  We investigate the X-ray and $\gamma$-ray flares of Mrk 421 on 2008 June 6-15
using the synchrotron self- Compton(SSC) model with electron acceleration, in
which an evident correlation between the X-ray and $\gamma$-ray bands appears,
while no significant correlation between the optical and X-ray band is
observed. We argue that the emission from Mrk 421 may originate from two
different components. One is the steady component from the outer region that is
mainly attributed to the optical band, in which the electrons are accelerated
by first-order Fermi acceleration mechanism. We use a steady electron spectrum
to produce the synchrotron self-Compton emission. The other is the variable
component from the inner region, in which the electrons are accelerated by the
stochastic acceleration process. We use the time-dependent SSC model to produce
the emission from the variable component. We suggest that the flares are due to
the hardening of the electron spectrum under the process of the stochastic
acceleration, which leads to the hardening of the observed spectrum in the
X-ray and $\gamma$-ray bands. Furthermore, we find that the energy densities of
electrons and magnetic fields are near equipartition in both jet regions.
