A dc power supply and dual battery automatic switching control system and method

CN122969185APending Publication Date: 2026-10-23SHENZHEN XUNDUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611397621.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-09
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

这类方案存在明显不足:切换逻辑固定,无法根据电池剩余电量、用户偏好或应用场景进行灵活调整,当DC电源电压在阈值附近波动时,容易产生频繁的切换振荡

Benefits of technology

[0019]相较于现有技术,本发明的一种DC电源和双电池自动切换控制系统及方法,通过控制模块内部的纯硬件实现的固定优先级切换逻辑电,实时监测三路电源的电压状态,按照DC电源>主电池>副电池的固定优先级进行仲裁。当当前供电电源电压异常或失去时,控制模块在微秒级时间内自动切换至下一个优先级有效的电源,配合后端的储能电容,负载电压在切换过程中保持连续,后端负载完全无感知,实现了真正意义上的无缝不掉电切换,有效避免了因电源切换导致的数据丢失或工作中断。严格按照DC电源>主电池>副电池的优先级顺序供电,优先使用外部DC电源,延长了电池的使用寿命,同时在DC断开时优先使用主电池,保证了关键任务供电的连续性和稳定性,供电逻辑清晰、可预期。支持用户在系统不关机的情况下随时插拔主电池BAT1或副电池BAT2。当电池被拔出时,控制模块在微秒级时间内自动切换至另一个有效的电源,随后嵌入式控制器检测到电池拔出并将对应通路的前级MOS管关断,整个过程系统运行不受影响,极大提升了设备使用的灵活性与续航连续性。每路电源均设有独立的欠压/过压检测电路,确保只有电压在安全范围内的电源才能接入系统。当输入电压低于欠压阈值或高于过压阈值时,该路被视为无效,不会被选为供电来源,有效防止了电池异常或适配器故障损坏设备,提高了系统的安全性。硬件控制模块负责微秒级的无缝切换与固定优先级仲裁,确保切换的实时性和可靠性,EC软件负责电池电量监测、阈值判断和软件策略执行,并通过拉低GPIO主动关断电池通路,实现灵活的电源管理策略。两者协同工作,既保证了切换不掉电,又提供了灵活的电源管理能力。同时,硬件优先级与GPIO默认常开的机制作为最终保障,即使在EC软件异常或死机的情况下,系统仍能保持供电和基本切换功能,显著提高了系统的鲁棒性。系统在关机状态下,嵌入式控制器未上电,GPIO引脚处于高阻态,自锁电路关断,所有MOS管均关断,没有任何静态电流消耗,实现了真正的零功耗待机。通过自锁电路与EC软件的配合,实现了按键触发的一键开机,操作简便,用户体验良好。主要采用MOS管、控制模块和嵌入式控制器实现,元器件数量少,电路结构简洁,无需复杂的机械检测元件(如霍尔传感器、弹簧针等),成本可控,便于集成于各类便携设备的主板中,具有良好的产业应用前景。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122969185A_ABST
    Figure CN122969185A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of DC power supply and double battery automatic switching control system and method.System includes DC power supply interface, main battery interface, secondary battery interface, three groups of MOS tube, control module, embedded controller and self-locking circuit, control module is built-in fixed priority switching logic, for monitoring the effectiveness of each power supply and select current power supply according to priority, when current power supply fails, microsecond level switches to the next priority effective power supply, seamless switching is realized, embedded controller is used to detect battery in-place state and remaining power, and according to software strategy, the corresponding battery path is turned off, self-locking circuit is turned on when triggered, battery path is powered on for embedded controller, and after trigger stops, it is controlled by embedded controller, the present application has the reliability of hardware level fast switching and the flexible power management capability of software level, supports battery hot plug, and system is zero power consumption in shutdown state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power management technology, and in particular to a DC power supply and a dual-battery automatic switching control system and method. Background Technology

[0002] With the widespread application of portable electronic devices, mobile terminals, and industrial control equipment, the continuity and reliability of power supply systems have become key indicators affecting equipment performance. In scenarios such as field operations, emergency rescue, and long-term data acquisition, equipment often needs to complete battery replacement or power switching without interrupting operation. Therefore, multi-power automatic switching control technology has received increasing attention.

[0003] Currently, multi-power supply switching control schemes can be mainly divided into the following categories: The first type is a purely hardware-based automatic switching solution. This type of solution typically uses voltage comparators, analog switches, or dedicated power management chips to automatically select from multiple power sources. This type of solution has significant drawbacks: the switching logic is fixed and cannot be flexibly adjusted based on remaining battery power, user preferences, or application scenarios; and frequent switching oscillations can easily occur when the DC power supply voltage fluctuates around a threshold.

[0004] The second category is software-centralized control schemes. These schemes use an embedded controller (EC) as their core, reading voltage, current, and battery level information from each power source via ADC sampling or I2C / SMBus bus. Software algorithms then determine the appropriate information and output control signals to drive MOSFETs or relays to complete the switching process. For example, existing technology discloses a scheme where an MCU reads the voltage of two batteries via I2C and directly controls the gate signal to drive the MOSFET for switching. While this type of scheme offers some flexibility, the software must directly participate in the arbitration of each switching operation. The switching speed is limited by the EC's sampling period and program execution time, typically in the millisecond range or even slower. If the EC software malfunctions, crashes, or experiences a response delay, it will directly lead to system power loss or power interruption, making reliability difficult to guarantee.

[0005] The third category is assisted switching schemes that combine hardware logic with external detection elements. Existing technologies disclose schemes that use semiconductor devices to build hardware logic circuits and combine them with external Hall effect sensors or spring pins to detect the battery's presence status to assist in switching. While this type of scheme can achieve automatic switching to a certain extent, it has the following drawbacks: it requires additional mechanical detection elements such as Hall sensors, magnets, or spring pins, increasing hardware costs and assembly complexity; Hall effect sensors are susceptible to interference from external magnetic fields and require high precision in their installation position; software development is labor-intensive, and actual user operation is relatively cumbersome.

[0006] Furthermore, regarding power consumption during shutdown, most existing solutions suffer from static leakage current, making it difficult to achieve true zero-power standby. While some solutions reduce standby current by disconnecting relays or having the main control unit enter a low-power mode, relays are bulky and have limited lifespans, and the low-power standby of the main control unit still consumes some static current, with complex wake-up mechanisms.

[0007] In summary, existing technologies lack a power management solution that can achieve microsecond-level rapid and seamless switching, ensure high reliability, support flexible software intervention, and simultaneously achieve zero power consumption during shutdown, hot-swappable batteries, and automatic adaptation of multiple battery cells. Therefore, it is necessary to provide a power supply and battery automatic switching control system and method to solve the aforementioned technical problems. Summary of the Invention

[0008] The present invention aims to solve the above-mentioned problems existing in the prior art and provide a DC power supply and dual battery automatic switching control system and method.

