In the context of carbon neutrality, energy conservation and carbon reduction in the heating industry have become the focus of attention. However, severe heat loss is currently occurring in the secondary heating system due to hydraulic imbalance, which is unable to supply heat according to users' needs. In view of this, a thermodynamic-hydraulic model of users’ demand for heat and flow rate for the heating system is established. Then, a novel method to regulate hydraulic imbalance is proposed, with the dynamic heat demand satisfied by regulating the valve opening based on NSGA-II. The optimization results show that the comprehensive hydraulic imbalance coefficient has been reduced from 23.08 to less than 0.019, which means that almost 100% of users can get heat supplies corresponding to their needs, while the energy consumption is reduced by about 30%. Additionally, when there are 1000 population and iteration steps, good convergence and high speed are presented using this method. In summary, an on-demand optimized model of hydraulic balance for the secondary heating network is put forward, which provides powerful engineering support and guidance for intelligent heating construction.