RFID is an important part of Internet of things, however, solving tag anti-collision problem is the key to RFID. In order to improve the identification efficiency of anti-collision algorithm, the performance of the time slot ALOHA algorithm is analyzed and the improved ALOHA is proposed that when there is an unknown number of tags, the window size will be dynamically adjusted according to the anti-collision algorithm. When estimate the number of tags, the conflict probability is taken into account and according to the current window size, the return value of each read cycle, the calculated conflict probability, and the estimated number of tags, the window size will be dynamically adjusted. The number of tags and the colliding tags within one time slot can be identified quickly and the performance of the system and tag anti-collision algorithm will be improved. Through modeling and simulation, after comparing and analyzing the results, the practicability and feasibility of the improved anti-collision algorithm is verified.