[0009] On one hand, the present invention provides a DC power supply and dual-battery automatic switching control system, comprising: a DC power interface for connecting to a DC power supply, a main battery interface for connecting to a main battery, a secondary battery interface for connecting to a secondary battery, a control module, a system load power supply terminal, a first MOSFET group, a second MOSFET group, a third MOSFET group, an embedded controller, and a self-locking circuit, wherein... The first MOSFET group is connected between the DC power interface and the system load power supply terminal. The path containing the DC power interface, the first MOSFET group and the system load power supply terminal is the DC power path. The first MOSFET group includes a first front-stage MOSFET and a first rear-stage MOSFET connected in series. The second MOSFET group is connected between the main battery interface and the system load power supply terminal. The main battery path is the main battery path, and the second MOSFET group includes a second front-stage MOSFET and a second rear-stage MOSFET connected in series. The third MOSFET group is connected between the secondary battery interface and the system load power supply terminal. The path containing the secondary battery interface, the third MOSFET group and the system load power supply terminal is the secondary battery path. The third MOSFET group includes a third front-stage MOSFET and a third rear-stage MOSFET connected in series. The control module is connected to the first MOSFET group, the second MOSFET group, the third MOSFET group and the system load power supply terminal. The control module includes a fixed priority switching logic circuit. The fixed priority order is DC power supply > main battery > auxiliary battery. The control module is used to monitor the validity of the output voltage of the DC power supply interface, the main battery interface and the auxiliary battery interface, and select the current power supply according to the fixed priority. When the current power supply fails, the control module switches to the next priority valid power supply. The embedded controller includes a main battery path control terminal connected to the second front-stage MOSFET and a secondary battery path control terminal connected to the third front-stage MOSFET. The embedded controller is also connected to the main battery interface and the secondary battery interface to detect the presence status and remaining battery capacity of the main battery and the secondary battery, and to turn on or off the second front-stage MOSFET and the third front-stage MOSFET according to the detection results. The self-locking circuit includes a first self-locking output terminal connected to the main battery path control terminal and a second self-locking output terminal connected to the secondary battery path control terminal. When the self-locking circuit receives a power-on trigger signal, it pulls the main battery path control terminal and the secondary battery path control terminal high to turn on the second and third pre-stage MOSFETs. After the trigger stops, the self-locking circuit stops outputting a high level to the main battery path control terminal and the secondary battery path control terminal. The state of the main battery path control terminal and the secondary battery path control terminal is maintained by the high level output by the embedded controller itself.

[0010] Furthermore, the DC power interface is connected to the gate of the first pre-stage MOSFET, the main battery path control terminal is connected to the gate of the second pre-stage MOSFET, the auxiliary battery path control terminal is connected to the gate of the third pre-stage MOSFET, the parasitic body diode inside the first pre-stage MOSFET is connected in reverse series with the parasitic body diode inside the first post-stage MOSFET, the parasitic body diode inside the second pre-stage MOSFET is connected in reverse series with the parasitic body diode inside the second post-stage MOSFET, and the parasitic body diode inside the third pre-stage MOSFET is connected in reverse series with the parasitic body diode inside the third post-stage MOSFET.

[0011] Furthermore, the control module also includes a first undervoltage / overvoltage detection circuit, a second undervoltage / overvoltage detection circuit, a third undervoltage / overvoltage detection circuit, a first drive signal output terminal, a second drive signal output terminal, and a third drive signal output terminal. The first undervoltage / overvoltage detection circuit is connected to the source of the first pre-stage MOSFET, the second undervoltage / overvoltage detection circuit is connected to the source of the second pre-stage MOSFET, and the third undervoltage / overvoltage detection circuit is connected to the source of the third pre-stage MOSFET. The first drive signal output terminal is connected to the gate of the first post-stage MOSFET, the second drive signal output terminal is connected to the gate of the second post-stage MOSFET, and the third drive signal output terminal is connected to the gate of the third post-stage MOSFET. Based on the output states of the first, second, and third undervoltage / overvoltage detection circuits and according to a fixed priority, the control module enables the drive signal corresponding to the highest priority path among the DC power supply path, main battery path, and secondary path, and disables the remaining drive signals, thereby turning on one of the corresponding first, second, and third post-stage MOSFETs.

[0012] Furthermore, the embedded controller also includes a main battery access detection terminal connected to the main battery interface and a secondary battery access detection terminal connected to the secondary battery interface. When the embedded controller detects that the main battery or secondary battery has been removed, it immediately sets the corresponding main battery path control terminal or secondary battery path control terminal to a low level and turns off the corresponding second or third pre-stage MOSFET. In the power-off state, the embedded controller sets the main battery path control terminal and the secondary battery path control terminal low, the control module has no drive signal output, and the first pre-stage MOSFET, the first post-stage MOSFET, the second pre-stage MOSFET, the second post-stage MOSFET, the third pre-stage MOSFET, and the third post-stage MOSFET are turned off.

[0013] Furthermore, a step-down circuit is connected between the embedded controller and the system load power supply terminal. The step-down circuit is used to convert the voltage of the system load power supply terminal into the operating voltage required by the embedded controller. An energy storage capacitor is connected between the system load power supply terminal and ground to maintain the voltage of the system load power supply terminal during power switching.

[0014] Furthermore, the source of the first pre-stage MOSFET is connected to the source of the first post-stage MOSFET, the source of the second pre-stage MOSFET is connected to the source of the second post-stage MOSFET, and the source of the third pre-stage MOSFET is connected to the source of the third post-stage MOSFET.

[0015] Furthermore, the system also includes a DC power supply detection circuit, the DC power supply interface being connected to the gate of the first front-stage MOSFET through the DC power supply detection circuit, for monitoring the DC power supply presence status, and outputting a DC power supply presence signal to the first front-stage MOSFET when the DC power supply is present to turn on the first front-stage MOSFET.

[0016] On the other hand, the present invention also provides a DC power supply and dual-battery automatic switching control method, comprising: In response to the power-on trigger signal, the connection between the battery in place and the system load power supply terminal is turned on, so that the system load power supply terminal is powered and the system operating voltage is established. After the power-on trigger signal disappears, the established system operating voltage is maintained. The system detects whether the DC power input voltage, main battery voltage, and auxiliary battery voltage are within preset voltage windows. The preset voltage windows include undervoltage thresholds and overvoltage thresholds. When the input voltage is higher than the undervoltage threshold and lower than the overvoltage threshold, the voltage is considered valid. When the input voltage is lower than the undervoltage threshold or higher than the overvoltage threshold, the voltage is considered invalid. Based on the test results, arbitration is conducted according to the fixed priority of DC power supply > main battery > auxiliary battery, and the power supply with the highest priority and valid voltage is selected as the current power supply. Output the selected power supply to the system load power supply terminal, and disconnect other power supplies from the system load power supply terminal; The system monitors the voltage status of the current power supply in real time. When the voltage of the current power supply drops below the preset voltage window or is completely lost, it automatically re-arbitrates within microseconds and switches to the next priority power supply with valid voltage to supply power to the system load. During the switching process, the system load voltage remains continuous. Real-time monitoring of the remaining power of the main and secondary batteries; When a preset strategy determines that a power source needs to be switched, the current battery is stopped from supplying power to the system load, triggering a priority arbitration step to re-arbitrate and switch to another power source with a valid priority to supply power to the system load. The preset strategy includes: when the remaining power of the main battery is lower than a preset threshold, the main battery is stopped from supplying power to the system load, triggering a switch to the secondary battery, and the main battery or the secondary battery is forcibly selected as the power source according to the priority command set by the user.

