|
@@ -19,7 +19,6 @@ from DiagDataMerge import DiagDataMerge
|
|
|
def diag_cal():
|
|
|
task_on=1
|
|
|
global SNnums
|
|
|
- global df_Diag_Ram
|
|
|
global start
|
|
|
#..................................设置时间..........................................................
|
|
|
start=time.time()
|
|
@@ -27,6 +26,18 @@ def diag_cal():
|
|
|
start_time=end_time-datetime.timedelta(seconds=900)#10分钟跑一次,一次取10分钟数据
|
|
|
start_time=start_time.strftime('%Y-%m-%d %H:%M:%S')
|
|
|
end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
|
|
|
+
|
|
|
+ host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
|
|
|
+ port=3306
|
|
|
+ db='safety_platform'
|
|
|
+ user='qx_read'
|
|
|
+ password='Qx@123456'
|
|
|
+ mode=2
|
|
|
+ tablename2='all_fault_info'
|
|
|
+ DBRead = DBDw.DBDownload(host, port, db, user, password,mode)
|
|
|
+ with DBRead as DBRead:
|
|
|
+ df_Diag_Ram = DBRead.getdata('start_time','end_time','product_id','code','level','info','advice','Batpos',tablename=tablename2,factory='骑享',sn='',timename='',st='',sp='')
|
|
|
+
|
|
|
|
|
|
print('起',len(df_Diag_Ram))
|
|
|
for sn in SNnums:#SN遍历
|