The present invention declares a kind of compound to treat respiratory syncytial virus infection and its preparation method and application. The compound stated is cyclopamine's chemical analogs, has the property of inhibiting respiratory syncytial virus replication, and does not have the property of inhibiting Hedgehog signaling pathways. The preparation method stated is to get the cyclopamine's chemical analogs through drug chemical synthesis, then to screen the analogs with two parallel in vitro experiment. The compound described can be used to treat respiratory virus infection, paramyxovirus, respiratory syncytial virus infection, capillary bronchitis/pneumonia/tympanitis caused by respiratory syncytial virus. Furthermore, the compound described never cause the side effects of fetal malformation, and it overcame the teratogenicity of cyclopamine, and filled the gap of anti-human respiratory syncytial virus drug, especially of the field of pediatric drug.