| With the increasingly rapid development of the Internet of things,more and more manufacturers are pouring into the Internet of things,and the number of terminal sensors is also growing explosively,but the problem is that the protocols defined by every manufacturer are different.Among them,the amount of sensor access in the industrial Internet of things is far ahead.How to solve the heterogeneity of sensors has become a crucial problem.In addition,the uneven distribution of sensor nodes makes the gateway south interface network congested and the data link broken,and the whole monitoring system can not complete the data acquisition work normally.To solve these problems,we design an intelligent gateway for Internet of things,which is applied to monitor complex environment.It aims to modularized different sensors from different manufacturers.And in order to improve the existing routing algorithms,we design improved particle swarm optimization routing algorithm based on fuzzy c-means algorithm(IPSO-FCM)to reduce the energy consumption of sensor nodes,balance the load of intelligent gateway,extend the life cycle of the network,and enable continuous monitoring.The overall architecture of the gateway designed in this paper is divided into four parts:perception layer,interface layer,control layer and general service layer.The perception layer designed in this paper includes the construction of device topology and the optimization of node routing algorithm.It supports three topologies:bus star,bus tree and cluster.In addition,aiming at the problem of limited energy of heterogeneous wireless sensor nodes,combined with the design idea of low energy adaptive clustering hierarchy routing(LEACH)algorithm,this paper designs IPSO-FCM routing algorithm.In the clustering process of Heterogeneous sensor nodes,particle swarm optimization algorithm and K-means algorithm are introduced to improve the fuzzy clustering algorithm.Then the cluster head sensor nodes are selected combined with the factors such as residual energy and distance of nodes.Finally,the superiority of the algorithm is verified by simulation.The simulation results verify that the improved algorithm makes the load of the gateway more balanced and the collected data can be uploaded continuously,which can solve the problem of short network life caused by uneven distribution of sensor nodes.For the problem of heterogeneous protocols,the interface layer designed in this paper judges whether gateway supports common communication protocols in industrial Internet of things(Modbus protocol,MQTT protocol,LoRaWan protocol).The module corresponding to the interface layer designed in this paper can analyze the physical quantity data collected by the sensor nodes in the sensing layer,package it into a unified user-defined data format,and then transmit it to the engineering intelligent monitoring cloud platform through message queuing telemetry transport(MQTT)protocol.Meanwhile,the intelligent gateway can encapsulate instructions into protocol formats supported by different sensors.In order to meet the demand that the device can be managed by users at any time,the control layer designed in this paper can complete the search,addition,change and deletion services of the device in the device management module,so as to realize the efficient management of the sensors in the sensing layer.In view of the situation that the gateway still needs to be upgraded in the subsequent version iteration,the control layer designed in this paper provides the service of monitoring the operation status of the intelligent gateway in the remote monitoring management module.The householder can query the working status of the gateway and the connection of the equipment through the engineering intelligent monitoring cloud platform.In the general service layer,this paper designs a multi-level feedback priority scheduling algorithm to manage the task processing of the intelligent gateway.Through this scheduling strategy,the response time of the gateway can be significantly reduced.This paper studies and analyzes the message subscription and publishing mode of MQTT protocol,creates a thread pool to manage MQTT protocol connections.Based on this mode,this paper designs the Topic Tree of MQTT broker,so that the intelligent gateway designed in this paper can realize information interaction with the cloud through topic subscription and publishing.Finally,build a real monitoring environment,and comprehensively test and analyze the intelligent gateway designed in this paper.The test results show that the intelligent gateway can effectively solve the problem of massive sensor protocol heterogeneity in the Internet of things,and it has broad application prospects. |