After long-term operation, the flow characteristics of the high-pressure regulating valve of a thermal power unit may be shifted to a certain extent, resulting in inconsistent changes in the total valve position and opening degree, which in turn affects the PFR function of the unit. Based on the historical operation data of a thermal power unit, the flow characteristics of the unit's high-pressure regulating valve are optimized using an improved particle swarm algorithm. By experimentally verifying the primary FM in different total valve position intervals, the influence of valve flow characteristics on the primary FM function is discussed. The results of the primary FM example show that, with the optimized valve flow characteristics, the output response index of the unit in 15 and 30 seconds is increased to 85.44% and 94.11%, respectively, which meets the assessment requirements of the grid-connected operation and management of the power plant for the primary FM, and optimizes the primary FM performance of the unit.