Disclosed is a method for protecting data information of an electronic device, comprising the following steps: 1) performing power-on detection on an electronic device of which production and installation are completed, detecting the stray capacitance of a signal line thereof, and recording same as a standard value of the signal line; 2) during a power-on operation, monitoring the stray capacitance of the signal line; 3) comparing the monitored capacitance value with the standard value, and entering step 4) when exceeding the set threshold value, otherwise entering step 2); and 4) erasing significant data in the electronic device. The method uses the manner of monitoring the stray capacitance to monitor the contact of outside foreign matter with the signal line, guarantees the security of data in the electronic device, and has the characteristics that the implementation process is simple and easy, safe and reliable, and the cost is low.