Acceptance sampling plans are divided into attributes and variables, which are used to evaluate the mechanism for determining lot quality. Traditional attribute sampling plans usually choose the Acceptable Quality Level (AQL) for each stage based on experience but need practical guidelines to follow. Previous research endeavors have predominantly centered around statistical perspectives and emphasized the reduction of sample size or sampling frequency while allocating lesser consideration to cost factors and practical applications when formulating sampling decisions. This study proposes a dynamic sampling strategy to minimize costs and estimate AQL values and sample sizes for each stage based on product quality performance to establish a more effective and flexible sampling strategy. The study verifies the scenario in an integrated circuit (IC) testing factory, considering multiple combinations of between-batch quality conditions, within-batch quality conditions, sampling method, and cost ratio, and conducts sampling inspection simulations. When quality changes, the dynamic strategy is activated to adjust AQL. Finally, based on the sampling errors and costs in the inspection results, a comparison is made with the traditional MIL-STD-105E sampling plan, confirming that the dynamic AQL sampling plan has significantly improved performance.