Flow scheduling is crucial in improving network Quality of Service (QoS). According to different optimization goals, many scheduling algorithms (e.g., STFQ, pFabric, SRPT, WFQ) have emerged in network. However, these scheduling algorithms are bound with hardware, which are only applicable to fixed network scenarios. Push-In First-Out (PIFO) queues are proposed as a queue abstraction to support programmable packet scheduling, but implementing them in hardware is difficult. We present a general framework named PR-AQM, which uses limited number of FIFO queues to approximate PIFO behavior. The core idea of PR-AQM is to perform Active Queue Management (AQM) on programmable data plane by capturing packet rank distribution and queue congestion level in real time. Specifically, PR-AQM can dynamically adjust the mapping between packet ranks and queues according to the delay status of different priority queues, thus efficiently achieving priority scheduling of packets. We carry out extensive simulations and implement PR-AQM prototype in Tofino switches to evaluate the performance of PR-AQM. Experimental results show that compared with state-of-the-art algorithms, PR-AQM can adapt well to different scheduling algorithms, and achieve better performance by reducing the average flow completion time for short flows up to 45%.