In the upcoming large-scale Internet of Things(IoT),it is increasingly challenging to de-fend against malicious traffic,due to the heterogene-ity of IoT devices and the diversity of IoT communi-cation protocols.In this paper,we propose a semi-supervised learning-based approach to detect mali-cious traffic at the access side.It overcomes the resource-bottleneck problem of traditional malicious traffic defenders which are deployed at the victim side,and also is free of labeled traffic data in model train-ing.Specifically,we design a coarse-grained behav-ior model of IoT devices by self-supervised learning with unlabeled traffic data.Then,we fine-tune this model to improve its accuracy in malicious traffic de-tection by adopting a transfer learning method using a small amount of labeled data.Experimental results show that our method can achieve the accuracy of 99.52%and the Fl-score of 99.52%with only 1%of the labeled training data based on the CICDDoS2019 dataset.Moreover,our method outperforms the state-of-the-art supervised learning-based methods in terms of accuracy,precision,recall and Fl-score with 1%of the training data.