In the industrial internet of things (IIoT), because thousands of pieces of hardware, instruments, and various controllers are involved, the core problem is the sensors. Detection using sensors is the bottom line of the IIoT, directly affecting the detection accuracy and control indicators of the IIoT system. However, when a large number of realtime data generated by IIoT devices are transferred to cloud computing centers, large-scale data will inevitably bring computing load, which will affect the computing speed of cloud computing centers and increase the computing load of cloud computing data centers. These factors directly lead to instability and delay in sensor data collected in real time in the IIoT. In this paper, a sensor outlier detection algorithm based on edge calculation is proposed. Firstly, focusing on the problem of the large amount of data in terminal equipment of the IIoT, the edge technology method of data compression is used to optimize the compression of sensor data, and different thresholds are set according to different industrial process requirements, so as to ensure the real-time aspect and authenticity of the data. Then, using the K-means clustering algorithm, the compressed test data sets are analyzed and the abnormal sensor detection values and labels are obtained. Finally, the effectiveness of such an approach is evaluated through a sample case study involving a temperature control system.