The operation of a proton exchange membrane fuel cell (PEMFC) is greatly affected by temperature. Reliable thermal management of fuel cells can improve the life, efficiency, and power output of fuel cells. The model established in this paper is based on the inner layer of the fuel cell, and through the analysis of the heat change and material flow between layers, the simulink model can reflect the temperature change of the end plate, the bipolar plate, and the membrane electrode assembly (MEA) plate. In terms of the thermal management control strategy, the deviation and deviation rate between the MEA plate’s temperature and the target temperature are taken as input, and the fuzzy PID (proportional integral differential) controller is used to control the cooling water flow, to achieve a cooling effect. Due to the low efficiency and instability of a haploid genetic algorithm (GA) in solving dynamic optimization problems, a diploid genetic algorithm to optimize the membership function of the controller, and improve the adaptability of the control system, was designed. The simulation results show that compared with the haploid genetic algorithm, the optimal results of 100 iterations of the fuzzy PID control strategy reduce by 27.9%. Compared with the haploid genetic algorithm and fuzzy PID control, the MEA layer temperature, under the control of a diploid genetic algorithm, is reduced by 18% and 28%, respectively, and the minimum temperature difference of the reactor is 2.28 K.