Quick sort is a commonly used sorting method,and the average performance is relatively good in all internal sorting methods,but if the choice of base element is not good,it may become slow,and in the worst case,time complexity is O(n2).This paper designs an algorithm by using all the elements of keywords to be ranked as a benchmark mean sort,which greatly increases the speed of sorting and effectively avoid theslowphenomenon..