To improve the maximal transmission distance and the maximal error rate tolerance, we apply the advantage distillation technology to analyze security of the practical decoy-sate quantum key distribution system. Based on the practical experimental parameters, the device-dependent quantum key distribution protocols and the measurement-device-independent quantum key distribution protocols have been respectively analyzed, and our analysis results demonstrate that the advantage distillation technology can significantly improve the performance of different quantum key distribution protocols. In the four-state and six-state device-dependent quantum key distribution protocols, we prove that the maximal transmission distance can be improved from 142 km to 180 km and from 146 km to 187 km respectively. In the four-state and six-state measurement-device-independent quantum key distribution protocols, we prove that the maximal transmission distance can be improved from 195 km to 273 km and from 200 km to 282 km respectively. More interestingly, the advantage distillation technology does not need to change the hardware devices about the quantum step, thus it can be conveniently to be applied in various practical quantum key distribution systems.