The additional phase noise of a sub -Hz linewidth laser transmitted in the fiber to excite the Hzlinewidth transition of erbium is actively compensated for using the fundamental laser of the cooling laser in the ultracold erbium atom system . To perform heterodyne beat detection and implement the compensation feedback without affecting the power of the original sub -Hz linewidth laser (1299 nm), we injecte the broadlinewidth fundamental laser of the cooling light at a similar wavelength (1166 nm) from the output end of the fiber. The phase noise of the narrowlinewidth laser caused by temperature and vibration in fiber transmission is suppressed when the noise of the two lasers is almost the same. The linewidth of the beat frequency signal of the transmitted laser is narrowed from 14. 6 Hz to 11. 6 mHz and the stability of the opticalfrequency transmission link is improved from 1. 6 × 10 -16 to 6. 5 × 10 -19 in 1000 s, meeting the opticalfrequency transfer needs of a startoftheart optical clock. This opticalfrequency transfer scheme can be used as an alternative where the power of the transmitted laser is insufficient or physical space is limited. The scheme is also applicable for simplifying the source setup on branching opticalfiber networks.