Aiming at the problem that there are many obstacles indoor and the situation is complex, and the traditional robot path planning algorithm is ineffective, this paper proposes a grid path planning algorithm based on the improved differential evolution algorithm for the robot in the building. Firstly, the grid model is used to construct the path planning model of the robot in the building, and the running direction model of the robot indoor is obtained. On this basis, the intelligent algorithm optimization model of the path planning of the robot indoor is given. Secondly, the differential evolution algorithm is introduced to optimize the structural optimization index, and the Q learning method is used to improve the optimization algorithm to realize the building. Finally, the performance advantages of the proposed algorithm in obstacle avoidance and optimization planning of robot path are verified by the simulation of an example of robot path planning in building.