In order to solve the problem of the dynamic error affecting the test accuracy of the thermocouple sensor during the transient temperature test, the dynamic compensation method of the thermocouple sensor based on the improved gray wolf optimization (IGWO) algorithm is proposed. The gray wolf optimization (GWO) algorithm is improved by changing the candidate solution generation strategy and introducing the dynamic weighting factor, thereby further improving the time constant of the thermocouple sensor. According to the thermocouple sensor water bath method calibration data to obtain the compensation system transfer function, and experiments on the actual measured flame data is performed. The experimental results show that the time constant of the water bath calibration data is increased from 0.068 5 s to 0.014 7 s, and the dynamic error is reduced by nearly 75 %. The dynamic compensation system obtained by IGWO optimization effectively improves the dynamic characteristics of the thermocouple sensor and reduces the dynamic error of the thermocouple sensor. Copyright ©2021 Control and Decision.