An online bunch length and momentum spread measurement method based on multiple BPMs