Central heating system is a nolinear system with the features of thermal inertia and hysteretic nature, etc. In order to solve the temperature control problem of heat network uniform heating, this paper designs a flow controller using two-degree-of-freedom PID (Proportional-Integral-Derivative) control algorithm, which can adjust the two parameters of external disturbance inhibition property and target tracking feature independently and respectively to the best simultaneously so that the effects of thermal inertia, hysteretic nature and external disturbance on the system are reduced. Pipeline heat media flow is controlled by two-degree-of-freedom PID through the control of valve opening to change the heating capacity. All PID control parameters of the controller were set through particle swarm optimization. Several groups of simulation experiments were conducted by the designed two-degree-of-freedom PID controller and the traditional PID controller. According to the experimental results, compared with traditional PID controllers, two-degree-of-freedom PID controller has better control effect with faster response, shorter adjustment time, better robustness and stronger inhibition of disturbance.