Prediction of energy consumption for a country (region) plays critical roles in economy and energy security, and accurate energy consumption forecasting is valuable for policy makers to formulate energy policies. To do this, we propose a novel improved GM(1,1) model, which is based on both data transformation for the original data sequence and optimization of the background value, and is therefore named as TBGM(1,1). TBGM(1,1) is employed to predict the total energy consumption of Shanghai City in China. And the results suggest that the TBGM(1,1) performs well compared with the traditional GM(1,1) model and other grey modification models in this context and Shanghai's total energy consumption will increase stably in the following five years. In summary TBGM(1,1) proposed in our study has competent exploration and exploitation ability, and TBGM(1,1) could be utilized as an effective and promising tool for short-term planning, which can be applied for energy consumption forecasting in particular and for other forecasting issues as well.