[fly-iot] (2): How to build your own IoT platform from scratch, using an open source technology stack to build a high-performance IoT platform, which is currently in the design stage.

foreword


The original link of this article is:
https://blog.csdn.net/freewebsys/article/details/129225780
fly-iot column:
https://blog.csdn.net/freewebsys/category_12219758.html

Not to be reproduced without permission of the blogger.
The blogger’s CSDN address is: https://blog.csdn.net/freewebsys
The blogger’s nugget address is: https://juejin.cn/user/585379920479288
The blogger’s Zhihu address is: https://www.zhihu. com/people/freewebsystem

1. fly-iot


"Open Source Flying Internet of Things Platform" system design.

Regarding Feifan IoT platform, the project uses golang for development.
Use ace jquery for front-end styling. An IoT platform is not created new.
Instead, it uses existing technologies to assemble an IOT IoT platform solution.

The project code adopts the Apache protocol to open source.
There is a fee for consultation and deployment solutions.

Use docker for deployment to solve the problem that small and medium-sized companies do not have an IoT platform.
Support public cloud and private cloud deployment.

Project technology stack, using golang 1.9 version for development.
The web side uses beego v2 to develop and manage the platform.
The front-end and back-end are separated, and the front-end uses vue+elementUI to develop a management platform.

The background system has login interception, but there is only one admin account.
Account secrets can be set, and only a few administrators can manage the device itself.
B-end device management platform.

Everything can use the mqtt service, which is very convenient.
It is planned to use mqtt as the notification module of the chat tool in the future.
Use mqtt as docker's edge image management tool. There are many things to do.
Many directions can be opened up.

2. mqtt-broker service


Use the open source project:
https://github.com/DrmagicE/gmqtt

A golang development, do mqtt broker service.
Solve the account login through the plug-in. Do device message sending.
This is a very good broker service, which has already been deployed and verified in the production environment.
The service is running very stable, and it is estimated that there are at least hundreds of customers.

https://github.com/DrmagicE/gmqtt/blob/master/README_ZH.md

3, Manage background product/equipment design


By default, there is a product model, flyDevice, which is convenient for management.
Additional products can be created. Generate a three-piece set.

Product information reference:
https://help.aliyun.com/document_detail/69123.htm

Device information reference:
https://help.aliyun.com/document_detail/69470.html

The login verification of the device adopts one type and one password, and one password for each model:
https://help.aliyun.com/document_detail/73742.htm

Then the connection uses websocket for communication, so that https encrypted transmission can be reused.
It can also solve some scenarios where non-80 443 ports cannot be accessed.
https://help.aliyun.com/document_detail/63656.html

4. Data storage currently uses mysql, and messages are stored in influxdb


Data storage uses mysql for development. Because basically what is stored is product and equipment information.
These data volumes are not large.
The amount of message data reported is relatively large, and it can be stored on a monthly basis using the mysql table partition.
Later, it can be placed on ElasticSearch, TiDB, or influxdb.

https://www.influxdata.com/

https://github.com/influxdata/influxdb

5, the rule engine uses ekuiper


https://github.com/lf-edge/ekuiper

Using LF Edge eKuiper is a lightweight IoT data analytics and stream processing engine that runs on resource-constrained edge devices.
It can also be used on the server side. Integrate into the IOT system.

6, Summary and other thoughts


Do a little when you have time, and gradually improve the system and platform.
The first step supports rapid deployment using docker-compose. Of course, it can be deployed separately on the server.

The original link of this article is:
https://blog.csdn.net/freewebsys/article/details/129225780

insert image description here

Guess you like

Origin blog.csdn.net/freewebsys/article/details/129225780