[0017] Furthermore, when it is detected that the currently powered main battery or auxiliary battery has been removed, the system switches to another priority power source to supply power to the system load power supply terminal, and at the same time terminates the connection between the removed battery and the system load power supply terminal.

[0018] Furthermore, in the power-off state, all power supplies and system load power supply connections are disconnected.

[0019] Compared to existing technologies, the DC power supply and dual-battery automatic switching control system and method of this invention implements a fixed-priority switching logic through pure hardware within the control module. It monitors the voltage status of the three power supplies in real time and arbitrates according to a fixed priority order: DC power supply > main battery > auxiliary battery. When the current power supply voltage is abnormal or lost, the control module automatically switches to the next available power supply within microseconds. Combined with the energy storage capacitor at the back end, the load voltage remains continuous during the switching process, and the back end load is completely unaware of the change, achieving truly seamless, non-disruptive switching and effectively avoiding data loss or work interruption caused by power switching. Strictly adhering to the priority order of DC power supply > main battery > auxiliary battery, it prioritizes the use of external DC power, extending battery life. Simultaneously, when the DC power supply is disconnected, it prioritizes the use of the main battery, ensuring the continuity and stability of power supply for critical tasks. The power supply logic is clear and predictable. Users can plug and unplug the main battery BAT1 or auxiliary battery BAT2 at any time without shutting down the system. When the battery is removed, the control module automatically switches to another valid power source within microseconds. The embedded controller then detects the battery removal and turns off the corresponding MOSFET. The entire process is unaffected, significantly improving the flexibility and continuous power supply of the device. Each power source has an independent undervoltage / overvoltage detection circuit, ensuring that only power sources with voltages within the safe range can be connected to the system. When the input voltage is below the undervoltage threshold or above the overvoltage threshold, the power source is considered invalid and will not be selected, effectively preventing damage from battery malfunctions or adapter failures and improving system safety. The hardware control module handles seamless microsecond-level switching and fixed-priority arbitration, ensuring real-time performance and reliability. The EC software monitors battery level, determines thresholds, and executes software policies. It also actively shuts down the battery path by pulling the GPIO low, enabling flexible power management strategies. Working together, they ensure uninterrupted power during switching while providing flexible power management capabilities. Furthermore, the hardware priority and GPIO default always-on mechanism provide a final guarantee, ensuring that the system maintains power supply and basic switching functions even in the event of EC software malfunctions or crashes, significantly improving system robustness. When the system is powered off, the embedded controller is not powered on, the GPIO pins are in a high-impedance state, the self-locking circuit is off, and all MOSFETs are turned off, resulting in no static current consumption and achieving true zero-power standby. Through the cooperation of the self-locking circuit and EC software, one-button power-on is achieved, which is simple to operate and provides a good user experience. It is mainly implemented using MOSFETs, a control module, and an embedded controller, with a small number of components and a simple circuit structure. It does not require complex mechanical detection components (such as Hall sensors, spring pins, etc.), keeping costs under control and facilitating integration into the motherboards of various portable devices, thus showing good prospects for industrial applications. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of the structure of a DC power supply and dual-battery automatic switching control system provided in an embodiment of the present invention; Figure 2 This is a flowchart of an automatic switching control method for DC power supply and dual batteries provided in an embodiment of the present invention. Detailed Implementation

[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] like Figure 1 As shown, an embodiment of the present invention provides a DC power supply and dual-battery automatic switching control system, including a DC power interface 10, a main battery interface 20, a secondary battery interface 30, a self-locking circuit 40, an embedded controller (EC) 50, a control module 60, a system load power supply terminal (VOUT) 70, a first MOSFET group (PQ1, PQ2), a second MOSFET group (PQ3, PQ4), and a third MOSFET group (PQ5, ​​PQ6).

[0024] The first MOSFET group (PQ1, PQ2) is connected between the DC power interface 10 and the system load power supply terminal 70. The path containing the DC power interface 10, the first MOSFET group (PQ1, PQ2) and the system load power supply terminal 70 is the DC power path. The first MOSFET group (PQ1, PQ2) includes a first front-stage MOSFET PQ1 and a first rear-stage MOSFET PQ2 connected in series.

[0025] The second MOSFET group (PQ3, PQ4) is connected between the main battery interface 20 and the system load power supply terminal 70. The main battery interface 20, the second MOSFET group (PQ3, PQ4) and the system load power supply terminal 70 are in the main battery path. The second MOSFET group (PQ3, PQ4) includes a second front-stage MOSFET PQ3 and a second rear-stage MOSFET PQ4 connected in series.

[0026] The third MOSFET group (PQ5, ​​PQ6) is connected between the secondary battery interface 30 and the system load power supply terminal 70. The path containing the secondary battery interface 30, the third MOSFET group (PQ5, ​​PQ6) and the system load power supply terminal 70 is the main battery path. The third MOSFET group (PQ5, ​​PQ6) includes the third front-stage MOSFET PQ5 and the third rear-stage MOSFET PQ6 connected in series.

[0027] The first pre-stage MOSFET PQ1 and the first post-stage MOSFET PQ2 are connected in series between the DC power interface 10 and the system load power supply terminal 70. The second pre-stage MOSFET PQ3 and the second post-stage MOSFET PQ4 are connected in series between the main battery interface 20 and the system load power supply terminal 70. The third pre-stage MOSFET PQ5 and the third post-stage MOSFET PQ6 are connected in series between the auxiliary battery interface 30 and the system load power supply terminal 70.

[0028] The DC power interface 10 is used to connect to a DC power input. The DC power interface 10 is connected to the system load power supply terminal 70 via a first MOSFET PQ1 and a second MOSFET PQ2 connected in series. In one embodiment, the gate of the first front-stage MOSFET PQ1 is connected to the DC power supply presence signal (ACOK, Adapter Check OK), the source of the first front-stage MOSFET PQ1 is connected to the input terminal of the first undervoltage / overvoltage detection circuit UV / OV1 of the control module 60, and the gate of the first rear-stage MOSFET PQ2 is connected to the first drive signal output terminal G1 of the control module 60. The ACOK signal is generated by an external DC power detection circuit. When the DC power interface input voltage is present, it automatically becomes high (only indicating the presence of DC, without requiring precise voltage judgment). This ACOK signal is directly connected to the gate of the first front-stage MOSFET PQ1 to enable the DC path of the first front-stage MOSFET PQ1 when the DC power is connected.

[0029] The main battery interface 20 is used to connect the pluggable main battery BAT1. The positive terminal of the main battery BAT1 is connected to the system load power supply terminal 70 via the second pre-stage MOSFET PQ3 and the second post-stage MOSFET PQ4 in series. The gate of the second pre-stage MOSFET PQ3 is connected to the main battery path control terminal GPIO2 of the embedded controller 50 (the firmware of the embedded controller 50 is configured to push-pull output high level after startup, and is only configured when the main battery BAT1 is detected to be in place). The source of the second pre-stage MOSFET PQ3 is connected to the input terminal of the second undervoltage / overvoltage detection circuit UV / OV2 of the control module 60. The gate of the second post-stage MOSFET PQ4 is connected to the second drive signal output terminal G2 of the control module 60.

