Abstract:BM algorithm is a classical single pattern matching algorithm. QS algorithm is an improved algorithm of BM algorithm. Because computing the moving distance to right position only by analyzing the character T[j+m], the overall matching efficiency of QS is not high. Therefore, an improved algorithm(QSP) accordingly to the QS algorithm is proposed. The core idea of QSP algorithm is finding all characters that appear more than once in the pattern string from left to right, calculating the jumping expectation difference value of these characters, getting the highest expectation difference value and maxPos value that is the position of it in the preprocessing phase, and changing the value of skipp2 array. During the matching phase, in order to move the pointer farthest at each time, it firstly considers the relationship between P[maxPos] and T[j+maxPos], then moves to right by using the skipp1 and skipp2 arrays. The experimental result shows that the comparison number and matching time of QSP are less than QS. Its efficiency has been improved obviously.