To realize the joint optimization of power systems and thermal systems and improve their energy utilization efficiency and economic benefits, an optimized operation method driven by power flow and exergy flow for a combined heat and power integrated energy system(CHP-IES) is proposed. Firstly, the Newton-Raphson method is used to calculate the power flow in polar coordinates. After iteration, important parameters such as electrical quantity and power at each node of the power network, temperature and flow rate at each node of the thermal network are obtained. Then, the exergy flow calculation mechanism of coupling elements such as power network, thermal network and CHP units is explored. Taking the CHP-IES composed of a 4-node electricity system and a 6-node thermal system as the object, the exergy flow distribution and exergy loss at each link are analyzed, and the joint optimization for the power system and thermal system is realized. The example proves that the optimization can keep the local and global exergy balance of the system, and the exergy efficiency of the thermal system is about 97 %.