The present invention discloses compounds of formula (I), imidazopyrimidine ketones, wherein n, R and Ar are as described in the specifications. This invention also discloses the preparations and applications of these compounds. Whereas these compounds and pharmaceutically acceptable salts thereof can stimulate the body to produce tumor necrosis factor- related apoptosis-inducing ligands, while avoiding the drawbacks of existing cancer treatments based on recombinant proteins and antibodies. Thus, they can provide novel options for the treatment of related tumors.