Pyramid algorithm and grid algorithm are typical algorithms for all-sky autonomous star identification, and it has advantages of high recognition rate, and fast in running. However their recognition rate decreases rapidly when the position noise, lost stars or fake stars exist in the star image. In order to improve the performance of star sensor, a new star identification algorithm based on star pattern of wheel code is proposed. The algorithm combines the main star and its surrounding neighbor stars to form the characteristic unit, and then constructs the corresponding code feature and the wheel feature respectively. In the process of star matching, the algorithm uses the code feature of the observation star as an index to Inquire storage address of the candidate navigation star, and then calculates the similarity of wheel feature between the candidate navigation star and the observation. Simulation shows that: compared to the grid algorithm, this algorithm has higher rate of correct star recognition and better robustness. When the position error is 1 pixel and 2 lost stars exist in star image, this algorithm can reach 98.4% on identification rate, while the grid algorithm is 94.6%, and the pyramid algorithm is 83.5%; when the position error is 1 pixel and 2 fake stars exist in star image, this algorithm can reach 98.6% on identification rate, while the grid algorithm is 92.3%, and the pyramid algorithm is 87.2%.