Because of the soft dynamic performance of the fuel cell stack, the battery is usually integrated in the power system in fuel cell hybrid electric vehicles. In this paper, a real time energy management strategy considering thermal constraints based on speed prediction with neuron network is proposed. The main principle of the proposed control strategy is to get the future power requirement with model predictive control based on the historic speed information, and then optimize the objective function according to the state variables. The objective function is set to minimize the equivalent fuel consumption of the vehicle and extend the life span of the fuel cell stack based on thermal constraints. Contrasting with the control strategy without thermal constraints under the WLTC driving cycle, the proposed energy management is 0.9% higher, but the temperature of the fuel cell stack and the battery can be limited within an appropriate range. The total equivalent fuel consumption is 3.9% lower than dynamic programming control strategy, which proves the availability of the proposed control strategy can reduce the equivalent fuel consumption while prolonging the fuel cell stack life span. Hardware in loop (HIL) experiment is implemented to testify the real time application of the proposed control strategy.