[0030] The secondary battery interface 30 is used to connect a pluggable secondary battery BAT2. The positive terminal of the secondary battery BAT2 is connected to the system load power supply terminal 70 via a series connection of the third pre-stage MOSFET PQ5 and the third post-stage MOSFET PQ6. The gate of the third pre-stage MOSFET PQ5 is connected to the secondary battery path control terminal GPIO3 of the embedded controller 50 (the firmware of the embedded controller 50 is configured to push-pull output high level after startup, and this configuration is only performed when the secondary battery BAT2 is detected to be in place). The source of the third pre-stage MOSFET PQ5 is connected to the input terminal of the second undervoltage / overvoltage detection circuit UV / OV3 of the control module 60. The gate of the third post-stage MOSFET PQ6 is connected to the third drive signal output terminal G3 of the control module 60.

[0031] The DC power interface 10 can be directly connected to the gate of the first front-stage MOSFET PQ1. When the DC power supply is connected to the DC power interface 10, a high level can be directly output to the gate of the first front-stage MOSFET PQ1 to turn on the first front-stage MOSFET PQ1. Alternatively, the voltage can be divided by a voltage divider circuit (not shown) and then connected to the gate of the first front-stage MOSFET PQ1 to turn on the first front-stage MOSFET PQ1. In another embodiment, a DC power detection circuit 35 may also be included. The DC power detection circuit 35 is connected to the DC power interface 10 and the gate of the first front-stage MOSFET PQ1. After the DC power supply (not shown) is connected, the DC power supply supplies power to the DC power detection circuit 35 to monitor the presence of the DC power supply and output a DC power presence signal ACOK (high level) to the first front-stage MOSFET PQ1 when the DC power supply is present, thereby turning on the first front-stage MOSFET PQ1.

[0032] The self-locking circuit 40 includes a first self-locking output terminal (unlabeled) connected to the main battery path control terminal GPIO2 and a second self-locking output terminal (unlabeled) connected to the secondary battery path control terminal GPIO3. It is used to momentarily output a high level to the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3 of the embedded controller 50 when the power button (not shown) is pressed or a power-on trigger signal is received. This forcibly pulls the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3 high, thereby turning on the corresponding front-stage MOSFETs (second front-stage MOSFET PQ3 and third front-stage MOSFET PQ5) of the battery path, providing the initial operating voltage for the embedded controller 60. After the trigger stops, the self-locking circuit 40 stops outputting a high level to the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3, and the high level output by the embedded controller 50 itself maintains the state of the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3.

[0033] The embedded controller 50 connects to the fuel gauges inside the main battery BAT1 and the secondary battery BAT2 via a battery power detection bus (I2C / SMBus) to periodically read the remaining battery capacity percentage and other necessary information. The embedded controller 50 includes a main battery path control terminal GPIO2, a secondary battery path control terminal GPIO3, and an I2C / SMBus terminal. The main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3 are respectively connected to the gates of the second pre-stage MOSFET PQ3 and the third pre-stage MOSFET PQ5, used to control the on or off state of the corresponding pre-stage MOSFETs.

[0034] The main battery path control terminal GPIO2 is configured as an output mode and connected to the gate of the second front-stage MOSFET PQ3. When the embedded controller 50 is not powered on, it is in a high-impedance state. After the embedded controller 50 starts up and completes initialization, it determines whether to configure the main battery path control terminal GPIO2 as a push-pull output and set it to a high level based on the detected presence of the main battery BAT1 (if the main battery BAT1 is present).

[0035] The secondary battery path control terminal GPIO3 is configured as an output mode and connected to the gate of the third front-end MOSFET PQ5. When the embedded controller 50 is not powered on, it is in a high-impedance state. After the embedded controller 50 starts up and completes initialization, it determines whether to configure the secondary battery path control terminal GPIO3 as a push-pull output and set it to a high level (if the secondary battery BAT2 is present) based on the detected presence of the secondary battery BAT2.

[0036] The embedded controller 50 can actively pull low the main battery path control terminal GPIO2 or the secondary battery path control terminal GPIO3 through software decision-making (preset strategy) to turn off the corresponding battery path's front-end MOSFETs (second front-end MOSFET PQ3 and third front-end MOSFET PQ5), thereby achieving indirect battery switching controlled by software. The preset strategy includes: when the remaining power of the main battery BAT1 is lower than a preset threshold, terminating the main battery BAT1's supply to the system load power supply terminal 70 and triggering a switch to the secondary battery BAT2 for power supply; and forcibly selecting the main battery BAT1 or the secondary battery BAT2 as the power source according to the user-defined priority instruction.

[0037] The embedded controller 50 also includes a main battery access detection terminal (unlabeled) connected to the main battery interface 20 and a secondary battery access detection terminal (unlabeled) connected to the secondary battery interface 30. When the embedded controller 50 detects that the main battery BAT1 or the secondary battery BAT2 has been removed through the main battery access detection terminal and the secondary battery access detection terminal, it immediately sets the corresponding main battery path control terminal GPIO2 or the secondary battery path control terminal GPIO3 to a low level, and turns off the corresponding second pre-stage MOSFET or the third pre-stage MOSFET. In the power-off state, the embedded controller 50 sets the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO2 to low, the control module 60 has no drive signal output, and the first pre-stage MOSFET PQ1, the first post-stage MOSFET PQ2, the second pre-stage MOSFET PQ3, the second post-stage MOSFET PQ4, the third pre-stage MOSFET PQ5, and the third post-stage MOSFET PQ6 are turned off.

[0038] The internal components of the control module 60 include: a first undervoltage / overvoltage detection circuit UV / OV1, a second undervoltage / overvoltage detection circuit UV / OV2, a third undervoltage / overvoltage detection circuit UV / OV3, a first drive signal output terminal G1, a second drive signal output terminal G2, a third drive signal output terminal G3, and a purely hardware fixed priority switching logic circuit 61.

[0039] The input of the first undervoltage / overvoltage detection circuit UV / OV1 is connected to the source of the first pre-stage MOSFET PQ1. The input of the second undervoltage / overvoltage detection circuit UV / OV2 is connected to the source of the second pre-stage MOSFET PQ3. The input of the third undervoltage / overvoltage detection circuit UV / OV3 is connected to the source of the third pre-stage MOSFET PQ5. A pure hardware-implemented fixed priority switching logic is used to select one of the three drive signal output terminals G1, G2, or G3 to output a drive signal (G1, G2, or G3) according to the output status of the three detection circuits UV / OV1, UV / OV2, and UV / OV3, following the priority order of DC power supply > main battery > secondary battery. The fixed priority switching logic circuit 61 determines which drive signal to output to the gate of the corresponding subsequent MOSFET (PQ2, PQ4, or PQ6) according to the fixed priority (DC power supply > main battery > secondary battery). Since the hardware core of the fixed priority switching logic circuit 61 is a priority encoder, which is a standard digital combinational logic circuit, when multiple inputs are valid at the same time, it only responds to and encodes the signal with the highest priority. Therefore, the priority logic in this embodiment does not depend on any software and can be fully implemented by the fixed priority switching logic circuit 61 built into the control module 60.

