A semi-analytical theory of the interaction between a relativistic laser pulse and the overdense plasma to generate an attosecond X-ray source is presented.The physical parameters such as plasma oscillation trajectory,surface electric field and magnetic field can be given by this model,and the high-order harmonic spectrum is also calculated accurately from the solution of the plasma surface oscillations,the obtained result is consistent with the result from the PIC simulation program.This model can be valid for arbitrary laser duration,solid densities,and a large set of laser peak intensities (1018-1021 W/cm2).In addition,the model is not applicable for the small laser focal spots (less than ten times the laser wavelength),although two-dimensional effects such as the pulse finite size may significantly change the movement progress of the electrons,the laser spot can be larger than ten times the laser wavelength under the general laboratory conditions. In this model,the laser energy absorption is small,and the electron kinetic pressure is also small.Due to the radiation pressure of the laser pulse,the electrons are pushed into the solid,forming a very steep density profile.As a result,the relevant forces makes the electrons ponderomotive and the longitudinal electric field is caused by the strong electric charge separation effect.This semi-analytical self-consistent theory can give us a reasonable physical description, and the momentum equation and the continuity equation of the electric and magnetic field at the boundary allow us to determine the plasma surface oscillations.The spatiotemporal characteristics of the reflected magnetic and electric field at the boundary can allow us to determine the emitting characteristics of the high order harmonic. Our results show that the radiation of the attosecond X-ray source is dependent on the plasma surface oscillation. The plasma surface oscillates with a duration about twice the laser optical cycle,and the high-order harmonics also emit twice the laser optical cycle,thus an attosecond pulse train driven by the multi-cycle laser pulse can be formed.By using a few-cycle laser field,the smooth high-order harmonics can be obtained,which leads to a single attosecond pulse with high signal-to-noise ratio.In a word,our calculation results show that the time evolution progress of plasma surface can be controlled by changing the carrier envelope phase of the few-cycle laser pulse,and then the radiation progress of the high-order harmonics can be influenced as result of a single attosecond X-ray pulse.