Formation and transformation of the 3:1 mean-motion resonance in 55 Cancri System