[0040] The system load power supply terminal 70 is connected to the drains of the first stage MOSFET PQ2, the second stage MOSFET PQ4, and the third stage MOSFET PQ6, serving as a common power supply output point to power the control module 60. After being stepped down to 3.3V by a step-down circuit, it provides the required operating voltage for the embedded controller 50.

[0041] A step-down circuit 80 is connected between the embedded controller 50 and the system load power supply terminal 70 to convert the VOUT voltage at the system load power supply terminal 70 into the operating voltage required by the embedded controller 50 (e.g., 3.3V). The step-down circuit 80 can be a DC-DC / LDO.

[0042] A storage capacitor 90 is connected between the system load power supply terminal 70 and ground to maintain the voltage of the system load power supply terminal 70 during power switching.

[0043] The following describes the operation of the DC power supply and dual-battery automatic switching control system according to an embodiment of the present invention.

[0044] I. System Startup Control Process When the system is powered off, the embedded controller 50 is not powered on and does not work. The main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3 are both in a high impedance state. All MOSFETs, including the first front-end MOSFET PQ1 to the third rear MOSFET PQ6, are turned off. At the system load power supply terminal 70, VOUT = 0V, there is no static current, and the system has zero power consumption.

[0045] When the DC power supply is not connected (the system is still powered off), at least one of the main battery BAT1 or the secondary battery BAT2 can be connected at this time or later. Afterwards, when the user presses the power button, the power-on trigger signal causes the self-locking circuit 40 to momentarily pull high the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3 of the embedded controller 50 (regardless of whether the battery is present). Once the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3 are pulled high, the corresponding front-end MOSFETs of the battery paths are turned on. At this time, only the battery that is actually in place (i.e., one or both of the main battery BAT1 and the secondary battery BAT2) can provide VOUT voltage to the system load power supply terminal 70 through the subsequent MOSFET. For example, if the secondary battery BAT2 is in place, the secondary battery path control terminal GPIO3 is pulled high, which turns on the third front-stage MOSFET PQ5. The voltage of the secondary battery BAT2 reaches the system load power supply terminal 70 through the body diode (not shown in the figure) of the third front-stage MOSFET PQ5 and the third subsequent MOSFET PQ6. If the main battery BAT1 is not in place, although the main battery path control terminal GPIO2 is pulled high, the source of the second front-stage MOSFET PQ3 is floating, and there is no current in the main battery path.

[0046] The voltage at the system load power supply terminal 70 is converted by the step-down circuit 80 to the operating voltage required by the embedded controller 50 (e.g., 3.3V), and the embedded controller 50 starts up and initializes. That is, when the power button is pressed, the channel of the front-stage MOSFET (PQ3 / PQ5) is turned on; at this time, the gate of the rear-stage MOSFET (PQ4 / PQ6) is not driven, the channel is turned off, and the parasitic diode inside the rear-stage MOSFET is turned on, outputting voltage to the system load power supply terminal 70 to wake up the embedded controller 50. Within milliseconds after the embedded controller 50 completes initialization, the embedded controller 50 performs the following operations: Detect whether the main battery BAT1 is in place: If it is in place, the embedded controller 50 configures the main battery path control terminal GPIO2 as a push-pull output and sets it to a high level; if it is not in place, the embedded controller 50 configures the main battery path control terminal GPIO2 to output a low level or maintain a high impedance.

[0047] Detect whether the secondary battery BAT2 is in place: If it is in place, the embedded controller 50 configures the secondary battery path control terminal GPIO3 as a push-pull output and sets it to a high level; if it is not in place, the embedded controller 50 configures the secondary battery path control terminal GPIO3 to output a low level or maintain a high impedance.

[0048] This operation takes over the pull-high provided by the self-locking circuit 40, ensuring that only the battery path that is actually in place will be continuously conducted by the embedded controller 50, while the unused battery path will not be accidentally opened.

[0049] Subsequently, the user releases the button, triggering a stop. The self-locking circuit 40 stops pulling the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3 high. However, since the embedded controller 50 has already set the GPIO corresponding to the actual battery in place to a high level output, the second pre-stage MOSFET PQ3 and the third pre-stage MOSFET PQ5 continue to conduct, maintaining the system power supply. The embedded controller 50 continues to complete the initialization of the remaining peripherals, and the system starts normally.

[0050] II. DC Power Supply Path Control Process When the DC power supply is connected to the DC power interface 10, the gate of the first front-stage MOSFET PQ1 receives a high-level signal, thus turning on the first front-stage MOSFET. This high-level signal can be directly transmitted to the gate of the first front-stage MOSFET PQ1 after the DC power supply is connected, or it can be generated by the DC power supply detection circuit 35 as an ACOK high-level signal. This ACOK high-level signal directly drives the gate of the first front-stage MOSFET PQ1, turning on the first front-stage MOSFET PQ1. This process does not require the participation of the embedded controller 50.

[0051] After the first front-stage MOSFET PQ1 is turned on, it transfers the DC power supply voltage to the source of the first rear-stage MOSFET PQ2, and simultaneously sends it to the input terminal of the first undervoltage / overvoltage detection circuit UV / OV1 of the control module 60 (equivalent to the source of the first front-stage MOSFET PQ1). The first undervoltage / overvoltage detection circuit UV / OV1 determines whether the voltage at this point is within a preset voltage window: If so, the fixed priority switching logic circuit 61 inside the control module 60 (when the current DC power input is valid and has the highest priority) outputs a drive signal G1 to turn on the first post-stage MOSFET PQ2, and the DC power supply voltage is delivered to the system load power supply terminal 70 through the first post-stage MOSFET PQ2. If not (undervoltage or overvoltage), the control module 60 will not output the drive signal G1, and the first subsequent stage MOSFET PQ2 will remain off.

[0052] In this embodiment of the invention, when the voltage value of a power supply is between a preset undervoltage threshold (UV) and an overvoltage threshold (OV), i.e., within a preset voltage window, the power supply is determined to be "valid". When the voltage value of a power supply is lower than the undervoltage threshold, higher than the overvoltage threshold, or physically disconnected causing a voltage loss (becoming 0V), i.e. not within the preset voltage window, the power supply is determined to be "failed".

[0053] III. Main Battery Path Control Process When the main battery BAT1 is connected, the main battery connection detection terminal of the embedded controller 50 detects that the main battery BAT1 is in place, and its main battery path control terminal GPIO2 maintains a high level output, so that the second front-stage MOSFET PQ3 is turned on.

[0054] After the second front-stage MOSFET PQ3 is turned on, the main battery BAT1 voltage is transferred to the source of the second rear-stage MOSFET PQ4, and simultaneously sent to the input terminal of the second undervoltage / overvoltage detection circuit UV / OV2 of the control module 60 (equivalent to the source of the second front-stage MOSFET PQ3).

