Browse Source

Merge branch 'dev' of http://git.fast-fun.cn:92/lmstack/data_analyze_platform into dev

Eric412V 3 years ago
parent
commit
bc6b6b0006

+ 4 - 0
LIB/MIDDLE/OutlierDetection/VoltOutlier/V_1_0_0/sta.py

@@ -22,6 +22,8 @@ def cal_volt_uniform(dfin, volt_column, window=10, step=5, threshold=3):
     # 电压偏离度
     mean = df_volt_rolling.mean(axis=1)
     std = df_volt_rolling.std(axis=1)
+    # mean = [np.array(sorted(x)[1:-1]).mean() for x in df_volt_rolling.values]
+    # std = [np.array(sorted(x)[1:-1]).std() for x in df_volt_rolling.values]
     df_volt_rolling_norm = df_volt_rolling.sub(mean, axis=0).div(std,axis=0)
     df_volt_rolling_norm = df_volt_rolling_norm.reset_index(drop=True)
     return df_volt_rolling_norm, time_list
@@ -54,6 +56,8 @@ def cal_voltdiff_uniform(dfin, volt_column, window=10, step=5, window2=10, step2
     time_list = time_list[window2-1::step2] 
     mean = df_voltdiff_rolling.mean(axis=1)
     std = df_voltdiff_rolling.std(axis=1)
+    # mean = [np.array(sorted(x)[1:-1]).mean() for x in df_voltdiff_rolling.values]
+    # std = [np.array(sorted(x)[1:-1]).std() for x in df_voltdiff_rolling.values]
     df_voltdiff_rolling_norm = df_voltdiff_rolling.sub(mean, axis=0).div(std,axis=0)
     df_voltdiff_rolling_norm = df_voltdiff_rolling_norm.reset_index(drop=True)
     return df_voltdiff_rolling_norm, time_list

File diff suppressed because it is too large
+ 0 - 9
LIB/MIDDLE/OutlierDetection/VoltOutlier/main.ipynb


+ 7 - 7
LIB/MIDDLE/SaftyCenter/diagfault/main.py

@@ -10,8 +10,8 @@ from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import DBDownload
 from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import log
 from pandas.core.frame import DataFrame
 import datacompy
-from SaftyCenter.Common import FeiShuData
-from SaftyCenter.Common import QX_BatteryParam
+from LIB.MIDDLE.SaftyCenter.Common import FeiShuData
+from LIB.MIDDLE.SaftyCenter.SaftyCenter.Common import QX_BatteryParam
 
 #...................................电池包电芯安全诊断函数......................................................................................................................
 def diag_cal():
@@ -20,7 +20,7 @@ def diag_cal():
   
     start=time.time()
     end_time=datetime.datetime.now()
-    start_time=end_time-datetime.timedelta(seconds=130)
+    start_time=end_time-datetime.timedelta(seconds=300)
     start_time=start_time.strftime('%Y-%m-%d %H:%M:%S')
     end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
     df_read_Yunw = FeiShuData.getFeiShuDATA()#运维表格数据
@@ -125,11 +125,11 @@ def diag_cal():
             df_Diag_Ram = df_temp4
             df_Diag_Ram_fix = df_Diag_Ram.loc[df_Diag_Ram['Batpos'] == 1]
             df_Diag_Ram_unfix = df_Diag_Ram.loc[df_Diag_Ram['Batpos'] == 0]
-        if len(df_Diag_Ram) > 0:
+        if len(df_Diag_Ram) > 0:#历史及现有故障
             df_Diag_Ram.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\01Screen_Problem\result.csv',index=False,encoding='GB18030')
-        if len(df_Diag_Ram_fix) > 0:
+        if len(df_Diag_Ram_fix) > 0:#故障车辆已返仓
             df_Diag_Ram_fix.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\01Screen_Problem\result_fix.csv',index=False,encoding='GB18030')
-        if len(df_Diag_Ram_unfix) > 0:
+        if len(df_Diag_Ram_unfix) > 0:#故障车辆未返仓
             df_Diag_Ram_unfix.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\01Screen_Problemm\result_unfix.csv',index=False,encoding='GB18030')
         end=time.time()
         print(end-start)
@@ -167,7 +167,7 @@ if __name__ == "__main__":
     print('-------计算中-----------')
     #定时任务.......................................................................................................................................................................
     scheduler = BlockingScheduler()
-    scheduler.add_job(diag_cal, 'interval', seconds=120, id='diag_job')
+    scheduler.add_job(diag_cal, 'interval', seconds=300, id='diag_job')
 
     try:  
         scheduler.start()

Some files were not shown because too many files changed in this diff