There is a large amount of real-time data, e.g. measurement data and instructions, among controllers, sensors, and actuators in the industrial IoT. These data are vulnerable to unauthorized access and tampering. In addition, once the controller is controlled by malicious code, it may send out dangerous instruction that is not compliant with the preset control process, which seriously interferes with the industrial control process. To achieve correct and undisturbed control based on real-time data, we propose an attribute-based access control method for real-time data in the industrial IoT to mitigate unauthorized access and tampering, and noncompliant operation. First, we analyze the abnormal behaviors of real-time data interaction in the industrial IoT. Second, we propose the multi-level hash identity authentication method to identify and block unauthorized access and tampering with real-time data. And then we model the timing relationship and task logic relationship of the control process into the attribute fields of the attribute-based access control method to identify and block non-compliant operations. Further, we design an access control module and display the lightweight deployment under the availability constraints of the control service. Finally, the proposed access control method is analyzed, proved, and experimented with. The results show that the proposed method can prevent unauthorized and non-compliant behaviors to field real-time data, meanwhile, it has a controllable delay and better scalability.