[0055] The second undervoltage / overvoltage detection circuit UV / OV2 of the control module 60 determines whether the voltage at that point is within a preset voltage window: If so, when the DC power supply is invalid, the fixed priority switching logic circuit 61 of the control module 60 outputs the drive signal G2, turns on the second post-stage MOSFET PQ4, and the main battery BAT1 voltage is delivered to the system load power supply terminal 70 through the second post-stage MOSFET PQ4. If not, the control module 60 will not output the drive signal G2, and the second-stage MOSFET PQ4 will remain off.

[0056] IV. Secondary Battery Path Control Process: When the secondary battery BAT2 is connected, the secondary battery connection detection terminal of the embedded controller 50 detects that the secondary battery BAT2 is in place, and its secondary battery path control terminal GPIO3 maintains a high level output, which turns on the third front-stage MOSFET PQ5.

[0057] After the third pre-stage MOSFET PQ5 is turned on, the voltage of the secondary battery BAT2 is transferred to the source of the third post-stage MOSFET PQ6, and simultaneously sent to the input terminal of the third undervoltage / overvoltage detection circuit UV / OV3 of the control module 60 (equivalent to the source of the third pre-stage MOSFET PQ5). The third undervoltage / overvoltage detection circuit UV / OV3 of the control module 60 determines whether the voltage at this point is within a preset voltage window: If so, when both the embedded controller 50 and the main battery BAT1 are invalid, the fixed priority switching logic circuit 61 inside the control module 60 outputs the drive signal G3, turns on the third post-stage MOSFET PQ6, and the voltage of the secondary battery BAT2 is delivered to the system load power supply terminal 70 through the third post-stage MOSFET PQ6. If not, the control module 60 will not output the drive signal G3, and the third-stage MOSFET PQ6 will remain off.

[0058] V. Priority and seamless switching control process, automatic hardware. During system operation, the control module 60 monitors the three input voltages in real time. The fixed priority switching logic circuit 61 uses pure hardware comparison and arbitration, and automatically and uniquely outputs one drive signal (G1, G2 or G3) to turn on the corresponding downstream MOSFET according to the fixed priority of DC power supply > main battery > secondary battery, while the other two downstream MOSFETs remain off.

[0059] When the DC power supply voltage is present and within the normal voltage window, the control module 60 outputs the drive signal G1, and the system load is powered by the DC power supply. When the DC power supply voltage drops below the undervoltage threshold or is disconnected, the control module 60 automatically stops outputting the drive signal G1. At the same time, if the main battery BAT1 voltage is normal, it immediately outputs the drive signal G2. Because it is a hardware automatic control, it can achieve microsecond-level seamless switching from the DC power supply to the main battery BAT1. Similarly, when the main battery BAT1 is removed or its voltage is below the undervoltage threshold, the control module 60 automatically switches to the secondary battery BAT2 (if the secondary battery BAT2 is normal).

[0060] VI. Hot-swap control process When the main battery BAT1 or the auxiliary battery BAT2 is disconnected during system operation, the corresponding voltage is lost (becomes 0V). The corresponding undervoltage / overvoltage detection circuit of the control module 60 (the first undervoltage / overvoltage detection circuit UV / OV1, the second undervoltage / overvoltage detection circuit UV / OV2, or the third undervoltage / overvoltage detection circuit UV / OV3) detects the loss of voltage within microseconds and immediately switches to the second highest priority available power supply. Subsequently, the embedded controller 50 detects the disappearance of the battery access signal, pulls the corresponding battery path control terminal GPIO (GPIO2 or GPIO3) low, and turns off the front-end MOSFET (the second front-end MOSFET PQ3 or the third front-end MOSFET PQ5), thus realizing battery replacement without power loss.

[0061] If the user connects the main battery BAT1 during operation, and the DC power supply is not yet connected, the embedded controller 50 detects the main battery BAT1 connection signal. If the main battery path control terminal GPIO2 was not previously configured (e.g., only the secondary battery BAT2 is powered), the embedded controller 50 configures the main battery path control terminal GPIO2 to push-pull output a high level, turning on the second front-stage MOSFET PQ3. The second undervoltage / overvoltage detection circuit UV / OV2 of the control module 60 detects that the voltage is within the effective voltage range (the main battery BAT1 voltage is normal). The priority logic determines that the DC power supply is invalid and the main battery BAT1 is valid, outputting the drive signal G2 at a high level, turning on the second rear-stage MOSFET PQ4, seamlessly switching to the main battery BAT1 to power the load. The switching time is in the microsecond range, and the voltage can be maintained constant by the energy storage capacitor 90 at the back end during this process. The same logic applies if the user connects the secondary battery BAT2 during operation.

