Background: Migraine is a disease closely related to calcium ions and ion channels. Ventralis posteromedialis (VPM) nucleus is an important nucleus in the process of migraine pain signal transmission. Flunarizine has been widely demonstrated as a calcium channel antagonist in the preventive treatment of migraine, but the mechanism of its anti-migraine on VPM is still unclear. Methods: Part 1. Fifteen transfected male rats were randomly divided into three groups: Flunarizine intervention group, Nimodipine intervention group and Normal saline sham group. Viral expression of fluorescent tracers allows purely anterograde labeling. Following injection of AAV-hSyn-9-CaMPARI-GFP into the physiologically defined area in the VPM nucleus of the thalamus, labeling in the thalamus-cortex had a green appearance. Part 2. Twenty Sprague Dawley male rats were randomly divided into four groups: Single stimulus group, Double stimuli group, Flunarizine intervention group and Nimodipine intervention group. A calcium-selective carbon fiber electrode (CFMEs) is used for online monitoring of electrochemically inactive Ca2+ in the rat brain in vivo. Results: Part 1.GFP Images showed that the VPM nucleus of the thalamus was involved in the signal transmission process of headache. Fluorescence imaging of the VPM nucleus of the thalamus after intervention with flunarizine or nimodipine suggested that it was activated. Part 2. No specific response was observed in the migraine rat model after stimulation with normal saline, extracellular calcium ions increased first and then decreased linearly after each stimulation with inflammatory soup. After the intervention of nimodipine, the curve of calcium changes after IS stimulation was the same as before. While after the intervention of flunarizine, the performance was significantly inconsistent, which was first increased and then maintained a level of concentration or slightly increased. Conclusion: VPM might play an important role in pain signal transmission of migraine and Flunarizine can alleviate such Ca2+ concentration in VPM neurons to exert its anti-migraine effects.