The expansion of the electric power communication network year by year has enabled a large number of intelligent terminals to be accessed exponentially. Massive intelligent terminals connected to the power communication network have a huge processing demand, which causes a heavy maintenance burden on the equipment of communication networks. In order to solve this problem, this study proposes a flexible communication mechanism based on the device-to-device (D2D) technique for the intelligent terminals to deal with the processing pressure of massive information in the network. This proposed mechanism introduces where and how to use the D2D technique. In this study, this communication mechanism makes terminals give a high priority to transferring the information of important services. The D2D communication model is formulated for this communication mechanism, and the influence of different conditions on the D2D communication is analysed. The D2D communication mechanism is simulated to optimise the existing network indexes, such as traffic and sum of service level. This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited.