In order to achieve intelligent analysis of building energy consumption using data mining theoretical models and to provide support for energy management solutions for buildings, this study optimizes the DBSCAN clustering algorithm using the improved Tenebrae swarm optimization algorithm, applies the IBSO-DBSCAN algorithm to the data analysis of building energy consumption, and develops an intelligent analysis platform for building energy consumption in the Internet of Things (IoT). The clustering performance of the IBSO-DBSCAN algorithm and the optimization effect of the BSO algorithm are verified through experiments, and the accuracy of the IBSO-DBSCAN algorithm reaches 97.33%, which is 8% higher than that before optimization. The building energy use pattern is clustered into three categories, the energy consumption of category 1 is close to the horizontal state, the energy consumption of category 2 and category 3 shows the “double peak” characteristics, and the energy consumption of the buildings in category 1~3 increases in turn. The DBSCAN clustering algorithm in this paper can be used in the data mining of intelligent analysis platform to provide managers with energy consumption pattern information and decision support.