Patent attributes
An electronic device assigns power to USB ports dynamically. A total current detection circuit transmits driving voltage signals to the USB ports, and detects whether a total current provided to the USB ports exceeds a rated total current and output a total current detection signal. A plurality of short-circuit detection circuits detects whether USB devices connected to the corresponding USB ports are shorted and to output a short-circuit detection signal. A plurality of relay circuits switch connection between the USB ports and the power circuit. A USB controller outputs a control signal according to the total current detection signal and the short-circuit detection signal and directs the relay circuits to switch connection between the corresponding USB ports and the power circuit on and off.