信息采集终端部分代码如下:
IP="202.101.190.111"
PORT="8080"
SSID="yzzx1"
PASSWORD="yzzx@2017"#设置连接参数
uart.init(baudrate=9600, bits=8, parity=None, stop=1, tx=pin2, rx=pin1)
while Obloq.connectWifi(SSID,PASSWORD,10000) != True:
display.show (".")
display.scroll(Obloq.ifconfig())
Obloq.httpSet(IP,PORT) #根据ip和port建连接
while True:
temp=round(pin1.read_analog ()/1024*3000/10.24,1) #读取温度
hum=round(pin2.read_analog (),1) #读取湿度
rain=round(pin3.read_analog (),1) #读取雨量
winpower= round(pin4 .read_analog(),1) #读取风力
errno,resp=Obloq.get("input?t="+str(temp)&"h="+str(hum) & "r="+str(rain)&"w="+str(winpower),10000)
if errno == 200 :
display.scroll(resp)
if resp=="1" :
music.pitch(1000, 3000)
display.scroll("SOS") #其他各种报警设备驱动代码
else:
display.scroll(str(errno))
sleep(10000*5) #设置采集间隔时间
#WEB 服务器部分代码如下所示:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index() :
#读取终端最近次的温度、湿度、雨量、风力存temp 、hum、rain、winpower,代码略
return "当前温度"+str(temp)+"当前湿度"+str(hum)+"当前雨量"+str(rain)+"当前风力"+str(winpower)
@app.route('/input',methods=['POST', 'GET'])
def add_data(): #终端上传最新采集的数据
#代码略
#maxtemp,mintemp,maxhum,minhum,maxrain,minrain,maxwinpower,manpower,变量分别为温度、湿度、雨量、风力的最大、最小的报警阀值
#以下为温度报警
if sensorvalue 1 > maxtemp or sensorvalue 1 < mintemp :
return '1'
else:
return '0'
#湿度、雨量、风力报警代码略
if __name__ == '__main__' :
app.run (host="202.101.190.111", port=8080)
(1)根据系统的功能和需求,判断系统架构图中的①和②分别表示的设备名称是
(2)从图中可以看出,该信息系统的架构是
(3)服务器端采用
http://

同类型试题

y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2


y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2

