In recent years,many universities have successively offered the Internet of Things profession,paying special attention to the cultivation of students' practical ability,and need an efficient and practical Internet of Things training system.Under the reality that the number of students is increasing rapidly,the teachers are insufficient,and the dedicated venues are tight,the centralized traditional training methods in the laboratory can no longer satisfy the actual needs.Our team designed an IoT training system based on cloud platform technology.The development kits used by the students can be connected to the cloud platform anytime and anywhere,and the experimental process and results can be accurately recorded in the cloud database.Students do not have to experiment at a fixed time and a fixed site,but borrow experimental equipment.It can be operated anywhere,solving the problem of shortage of experimental sites in the school;teachers can track the progress of students' experiments in real time,and can interact with students online,and can effectively use limited teacher resources;managers can analyze the devices operation status and errors online,accurate assessment of students' experiments and teacher guidance,and solving management problems.This paper designs a cloud server cluster in the IoT training system to meet the access requirements of equipment,students,teachers,administrators and so on.A layered cloud platform system architecture is proposed,including the basic storage layer,the supporting service layer and the application enabling layer.At the same time,three server clusters are divided:a service server cluster that supports the functions of the front-end website,a device server cluster that supports remote access of various development boards,and a storage support server cluster.This paper studies the data synchronization method in stateful clusters,and the mechanism of server node cache and centralized storage cluster is designed.The idea of cache elimination algorithm based on the data structure of hash table and doubly linked list is adopted,and the appropriate hash seed and load factor values are calculated.The cache lookup in the node only takes 2ms.This paper analyzes the possible problems of the final consistency of the data in the centralized storage cluster,and adds a mechanism for the node to actively delete the cache and actively pull the information from the main memory outside the cluster.And the data monitoring trigger function of the storage cluster is used together with the cache processing of the server node to jointly realize data consistency sharing and synchronization in the device server cluster.A multi-stage pipeline device data processing mechanism is designed to ensure non-blocking parsing and inserting data on the basis of non-blocking execution of each unit of work.The average response time of the final device server is only 9ms under 100.000 connection pressure measurement,and the processing speed of a single data task execution unit is 7500/s.And add the data write task shaping mechanism,effectively preventing the database from being washed by a large number of tasks.The business server software is designed to provide various enabling interfaces for upper-layer applications.And through the design of various support services and common functions,the scalability and stability of the business software modules are guaranteed.Finally,the entire system was tested for functional,performance and reliability.The test results show that the platform designed in this paper has reached the design goal. |