Detailed Description
In order that the above objects, features and advantages of the present application can be more clearly understood, a detailed description of the present application will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth to provide a thorough understanding of the present application, and the described embodiments are merely a subset of the embodiments of the present application and are not intended to be a complete embodiment. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different from that in the flowcharts. The terms first, second and the like in the description and in the claims, and the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. The methods disclosed in embodiments of the present application include one or more steps or actions for achieving the methods. The method steps and/or actions may be interchanged with one another without departing from the scope of the claims. In other words, unless a specific order of steps or actions is specified, the order and/or use of specific steps and/or actions may be modified without departing from the scope of the claims.
The reverse power supply technology is named in a relative manner, and generally, a power supply mode that current flows from a switch to a network terminal is called forward power supply, and a power supply mode that current flows from the network terminal to the switch is called reverse power supply. At present, network equipment and a switch respectively adopt independent power supplies for power supply, and if the switch is in power supply failure and loses power abnormally, the normal work of the network equipment can be influenced.
Based on the above, the present application provides a power supply method, a power supply device, and a storage medium, which can supply power to an exchange under the condition of abnormal power loss of the exchange, thereby maintaining normal operation of the exchange and a network device.
Example one
Referring to fig. 1, a first embodiment provides a power supply method, which includes the following steps:
and S11, acquiring external power supply information.
The power supply method of the embodiment one is applied to a power supply device, the power supply device includes a network device, and the network device is connected with a switch, and can be directly connected through a network port, and can also be connected with the switch through adapters of different types of ports.
The external power supply information includes whether the network device is connected to an external power supply on the exchange side. The network device can be a network camera, a video monitor, a network telephone, an industrial sensor and the like, and can also be other terminal devices which are networked through a switch network.
In step S11, the external power supply information may be acquired through an access port of the network device. For example, an access port of a network device includes a USB3.0 or USB type a/type b/type c port, and whether to access an external power source can be determined by detecting a voltage or a current of a port pin.
And S12, carrying out forward power supply by adopting an external power supply or carrying out reverse power supply by adopting an internal power supply according to external power supply information.
In step S12, the network device may determine whether to access the external power source by detecting the voltage amplitude or the current input of the access port. The external power supply can be a power supply of the switch or an independent standby power supply. If the external power supply is the power supply of the switch, the current flows from the switch to the network equipment, and the network equipment and the switch can be powered. If the external power supply is an independent standby power supply, the standby power supply can only supply power for the network equipment, and can also supply power for the network equipment and the switch at the same time.
The external Power source may be Power Over Ethernet (POE), or may be an Adapter (Adapter).
The internal power supply can be a power supply of the network equipment, and can also be an independent standby power supply. If the internal power supply is the power supply of the network equipment, the current flows from the network equipment to the switch, and the switch can be reversely powered. If the internal power supply is an independent standby power supply, the standby power supply can only supply power for the switch, and can also supply power for the network equipment and the switch at the same time. The internal power source may be powered by a Battery (Battery).
In the power supply method of the first embodiment, the external power supply is used for forward power supply or the internal power supply is used for reverse power supply, and an alternative power supply scheme can be provided when a power supply fault occurs to the switch or the network device, so that normal operation of the switch and the network device is guaranteed, network faults are reduced, and network stability is improved.
In some embodiments, step S11 specifically includes the following step S111: and detecting whether an external power supply is connected.
In step S111, whether an external power source is connected can be determined by detecting a voltage amplitude or a current input of the network device access port. When the network equipment adopts an internal power supply to supply power, the access port has no load, the voltage amplitude is 0, and no current is input; when the network equipment adopts an external power supply to supply power, the access port is hung with a load, the voltage amplitude is not 0, and current input exists. Whether the external power supply is connected or not is detected, judgment basis can be provided for power switching, and therefore a more flexible standby power supply scheme is provided.
In some embodiments, if the network device is connected to the external power source, step S12 includes the following specific steps:
s1211, disconnecting the power supply loop of the internal power supply.
In step S1211, the connection/disconnection of the internal power source may be controlled by the switch. The switch is connected between the access port of the network equipment and the power supply loop of the internal power supply.
The switch comprises a switch circuit which can be a triode switch circuit or a field effect transistor switch circuit and controls the connection on-off of the power supply loop through the high and low of the logic level. The logic level may be set according to the supply voltages of the external power supply and the internal power supply. The power supply voltage of the internal power supply can be set as a reference voltage, and if the power supply voltage of the external power supply is smaller than the reference voltage, the switch circuit is connected; and if the power supply voltage of the external power supply is not less than the reference voltage, the switching circuit is disconnected.
And S1212, adopting an external power supply to perform positive power supply.
In step S1212, the external power supply is connected to the network device through the access port, the voltage amplitude of the access port is transited, the power supply loop of the internal power supply is disconnected, at this time, the network device is powered by the external power supply, and the current is input from the access port. The external power supply can be used as an alternative power supply scheme of the network equipment, and when the network equipment has a power supply fault, the internal power supply can be switched into the external power supply, so that the normal work of the network equipment is maintained. In some embodiments, the external power source may serve as a main power supply of the network device, that is, the internal power source serves as a backup power supply of the network device, and when the network device is in normal operation, the access port is connected to the external power source, and the external power source continuously supplies power to the network device in a forward direction. When the external power supply has power supply failure, the internal power supply is switched to supply power, so that the normal work of the network equipment is guaranteed.
It is to be understood that the present embodiment does not limit the execution sequence of step S1211 and step S1212. In other embodiments, step S1211 may be performed after step S1212 is performed.
In some embodiments, if the network device does not access the external power source, step S12 includes the following specific steps S1221: and an internal power supply is adopted for reverse power supply.
In step S1221, if it is detected that the access port is not connected to the external power supply, the power supply circuit of the internal power supply is connected to supply power to the switch in the reverse direction.
It can be understood that the network device is connected with the switch, when there is no external power supply, it can be considered that the switch side has a power supply failure, and in order to avoid the network device from being disconnected, the internal power supply of the network device supplies power to the switch in a reverse direction, so as to maintain the normal operation of the network device and the switch.
In some embodiments, the external power source includes a first external power source and a second external power source, and if the first external power source and/or the second external power source is connected, the step S12 includes the following specific steps:
s1231, disconnecting a power supply loop of the internal power supply.
In step S1231, the network device includes at least two access ports, and the network device is connected to at least two corresponding external power sources through the at least two access ports. Taking two external power supplies as an example, the first access port is connected with the first external power supply, and the second access port is connected with the second access power supply. When an external power supply is connected, the voltage of the access port jumps, and the power supply loop of the internal power supply is disconnected.
It is understood that the first external power source and the second external power source may be powered by the same or different power modes, and the power modes include POE power supply or adapter power supply.
S1232, positive power supply is carried out by adopting the first external power supply or the second external power supply.
In step S1232, when two external power sources are simultaneously connected to the network device, only one of the external power sources is allowed to supply power to the network device to ensure power supply safety. A switch can be arranged between each access port and the internal power supply, and a multi-way selection switch can also be arranged between the access ports and the internal power supply. The priority of the external power supply can be set, and the corresponding switch link is selected to be conducted according to different priorities of the external power supply. The priority of the external power source may be set according to the magnitude of the supply voltage value. For example, the higher the supply voltage value of the external power supply, the higher the corresponding priority. When the external power supplies with different priorities are connected at the same time, the external power supply with low priority is disconnected, and only the external power supply with high priority is adopted for supplying power. When the external power supplies with the same priority are connected at the same time, one external power supply is randomly selected to be connected, the connection of other external power supplies is disconnected, and only one external power supply is reserved for supplying power.
It is to be understood that the present embodiment does not limit the execution sequence of step S1231 to step S1232. In other embodiments, step S1231 may be performed after step S1232 is performed.
Referring to fig. 2, the present embodiment provides a specific flow of a power supply method, where the method includes the following steps:
s21, acquiring a voltage value of an access port;
s22, judging whether an external power supply is accessed; if the external power supply is connected, executing step S23; otherwise, go to step S24;
s23, disconnecting a power supply loop of the internal power supply, and carrying out forward power supply by adopting an external power supply;
and S24, carrying out reverse power supply by adopting an internal power supply.
The present embodiment uses the internal power supply as the main power supply, that is, the internal power supply provides the power supply voltage of the network device in the normal operating state. When a power supply fault occurs on the side of the switch, the internal power supply supplies power to the switch in a reverse direction, and a Boost circuit such as a Boost chopper (Boost circuit) is arranged between the internal power supply and a connection port of the switch. The supply voltage of the internal power supply is converted into the operating voltage of the switch by the booster circuit. When the external power supply supplies positive power to the power supply equipment, a voltage reduction circuit such as a Buck chopper (Buck circuit) is arranged between the access port and the internal power supply. The supply voltage of the external power supply is converted into the working voltage of the network equipment through the voltage reduction circuit.
Example two
Referring to fig. 3, the second embodiment provides a power supply apparatus 30, where the power supply apparatus 30 includes: an internal power supply 31; an access port 32 for accessing an external power supply; and the power control switch 33 is respectively connected with the internal power supply 31 and the access port 32, and the power control switch 33 is used for controlling the connection and disconnection of the internal power supply according to the external power supply information of the access port so as to adopt the external power supply to carry out forward power supply or adopt the internal power supply to carry out reverse power supply.
In the power supply device 30 of the second embodiment, the power control switch 33 is disposed between the internal power supply 31 and the access port 32, and whether an external power supply is connected can be determined by detecting the voltage amplitude and the current input of the access port 32. The power control switch 33 can set a reference voltage, and the connection and disconnection of the connection link can be controlled by comparing the voltage value of the access port 32 with the reference voltage value. In some embodiments, the reference voltage may be a supply voltage of the internal power supply 31, and when the voltage value of the access port 32 is greater than the reference voltage, the connection link of the internal power supply 31 is disconnected; when the voltage value of the access port 32 is not greater than the reference voltage, the connection link of the internal power supply 31 is connected. The power supply device 30 may be the network device in the first embodiment, and may also be a power supply device that supplies power to the network device or the switch.
In some embodiments, if the access port is connected to an external power source, the power control switch is configured to: and disconnecting the power supply loop of the internal power supply to adopt the external power supply to carry out forward power supply.
The power supply equipment is connected with an external power supply through the access port, the voltage value of the access port jumps, the power supply control switch disconnects the connection link of the internal power supply, and the external power supply provides forward current at the moment. A voltage reduction circuit can be arranged between the access port and the external power supply to ensure the power supply safety and maintain the normal work of the network equipment.
In some embodiments, if the access port is not accessed with an external power source, the power control switch is configured to: and communicating the internal power supply to adopt the internal power supply to carry out reverse power supply.
The power supply equipment is not connected with an external power supply, the access port is not hung with a load, the voltage value of the access port is 0 at the moment, the power supply control switch is communicated with a connection link of the internal power supply, the internal power supply provides reverse current, and the power supply can supply power to the switch. A boost circuit may be provided between the connection port of the switch and the internal power supply to provide an operating voltage to maintain the normal operation of the switch.
In some embodiments, the external power source includes a first external power source and a second external power source, and if the first external power source and/or the second external power source is connected, the power control switch is configured to: and disconnecting the power supply loop of the internal power supply to adopt the first external power supply or the second external power supply to carry out forward power supply.
When the power supply equipment has at least two access ports, at least two external power supplies are respectively connected with the power supply equipment through the at least two access ports, and in order to ensure the power supply safety and improve the power supply efficiency of the external power supplies, the power supply control switch is used for disconnecting the connection link of the internal power supply and selecting one external power supply from the at least two external power supplies. The external power supply can be set according to the priority of the power supply voltage or the power supply current, and the power supply control switch is selectively connected with the external power supply according to the priority.
EXAMPLE III
The embodiment of the present application provides a storage medium for a computer-readable storage, where the storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the power supply method according to the first embodiment of the present application.
Storage media of embodiments of the present application include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer.
It can be understood that some technical features and technical effects of the second embodiment and the third embodiment of the present application may refer to corresponding technical features and technical effects of the first embodiment.
In order to more clearly understand the above embodiments of the present application, a webcam is taken as an example.
The network camera comprises a USB port and a battery, and is connected with a switch through a USB adapter (such as a USB Ethernet Dongle). The network camera can adopt the power supply of external adapter, perhaps adopts the mode of POE power supply, carries out the forward power supply to the network camera through the switch. When the switch loses power, the power supply of the external adapter and the power supply of the POE are not applicable, the network camera can reversely supply power to the switch through the battery to keep normal power supply, and therefore the normal work of the network camera is maintained.
If the USB port of the network camera is a USB3.0 type a port, the pin definition of the USB3.0 type a port is shown in table 1.
TABLE 1 Pin definitions for USB3.0 TypeA ports
The USB3.0 type a port includes the following three pairs of high-speed signal pairs: pin2 and Pin3, Pin5 and Pin6, Pin8 and Pin 9. The power is supplied in the forward direction by Pin1, the data signals are transmitted by Pin2 and Pin3, and the power is supplied in the reverse direction by Pin5 and Pin6, Pin8 and Pin 9. When the power detection pin detects that the external POE supplies power or the external adapter supplies power, the reverse power supply loop is automatically cut off to ensure the power supply safety.
Referring to fig. 4, one end of a Battery (Battery)43 is connected to the USB port 41 through a Charge/discharge circuit (Charge IC)42, the other end of the Battery 43 is connected to a network camera system 45 and one end of a Switch (Switch)46 through a Boost/Buck circuit (Boost/Buck)44, and the other end of the Switch 46 is connected to the USB port 41. The USB port 41 may control the switch 46 via a Power Detect (Power Detect) pin.
In the forward power supply process, an external power supply supplies power to the network camera through the USB port 41. The network camera system 45 can be directly powered by the charging and discharging circuit 42 and the Buck circuit, the battery 43 can be charged and discharged by the charging and discharging circuit 42, and the network camera system 45 is powered by the battery 43 and the Buck circuit. During the reverse power supply process, the battery 43 supplies power to the switch in the reverse direction through the Boost circuit and the USB port 41. A switch 46 is connected between the USB port 41 and the battery 43, and the USB port 41 controls the connection state of the switch 46. If the switch 46 is closed, the reverse power supply loop is connected; if the switch 46 is open, the reverse supply loop is open.
The embodiments of the present application have been described in detail with reference to the drawings, but the present application is not limited to the embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present application. Furthermore, the embodiments and features of the embodiments of the present application may be combined with each other without conflict.