The present invention discloses a deterministic anti-collision algorithm based on multi-prefix matching of a query tree method. The algorithm comprises the following steps of: reading a query prefix and sending a query command by a reader-writer; receiving the query command and responding matching by a tag; receiving the response by the reader-writer; responding a successful end process, generating collision and going to step 4; detecting response collision positions, and if the highest collision position and the second-highest collision position are continuous collision positions, going to step 5; if the highest collision position and the second-highest collision position are not continuous collision positions, going to step 6; forming a new common prefix, giving a subsequent numerical value, pressing into a stack respectively at last, and going to step 7; forming a new common prefix, giving a subsequent numerical value, pressing into a stack at last, and going to step 7; if the stack is determined to be empty, ending the entire identification process; or otherwise, returning to step 1. The deterministic anti-collision algorithm has the following beneficial effects: a multi-prefix matching and query technology is introduced, the identification of multiple tags by one time slot is realized by virtue of a prefix 1 and a prefix 2, idle time slots of a multi-ary algorithm are completely eliminated, the query times is reduced, and the query efficiency is improved.