The invention relates to an anti-detachment technology field, in particular to a method for preventing an in-car terminal from being detached. The method includes: 1) stipulating a fixed
password between the in-car terminal and a vehicle ECU; 2) generating a random
password R by the vehicle ECU, joining the fixed
password of the vehicle ECU with the random password R, generating an MD5 encrypted value which is a dynamic password A, sending a
heartbeat interactive request to the in-car terminal by the vehicle ECU through a
CAN bus, wherein a frame of the
heartbeat interactive request contains the random password R; 3) after a CAN
transceiver of the in-car terminal receives the
heartbeat interactive request of the vehicle ECU, extracting the random password R, joining the fixed password of the in-car terminal with the random password R by the in-car terminal, generating an MD5 encrypted value which is a dynamic password B, and sending the dynamic password B to the vehicle ECU through the CAN
transceiver, wherein the dynamic password B is used as a heartbeat frame; 4) after the vehicle ECU receives the heartbeat frame, comparing the dynamic password A with the dynamic password B, and if the dynamic password A coincides with the dynamic password B, determining that the in-car terminal is normal, otherwise determining that the in-car terminal is detached. The method has a characteristic of high safety.