zhuxi 3 سال پیش
والد
کامیت
7081925b53
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      LIB/MIDDLE/Anomaly_Detection/V1_0_0/main_detection.py

+ 2 - 2
LIB/MIDDLE/Anomaly_Detection/V1_0_0/main_detection.py

@@ -20,7 +20,7 @@ l = len(fileNames)
 
 now_time=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')   #type: str
 now_time=datetime.datetime.strptime(now_time,'%Y-%m-%d %H:%M:%S')     #type: datetime
-start_time=now_time-datetime.timedelta(hours=3)
+start_time=now_time-datetime.timedelta(hours=5)
 end_time=str(now_time)
 start_time=str(start_time)
 
@@ -55,7 +55,7 @@ for k in range(l):
         df_data = dbManager.get_data(sn=sn, start_time=start_time, end_time=end_time, data_groups=['bms'])
         data_test = df_data['bms']
         data_test=data_test[data_test['SOC[%]']>20]
-        if len(data_test)>0:
+        if len(data_test)>15:
             pca1 = joblib.load('pca1_'+sn+'.m')  
             pca2 = joblib.load('pca2_'+sn+'.m') 
             res1 = pd.read_csv('res1_'+sn+'.csv',encoding='gbk')