Method and device used for preventing bad data from infringing on numerical control equipment

The invention provides a method used for preventing bad data from infringing on numerical control equipment, comprising the following steps: a first module receives data from the outside; the first module filters the data according to the preset rule and sends the filtered data to a second module; and the second module sends the filtered data to the numerical control equipment. The invention provides a device used for preventing bad data from infringing on numerical control equipment, comprising the first module and the second module, wherein the first module is used for receiving data from the outside, filtering the data according to the preset rule and sending the filtered data to the second module, and the second module is used for sending the filtered data to the numerical control equipment. The invention solves the problem that the infringement of the bad data can not be timely and effectively prevented in the prior art and achieves the effects of effectively isolating and removing the bad data in real time and preventing the bad data from infringing on the numerical control equipment.