With the rapid advancement of molecular biology and nanotechnology, DNA logic gates have emerged as a method to simulate complex chemical reaction networks, which is crucial for distinguishing tumor cells from normal cells in early cancer diagnosis and treatment. The current challenges include the compositional differences in biomarkers between tumors and normal tissues and achieving high specific imaging in low-expression miRNAs within cells. We developed a triple AND logic-gate nanomachine that utilizes the high expression of matrix metalloproteinase (MMPs) in tumor metastasis and the specific overexpression of telomerase in cancer cells to initiate a first-stage signal and accurately identify tumor cells. This system then interacts with miRNA-21 to trigger a second-stage signal, enabling precise detection and signal amplification through the activity of purine-free/pyrimidine-free endonuclease 1 (APE1). This system can not only achieve efficient target recognition in complex bio-logical samples, but also provide a strong detection signal through continuous signal amplification, greatly improving the accuracy and reliability of diagnosis. This research provides a new molecular tool for cancer diagnosis, facilitating early detection and improving patient treatment outcomes and quality of life. Additionally, the principles and methods of this technique can be applied to the detection of other disease markers and tumor cell subtypes.