The application of semantic web technologies such as semantic inference to the field of the Internet of Things (IoT) can realize data semantic information enhancement and semantic knowledge discovery, which plays a key role in enhancing data value and application intelligence. However, Mainstream semantic inference engines cannot be applied to IoT computing devices with limited storage resources and weak computing power, and cannot reason about uncertain knowledge. To solve this problem, the authors propose a lightweight semantic inference engine, Tiny-UKSIE, based on the RETE algorithm. The genetic algorithm (GA) is adopted to optimize the Alpha network sequence, and the inference time can be reduced by 8.73% before and after optimization. Moreover, a four-tuple knowledge representation method with probability factors is proposed, and probabilistic inference rules are constructed to enable the inference engine to infer uncertain knowledge. Compared with mainstream inference engines, storage resource usage is reduced by up to 97.37%, and inference time is reduced by up to 24.55%.