Aiming at the problems of insufficient particle search ability of the existing methods of using time-varying particle swarm optimization(TVCPSO)to optimize support vector machines(SVM)for intrusion detection of network traffic data,an intru-sion detection method based on nonlinear time-varying particle swarm optimization(TVCPSO)to optimize SVM parameters is pro-posed.In this method,firstly,ReliefF algorithm and information gain algorithm are combined to reduce the feature dimension of net-work traffic data,then the time-varying particle swarm optimization algorithm is improved by nonlinear learning factor and adaptive weight to support SVM,and finally the detection of network traffic is completed by SVM.The results on NSL-KDD show that the pro-posed method achieves 97.86%accuracy,97.67%detection rate and 2%false positive rate,which verifies the effectiveness of the method.