程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Django risk control System-2 project configuration and function realization concept

編輯:Python

The more work is done, the better it will be done , First of all, we must improve our tools . The prerequisite for a good project is to prepare the preliminary work well .
Create a database , After the project is configured , We need to know how to accomplish the five functions we need ?

The web page controls the start and stop of the fan and the automatic mode

Because of the complexity of the communication module used in the hardware WIFI modular , Therefore, the communication protocol on the web page must be well-known TCP perhaps UDP It's agreed , So what kind of protocol is used ?
What I'm using here is UDP agreement , because udp It belongs to connectionless transmission protocol , Faster transmission speed , It will not consume too many resources in the process of high-speed refresh request on the web page .
When you click start in the web page , Stop or auto mode button , Will pass udp The protocol is like the specified address and port number OPEN、STOP、AUTO Information about . The hardware determines the rotation mode of the fan based on this information .

The hardware sends the environment information to the database

Hardware end pass WiFi The module will change the temperature 、 Speed and other information are sent to django backstage , The background writes this information to the database , When a high-speed refresh web page requests to receive the information sent by the hardware , When our web page changes information every two seconds , It is equivalent to storing a set of data every two seconds , It won't take long , The database will not be able to support , So we need to limit the amount of data stored .


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved