To analyze medication rule of physicians in the Qing Dynasty for insomnia based on data mining of Chinese Medical Records and thus to provide a reference for clinical practice.Methods:Medical records of some physicians in the Qing Dynasty on the treatment of insomnia in Chinese Medical Records were analyzed.To be specific,the related medical works,high-frequency medicinals,and the properties,flavor,and meridian tropism of the medicinals were clarified.SPSS Modeler18.0 was used for the association rules analysis and SPSS 21.0 for cluster analysis of selected high-frequency medicinals.Results:A total of 122 medical records were found,involving 32 books.Among them,the medical records of physicians Zhang Yuqing,Shao Lansun,Miao Songxin,Ye Tianshi,and Wu Jutong were the most.The 122 medical records involved 177 Chinese medicinals,with the total use frequency of 1 205.A total of 50 high-frequency medicinals were screened out.The statistical analysis showed that the majority were plain and slightly cold in property and sweet and bitter in taste with meridian tropism at the heart.The correlation analysis showed the combination of Poria cum Radix Pini and Semen Ziziphi Spinosae was the common medicinal pair in the medical records.As for the threesome,Poria cum Radix Pini,Semen Ziziphi Spinosae,and Radix Polygalae were used together frequently.Custer analysis yielded 7 medicinal combinations,such as modified Shengmai Powder,modified Ejiao Jizihuang Decotion and Ganmai Dazao Decoction,Guipi Decoction,modified Ditan Decoction,modified Tianwang Buxin Pills,and modified Wendan Decoction and Banxia Shumi Decoction.Conclusion:Physicians in Qing Dynasty focus on deficiency and excess in diagnosis and treatment of insomnia.For insomnia with deficiency,the medicinals with the functions of tonifying and replenishing qi and blood,nourishing yin and clearing heat,nourishing blood and tranquilizing the mind were used and the common symptoms were heart-kidney non-interaction and heart-spleen deficiency.As to insomnia with excess,medicinals with the effects of pacifying liver and subduing yang,and resolving phlegm and regulating qi were used and the liver hyperactivity and phlegm heat were more common in excessive insomnia.