In view of the shortcomings of artificial neural network, such as slow convergence, easily falling into local optimum, based on ANN and GA, a method was put forward to establish a model which could achieve fast analysis of Polydatin and Resveratrol in the extracting process of Rhizoma Polygoni Cuspidati by near infrared spectroscopy(NIR) . The method was proved to be convenient, rapid, accurate and reliable. It has the better precision of prediction and applicability compared with PLS, and provides a promising application for pharmaceutical production process and quality control.