As the brightness of synchrotron radiation (SR) light sources improves, the operation stability of light sources is weakened. To explore various beam instability related issues in light sources, one transverse beam diagnostics system for bunch-by-bunch (BbB) profile measurement has been established at Hefei Light Source-II (HLS-II). In this paper, one in-situ extraction algorithm in the data processing backend of the system is developed for BbB profiles, so as to provide important beam information of the machine operation in time.