The mechanism of two-stage electron acceleration by backward stimulated Raman scattering (BSRS) and forward stimulated Raman scattering (FSRS) is demonstrated through relativistic Vlasov-Maxwell simulation. The theoretical model is given to judge the condition of two-stage electron acceleration. The electrons trapped by BSRS inducing Langmuir wave (LW) will be trapped and accelerated by FSRS LW directly in the high electron density region. The superthermal electrons with energy larger than the energy at the phase velocity of FSRS LW will be generated by two-stage acceleration. In the condition of Te=2.5keV, only when ne>0.138n_c, can the electrons trapped by BSRS LW be accelerated by the FSRS LW directly. And the optimal parameter region is 0.108nc< ne< 0.128nc in condition of Te=2.5keV to control BSRS and superthermal electrons to a low level.