| With the rapid development of information technology and Internet of Things,sharing bicycles has brought great changes for people’s travels.the built-in car control terminal in Sharing bicycle can accomplish functions suchi as real-time GPS positioning and remote unlocking by exchanging information between the GPRS module and the cloud server.During the internship,the author participated in and developed a information interaction system of sharing bicycle,with the growth of users,the original system had reached the bottleneck,the users’ experience are getting worse and worse.On the basis of the original system,this paper summarized and analyzed its defects and shortcomings,and put forward some corresponding improvements and designs.Based on the MQTT protocol,this paper designed and implemented a new exchanging information system.In this system,it mainly includes a load distribution server based on the UDP transport protocol,the protobuf data transfer structure and the Redis database was introduced.In order to meet the limits of resources in the vehiclecontrol terminal,transmission bandwidth and processing power,take the characteristics of using bicycles at the traffic peak time into consideration and achieve efficient,reliable and low-power information exchanging system,the following modules had been improved:(1)the MQTT consumer server was introduces as an information exchanging middleware for client,shareing bicycle and business server.(2)Before the first connect between client and the MQTT server,the UDP load distribution server was joined to relieve the stress of the MQTT server.(3)the Redis memory database was imported to instead of My SQL database to improve the efficiency of database in data exchanging.(4)protobuf was used as a communication data protocol to reduce information redundancy and save traffic.Finally,the reading and writing speed of data in Redis database and My SQL database was tested respectively based on high compliant stress test for MQTT serves and comparison of data flow testing for Protobuf and Json to verify the effectiveness of method in this paper. |