Power supply device, charging method, electronic equipment, chip system and storage medium
By designing a power supply device in an electronic device that includes a preset voltage conversion unit and a controllable power supply interface, the problem of power loss of peripheral devices when charging is solved, extends the battery life of the device and prevents the loss of MCU abnormal information.
Patent Information
- Application Number
- CN202411198907.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-08-28
AI Technical Summary
When the electronic device is connected to the charger or the battery is sufficient, the peripheral device is prone to power down, resulting in short device battery life and loss of MCU abnormal information.
A power supply device is designed, including at least one first type voltage conversion unit, a register and two types of power supply interfaces. The parameters of the first type voltage conversion unit are preset by the register and are not controlled by the MCU. The second type voltage conversion unit is MCU control ensures that the peripheral device does not lose power while charging, and stops ineffective operation when the MCU is abnormal to reduce power consumption.
It effectively reduces the probability of power loss of peripheral devices, extends the battery life of electronic devices, and prevents the loss of MCU abnormal information.
Smart Images

Figure CN119298263A_ABST
Abstract
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 integrated circuits (ICs). A charger connected to an electronic device or a battery on the electronic device can supply power to a microcontroller unit (MCU) and peripheral devices on the electronic device through the IC. The peripheral devices can be display screens, motors, sensors, etc.
[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 embodiments of the present application provide 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 the 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 at the first type power supply interface. The second type power supply interface is connected to the power supply of the power supply device, and is used to output the system power supply voltage at the second type power supply interface. 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, and supply power to the second type electrical device. Among them, 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 the microcontroller unit MCU.
[0006] In this way, the parameters pre-set in the register for the first type of voltage conversion unit may be default values preset for the first type of voltage conversion unit. The MCU 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. In addition, the probability of power failure of peripheral devices such as the first type of electrical device is reduced when the electronic device is connected to the charger or the battery unit is fully charged. Among them, the electronic device may include a power supply device. The second type of power supply interface is connected to the power supply of the power supply device to realize the output of the system power supply voltage 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 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 further 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 may not lose power, thereby reducing the probability of power failure 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 buck circuit, or a boost circuit.
[0010] In this way, power supply for different first-type electrical devices with different operating voltages can be achieved.
[0011] In a possible implementation, the device further includes: a first charging unit. The first charging unit is used to convert the voltage output by the power supply into a system power supply voltage, and is also used 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 power supply voltage, and the first type voltage conversion unit can convert the system power supply voltage into the working voltage of the first type electrical device to power the first type electrical device. The first charging unit also outputs the system power supply voltage through the second type power supply interface to power the second type electrical device.
[0013] In a possible implementation, it 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 with a constant voltage, and the second charging unit is controlled to be 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 constant current charging stage uses the second charging unit for constant current charging, and the constant voltage charging stage uses the first charging unit for constant voltage charging, which can improve the charging efficiency of the electronic device.
[0015] In a possible implementation, it also includes: an integrated circuit bus IIC interface. The first mode parameter is configured in the register as follows: before constant current charging, a first indication from the MCU is received 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 of the multiple charging stages. The second mode parameter is configured in the register as follows: before constant voltage charging, a second indication from the MCU is received through the IIC interface, and the mode parameter in the register is modified to the second mode parameter.
[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 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 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, in 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, and the first charging unit does not charge the battery unit. In the constant voltage charging stage, the second charging unit is not enabled, and the first switch unit and the second switch unit are both 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 a 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 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.
[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. 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.
[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 a 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: obtain the second identifier associated with the first sub-function of the target function. When the state of the second identifier is a closed state, obtain the third identifier associated with the first sub-function, and the state of the second identifier is a closed state, indicating that the component for 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 an open state, by calling the second HAL layer interface corresponding to the first sub-function and the third identifier, operate the register to control the first charging unit or the second charging unit, and the state of the third identifier is an open state, indicating that the component for charging the battery unit includes the power supply device. Obtain the fourth identifier associated with the second sub-function of the target function. When the state of the fourth identifier is a closed state, obtain the third identifier associated with the second sub-function, and the state of the fourth identifier is a closed state, indicating that the component for charging the battery unit does not include the second charging chip, and the second charging chip is independent of the power supply device. When the state of the third identifier associated with the second sub-function is turned on, the register is operated by calling the third HAL layer interface corresponding to the second sub-function and the third identifier to control the second charging unit or the first charging unit. The target function is any one of 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, an embodiment of the present application provides a charging method, which is applied to an electronic device, and the electronic device includes a power supply device, a first charging chip, a second charging chip, and a battery cell in the first aspect or any possible implementation of the first aspect. The method includes: obtaining an identifier associated with a target sub-function of a target function, the identifier associated with the target sub-function is a first identifier, a fifth identifier, or a sixth identifier, the first identifier indicates that the component used to charge the battery cell is a power supply device, the fifth identifier indicates that the component used to charge the battery cell includes a first charging chip, and the sixth identifier indicates that the component used to charge the battery cell includes a second charging chip, and the first charging chip and the second charging chip are both independent of the power supply device. The target function is any one of multiple functions related to charging, and the target sub-function is any one of multiple sub-functions of the target function. In the case where 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. In the case where 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. In the case where 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, so as to implement the target sub-function.
[0026] In this way, the method flow provided in the embodiment of the present application can be compatible with the charging function of an electronic device including a power supply device, or a first charging chip and a second charging chip. That is, whether the charging component for charging the battery unit on the electronic device is a power supply device, or a first charging chip and a second charging chip, the target function can be achieved through the method or flow provided in the embodiment of the present application.
[0027] In a third aspect, an embodiment of the present application provides a charging method, which is applied to an electronic device, and the electronic device includes a power supply device, a first charging chip, a second charging chip, and a battery cell in the first aspect or any possible implementation of the first aspect. The method includes: obtaining a second identifier associated with the first sub-function of the target function. When the state of the second identifier is in an on state, the register of the first charging chip is operated by calling the sixth HAL layer interface corresponding to the first sub-function and the second identifier, and the state of the second identifier is in an on state, indicating that the component charging the battery cell includes the first charging chip. Obtain a third identifier associated with the first sub-function. When the state of the third identifier is in an off state, obtain a fourth identifier associated with the second sub-function of the target function, and the state of the third identifier is in an off state, indicating that the component charging the battery cell does not include the power supply device. When the state of the fourth identifier is in an on state, the register of the second charging chip is operated by calling the seventh HAL layer interface corresponding to the second sub-function and the fourth identifier to implement the target function, and the state of the fourth identifier is in an on state, indicating that the component charging the battery cell includes the second charging chip. Wherein, 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, an embodiment of the present application provides an electronic device, the electronic device comprising: 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 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. When the computer program runs 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.
[0032] In a seventh aspect, the present application provides a chip or a chip system, the chip or chip system comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is used 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 can be an input / output interface, a pin, or a circuit, etc.
[0033] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside 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 aspect 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 further circuit diagram of an electronic device provided in an embodiment of the present application;
[0038] Figure 4 A further circuit diagram 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] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0043] 1. Battery charging process
[0044] The battery may include a nickel-metal hydride battery, a lithium battery, a graphite battery, etc. Since lithium batteries have no memory effect, many handheld devices and many portable electronic devices are powered by lithium batteries.
[0045] Taking a lithium battery as an example, the battery charging process may 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 restore) a fully discharged battery. For example, when the battery voltage is less than 3 volts (V), a constant current of up to 0.1 coulomb (C) can be used to charge the battery.
[0048] The current unit C is the current rate when the battery is charged. 1C is equal to 1 ampere (A) multiplied by 1 second. C is a method of expressing the nominal capacity of the battery 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 current of the constant current charge 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 charge voltage. Threshold A can be 3V.
[0052] Stage 3: Constant voltage charging Stage 3 can be called the constant voltage charging stage.
[0053] When the battery voltage rises to threshold B, constant current charging ends and constant voltage charging begins. In the constant voltage charging stage, the charging voltage is constant and the charging current gradually decreases.
[0054] The threshold B may be referred to as a constant current charging threshold. The threshold B may also be referred to as a constant voltage charging voltage. The threshold B may 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 may be referred to as the charge termination phase.
[0057] When the charging current decreases to the threshold value Z, the charging is terminated. Alternatively, when the charging current decreases to the current range D, the charging is terminated. Alternatively, from the start of the constant voltage charging stage to the time when the preset time E is reached, the charging is terminated. It should be understood that the charging termination may mean that the battery is fully charged.
[0058] Among them, the threshold Z can be called the current threshold for charging to end. The current range D can be called the current range for charging to end. The threshold Z can be 0.01C or 0.02C. The 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. The 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 understandable 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 indicates that the battery is fully charged. The electronic device indicating that the battery is fully charged may be referred to as the electronic device indicating that the battery is fully charged.
[0061] 2. Field effect devices
[0062] Field effect devices may 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 of the field effect tube DS control.
[0063] Field effect transistors may include: junction FET (JFET) and metal-oxide semiconductor FET (MOSFET), wherein the metal-oxide semiconductor field effect transistor is also called MOS transistor.
[0064] According to the channel type of the field effect transistor, the field effect transistor can be divided into an N-type field effect transistor and a P-type field effect transistor. Taking the field effect transistor as a MOS tube as an example, the MOS tube can include an N-type MOS tube and a P-type MOS tube.
[0065] 3. Other terms
[0066] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0067] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0068] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" 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: A exists alone, A and B exist at the same time, and B exists 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" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0069] 4. Electronic equipment
[0070] The electronic device of the embodiment of the present application may include a handheld device with a charging function, a vehicle-mounted device, etc. For example, some electronic devices are: 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 (public landmobile networks). The embodiments of the present application do not limit this.
[0071] As an example but not 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 powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices 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 types of 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 that interconnects people and machines and things.
[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 an embodiment 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 a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or 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 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 circuit.
[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 , and may also be connected between the buck charging IC 102 and the battery cell 104 .
[0082] The peripheral device 107 can be connected between the buck charging IC 102 and the MCU 106 or the peripheral device. For example, LDO1 can be connected between the buck charging IC 102 and the MCU 106. LDO2 can be connected between the buck charging IC 102 and the peripheral device 1. LDO3 can be connected between the buck charging IC 102 and the peripheral device 2. LDO4 can be connected between the buck charging IC 102 and the peripheral device 3. The peripheral device N can be connected to the buck charging 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 a system power supply voltage (Vsys).
[0086] The external LDO 105 can convert the Vsys transmitted by the buck charging IC 102 into the power supply voltage of the MCU 106 or the power supply voltage of the peripheral device. For example, LDO1 can convert the system power supply voltage (Vsys) transmitted by the buck charging IC 102 into the power supply voltage of the MCU 106. LDO2 can convert the Vsys transmitted by the buck charging IC 102 into the power supply voltage of the peripheral device 1. LDO3 can convert the Vsys transmitted by the buck charging IC 102 into the power supply voltage of the peripheral device 2. LDO4 can convert the Vsys transmitted by the buck charging IC 102 into the power supply voltage of the 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] MCU 106 can control the opening or closing of external LDO 105. For example, MCU 106 can transmit GPIO to LDO2, LDO3 and LDO4 through a GPIO interface including GPIO pins to control LDO2, LDO3 and LDO4.
[0089] For example, taking the eMMC as an example, 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 can include the MCU 106 starting, resetting or restarting.
[0090] When the MCU is working, LDO2 is in the on state or enabled state. LDO2 in the on state or enabled state can supply power to the eMMC, and the eMMC can work normally. However, if the MCU fails or is abnormal, it will cause the MCU to reset, and the MCU reset will restore the GPIO interface to the GPIO interface state before initialization. The GPIO interface state before initialization, for example, the state in which the GPIO interface does not transmit the level of turning on LDO2 to LDO2, that is, the GPIO interface state before initialization can cause LDO2 to be in the off state or disabled state. It should be understood that LDO2 in the off state or disabled state will not supply power to the eMMC, causing the eMMC to lose power or fail to work.
[0091] When the MCU changes from a working state to an abnormal state, the abnormality of the MCU 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 situation where the peripheral device loses power.
[0092] The MCU abnormality causes the eMMC to lose power, so that the eMMC cannot save the information causing the MCU abnormality or the abnormal state information of the MCU. This will affect the processing or location of the MCU abnormality by the electronic equipment or MCU technicians. The information causing the MCU abnormality and / or the abnormal state information of the MCU can be called the abnormal information of the MCU.
[0093] In view of this, an embodiment of the present application provides a power supply device, which can be applied to electronic equipment, and 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 a charger or a battery unit of the power supply device to transmit the system power supply voltage (Vsys) to an 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 performed 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 operated according to 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 schematic 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 power meter 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 the embodiment.
[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 outputted 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. Exemplarily, the first type power device may be a peripheral device 107 whose power supply is not controlled by the MCU 207, for example, a peripheral device 1 (such as an eMMC) or a peripheral device 2.
[0105] Among them, the activation of the first type voltage conversion unit 203, the voltage output of the first type voltage conversion unit 203 and the closure of the first type voltage conversion unit 203 are all executed 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 the working voltage of the second type electrical device to supply power to the second type electrical device. The second type 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 of the MCU 207. LDO1 , to power the MCU 207. The second type voltage conversion unit 2 can output the working voltage V of the peripheral device 3. LDO4 , to power peripheral device 3.
[0110] Exemplarily, the second type of electrical device may be a peripheral device 107 whose power supply is controlled by the MCU 207, for example, the peripheral device 3. The activation of the second type voltage conversion unit 206 (such as the second type voltage conversion unit 2) and the deactivation of the second type voltage conversion unit 206 (such as the second type voltage conversion unit 2) may both be controlled by the MCU 207.
[0111] Take the case where the peripheral device 3 is a speed sensor as an example. When the MCU 207 is abnormal, the MCU 207 cannot receive the information transmitted by the speed sensor, nor can it process the information transmitted by the speed sensor. The transmission of information by the speed sensor to the MCU 207 is invalid. Therefore, when the MCU 207 is abnormal, the MCU 207 is reset to power off the speed sensor, so as to control the speed sensor to stop working, which can reduce the power consumption generated by the invalid operation of the speed sensor, and further reduce the probability of the occurrence of a short battery life of the electronic device.
[0112] The fuel gauge 103 may be connected between the charging device and the battery unit 104. The power supply device may charge the battery unit 104. The fuel gauge 103 may monitor the voltage transmitted from the power supply device to the battery unit 104 to achieve charging management. The fuel gauge may also monitor the voltage output by the battery unit 104 to achieve 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. Thereby reducing 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 to realize the output of the system power supply voltage 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, if 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 power supply voltage, and the first type voltage conversion unit can convert the system power supply voltage into the working voltage of the first type electrical device to power the first type electrical device. The first charging unit also outputs the system power supply voltage through the second type power supply interface to power the second type electrical device.
[0120] Alternatively, if 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 working voltage of the first type electrical device, thereby supplying 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] Exemplarily, the first charging unit 205 may be a buck charging unit. The second charging unit 201 may be a switched capacitor (SC) charging unit. The switched capacitor (SC) charging unit may be, for example, a charge pump with an input power: output power ratio of 2:1 (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 constant current charging of the second charging unit is used in the constant current charging stage, and the constant voltage charging of the first charging unit is used in the constant voltage charging stage, which can improve the charging efficiency of the electronic device. 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, if 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 may be configured in the register as follows: before constant current charging, a first instruction from the MCU is received 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 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 indication or the second indication 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 can be understood 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, if 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 An 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 example that the power supply may include a charger or a battery unit, the power bus interface may 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 can be used to transmit the voltage output by the battery unit to the first charging unit 205 .
[0137] The first mode parameter may be used to indicate that the first switch unit 202 is controlled to be in an on state, and the second switch unit 204 is controlled to be in an off state.
[0138] The second mode parameter may be used to indicate that both the first switch unit 202 and the second switch unit 204 are controlled to be in the on state.
[0139] The fuel gauge 103 may be connected between the battery voltage interface and the battery cell 104 .
[0140] In this way, in 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, and the first charging unit does not charge the battery unit 104. In the constant voltage charging stage, the second charging unit is not enabled, and the first switch unit and the second switch unit are both 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 104.
[0141] It is understandable that when the electronic device is not connected to an external device such as a charger, the MCU or the power supply device can control the first switch unit to be in an off state and control the second switch unit to be in an on state. The battery unit can transmit the voltage output by the battery unit to the first charging unit and the first type voltage conversion unit respectively to realize power supply to the peripheral 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 of electrical device.
[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 schematic 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, and can also be constructed by other switch devices that can realize the conduction or disconnection of the circuit. The first switch unit 202, for example, M1. The second switch unit 204, 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 a boost circuit 302, one end of an LDO3 and one end of an LDO2 are respectively connected between a first inductor L1 and a 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 voltage conversion unit 2, for example, LDO 4. The second type voltage conversion unit 2 can transmit V to the peripheral device 3. LDO4 .
[0154] It should be understood that the first inductor L1 and the first capacitor C1 may constitute a buck circuit. The first charging unit 205 may include a buck circuit.
[0155] like Figure 3 The specific implementation principle and technical effect of the embodiment shown are Figure 2 The specific implementation principles and technical effects of the embodiments shown are similar and will not be described in detail here. Figure 3 As shown, the power supply device can be an integrated charging IC. Compared with some electronic devices deployed with SC charging chips and buck charging chips, the number of chips used for charging on the electronic device deployed with only integrated charging ICs is smaller, so that the electronic device deployed with only integrated charging ICs has more hardware layout margin and can also save the chip cost of the electronic device.
[0156] It is understandable that when the electronic device has an SC charging chip and a buck charging chip, and / or a power supply device, the electronic device has multiple functions related to charging. 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 scenarios for deploying charging components on electronic devices may include the following scenarios 1, 2, or 3:
[0158] Scenario 1: The electronic device includes a power supply device.
[0159] Scenario 2: The electronic device includes a power supply device, an SC charging chip and a buck charging chip.
[0160] Scenario 3: 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 may include a power supply device, an SC charging chip and / or a buck charging chip. For scenario 1, please refer to Figure 2-Figure 3 . For scenario three, please refer to Figure 1 For scenario 2, please refer to Figure 4 SC charging chip can be called SC charging IC. Buck charging chip can be called buck charging IC.
[0162] Figure 4 Another circuit schematic diagram of an electronic device provided in 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 is also connected 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 buck charging IC 102 in the embodiment. The second charging chip 402 may be an SC charging chip. The 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. In 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 not to charge the battery cell 104. In 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 program and software architecture that is compatible with 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, the target function may be any one of trickle charging, constant current charging, constant voltage charging, charging 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. An application program, for example, a charging application. The charging application may include a module corresponding to each of a plurality of charging functions related to charging.
[0171] For example, taking the case where multiple charging functions related to charging include 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. Among them, 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 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 a 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 a constant voltage, or to control the first charging chip to charge the battery cell at a 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 HAL layer interface by calling the middle 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, the middle layer interface 11 and the middle layer interface 10 are both middle layer interfaces corresponding to the functional module 1. The middle layer interface 21 and the middle layer interface 20 are both middle layer interfaces corresponding to the functional module 2. The middle layer interface 31 and the middle layer interface 30 are both middle layer interfaces corresponding to the functional module 3. The middle layer interface 41 and the middle layer interface 40 are both middle layer interfaces corresponding to the functional module 4. The middle layer interface 50 is a middle layer interface corresponding to the 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 , HAL layer interface 10 , HAL layer interface 21 , HAL layer interface 20 , HAL layer interface 31 , HAL layer interface 30 , HAL layer interface 41 , HAL layer interface 40 and HAL layer interface 50 are shown.
[0179] 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 correspond one to one 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 middle layer interface 11 corresponds to the HAL layer interface 11. The middle layer interface 10 corresponds to the HAL layer interface 10. The middle layer interface 21 corresponds to the HAL layer interface 21.
[0180] The driver layer can configure or operate the register of the charging chip or the register of the power supply device to realize the control of the charging chip or the power supply device. The charging chip is such as the first charging chip and / or the second charging chip. The register is operated, for example, reading, writing or modifying the parameters in the register.
[0181] The driver layer may include a first charging chip driver, a second charging chip driver, and an integrated charging IC driver. The first charging chip driver, the second charging chip driver, and the integrated charging IC driver may each 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 realize the target function.
[0187] Exemplarily, the target function of the electronic device may be implemented by the methods shown in S101-S103, the methods shown in S101-S102, or the methods 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 a first identifier, a fifth identifier, or a 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 can be understood 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 mark indicates that the component for charging the battery unit includes a first charging chip, and the sixth mark indicates that the component for charging the battery unit 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. The following describes S101 and S103 in conjunction with the process shown in S301-S304.
[0197] For example, the target function is charging function 1, and charging function 1 includes a first sub-function and a second sub-function, and the first sub-function can be a function of controlling the first charging chip (or the first charging unit) not to charge the battery cell, and the second sub-function can be a function of controlling the second charging chip (or the 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 for indicating the attributes of the charging component is, for example, the first identifier, the fifth identifier, or the sixth identifier.
[0198] For scenario 1 or scenario 2, the first identifier may be preset in both the functional module 1 and the functional module 2, and the charging function 1 may be implemented through the process (or method) shown in S201-S204:
[0199] S201, obtaining an identifier for indicating the attribute of a charging component in the functional module 1, and identifying that the identifier for indicating the attribute of a 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, calling the function module 1 and the intermediate layer interface 10 corresponding to the first identifier, and the HAL layer interface 10 corresponding to the intermediate layer interface 10, and operating 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 not to charge the battery unit.
[0202] S203: Acquire an identifier in the functional module 2 for indicating the attribute of the charging component, and identify that the identifier in the functional module 2 for indicating the attribute of the charging component is a first identifier.
[0203] S204, calling the function module 2 and the intermediate layer interface 20 corresponding to the first identifier, and the HAL layer interface 20 corresponding to the intermediate layer interface 20, and operating 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 the intermediate layer interface 10 and the intermediate layer interface 20 both belong to the first intermediate layer interface. The HAL layer interface 10 and the HAL layer interface 20 both belong to the first HAL layer interface. The intermediate layer interface 10 is the intermediate layer interface corresponding to the first sub-function and the first identifier. The 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, a fifth identifier may be preset in the function module 1 and a sixth identifier may be preset in the function module 2, and the charging function 1 may be implemented through the process (or method) shown in S301-S304:
[0206] S301, obtaining an identifier for indicating the attribute of a charging component in the functional module 1, and identifying that the identifier for indicating the attribute of a charging component in the functional module 1 is a fifth identifier.
[0207] S302, calling the function module 1 and the intermediate layer interface 11 corresponding to the fifth identifier, and the HAL layer interface 11 corresponding to the intermediate layer interface 11, and operating the register of the first charging chip (i.e., buck charging IC) through the first charging chip driver to implement the first sub-function, for example, to control the first charging chip not to charge the battery unit.
[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, calling the function module 2 and the intermediate layer interface 21 corresponding to the sixth identifier, and the HAL layer interface 21 corresponding to the intermediate layer interface 21, and operating the register 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 unit.
[0210] It should be understood that the intermediate layer interface 11 belongs to the second intermediate layer interface. The HAL layer interface 11 belongs to the fourth HAL layer interface. The intermediate layer interface 21 belongs to the third intermediate layer interface. The HAL layer interface 21 belongs to the fifth HAL layer interface. The intermediate layer interface 11 is the intermediate layer interface corresponding to the first sub-function and the fifth identifier. The intermediate layer interface 21 is the intermediate layer interface corresponding to the second sub-function and the sixth identifier.
[0211] It can be understood that in scenario one, the identifier associated with the target sub-function of the target function is the first identifier. The target function of the electronic device can be obtained in the following manner: obtaining the first identifier associated with the target sub-function. 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, operating 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 program 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 in which the charging component is 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, but only needs to call the packaged intermediate layer interface. Figure 5In the charging application shown, a set of codes included in functional module 1 can be used to control the first charging chip or the first charging unit, and a set of codes included in functional module 2 can be used to control the second charging chip or the second charging unit. While improving the readability of the code, it is also possible to save code space and reduce code redundancy. 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 Another software architecture diagram 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 the charging function 1 include: functional module 11, functional module 21, functional module 10 and functional module 20. Among them, the function implemented by the functional module 11 can be the same as the function implemented by the functional module 10. The function implemented by the functional module 21 can be the same as the function implemented by the functional module 20.
[0217] The functional modules corresponding to the charging function 2 include: functional module 31, functional module 41, functional module 30 and functional module 40. The function implemented by the functional module 31 may be the same as the function implemented by the functional module 30. The function implemented by the functional module 41 may be the same as the function implemented by the 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 attributes of the charging component 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. An identifier for indicating the attributes of the charging component, such as a second identifier, a third identifier, or a fourth identifier.
[0219] Figure 6 and Figure 5 The difference is that Figure 6 The code contained in the functional module is the same as Figure 5The codes contained in the functional modules may be different. Exemplarily, 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 a constant voltage. The charging function or code contained in the functional module 11 can be used to implement disabling the control of the second charging chip. The charging function or code contained in the functional module 21 can be used to implement controlling the first charging chip to charge the battery cell at a constant voltage. The charging function or code contained in the functional module 10 can be used to implement disabling the control of the second charging unit. The charging function or code contained in the functional module 20 can be used to implement controlling the first charging unit to charge the battery cell at a 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. Exemplarily, 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 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 modules 10 and 20 can each also 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: Acquire 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 there is a first charging unit with an integrated charging IC on the electronic device.
[0229] S703, obtaining a third identifier associated with the first sub-function to determine whether there is a first charging unit of the integrated charging IC on the electronic device or whether a preset charging component on the electronic device includes the first charging unit of the integrated charging IC. The state of the second identifier is an off state, indicating 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 the off state, the third identifier in the functional module 10 can be acquired and the state of the third identifier can be identified.
[0232] The state of the third identification is an on state, which may indicate that an integrated charging IC exists 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 identification 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 the integrated charging IC.
[0234] If the state of the third identifier associated with the first sub-function is turned on, it means that there is a first charging unit with an integrated charging IC on the electronic device, or the preset charging component on 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 not to charge the battery unit.
[0235] S704: When the state of the third identifier associated with the first sub-function is in the on state, the register of the integrated charging IC is operated by calling the second HAL layer interface corresponding to the first sub-function and the third identifier to control the first charging unit. The on state of the third identifier indicates that the component for charging 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 may 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 there is a second charging unit with an integrated charging IC on the electronic device or determine 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 is the off state, indicating 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 a third identifier in the functional module 20 .
[0245] When the state of the fourth identifier is the off state, the third identifier in the functional module 20 can be acquired and the state of the third identifier can 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 turned 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 may 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, when the charging component preset on the electronic device is a power supply device, the target function can be achieved.
[0252] For scenario 2 or scenario 3, the charging components preset on the electronic device include a first charging chip and a second charging chip, that is, the first charging chip and the second charging chip are used to charge the battery unit, and the power supply device is not used to charge the battery unit. Figure 7 As shown, still taking the power supply device as an integrated charging IC as an example, the target function of the electronic device can be achieved through the processes shown in S701-S703, S705-S706:
[0253] S701: Acquire 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.
[0254] Exemplarily, the second identifier in the functional module 11 is acquired, and the state of the second identifier is identified.
[0255] If the state of the second identifier is on, it may indicate that there is a first charging chip on the electronic device, or the preset charging component on the electronic device includes the first charging chip, and S702 may be executed to control the first charging chip, thereby achieving the target function.
[0256] S702: When the state of the second identifier is turned on, the register of the first charging chip is operated by calling the sixth HAL layer interface corresponding to the first sub-function and the second identifier. The first sub-function is implemented, for example, the first charging chip is controlled not to charge the battery cell. The state of the second identifier being turned on may indicate that the component for charging the battery cell includes the first charging chip.
[0257] Exemplarily, when the target function is charging function 1 and the second identifier is an identifier in function module 11, the sixth HAL layer interface corresponding to the first sub-function and the second identifier may be the HAL layer interface 11 corresponding to function module 11. It should be understood that the sixth HAL layer interface belongs to the HAL layer interface corresponding to the target function and the first charging chip.
[0258] When the state of the second flag is on, the HAL layer interface 11 can be called to drive the first charging chip of the driving layer to operate the register of the first charging chip to control the first charging chip not to charge the battery unit.
[0259] S703: Obtain a third identifier associated with the first sub-function to determine whether there is a first charging unit of an integrated charging IC on the electronic device or whether a preset charging component on the electronic device includes the first charging unit of an integrated charging IC.
[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, obtaining 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 the preset charging component on the electronic device includes the second charging chip. The state of the third identifier is an off state, indicating that the component charging the battery unit does not include a power supply device.
[0263] Exemplarily, the fourth identifier associated with the second sub-function may be the fourth identifier in the functional module 21. When the state of the third identifier associated with the first sub-function is off, the fourth identifier in the functional module 21 may be acquired and the state of the fourth identifier may be identified.
[0264] If the state of the fourth identifier is on, it means 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, and S706 can be executed to control the second charging chip to achieve the target function.
[0265] S706: When the state of the fourth identifier is turned 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 second sub-function, such as controlling the second charging chip to charge the battery cell, thereby implementing the target function. The state of the fourth identifier is turned on, indicating that the component that charges the battery cell includes the second charging chip.
[0266] Exemplarily, when the target function is charging function 1 and the fourth identifier is an identifier in the functional module 21, the seventh HAL layer interface corresponding to the second sub-function and the fourth identifier may be the HAL layer interface 21 corresponding to the 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 state of the fourth flag is the on state, the HAL layer interface 21 can be called, and the register of the second charging chip can be operated through the second charging chip driver 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 a first charging chip and a second charging chip, the target function can be achieved.
[0269] It can be understood 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 an identifier in the function module to indicate the attributes of the charging components to achieve control of different charging components. Figure 7 The process shown, Figure 6 The application program 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, no matter the scenario in which the charging component is deployed on the electronic device is scenario 1, scenario 2 or scenario 3, the electronic device can use 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 a first macro, the second identifier can be a second macro, the third identifier can be a third macro, the fourth identifier can be a fourth macro, the fifth identifier can be a fifth macro, and the sixth identifier can be a sixth macro. In the case where the identifier is 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 the first identifier and the third identifier in the embodiment of the present application 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 subject 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, which is applied to an electronic device, and the electronic device may include the power supply device, the first charging chip, the second charging chip and the battery unit. The charging method may include S101-S103, and its specific implementation principle and technical effect are not repeated here.
[0275] The present application also provides a charging method, which is applied to an electronic device, and the electronic device may include the above-mentioned power supply device, the first charging chip, the second charging chip and the battery unit. The charging method may include S701-S703, S705-S706, and its specific implementation principle and technical effect are not repeated here.
[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, and the device for executing the above method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the related device or electronic device provided by the embodiment of the present application can execute 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, and the specific device form of the terminal devices can refer to the above related descriptions, which 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 executes the above method.
[0281] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0282] The 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 used to run a computer program or instruction to execute 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. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function 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, a computer readable medium 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 that is intended to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer readable medium. For example, if the 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 technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and optical disk as used herein include optical disk, laser disk, optical disk, digital versatile disk (DVD), floppy disk and Blu-ray disk, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in 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 generate 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 processes in the flowchart and / or block diagram. 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 purpose, 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 substitutions, 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, and at least one second type power supply interface; Any one of the first-type power supply interfaces is connected to any one of the first-type voltage conversion units, and is used to output the output voltage of the first-type voltage conversion unit at the first-type power supply interface; The second type power supply interface is connected to the power supply of the power supply device, and is used to output the system power supply voltage at the second type power supply interface; 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 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.
2. The power supply device according to claim 1, characterized in that: The parameters pre-set in the register for the first type of voltage conversion unit remain unchanged when the MCU is started, restarted and running.
3. The power supply device according to claim 1 or 2, characterized in that: The first type voltage conversion unit includes a low dropout linear regulator LDO, a buck circuit or a boost circuit.
4. The power supply device according to any one of claims 1 to 3, characterized in that: Also includes: a first charging unit; The first charging unit is used to convert the voltage output by the power supply into a system power supply voltage, and is also used to charge the battery 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 second-type power supply interface is connected to the first charging unit.
5. The power supply device according to claim 4, characterized in that: Also includes: 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.
6. The power supply device according to claim 5, characterized in that: Also includes: Integrated circuit bus IIC interface; The first mode parameter is configured in the register as follows: before the constant current charging, a first indication from the MCU is received 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 in multiple stages of charging; 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.
7. The power supply device according to claim 5 or 6, characterized in that: It also includes: a power bus interface, a battery voltage interface, a first 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 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 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.
8. The power supply device according to claim 7, characterized in that: The first charging unit includes: a first inductor and a first capacitor; One end of the first inductor is connected to the first 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.
9. The power supply device according to any one of claims 1 to 8, characterized in that: The power supply device comprises a first charging unit and a second charging unit, both of which are used to charge the battery unit; the power supply device realizes 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; 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.
10. The power supply device according to any one of claims 1 to 8, characterized in that: The power supply device comprises a first charging unit and a second charging unit, both of which are used to charge the battery unit; the power supply device realizes the target function in the following manner: Obtaining a second identifier associated with a first sub-function of the target function; When the state of the second identifier is an off state, obtaining a third identifier associated with the first sub-function, the state of the second identifier being an off state indicates that the component for charging the battery unit does not include the first charging chip, and the first charging chip is independent of the power supply device; In the case where 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 is in the on state, indicating 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 an off state, obtaining the third identifier associated with the second sub-function, the state of the fourth identifier being an off state indicates that the component for charging the battery unit does not include the second charging chip, and the second charging chip is independent of the power supply device; When the state of the third identifier associated with the second sub-function is in the on state, the register is operated by calling the third HAL layer interface corresponding to the second sub-function and the third identifier to control the second charging unit or the first charging unit; The target function is any one of a plurality of functions related to charging.
11. A charging method, characterized in that: Applied to an electronic device, the electronic device comprising a power supply device as described in any one of claims 1 to 10, a first charging chip, a second charging chip and a battery unit; the method comprising: Obtaining an identifier associated with a target sub-function of a target function, wherein the identifier associated with the target sub-function is a first identifier, a fifth identifier, or a sixth identifier, wherein the first identifier indicates that the component used to charge the battery cell is the power supply device, the fifth identifier indicates that the component used to charge the battery cell includes a first charging chip, and the sixth identifier indicates that the component used to charge the battery cell includes a second charging chip, 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 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, 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; In a case where 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.
12. A charging method, characterized in that: Applied to an electronic device, the electronic device comprising a power supply device as described in any one of claims 1 to 10, a first charging chip, a second charging chip and a battery unit; the method comprising: Obtain a second identifier associated with a first sub-function of the target function; In the case where the state of the second identifier is in the on state, the register of the first charging chip is operated by calling the first sub-function and the sixth HAL layer interface corresponding to the second identifier, and the state of the second identifier is in the on state, indicating 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 state of the third identifier is an off state indicating that the component for charging the battery unit does not include the power supply device; In the case where the state of the fourth identifier is in the on state, the register of the second charging chip is operated by calling the second sub-function and the seventh HAL layer interface corresponding to the fourth identifier to implement the target function, and the state of the fourth identifier is in the on state, 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.
13. An electronic device, characterized in that: The electronic device comprises: 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 comprises computer instructions, and the one or more processors call the computer instructions so that the electronic device executes the method as claimed in claim 11 or 12.
14. 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 11 or 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to claim 11 or 12.
16. A computer program product, characterized in that The computer program product comprises a computer program code, and when the computer program code is run on an electronic device, the electronic device is caused to perform the method according to claim 11 or 12.
Citation Information
Patent Citations
Electronic equipment and power supply control device thereof
CN106712461A
Abnormal power-down SOC protection method for BMS system
CN106872908A
Power supply chip, power supply and electric energy providing method
CN108205371A
Battery management chip
CN116488276A
Power-down holding circuit
CN209593090U
Cited By
Power supply apparatus, charging method, electronic device, chip system and storage medium
WO2026045374A1