With the implementation of AGV technology and automated scheduling, storage and retrieval systems have become widely utilized in warehouse management. However, due to the use of unidirectional channels, AGV movement is restricted, and detours may occur frequently. Additionally, as the number of AGVs increases, deadlocks can arise, which lead to delays in order packaging and a decrease in overall warehouse performance. Hence, this paper proposes a dynamic scheduling method for task assignment and route optimization of AGVs to prevent collisions. The routing optimization method is based on an improved A* algorithm, which takes into account the dynamic map as input. Moreover, this paper investigates highly complex collision scenarios in bidirectional channels. Through simulation experiments, it is evident that scheduling methods based on bidirectional channels offer a clear advantage in terms of efficiency compared to those based on unidirectional channels.