The invention relates to a protection device and a method, belonging to the field of downhole electronic instruments and meters, in particular to a diagnostic protection device and method for tunnel drilling rigs based on virtual instruments. It includes five parts including sensing module, real-time data acquisition instrument, power supply module, data processing and display terminal, and protection module, all of which are designed with intrinsically safe circuits and can be used in coal mines; the software passes through the hardware driver layer, platform software layer, and application program The three-tier architecture is designed and developed to realize the functions of storage, communication, display, monitoring and diagnosis; during the diagnosis process, a fault database and feature library are built to accurately identify drilling rig faults through similarity coefficients, and make corresponding alarms according to fault levels response. The invention has small volume and low cost, can comprehensively monitor the state of the drilling rig, accurately identify the failure of the drilling rig, improves the digital level of the drilling rig, and provides technical support for the intelligentization of the drilling rig in the future.