Deep brain stimulation (DBS) targeting thalamus reticular nucleus (TRN) brain regions has been proven to play an irreplaceable role in the treatment of absence seizures. Compared with open-loop DBS, closed-loop DBS has been recognized by researchers for its advantages of significantly inhibiting seizures and having fewer side effects. However, due to the complexity of the nervous system, the mechanism of DBS control epilepsy is still unclear, which hinders the study of closed-loop DBS. In our study, based on the biophysical model jointly constituted by cortical, thalamic, and basal ganglia, we selected the 2-4 Hz spike and wave discharges (SWDs) of the cortical region as a biomarker for response to absence epilepsy, and the mean firing rate (MFR) of substantia nigra pars reticulata (SNr) was used as a reference signal for modulation of closed-loop DBS. Moreover, to obtain the linear relationship between the stimulus and the response, we adopted an algorithm that combines controlled auto-regressive (CAR) and recursive least squares (RLS), and we built a proportional integral (PI) controller to make the DBS stimulus parameters self-update to control the seizures. The numerical simulation results show that the closed-loop DBS controllers based on frequency modulation and amplitude modulation respectively not only successfully track the firing rate (FR) of SNr, but also significantly destroy the SWDs of cerebral cortex and restore it to the other two normal discharge modes.