A Study on the Origin and Protective Function of Alkaloids in Plants