Accurate prediction of Municipal Solid Waste electricity generation is very important for the fine management of cities. In this study, Shanghai was taken as the research object, and six influencing factors of Municipal Solid Waste production were used as input indexes to realize the effective prediction of Municipal Solid Waste production through constructing a neural network model based on bidirectional long short term memory. At the same time, based on the predicted results and the forecast formula of MSW electricity generation, this study realized the harmless treatment of Municipal Solid Waste in Shanghai. Firstly, the economic, demographic, and social indicators related to Municipal Solid Waste were determined. Secondly, the bidirectional long and short time memory model is used to learn the features of the input indexes. Finally, the electricity generation capacity of Shanghai municipal solid waste in the next six years is predicted with the municipal solid waste electricity generation formula. The experimental results show that, firstly, the MAPE value of the bidirectional long and short time memory combination model established in this paper is 7.390, and the prediction performance of this model is better than that of the other five structural methods. Second, it is predicted that in 2025, the maximum electricity generation of Shanghai Municipal Solid Waste under the three scenarios will be 512752MkW, and the minimum electricity generation of Shanghai Municipal Solid Waste will be 260668MkW. Finally, this paper can be used as a scientific information source for environmental sustainability decision-making of domestic Municipal Solid Waste electricity generation technology.