The local and global existence of solutions for a generalized Camassa-Holm equation