[0062] VII. Coordination between Software Active Control and Hardware Priority The embedded controller 50 obtains the remaining power percentage of the main battery BAT1 and the secondary battery BAT2 in real time via I2C / SMBus. For example, the embedded controller 50 can read the power of the main battery BAT1 every second. When it detects that the remaining power of the main battery BAT1 is lower than the user-set threshold (e.g., 10%), in order to avoid over-discharging of the main battery BAT1 or according to user preferences (e.g., "switch to the secondary battery when the main battery is below 10%), the embedded controller 50 executes a software decision: pulls the output of the main battery path control terminal GPIO2 from high level to low level, thereby turning off the front-end MOSFET, i.e., the second front-end MOSFET PQ3.

[0063] At this time, since the second pre-stage MOSFET PQ3 is turned off, the voltage of the main battery BAT1 cannot reach the input terminal of the second undervoltage / overvoltage detection circuit UV / OV2 of the control module 60. After the control module 60 detects the loss of voltage in this circuit, its internal fixed priority switching logic circuit 61 will automatically re-arbitrate within microseconds: if the DC power supply is invalid, the main battery is invalid, and the auxiliary battery is valid, then the drive signal G3 will be output as high level immediately, and the third post-stage MOSFET PQ6 will be turned on, and the system load will draw power from the auxiliary battery BAT2.

[0064] Because the control module 60 has a fast switching speed (microsecond level), and in conjunction with the energy storage capacitor 90 at the back end, the load voltage can remain continuous during the switching process without significant drop. Throughout the process, the embedded controller 50 is only responsible for issuing the "shut down the main battery" command, while the actual power switching action is completed autonomously by the control module 60, without the need for the embedded controller 50 to participate in real-time switching.

[0065] Similarly, the embedded controller 50 can also actively pull down the corresponding GPIO pins (GPIO2 for main battery path control or GPIO3 for secondary battery path control) according to other software strategies (such as user-defined "priority use of secondary battery" or "switch back to main battery when secondary battery level is below 15%), thereby turning off the corresponding front-end MOSFETs. The hardware control module 60 always follows a fixed priority of DC power supply > main battery > secondary battery, and only provides drive signals to the currently effective and highest priority power supply.

[0066] Even if the embedded controller 50 software malfunctions or crashes, because the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3 are set to high level and maintained after the embedded controller 50 is initialized (only for batteries actually in place), the pre-stage MOSFETs (second pre-stage MOSFET PQ3 and third pre-stage MOSFET PQ5) of the main battery BAT1 and secondary battery BAT2 remain in the conducting state. Therefore, the control module 60 can still ensure that at least one high-priority active power supply powers the system, preventing system power loss due to software failure. If the embedded controller 50 has never completed initialization after power-on (e.g., the embedded controller 50 fails to start after the self-locking circuit 40 is triggered), the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3 will remain in a high-impedance state. When the button is released, the self-locking circuit 40 stops pulling high, all battery paths are disconnected, and the system automatically powers off to avoid jamming.

[0067] This "hardware priority arbitration + software active intervention" design ensures both fast and seamless switching and provides flexible power management capabilities.

[0068] VIII. System Shutdown Control Process After the user initiates a shutdown operation and the operating system completes all tasks, it notifies the embedded controller 50 to power off. The embedded controller 50 first sets the outputs of the main battery path control terminal GPIO2 and the secondary battery path control terminal GPIO3 to a low level, thereby turning off the second pre-stage MOSFET PQ3 and the third pre-stage MOSFET PQ5 (ACOK is also low after the DC power is removed, turning off PQ1). The control module 60 stops outputting drive signals G1 / G2 / G3 because all input voltages are invalid, thereby turning off the first post-stage MOSFET PQ2, the second post-stage MOSFET PQ4, and the third post-stage MOSFET PQ6. The entire system is completely disconnected from the battery and DC input, with no leakage current path, achieving zero power consumption during shutdown. In other words, both MOSFETs in each MOSFET group are turned off, and the parasitic body diodes inside the two MOSFETs are connected in reverse series. Regardless of which side has a higher voltage, one PN junction is always reverse-biased and cut off, blocking reverse current and achieving zero power consumption during shutdown.

[0069] Compared with the prior art, the DC power supply and dual-battery automatic switching control system and method of the present invention have many beneficial effects: The fixed-priority switching logic circuit 61, implemented entirely in hardware within the control module 60, monitors the voltage status of the three power supplies in real time and arbitrates according to a fixed priority order: DC power supply > main battery > auxiliary battery. When the current power supply voltage is abnormal or lost, the control module 60 automatically switches to the next available power supply within microseconds. Combined with the energy storage capacitor 90 at the back end, the load voltage remains continuous during the switching process, and the back end load is completely unaware of the change, achieving truly seamless, non-disruptive switching and effectively preventing data loss or work interruption due to power switching.

[0070] Power is supplied in strict order of priority: DC power > main battery > auxiliary battery. External DC power is used first, which extends the battery life. At the same time, the main battery is used first when DC is disconnected, which ensures the continuity and stability of power supply for critical tasks. The power supply logic is clear and predictable.

[0071] Users can plug or unplug the main battery BAT1 or the secondary battery BAT2 at any time without shutting down the system. When the battery is removed, the control module 60 automatically switches to another effective power source within microseconds. Subsequently, the embedded controller 50 detects the battery removal and turns off the corresponding pre-amplifier MOSFET. The entire process is unaffected by the system operation, greatly improving the flexibility and continuous battery life of the device.

[0072] Each power supply circuit has an independent undervoltage / overvoltage detection circuit to ensure that only power supplies with voltages within the safe range can be connected to the system. When the input voltage is below the undervoltage threshold or above the overvoltage threshold, the circuit is considered invalid and will not be selected as a power source, effectively preventing damage to the equipment due to battery abnormalities or adapter failures, and improving system safety.

[0073] The hardware control module 60 is responsible for seamless microsecond-level switching and fixed-priority arbitration, ensuring the real-time performance and reliability of the switching. The EC software is responsible for battery power monitoring, threshold judgment, and software policy execution, and actively shuts down the battery path by pulling the GPIO low to achieve flexible power management strategies. Working together, they ensure no power loss during switching while providing flexible power management capabilities. Meanwhile, the hardware priority and GPIO default always-on mechanism serve as a final guarantee, ensuring that the system maintains power supply and basic switching functions even in the event of EC software malfunction or crash, significantly improving system robustness.

[0074] When the system is powered off, the embedded controller 50 is not powered on, the GPIO pins are in a high-impedance state, the self-locking circuit is off, all MOSFETs are turned off, and there is no static current consumption, achieving true zero-power standby. Through the cooperation of the self-locking circuit 40 and the EC software, one-button power-on is achieved, which is simple to operate and provides a good user experience.

[0075] It mainly uses MOSFETs, self-locking circuits 40, embedded controllers 50 and control modules 60 for implementation. It has a small number of components, a simple circuit structure, and does not require complex mechanical detection elements (such as Hall sensors, spring pins, etc.). The cost is controllable and it is easy to integrate into the motherboards of various portable devices, which has good prospects for industrial application.

[0076] The hardware UV / OV detection circuits for the main battery BAT1 and auxiliary battery BAT2 have their undervoltage / overvoltage windows fixed to cover the normal operating voltage range of 2-cell, 3-cell, and 4-cell lithium battery packs, automatically adapting to battery packs with different cell numbers without any hardware adjustments. The embedded controller 50 reads the number of cells connected in series inside the battery via I2C / SMBus for software-level percentage calculation and charge / discharge strategy optimization. The system can automatically adapt to battery packs with different voltage platforms (2-cell, 3-cell, 4-cell) without requiring hardware design changes, improving product versatility and configurability.

[0077] The DC input interface supports a wide voltage range (such as 5V to 24V or even wider). By adjusting the voltage window of the UV / OV detection circuit of the control module 60, it can be adapted to power adapters of different specifications, enhancing the system's compatibility and field adaptability.

[0078] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A DC power supply and dual-battery automatic switching control system, characterized in that, include: The system includes a DC power interface for connecting to a DC power source, a main battery interface for connecting to the main battery, a secondary battery interface for connecting to the secondary battery, a control module, a system load power supply terminal, a first MOSFET group, a second MOSFET group, a third MOSFET group, an embedded controller, and a self-locking circuit. The first MOSFET group is connected between the DC power interface and the system load power supply terminal. The path containing the DC power interface, the first MOSFET group and the system load power supply terminal is a DC power path. The first MOSFET group includes a first front-stage MOSFET and a first rear-stage MOSFET connected in series. The second MOSFET group is connected between the main battery interface and the system load power supply terminal. The main battery interface, the second MOSFET group and the system load power supply terminal are located in the main battery path. The second MOSFET group includes a second front-stage MOSFET and a second rear-stage MOSFET connected in series. The third MOS transistor group is connected between the sub-battery interface and the system load power supply terminal. The path containing the sub-battery interface, the third MOS transistor group, and the system load power supply terminal is the sub-battery path. The third MOS transistor group includes a third front-stage MOS transistor and a third rear-stage MOS transistor connected in series. The control module is connected to the first MOS transistor group, the second MOS transistor group, the third MOS transistor group and the system load power supply terminal. The control module includes a fixed priority switching logic circuit. The fixed priority order is DC power supply > main battery > auxiliary battery. The control module is used to monitor the validity of the output voltage of the DC power supply interface, the main battery interface and the auxiliary battery interface, and select the current power supply according to the fixed priority. When the current power supply fails, the control module switches to the next priority valid power supply. The embedded controller includes a main battery path control terminal connected to the second front-stage MOSFET and a secondary battery path control terminal connected to the third front-stage MOSFET. The embedded controller is also connected to the main battery interface and the secondary battery interface to detect the presence status and remaining battery capacity of the main battery and the secondary battery, and to turn on or off the second front-stage MOSFET and the third front-stage MOSFET according to the detection results. The self-locking circuit includes a first self-locking output terminal connected to the main battery path control terminal and a second self-locking output terminal connected to the secondary battery path control terminal. When the self-locking circuit receives a power-on trigger signal, it pulls the main battery path control terminal and the secondary battery path control terminal high to turn on the second pre-stage MOSFET and the third pre-stage MOSFET. After the trigger stops, the self-locking circuit stops outputting a high level to the main battery path control terminal and the secondary battery path control terminal, and the state of the main battery path control terminal and the secondary battery path control terminal is maintained by the high level output by the embedded controller itself.

2. The DC power supply and dual-battery automatic switching control system as described in claim 1, characterized in that, The DC power interface is connected to the gate of the first pre-stage MOSFET, the main battery path control terminal is connected to the gate of the second pre-stage MOSFET, and the secondary battery path control terminal is connected to the gate of the third pre-stage MOSFET.

3. The DC power supply and dual-battery automatic switching control system as described in claim 2, characterized in that, The control module further includes a first undervoltage / overvoltage detection circuit, a second undervoltage / overvoltage detection circuit, a third undervoltage / overvoltage detection circuit, a first drive signal output terminal, a second drive signal output terminal, and a third drive signal output terminal. The first undervoltage / overvoltage detection circuit is connected to the source of the first pre-stage MOSFET, the second undervoltage / overvoltage detection circuit is connected to the source of the second pre-stage MOSFET, and the third undervoltage / overvoltage detection circuit is connected to the source of the third pre-stage MOSFET. The first drive signal output terminal is connected to the gate of the first post-stage MOSFET, the second drive signal output terminal is connected to the gate of the second post-stage MOSFET, and the third drive signal output terminal is connected to the gate of the third post-stage MOSFET. The control module, based on the output states of the first, second, and third undervoltage / overvoltage detection circuits and according to the fixed priority, sets the drive signal corresponding to the highest priority path among the DC power path, main battery path, and secondary path to be valid, and sets the remaining drive signals to be invalid, so as to turn on one of the corresponding first, second, and third post-stage MOSFETs.

4. The DC power supply and dual-battery automatic switching control system as described in claim 3, characterized in that, The embedded controller further includes a main battery access detection terminal connected to the main battery interface and a secondary battery access detection terminal connected to the secondary battery interface. When the embedded controller detects that the main battery or the secondary battery is removed, it immediately sets the corresponding main battery path control terminal or the secondary battery path control terminal to a low level and turns off the corresponding second pre-stage MOSFET or the third pre-stage MOSFET. In the power-off state, the embedded controller sets the main battery path control terminal and the secondary battery path control terminal low, the control module has no drive signal output, and the first pre-stage MOSFET, the first post-stage MOSFET, the second pre-stage MOSFET, the second post-stage MOSFET, the third pre-stage MOSFET, and the third post-stage MOSFET are turned off.

5. The DC power supply and dual-battery automatic switching control system as described in claim 1, characterized in that, A step-down circuit is connected between the embedded controller and the system load power supply terminal. The step-down circuit is used to convert the voltage of the system load power supply terminal into the operating voltage required by the embedded controller. An energy storage capacitor is connected between the system load power supply terminal and ground to maintain the voltage of the system load power supply terminal during power switching.

6. The DC power supply and dual-battery automatic switching control system as described in claim 1, characterized in that, The source of the first pre-stage MOSFET is connected to the source of the first post-stage MOSFET, the source of the second pre-stage MOSFET is connected to the source of the second post-stage MOSFET, and the source of the third pre-stage MOSFET is connected to the source of the third post-stage MOSFET. The parasitic diode inside the first pre-stage MOSFET is connected in reverse series with the parasitic diode inside the first post-stage MOSFET, the parasitic diode inside the second pre-stage MOSFET is connected in reverse series with the parasitic diode inside the second post-stage MOSFET, and the parasitic diode inside the third pre-stage MOSFET is connected in reverse series with the parasitic diode inside the third post-stage MOSFET.

7. The DC power supply and dual-battery automatic switching control system as described in claim 2, characterized in that, The system also includes a DC power detection circuit. The DC power interface is connected to the gate of the first front-stage MOSFET through the DC power detection circuit to monitor the DC power supply status and output a DC power supply status signal to the first front-stage MOSFET when the DC power supply is in place, so as to turn on the first front-stage MOSFET.

8. A method for automatic switching control between DC power supply and dual batteries, characterized in that, include: In response to the power-on trigger signal, the connection between the battery in place and the system load power supply terminal is turned on, so that the system load power supply terminal is energized and the system operating voltage is established. After the power-on trigger signal disappears, the established system operating voltage is maintained. The system detects whether the DC power input voltage, main battery voltage, and auxiliary battery voltage are within preset voltage windows. The preset voltage windows include an undervoltage threshold and an overvoltage threshold. When the input voltage is higher than the undervoltage threshold and lower than the overvoltage threshold, the voltage is determined to be valid. When the input voltage is lower than the undervoltage threshold or higher than the overvoltage threshold, the voltage is determined to be invalid. Based on the test results, arbitration is conducted according to the fixed priority of DC power supply > main battery > auxiliary battery, and the power supply with the highest priority and valid voltage is selected as the current power supply. Output the selected power supply to the system load power supply terminal, and disconnect other power supplies from the system load power supply terminal; The voltage status of the current power supply is monitored in real time. When the voltage of the current power supply drops below the preset voltage window or is completely lost, the system automatically re-arbitrates within microseconds and switches to the next priority power supply with valid voltage to supply power to the system load. During the switching process, the voltage of the system load remains continuous. The remaining power of the main battery and the auxiliary battery can be obtained in real time; When a preset strategy determines that a power source needs to be switched, the current battery is terminated from supplying power to the system load, triggering the priority arbitration step to re-arbitrate and switch to another power source with a valid priority to supply power to the system load. The preset strategy includes: when the remaining power of the main battery is lower than a preset threshold, the main battery is terminated from supplying power to the system load, triggering a switch to the secondary battery for power supply, and the main battery or the secondary battery is forcibly selected as the power source according to the priority command set by the user.

9. The DC power supply and dual-battery automatic switching control method as described in claim 8, characterized in that, When it is detected that the currently powered main battery or auxiliary battery has been removed, the system switches to another priority power source to supply power to the system load power supply terminal, and at the same time terminates the connection between the removed battery and the system load power supply terminal.

10. The DC power supply and dual-battery automatic switching control method as described in claim 8, characterized in that, When the system is powered off, all power supplies are disconnected from the system load power supply terminals.