Power supply switching circuit, method and device of server and storage medium
By introducing a reference switching device and a target switching device into the server power supply switching circuit, power switching under different voltage threshold conditions is achieved, and the problem of high probability of server power supply failure is solved, and the stability and reliability of load power supply is achieved.
Patent Information
- Application Number
- CN202412000500.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-27
AI Technical Summary
In the prior art, the probability of power supply failure during the power supply of the server is high, and the possibility of abnormal load power supply is high.
A power supply switching circuit for a server is provided, including a reference switching device and a target switching device, through which power switching is controlled under different voltage threshold conditions, ensuring that the server components are always operated under reliable power supply.
It effectively reduces the probability of power supply failure during the server's power supply process, ensures the stability and reliability of load power supply, and avoids the problem of battery leakage current to the load end.
Smart Images

Figure CN120045044A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a power supply switching circuit, method, device, storage medium, and electronic device for a server. Background Art
[0002] The related technologies include two load power supply switching schemes. One is to use two diodes and utilize the unidirectional conductivity of the diodes to achieve the switching between power supplies. However, ordinary diodes or Schottky diodes will generate a relatively large voltage drop during operation. For example, for LBAS70, when the load current is 2 mA, the voltage drop is about 0.5 V. When the battery voltage is lower than 2.5 V, the voltage P3V3 at the load will be less than 2 V, which cannot ensure the normal operation of the load (whose operating voltage range is between 2 V and 3.3 V). Moreover, small voltage drop diodes have a large reverse leakage current, and the battery power will be consumed in the reverse direction, reducing the battery life. The other is the scheme of replacing some diodes with MOS transistors. When the main board power supply is in operation, if the battery voltage is higher than the main board power supply voltage after being stepped down by the diode, the battery will discharge current to the load terminal through the body diode of the MOS transistor, resulting in an inability to switch the power supply normally, and this scheme is only applicable to the case where the power supply voltage difference is large. In summary, in the related technologies, whether it is the first or the second scheme, the possibility of abnormal load power supply is relatively high.
[0003] In view of the problems such as a relatively high probability of power supply failure during the power supply process of the server in the related technologies, no effective solution has been proposed yet. Summary of the Invention
[0004] The embodiments of the present application provide a power supply switching circuit, method, device, and storage medium for a server, so as to at least solve the problems such as a relatively high probability of power supply failure during the power supply process of the server in the related technologies.
[0005] According to an embodiment of the embodiments of the present application, a power supply switching circuit for a server is provided. A reference power supply and a target power supply are connected to a server component to be powered through a power supply switching circuit. The power supply switching circuit includes: a reference switching device and a target switching device. The reference switching device is connected to the target power supply through a reference control terminal, a reference input terminal is connected to the reference power supply, and a reference output terminal is connected to the server component. When a first reference voltage difference between the reference input terminal and the reference output terminal is greater than or equal to a first voltage threshold, the reference input terminal leaks current to the reference output terminal, and the target power supply is connected to the server component and the reference output terminal through the target switching device;
[0006] The target switching device is used to control the conduction between the target power supply and the server component, control the second reference voltage difference between the reference control end and the reference output end to be greater than a second voltage threshold, and control the first reference voltage difference to be less than the first voltage threshold when the target power supply is powered on; and control the second reference voltage difference to be less than or equal to the second voltage threshold when the target power supply is powered off.
[0007] The reference switching device is used to control the disconnection between the reference input end and the reference output end when the second reference voltage difference is greater than the second voltage threshold, so as to supply power to the server component only using the target power supply, and control the conduction between the reference input end and the reference output end when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server component from the target power supply to the reference power supply.
[0008] Optionally, the target switching device includes: a first target switch and a second target switch. The second target switch includes a second target control end, a second target input end, and a second target output end. The target power supply is connected to the second target control end through the first target switch, the target power supply is also connected to the second target input end, and the target power supply is connected to the server component and the reference output end through the second target output end in the target switching device.
[0009] The first target switch is used to control the second target voltage difference between the second target control end and the second target output end to be less than or equal to a third voltage threshold when the target power supply is powered on.
[0010] The second target switch is used to control the conduction between the second target input end and the second target output end when the second target voltage difference is less than or equal to the third voltage threshold, and prohibit the second target output end from leaking current to the second target input end when the target power supply is powered off.
[0011] Optionally, the first target switch includes a first target control end, a first target input end, and a first target output end. The first target switch is connected to the target power supply through the first target control end, connected to the second target control end of the second target switch through the first target input end, and the first target output end is grounded. When the target power supply is powered on, the first target voltage difference between the first target control end and the first target output end is greater than or equal to a fourth voltage threshold.
[0012] The first target switch is configured to control the conduction between the first target output terminal and the first target input terminal when the first target voltage difference is greater than or equal to the fourth voltage threshold, so that the second target voltage difference is less than or equal to the third voltage threshold;
[0013] The first target switch is further configured to control the disconnection between the first target output terminal and the first target input terminal when the first target voltage difference is less than the fourth voltage threshold.
[0014] Optionally, the second target switch is a second P-type field effect transistor, the second target control terminal is the second target gate of the second P-type field effect transistor, the second target input terminal is the second target drain of the second P-type field effect transistor, the second target output terminal is the second target source of the second P-type field effect transistor, and a second target body diode of the second P-type field effect transistor is connected between the second target drain and the second target source, and the conduction direction of the second target body diode is from the second target drain to the second target source;
[0015] The second target body diode is configured to prevent the second target source from leaking current to the second target drain when the target power supply is powered off;
[0016] The second target body diode is further configured to allow the second target drain to leak current to the second target source when the target power supply is powered on, until the second target voltage difference between the second target gate and the second target source is less than or equal to the third voltage threshold.
[0017] Optionally, the first target switch is a first N-type field effect transistor, the first target control terminal is the first target gate, the first target input terminal is the first target drain, and the first target output terminal is the first target source.
[0018] Optionally, the reference switching device is a reference P-type field effect transistor, the reference control terminal is the reference gate of the reference P-type field effect transistor, the reference input terminal is the reference drain of the reference P-type field effect transistor, the reference output terminal is the reference source of the reference P-type field effect transistor, and a reference body diode of the reference P-type field effect transistor is connected between the reference drain and the reference source, and the conduction direction of the reference body diode is from the reference drain to the reference source;
[0019] The reference body diode is used to prevent the reference source from leaking current to the reference drain when the target power supply is powered on; it is also used to allow the reference drain to leak current to the reference source when the target power supply is powered off until the second reference voltage difference between the reference gate and the reference source is less than or equal to the second voltage threshold;
[0020] The reference P-type field effect transistor is used to control the disconnection between the reference drain and the reference source when the second reference voltage difference between the reference gate and the reference source is greater than the second voltage threshold, so as to supply power to the server component only using the target power supply, and to control the conduction between the reference drain and the reference source when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server component from the target power supply to the reference power supply.
[0021] According to an embodiment of the present application, a power supply switching method for a server is provided. A reference power supply and a target power supply are connected to a server component to be powered through a power supply switching circuit. The power supply switching circuit includes: a reference switching device and a target switching device. The reference switching device is connected to the target power supply through a reference control terminal, the reference input terminal is connected to the reference power supply, and the reference output terminal is connected to the server component. When the first reference voltage difference between the reference input terminal and the reference output terminal is greater than or equal to the first voltage threshold, the reference input terminal leaks current to the reference output terminal. The target power supply is connected to the server component and the reference output terminal through the target switching device. The method is applied to the target switching device and includes:
[0022] When the target power supply is powered on, controlling the conduction between the target power supply and the server component, controlling the second reference voltage difference between the reference control terminal and the reference output terminal to be greater than the second voltage threshold, and controlling the first reference voltage difference to be less than the first voltage threshold. Wherein, the reference switching device is configured to control the disconnection between the reference input terminal and the reference output terminal when the second reference voltage difference is greater than the second voltage threshold, so as to supply power to the server component only using the target power supply;
[0023] When the target power supply is powered off, controlling the second reference voltage difference to be less than or equal to the second voltage threshold. Wherein, the reference switching device is configured to control the conduction between the reference input terminal and the reference output terminal when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server component from the target power supply to the reference power supply.
[0024] According to another embodiment of the embodiments of the present application, there is also provided a power supply switching device for a server. A reference power supply and a target power supply are connected to server components to be powered through a power supply switching circuit. The power supply switching circuit includes: a reference switching device and a target switching device. The reference switching device is connected to the target power supply through a reference control terminal, a reference input terminal is connected to the reference power supply, and a reference output terminal is connected to the server components. When a first reference voltage difference between the reference input terminal and the reference output terminal is greater than or equal to a first voltage threshold, the reference input terminal leaks current to the reference output terminal. The target power supply is connected to the server components and the reference output terminal through the target switching device. The device is applied to the target switching device and includes:
[0025] A first control module, configured to, when the target power supply is supplying power, control the target power supply to conduct with the server components, control a second reference voltage difference between the reference control terminal and the reference output terminal to be greater than a second voltage threshold, and control the first reference voltage difference to be less than the first voltage threshold. Wherein, the reference switching device is configured to control the reference input terminal and the reference output terminal to be disconnected when the second reference voltage difference is greater than the second voltage threshold, so as to supply power to the server components only using the target power supply;
[0026] A second control module, configured to, when the target power supply is powered off, control the second reference voltage difference to be less than or equal to the second voltage threshold. Wherein, the reference switching device is configured to control the reference input terminal and the reference output terminal to be conducted when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server components from the target power supply to the reference power supply.
[0027] According to still another embodiment of the present application, there is also provided a computer program product, including a computer program, and the computer program is executed by a processor to perform the steps in any one of the above method embodiments.
[0028] According to still another embodiment of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored. Wherein, the computer program is configured to perform the steps in any one of the above method embodiments when running.
[0029] According to still another embodiment of the present application, there is also provided an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments.
[0030] In an embodiment of the present application, a power supply switching circuit for a server is proposed. A reference power supply and a target power supply are connected to server components to be powered through the power supply switching circuit. The power supply switching circuit includes: a reference switching device and a target switching device. The reference switching device is connected to the target power supply through a reference control terminal, connected to the reference power supply through a reference input terminal, and connected to the server components through a reference output terminal. When a first reference voltage difference between the reference input terminal and the reference output terminal is greater than or equal to a first voltage threshold, a leakage current flows from the reference input terminal to the reference output terminal. The target power supply is connected to the server components and the reference output terminal through the target switching device; the target switching device is configured to, when the target power supply is supplying power, control the target power supply to conduct with the server components, control a second reference voltage difference between the reference control terminal and the reference output terminal to be greater than a second voltage threshold, and control the first reference voltage difference to be less than the first voltage threshold. When the target power supply is powered off, control the second reference voltage difference to be less than or equal to the second voltage threshold; the reference switching device is configured to, when the second reference voltage difference is greater than the second voltage threshold, control the reference input terminal and the reference output terminal to be disconnected, so as to supply power to the server components only using the target power supply, and when the second reference voltage difference is less than or equal to the second voltage threshold, control the reference input terminal and the reference output terminal to be conducted, so as to switch the power supply of the server components from the target power supply to the reference power supply. That is, when the target power supply is supplying power, the second reference voltage difference between the reference control terminal and the reference output terminal can be controlled to be greater than the second voltage threshold through the target switching device, so that the reference switching device controls the reference input terminal and the reference output terminal to be disconnected, so as to supply power to the server components only using the target power supply. In addition, the target switching device can also control the first reference voltage difference to be less than the first voltage threshold, thereby preventing a leakage current from flowing from the reference input terminal of the reference switching device to the reference output terminal, avoiding the problem in the related art that a battery discharges current to a load terminal, resulting in an abnormal power supply switching. By adopting the above technical solution, the problems in the related art, such as a relatively high probability of power supply failure during the power supply process of the server, are solved, and the technical effect of reducing the probability of power supply failure during the power supply process of the server is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is the first power supply switching circuit in the related art;
[0032] Figure 2 is the second power supply switching circuit in the related art;
[0033] Figure 3 is a schematic diagram of a power supply switching circuit for a server according to an embodiment of the present application;
[0034] Figure 4 is a schematic diagram of a target switching device according to an embodiment of the present application;
[0035] Figure 5 Schematic diagram of a first target switcher according to an embodiment of the present application;
[0036] Figure 6 Schematic diagram of a first target switcher, a second target switcher and a reference switching device according to an embodiment of the present application;
[0037] Figure 7 Hardware structure block diagram of a computer device for a power supply switching method of a server according to an embodiment of the present application;
[0038] Figure 8 Flowchart of a power supply switching method of a server according to an embodiment of the present application;
[0039] Figure 9 Structure block diagram of a power supply switching device of a server according to an embodiment of the present application;
[0040] Figure 10 Schematic diagram of an electronic device according to an embodiment of the present application. Detailed implementation manners
[0041] In the following, embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments.
[0042] The present application proposes a power supply switching method for a server. Before describing the optional embodiments of the present application, in order to better understand the inventive concept of the present application and the creativity of the solution, the related technologies will be described first:
[0043] Figure 1 The first power supply switching circuit in the related technology is as Figure 1 shown. The first power supply switching circuit uses two diodes and utilizes the unidirectional conductivity of the diodes to achieve the switching between power supplies. The load is an IC (Integrated Circuit) such as a sensor. There are 2 power supplies to supply power to it: P3V3_MAIN and P3V3_BAT. The disadvantage of this solution is that the voltage drop of the diode is too large. The voltage drop of an ordinary diode is 0.7V. When a Schottky diode is selected, the voltage drop is still very large, which will cause waste of the battery voltage and reduce the battery life. For example, when the LBAS70 diode is selected, the voltage drop is about 0.5V (when the load current is 2ma). When the battery voltage is lower than 2.5V, P3V3 is less than 2V, which cannot ensure the normal operation of the monitoring board chip (the working voltage range of the MCU, temperature sensor, vibration sensor, and air pressure sensor on the monitoring board is between 2v and 3.3v). For diodes with a smaller voltage drop, their reverse leakage current will be larger, and the battery current will be consumed reversely through the D6 diode, which cannot play the role of improving the battery life.
[0044] Figure 2It is the second power supply switching circuit in the related art. As Figure 2 shown, based on the first power supply switching circuit, the second power supply switching circuit deletes the (D2) diode and selects a MOS transistor as the switching switch. The disadvantage of this solution is that it is only applicable to the case where the voltage difference between the two power supplies is relatively large. When the voltage difference between the two power supplies is relatively small, when powered by P3V3_MAIN, after passing through the diode, the P3V3 voltage (the voltage at the load) is 2.8V. At this time, if the output voltage of the battery voltage P3V3_BAT is greater than 2.8V, it will discharge current to the P3V3 network through the body diode of the Q1 MOS transistor (characteristic of the body diode inside the MOS transistor: when the voltage of the drain D is higher than the voltage of the source S, the drain D discharges current to the source S through the body diode), resulting in two power supplies supplying power to the load at the same time, causing power supply disorder and unable to perform the power supply switching function.
[0045] Based on the problems such as the relatively high probability of power supply failure in the power supply process of the server existing in the above-mentioned related art circuit, the present application proposes a power supply switching circuit for a server, which can reduce the probability of power supply failure in the power supply process of the server. The following will be introduced in detail.
[0046] It should be noted that the terms "first", "second", etc. in the description, claims and the above-mentioned drawings of the present application are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence.
[0047] In this embodiment, a power supply switching circuit for a server is provided. Figure 3 It is a schematic diagram of a power supply switching circuit for a server according to an embodiment of the present application. As Figure 3 shown, a reference power supply (P3V3_BAT) and a target power supply (P3V3_MAIN) are connected to a server component to be powered (which can be, but is not limited to, an IC such as a monitoring board / sensor of the server) through a power supply switching circuit. The power supply switching circuit includes: a reference switching device and a target switching device. The reference switching device is connected to the target power supply through a reference control terminal (G3), a reference input terminal (D3) is connected to the reference power supply, and a reference output terminal (S3) is connected to the server component. When the first reference voltage difference between the reference input terminal (D3) and the reference output terminal (S3) is greater than or equal to a first voltage threshold, the reference input terminal (D3) leaks current to the reference output terminal (S3), and the target power supply is connected to the server component and the reference output terminal (S3) through the target switching device;
[0048] The target switching device is configured to, when the target power supply is powered on, control the connection between the target power supply and the server component, control the second reference voltage difference between the reference control terminal (G3) and the reference output terminal (S3) to be greater than a second voltage threshold, and control the first reference voltage difference to be less than the first voltage threshold; when the target power supply is powered off, control the second reference voltage difference to be less than or equal to the second voltage threshold.
[0049] The reference switching device is configured to, when the second reference voltage difference is greater than the second voltage threshold, control the disconnection between the reference input terminal (D3) and the reference output terminal (S3) so as to supply power to the server component only using the target power supply, and when the second reference voltage difference is less than or equal to the second voltage threshold, control the connection between the reference input terminal (D3) and the reference output terminal (S3) so as to switch the power supply of the server component from the target power supply to the reference power supply.
[0050] Optionally, in this embodiment, when the first reference voltage difference between the reference input terminal (D3) and the reference output terminal (S3) is greater than or equal to the first voltage threshold, the reference input terminal (D3) leaks current to the reference output terminal (S3), where when the first reference voltage difference Vd3s3 is greater than or equal to the first voltage threshold Vthreshold_1, the reference input terminal (D3) leaks current to the reference output terminal (S3).
[0051] Optionally, in this embodiment, when the target power supply is powered on, the target switching device is configured to control the connection between the target power supply and the server component. The target switching device is further configured to control the second reference voltage difference Vg3s3 between the reference control terminal (G3) and the reference output terminal (S3) to be greater than the second voltage threshold Vthreshold_2 (which can take a value of 0 but is not limited thereto) (correspondingly, the reference switching device controls the disconnection between the reference input terminal (D3) and the reference output terminal (S3) when the second reference voltage difference is greater than the second voltage threshold). The target switching device is further configured to control the first reference voltage difference to be less than the first voltage threshold (aiming to prevent the reference input terminal (D3) from leaking current to the reference output terminal (S3)).
[0052] Optionally, in this embodiment, Vd3s3 = Vd3 - Vs3, where Vd3s3 is the first reference voltage difference, Vd3 is the voltage value of the reference input terminal (D3), and Vs3 is the voltage value of the reference output terminal (S3).
[0053] Optionally, in this embodiment, Vg3s3 = Vg3 - Vs3, where Vg3s3 is the second reference voltage difference, Vg3 is the voltage value of the reference control terminal (G3), and Vs3 is the voltage value of the reference output terminal (S3).
[0054] As an alternative solution, Figure 4 is a schematic diagram of a target switching device according to an embodiment of the present application, as Figure 4 shown. The target switching device includes: a first target switch and a second target switch. The second target switch includes a second target control terminal (G2), a second target input terminal (D2), and a second target output terminal (S2). The target power supply is connected to the second target control terminal (G2) through the first target switch, and the target power supply is also connected to the second target input terminal (D2). The target power supply is connected to the server component and the reference output terminal (S3) through the second target output terminal (S2) in the target switching device;
[0055] The first target switch is configured to control the second target voltage difference between the second target control terminal (G2) and the second target output terminal (S2) to be less than or equal to a third voltage threshold when the target power supply is powered;
[0056] The second target switch is configured to control the second target input terminal (D2) and the second target output terminal (S2) to conduct when the second target voltage difference is less than or equal to the third voltage threshold, and to prohibit the second target output terminal (S2) from leaking current to the second target input terminal (D2) when the target power supply is powered off.
[0057] Optionally, in this embodiment, when the target power supply is powered, the first target switch is configured to control the second target voltage difference Vg2s2 between the second target control terminal (G2) and the second target output terminal (S2) to be less than or equal to a third voltage threshold Vthreshold_3 (which can take a value of 0 but is not limited to this). Correspondingly, when the second target voltage difference is less than or equal to the third voltage threshold, the second target switch is configured to control the second target input terminal (D2) and the second target output terminal (S2) to conduct, so that the target power supply supplies power to the server component.
[0058] As an alternative solution, Figure 5 is a schematic diagram of a first target switch according to an embodiment of the present application, as Figure 5As shown in the figure, the first target switch includes a first target switch (G1), a first target input terminal (D1), and a first target output terminal (S1). The first target switch is connected to the target power supply through the first target switch (G1), and is connected to the second target control terminal (G2) of the second target switch through the first target input terminal (D1). The first target output terminal (S1) is grounded. When the target power supply is powered on, the first target voltage difference between the first target switch (G1) and the first target output terminal (S1) is greater than or equal to the fourth voltage threshold;
[0059] The first target switch is configured to control the first target output terminal (S1) and the first target input terminal (D1) to conduct when the first target voltage difference is greater than or equal to the fourth voltage threshold, so that the second target voltage difference is less than or equal to the third voltage threshold;
[0060] The first target switch is further configured to control the first target output terminal (S1) and the first target input terminal (D1) to be disconnected when the first target voltage difference is less than the fourth voltage threshold.
[0061] Optionally, in this embodiment, when the target power supply is powered on, the first target voltage difference Vg1s2 between the first target switch (G1) and the first target output terminal (S1) is greater than or equal to the fourth voltage threshold Vthreshold_4 (which can take a value of 0 but is not limited to this). Correspondingly, when the first target voltage difference Vg1s2 is greater than or equal to the fourth voltage threshold Vthreshold_4, the first target switch is configured to control the first target output terminal (S1) and the first target input terminal (D1) to conduct. Once the first target output terminal (S1) and the first target input terminal (D1) conduct, the second target control terminal (G2) is grounded, and the second target voltage difference Vg2s2 between the second target control terminal (G2) and the second target output terminal (S2) is less than or equal to the third voltage threshold Vthreshold_3.
[0062] As an optional solution, the second target switch is a second P-type field effect transistor Q2. The second target control terminal (G2) is the second target gate of the second P-type field effect transistor Q2. The second target input terminal (D2) is the second target drain of the second P-type field effect transistor Q2. The second target output terminal (S2) is the second target source of the second P-type field effect transistor Q2. The second target drain and the second target source are connected through the second target body diode of the second P-type field effect transistor Q2. The conduction direction of the second target body diode is from the second target drain to the second target source;
[0063] The second target body diode is used to prevent current leakage from the second target source to the second target drain when the target power supply is powered off;
[0064] The second target body diode is further used to allow current leakage from the second target drain to the second target source when the target power supply is powered on, until the second target voltage difference between the second target gate and the second target source is less than or equal to the third voltage threshold.
[0065] As an alternative solution, the first target switch is a first N-type field effect transistor Q1, the first target switch (G1) is the first target gate, the first target input terminal (D1) is the first target drain, and the first target output terminal (S1) is the first target source.
[0066] As an alternative solution, the reference switching device is a reference P-type field effect transistor Q3, the reference control terminal (G3) is the reference gate of the reference P-type field effect transistor Q3, the reference input terminal (D3) is the reference drain of the reference P-type field effect transistor Q3, the reference output terminal (S3) is the reference source of the reference P-type field effect transistor Q3, and the reference drain and the reference source are connected through the reference body diode of the reference P-type field effect transistor Q3. The conduction direction of the reference body diode is from the reference drain to the reference source;
[0067] The reference body diode is used to prevent current leakage from the reference source to the reference drain when the target power supply is powered on; it is also used to allow current leakage from the reference drain to the reference source when the target power supply is powered off, until the second reference voltage difference between the reference gate and the reference source is less than or equal to the second voltage threshold;
[0068] The reference P-type field effect transistor Q3 is used to control the disconnection between the reference drain and the reference source when the second reference voltage difference between the reference gate and the reference source is greater than the second voltage threshold, so as to supply power to the server component only using the target power supply, and to control the conduction between the reference drain and the reference source when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server component from the target power supply to the reference power supply.
[0069] Optionally, in this embodiment, Figure 6 is a schematic diagram of a first target switch, a second target switch, and a reference switching device according to an embodiment of the present application, as Figure 6As shown, P3V3_BAT is the battery output voltage, and P3V3_MAIN is the motherboard output voltage. The field effect transistor is a MOS transistor. MOS transistors are divided into P-type MOS transistors (for example, the second P-type field effect transistor Q2 and the reference P-type field effect transistor Q3) and N-type MOS transistors (for example, the first N-type field effect transistor Q1).
[0070] For a P-type MOS transistor, when Vgs is less than the threshold voltage (Vth, usually Vth is a negative value), the PMOS conducts, and the current flows from the source to the drain. That is, its conduction condition is Vgs < Vth, and as Vgs decreases (the absolute value increases), the drain current (Id) will increase. Among them, Vgs = Vg - Vs, where Vg is the gate voltage and Vs is the source voltage.
[0071] For an N-type MOS transistor, the current is controlled by controlling the gate-source voltage (Vgs). When Vgs is greater than the threshold voltage (Vth), the NMOS conducts, and the current flows from the drain to the source. Its conduction condition is Vgs > Vth (usually Vth is a positive value), and as Vgs increases, the drain current (Id) will increase. Among them, Vgs = Vg - Vs, where Vg is the gate voltage and Vs is the source voltage.
[0072] As Figure 6 shown, the battery output voltage P3V3_BAT is connected to the reference drain D3 of the PMOS transistor Q3 (i.e., the reference P-type field effect transistor). The reference source S3 of Q3 is interconnected with the second target source S2 of Q2 (the second P-type field effect transistor) and the resistor R2. The reference gate G3 of the PMOS transistor Q3 is interconnected with the first target gate G1 of the PMOS transistor Q1 (i.e., the first N-type field effect transistor) and is connected to GND through the series resistor R1. The first target drain D1 of the NMOS transistor Q1 is interconnected with the second target gate G2 of the PMOS transistor Q2 and the resistor R2. The server motherboard power supply P3V3_MAIN, after passing through the second target drain D2 and the second target source S2 of the PMOS transistor Q2, is filtered by the C1 capacitor and then supplies power to sensors and other ICs.
[0073] When P3V3_MAIN is powered on, the gates (G3, G1) of Q3 PMOS transistor and Q1 NMOS transistor are at high level. Therefore, Vg3s3 = 0v, Q3 PMOS transistor is turned off, and the battery stops supplying power to the load circuit. Q1 NMOS transistor is turned on, and the second target gate G2 of Q2 PMOS transistor is pulled down to low level. P3V3_MAIN discharges current to the P3V3 network (the voltage at the load output) through the body diode of Q2 (the second target body diode), thereby making Vg2s2 < 0v, Q2 is turned on, and the voltage of the P3V3 network is approximately equal to P3V3_MAIN. Due to the reverse cut-off effect of the body diode of Q3 PMOS transistor (the reference body diode), no current will flow from the load end P3V3 into the battery, and no reverse charging will occur, thus preventing damage to the battery. The voltage of the main board power supply P3V3_MAIN is not less than the battery voltage P3V3_BAT, and the battery cannot leak current to the load end P3V3 network through the body diode of Q3.
[0074] When P3V3_MAIN is not powered on, the gates of Q3 PMOS transistor and Q1 NMOS transistor are at zero level, and the potential of the second target gate G2 of Q2 PMOS transistor is the same as that of its second target source S2. Therefore, Q2 is turned off; first, the battery network P3V3_BAT discharges voltage to S3 through the body diode of Q3. When the voltage reaches a certain value, Q3 is turned on, and P3V3_BAT is transmitted to the P3V3 network. Similarly, due to the cut-off effect of the body diode of Q2, the battery current will not flow to P3V3_MAIN, and thus no leakage problem will occur. When the MOS transistor is turned on, the resistance Rds(on) between its drain and source is a few ohms. Multiply it by the maximum on-current of 2ma and reach the load end, and the battery voltage drops by a few mv, which is much less than 0.5v, thereby improving the power utilization rate of the battery.
[0075] When designing this circuit, attention should be paid to the seamless automatic switching problem. Appropriate components with proper parameters are required to achieve seamless automatic switching. The main parameters are as follows:
[0076] I. Parameters of PMOS transistor: MOS transistors have a threshold voltage. The smaller the threshold voltage, the easier it is for the MOS transistor to conduct. The faster the automatic switching speed of the above circuit.
[0077] II. Figure 6 Resistors R1, R2 in: The smaller the resistance value, the faster the on and off speeds of the MOS transistor. However, due to the power consumption problem of R2, it cannot be chosen too small. If it is too small, it will cause the system to waste a lot of extra power consumption. Generally, values above several hundred k ohms are selected.
[0078] III. Figure 6 Capacitor C1 in: The capacitor at the P3V3 terminal generally needs to be selected above 100uf. The larger the capacitance value, the more charge it stores, and it will make the seamless switching more stable.
[0079] IV. Input Capacitor: For the capacitor at P3V3_MAIN, it is better not to add it if possible. If there is a capacitor, it will cause the power-down of P3V3_MAIN to be slow, which will further lead to an extended cut-off time of the PMOS, and is not conducive to switching.
[0080] V. Load Power Consumption: The greater the load power consumption, the more likely it is to cause a larger voltage drop during switching, which may lead to system reset. Therefore, whether from the perspective of increasing battery life or ensuring the stability of circuit switching, it is necessary to select devices with low load power consumption.
[0081] As shown above, Figure 6 As shown, 3 MOS transistors are used in the circuit. Q1 is an NMOS, and Q3 and Q2 are PMOS, and it is required that Q3 and Q2 have the same model. The source of Q1 is connected to GND, and the drain D1 is interconnected with R2 and the gate G2 of Q2; the gate G1 of Q1 is interconnected with P3V3_MAIN, the drain D2 of Q2, the resistor R1, and the gate G3 of Q3; the source S2 of Q2 is interconnected with the series resistor R2, the capacitor C1, and the source S3 of the PMOS transistor Q3, and the drain D3 of Q3 is connected to the battery network P3V3_BAT. When the main board power supply P3V3_MAIN is powered on, the MOS transistors Q1 and Q2 are turned on, and Q3 is turned off. The P3V3 voltage comes from P3V3_MAIN, and there will be no phenomenon of charging the battery; when the main board power supply P3V3_MAIN is powered off, the MOS transistors Q1 and Q2 are turned off, and Q3 is turned on. The P3V3 voltage comes from P3V3_BAT. When the MOS transistor is turned on, the impedance between its drain and source is only a few ohms, so that the voltage drop between the battery and the load is very small.
[0082] It should be noted that Figure 6 The figure shows a switching circuit between two power supplies. For the switching of more power supplies, the power supply switching circuit of the server mentioned in this solution can also be used. For example, in the switching solution between three power supplies, more MOS transistors can be deployed on three power supply lines, and the control logic and idea of this solution can be adopted to connect the gates, drains, and sources of the MOS transistors in the circuit, so as to achieve power supply redundancy. The power supply switching circuit of the server protected by this application can not only solve the problem of excessive voltage drop at the load end when the backup power supply (i.e., battery power supply) is used, and the battery power cannot be fully utilized; but also solve the problems of battery leakage and reverse charging.
[0083] The method embodiments provided in the embodiments of this application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 7 is a hardware structure block diagram of a computer device for a power supply switching method of a server in an embodiment of this application. As Figure 7 shown, the server device may include one or more (Figure 7 Only one processor 102 is shown (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a field programmable gate array FPGA), and a memory 104 for storing data. Among them, the above server device may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 7 The structure shown is only schematic and does not limit the structure of the above server device. For example, the server device may further include more or fewer components than Figure 7 shown, or have a different configuration from Figure 7 shown.
[0084] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the power supply switching method of the server in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the server device through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0085] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by the communication provider of the server device. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0086] In this embodiment, a power supply switching method for a server is provided. Figure 8 It is a flowchart of a power supply switching method for a server according to an embodiment of the present application, as Figure 8As shown in the figure, the reference power supply and the target power supply are connected to the server component to be powered through a power supply switching circuit. The power supply switching circuit includes: a reference switching device and a target switching device. The reference switching device is connected to the target power supply through a reference control terminal, a reference input terminal is connected to the reference power supply, and a reference output terminal is connected to the server component. When the first reference voltage difference between the reference input terminal and the reference output terminal is greater than or equal to the first voltage threshold, the reference input terminal leaks current to the reference output terminal. The target power supply is connected to the server component and the reference output terminal through the target switching device. The method is applied to the target switching device, and the method flow includes the following steps:
[0087] Step S82, when the target power supply is supplying power, control the target power supply to conduct with the server component, control the second reference voltage difference between the reference control terminal and the reference output terminal to be greater than the second voltage threshold, and control the first reference voltage difference to be less than the first voltage threshold. Wherein, the reference switching device is configured to control the disconnection between the reference input terminal and the reference output terminal when the second reference voltage difference is greater than the second voltage threshold, so as to supply power to the server component only using the target power supply;
[0088] Step S84, when the target power supply is powered off, control the second reference voltage difference to be less than or equal to the second voltage threshold. Wherein, the reference switching device is configured to control the connection between the reference input terminal and the reference output terminal when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server component from the target power supply to the reference power supply.
[0089] Optionally, in this embodiment, when the target power supply is supplying power, the second reference voltage difference between the reference control terminal and the reference output terminal can be controlled to be greater than the second voltage threshold through the target switching device, so that the reference switching device controls the disconnection between the reference input terminal and the reference output terminal, so as to supply power to the server component only using the target power supply. In addition, the target switching device can also control the first reference voltage difference to be less than the first voltage threshold, thereby preventing the reference input terminal of the reference switching device from leaking current to the reference output terminal, avoiding the problem in the related art that the battery discharges current to the load end, resulting in abnormal power supply switching. By adopting the above technical solution, the problems such as a relatively high probability of power supply failure in the power supply process of the server in the related art are solved, and the technical effect of reducing the probability of power supply failure in the power supply process of the server is achieved.
[0090] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation manner. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application.
[0091] In this embodiment, a power supply switching device for a server is further provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0092] Figure 9 is a structural block diagram of a power supply switching device for a server according to an embodiment of the present application; as Figure 9 shown, a reference power supply and a target power supply are connected to a server component to be powered through a power supply switching circuit. The power supply switching circuit includes: a reference switching device and a target switching device. The reference switching device is connected to the target power supply through a reference control terminal, a reference input terminal is connected to the reference power supply, and a reference output terminal is connected to the server component. When a first reference voltage difference between the reference input terminal and the reference output terminal is greater than or equal to a first voltage threshold, the reference input terminal leaks current to the reference output terminal. The target power supply is connected to the server component and the reference output terminal through the target switching device. The device is applied to the target switching device and includes:
[0093] A first control module 902, configured to, when the target power supply supplies power, control the target power supply to conduct with the server component, control a second reference voltage difference between the reference control terminal and the reference output terminal to be greater than a second voltage threshold, and control the first reference voltage difference to be less than the first voltage threshold. Wherein, the reference switching device is configured to disconnect the reference input terminal and the reference output terminal when the second reference voltage difference is greater than the second voltage threshold, so as to supply power to the server component only using the target power supply;
[0094] A second control module 904, configured to control the second reference voltage difference to be less than or equal to the second voltage threshold when the target power supply is powered off, where the reference switching device is configured to control the reference input terminal and the reference output terminal to be conducted when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server component from the target power supply to the reference power supply.
[0095] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.
[0096] An embodiment of the present application further provides a computer program product, including a computer program, where the computer program, when executed by a processor, implements the steps of the methods in the various embodiments of the present application; the computer program product further includes a non-volatile computer-readable storage medium, and the non-volatile computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the steps of the methods in the various embodiments of the present application.
[0097] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0098] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc, etc., various media that can store a computer program.
[0099] An embodiment of the present application further provides an electronic device, Figure 10 is a schematic diagram of an electronic device according to an embodiment of the present application, as Figure 10 shown, the electronic device includes a memory and a processor, a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0100] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, where the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0101] For the specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details thereof will not be repeated herein.
[0102] Obviously, those skilled in the art should understand that the various modules or steps of the present application described above can be implemented by a general-purpose computing device. They can be centralized on a single computing device or distributed over a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a sequence different from that here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to be implemented. In this way, the present application is not limited to any specific combination of hardware and software.
[0103] The above are only the preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application shall be included in the protection scope of the present application.
Claims
1. A power supply switching circuit for a server, characterized in that: The reference power supply and the target power supply are connected to the server component to be powered through a power supply switching circuit, the power supply switching circuit comprising: a reference switching device and a target switching device, the reference switching device is connected to the target power supply through a reference control terminal, a reference input terminal is connected to the reference power supply, and a reference output terminal is connected to the server component, when a first reference voltage difference between the reference input terminal and the reference output terminal is greater than or equal to a first voltage threshold, the reference input terminal leaks current to the reference output terminal, and the target power supply is connected to the server component and the reference output terminal through the target switching device; The target switching device is used to control the target power supply to be turned on with the server component, control the second reference voltage difference between the reference control terminal and the reference output terminal to be greater than a second voltage threshold, and control the first reference voltage difference to be less than the first voltage threshold when the target power supply is powered on; and control the second reference voltage difference to be less than or equal to the second voltage threshold when the target power supply is powered off; The reference switching device is used to control the reference input terminal and the reference output terminal to be disconnected when the second reference voltage difference is greater than the second voltage threshold, so that only the target power supply is used to power the server component, and to control the reference input terminal and the reference output terminal to be connected when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server component from the target power supply to the reference power supply.
2. The power supply switching circuit according to claim 1, characterized in that: The target switching device comprises: a first target switch and a second target switch, wherein the second target switch comprises a second target control terminal, a second target input terminal and a second target output terminal, wherein the target power supply is connected to the second target control terminal via the first target switch, the target power supply is also connected to the second target input terminal, and the target power supply is connected to the server component and the reference output terminal via the second target output terminal in the target switching device; The first target switch is used to control a second target voltage difference between the second target control terminal and the second target output terminal to be less than or equal to a third voltage threshold when the target power supply is powered; The second target switch is used to control the second target input terminal and the second target output terminal to be turned on when the second target voltage difference is less than or equal to the third voltage threshold, and to prohibit the second target output terminal from leaking current to the second target input terminal when the target power supply is powered off.
3. The power supply switching circuit according to claim 2, characterized in that: The first target switch comprises a first target control terminal, a first target input terminal and a first target output terminal, the first target switch is connected to the target power supply via the first target control terminal, and is connected to the second target control terminal of the second target switch via the first target input terminal, the first target output terminal is grounded, and when the target power supply is supplied, a first target voltage difference between the first target control terminal and the first target output terminal is greater than or equal to a fourth voltage threshold; The first target switch is used to control the first target output terminal to be connected with the first target input terminal when the first target voltage difference is greater than or equal to a fourth voltage threshold, so that the second target voltage difference is less than or equal to the third voltage threshold; The first target switch is further used to control the first target output terminal to be disconnected from the first target input terminal when the first target voltage difference is less than a fourth voltage threshold.
4. The power supply switching circuit according to claim 2, characterized in that: The second target switch is a second P-type field effect transistor, the second target control terminal is a second target gate of the second P-type field effect transistor, the second target input terminal is a second target drain of the second P-type field effect transistor, the second target output terminal is a second target source of the second P-type field effect transistor, the second target drain is connected to the second target source via a second target body diode of the second P-type field effect transistor, and the conduction direction of the second target body diode is from the second target drain to the second target source; The second target body diode is used to prohibit the second target source from leaking current to the second target drain when the target power supply is powered off; The second target body diode is further used to allow the second target drain to leak current to the second target source when the target power supply is powered, until the second target voltage difference between the second target gate and the second target source is less than or equal to the third voltage threshold.
5. The power supply switching circuit according to claim 3, characterized in that: The first target switch is a first N-type field effect transistor, the first target control terminal is a first target gate, the first target input terminal is a first target drain, and the first target output terminal is a first target source.
6. The power supply switching circuit according to claim 1, characterized in that: The reference switching device is a reference P-type field effect transistor, the reference control terminal is a reference gate of the reference P-type field effect transistor, the reference input terminal is a reference drain of the reference P-type field effect transistor, the reference output terminal is a reference source of the reference P-type field effect transistor, the reference drain is connected to the reference source via a reference body diode of the reference P-type field effect transistor, and the conduction direction of the reference body diode is from the reference drain to the reference source; The reference body diode is used to prohibit the reference source from leaking current to the reference drain when the target power supply is powered; and is also used to allow the reference drain to leak current to the reference source when the target power supply is powered off, until the second reference voltage difference between the reference gate and the reference source is less than or equal to the second voltage threshold; The reference P-type field effect transistor is used to control the reference drain to be disconnected from the reference source when the second reference voltage difference between the reference gate and the reference source is greater than the second voltage threshold, so as to use only the target power supply to power the server component, and to control the reference drain to be connected to the reference source when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server component from the target power supply to the reference power supply.
7. A method for switching power supply of a server, characterized in that: A reference power supply and a target power supply are connected to a server component to be powered through a power supply switching circuit, the power supply switching circuit comprising: a reference switching device and a target switching device, the reference switching device is connected to the target power supply through a reference control terminal, a reference input terminal is connected to the reference power supply, and a reference output terminal is connected to the server component, when a first reference voltage difference between the reference input terminal and the reference output terminal is greater than or equal to a first voltage threshold, the reference input terminal leaks current to the reference output terminal, the target power supply is connected to the server component and the reference output terminal through the target switching device, and the method is applied to the target switching device, comprising: In the case where the target power supply is powered, controlling the target power supply to be turned on with the server component, controlling the second reference voltage difference between the reference control terminal and the reference output terminal to be greater than a second voltage threshold, and controlling the first reference voltage difference to be less than the first voltage threshold, wherein the reference switching device is configured to control the reference input terminal to be disconnected from the reference output terminal when the second reference voltage difference is greater than the second voltage threshold, so as to use only the target power supply to power the server component; In the event that the target power supply is powered off, the second reference voltage difference is controlled to be less than or equal to the second voltage threshold, wherein the reference switching device is configured to control the reference input terminal and the reference output terminal to be turned on when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server component from the target power supply to the reference power supply.
8. A power supply switching device for a server, characterized in that: The reference power supply and the target power supply are connected to the server component to be powered through a power supply switching circuit, the power supply switching circuit includes: a reference switching device and a target switching device, the reference switching device is connected to the target power supply through a reference control terminal, a reference input terminal is connected to the reference power supply, and a reference output terminal is connected to the server component, when a first reference voltage difference between the reference input terminal and the reference output terminal is greater than or equal to a first voltage threshold, the reference input terminal leaks current to the reference output terminal, the target power supply is connected to the server component and the reference output terminal through the target switching device, and the device is applied to the target switching device, including: a first control module, configured to control the target power supply to be turned on with the server component, control the second reference voltage difference between the reference control terminal and the reference output terminal to be greater than a second voltage threshold, and control the first reference voltage difference to be less than the first voltage threshold when the target power supply is supplying power, wherein the reference switching device is configured to control the reference input terminal to be disconnected from the reference output terminal when the second reference voltage difference is greater than the second voltage threshold, so as to use only the target power supply to supply power to the server component; A second control module is used to control the second reference voltage difference to be less than or equal to the second voltage threshold when the target power supply is powered off, wherein the reference switching device is configured to control the reference input terminal and the reference output terminal to be turned on when the second reference voltage difference is less than or equal to the second voltage threshold, so as to switch the power supply of the server component from the target power supply to the reference power supply.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method according to claim 7 when executed by a processor.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to claim 7 are implemented.