Patulin (PAT) is a kind of mycotoxin which must be monitored for the sake of quality and safety in traditional Chinese medicine (TCM) owing to its harm to human health. On this account, a rationally designed ratiometric fluorescent aptasensor was developed based on the studies of the interaction mechanism between PAT and its aptamer (PAT-APT). First, CD spectroscopy, molecular docking, and molecular dynamic simulation were applied to investigate the details on how PAT-APT binds with its target molecule. The results indicated that the structure of PAT-APT changed to a certain extent and was stabilized after binding with PAT. C-11, C-37 and C-38 were the key sites for the recognition and interaction between PAT-APT and its target. Second, based on these results, a ratiometric aptasensor was designed using fluorescence resonance energy transfer (FRET) and synchronous fluorescence spectroscopy. A complementary sequence (cDNA) to the aptamer with an appropriate length and hybridization position was obtained through rational design and optimization. Both PAT-APT and cDNA were labeled using a pair of fluorophores, which could generate FRET when the two single-stranded oligonucleotides hybridized. The accurate detection of PAT could be realized according to the change ratio of the fluorescence intensity at the corresponding wavelengths of the two fluorophores before and after the assay. The aptasensor achieved an ultralow limit of detection of 0.16 nM, perfect selectivity, and satisfactory practicability in complex TCM samples. To our knowledge, this is the first aptasensor for PAT designed through the interaction mechanism between its aptamer and the target molecule. Moreover, the assay for PAT is cost-effective, does not need complicated pretreatment and only takes less than an hour. In summary, this study makes a contribution to the safety control of TCM and provides a thinking mode from mechanism to rational design to conquer the problem of sensitive aptasensing of one component in a complex system.