An Intelligent Framework for Smart Power Grid