add the dedup module and a ring buffer for deduplication process
fix some bug