In recent years,DDoS attack detection has mostly adopted machine learning methods,and Stacking is one of them.The current stacking base-learner configuration method is mostly fixed collocation.Due to the complexity and dynamics of DDoS attacks,static configuration strategy is obviously less flexible.In this regard,the QGA-Stacking algorithm is proposed,which uses quantum genetic algorithm(QGA)to dynamically select a group of learner combinations with the highest evaluation index in Stacking,thereby improving the accuracy and flexibility of the detection model.At the same time,a set of optimal feature sets was proposed to save computational cost.Through experimental comparison,it is fully proved that the QGA-Stacking algorithm has more significant detection performance than the other three mainstream algorithms,and the selection of the best feature set is more reasonable.