The present invention relates to a spectrum switching method based on a reputation system in a cognitive heterogeneous wireless network. For the problem that selfish or malicious behaviors of secondary users in a spectrum switching process cause degradation of network performance, firstly, the behavior of a secondary user after accessing a channel is evaluated by extracting user behavior characteristic information, a reputation value is determined according to the behavior of the secondary user, and a reputation system is established on a cognitive base station; secondly, the secondary user isranked according to a reputation status of the secondary user, and a licensed channel or a channel of an ISM frequency band is allocated to the secondary user according to the ranking situation of the secondary user; and finally, in a process of accessing a licensed spectrum, when a requirement for a waiting delay of a user is met, the secondary user with a high reputation value has a higher access priority. A simulation result shows that the method can effectively improve system throughput, reduce probability of switching and interruption, reduce the chances to access the licensed spectrum by secondary users with low reputation, and improve system security.