Aiming at the low efficiency problem of the traditional Apriori algorithm, an LMC-Apriori algorithm is proposed in this paper. It uses a packet pruning approach to effectively reduce the cost of the search layer by layer, through mathematical proofs and experimental verification, it is shown that the calculation efficiency is significantly improved for cases with significant differences between the groups. This algorithm can find important applications in the intrusion detection technology, consumer market price analysis, mobile communications, and other fields.