Bladeren bron

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

zhuxi 3 jaren geleden
bovenliggende
commit
4c9a016c22
37 gewijzigde bestanden met toevoegingen van 6645 en 73 verwijderingen
  1. 1 0
      .gitignore
  2. 32 11
      LIB/MIDDLE/CellStateEstimation/BatSafetyAlarm/V1_0_1/CBMSSafetyAlarm.py
  3. 46 38
      LIB/MIDDLE/CellStateEstimation/BatSafetyAlarm/main.py
  4. 666 0
      LIB/MIDDLE/CellStateEstimation/BatSafetyWarning/V1_0_1/CBMSBatInterShort.py
  5. 96 0
      LIB/MIDDLE/CellStateEstimation/BatSafetyWarning/V1_0_1/CBMSSafetyWarning.py
  6. 185 0
      LIB/MIDDLE/CellStateEstimation/BatSafetyWarning/main.py
  7. 6 6
      LIB/MIDDLE/CellStateEstimation/Common/V1_0_1/BatParam.py
  8. 1 0
      LIB/MIDDLE/CellStateEstimation/Common/V1_0_1/log.py
  9. 4 0
      LIB/MIDDLE/OutlierDetection/VoltOutlier/V_1_0_0/sta.py
  10. 0 9
      LIB/MIDDLE/OutlierDetection/VoltOutlier/main.ipynb
  11. 70 0
      LIB/MIDDLE/SaftyCenter/Common/DBDownload.py
  12. 63 0
      LIB/MIDDLE/SaftyCenter/Common/FeiShuData.py
  13. 9 9
      LIB/MIDDLE/SaftyCenter/Common/QX_BatteryParam.py
  14. 488 0
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/CBMSBatDiag.py
  15. 141 0
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/DataStatistics.py
  16. 36 0
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/DiagDataMerge.py
  17. 73 0
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/SC_CtrlSafty.py
  18. 356 0
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/SC_SamplingSafty.py
  19. 296 0
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/main.py
  20. BIN
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/各项目sn号.xlsx
  21. BIN
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/故障表头及数据类型.xlsx
  22. 221 0
      LIB/MIDDLE/SaftyCenter/Liplated/BatParam.py
  23. 164 0
      LIB/MIDDLE/SaftyCenter/Liplated/Li_plated.py
  24. 94 0
      LIB/MIDDLE/SaftyCenter/Liplated/main.py
  25. BIN
      LIB/MIDDLE/SaftyCenter/Liplated/析锂.xlsx
  26. 35 0
      LIB/MIDDLE/SaftyCenter/Low_Soc_Alarm/low_soc_alarm.py
  27. 86 0
      LIB/MIDDLE/SaftyCenter/Low_Soc_Alarm/main.py
  28. 28 0
      LIB/MIDDLE/SaftyCenter/StatusSta/V1_0_0/status_sta.py
  29. 952 0
      LIB/MIDDLE/SaftyCenter/StatusSta/main.ipynb
  30. 84 0
      LIB/MIDDLE/SaftyCenter/diagfault/SC_SamplingSafty.py
  31. 171 0
      LIB/MIDDLE/SaftyCenter/diagfault/main.py
  32. 24 0
      LIB/MIDDLE/SaftyCenter/log.py
  33. 1947 0
      LIB/MIDDLE/WinterCharging/V1_0_0/main.ipynb
  34. 121 0
      LIB/MIDDLE/WinterCharging/V1_0_1/Data_Analyse2.py
  35. 149 0
      LIB/MIDDLE/WinterCharging/V1_0_1/main.ipynb
  36. BIN
      Low_Soc_Alarm.xlsx
  37. BIN
      df_file.xlsx

+ 1 - 0
.gitignore

@@ -21,4 +21,5 @@
 /*/*/*/deploy.py
 !数据分析平台手册.doc
 *.pyc
+*.csv
 

+ 32 - 11
LIB/MIDDLE/CellStateEstimation/BatSafetyAlarm/V1_0_1/CBMSSafetyAlarm.py

@@ -42,7 +42,7 @@ class SafetyAlarm:
     
     #寻找当前行数据的所有温度值...................................................................................
     def _celltemp_get(self,num):   
-        celltemp = list(self.df_bms.loc[num,self.celltemp_name])
+        celltemp = np.array(self.df_bms.loc[num,self.celltemp_name])
         return celltemp
 
     #获取当前行所有电压数据............................................................................................
@@ -93,7 +93,7 @@ class SafetyAlarm:
 
                         delttime=(time2-time1).total_seconds()
                         celltemp_rate=(max(temp2-temp1)*60)/delttime    #计算最大温升速率
-                        if celltemp_rate>self.param.TrwTempRate and self.param.CellTempLwLmt<min(temp1) and max(temp1)<self.param.CellTempUpLmt:
+                        if celltemp_rate>self.param.TrwTempRate and self.param.CellTempLwLmt<min(temp1) and max(temp1)<self.param.CellTempUpLmt and max(temp2-temp1)>3:
                             celltemprise=1
                         else:
                             pass
@@ -115,19 +115,41 @@ class SafetyAlarm:
                 pass
             
             #电压诊断功能.........................................................................................................................................
-            cellvolt=self._cellvolt_get(i)
-            cellvolt2=np.array(cellvolt)
-            cellvoltmin=min(cellvolt)
-            cellvoltmax=max(cellvolt)
-            cellvoltmin_index=cellvolt.index(cellvoltmin)
-            cellvoltmax_index=cellvolt.index(cellvoltmax)
+            if i<1:
+                cellvolt2=self._cellvolt_get(i)
+                cellvoltmin2=min(cellvolt2)
+                cellvoltmax2=max(cellvolt2)
+                cellvoltmin_index2=list(cellvolt2).index(cellvoltmin2)
+                cellvoltmax_index2=list(cellvolt2).index(cellvoltmax2)
+                if not self.df_bms_ram.empty:
+                    cellvolt1=np.array(self.df_bms_ram.iloc[-1]['cellvolt'])
+                    cellvoltmin1=min(cellvolt1)
+                    cellvoltmax1=max(cellvolt1)
+                    cellvoltmin_index1=list(cellvolt1).index(cellvoltmin1)
+                    cellvoltmax_index1=list(cellvolt1).index(cellvoltmax1)
+                else:
+                    cellvoltmin1=cellvoltmin2
+                    cellvoltmax1=cellvoltmax2
+                    cellvoltmin_index1=cellvoltmin_index2
+                    cellvoltmax_index1=cellvoltmax_index2
+            else:
+                cellvolt2=self._cellvolt_get(i)
+                cellvoltmin2=min(cellvolt2)
+                cellvoltmax2=max(cellvolt2)
+                cellvoltmin_index2=list(cellvolt2).index(cellvoltmin2)
+                cellvoltmax_index2=list(cellvolt2).index(cellvoltmax2)
+                cellvolt1=self._cellvolt_get(i-1)
+                cellvoltmin1=min(cellvolt1)
+                cellvoltmax1=max(cellvolt1)
+                cellvoltmin_index1=list(cellvolt1).index(cellvoltmin1)
+                cellvoltmax_index1=list(cellvolt1).index(cellvoltmax1)
 
             #电压有效性..........................................................................................................................................
-            if (cellvoltmin<2 and cellvoltmax>4.5 and (cellvoltmax_index-cellvoltmin_index)==1) or cellvoltmin<0.01:   #电压断线故障进入
+            if (cellvoltmin2<2 and cellvoltmax2>4.5 and abs(cellvoltmax_index2-cellvoltmin_index2)==1) or cellvoltmin2<0.01 or (cellvoltmin1<2 and cellvoltmax1>4.5 and abs(cellvoltmax_index1-cellvoltmin_index1)==1) or cellvoltmin1<0.01:   #电压断线故障进入
                 cellvoltvalid=0
             else:
                 cellvoltvalid=1
-   
+
             if cellvoltvalid==1:
                 #单体电压跌落诊断...........................................................................................................................
                 if i<1:
@@ -135,7 +157,6 @@ class SafetyAlarm:
                         time1=self.df_bms_ram.iloc[-1]['time']
                         time2=self.bmstime[i]
                         delttime=(time2-time1).total_seconds()
-                        cellvolt1=np.array(self.df_bms_ram.iloc[-1]['cellvolt'])
                         if delttime<310:
                             if self.packcrnt[i]<0.5 and max(cellvolt1-cellvolt2)>self.param.TrwCellVoltFall:
                                 cellvoltfall=1

+ 46 - 38
LIB/MIDDLE/CellStateEstimation/BatSafetyAlarm/main.py

@@ -1,4 +1,5 @@
 import CBMSSafetyAlarm
+import pymysql
 import datetime
 import pandas as pd
 import multiprocessing
@@ -9,14 +10,33 @@ from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import log
 
 
 #...................................电池包电芯安全诊断函数......................................................................................................................
-def diag_cal(sn_list, df_diag_ram, df_bms_ram):
-    
-    start=time.time()
+def diag_cal(sn_list, df_bms_ram):
+
+    # start=time.time()
     now_time=datetime.datetime.now()
     start_time=now_time-datetime.timedelta(seconds=70)
     start_time=start_time.strftime('%Y-%m-%d %H:%M:%S')
     end_time=now_time.strftime('%Y-%m-%d %H:%M:%S')
 
+    #数据库配置
+    host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
+    port=3306
+    user='qx_algo_readonly'
+    password = 'qx@123456'
+
+    #读取故障结果库中code==119且end_time='0000-00-00 00:00:00'...............................
+    db='safety_platform'
+    mysql = pymysql.connect (host=host, port=port, user=user, password=password, database=db)
+    cursor = mysql.cursor()
+    param='start_time,end_time,product_id,code,level,info,advice'
+    tablename='all_fault_info'
+    sql =  "select %s from %s where code=119 and end_time='0000-00-00 00:00:00'" %(param,tablename)
+    cursor.execute(sql)
+    res = cursor.fetchall()
+    df_diag_ram= pd.DataFrame(res,columns=param.split(','))
+    cursor.close()
+    mysql.close()
+
     for sn in sn_list:
         if 'PK500' in sn:
             celltype=1 #6040三元电芯
@@ -37,57 +57,47 @@ def diag_cal(sn_list, df_diag_ram, df_bms_ram):
         dbManager = DBManager.DBManager()
         df_data = dbManager.get_data(sn=sn, start_time=start_time, end_time=end_time, data_groups=['bms'])
         df_bms = df_data['bms']
-        # print(df_bms)
+        print(df_bms)
 
         #电池诊断................................................................................................................................................................
-        if not df_bms.empty:
-            df_diag_ram_sn=df_diag_ram[df_diag_ram['product_id']==sn]
-            df_bms_ram_sn=df_bms_ram[df_bms_ram['sn']==sn]
-            if df_diag_ram_sn.empty:
+        df_diag_ram_sn=df_diag_ram[df_diag_ram['product_id']==sn]
+        df_bms_ram_sn=df_bms_ram[df_bms_ram['sn']==sn]
+        if df_diag_ram_sn.empty:   
+            if not df_bms.empty:
                 SafetyAlarm=CBMSSafetyAlarm.SafetyAlarm(sn,celltype,df_bms, df_bms_ram_sn)
                 df_diag_res, df_bms_res=SafetyAlarm.diag() 
 
-                #更新bms的ram数据 和 diag的Ram数据
+                #更新bms的ram数据
                 sn_index=df_bms_ram.loc[df_bms_ram['sn']==sn].index
                 df_bms_ram=df_bms_ram.drop(index=sn_index)
                 df_bms_ram=df_bms_ram.append(df_bms_res)
 
-                sn_index=df_diag_ram.loc[df_diag_ram['product_id']==sn].index
-                df_diag_ram=df_diag_ram.drop(index=sn_index)
-                df_diag_ram=df_diag_ram.append(df_diag_res)
-                df_diag_ram.reset_index(inplace=True,drop=True)     #重置索引
-
                 #当前热失控故障写入数据库
                 if not df_diag_res.empty:
-                    with open(r'D:\Platform\platform_python\data_analyze_platform\USER\spf\01qixiang\06BatSafetyAlarm\热失控.txt','a') as file:
+                    with open(r'D:\Platform\platform_python\data_analyze_platform\USER\spf\01qixiang\06BatSafetyAlarm\热失控报警.txt','a') as file:
                         file.write(str(tuple(df_diag_res.iloc[-1]))+'\n')
                 
-            #当前热失控已超过三天变为历史故障并写入数据库,并删除原有数据库中的当前故障和ram中的当前故障
-            elif (now_time-df_bms_ram_sn.iloc[-1]['time']).total_seconds()>3*24*3600:
-                df_diag_ram=df_diag_ram.drop(df_diag_ram['sn']==sn)    #删除ram中的当前故障
-                df_bms_ram_sn.iloc[-1]['end_time']=now_time
-                with open(r'D:\Platform\platform_python\data_analyze_platform\USER\spf\01qixiang\06BatSafetyAlarm\热失控.txt','a') as file:
-                        file.write(str(tuple(df_diag_res.iloc[-1]))+'\n')
-
-
-
-        #故障处理........................................................................................................................................................
-
-        end=time.time()
-        print(end-start)
-        # print(df_soh)
-
+        #当前热失控已超过一天变为历史故障并更改数据库
+        else:
+            fault_time=datetime.datetime.strptime(df_diag_ram_sn.iloc[-1]['start_time'], '%Y-%m-%d %H:%M:%S')
+            if (now_time-fault_time).total_seconds()>24*3600:
+                df_diag_ram_sn['end_time']=end_time
+                df_diag_ram_sn['Batpos']=1
+                with open(r'D:\Platform\platform_python\data_analyze_platform\USER\spf\01qixiang\06BatSafetyAlarm\热失控报警.txt','a') as file:
+                    file.write(str(tuple(df_diag_ram_sn.iloc[-1]))+'\n')
+
+        # end=time.time()
+        # print(end-start)
 #...................................................主进程...........................................................................................................
 def mainprocess():
     global SNnums
-    global df_diag_ram
     global df_bms_ram
     process = 2
     pool = multiprocessing.Pool(processes = process)
 
     for i in range(process):
         sn_list = SNnums[i]
-        pool.apply_async(diag_cal, (sn_list,df_diag_ram,df_bms_ram))
+        pool.apply_async(diag_cal, (sn_list,df_bms_ram))
 
     pool.close()
     pool.join()
@@ -110,19 +120,17 @@ if __name__ == "__main__":
     SNnums_C7255=SNdata_C7255['SN号'].tolist()
     SNnums_U7255=SNdata_U7255['SN号'].tolist()
     SNnums=[SNnums_L7255 + SNnums_C7255 + SNnums_U7255, SNnums_6040 + SNnums_4840 + SNnums_6060]
-    # SNnums=['PK50201A000002201']
+    SNnums=[[], ['PK504B10100004447']]
     
     mylog=log.Mylog('log_diag.txt','error')
     mylog.logcfg()
-
-    #............................模块运行前,先读取数据库中所有结束时间为0的数据,需要从数据库中读取...................................
-    result=pd.read_excel(r'D:\Platform\platform_python\data_analyze_platform\USER\spf\01qixiang\06BatSafetyAlarm\result.xlsx')
-    df_diag_ram=result[(result['end_time']=='0000-00-00 00:00:00') & (result['code']==119)]
+    
+    #参数初始化
     df_bms_ram=pd.DataFrame(columns=['time', 'sn', 'packvolt', 'cellvolt', 'celltemp'])
 
     #定时任务.......................................................................................................................................................................
     scheduler = BlockingScheduler()
-    scheduler.add_job(mainprocess, 'interval', seconds=60, id='diag_job')
+    scheduler.add_job(mainprocess, 'interval', seconds=10, id='diag_job')
 
     try:  
         scheduler.start()

+ 666 - 0
LIB/MIDDLE/CellStateEstimation/BatSafetyWarning/V1_0_1/CBMSBatInterShort.py

@@ -0,0 +1,666 @@
+import pandas as pd
+import numpy as np
+import matplotlib.pyplot as plt
+# from pymysql import paramstyle
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import BatParam
+
+class BatInterShort():
+    def __init__(self,sn,celltype,df_bms,df_soh,df_last,df_last1,df_last2,df_last3,df_lfp):  #参数初始化
+
+        if (not df_lfp.empty) and celltype>50:
+            df_lfp.drop(['sn'],axis=1)
+            df_bms=pd.concat([df_lfp, df_bms], ignore_index=True)
+        else:
+            pass
+
+        self.sn=sn
+        self.celltype=celltype
+        self.param=BatParam.BatParam(celltype)
+        self.df_bms=df_bms
+        self.packcrnt=df_bms['总电流[A]']*self.param.PackCrntDec
+        self.packvolt=df_bms['总电压[V]']
+        self.bms_soc=df_bms['SOC[%]']
+        self.bmstime= pd.to_datetime(df_bms['时间戳'], format='%Y-%m-%d %H:%M:%S')
+
+        self.df_soh=df_soh
+        self.df_last=df_last
+        self.df_last1=df_last1
+        self.df_last2=df_last2
+        self.df_last3=df_last3
+        self.df_lfp=df_lfp
+
+        self.cellvolt_name=['单体电压'+str(x) for x in range(1,self.param.CellVoltNums+1)]
+        self.celltemp_name=['单体温度'+str(x) for x in range(1,self.param.CellTempNums+1)]
+    
+    def intershort(self):
+        if self.celltype<=50:
+            df_res, df_ram_last, df_ram_last1, df_ram_last3=self._ncm_intershort()
+            return df_res, df_ram_last, df_ram_last1,self.df_last2, df_ram_last3,self.df_lfp
+            
+        else:
+            df_res, df_ram_last, df_ram_last1, df_ram_last2, df_ram_last3, df_ram_lfp=self._lfp_intershort()
+            return df_res, df_ram_last, df_ram_last1, df_ram_last2, df_ram_last3, df_ram_lfp
+
+
+    #定义滑动滤波函数....................................................................................
+    def _np_move_avg(self,a, n, mode="same"): 
+        return (np.convolve(a, np.ones((n,)) / n, mode=mode))
+    
+    #寻找当前行数据的最小温度值.............................................................................
+    def _celltemp_weight(self,num):   
+        celltemp = list(self.df_bms.loc[num,self.celltemp_name])
+        celltemp=np.mean(celltemp)
+        self.celltemp=celltemp
+        if self.celltype==99:
+            if celltemp>=25:
+                self.tempweight=1
+                self.StandardStandingTime=3600
+            elif celltemp>=15:
+                self.tempweight=0.6
+                self.StandardStandingTime=7200
+            elif celltemp>=5:
+                self.tempweight=0.
+                self.StandardStandingTime=10800
+            else:
+                self.tempweight=0.1
+                self.StandardStandingTime=10800
+        else:
+            if celltemp>=20:
+                self.tempweight=1
+                self.StandardStandingTime=3600
+            elif celltemp>=10:
+                self.tempweight=0.8
+                self.StandardStandingTime=3600
+            elif celltemp>=5:
+                self.tempweight=0.6
+                self.StandardStandingTime=7200
+            else:
+                self.tempweight=0.2
+                self.StandardStandingTime=10800
+
+    #获取当前行所有电压数据........................................................................................
+    def _cellvolt_get(self,num): 
+        cellvolt = np.array(self.df_bms.loc[num,self.cellvolt_name])/1000
+        return cellvolt
+
+    #获取当前行所有soc差...........................................................................................
+    def _celldeltsoc_get(self,num,dict_baltime,capacity): 
+        cellsoc=[]
+        celldeltsoc=[]
+        for j in range(1, self.param.CellVoltNums+1):   #获取每个电芯电压对应的SOC值
+            cellvolt=self.df_bms.loc[num,'单体电压' + str(j)]/1000
+            ocv_soc=np.interp(cellvolt,self.param.LookTab_OCV,self.param.LookTab_SOC)
+            if j in dict_baltime.keys():
+                ocv_soc=ocv_soc+dict_baltime[j]*self.param.BalCurrent/(capacity*3600)   #补偿均衡电流
+            else:
+                pass
+            cellsoc.append(ocv_soc)
+        
+        if self.celltype==1 or self.celltype==2:
+            consum_num=7
+            cellsoc1=cellsoc[:self.param.CellVoltNums-consum_num]    #切片,将bms耗电的电芯和非耗电的电芯分离开
+            cellsocmean1=(sum(cellsoc1)-max(cellsoc1)-min(cellsoc1))/(len(cellsoc1)-2)
+            cellsoc2=cellsoc[self.param.CellVoltNums-consum_num:]
+            cellsocmean2=(sum(cellsoc2)-max(cellsoc2)-min(cellsoc2))/(len(cellsoc2)-2)
+            
+            for j in range(len(cellsoc)):   #计算每个电芯的soc差
+                if j<self.param.CellVoltNums-consum_num:
+                    celldeltsoc.append(cellsoc[j]-cellsocmean1)
+                else:
+                    celldeltsoc.append(cellsoc[j]-cellsocmean2)
+            return np.array(celldeltsoc), np.array(cellsoc)
+
+        else:
+            cellsocmean=(sum(cellsoc)-max(cellsoc)-min(cellsoc))/(len(cellsoc)-2)
+            for j in range(len(cellsoc)):   #计算每个电芯的soc差
+                celldeltsoc.append(cellsoc[j]-cellsocmean)
+            return np.array(celldeltsoc), np.array(cellsoc)
+ 
+    #获取所有电芯的As差
+    def _cellDeltAs_get(self,chrg_st,chrg_end,dict_baltime):
+        cellAs=[]
+        celldeltAs=[]
+        for j in range(1, self.param.CellVoltNums+1):   #获取每个电芯电压>峰值电压的充入As数
+            if j in dict_baltime.keys():    #补偿均衡电流
+                As=-self.param.BalCurrent*dict_baltime[j]
+            else:    
+                As=0
+            As_tatol=0
+            symbol=0
+            for m in range(chrg_st+1,chrg_end):
+                As=As-self.packcrnt[m]*(self.bmstime[m]-self.bmstime[m-1]).total_seconds()
+                if symbol<5:
+                    if self.df_bms.loc[m,'单体电压'+str(j)]/1000>self.param.PeakCellVolt[symbol]:
+                        As_tatol=As_tatol+As
+                        symbol=symbol+1
+                    else:
+                        continue
+                else:
+                    cellAs.append(As_tatol/5)
+                    break
+        
+        if self.celltype==99:
+            consum_num=10
+            cellAs1=cellAs[:self.param.CellVoltNums-consum_num]    #切片,将bms耗电的电芯和非耗电的电芯分离开
+            cellAsmean1=(sum(cellAs1)-max(cellAs1)-min(cellAs1))/(len(cellAs1)-2)
+            cellAs2=cellAs[self.param.CellVoltNums-consum_num:]
+            cellAsmean2=(sum(cellAs2)-max(cellAs2)-min(cellAs2))/(len(cellAs2)-2)
+            
+            for j in range(len(cellAs)):   #计算每个电芯的soc差
+                if j<self.param.CellVoltNums-consum_num:
+                    celldeltAs.append(cellAs[j]-cellAsmean1)
+                else:
+                    celldeltAs.append(cellAs[j]-cellAsmean2)
+        else:
+            cellAsmean=(sum(cellAs)-max(cellAs)-min(cellAs))/(len(cellAs)-2)
+            for j in range(len(cellAs)):   #计算每个电芯的soc差
+                celldeltAs.append(cellAs[j]-cellAsmean)
+            
+        return np.array(celldeltAs)
+
+    #计算每个电芯的均衡时长..........................................................................................................................
+    def _bal_time(self,dict_bal):
+        dict_baltime={}
+        dict_baltime1={}
+        for key in dict_bal:
+            count=1
+            x=eval(key)
+            while x>0:
+                if x & 1==1:    #判断最后一位是否为1
+                    if count in dict_baltime.keys():
+                        dict_baltime[count] = dict_baltime[count] + dict_bal[key]
+                    else:
+                        dict_baltime[count] = dict_bal[key]
+                else:
+                    pass
+                count += 1
+                x >>= 1    #右移一位
+        
+        dict_baltime=dict(sorted(dict_baltime.items(),key=lambda dict_baltime:dict_baltime[0]))
+        for key in dict_baltime:    #解析均衡的电芯编号
+            if self.celltype==1:    #科易6040
+                if key<14:
+                    dict_baltime1[key]=dict_baltime[key]
+                elif key<18:
+                    dict_baltime1[key-1]=dict_baltime[key]
+                else:
+                    dict_baltime1[key-3]=dict_baltime[key]
+            elif self.celltype==1:    #科易4840
+                if key<4:
+                    dict_baltime1[key-1]=dict_baltime[key]
+                elif key<8:
+                    dict_baltime1[key-1]=dict_baltime[key]
+                elif key<14:
+                    dict_baltime1[key-3]=dict_baltime[key]
+                elif key<18:
+                    dict_baltime1[key-4]=dict_baltime[key]
+                else:
+                    dict_baltime1[key-6]=dict_baltime[key]
+            else:
+                dict_baltime1=dict_baltime
+        return dict_baltime1
+
+    #三元电池的内短路电流计算...........................................................................................................................................................
+    def _ncm_intershort(self):
+        column_name=['time_st', 'time_sp', 'sn', 'method','short_current','baltime']
+        df_res=pd.DataFrame(columns=column_name)
+        df_ram_last=self.df_last
+        df_ram_last1=self.df_last1
+        df_ram_last3=self.df_last3
+
+        #容量初始化
+        if self.df_soh.empty:
+            batsoh=self.df_bms.loc[0,'SOH[%]']
+            capacity=self.param.Capacity*batsoh/100
+        else:
+            batsoh=self.df_soh.loc[len(self.df_soh)-1,'soh']
+            capacity=self.param.Capacity*batsoh/100
+
+        #参数初始化
+        if self.df_last.empty:  
+            firsttime=1
+            dict_bal={}
+        else:
+            deltsoc_last=self.df_last.loc[0,'deltsoc']
+            cellsoc_last=self.df_last.loc[0,'cellsoc']
+            time_last=self.df_last.loc[0,'time']
+            firsttime=0
+            dict_bal={}
+        if self.df_last1.empty:
+            firsttime1=1
+            dict_bal1={}
+        else:
+            deltsoc_last1=self.df_last1.loc[0,'deltsoc1']
+            time_last1=self.df_last1.loc[0,'time1']
+            firsttime1=0
+            dict_bal1={}
+        if self.df_last3.empty:
+            standingtime=0
+            standingtime1=0
+        else:
+            standingtime=self.df_last3.loc[0,'standingtime']
+            standingtime1=self.df_last3.loc[0,'standingtime1']
+            firsttime1=0
+            dict_bal1={}
+
+        for i in range(1,len(self.df_bms)-1):
+
+            if firsttime1==0:   #满电静置算法--计算均衡状态对应的均衡时间
+                try:
+                    balstat=int(self.df_bms.loc[i,'单体均衡状态'])
+                    if balstat>0.5:
+                        bal_step=(self.bmstime[i+1]-self.bmstime[i]).total_seconds()  #均衡步长
+                        bal_step=int(bal_step)
+                        if str(balstat) in dict_bal1.keys():
+                            dict_bal1[str(balstat)]=dict_bal1[str(balstat)]+bal_step
+                        else:
+                            dict_bal1[str(balstat)]=bal_step
+                    else:
+                        pass
+                except:
+                    dict_bal1={}
+            else:
+                pass
+
+            if abs(self.packcrnt[i]) < 0.1 and abs(self.packcrnt[i-1]) < 0.1 and abs(self.packcrnt[i+1]) < 0.1:     
+                delttime=(self.bmstime[i]-self.bmstime[i-1]).total_seconds()
+                standingtime=standingtime+delttime
+                standingtime1=standingtime1+delttime
+                self._celltemp_weight(i)
+
+                #长时间静置法计算内短路-开始.....................................................................................................................................
+                if firsttime==1:    
+                    if standingtime>self.StandardStandingTime*2:      #静置时间满足要求
+                        standingtime=0
+                        cellvolt_now=self._cellvolt_get(i)
+                        cellvolt_min=min(cellvolt_now)
+                        cellvolt_max=max(cellvolt_now)
+                        cellvolt_last=self._cellvolt_get(i-1)
+                        deltvolt=max(abs(cellvolt_now-cellvolt_last))
+
+                        if 2<cellvolt_min<4.5 and 2<cellvolt_max<4.5 and deltvolt<0.005: 
+                            dict_baltime={}   #获取每个电芯的均衡时间
+                            deltsoc_last, cellsoc_last=self._celldeltsoc_get(i,dict_baltime,capacity)
+                            time_last=self.bmstime[i]
+                            firsttime=0
+                            df_ram_last.loc[0]=[self.sn,time_last,deltsoc_last,cellsoc_last]   #更新RAM信息
+                    else:
+                        pass                
+                elif standingtime>3600*10:
+                    standingtime=0
+                    cellvolt_now=self._cellvolt_get(i)
+                    cellvolt_min=min(cellvolt_now)
+                    cellvolt_max=max(cellvolt_now)
+                    cellvolt_last=self._cellvolt_get(i-1)
+                    deltvolt=max(abs(cellvolt_now-cellvolt_last))
+                    
+                    if 2<cellvolt_min<4.5 and 2<cellvolt_max<4.5 and deltvolt<0.005:
+                        dict_baltime=self._bal_time(dict_bal)   #获取每个电芯的均衡时间
+                        deltsoc_now, cellsoc_now=self._celldeltsoc_get(i,dict_baltime,capacity)
+                        time_now=self.bmstime[i]
+                        if -5<max(cellsoc_now-cellsoc_last)<5:
+                            df_ram_last.loc[0]=[self.sn,time_now,deltsoc_now,cellsoc_now] #更新RAM信息
+                            
+                            list_sub=deltsoc_now-deltsoc_last
+                            list_pud=(0.01*capacity*3600*1000)/(time_now-time_last).total_seconds()
+                            leak_current=list_sub*list_pud
+                            # leak_current=np.array(leak_current)
+                            leak_current=np.round(leak_current,3)
+                            leak_current=list(leak_current)
+                            
+                            df_res.loc[len(df_res)]=[time_last,time_now,self.sn,1,str(leak_current),str(dict_baltime)]  #计算结果存入Dataframe
+                            time_last=time_now  #更新时间
+                            deltsoc_last=deltsoc_now    #更新soc差
+                            dict_bal={}
+                        else:
+                            firsttime=1
+                else: 
+                    try:  
+                        balstat=int(self.df_bms.loc[i,'单体均衡状态'])
+                        if balstat>0.5:
+                            bal_step=(self.bmstime[i+1]-self.bmstime[i]).total_seconds()  #均衡步长
+                            bal_step=int(bal_step)
+                            if str(balstat) in dict_bal.keys():
+                                dict_bal[str(balstat)]=dict_bal[str(balstat)]+bal_step
+                            else:
+                                dict_bal[str(balstat)]=bal_step
+                        else:
+                            pass
+                    except:
+                        dict_bal={}
+
+                #满电静置法计算内短路-开始.....................................................................................................................................................
+                if self.StandardStandingTime<standingtime1:  
+                    standingtime1=0
+                    cellvolt_now1=self._cellvolt_get(i)
+                    cellvolt_max1=max(cellvolt_now1)
+                    cellvolt_min1=min(cellvolt_now1)
+                    cellvolt_last1=self._cellvolt_get(i-1)
+                    deltvolt1=max(abs(cellvolt_now1-cellvolt_last1))
+                    cellsoc_now1=np.interp(cellvolt_max1,self.param.LookTab_OCV,self.param.LookTab_SOC)
+
+                    if cellsoc_now1>=self.param.FullChrgSoc-10 and 2<cellvolt_min1<4.5 and 2<cellvolt_max1<4.5 and deltvolt1<0.005:
+                        if firsttime1==1:
+                            dict_baltime1={}   #获取每个电芯的均衡时间
+                            deltsoc_last1, cellsoc_last1=self._celldeltsoc_get(i,dict_baltime1,capacity)
+                            time_last1=self.bmstime[i]
+                            firsttime1=0
+                            df_ram_last1.loc[0]=[self.sn,time_last1,deltsoc_last1]    #更新RAM信息
+                        else:
+                            dict_baltime1=self._bal_time(dict_bal1)   #获取每个电芯的均衡时间
+                            time_now1=self.bmstime[i]
+                            if (time_now1-time_last1).total_seconds()>3600*12:
+                                deltsoc_now1, cellsoc_now1=self._celldeltsoc_get(i,dict_baltime1,capacity)
+                                df_ram_last1.loc[0]=[self.sn,time_now1,deltsoc_now1] #更新RAM信息
+
+                                list_sub1=deltsoc_now1-deltsoc_last1
+                                list_pud1=(0.01*capacity*3600*1000)/(time_now1-time_last1).total_seconds()
+                                leak_current1=list_sub1*list_pud1
+                                # leak_current1=np.array(leak_current1)
+                                leak_current1=np.round(leak_current1,3)
+                                leak_current1=list(leak_current1)
+                                
+                                df_res.loc[len(df_res)]=[time_last1,time_now1,self.sn,2,str(leak_current1),str(dict_baltime1)]  #计算结果存入Dataframe
+                                time_last1=time_now1  #更新时间
+                                deltsoc_last1=deltsoc_now1    #更新soc差
+                                dict_bal1={}
+                            else:
+                                pass
+                    else:
+                        pass
+                else:   
+                    pass
+
+            else:
+                df_ram_last=pd.DataFrame(columns=['sn','time','deltsoc','cellsoc'])   #电流>0,清空上次静置的SOC差
+                dict_bal={} 
+                firsttime=1
+                standingtime=0
+                standingtime1=0
+                pass
+        
+        #更新RAM的standingtime
+        df_ram_last3.loc[0]=[self.sn,standingtime,standingtime1]
+
+        #返回计算结果
+        if df_res.empty:    
+            return pd.DataFrame(), df_ram_last, df_ram_last1, df_ram_last3
+        else:
+            return df_res, df_ram_last, df_ram_last1, df_ram_last3
+
+    #磷酸铁锂电池内短路计算程序.............................................................................................................................
+    def _lfp_intershort(self):
+        column_name=['time_st', 'time_sp', 'sn', 'method','short_current','baltime']
+        df_res=pd.DataFrame(columns=column_name)
+        df_ram_last=self.df_last
+        df_ram_last1=self.df_last1
+        df_ram_last2=self.df_last2
+        df_ram_last3=self.df_last3
+        df_ram_lfp=pd.DataFrame(columns=self.df_bms.columns.tolist())
+
+        #容量初始化
+        if self.df_soh.empty:
+            batsoh=self.df_bms.loc[0,'SOH[%]']
+            capacity=self.param.Capacity*batsoh/100
+        else:
+            batsoh=self.df_soh.loc[len(self.df_soh)-1,'soh']
+            capacity=self.param.Capacity*batsoh/100
+        #参数初始化
+        if self.df_last.empty:  
+            firsttime=1
+            dict_bal={}
+        else:
+            deltsoc_last=self.df_last.loc[0,'deltsoc']
+            cellsoc_last=self.df_last.loc[0,'cellsoc']
+            time_last=self.df_last.loc[0,'time']
+            firsttime=0
+            dict_bal={}
+        if self.df_last1.empty:
+            firsttime1=1
+            dict_bal1={}
+        else:
+            deltsoc_last1=self.df_last1.loc[0,'deltsoc1']
+            time_last1=self.df_last1.loc[0,'time1']
+            firsttime1=0
+            dict_bal1={}
+        if self.df_last2.empty:
+            firsttime2=1
+            charging=0
+            dict_bal2={}
+        else:
+            deltAs_last2=self.df_last2.loc[0,'deltAs2']
+            time_last2=self.df_last2.loc[0,'time2']
+            firsttime2=0
+            charging=0
+            dict_bal2={}
+        if self.df_last3.empty:
+            standingtime=0
+            standingtime1=0
+        else:
+            standingtime=self.df_last3.loc[0,'standingtime']
+            standingtime1=self.df_last3.loc[0,'standingtime1']
+            dict_bal1={}
+
+        for i in range(1,len(self.df_bms)-1):
+
+            #静置法计算内短路..........................................................................................................................
+            if firsttime1==0:   #满电静置算法--计算均衡状态对应的均衡时间
+                try:
+                    balstat=int(self.df_bms.loc[i,'单体均衡状态'])
+                    if balstat>0.5:
+                        bal_step=(self.bmstime[i+1]-self.bmstime[i]).total_seconds()  #均衡步长
+                        bal_step=int(bal_step)
+                        if str(balstat) in dict_bal1.keys():
+                            dict_bal1[str(balstat)]=dict_bal1[str(balstat)]+bal_step
+                        else:
+                            dict_bal1[str(balstat)]=bal_step
+                    else:
+                        pass
+                except:
+                    dict_bal1={}
+            else:
+                pass
+
+            if abs(self.packcrnt[i]) < 0.1 and abs(self.packcrnt[i-1]) < 0.1 and abs(self.packcrnt[i+1]) < 0.1:     
+                delttime=(self.bmstime[i]-self.bmstime[i-1]).total_seconds()
+                standingtime=standingtime+delttime
+                standingtime1=standingtime1+delttime
+                self._celltemp_weight(i)
+
+                #长时间静置法计算内短路-开始.....................................................................................................................................
+                if firsttime==1:    
+                    if standingtime>self.StandardStandingTime:      #静置时间满足要求
+                        standingtime=0
+                        cellvolt_now=self._cellvolt_get(i)
+                        cellvolt_min=min(cellvolt_now)
+                        cellvolt_max=max(cellvolt_now)
+                        cellvolt_last=self._cellvolt_get(i-1)
+                        deltvolt=max(abs(cellvolt_now-cellvolt_last))
+
+                        if 2<cellvolt_max<self.param.OcvInflexionBelow-0.002 and 2<cellvolt_min<4.5 and abs(deltvolt)<0.003:
+                            dict_baltime={}  #获取每个电芯的均衡时间
+                            deltsoc_last, cellsoc_last=self._celldeltsoc_get(i,dict_baltime,capacity)
+                            time_last=self.bmstime[i]
+                            firsttime=0
+                            df_ram_last.loc[0]=[self.sn,time_last,deltsoc_last,cellsoc_last]   #更新RAM信息
+                        else:
+                            pass
+                    else:
+                        pass                
+                elif standingtime>3600*10:
+                    standingtime=0
+                    cellvolt_now=np.array(self._cellvolt_get(i))
+                    cellvolt_min=min(cellvolt_now)
+                    cellvolt_max=max(cellvolt_now)
+                    cellvolt_last=np.array(self._cellvolt_get(i-1))
+                    deltvolt=max(abs(cellvolt_now-cellvolt_last))
+
+                    if 2<cellvolt_max<self.param.OcvInflexionBelow-0.002 and 2<cellvolt_min<4.5  and abs(deltvolt)<0.003:
+                        dict_baltime=self._bal_time(dict_bal)   #获取每个电芯的均衡时间
+                        deltsoc_now, cellsoc_now=self._celldeltsoc_get(i, dict_baltime,capacity)    #获取每个电芯的SOC差
+                        time_now=self.bmstime[i]
+                        if -5<max(cellsoc_now-cellsoc_last)<5:
+                            df_ram_last.loc[0]=[self.sn,time_now,deltsoc_now,cellsoc_now]   #更新RAM信息
+
+                            list_sub=deltsoc_now-deltsoc_last
+                            list_pud=(0.01*capacity*3600*1000)/(time_now-time_last).total_seconds()
+                            leak_current=list_sub*list_pud
+                            # leak_current=np.array(leak_current)
+                            leak_current=np.round(leak_current,3)
+                            leak_current=list(leak_current)
+                            
+                            df_res.loc[len(df_res)]=[time_last,time_now,self.sn,1,str(leak_current),str(dict_baltime)]  #计算结果存入Dataframe
+                            time_last=time_now  #更新时间
+                            deltsoc_last=deltsoc_now    #更新soc差
+                            dict_bal={}
+                        else:
+                            firsttime=1
+                    else:
+                        pass
+                else: 
+                    try:  
+                        balstat=int(self.df_bms.loc[i,'单体均衡状态'])
+                        if balstat>0.5:
+                            bal_step=(self.bmstime[i+1]-self.bmstime[i]).total_seconds()  #均衡步长
+                            bal_step=int(bal_step)
+                            if str(balstat) in dict_bal.keys():
+                                dict_bal[str(balstat)]=dict_bal[str(balstat)]+bal_step
+                            else:
+                                dict_bal[str(balstat)]=bal_step
+                        else:
+                            pass
+                    except:
+                        dict_bal={}
+
+                #非平台区间静置法计算内短路-开始.....................................................................................................................................................
+                if standingtime1>self.StandardStandingTime: 
+                    standingtime1=0
+                    cellvolt_now1=self._cellvolt_get(i)
+                    cellvolt_max1=max(cellvolt_now1)
+                    cellvolt_min1=min(cellvolt_now1)
+                    cellvolt_last1=self._cellvolt_get(i-1)
+                    deltvolt1=max(abs(cellvolt_now1-cellvolt_last1))
+                
+                    if 2<cellvolt_max1<self.param.OcvInflexionBelow-0.002 and 2<cellvolt_min1<4.5 and deltvolt1<0.005:
+                        if firsttime1==1:
+                            dict_baltime1=self._bal_time(dict_bal1)   #获取每个电芯的均衡时间
+                            deltsoc_last1, cellsoc_last1=self._celldeltsoc_get(i,dict_baltime1,capacity)
+                            time_last1=self.bmstime[i]
+                            firsttime1=0
+                            df_ram_last1.loc[0]=[self.sn,time_last1,deltsoc_last1]    #更新RAM信息
+                        else:
+                            dict_baltime1=self._bal_time(dict_bal1)   #获取每个电芯的均衡时间
+                            deltsoc_now1, cellsoc_now1=self._celldeltsoc_get(i,dict_baltime1,capacity)
+                            time_now1=self.bmstime[i]
+                            df_ram_last1.loc[0]=[self.sn,time_now1,deltsoc_now1]    #更新RAM信息
+
+                            if (time_now1-time_last1).total_seconds()>3600*12:
+                                list_sub1=deltsoc_now1-deltsoc_last1
+                                list_pud1=(0.01*capacity*3600*1000)/(time_now1-time_last1).total_seconds()
+                                leak_current1=list_sub1*list_pud1
+                                # leak_current1=np.array(leak_current1)
+                                leak_current1=np.round(leak_current1,3)
+                                leak_current1=list(leak_current1)
+                                
+                                df_res.loc[len(df_res)]=[time_last1,time_now1,self.sn,2,str(leak_current1),str(dict_baltime1)]  #计算结果存入Dataframe
+                                time_last1=time_now1  #更新时间
+                                deltsoc_last1=deltsoc_now1    #更新soc差
+                                dict_bal1={}
+                            else:
+                                pass
+                    else:
+                        pass
+                else:   
+                    pass
+
+            else:
+                df_ram_last=pd.DataFrame(columns=['sn','time','deltsoc','cellsoc'])   #电流>0,清空上次静置的SOC差
+                dict_bal={} 
+                firsttime=1
+                standingtime=0
+                standingtime1=0
+                pass
+
+            #获取充电数据——开始..............................................................................................................
+            try:
+                balstat=int(self.df_bms.loc[i,'单体均衡状态'])  #统计均衡状态
+                if balstat>0.5:
+                    bal_step=(self.bmstime[i+1]-self.bmstime[i]).total_seconds()  #均衡步长
+                    bal_step=int(bal_step)
+                    if str(balstat) in dict_bal2.keys():
+                        dict_bal2[str(balstat)]=dict_bal2[str(balstat)]+bal_step
+                    else:
+                        dict_bal2[str(balstat)]=bal_step
+                else:
+                    pass
+            except:
+                dict_bal2={}
+
+            #判断充电状态
+            if self.packcrnt[i]<=-1 and self.packcrnt[i+1]<=-1 and self.packcrnt[i-1]<=-1:
+                if charging==0:
+                    if self.bms_soc[i]<40:
+                        cellvolt_now=self._cellvolt_get(i)
+                        if min(cellvolt_now)<self.param.CellFullChrgVolt-0.15:
+                            charging=1
+                            chrg_start=i
+                        else:
+                            pass
+                    else:
+                        pass
+
+                else: #充电中
+                    cellvolt_now=self._cellvolt_get(i)
+                    if (self.bmstime[i+1]-self.bmstime[i]).total_seconds()>180 or (self.packcrnt[i]>self.param.Capacity/3 and self.packcrnt[i+1]>self.param.Capacity/3):  #如果充电过程中时间间隔>180s,则舍弃该次充电
+                        charging=0
+                        continue
+                    elif min(cellvolt_now)>self.param.CellFullChrgVolt-0.13:   #电压>满充电压-0.13V,即3.37V
+                        self._celltemp_weight(i)
+                        if i-chrg_start>10 and self.celltemp>10:
+                            chrg_end=i+1
+                            charging=0
+
+                            #计算漏电流值...................................................................
+                            if firsttime2==1:
+                                dict_baltime={}
+                                deltAs_last2=self._cellDeltAs_get(chrg_start,chrg_end,dict_baltime)
+                                time_last2=self.bmstime[chrg_end]
+                                df_ram_last2.loc[0]=[self.sn,time_last2,deltAs_last2]    #更新RAM信息
+                            else:
+                                dict_baltime=self._bal_time(dict_bal2)   #获取每个电芯的均衡时间
+                                deltAs_now2=self._cellDeltAs_get(chrg_start,chrg_end,dict_baltime)  #获取每个电芯的As差
+                                time_now2=self.bmstime[chrg_end]
+                                df_ram_last2.loc[0]=[self.sn,time_now2,deltAs_now2]    #更新RAM信息
+
+                                list_sub2=deltAs_now2-deltAs_last2
+                                list_pud2=-1000/(time_now2-time_last2).total_seconds()
+                                leak_current2=list_sub2*list_pud2
+                                # leak_current=np.array(leak_current)
+                                leak_current2=np.round(leak_current2,3)
+                                leak_current2=list(leak_current2)
+
+                                df_res.loc[len(df_res)]=[time_last2,time_now2,self.sn,3,str(leak_current2),str(dict_baltime)]  #计算结果存入Dataframe
+                                deltAs_last2=deltAs_now2
+                                time_last2=time_now2
+                                dict_bal2={}
+
+                        else:
+                            charging=0
+                            continue
+                    elif i==len(self.df_bms)-2:  #数据中断后仍在充电,将前段充电数据写入RAM
+                        df_ram_lfp=self.df_bms.iloc[chrg_start:]
+                        df_ram_lfp['sn']=self.sn
+                    else:
+                        pass
+            else:
+                pass
+
+    
+        #更新RAM
+        df_ram_last3.loc[0]=[self.sn,standingtime,standingtime1]
+
+        #返回结果
+        if df_res.empty:    
+            return pd.DataFrame(), df_ram_last, df_ram_last1, df_ram_last2, df_ram_last3,df_ram_lfp
+        else:
+            return df_res, df_ram_last, df_ram_last1, df_ram_last2, df_ram_last3, df_ram_lfp

+ 96 - 0
LIB/MIDDLE/CellStateEstimation/BatSafetyWarning/V1_0_1/CBMSSafetyWarning.py

@@ -0,0 +1,96 @@
+import pandas as pd
+import numpy as np
+import datetime
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import BatParam
+
+class SafetyWarning:
+    def __init__(self,sn,celltype,df_short,df_liplated,df_uniform,df_diag_ram):  #参数初始化
+
+        self.sn=sn
+        self.celltype=celltype
+        self.param=BatParam.BatParam(celltype)
+        self.df_short=df_short
+        self.df_liplated=df_liplated
+        self.df_uniform=df_uniform
+        self.df_diag_ram=df_diag_ram
+
+    
+    def diag(self):
+        if self.celltype<=50:
+            df_res=self._warning_diag()
+            return df_res    
+        else:
+            df_res=self._warning_diag()
+            return df_res
+        
+
+    #电池热安全预警诊断功能.................................................................................................
+    def _warning_diag(self):
+
+        df_res=pd.DataFrame(columns=['start_time', 'end_time', 'product_id', 'code', 'level', 'info','advice'])
+
+        time=datetime.datetime.now()
+        time_sp='0000-00-00 00:00:00'
+
+        #参数初始化
+        shortfault=0
+        liplatedfault=0
+        uniformfault=0
+
+        for i in range(self.param.CellVoltNums):
+
+            #漏电流故障判断...........................................................................
+            if not self.df_short.empty:
+                short_current=self.df_short['short_current']
+                short_current=short_current.str.replace("[", '')
+                short_current=short_current.str.replace("]", '')
+                self.df_short['cellshort'+str(i+1)]=short_current.map(lambda x:eval(x.split(',')[i]))
+
+                cellshort=self.df_short['cellshort'+str(i+1)]
+                index_list=cellshort[cellshort>self.param.LeakCurrentLv2].index
+                if len(index_list)==2 and (index_list[1]-index_list[0])==1:
+                    shortfault=1
+                elif len(index_list)>2:
+                    shortfault=1
+                else:
+                    shortfault=0
+            
+            #析锂故障判断...............................................................................
+            if not self.df_liplated.empty:
+                liplated=self.df_liplated['liplated_amount']
+                liplated=liplated.str.replace("[", '')
+                liplated=liplated.str.replace("]", '')
+                self.df_liplated['liplated_amount'+str(i+1)]=liplated.map(lambda x:eval(x.split(',')[i]))
+
+                if max(self.df_liplated['liplated_amount'+str(i+1)])>30:
+                    liplatedfault=1
+                else:
+                    liplatedfault=0
+            else:
+                liplatedfault=0
+
+            #电芯SOC排名判断.............................................................................
+            if not self.df_uniform.empty:
+                if (i+1) in self.df_uniform['cellmin_num'].tolist():
+                    uniformfault=1
+                else:
+                    uniformfault=0
+            else:
+                uniformfault=0
+            
+            #电池热安全预警
+            if not 110 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                if shortfault==1 and (liplatedfault==1 or uniformfault==1):
+                    faultcode=110
+                    faultlv=4
+                    faultinfo='电芯{}热失控安全预警'.format(i+1)
+                    faultadvice='联系用户远离电池,立刻召回电池'
+                    self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, time_sp, self.sn, faultcode, faultlv, faultinfo, faultadvice]
+                else:
+                    pass
+            else:
+                if shortfault==0 and liplatedfault==0:
+                    time=self.bmstime[i]
+                    self.df_diag_ram[self.df_diag_ram[self.df_diag_ram['faultcode']==110].index, 'time_sp'] = time
+            
+        return self.df_diag_ram

+ 185 - 0
LIB/MIDDLE/CellStateEstimation/BatSafetyWarning/main.py

@@ -0,0 +1,185 @@
+import pandas as pd
+import pymysql
+from LIB.BACKEND import DBManager, Log
+from apscheduler.schedulers.blocking import BlockingScheduler
+import time, datetime
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import DBDownload
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import log
+import CBMSBatInterShort
+import CBMSSafetyWarning
+
+#电池热安全预警核心算法函数......................................................................................................................
+def saftywarning_cal():
+    global SNnums
+    global df_warning_ram
+    global df_warning_ram1
+    global df_warning_ram2
+    global df_warning_ram3
+    global df_lfp_ram
+    
+    now_time=datetime.datetime.now()
+    start_time=now_time-datetime.timedelta(hours=12)
+    start_time1=now_time-datetime.timedelta(days=7)
+    start_time2=now_time-datetime.timedelta(days=90)
+    start_time=start_time.strftime('%Y-%m-%d %H:%M:%S')
+    start_time1=start_time1.strftime('%Y-%m-%d %H:%M:%S')
+    end_time=now_time.strftime('%Y-%m-%d %H:%M:%S')
+
+    #数据库配置
+    host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
+    port=3306
+    user='qx_read'
+    password='Qx@123456'
+
+    #读取故障结果库中code==110且end_time='0000-00-00 00:00:00'...............................
+    db='safety_platform'
+    mysql = pymysql.connect (host=host, user=user, password=password, port=port, database=db)
+    cursor = mysql.cursor()
+    param='start_time,end_time,product_id,code,level,info,advice'
+    tablename='all_fault_info'
+    sql =  "select %s from %s where code=110 and end_time='0000-00-00 00:00:00'" %(param,tablename)
+    cursor.execute(sql)
+    res = cursor.fetchall()
+    df_fault_ram= pd.DataFrame(res,columns=param.split(','))
+    cursor.close()
+    mysql.close()
+
+    for sn in SNnums:
+        if 'PK500' in sn:
+            celltype=1 #6040三元电芯
+        elif 'PK502' in sn:
+            celltype=2 #4840三元电芯
+        elif 'K504B' in sn:
+            celltype=99    #60ah林磷酸铁锂电芯
+        elif 'MGMLXN750' in sn:
+            celltype=3 #力信50ah三元电芯
+        elif 'MGMCLN750' or 'UD' in sn: 
+            celltype=4 #CATL 50ah三元电芯
+        else:
+            print('SN:{},未找到对应电池类型!!!'.format(sn))
+            continue
+            # sys.exit()
+
+        #读取原始数据库数据........................................................................................................................................................
+        dbManager = DBManager.DBManager()
+        df_data = dbManager.get_data(sn=sn, start_time=start_time, end_time=end_time, data_groups=['bms'])
+        df_bms = df_data['bms']
+        # tim=start_time.replace(':','_')
+        # df_bms.to_csv(r'D:\Platform\platform_python\data_analyze_platform\USER\spf\01qixiang\98Download\\'+sn+'_BMS_'+tim+'.csv',encoding='GB18030')
+
+        #读取结果数据库数据........................................................................................................................................................
+        db='qx_cas'
+        mode=1
+        tablename='cellstateestimation_soh'
+        DBRead=DBDownload.DBDownload(host, port, db, user, password,mode)
+        with DBRead as DBRead:
+            df_soh=DBRead.getdata('time_st,sn,soh,cellsoh', tablename=tablename, sn=sn, timename='time_sp', st=start_time, sp=end_time)
+
+        if not df_bms.empty:
+            #电池内短路计算................................................................................................................................................................
+            df_warning_ram_sn=df_warning_ram[df_warning_ram['sn']==sn]
+            df_warning_ram_sn1=df_warning_ram1[df_warning_ram1['sn']==sn]
+            df_warning_ram_sn2=df_warning_ram2[df_warning_ram2['sn']==sn]
+            df_warning_ram_sn3=df_warning_ram3[df_warning_ram3['sn']==sn]
+            df_warning_ram_sn.reset_index(inplace=True,drop=True)     #重置索引
+            df_warning_ram_sn1.reset_index(inplace=True,drop=True)     #重置索引
+            df_warning_ram_sn2.reset_index(inplace=True,drop=True)     #重置索引
+            df_warning_ram_sn3.reset_index(inplace=True,drop=True)     #重置索引
+            if celltype>50:
+                df_lfp_ram=df_lfp_ram.reindex(columns=df_bms.columns.tolist()+['sn'])
+                df_lfp_ram_sn=df_lfp_ram[df_lfp_ram['sn']==sn]
+                df_lfp_ram_sn.reset_index(inplace=True,drop=True)     #重置索引
+            else:
+                df_lfp_ram_sn=pd.DataFrame()
+
+            BatShort=CBMSBatInterShort.BatInterShort(sn,celltype,df_bms,df_soh,df_warning_ram_sn,df_warning_ram_sn1,df_warning_ram_sn2,df_warning_ram_sn3,df_lfp_ram_sn)
+            df_short_res, df_ram_res, df_ram_res1, df_ram_res2, df_ram_res3, df_ram_res4=BatShort.intershort() 
+
+            if not df_short_res.empty:
+                with open(r'D:\Platform\platform_python\data_analyze_platform\USER\spf\01qixiang\07BatSafetyWarning\内短路.txt','a') as file:
+                    file.write(str(df_short_res)+'\n')
+
+            #内短路ram处理.........................................................
+            df_warning_ram=df_warning_ram.drop(df_warning_ram[df_warning_ram.sn==sn].index)
+            df_warning_ram1=df_warning_ram1.drop(df_warning_ram1[df_warning_ram1.sn==sn].index)
+            df_warning_ram2=df_warning_ram2.drop(df_warning_ram2[df_warning_ram2.sn==sn].index)
+            df_warning_ram3=df_warning_ram3.drop(df_warning_ram3[df_warning_ram3.sn==sn].index)
+
+            df_warning_ram=pd.concat([df_warning_ram,df_ram_res],ignore_index=True)
+            df_warning_ram1=pd.concat([df_warning_ram1,df_ram_res1],ignore_index=True)
+            df_warning_ram2=pd.concat([df_warning_ram2,df_ram_res2],ignore_index=True)
+            df_warning_ram3=pd.concat([df_warning_ram3,df_ram_res3],ignore_index=True)
+            
+            if celltype>50:
+                df_lfp_ram=df_lfp_ram.drop(df_lfp_ram[df_lfp_ram.sn==sn].index)
+                df_lfp_ram=pd.concat([df_lfp_ram,df_ram_res4],ignore_index=True)
+            
+
+        #电池热安全预警..............................................................................................................................................................
+        #读取内短路、析锂和一致性结果数据库数据
+        db='qx_cas'
+        mode=2
+        tablename1='cellstateestimation_intershort'
+        tablename2='mechanism_liplated'   #析锂表单
+        tablename3='cellstateestimation_uniform_socvoltdiff'
+        DBRead=DBDownload.DBDownload(host, port, db, user, password,mode)
+        with DBRead as DBRead:
+            df_short=DBRead.getdata('time_sp,sn,short_current', tablename=tablename1, sn=sn, timename='time_sp', st=start_time1, sp=end_time)
+            df_liplated=DBRead.getdata('time,sn,liplated,lipltd_amount', tablename=tablename2, sn=sn, timename='time_sp', st=start_time2, sp=end_time)
+            df_uniform=DBRead.getdata('time,sn,cellsoc_diff,cellmin_num', tablename=tablename3, sn=sn, timename='time', st=start_time1, sp=end_time)
+        
+        #获取sn的故障RAM
+        df_fault_ram_sn=df_fault_ram[df_fault_ram['product_id']==sn]
+        
+        #热安全预警
+        BatWarning=CBMSSafetyWarning.SafetyWarning(sn,celltype,df_short,df_liplated,df_uniform,df_fault_ram_sn)
+        df_warning_res=BatWarning.diag()
+
+        df_warning_end=df_warning_res[df_warning_res['end_time'] != '0000-00-00 00:00:00']
+        if not df_warning_end.empty:    #df_warning_end历史故障筛选并更改数据库故障结束时间
+            pass   
+        elif df_fault_ram_sn.empty and (not df_warning_res.empty):
+            with open(r'D:\Platform\platform_python\data_analyze_platform\USER\spf\01qixiang\07BatSafetyWarning\热失控预警.txt','a') as file:
+                file.write(str(tuple(df_warning_res.iloc[-1]))+'\n')
+        else:
+            pass
+
+#...............................................主函数起定时作用.......................................................................................................................
+if __name__ == "__main__":
+    
+    excelpath=r'D:\Platform\platform_python\data_analyze_platform\USER\spf\01qixiang\sn-20210903.xlsx'
+    SNdata_6060 = pd.read_excel(excelpath, sheet_name='科易6060')
+    SNdata_6040 = pd.read_excel(excelpath, sheet_name='科易6040')
+    SNdata_4840 = pd.read_excel(excelpath, sheet_name='科易4840')
+    SNdata_L7255 = pd.read_excel(excelpath, sheet_name='格林美-力信7255')
+    SNdata_C7255 = pd.read_excel(excelpath, sheet_name='格林美-CATL7255')
+    SNdata_U7255 = pd.read_excel(excelpath, sheet_name='优旦7255')
+    SNnums_6060=SNdata_6060['SN号'].tolist()
+    SNnums_6040=SNdata_6040['SN号'].tolist()
+    SNnums_4840=SNdata_4840['SN号'].tolist()
+    SNnums_L7255=SNdata_L7255['SN号'].tolist()
+    SNnums_C7255=SNdata_C7255['SN号'].tolist()
+    SNnums_U7255=SNdata_U7255['SN号'].tolist()
+    SNnums=SNnums_L7255 + SNnums_C7255 + SNnums_U7255, SNnums_6040 + SNnums_4840 + SNnums_6060
+    SNnums=['MGMCLN750N215N099','PK504B10100004425']
+    
+    mylog=log.Mylog('log_warning.txt','error')
+    mylog.logcfg()
+
+    #............................模块运行前,先读取数据库中所有结束时间为0的数据,需要从数据库中读取...................................
+    df_warning_ram=pd.DataFrame(columns=['sn','time','deltsoc','cellsoc'])
+    df_warning_ram1=pd.DataFrame(columns=['sn','time1','deltsoc1'])
+    df_warning_ram2=pd.DataFrame(columns=['sn','time2','deltAs2'])
+    df_warning_ram3=pd.DataFrame(columns=['sn','standingtime','standingtime1'])
+    df_lfp_ram=pd.DataFrame()
+
+    #定时任务.......................................................................................................................................................................
+    scheduler = BlockingScheduler()
+    scheduler.add_job(saftywarning_cal, 'interval', seconds=5)
+
+    try:  
+        scheduler.start()
+    except Exception as e:
+        scheduler.shutdown()
+        print(repr(e))
+        mylog.logopt(e)

+ 6 - 6
LIB/MIDDLE/CellStateEstimation/Common/V1_0_1/BatParam.py

@@ -23,13 +23,13 @@ class BatParam:
         self.TrwCellVoltLow=1.5
         self.TrwPackVoltFall=1.5
 
-        self.SocJump=3
+        self.SocJump=10
         self.SocClamp=0.1
         self.SocLow=3
         self.SocDiff=20
 
-        self.SohLow=65
-        self.SohDiff=20
+        self.SohLow=70
+        self.SohDiff=15
 
         self.OcvWeight_Temp=[-30,-20,-10,0,10,20,30,40,50]
         self.OcvWeight_StandingTime=[0,500,600,1200,1800,3600,7200,10800]
@@ -50,7 +50,7 @@ class BatParam:
             self.CellFullChrgVolt=4.2
             self.CellFullChrgCrnt=-15
             self.CellVoltNums=17
-            self.CellTempNums=4
+            self.CellTempNums=3
             self.OtherTempNums=5
             self.FullChrgSoc=98
             self.PackCrntDec=1
@@ -82,7 +82,7 @@ class BatParam:
             self.CellFullChrgVolt=4.2
             self.CellFullChrgCrnt=-15
             self.CellVoltNums=14
-            self.CellTempNums=4
+            self.CellTempNums=3
             self.OtherTempNums=4
             self.FullChrgSoc=98
             self.PackCrntDec=1
@@ -114,7 +114,7 @@ class BatParam:
             self.CellFullChrgVolt=4.2
             self.CellFullChrgCrnt=-15
             self.CellVoltNums=20
-            self.CellTempNums=4
+            self.CellTempNums=3
             self.OtherTempNums=4
             self.FullChrgSoc=98
             self.PackCrntDec=1

+ 1 - 0
LIB/MIDDLE/CellStateEstimation/Common/V1_0_1/log.py

@@ -19,6 +19,7 @@ class Mylog:
                 Level=logging.ERROR
         logging.basicConfig(filename=r'D:\Platform\platform_python\data_analyze_platform\USER\spf\101log\\'+self.name, level=Level,format='%(asctime)s - %(levelname)s - %(message)s')
 
+
     def logopt(self,*info):
         logging.error(info)
         logging.error(traceback.format_exc())

+ 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


+ 70 - 0
LIB/MIDDLE/SaftyCenter/Common/DBDownload.py

@@ -0,0 +1,70 @@
+import pymysql
+import time
+import pandas as pd
+
+class DBDownload:
+
+    def __init__(self, host='', port='', db='', user='', password='', mode=''):
+        self.host = host
+        self.port = port
+        self.db = db
+        self.user = user
+        self.password = password
+        self.mode=mode
+        pass
+
+    def __enter__(self):
+        self.connect()
+        return self
+
+    def __exit__(self, exc_type, exc_val, exc_tb):
+        self.close()
+
+    def connect(self):
+        conn_success_flag = 0
+        while not conn_success_flag:
+            try:
+                self.conn = pymysql.connect(host=self.host, port=self.port, user=self.user, password=self.password, database=self.db)
+            except Exception as e:
+                conn_success_flag = 0
+                print("数据库连接失败 :{}".format(e))
+                time.sleep(5)
+            else:
+                conn_success_flag = 1
+                print('数据库连接成功!')
+                self.cursor = self.conn.cursor()
+
+    def getdata(self,*param,tablename,sn,timename,st,sp,factory):
+        print('数据获取中......')
+        param=list(param)
+        str=''
+        for i in range(len(param)):
+            if i<1:
+                str=str+param[i]
+            else:
+                str=str+','+param[i]
+        if self.mode==1:
+            self.cursor.execute("select %s from %s where sn='%s' order by id desc limit 1" %(str,tablename,sn))
+        elif self.mode==0:
+            self.cursor.execute("select %s from %s where sn='%s' and %s between '%s' and '%s'" %(str,tablename,sn,timename,st,sp))
+        elif self.mode==2:
+            self.cursor.execute("select %s from %s where factory='%s'" %(str,tablename,factory))
+        elif self.mode==3:
+            self.cursor.execute("select %s from %s" %(str,tablename))
+        elif self.mode==4:
+            self.cursor.execute("select %s from %s where qrcode='%s' order by id desc limit 1" %(str,tablename,sn))
+        res = self.cursor.fetchall()
+        df_res = pd.DataFrame(res, columns=param)
+        df_res = df_res.reset_index(drop=True)
+        return(df_res)
+
+    def close(self):
+        try:
+            self.cursor.close()
+            self.conn.close()
+        except Exception as e:
+            print(e)
+        else:
+            print('数据库已断开连接!')
+    
+    

+ 63 - 0
LIB/MIDDLE/SaftyCenter/Common/FeiShuData.py

@@ -0,0 +1,63 @@
+from numpy import empty
+import pandas as pd
+from pandas.core.frame import DataFrame
+
+import requests
+import json
+import datetime,time
+import numpy as np
+
+
+
+def getFeiShuDATA():
+    print('飞书数据获取中......')
+    Columns=["状态", "发生时间","代理商","电池编码","用户信息","业务分类A","业务分类B","操作","信息来源", "内容描述", "客服处理时间","客服处理结果","记录人","当前处理人","处理部门","跟进记录","问题类型A","问题类型B","事件处理完结时间","运维紧急程度","维修信息","返厂时间"]
+    # 获取token
+
+    app_id = 'cli_a1e503bb3d78100c'
+    app_secret = 'oZBbGSRYsf9sXy8t8e8kbhVLciekyvMt'
+    url = 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal'
+
+    headers = {'Content-Type':"application/json; charset=utf-8"}
+    datas = json.dumps({'app_id':app_id, 'app_secret':app_secret})
+    response = requests.post(url, data=datas, headers=headers)
+    auth_token = json.loads(response.text)['tenant_access_token']
+
+    # 获取数据
+    app_token = 'bascnpaW50pJsCNd1AyIRFIc24b'
+    table_id = 'tblo3wnR2HFWI6rA'
+    sheet_id = 'vewZh94xDC'
+    url = 'https://open.feishu.cn/open-apis/bitable/v1/apps/{}/tables/{}/records'.format(app_token, table_id)
+    headers = {"Authorization":"Bearer {}".format(auth_token)}
+
+
+    df_file = pd.DataFrame(columns=Columns)
+    timesort=['发生时间','客服处理时间','事件处理完结时间','返厂时间']
+    count=0
+    GotPageToken=str()
+
+    while True:
+        # 筛选条件加载这里
+        datas = {'view_id':sheet_id, 'page_size':100, 'text_field_as_array':"true", 'page_token':GotPageToken,'field_names':'["状态", "发生时间","代理商","电池编码","用户信息","业务分类A","业务分类B","操作","信息来源", "内容描述", "客服处理时间","客服处理结果","记录人","当前处理人","处理部门","跟进记录","问题类型A","问题类型B","事件处理完结时间","运维紧急程度","维修信息","返厂时间"]'}
+        try:
+            response = requests.get(url, params=datas, headers=headers)
+            #print(response.text)
+            results = json.loads(response.text)['data']['items']
+            GotPageToken=json.loads(response.text)['data']['page_token']
+
+            for r in results:
+                df_file = df_file.append([r['fields']], ignore_index=True)
+        except:
+            break
+
+    for i in range(0,len(df_file)):
+        for t in range(0,len(timesort)):
+            if not df_file.loc[i,timesort[t]] is np.nan and not df_file.loc[i,timesort[t]] is None:
+                timeTemp= float(df_file.loc[i,timesort[t]])
+                timeTTmp=time.localtime(timeTemp/1000) 
+                df_file.loc[i,timesort[t]] = time.strftime('%Y-%m-%d %H:%M:%S',timeTTmp)
+    for col in Columns:
+        df_file[col]=df_file[col].map(lambda x:str(x).lstrip('[{\'text\': ').rstrip('\', \'type\': \'text\'}]').replace('\\n\', \'type\': \'text\'}, {\'text\': \'',' '))
+    df_file.to_excel('df_file.xlsx')
+    print('飞书数据获取完成')
+    return df_file

+ 9 - 9
LIB/MIDDLE/SaftyCenter/Common/QX_BatteryParam.py

@@ -5,7 +5,7 @@ class BatteryInfo():
         self.AllowDsChgTemp=-5
         self.AvgVolGap=1
         self.AvgCellTempGap=10
-        self.AvgOtherTempGap=30
+        self.AvgOtherTempGap=40
         self.PackOTlmt=65
         self.PackUTlmt=-20
         self.OtherOTlmt=91
@@ -19,7 +19,7 @@ class BatteryInfo():
             self.PackFullChrgVolt=69.99
             self.CellFullChrgVolt=4.2
             self.CellVoltNums=17
-            self.CellTempNums=4
+            self.CellTempNums=3
             self.OtherTempNums=5
             self.FullChrgSoc=98
             self.PeakSoc=57
@@ -27,7 +27,7 @@ class BatteryInfo():
             self.BalCurrent=0.015
             self.LookTab_SOC = [0,	    3.5348,	8.3581,	13.181,	18.004,	22.827,	27.651,	32.474,	37.297,	42.120,	46.944,	51.767,	56.590,	61.413,	66.237,	71.060,	75.883,	80.707,	85.530,	90.353,	95.176,	100,   105]
             self.LookTab_OCV = [3.3159,	3.4384,	3.4774,	3.5156,	3.5478,	3.5748,	3.6058,	3.6238,	3.638,	3.6535,	3.6715,	3.6951,	3.7279,	3.7757,	3.8126,	3.8529,	3.8969,	3.9446,	3.9946,	4.0491,	4.109,	4.183, 4.263]
-            self.BLVol = 3
+            self.DifVolGap = 3
             self.CellOVlmt=5
             self.CellUVlmt=2
             self.CantChrgVol=3
@@ -37,7 +37,7 @@ class BatteryInfo():
             self.PackFullChrgVolt=69.99
             self.CellFullChrgVolt=4.2
             self.CellVoltNums=14
-            self.CellTempNums=4
+            self.CellTempNums=3
             self.OtherTempNums=5            
             self.FullChrgSoc=98
             self.PeakSoc=57
@@ -45,7 +45,7 @@ class BatteryInfo():
             self.BalCurrent=0.015
             self.LookTab_SOC = [0,	    3.5348,	8.3581,	13.181,	18.004,	22.827,	27.651,	32.474,	37.297,	42.120,	46.944,	51.767,	56.590,	61.413,	66.237,	71.060,	75.883,	80.707,	85.530,	90.353,	95.176,	100,   105]
             self.LookTab_OCV = [3.3159,	3.4384,	3.4774,	3.5156,	3.5478,	3.5748,	3.6058,	3.6238,	3.638,	3.6535,	3.6715,	3.6951,	3.7279,	3.7757,	3.8126,	3.8529,	3.8969,	3.9446,	3.9946,	4.0491,	4.109,	4.183, 4.263]
-            self.BLVol = 3
+            self.DifVolGap = 3
             self.CellOVlmt=5
             self.CellUVlmt=2
             self.CantChrgVol=3        
@@ -63,7 +63,7 @@ class BatteryInfo():
             self.BalCurrent=0.015
             self.LookTab_SOC = [0,	    5,	    10,	    15,	    20,	    25,	    30,	    35,	    40,	    45,	    50,	    55,	    60,	    65,	    70,	    75,	    80,	    85,	    90,	    95,	    100,   105]
             self.LookTab_OCV = [3.357, 	3.455, 	3.493, 	3.540, 	3.577, 	3.605, 	3.622, 	3.638, 	3.655, 	3.677, 	3.707, 	3.757, 	3.815, 	3.866, 	3.920, 	3.976, 	4.036, 	4.099, 	4.166, 	4.237, 	4.325, 4.415]
-            self.BLVol = 3
+            self.DifVolGap = 3
             self.CellOVlmt=5
             self.CellUVlmt=2
             self.CantChrgVol=3
@@ -81,7 +81,7 @@ class BatteryInfo():
             self.BalCurrent=0.015
             self.LookTab_SOC = [0,	    5,	    10,	    15,	    20,	    25,	    30,	    35,	    40,	    45,	    50,	    55,	    60,	    65,	    70,	    75,	    80,	    85,	    90,	    95,	    100,   105]
             self.LookTab_OCV = [3.152, 	3.397, 	3.438, 	3.481, 	3.523, 	3.560, 	3.586, 	3.604, 	3.620, 	3.638, 	3.661, 	3.693, 	3.748, 	3.803, 	3.853, 	3.903, 	3.953, 	4.006, 	4.063, 	4.121, 	4.183, 4.253]
-            self.BLVol = 3
+            self.DifVolGap = 3
             self.CellOVlmt=5
             self.CellUVlmt=2
             self.CantChrgVol=3
@@ -96,7 +96,7 @@ class BatteryInfo():
             self.OcvInflexion3=3.328
             self.OcvInflexionAbove=3.4
             self.CellVoltNums=20
-            self.CellTempNums=4
+            self.CellTempNums=3
             self.OtherTempNums=5 
             self.FullChrgSoc=98
             self.PeakSoc=59
@@ -107,7 +107,7 @@ class BatteryInfo():
             self.BalCurrent=0.015
             self.LookTab_SOC = [0.00, 	2.40, 	6.38, 	10.37, 	14.35, 	18.33, 	22.32, 	26.30, 	30.28, 	35.26, 	40.24, 	45.22, 	50.20, 	54.19, 	58.17, 	60.16, 	65.14, 	70.12, 	75.10, 	80.08, 	84.06, 	88.05, 	92.03, 	96.02, 	100.00]
             self.LookTab_OCV = [2.7151,	3.0298,	3.1935,	3.2009,	3.2167,	3.2393,	3.2561,	3.2703,	3.2843,	3.2871,	3.2874,	3.2868,	3.2896,	3.2917,	3.2967,	3.3128,	3.3283,	3.3286,	3.3287,	3.3288,	3.3289,	3.3296,	3.3302,	3.3314,	3.3429]
-            self.BLVol = 3
+            self.DifVolGap = 3
             self.CellOVlmt=4
             self.CellUVlmt=2
             self.CantChrgVol=2.6

+ 488 - 0
LIB/MIDDLE/SaftyCenter/DataDiag_Static/CBMSBatDiag.py

@@ -0,0 +1,488 @@
+import pandas as pd
+import numpy as np
+import datetime
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import BatParam
+
+class BatDiag:
+    def __init__(self,sn,celltype,df_bms,df_soh,df_uniform,df_diag_Ram):  #参数初始化
+
+        self.sn=sn
+        self.celltype=celltype
+        self.param=BatParam.BatParam(celltype)
+        self.df_bms=df_bms
+        self.df_soh=df_soh
+        self.df_uniform=df_uniform
+        self.df_diag_ram=df_diag_Ram
+        self.packcrnt=df_bms['总电流[A]']*self.param.PackCrntDec
+        self.packvolt=df_bms['总电压[V]']
+        self.bms_soc=df_bms['SOC[%]']
+        self.bmstime= pd.to_datetime(df_bms['时间戳'], format='%Y-%m-%d %H:%M:%S')
+        self.bmsfault1=self.df_bms['故障代码']
+        # self.bmsfault2=self.df_bms['alarm2'].tolist()
+        # self.bmsfault3=self.df_bms['alarm3'].tolist()
+        # self.bmsfault4=self.df_bms['fault'].tolist()
+
+        self.cellvolt_name=['单体电压'+str(x) for x in range(1,self.param.CellVoltNums+1)]
+        self.celltemp_name=['单体温度'+str(x) for x in range(1,self.param.CellTempNums+1)]
+    
+    def diag(self):
+        if self.celltype<=50:
+            df_res=self._ncm_diag()
+            return df_res    
+        else:
+            df_res=self._ncm_diag()
+            return df_res
+        
+
+    #定义滑动滤波函数.............................................................................................
+    def _np_move_avg(self,a, n, mode="same"): 
+        return (np.convolve(a, np.ones((n,)) / n, mode=mode))
+    
+    #寻找当前行数据的所有温度值...................................................................................
+    def _celltemp_get(self,num):   
+        celltemp = list(self.df_bms.loc[num,self.celltemp_name])
+        return celltemp
+
+    #获取当前行所有电压数据............................................................................................
+    def _cellvolt_get(self,num): 
+        cellvolt = list(self.df_bms.loc[num,self.cellvolt_name]/1000)
+        return cellvolt
+
+    #..........................................三元电池诊断功能..................................................................
+    def _ncm_diag(self):
+
+        bmssoc_st=float(self.bms_soc[0])    #SOC卡滞初始参数
+        ah_accum=0  #SOC卡滞初始参数
+        as_chg=0    #过流诊断初始参数
+        as_dis=0    #过流诊断初始参数
+        time1=self.bmstime[0]   #温升速率初始参数
+        temp1=np.array(self._celltemp_get(0))   #温升速率初始参数
+        temprate_cnt=0
+        
+        end_time='0000-00-00 00:00:00'
+            
+        for i in range(1,len(self.df_bms)):
+            
+            #温度诊断功能.............................................................................................................
+            celltemp0=self._celltemp_get(i-1)
+            celltemp1=self._celltemp_get(i)
+            celltempmin0=min(celltemp0)
+            celltempmin1=min(celltemp1)
+            celltempmax0=max(celltemp0)
+            celltempmax1=max(celltemp1)
+            #温度有效性判断..........................................................................
+            if celltempmax0>self.param.CellTempUpLmt or celltempmin0<self.param.CellTempLwLmt:
+                celltempvalid=0
+            else:  
+                celltempvalid=1
+           
+
+            if celltempvalid==1:
+                #过温判断.............................................................................................................
+                if not 4 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                    if celltempmax0>self.param.CellTempHighLv2 and celltempmax1>self.param.CellTempHighLv2:    #二级高温进入
+                        time=self.bmstime[i]
+                        code=4
+                        faultlv=3
+                        faultinfo='温度{}高温二级'.format(celltemp1.index(celltempmax1)+1)
+                        faultadvice='技术介入诊断'
+                        self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                    else:
+                        pass
+                else:   #ram当前故障中有该故障,则判断是否退出该故障
+                    if celltempmax0<self.param.CellTempHighLv1-5 and celltempmax1<self.param.CellTempHighLv1-5:    #二级高温恢复
+                        time=self.bmstime[i]
+                        self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==4].index, 'end_time'] = time
+                    else:
+                        pass
+            
+                #欠温判断.................................................................................................................
+                if not 6 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                    if celltempmin0<self.param.CellTempLowLv2 and celltempmin1<self.param.CellTempLowLv2:  #二级低温进入
+                        time=self.bmstime[i]
+                        code=6
+                        faultlv=3
+                        faultinfo='温度{}低温二级'.format(celltemp1.index(celltempmin1)+1)
+                        faultadvice='技术介入诊断'
+                        self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                    else:
+                        pass
+                else:   #ram当前故障中有该故障,则判断是否退出该故障
+                    if celltempmax0>self.param.CellTempLowLv1+2 and celltempmax1>self.param.CellTempLowLv1+2:    #二级高温恢复
+                        time=self.bmstime[i]
+                        self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==6].index, 'end_time'] = time
+                    else:
+                        pass
+              
+                #温差判断.............................................................................................................................
+                if not 8 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                    if (celltempmax0-celltempmin0)>self.param.CellTempDiffLv2 and (celltempmax1-celltempmin1)>self.param.CellTempDiffLv2:  #二级温差进入
+                        time=self.bmstime[i]
+                        code=8
+                        faultlv=3
+                        faultinfo='温度{}和{}温差大二级'.format(celltemp1.index(celltempmax1)+1,celltemp1.index(celltempmin1)+1)
+                        faultadvice='技术介入诊断'
+                        self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                    else:
+                        pass
+                else:   #ram当前故障中有该故障,则判断是否退出该故障
+                    if (celltempmax0-celltempmin0)<self.param.CellTempDiffLv1-2 and (celltempmax1-celltempmax0)>self.param.CellTempDiffLv1-2:  #二级温差恢复
+                        time=self.bmstime[i]
+                        self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==8].index, 'end_time'] = time
+                    else:
+                        pass
+
+                #温升判断
+                time2=self.bmstime[i]
+                delttime=(time2-time1).total_seconds()
+                if delttime>20:
+                    temp2=np.array(self._celltemp_get(i))
+                    celltemp_rate=round((max(temp2-temp1)*60)/delttime,2)    #计算最大温升速率
+                    temp1=temp2 #更新初始温度
+                    time1=time2 #更新初始时间
+                    if not 9 in list(self.df_diag_ram['code']):#当前故障中没有该故障,则判断是否发生该故障
+                        if celltemp_rate>self.param.CellTempRate:
+                            temprate_cnt=temprate_cnt+1
+                            if temprate_cnt>2:  #温升故障进入
+                                time=self.bmstime[i]
+                                code=9
+                                faultlv=3
+                                faultinfo='温升速率过快:{}℃/min'.format(celltemp_rate)
+                                faultadvice='技术介入诊断'
+                                self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                            else:
+                                pass
+                        else:   #ram当前故障中有该故障,则判断是否退出该故障
+                           pass
+                    else:
+                        if celltemp_rate<self.param.CellTempRate-1: #温升故障恢复
+                            time=self.bmstime[i]
+                            self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==9].index, 'end_time'] = time
+                else:
+                    pass
+            
+            else:
+                pass
+            
+            #电压诊断功能.................................................................................................
+            cellvolt0=self._cellvolt_get(i-1)
+            cellvolt1=self._cellvolt_get(i)
+            cellvoltmin0=min(cellvolt0)
+            cellvoltmax0=max(cellvolt0)
+            cellvoltmin1=min(cellvolt1)
+            cellvoltmax1=max(cellvolt1)
+            #电压断线诊断...................................................................................................
+            if (cellvoltmin0<2 and cellvoltmax0>4.5) or cellvoltmin0<0.1 or cellvoltmax0>5:
+                cellvoltvalid=0
+            else:
+                cellvoltvalid=1
+            
+            if cellvoltvalid==1:
+                #过压诊断.............................................................................................................
+                if not 12 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                    if cellvoltmax0>self.param.CellOvLv2 and cellvoltmax1>self.param.CellOvLv2:  #二级过压进入
+                        time=self.bmstime[i]
+                        code=12
+                        faultlv=4
+                        faultinfo='电芯{}过压二级'.format(cellvolt1.index(cellvoltmax1)+1)
+                        faultadvice='联系用户询问用车场景,技术介入诊断'
+                        self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                    else:
+                        pass
+                else:   #ram当前故障中有该故障,则判断是否退出该故障
+                    if cellvoltmax0<self.param.CellOvLv1-0.05 and cellvoltmax1<self.param.CellOvLv1-0.05:   #二级过压故障恢复
+                        time=self.bmstime[i]
+                        self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==12].index, 'end_time'] = time
+                    else:
+                        pass
+              
+
+                #欠压诊断.................................................................................................................
+                if not 14 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                    if cellvoltmin0<self.param.CellUvLv2 and cellvoltmin1<self.param.CellUvLv2:  #二级欠压
+                        time=self.bmstime[i]
+                        code=14
+                        faultlv=3
+                        faultinfo='电芯{}欠压二级'.format(cellvolt1.index(cellvoltmin1)+1)
+                        faultadvice='联系用户询问用车场景,技术介入诊断'
+                        self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                    else:
+                        pass
+                else:
+                    if cellvoltmin0>self.param.CellUvLv1+0.1 and cellvoltmin1>self.param.CellUvLv1+0.1:
+                        time=self.bmstime[i]
+                        self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==14].index, 'end_time'] = time
+                    else:
+                        pass
+             
+                #电芯压差大.....................................................................................................................................................
+                if not 16 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                    if (cellvoltmax0-cellvoltmin0)>self.param.CellVoltDiffLv2 and (cellvoltmax1-cellvoltmin1)>self.param.CellVoltDiffLv2:  #二级电芯压差
+                        time=self.bmstime[i]
+                        code=16
+                        faultlv=3
+                        faultinfo='电芯{}和{}压差大二级'.format(cellvolt1.index(cellvoltmax1)+1,cellvolt1.index(cellvoltmin1)+1)
+                        faultadvice='技术介入诊断'
+                        self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                    else:
+                        pass
+                else:
+                    if (cellvoltmax0-cellvoltmin0)<self.param.CellVoltDiffLv1-0.05 and (cellvoltmax1-cellvoltmin1)>self.param.CellVoltDiffLv1-0.05: #二级欠压恢复
+                        time=self.bmstime[i]
+                        self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==16].index, 'end_time'] = time
+                    else:
+                        pass
+            else:
+                pass
+                
+            #电池包诊断.....................................................................................................................................
+            if not 18 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                if self.packvolt[i-1]>self.param.PackVoltOvLv2 and self.packvolt[i]>self.param.PackVoltOvLv2:   #电池包过压二级进入
+                    time=self.bmstime[i]
+                    code=18
+                    faultlv=4
+                    faultinfo='电池包过压二级'
+                    faultadvice='联系用户询问用车场景,技术介入诊断'
+                    self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                else:
+                    pass
+            else:
+                if self.packvolt[i-1]<self.param.PackVoltOvLv1-0.05*self.param.CellVoltNums and self.packvolt[i]<self.param.PackVoltOvLv1-0.05*self.param.CellVoltNums: #电池包过压二级恢复
+                    time=self.bmstime[i]
+                    self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==18].index, 'end_time'] = time
+                else:
+                    pass
+          
+            #电池包诊断.....................................................................................................................................
+            if not 20 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                if self.packvolt[i-1]<self.param.PackVoltUvLv2 and self.packvolt[i]<self.param.PackVoltUvLv2:   #电池包二级欠压进入
+                    time=self.bmstime[i]
+                    code=20
+                    faultlv=3
+                    faultinfo='电池包欠压二级'
+                    faultadvice='联系用户询问用车场景,技术介入诊断'
+                    self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                else:
+                    pass
+            else:
+                if self.packvolt[i-1]>self.param.PackVoltUvLv1+0.1*self.param.CellVoltNums and self.packvolt[i]>self.param.PackVoltUvLv1+0.1*self.param.CellVoltNums:   #电池包二级欠压恢复
+                    time=self.bmstime[i]
+                    self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==20].index, 'end_time'] = time
+                else:
+                    pass
+            
+            #电流过流诊断.......................................................................................................................
+            step=(self.bmstime[i]-self.bmstime[i-1]).total_seconds()
+            if step<120 and self.packcrnt[i]>self.param.PackDisOc:
+                as_dis=as_dis+(self.packcrnt[i]-self.param.self.PackDisOc)*step    #ah累计
+            elif step<120 and self.packcrnt[i]<self.param.PackChgOc:
+                as_chg=as_chg+(self.param.PackDisOc-self.packcrnt[i])*step    #ah累计
+            else:
+                as_dis=0
+                as_chg=0
+            
+            if not 22 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                if as_dis>100:
+                    time=self.bmstime[i]
+                    code=22
+                    faultlv=3
+                    faultinfo='电池包放电过流'
+                    faultadvice='联系用户询问用车场景,技术介入诊断'
+                    self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                else:
+                    pass
+            else:
+                if self.packcrnt[i-1]<self.param.PackDisOc-10 and self.packcrnt[i]<self.param.PackDisOc-10:
+                    time=self.bmstime[i]
+                    self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==22].index, 'end_time'] = time
+                else:
+                    pass
+            
+            if not 21 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                if as_chg>100:
+                    time=self.bmstime[i]
+                    code=21
+                    faultlv=3
+                    faultinfo='电池包充电过流'
+                    faultadvice='联系用户询问用车场景,技术介入诊断'
+                    self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                else:
+                    pass
+            else:
+                if self.packcrnt[i-1]>self.param.PackChgOc+10 and self.packcrnt[i]>self.param.PackChgOc+10:
+                    time=self.bmstime[i]
+                    self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==22].index, 'end_time'] = time
+                else:
+                    pass
+
+            #SOC卡滞、跳变诊断................................................................................................
+            step=(self.bmstime[i]-self.bmstime[i-1]).total_seconds()
+            if step<120:
+                ah_accum=ah_accum-self.packcrnt[i]*step/3600    #ah累计
+            else:
+                pass
+            #SOC卡滞............................................................................................................
+            if abs(ah_accum)>self.param.Capacity*0.05:   
+                bmssoc_now=float(self.bms_soc[i])
+                if not 27 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                    if abs(bmssoc_now-bmssoc_st)<self.param.SocClamp:   #SOC卡滞故障进入
+                        time=self.bmstime[i]
+                        code=27
+                        faultlv=1
+                        faultinfo='电池SOC卡滞'
+                        faultadvice='技术介入诊断,检修电池BMS软件'
+                        self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                    else:
+                        pass
+                else:
+                    if abs(bmssoc_now-bmssoc_st)>self.param.SocClamp:   #SOC卡滞故障退出
+                        time=self.bmstime[i]
+                        self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==27].index, 'end_time'] = time
+                    else:
+                        pass
+                bmssoc_st=bmssoc_now
+                ah_accum=0
+            else:
+                pass
+
+            #SOC跳变....................................................................................................................
+            bmssoc_last=float(self.bms_soc[i-1])
+            bmssoc_now=float(self.bms_soc[i])
+            if not 28 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                if step<30 and abs(bmssoc_now-bmssoc_last)>self.param.SocJump:  #SOC跳变进入
+                    time=self.bmstime[i]
+                    code=28
+                    faultlv=1
+                    faultinfo='电池SOC跳变'
+                    faultadvice='技术介入诊断,检修电池BMS软件'
+                    self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                else:
+                    pass
+            else:
+                if abs(bmssoc_now-bmssoc_st)<self.param.SocJump:    #SOC跳变故障退出
+                    time=self.bmstime[i]
+                    self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==28].index, 'end_time'] = time
+                else:
+                    pass
+
+            # #SOC过低故障报警............................................................................................................
+            # if not 26 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+            #     if self.bms_soc[i-1]<self.param.SocLow and self.bms_soc[i]<self.param.SocLow:   #SOC过低故障进入
+            #         time=self.bmstime[i]
+            #         code=26
+            #         faultlv=1
+            #         faultinfo='电池包电量过低'
+            #         faultadvice='联系用户,请立刻充电'
+            #         self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+            #     else:
+            #         pass
+            # else:   
+            #     if self.bms_soc[i-1]>self.param.SocLow and self.bms_soc[i]>self.param.SocLow:   #SOC过低故障退出
+            #         time=self.bmstime[i]
+            #         self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==26].index, 'end_time'] = time
+            #     else:
+            #         pass
+
+            # #BMS故障报警........................................................................................................
+            # if not 1 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+            #     if self.bmsfault1[i-1] is None or self.bmsfault1[i] is None:
+            #         self.bmsfault1[i-1]=0
+            #         self.bmsfault1[i]=0
+            #     if self.bmsfault1[i-1]>0 or self.bmsfault1[i]>0:   #BMS故障进入
+            #         time=self.bmstime[0]
+            #         code=1
+            #         faultlv=2
+            #         faultinfo='BMS故障报警:{}'.format(self.bmsfault1[i-1])
+            #         faultadvice='技术介入诊断'
+            #         self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+            #     else:
+            #         pass
+            # else:
+            #     if self.bmsfault1[i-1]==0 and self.bmsfault1[i]==0:   #BMS故恢复
+            #         time=self.bmstime[i]
+            #         self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==1].index, 'end_time'] = time
+        
+        
+        #SOC一致性故障报警..........................................................................................................
+        if not self.df_uniform.empty:
+            cellsoc_diff=self.df_uniform.loc[0,'cellsoc_diff']
+            if not 25 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                if cellsoc_diff>self.param.SocDiff: #SOC一致性差故障进入
+                    time=self.bmstime[0]
+                    code=25
+                    faultlv=1
+                    faultinfo='电芯{}和{}SOC差过大:{}'.format(self.df_uniform.loc[0,'cellmin_num'],self.df_uniform.loc[0,'cellmax_num'],cellsoc_diff)
+                    faultadvice='技术介入诊断'
+                    self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                else:
+                    pass
+            else:
+                if cellsoc_diff<self.param.SocDiff: #SOC一致性差故障恢复
+                    time=self.bmstime[0]
+                    self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==25].index, 'end_time'] = time
+        else:
+            cellsoc_diff=3
+
+        #容量过低和一致性故障报警................................................................................................
+        if not self.df_soh.empty:
+            soh=self.df_soh.loc[0,'soh']
+            cellsoh=eval(self.df_soh.loc[0,'cellsoh'])
+            cellsoh=np.array(cellsoh)
+            cellsoh_lowindex=np.argwhere(cellsoh<self.param.SohLow)
+            cellsoh_lowindex=cellsoh_lowindex+1
+            if self.celltype==1 or self.celltype==2 or self.celltype==3 or self.celltype==4: 
+                cellsoh_diff=np.max(cellsoh)-np.min(cellsoh)
+                if not 23 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                    if soh<self.param.SohLow:   #soh过低故障进入
+                        time=self.bmstime[0]
+                        code=23
+                        faultlv=1
+                        faultinfo='电池包容量过低:电芯{}'.format(cellsoh_lowindex)
+                        faultadvice='检修电池,更换容量过低的电芯或模组'
+                        self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                    else:
+                        pass
+                else:
+                    if soh>self.param.SohLow+2:   #soh过低故障恢复
+                        time=self.bmstime[0]
+                        self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==23].index, 'end_time'] = time
+                    else:
+                        pass
+
+                if not 24 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                    if cellsoh_diff>self.param.SohDiff:
+                        time=self.bmstime[0]
+                        code=24
+                        faultlv=1
+                        faultinfo='电池包容量一致性差:电芯{}'.format(cellsoh_lowindex)
+                        faultadvice='检修电池,更换容量过低的电芯或模组'
+                        self.df_diag_ram.loc[len(self.df_diag_ram)]=[time, end_time, self.sn, code, faultlv, faultinfo, faultadvice]
+                    else:
+                        pass
+                else:
+                    if cellsoh_diff<self.param.SohDiff-2:
+                        time=self.bmstime[0]
+                        self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==24].index, 'end_time'] = time
+                    else:
+                        pass
+            else:
+                pass
+        else:
+            cellsoh_diff=5
+        
+        # #电池健康度评分.....................................................................................................
+        # health_state=soh*0.6+(100-cellsoh_diff)*0.2+(100-cellsoc_diff)*0.2
+        # if health_state>100:
+        #     health_state=100
+        # elif health_state<0:
+        #     health_state=0
+        # else:
+        #     pass
+        # health_state=eval(format(health_state,'.1f'))
+
+        #返回诊断结果...........................................................................................................
+        df_res=self.df_diag_ram
+        if not df_res.empty:
+            return df_res
+        else:
+            return pd.DataFrame()

+ 141 - 0
LIB/MIDDLE/SaftyCenter/DataDiag_Static/DataStatistics.py

@@ -0,0 +1,141 @@
+import numpy as np
+import pandas as pd
+from LIB.MIDDLE.SaftyCenter.Common import FeiShuData
+from LIB.MIDDLE.SaftyCenter.Common import DBDownload
+import time, datetime
+from datetime import timedelta
+from pandas.core.frame import DataFrame
+from apscheduler.schedulers.blocking import BlockingScheduler
+
+class DataSta():
+    def __init__(self) -> None:
+        pass
+    def SaftyWarningSta(df_fltinfo,start_time,end_time):
+        start_time=datetime.datetime.strptime(start_time, '%Y-%m-%d')
+        start_time=start_time+datetime.timedelta(days=1)
+        start_time=start_time.strftime('%Y-%m-%d')
+        SftyPlt_Data_Total=len(df_fltinfo)#总报警数
+        CS_Warning_Total_Finish=df_fltinfo[df_fltinfo['batpos']==1]
+        CS_Warning_Total_Finish_Count=len(CS_Warning_Total_Finish) #平台报警总运维数
+        SftyPlt_Data_day=len(df_fltinfo[df_fltinfo['start_time']>=start_time])#日、周总报警数
+        CS_Warning_day_Finish=CS_Warning_Total_Finish[CS_Warning_Total_Finish['start_time']>=start_time]#日/周运维数
+        CS_Warning_day_Finish_Count=len(CS_Warning_day_Finish)
+        SftyPlt_EmgcyData_day=df_fltinfo[df_fltinfo['start_time']>=start_time] #紧急报警数
+        SftyPlt_EmgcyData_day=SftyPlt_EmgcyData_day[SftyPlt_EmgcyData_day['level']>3]
+        SftyPlt_EmgcyData_day_Count=len(SftyPlt_EmgcyData_day[SftyPlt_EmgcyData_day['level']>3])
+        SftyPlt_EmgcyData_day_Finish=SftyPlt_EmgcyData_day[SftyPlt_EmgcyData_day['batpos']==1]
+        SftyPlt_EmgcyData_day_Finish_Count=len(SftyPlt_EmgcyData_day_Finish)
+        if int(SftyPlt_Data_Total)>0:
+            OprationManageRate=round(float(CS_Warning_day_Finish_Count/SftyPlt_Data_day)*100,2)
+        else:
+            OprationManageRate=100
+        if int(SftyPlt_EmgcyData_day_Count)>0:
+            OprationManageEmgcyRate=round(float(SftyPlt_EmgcyData_day_Finish_Count/SftyPlt_EmgcyData_day_Count)*100,2)
+        else:
+            OprationManageEmgcyRate=100
+        PK504FltData_Count=len(df_fltinfo[df_fltinfo['product_id'].str.contains('PK504')])
+        PK502FltData_Count=len(df_fltinfo[df_fltinfo['product_id'].str.contains('PK502')])
+        PK500FltData_Count=len(df_fltinfo[df_fltinfo['product_id'].str.contains('PK500')])
+        MGMCLFltData_Count=len(df_fltinfo[df_fltinfo['product_id'].str.contains('MGMCL')])
+        MGMLXFltData_Count=len(df_fltinfo[df_fltinfo['product_id'].str.contains('MGMLX')])
+        # print('总报警数=',SftyPlt_Data_Total)
+        # print('总完成运维数=',CS_Warning_Total_Finish_Count)
+        # print('周报警数=',SftyPlt_Data_day)
+        # print('周完成运维数=',CS_Warning_day_Finish_Count)
+        # print('周紧急报警数=',SftyPlt_EmgcyData_day)
+        # print('周紧急完成运维数=',SftyPlt_EmgcyData_day_Finish_Count)
+        # print('周运维率=',OprationManageRate)
+        # print('周紧急运维率=',OprationManageEmgcyRate)
+        # print('PK504总报警=',PK504FltData_Count)
+        # print('PK502总报警=',PK502FltData_Count)
+        # print('PK500总报警=',PK500FltData_Count)
+        # print('格林美总报警=',MGMCLFltData_Count)
+        # print('自研总报警=',MGMLXFltData_Count)
+        FltAlarmInfo=DataFrame(columns=['SftyPlt_Data_Total','CS_Warning_Total_Finish_Count','SftyPlt_Data_day','CS_Warning_day_Finish_Count','SftyPlt_EmgcyData_day','SftyPlt_EmgcyData_day_Finish_Count','OprationManageRate','OprationManageEmgcyRate'])
+        Celltype=DataFrame(columns=['PK504','PK502','PK500','MGMCL','MGMLX'])
+        FltAlarmInfo.loc[0]=[SftyPlt_Data_Total,CS_Warning_Total_Finish_Count,SftyPlt_Data_day,CS_Warning_day_Finish_Count,SftyPlt_EmgcyData_day_Count,SftyPlt_EmgcyData_day_Finish_Count,OprationManageRate,OprationManageEmgcyRate]
+        Celltype.loc[0]=[PK504FltData_Count,PK502FltData_Count,PK500FltData_Count,MGMCLFltData_Count,MGMLXFltData_Count]
+        return FltAlarmInfo,Celltype
+    def WeekInfoSta(df_fltinfo,start_time,end_time):
+        df_fltinfo=df_fltinfo[df_fltinfo['start_time']>=start_time]
+        FaultLvlCount=DataFrame(columns=['level','count'])
+        FaultLvlCount=df_fltinfo.groupby('level').count().T.head(1).T
+        FaultLvlCount=FaultLvlCount.reset_index(drop=False)
+        
+        return FaultLvlCount
+    def SftyWrngClsfy(df_fltinfo):
+        DsnSaftyCode=[]
+        DataSaftyCode=[]
+        SamplingSaftyCode=[2,10,50,53,54,55,56]
+        HvSaftyCode=[]
+        SysSaftyCode=[]
+        CellSaftyCode=[3,5,6,7,8,9,10,11,13,14,15,16,17,19,20,21,15,16,17,19,23,24,25,26,29,30,31,51,119]
+        CtrlSatyCode=[4,12,18,20,21,22,57]
+        StateSaftyCode=[27,28,52]
+        
+        DsnSaftyCodeCount=len(df_fltinfo[df_fltinfo['code'].isin(DsnSaftyCode)])
+        DataSaftyCodeCount=len(df_fltinfo[df_fltinfo['code'].isin(DataSaftyCode)])
+        HvSaftyCodeCount=len(df_fltinfo[df_fltinfo['code'].isin(HvSaftyCode)])
+        SysSaftyCodeCount=len(df_fltinfo[df_fltinfo['code'].isin(SysSaftyCode)])
+        SamplingSatyCount=len(df_fltinfo[df_fltinfo['code'].isin(SamplingSaftyCode)])
+        CellSaftyCount=len(df_fltinfo[df_fltinfo['code'].isin(CellSaftyCode)])
+        CtrlSaftyCodeCount=len(df_fltinfo[df_fltinfo['code'].isin(CtrlSatyCode)])
+        StateSaftyCodeCount=len(df_fltinfo[df_fltinfo['code'].isin(StateSaftyCode)])
+        SatftyCount=DataFrame(columns=['DsnSaftyCodeCount','DataSaftyCodeCount','HvSaftyCodeCount','SysSaftyCodeCount','SamplingSatyCount','CellSaftyCount','CtrlSaftyCodeCount','StateSaftyCodeCount'])
+        SatftyCount.loc[0]=[DsnSaftyCodeCount,DataSaftyCodeCount,HvSaftyCodeCount,SysSaftyCodeCount,SamplingSatyCount,CellSaftyCount,CtrlSaftyCodeCount,StateSaftyCodeCount]
+        # print('设计安全分数为',DsnSaftyCodeCount)
+        # print('数据安全分数为',DataSaftyCodeCount)
+        # print('高压安全分数为',HvSaftyCodeCount)
+        # print('系统安全分数为',SysSaftyCodeCount)
+        # print('采样安全分数为',SamplingSatyCount)
+        # print('电芯安全分数为',CellSaftyCount)
+        # print('控制安全分数为',CtrlSaftyCodeCount)
+        # print('状态安全分数为',StateSaftyCodeCount)
+        # print('---------------------------------------------------------------------------')
+        return SatftyCount
+    def AccumInfo(df_last_accum,df_FirstDataTime,end_time):
+        df_last_accum=df_last_accum[~df_last_accum['devcode'].str.contains('TJMCL')]
+        MaxAccumAh=df_last_accum['dsg_ahaccum'].max()
+        TotalAccumAh=df_last_accum['dsg_ahaccum'].sum()
+        PK504_Ah=df_last_accum[df_last_accum['devcode'].str.contains('PK504')]
+        PK504_Ah_Max=(PK504_Ah['dsg_ahaccum'].max())/60
+        PK502_Ah=df_last_accum[df_last_accum['devcode'].str.contains('PK502')]
+        PK502_Ah_Max=(PK502_Ah['dsg_ahaccum'].max())/40
+        PK500_Ah=df_last_accum[df_last_accum['devcode'].str.contains('PK500')]
+        PK500_Ah_Max=(PK500_Ah['dsg_ahaccum'].max())/40
+        MGMCL_Ah=df_last_accum[df_last_accum['devcode'].str.contains('MGMCL')]
+        MGMCL_Ah_Max=(MGMCL_Ah['dsg_ahaccum'].max())/50
+        MGMLX_Ah=df_last_accum[df_last_accum['devcode'].str.contains('MGMLX')]
+        MGMLX_Ah_Max=(MGMLX_Ah['dsg_ahaccum'].max())/50
+        MaxCycle=round(max(PK504_Ah_Max,PK502_Ah_Max,PK500_Ah_Max,MGMCL_Ah_Max,MGMLX_Ah_Max),0)
+        deltatimeMax=0
+        deltatime=DataFrame(columns=['runningdate'])
+        df_FirstDataTime=df_FirstDataTime.dropna(how='any')
+        df_FirstDataTime=df_FirstDataTime.reset_index(drop=False)
+        for i in range(0,len(df_FirstDataTime)):
+            End_time=datetime.datetime.now()
+            df_FirstDataTime.loc[i,'first_data_time']=df_FirstDataTime.loc[i,'first_data_time'].strftime('%Y-%m-%d')
+            df_FirstDataTime.loc[i,'first_data_time']=datetime.datetime.strptime(df_FirstDataTime.loc[i,'first_data_time'],'%Y-%m-%d')
+            deltatime.loc[i,'runningdate']=(End_time-df_FirstDataTime.loc[i,'first_data_time'])
+            deltatime.loc[i,'runningdate']= deltatime.loc[i,'runningdate'].total_seconds()/3600
+        MaxRunningHour=int(deltatime['runningdate'].max())
+        TotalRunHour=int(deltatime['runningdate'].sum())
+        return MaxAccumAh,TotalAccumAh,MaxCycle,MaxRunningHour,TotalRunHour
+
+    def FltBatPosition(df_last_pos,df_fltinfo):
+        df_Diag_Ram=df_fltinfo[df_fltinfo['batpos']==0].drop_duplicates(subset=['product_id'],keep=False)
+        all_location_info=DataFrame(columns=['factory','product_id','lat','lon'])
+        df_last_pos.rename(columns={'devcode':'product_id'},inplace=True)
+        df_Diag_Ram_Pos_a=pd.concat([df_Diag_Ram,df_last_pos]).drop_duplicates(subset=['product_id'],keep='first')
+        df_Diag_Ram_Pos_b=pd.concat([df_Diag_Ram,df_last_pos]).drop_duplicates(subset=['product_id'],keep=False)
+        df_Diag_Ram_Pos=df_Diag_Ram_Pos_a.append(df_Diag_Ram_Pos_b).drop_duplicates(subset=['product_id'],keep=False)
+        df_Diag_Ram_Pos=df_Diag_Ram_Pos.reset_index(drop=True)
+        for i in range(0,len(df_Diag_Ram_Pos)):
+            df_last_pos_list=df_last_pos['product_id'].values.tolist()
+            if  str(df_Diag_Ram_Pos.loc[i,'product_id']) in df_last_pos_list:
+                pos_la_temp=df_last_pos[df_last_pos['product_id']==(df_Diag_Ram_Pos.loc[i,'product_id'])].reset_index(drop=True)
+                all_location_info.loc[i,'lat']=pos_la_temp.loc[0,'latitude']
+                all_location_info.loc[i,'lon']=pos_la_temp.loc[0,'longitude']
+                all_location_info.loc[i,'factory']='骑享'
+                all_location_info.loc[i,'product_id']=df_Diag_Ram_Pos.loc[i,'product_id']
+        return all_location_info

+ 36 - 0
LIB/MIDDLE/SaftyCenter/DataDiag_Static/DiagDataMerge.py

@@ -0,0 +1,36 @@
+import pandas as pd
+import datacompy
+
+
+class DiagDataMerge():
+    def DetaMerge(df_Diag_Ram_sn,df_Diag_Batdiag_update,df_OprtnSta,df_Diag_Ram_sn_else):
+        df_Diag_Ram_add = pd.DataFrame()
+        df_Diag_Ram_Update_change = pd.DataFrame()
+        
+        df_Diag_Cal_finish = pd.DataFrame(columns=['start_time', 'end_time', 'product_id', 'code', 'level', 'info','advice','Batpos'])
+        df_Diag_Cal_unfinish = pd.DataFrame(columns=['start_time', 'end_time', 'product_id', 'code', 'level', 'info','advice','Batpos'])
+        print('处理前',df_Diag_Cal_unfinish)
+        if not df_Diag_Batdiag_update.empty:
+            #------------------------------合并两者故障,并将同一sn号下的车辆故障放一起----------------------------------------------
+            df_Diag_Cal_finish = df_Diag_Batdiag_update[df_Diag_Batdiag_update['end_time'] != '0000-00-00 00:00:00']
+            df_Diag_Cal_unfinish = df_Diag_Batdiag_update[df_Diag_Batdiag_update['end_time'] == '0000-00-00 00:00:00']
+            df_Diag_Cal_finish['Batpos'] = [1]*len(df_Diag_Cal_finish)
+            if len(df_OprtnSta):
+                if df_OprtnSta.loc[0,'status'] !=1:#0禁用 1正常 2故障 3返修 4 损毁 5丢失已赔偿,6丢失未赔偿
+                    if df_Diag_Cal_unfinish['level'].max()>3:
+                        if df_OprtnSta.loc[0,'status'] ==3:
+                            df_Diag_Cal_unfinish['Batpos'] = [1]*len(df_Diag_Cal_unfinish)
+                        else:
+                            df_Diag_Cal_unfinish['Batpos'] = [0]*len(df_Diag_Cal_unfinish)
+                    else:
+                        df_Diag_Cal_unfinish['Batpos'] = [1]*len(df_Diag_Cal_unfinish)
+                else:
+                    df_Diag_Cal_unfinish['Batpos'] = [0]*len(df_Diag_Cal_unfinish)
+                    
+        print('处理后',df_Diag_Cal_unfinish)
+        df_Diag_Cal_Update=pd.concat([df_Diag_Cal_finish,df_Diag_Cal_unfinish])    
+        df_Diag_Ram_add = pd.concat([df_Diag_Cal_Update,df_Diag_Ram_sn,df_Diag_Ram_sn]).drop_duplicates(subset=['start_time','code'],keep=False)#此次判断中新增故障
+        df_Diag_Ram_Update_old = pd.concat([df_Diag_Cal_Update,df_Diag_Ram_add,df_Diag_Ram_add]).drop_duplicates(subset=['start_time','code'],keep=False)#此次判断中新增故障
+        df_Diag_Ram_Update_change = pd.concat([df_Diag_Ram_Update_old,df_Diag_Ram_sn,df_Diag_Ram_sn]).drop_duplicates(subset=['start_time','code','Batpos'],keep=False)#此次判断中新增故障
+        # df_Diag_Ram = pd.concat([df_Diag_Ram_sn_else,df_Diag_Cal_unfinish])    
+        return df_Diag_Ram_add,df_Diag_Ram_Update_change

+ 73 - 0
LIB/MIDDLE/SaftyCenter/DataDiag_Static/SC_CtrlSafty.py

@@ -0,0 +1,73 @@
+import sys
+import numpy as np
+import pandas as pd
+import string
+import os
+from pandas import Series
+from matplotlib import pyplot as plt
+from pandas.core.frame import DataFrame
+from pandas.core.indexes.base import Index
+from LIB.BACKEND import DBManager
+import datetime
+import time
+import string
+import re
+
+
+
+class CtrlSafty:
+    def __init__(self):
+        pass
+    def main(sn,param,bms_info,df_Diag_Ram_in):
+        df_Diag_Ram_Update_inside=DataFrame(columns=['start_time', 'end_time', 'product_id', 'code', 'level', 'info','advice'])
+        df_Diag_Ram_Update_inside=df_Diag_Ram_Update_inside.append(df_Diag_Ram_in)
+        global QuitErrCount 
+        VolStarkCount=[0 for i in range(param.CellVoltNums)]
+        VolCount=0
+        QuitErrCount=[0 for i in range(param.FaultCount)]
+
+        #--------------该电池的所有当前故障-------------
+
+
+
+
+        df_Diag_Ram_Update_inside=CtrlSafty.TempCtrlDiag(sn,bms_info,param,df_Diag_Ram_Update_inside) 
+        return df_Diag_Ram_Update_inside
+
+
+
+    def TempCtrlDiag(sn,bms_info,param,df_Diag_Ram):
+        ErrorFlg=0
+        CellTempMax=0
+        OtherTempMax=0
+
+        CellTempNum=['单体温度'+str(i) for i in range(1,param.CellTempNums+1)]
+        if 'MXMLX' in sn:
+            OtherTempNum=['其他温度1','其他温度3','其他温度4','其他温度5']
+        else:
+            OtherTempNum=['其他温度'+str(i) for i in range(1,param.OtherTempNums+1)]
+        
+        CellTempMax=bms_info[bms_info[CellTempNum]>(param.CellMaxUSBTemp-5)]
+        CellTempMax=CellTempMax[CellTempMax<(param.CellMaxUSBTemp+5)].dropna(axis=0,how='all')
+        OtherTempMax=bms_info[bms_info[OtherTempNum]>(param.OtherOTlmt-10)]
+        OtherTempMax=OtherTempMax[OtherTempMax[OtherTempNum]<(param.OtherOTlmt+5)].dropna(axis=0,how='all')
+        if len(CellTempMax) and len(OtherTempMax):
+            QuitErrCount[57]=0
+            if not 57 in df_Diag_Ram['code'].values.tolist():#如果故障发生当前故障中没有该故障,则压入该故障
+                df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[len(bms_info)-1,'时间戳'],'0000-00-00 00:00:00',sn,57,4,'电芯温度高','立即联系用户确认电池状态']
+                ErrorFlg=1            
+            else:#如果故障发生当前故障中有该故障,则不进行操作
+                pass
+        else:
+            if 57 in df_Diag_Ram['code'].values.tolist():
+                QuitErrCount[57]=QuitErrCount[57]+1
+                if QuitErrCount[57]>3:
+                    QuitErrCount[57]=4
+                    end_time=datetime.datetime.now()
+                    end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                    df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==57].index,['end_time']]=end_time
+                else:
+                    pass
+            else:
+                pass
+        return df_Diag_Ram

+ 356 - 0
LIB/MIDDLE/SaftyCenter/DataDiag_Static/SC_SamplingSafty.py

@@ -0,0 +1,356 @@
+import sys
+import numpy as np
+import pandas as pd
+import string
+import os
+from pandas import Series
+from matplotlib import pyplot as plt
+from pandas.core.frame import DataFrame
+from pandas.core.indexes.base import Index
+from LIB.BACKEND import DBManager
+import datetime
+import time
+import string
+import re
+
+
+
+class SamplingSafty:
+    def __init__(self):
+        pass
+    def main(sn,param,bms_info,df_Diag_Ram_in):
+        df_Diag_Ram_Update_inside=DataFrame(columns=['start_time', 'end_time', 'product_id', 'code', 'level', 'info','advice'])
+        df_Diag_Ram_Update_inside=df_Diag_Ram_Update_inside.append(df_Diag_Ram_in)
+        global QuitErrCount 
+        VolStarkCount=[0 for i in range(param.CellVoltNums)]
+        VolCount=0
+        QuitErrCount=[0 for i in range(param.FaultCount)]
+
+        #--------------该电池的所有当前故障-------------
+
+
+
+        for i in range(0,len(bms_info)):
+            if i==0:
+                bms_infoP=bms_info.loc[i]
+            elif len(bms_info)>=1:
+                    bms_infoP=bms_info.loc[i-1]
+            df_Diag_Ram_Update_inside,VolStarkCount,VolCount=SamplingSafty.VoltSamplingDiag(sn,bms_info.loc[i],bms_infoP,param,VolStarkCount,VolCount,df_Diag_Ram_Update_inside)   
+            df_Diag_Ram_Update_inside=SamplingSafty.TempSamplingDiag(sn,bms_info.loc[i],bms_infoP,param,df_Diag_Ram_Update_inside)
+                # FltInfo=SamplingSafty.CrntSamplingDiag(sn,bms_info.loc[i],FltInfo,param)
+        return df_Diag_Ram_Update_inside
+
+
+
+    def VoltSamplingDiag(sn,bms_infoN,bms_infoP,param,VolStarkCount,VolCount,df_Diag_Ram):
+        InVMaxBatNo=[]
+        InVMinBatNo=[]
+        StackVolNo=[]
+        OutlierVolNo=[]
+        ErrorFlg=0
+        #——————————————————————取最高最低电压————————————————————————————————
+
+        VoltageNum=['单体电压'+str(i) for i in range(1,param.CellVoltNums+1)]
+        CellVoltage=bms_infoN[VoltageNum]/1000
+        CellVoltageP=bms_infoP[VoltageNum]/1000
+        MaxVolt=CellVoltage.max()
+        MinVolt=CellVoltage.min()
+        MaxVoltNum=CellVoltage[MaxVolt==CellVoltage].index
+        MinVoltNum=CellVoltage[MinVolt==CellVoltage].index
+        InVMaxBatNo=CellVoltage[CellVoltage>=param.CellOVlmt].index
+        InVMinBatNo=CellVoltage[CellVoltage<=param.CellUVlmt].index
+        if param.CellVoltNums>2:
+            AvgVol=(CellVoltage.sum()-MaxVolt-MinVolt)/(param.CellVoltNums-2)
+        else:
+            AvgVol=CellVoltage.mean()
+        #—————————————————————————————电压无效和断线判断———————————————————————
+        if len(InVMaxBatNo):
+            if len(InVMinBatNo):
+                QuitErrCount[10]=0
+                if not 10 in df_Diag_Ram['code'].values.tolist():#如果故障发生当前故障中没有该故障,则压入该故障
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,10,2,'电池电压采样断线,最高电压为{:.2f}V,电池编号为{},最低电压为{:.2f}V,电池编号为{}'.format(MaxVolt,InVMaxBatNo.values,MinVolt,InVMinBatNo.values),'返厂维修']
+                    ErrorFlg=1  
+                else:#如果故障发生当前故障中有该故障,则不进行操作
+                    pass                 
+            else:#如果没有故障,并且当前故障表中有该故障,则判断故障是否结束
+                QuitErrCount[50]=0
+                if 10 in df_Diag_Ram['code'].values.tolist():
+                    QuitErrCount[10]=QuitErrCount[10]+1
+                    if QuitErrCount[10]>3:
+                        QuitErrCount[10]=4
+                        end_time=datetime.datetime.now()
+                        end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                        df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==10].index,['end_time']]=end_time
+                    else:
+                        pass
+                else:
+                    pass
+                if not 50 in df_Diag_Ram['code'].values.tolist():
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,50,2,str(InVMaxBatNo.values)+'号电压大于{:.2f}V,采样无效'.format(param.CellOVlmt),'返厂维修']
+                    ErrorFlg=1
+                else:
+                    pass
+        elif len(InVMinBatNo):
+            QuitErrCount[50]=0
+            if not 50 in df_Diag_Ram['code'].values.tolist():
+                df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,50,2,str(InVMinBatNo.values)+'号电压小于{:.2f}V,采样无效'.format(param.CellUVlmt),'返厂维修']
+                ErrorFlg=1
+            else:
+                pass
+        else:
+            if 50 in df_Diag_Ram['code'].values.tolist():
+                QuitErrCount[50]=QuitErrCount[50]+1
+                if QuitErrCount[50]>3:
+                    QuitErrCount[50]=4
+                    end_time=datetime.datetime.now()
+                    end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                    df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==50].index,['end_time']]=end_time                   
+                else:
+                    pass
+            else:
+                pass                                      
+       #——————————————————————————————————电压卡滞和离群判断—————————————————————————
+        if ErrorFlg==0:
+            AvgVolGap=CellVoltage-AvgVol
+            OutlierVolNo=AvgVolGap[AvgVolGap>=param.AvgVolGap].index
+            if len(OutlierVolNo) and abs(bms_infoN['总电流[A]'])<2 and not 51 in df_Diag_Ram['code']:
+                VolCount=VolCount+1
+                QuitErrCount[51]=0
+                if VolCount>10:
+                    VolCount=11
+                    if not 51 in df_Diag_Ram['code'].values.tolist():#如果故障发生当前故障中没有该故障,则压入该故障
+                        df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,51,2,str(OutlierVolNo.values)+'号电池电压离群','技术介入诊断']
+                        ErrorFlg=1            
+                    else:#如果故障发生当前故障中有该故障,则不进行操作
+                        pass                
+            else:
+                VolCount=0
+                if 51 in df_Diag_Ram['code'].values.tolist():
+                    QuitErrCount[51]=QuitErrCount[51]+1
+                    if QuitErrCount[51]>3:
+                        QuitErrCount[51]=4
+                        end_time=datetime.datetime.now()
+                        end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                        df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==51].index,['end_time']]=end_time                
+                    else:
+                        pass
+                else:
+                    pass
+            # -------------------卡滞逻辑未加-------------------------------------
+            # if (abs(float(bms_infoN['总电流[A]']))>=10 and not 'PK504' in sn) or (abs(float(bms_infoN['总电流[A]']))>=15 and 'PK504' in sn):
+            #     StackVolNo=CellVoltage[abs(CellVoltage-CellVoltageP)<=0.0001].index
+            #     NotStackVolNo=CellVoltage[abs(CellVoltage-CellVoltageP)>0.0001].index
+            #     if len(StackVolNo) and not 52 in df_Diag_Ram['code']:
+            #         StackVolNo=[int(s) for s in StackVolNo.str.replace(r'[^0-9]','').tolist()]
+            #         NotStackVolNo=[int(s) for s in NotStackVolNo.str.replace(r'[^0-9]','').tolist()]
+            #         for i in StackVolNo:
+            #             VolStarkCount[i-1]=VolStarkCount[i-1]+1
+            #         for i in NotStackVolNo:
+            #             VolStarkCount[i-1]=0
+            #     if [s for s in VolStarkCount]>10:
+            #         StacVolNo=
+
+        return df_Diag_Ram,VolStarkCount,VolCount
+
+    def TempSamplingDiag(sn,bms_infoN,bms_infoP,param,df_Diag_Ram):
+        InVMaxBatNo=[]
+        InVMinBatNo=[]
+        StackVolNo=[]
+        OutlierVolNo=[]
+        ErrorFlg=0
+        #——————————————————————Cell取最高最低温度————————————————————————————————
+        TempNum=['单体温度'+str(i) for i in range(1,param.CellTempNums+1)]
+        CellTemp=bms_infoN[TempNum]
+        CellTempP=bms_infoP[TempNum]
+        maxCellTemp=CellTemp.max()
+        minCellTemp=CellTemp.min()
+        MaxVoltNum=CellTemp[maxCellTemp==CellTemp].index
+        MinVoltNum=CellTemp[minCellTemp==CellTemp].index
+        InVMaxTempBatNo=CellTemp[CellTemp>=param.PackOTlmt].index
+        InVMinTempBatNo=CellTemp[CellTemp<=param.PackUTlmt].index
+        if param.CellTempNums>2:
+            AvgCellTemp=(CellTemp.sum()-maxCellTemp-minCellTemp)/(param.CellTempNums-2)
+        else:
+            AvgCellTemp=CellTemp.mean()        
+        #——————————————————————温度无效,离群和断线判断———————————————————————
+        if len(InVMaxTempBatNo):
+            if len(InVMinTempBatNo):
+                QuitErrCount[53]=0
+                if not 53 in df_Diag_Ram['code'].values.tolist():#如果故障发生当前故障中没有该故障,则压入该故障
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,53,2,'电池温度采样断线,最高温度为{}℃,电池编号为{},最低温度为{}℃,电池编号为{}'.format(maxCellTemp,InVMaxTempBatNo.values,minCellTemp,InVMinTempBatNo.values),'返厂维修']
+                    ErrorFlg=1 
+                else:#如果故障发生当前故障中有该故障,则不进行操作
+                    pass                 
+            else:#如果没有故障,并且当前故障表中有该故障,则判断故障是否结束
+                QuitErrCount[2]=0
+                if 53 in df_Diag_Ram['code'].values.tolist():
+                    QuitErrCount[53]=QuitErrCount[53]+1
+                    if QuitErrCount[53]>3:
+                        QuitErrCount[53]=4
+                        end_time=datetime.datetime.now()
+                        end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                        df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==53].index,['end_time']]=end_time
+                    else:
+                        pass
+                else:
+                    pass
+                if not 2 in df_Diag_Ram['code'].values.tolist():
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,2,2,str(InVMaxTempBatNo.values)+'号温度大于{}℃,采样无效'.format(param.PackOTlmt),'联系用户核实电池温度情况,并返厂维修']
+                    ErrorFlg=1
+                else:
+                    pass
+        elif len(InVMinTempBatNo):
+            QuitErrCount[2]=0
+            if not 2 in df_Diag_Ram['code'].values.tolist():
+                df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,2,2,str(InVMinTempBatNo.values)+'号温度小于{}℃,采样无效'.format(param.PackUTlmt),'返厂维修']
+                ErrorFlg=1
+            else:
+                pass
+        else:
+            if 2 in df_Diag_Ram['code'].values.tolist():
+                QuitErrCount[2]=QuitErrCount[2]+1
+                if QuitErrCount[2]>3:
+                    QuitErrCount[2]=4
+                    end_time=datetime.datetime.now()
+                    end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                    df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==2].index,['end_time']]=end_time                   
+                else:
+                    pass
+            else:
+                pass             
+        if ErrorFlg==0:
+            AvgCellTempGap=abs(CellTemp-AvgCellTemp)
+            OutlierTempNo=AvgCellTempGap[AvgCellTempGap>=param.AvgCellTempGap].index
+            if len(OutlierTempNo):
+                QuitErrCount[8]=0
+                if not 8 in df_Diag_Ram['code'].values.tolist():#如果故障发生当前故障中没有该故障,则压入该故障
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,8,2,str(OutlierTempNo.values)+'号电池异常温度离群','技术介入诊断']
+                    ErrorFlg=1            
+                else:#如果故障发生当前故障中有该故障,则不进行操作
+                    pass
+            else:
+                if 8 in df_Diag_Ram['code'].values.tolist():
+                    QuitErrCount[8]=QuitErrCount[8]+1
+                    if QuitErrCount[8]>3:
+                        QuitErrCount[8]=4
+                        end_time=datetime.datetime.now()
+                        end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                        df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==8].index,['end_time']]=end_time
+                    else:
+                        pass
+                else:
+                    pass
+        #——————————————————————————————————OtherTemp————————————————————————————————————
+        if param.OtherTempNums>0:
+            OtherTempNum=['其他温度'+str(i) for i in range(1,param.OtherTempNums+1)]
+            OtherTemp=bms_infoN[OtherTempNum]
+            OtherTemppP=bms_infoP[OtherTempNum]
+            maxOtherTemp=OtherTemp.max()
+            minOtherTemp=OtherTemp.min()
+            MaxVoltNum=OtherTemp[maxOtherTemp==OtherTemp].index
+            MinVoltNum=OtherTemp[minOtherTemp==OtherTemp].index
+            InVMaxOtherTempBatNo=OtherTemp[OtherTemp>=param.OtherOTlmt].index
+            InVMinOtherTempBatNo=OtherTemp[OtherTemp<=param.OtherUTlmt].index
+            if param.OtherTempNums>2:
+                AvgOtherTemp=(OtherTemp.sum()-maxOtherTemp-minOtherTemp)/(param.OtherTempNums-2)
+            else:
+                AvgOtherTemp=OtherTemp.mean()        
+            #——————————————————————温度无效,离群和断线判断———————————————————————
+            if len(InVMaxOtherTempBatNo):
+                if len(InVMinOtherTempBatNo):
+                    QuitErrCount[54]=0
+                    if not 54 in df_Diag_Ram['code'].values.tolist():#如果故障发生当前故障中没有该故障,则压入该故障
+                        df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,54,2,'其他温度采样断线,最高温度为{}℃,传感器编号为{},最低温度为{}℃,传感器编号为{}'.format(maxOtherTemp,InVMaxOtherTempBatNo.values,minOtherTemp,InVMinOtherTempBatNo.values),'返厂维修']
+                        ErrorFlg=1 
+                    else:#如果故障发生当前故障中有该故障,则不进行操作
+                        pass                 
+                else:#如果没有故障,并且当前故障表中有该故障,则判断故障是否结束
+                    QuitErrCount[55]=0
+                    if 54 in df_Diag_Ram['code'].values.tolist():
+                        QuitErrCount[54]=QuitErrCount[54]+1
+                        if QuitErrCount[54]>3:
+                            QuitErrCount[54]=4
+                            end_time=datetime.datetime.now()
+                            end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                            df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==54].index,['end_time']]=end_time
+                        else:
+                            pass
+                    else:
+                        pass
+                    if not 55 in df_Diag_Ram['code'].values.tolist():
+                        df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,55,2,'传感器温度大于{}℃,采样无效'.format(param.OtherOTlmt),'联系用户核实电池温度情况,并返厂维修']
+                        ErrorFlg=1
+                    else:
+                        pass
+            elif len(InVMinTempBatNo):
+                QuitErrCount[55]=0
+                if not 55 in df_Diag_Ram['code'].values.tolist():
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,55,2,'传感器温度小于{}℃,采样无效'.format(param.OtherUTlmt),'返厂维修']
+                    ErrorFlg=1
+                else:
+                    pass
+            else:
+                if 55 in df_Diag_Ram['code'].values.tolist():
+                    QuitErrCount[55]=QuitErrCount[55]+1
+                    if QuitErrCount[55]>3:
+                        QuitErrCount[55]=4
+                        end_time=datetime.datetime.now()
+                        end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                        df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==55].index,['end_time']]=end_time                   
+                    else:
+                        pass
+                else:
+                    pass             
+            if ErrorFlg==0:
+                AvgOtherTempGap=abs(OtherTemp-AvgOtherTemp)
+                OutlierOtherTempNo=AvgOtherTempGap[AvgOtherTempGap>=param.AvgOtherTempGap].index
+                if len(OutlierOtherTempNo):
+                    QuitErrCount[56]=0
+                    if not 56 in df_Diag_Ram['code'].values.tolist():#如果故障发生当前故障中没有该故障,则压入该故障
+                        df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,56,2,'传感器温度异常离群','技术介入诊断']
+                        ErrorFlg=1            
+                    else:#如果故障发生当前故障中有该故障,则不进行操作
+                        pass
+                else:
+                    if 56 in df_Diag_Ram['code'].values.tolist():
+                        QuitErrCount[56]=QuitErrCount[56]+1
+                        if QuitErrCount[56]>3:
+                            QuitErrCount[56]=4
+                            end_time=datetime.datetime.now()
+                            end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                            df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==56].index,['end_time']]=end_time
+                        else:
+                            pass
+                    else:
+                        pass
+
+                if (maxOtherTemp-maxCellTemp)>param.AvgOtherTempGap and  maxOtherTemp<param.OtherOTlmt and maxCellTemp<param.PackOTlmt:
+                    QuitErrCount[56]=0
+                    if not 56 in df_Diag_Ram['code'].values.tolist():
+                        df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,56,2,'传感器温度异常离群','技术立即介入诊断']
+                        ErrorFlg=1
+                else:
+                    if 56 in df_Diag_Ram['code'].values.tolist():
+                            QuitErrCount[56]=QuitErrCount[56]+1
+                            if QuitErrCount[56]>3:
+                                QuitErrCount[56]=4
+                                end_time=datetime.datetime.now()
+                                end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                                df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==56].index,['end_time']]=end_time
+                                
+                if (maxCellTemp-maxOtherTemp)>param.AvgOtherTempGap and  maxOtherTemp<param.OtherOTlmt and maxCellTemp<param.PackOTlmt and not 8 in df_Diag_Ram['code']:
+                    QuitErrCount[8]=0
+                    if not 8 in df_Diag_Ram['code'].values.tolist():
+                        df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,8,2,str(OutlierTempNo.values)+'号电芯温度异常离群','技术立即介入诊断']
+                        
+                        ErrorFlg=1
+                else:
+                    if 8 in df_Diag_Ram['code'].values.tolist():
+                            QuitErrCount[8]=QuitErrCount[8]+1
+                            if QuitErrCount[8]>3:
+                                QuitErrCount[8]=4
+                                end_time=datetime.datetime.now()
+                                end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+                                df_Diag_Ram.loc[df_Diag_Ram[df_Diag_Ram['code']==8].index,['end_time']]=end_time              
+
+        return df_Diag_Ram

+ 296 - 0
LIB/MIDDLE/SaftyCenter/DataDiag_Static/main.py

@@ -0,0 +1,296 @@
+import CBMSBatDiag
+from SC_SamplingSafty import SamplingSafty
+from DataStatistics import DataSta
+from DiagDataMerge import DiagDataMerge
+from SC_CtrlSafty import CtrlSafty
+import datetime
+import pandas as pd
+from LIB.BACKEND import DBManager, Log
+from sqlalchemy import create_engine
+import time, datetime
+from apscheduler.schedulers.blocking import BlockingScheduler
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import DBDownload as DBDownload
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import log
+from pandas.core.frame import DataFrame
+import datacompy
+from LIB.MIDDLE.SaftyCenter.Common import QX_BatteryParam
+from LIB.MIDDLE.SaftyCenter.Common import DBDownload as DBDw
+
+#...................................电池包电芯安全诊断函数......................................................................................................................
+def diag_cal():
+    task_on=1
+    global SNnums
+    global start
+    #..................................设置时间..........................................................  
+    start=time.time()
+    end_time=datetime.datetime.now()
+    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_algo_readonly'
+    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遍历
+        print(sn)
+        if 'PK500' in sn:
+            celltype=1 #6040三元电芯
+        elif 'PK502' in sn:
+            celltype=2 #4840三元电芯
+        elif 'K504B' in sn:
+            celltype=99    #60ah林磷酸铁锂电芯
+        elif 'MGMLXN750' in sn:
+            celltype=3 #力信50ah三元电芯
+        elif 'MGMCLN750' or 'UD' in sn: 
+            celltype=4 #CATL 50ah三元电芯
+        else:
+            print('SN:{},未找到对应电池类型!!!'.format(sn))
+            continue
+            # sys.exit()
+        param=QX_BatteryParam.BatteryInfo(celltype)   
+        #读取原始数据库数据........................................................................................................................................................
+        dbManager = DBManager.DBManager()
+        df_data = dbManager.get_data(sn=sn, start_time=start_time, end_time=end_time, data_groups=['bms'])
+        df_bms = df_data['bms']
+
+        #读取结果数据库数据........................................................................................................................................................
+        host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
+        port=3306
+        db='qx_cas'
+        user='qx_algo_readonly'
+        password='qx@123456'
+        mode=1
+        tablename1='cellstateestimation_soh'
+        tablename2='cellstateestimation_uniform_socvoltdiff'       
+        DBRead=DBDownload.DBDownload(host, port, db, user, password,mode)
+        with DBRead as DBRead:
+            df_soh=DBRead.getdata('time_st,sn,soh,cellsoh', tablename=tablename1, sn=sn, timename='time_sp', st=start_time, sp=end_time)
+            df_uniform=DBRead.getdata('time,sn,cellsoc_diff,cellmin_num,cellmax_num', tablename=tablename2, sn=sn, timename='time', st=start_time, sp=end_time)
+
+        #读取电池当前运营状态.....................................................................................................................................................
+        host='rm-bp10j10qy42bzy0q7.mysql.rds.aliyuncs.com'
+        port=3306
+        db='qixiang_manage'
+        user='qx_query'
+        password='@Qx_query'
+        mode=4
+        tablename1='py_battery'     
+        DBRead=DBDw.DBDownload(host, port, db, user, password,mode)
+        with DBRead as DBRead:
+            df_OprtnSta=DBRead.getdata('qrcode','status', tablename=tablename1, sn=sn, timename='', st='', sp='',factory='')#取最后一条运营状态
+
+
+
+
+
+
+        #电池诊断.....................................................................................................................................................................
+        CellFltInfo=DataFrame(columns=['start_time', 'end_time', 'product_id', 'code', 'level', 'info','advice'])
+        df_Diag_Ram_sn = df_Diag_Ram.loc[df_Diag_Ram['product_id']==sn]#历史故障
+        df_Diag_Ram_sn_else = df_Diag_Ram.loc[df_Diag_Ram['product_id']!=sn]#sn之外的故障
+        CellFltInfo = df_Diag_Ram_sn.drop('Batpos',axis=1)
+        #获取当前故障电池的历史故障信息↑↑↑↑↑↑↑↑↑↑↑.......................................................................................................................................
+        if not df_bms.empty:
+            df_Diag_Batdiag_update_xq=SamplingSafty.main(sn,param,df_bms,CellFltInfo)#学琦计算故障   
+            df_Diag_Batdiag_update_xq2=CtrlSafty.main(sn,param,df_bms,df_Diag_Batdiag_update_xq)
+            batDiag=CBMSBatDiag.BatDiag(sn,celltype,df_bms, df_soh, df_uniform, df_Diag_Batdiag_update_xq2)#鹏飞计算
+            df_Diag_Batdiag_update=batDiag.diag()
+            # df_Diag_Batdiag_update=BatDiag.diag() 
+        else:
+            df_Diag_Batdiag_update_xq=DataFrame(columns=['start_time','end_time','product_id','code','level','info','advice','Batpos'])
+            df_Diag_Batdiag_update=DataFrame(columns=['start_time','end_time','product_id','code','level','info','advice','Batpos'])
+        df_Diag_Ram_add,df_Diag_Ram_Update=DiagDataMerge.DetaMerge(df_Diag_Ram_sn,df_Diag_Batdiag_update,df_OprtnSta,df_Diag_Ram_sn_else)
+    task_on=0
+#.................................统计程序...............................
+def DaTa_Sta_Week_Task():
+    task_on=1
+    all_period_fault_info=DataFrame(columns=['factory','week','level1_count','level2_count','level3_count','level4_count','level5_count','solve_rate'])
+    #............................获取数据................................
+    toweek='Week'+time.strftime('%W')
+    host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
+    port=3306
+    db='safety_platform'
+    user='qx_algo_readonly'
+    password='qx@123456'
+    mode=2
+    tablename1='all_fault_info'
+    DBRead=DBDw.DBDownload(host, port, db, user, password,mode)
+    with DBRead as DBRead:
+        df_fltinfo=DBRead.getdata('product_id','level','code','start_time','end_time','batpos',tablename=tablename1,factory='骑享',sn='',timename='',st='',sp='')#dbdownload经过了改编
+    #............................获取时间................................      
+    end_time=datetime.datetime.now()
+    # end_time=datetime.datetime.strptime(end_time,'%Y-%m-%d')
+    start_time_week=end_time-datetime.timedelta(days=7)
+    start_time_week=start_time_week.strftime('%Y-%m-%d')
+    end_time=end_time.strftime('%Y-%m-%d')
+    FltAlarmInfo,Celltype=DataSta.SaftyWarningSta(df_fltinfo,start_time_week,end_time)
+    FaultLvlCount=DataSta.WeekInfoSta(df_fltinfo,start_time_week,end_time)
+    for i in range(1,6):
+        if not FaultLvlCount[FaultLvlCount['level']==i]['product_id'].empty:
+            all_period_fault_info.loc[0,'level'+str(i)+'_count']=int(FaultLvlCount[FaultLvlCount['level']==i]['product_id'].values)
+        else:
+            all_period_fault_info.loc[0,'level'+str(i)+'_count']=int(0)
+    all_period_fault_info.loc[0,'factory']='骑享'
+    all_period_fault_info.loc[0,'week']=toweek
+    all_period_fault_info.loc[0,'solve_rate']=FltAlarmInfo.loc[0,'OprationManageRate']
+    all_period_fault_info.fillna(0,inplace=False)
+
+    task_on=0
+def DaTa_Sta_Minutes_Task():
+    task_on=1
+    #............................获取数据................................
+    host='172.16.121.236'
+    port=3306
+    db='fastfun'
+    user='readonly'
+    password='Fast1234'
+    mode=3
+    tablename1='ff_battery_accum'
+    tablename2='ff_location'
+    DBRead=DBDw.DBDownload(host, port, db, user, password,mode)
+    with DBRead as DBRead:
+        df_last_accum=DBRead.getdata('devcode','dsg_phaccum','dsg_ahaccum',tablename=tablename1,factory='',sn='',timename='',st='',sp='')#dbdownload经过了改编
+        df_last_pos=DBRead.getdata('devcode','latitude','longitude',tablename=tablename2,factory='',sn='',timename='',st='',sp='')#dbdownload经过了改编
+        
+        
+    host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
+    port=3306
+    db='qx_cas'
+    user='qx_algo_readonly'
+    password='qx@123456'
+    mode=3
+    tablename2='bat_first_data_time'
+    DBRead=DBDw.DBDownload(host, port, db, user, password,mode)
+    with DBRead as DBRead:
+        df_FirstDataTime=DBRead.getdata('sn','first_data_time',tablename=tablename2,factory='',sn='',timename='',st='',sp='')#dbdownload经过了改编
+        
+        
+    host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
+    port=3306
+    db='safety_platform'
+    user='qx_algo_readonly'
+    password='qx@123456'
+    mode=2
+    tablename1='all_fault_info'
+    DBRead=DBDw.DBDownload(host, port, db, user, password,mode)
+    with DBRead as DBRead:
+        df_fltinfo=DBRead.getdata('product_id','level','code','start_time','batpos',tablename=tablename1,factory='骑享',sn='',timename='',st='',sp='')#dbdownload经过了改编
+    #............................获取时间................................
+    end_time=datetime.datetime.now()
+    # end_time=datetime.datetime.strptime(end_time,'%Y-%m-%d')
+    start_time=end_time-datetime.timedelta(days=1)
+    start_time=start_time.strftime('%Y-%m-%d')
+    end_time=end_time.strftime('%Y-%m-%d')
+    #............................执行程序................................
+    FltAlarmInfo,Celltype=DataSta.SaftyWarningSta(df_fltinfo,start_time,end_time)
+    SatftyCount=DataSta.SftyWrngClsfy(df_fltinfo)
+    MaxAccumAh,TotalAccumAh,MaxCycle,MaxRunningHour,TotalRunHour=DataSta.AccumInfo(df_last_accum,df_FirstDataTime,end_time)
+    all_location_info=DataSta.FltBatPosition(df_last_pos,df_fltinfo)
+
+    all_statistic_info=DataFrame(columns=['factory','total_alarm','alarm_total_today','alarm_not_close_today','alarm_close_today','alarm_uregent_total_today','alarm_uregent_close_today','alarm_uregent_not_close_today','alarm_close_total','run_time_total','dischrg_total','odo_total','max_dischrg_one','max_runtime_one','max_cycle_one','max_odo_one','alarm_close_total','alarm_total','cell_type','cell_type_count','cell_safety_risk_count','data_safety_risk_count','status_safety_risk_count','hv_safety_risk_count','system_safety_risk_count','sample_safety_risk_count','controller_safety_risk_count','design_safety_risk_count'])
+    all_statistic_info.loc[0,'factory']='骑享'
+    all_statistic_info.loc[0,'total_alarm']=FltAlarmInfo.loc[0,'SftyPlt_Data_Total']
+    all_statistic_info.loc[0,'alarm_total_today']=FltAlarmInfo.loc[0,'SftyPlt_Data_day']
+    all_statistic_info.loc[0,'alarm_close_today']=FltAlarmInfo.loc[0,'CS_Warning_day_Finish_Count']
+    all_statistic_info.loc[0,'alarm_not_close_today']=FltAlarmInfo.loc[0,'SftyPlt_Data_day']-FltAlarmInfo.loc[0,'CS_Warning_day_Finish_Count']
+    all_statistic_info.loc[0,'alarm_uregent_total_today']=FltAlarmInfo.loc[0,'SftyPlt_EmgcyData_day']
+    all_statistic_info.loc[0,'alarm_uregent_close_today']=FltAlarmInfo.loc[0,'SftyPlt_EmgcyData_day_Finish_Count']
+    all_statistic_info.loc[0,'alarm_uregent_not_close_today']=FltAlarmInfo.loc[0,'SftyPlt_EmgcyData_day']-FltAlarmInfo.loc[0,'SftyPlt_EmgcyData_day_Finish_Count']
+    all_statistic_info.loc[0,'run_time_total']=TotalRunHour
+    all_statistic_info.loc[0,'dischrg_total']=TotalAccumAh
+    all_statistic_info.loc[0,'odo_total']=0
+    all_statistic_info.loc[0,'max_dischrg_one']=MaxAccumAh
+    all_statistic_info.loc[0,'max_runtime_one']=MaxRunningHour
+    all_statistic_info.loc[0,'max_cycle_one']=MaxCycle
+    all_statistic_info.loc[0,'max_odo_one']=0
+    all_statistic_info.loc[0,'alarm_close_total']=FltAlarmInfo.loc[0,'CS_Warning_Total_Finish_Count']
+    all_statistic_info.loc[0,'alarm_total']=FltAlarmInfo.loc[0,'SftyPlt_Data_Total']
+    CellType=Celltype.columns.tolist()
+    CellType=','.join(CellType) 
+    all_statistic_info.loc[0,'cell_type']=str(CellType)
+    CellTypeCount=Celltype.loc[0].tolist()
+    CellTypeCount=[str(x) for x in CellTypeCount]
+    CellTypeCount=','.join(CellTypeCount) 
+    all_statistic_info.loc[0,'cell_type_count']=str(CellTypeCount)
+    all_statistic_info.loc[0,'cell_safety_risk_count']=SatftyCount.loc[0,'CellSaftyCount']
+    all_statistic_info.loc[0,'data_safety_risk_count']=SatftyCount.loc[0,'DataSaftyCodeCount']
+    all_statistic_info.loc[0,'status_safety_risk_count']=SatftyCount.loc[0,'StateSaftyCodeCount']
+    all_statistic_info.loc[0,'hv_safety_risk_count']=SatftyCount.loc[0,'HvSaftyCodeCount']
+    all_statistic_info.loc[0,'system_safety_risk_count']=SatftyCount.loc[0,'SysSaftyCodeCount']
+    all_statistic_info.loc[0,'sample_safety_risk_count']=SatftyCount.loc[0,'SamplingSatyCount']
+    all_statistic_info.loc[0,'controller_safety_risk_count']=SatftyCount.loc[0,'CtrlSaftyCodeCount']
+    all_statistic_info.loc[0,'design_safety_risk_count']=SatftyCount.loc[0,'DsnSaftyCodeCount']
+    end=time.time()
+    print(end-start)
+    task_on=0
+
+
+
+#...............................................主函数.......................................................................................................................
+if __name__ == "__main__":
+    global SNnums
+    global task_on
+    
+    task_on=0
+    excelpath=r'D:\ZLWORK\code\data_analyze_platform\USER\eric\SaftyCenter_CODE_V1\sn-20210903.xlsx'
+    SNdata_6060 = pd.read_excel(excelpath, sheet_name='科易6060')
+    SNdata_6040 = pd.read_excel(excelpath, sheet_name='科易6040')
+    SNdata_4840 = pd.read_excel(excelpath, sheet_name='科易4840')
+    SNdata_L7255 = pd.read_excel(excelpath, sheet_name='格林美-力信7255')
+    SNdata_C7255 = pd.read_excel(excelpath, sheet_name='格林美-CATL7255')
+    SNdata_U7255 = pd.read_excel(excelpath, sheet_name='优旦7255')
+    SNnums_6060=SNdata_6060['SN号'].tolist()
+    SNnums_6040=SNdata_6040['SN号'].tolist()
+    SNnums_4840=SNdata_4840['SN号'].tolist()
+    SNnums_L7255=SNdata_L7255['SN号'].tolist()
+    SNnums_C7255=SNdata_C7255['SN号'].tolist()
+    SNnums_U7255=SNdata_U7255['SN号'].tolist()
+    SNnums=SNnums_L7255 + SNnums_C7255 + SNnums_6040 + SNnums_4840 + SNnums_U7255+ SNnums_6060
+    # SNnums=['MGMCLN750N215I005','PK504B10100004341','PK504B00100004172','MGMLXN750N2189014']
+    #SNnums = ['MGMLXN750N218N004'] #SNnums_6040
+    
+    mylog=log.Mylog('log_diag.txt','error')
+    mylog.logcfg()
+    #............................模块运行前,先读取数据库中所有结束时间为0的数据,需要从数据库中读取................
+    host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
+    port=3306
+    db='safety_platform'
+    user='qx_algo_readonly'
+    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='')
+    # result=pd.read_csv(r'D:\Work\Code_write\data_analyze_platform\USER\01Screen_Problem\result.csv',encoding='gbk')
+
+    #定时任务.......................................................................................................................................................................
+    scheduler = BlockingScheduler()
+    diag_cal()
+    DaTa_Sta_Minutes_Task()
+    DaTa_Sta_Week_Task()  
+
+    if task_on==0:
+        scheduler.add_job(DaTa_Sta_Week_Task, 'interval', days=7, id='Week_Task')
+        scheduler.add_job(diag_cal, 'interval', seconds=900, id='diag_job')
+        scheduler.add_job(DaTa_Sta_Minutes_Task, 'interval', seconds=180, id='Hour_Task')
+
+    try:
+
+        scheduler.start()
+    except Exception as e:
+        scheduler.shutdown()
+        print(repr(e))
+        mylog.logopt(e)

BIN
LIB/MIDDLE/SaftyCenter/DataDiag_Static/各项目sn号.xlsx


BIN
LIB/MIDDLE/SaftyCenter/DataDiag_Static/故障表头及数据类型.xlsx


+ 221 - 0
LIB/MIDDLE/SaftyCenter/Liplated/BatParam.py

@@ -0,0 +1,221 @@
+
+#定义电池参数
+class BatParam:
+    def __init__(self,celltype):
+
+        #公用参数................................................................................................................................................
+        self.CellTempUpLmt=119
+        self.CellTempLwLmt=-39
+        self.CellTempHighLv1=45
+        self.CellTempHighLv2=50
+        self.CellTempLowLv1=-20
+        self.CellTempLowLv2=-25
+        self.CellTempDiffLv1=10
+        self.CellTempDiffLv2=15
+        self.CellTempRate=5
+
+       #热失控参数
+        self.TrwTempHigh=60
+        self.TrwTempRate=20
+        self.TrwTempDiff=15
+        self.TrwCellVoltDiff=2.5
+        self.TrwCellVoltFall=1
+        self.TrwCellVoltLow=1.5
+        self.TrwPackVoltFall=1.5
+
+        self.SocJump=3
+        self.SocClamp=0.1
+        self.SocLow=3
+        self.SocDiff=20
+
+        self.SohLow=65
+        self.SohDiff=20
+
+        self.OcvWeight_Temp=[-30,-20,-10,0,10,20,30,40,50]
+        self.OcvWeight_StandingTime=[0,500,600,1200,1800,3600,7200,10800]
+        self.OcvWeight            =[[0,0,  0,  0,    0,   0.1,0.3, 1],
+                                    [0,0,  0,  0,    0,   0.1,0.3, 1],
+                                    [0,0,  0,  0,    0,   0.2,0.5, 1],
+                                    [0,0,  0,  0,    0.2, 0.4,0.8, 1],
+                                    [0,0,  0,  0.1,  0.3, 0.6,1,   1],
+                                    [0,0,  0.1,0.2,  0.5, 0.8,1,   1],
+                                    [0,0,  0.1,0.3,  0.6, 1,  1,   1],
+                                    [0,0,  0.1,0.3,  0.7, 1,  1,   1],
+                                    [0,0,  0.2,0.3,  0.8, 1,  1,   1]]
+
+
+        if celltype==1: #6040
+            self.Capacity = 41
+            self.PackFullChrgVolt=69.99
+            self.CellFullChrgVolt=4.2
+            self.CellFullChrgCrnt=-15
+            self.CellVoltNums=17
+            self.CellTempNums=3
+            self.OtherTempNums=5
+            self.FullChrgSoc=98
+            self.PackCrntDec=1
+            self.BalCurrent=0.015
+            self.LookTab_SOC = [0,	    3.5348,	8.3581,	13.181,	18.004,	22.827,	27.651,	32.474,	37.297,	42.120,	46.944,	51.767,	56.590,	61.413,	66.237,	71.060,	75.883,	80.707,	85.530,	90.353,	95.176,	100,   105]
+            self.LookTab_OCV = [3.3159,	3.4384,	3.4774,	3.5156,	3.5478,	3.5748,	3.6058,	3.6238,	3.638,	3.6535,	3.6715,	3.6951,	3.7279,	3.7757,	3.8126,	3.8529,	3.8969,	3.9446,	3.9946,	4.0491,	4.109,	4.183, 4.263]
+
+            self.CellOvLv1=4.3
+            self.CellOvLv2=4.35
+            self.CellUvLv1=2.8
+            self.CellUvLv2=2.5
+            self.CellVoltDiffLv1=0.3
+            self.CellVoltDiffLv2=0.5
+            self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
+            self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
+            self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
+            self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
+
+            self.PackChgOc=-40
+            self.PackDisOc=200
+
+            self.LeakCurrentLv1=10
+            self.LeakCurrentLv2=20
+            self.LeakCurrentLv3=50
+
+        elif celltype==2: #4840
+            self.Capacity = 41
+            self.PackFullChrgVolt=69.99
+            self.CellFullChrgVolt=4.2
+            self.CellFullChrgCrnt=-15
+            self.CellVoltNums=14
+            self.CellTempNums=3
+            self.OtherTempNums=4
+            self.FullChrgSoc=98
+            self.PackCrntDec=1
+            self.BalCurrent=0.015
+            self.LookTab_SOC = [0,	    3.5348,	8.3581,	13.181,	18.004,	22.827,	27.651,	32.474,	37.297,	42.120,	46.944,	51.767,	56.590,	61.413,	66.237,	71.060,	75.883,	80.707,	85.530,	90.353,	95.176,	100,   105]
+            self.LookTab_OCV = [3.3159,	3.4384,	3.4774,	3.5156,	3.5478,	3.5748,	3.6058,	3.6238,	3.638,	3.6535,	3.6715,	3.6951,	3.7279,	3.7757,	3.8126,	3.8529,	3.8969,	3.9446,	3.9946,	4.0491,	4.109,	4.183, 4.263]
+
+            self.CellOvLv1=4.3
+            self.CellOvLv2=4.35
+            self.CellUvLv1=2.8
+            self.CellUvLv2=2.5
+            self.CellVoltDiffLv1=0.3
+            self.CellVoltDiffLv2=0.5
+            self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
+            self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
+            self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
+            self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
+
+            self.PackChgOc=-40
+            self.PackDisOc=200
+
+            self.LeakCurrentLv1=10
+            self.LeakCurrentLv2=20
+            self.LeakCurrentLv3=50
+
+        elif celltype==3:   #力信50ah三元电芯
+            self.Capacity = 51
+            self.PackFullChrgVolt=80
+            self.CellFullChrgVolt=4.2
+            self.CellFullChrgCrnt=-15
+            self.CellVoltNums=20
+            self.CellTempNums=3
+            self.OtherTempNums=4
+            self.FullChrgSoc=98
+            self.PackCrntDec=1
+            self.BalCurrent=0.015
+            self.LookTab_SOC = [0,	    5,	    10,	    15,	    20,	    25,	    30,	    35,	    40,	    45,	    50,	    55,	    60,	    65,	    70,	    75,	    80,	    85,	    90,	    95,	    100,   105]
+            self.LookTab_OCV = [3.357, 	3.455, 	3.493, 	3.540, 	3.577, 	3.605, 	3.622, 	3.638, 	3.655, 	3.677, 	3.707, 	3.757, 	3.815, 	3.866, 	3.920, 	3.976, 	4.036, 	4.099, 	4.166, 	4.237, 	4.325, 4.415]
+
+            self.CellOvLv1=4.3
+            self.CellOvLv2=4.35
+            self.CellUvLv1=2.8
+            self.CellUvLv2=2.5
+            self.CellVoltDiffLv1=0.3
+            self.CellVoltDiffLv2=0.5
+            self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
+            self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
+            self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
+            self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
+
+            self.PackChgOc=-40
+            self.PackDisOc=200
+
+            self.LeakCurrentLv1=10
+            self.LeakCurrentLv2=20
+            self.LeakCurrentLv3=50
+
+        elif celltype==4:   #CATL 50ah三元电芯
+            self.Capacity = 50
+            self.PackFullChrgVolt=80
+            self.CellFullChrgVolt=4.2
+            self.CellFullChrgCrnt=-15
+            self.CellVoltNums=20
+            self.CellTempNums=2
+            self.OtherTempNums=0
+            self.FullChrgSoc=98
+            self.PeakSoc=57
+            self.PackCrntDec=-1
+            self.BalCurrent=0.015
+            self.LookTab_SOC = [0,	    5,	    10,	    15,	    20,	    25,	    30,	    35,	    40,	    45,	    50,	    55,	    60,	    65,	    70,	    75,	    80,	    85,	    90,	    95,	    100,   105]
+            self.LookTab_OCV = [3.152, 	3.397, 	3.438, 	3.481, 	3.523, 	3.560, 	3.586, 	3.604, 	3.620, 	3.638, 	3.661, 	3.693, 	3.748, 	3.803, 	3.853, 	3.903, 	3.953, 	4.006, 	4.063, 	4.121, 	4.183, 4.253]
+
+            self.CellOvLv1=4.3
+            self.CellOvLv2=4.35
+            self.CellUvLv1=2.8
+            self.CellUvLv2=2.5
+            self.CellVoltDiffLv1=0.3
+            self.CellVoltDiffLv2=0.5
+            self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
+            self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
+            self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
+            self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
+
+            self.PackChgOc=-40
+            self.PackDisOc=200
+
+            self.LeakCurrentLv1=10
+            self.LeakCurrentLv2=20
+            self.LeakCurrentLv3=50
+
+        elif celltype==99:   #60ah磷酸铁锂电芯
+            self.Capacity = 54
+            self.PackFullChrgVolt=69.99
+            self.CellFullChrgVolt=3.5
+            self.CellFullChrgCrnt=-20
+            self.OcvInflexionBelow=3.281
+            self.OcvInflexion2=3.296
+            self.OcvInflexion3=3.328
+            self.OcvInflexionAbove=3.4
+            self.SocInflexion1=30
+            self.SocInflexion2=60
+            self.SocInflexion3=70
+            self.CellVoltNums=20
+            self.CellTempNums=4
+            self.OtherTempNums=5
+            self.FullChrgSoc=98
+            self.PeakSoc=59
+            self.PeakVoltLowLmt=3.35
+            self.PeakVoltUpLmt=3.4
+            self.PeakCellVolt=[3.362,3.363,3.365,3.366,3.367]
+            self.PackCrntDec=1
+            self.BalCurrent=0.015
+            self.LookTab_SOC = [0.00, 	2.40, 	6.38, 	10.37, 	14.35, 	18.33, 	22.32, 	26.30, 	30.28, 	35.26, 	40.24, 	45.22, 	50.20, 	54.19, 	58.17, 	60.16, 	65.14, 	70.12, 	75.10, 	80.08, 	84.06, 	88.05, 	92.03, 	96.02, 	100.00]
+            self.LookTab_OCV = [2.7151,	3.0298,	3.1935,	3.2009,	3.2167,	3.2393,	3.2561,	3.2703,	3.2843,	3.2871,	3.2874,	3.2868,	3.2896,	3.2917,	3.2967,	3.3128,	3.3283,	3.3286,	3.3287,	3.3288,	3.3289,	3.3296,	3.3302,	3.3314,	3.3429]
+
+            self.CellOvLv1=3.68
+            self.CellOvLv2=3.7
+            self.CellUvLv1=2.1
+            self.CellUvLv2=2
+            self.CellVoltDiffLv1=0.6
+            self.CellVoltDiffLv2=1
+            self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
+            self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
+            self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
+            self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
+
+            self.PackChgOc=-40
+            self.PackDisOc=200
+
+            self.LeakCurrentLv1=20
+            self.LeakCurrentLv2=50
+            self.LeakCurrentLv3=100
+        else:
+            print('未找到对应电池编号!!!')
+            # sys.exit()
+

+ 164 - 0
LIB/MIDDLE/SaftyCenter/Liplated/Li_plated.py

@@ -0,0 +1,164 @@
+import pandas as pd
+import numpy as np
+import datetime
+import matplotlib as plt
+from scipy.signal import savgol_filter
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import BatParam
+
+class Liplated_test:
+    def __init__(self,sn,celltype,df_bms):  #参数初始化
+
+        self.sn=sn
+        self.celltype=celltype
+        self.param=BatParam.BatParam(celltype)
+        self.df_bms=pd.DataFrame(df_bms)
+        self.packcrnt=df_bms['总电流[A]']*self.param.PackCrntDec
+        self.packvolt=df_bms['总电压[V]']
+        self.bms_soc=df_bms['SOC[%]']
+        self.bmstime= pd.to_datetime(df_bms['时间戳'], format='%Y-%m-%d %H:%M:%S')
+
+        self.cellvolt_name=['单体电压'+str(x) for x in range(1,self.param.CellVoltNums+1)]
+        self.celltemp_name=['单体温度'+str(x) for x in range(1,self.param.CellTempNums+1)]
+        self.bmssta = df_bms['充电状态']
+    #定义加权滤波函数..................................................................................................
+    def moving_average(interval, windowsize):
+        window = np.ones(int(windowsize)) / float(windowsize)
+        re = np.convolve(interval, window, 'same')
+        return re
+#.............................................析锂检测............................................................................
+    def liplated_detect(self):
+        #----------------------------------------筛选充电后静置数据------------------------------------------------------------
+        chrgr_rest_data_temp = self.df_bms.loc[((self.df_bms['充电状态'] == 0) & (self.df_bms['SOC[%]'] > 98) & (self.df_bms['总电流[A]'] == 0)) | 
+                                               ((self.df_bms['充电状态'] == 2) & (self.df_bms['SOC[%]'] > 98) & (self.df_bms['总电流[A]'] == 0))]#接近慢充后静置数据
+        df_lipltd_result = pd.DataFrame(columns=['sn','time','liplated','liplated_amount'])
+        if not chrgr_rest_data_temp.empty:
+            chrgr_rest_data = chrgr_rest_data_temp.reset_index(drop=True)
+            temp_rest_time = chrgr_rest_data['时间戳']
+            rest_time = pd.to_datetime(temp_rest_time)
+            delta_time = (np.diff(rest_time)/pd.Timedelta(1, 'min'))#计算时间差的分钟数
+            pos = np.where(delta_time > 30)#静置数据分段,大于30min时,认为是两个静置过程
+            splice_num = []
+            if len(pos[0]) >= 1:
+                pos_ful_tem = np.insert(pos, 0, 0)
+                pos_len = len(pos_ful_tem)
+                data_len = len(rest_time)
+                pos_ful = np.insert(pos_ful_tem, pos_len, data_len-1)
+                for item in range(0,len(pos_ful)-1):
+                    splice_num.extend(item*np.ones(pos_ful[item +1]-pos_ful[item]))
+                splice_num = np.insert(splice_num, 0, 0)
+            else:
+                splice_num = np.zeros(len(temp_rest_time))
+                pos_ful = np.array([0])
+            chrgr_rest_data['chrgr_rest'] = splice_num
+            #---------------------------判断数据点数大于30的数据段,对电压微分并画图--------------------------------------------
+            cellvolt_list = self.cellvolt_name
+            chrgr_rest_check_data = chrgr_rest_data.drop(['GSM信号','故障等级','故障代码','绝缘电阻','总电流[A]','总电压[V]','充电状态','单体压差','SOC[%]'],axis=1,inplace=False)
+            chrgr_rest_check_data.fillna(value=0)
+            df_rest_volt_diffdt = pd.DataFrame()
+            df_rest_volt_smooth = pd.DataFrame()
+            k = 0
+            for j in range(0,len(pos_ful)-1):#len(pos_ful)-1#有几段充电后静置数据
+                df_test_rest_data = chrgr_rest_check_data.loc[chrgr_rest_check_data['chrgr_rest'] == j]
+                df_rest_volt_smooth = pd.DataFrame()
+                df_test_rest_time = pd.to_datetime(df_test_rest_data['时间戳'],format='%Y-%m-%d %H:%M:%S')
+                df_test_rest_time = df_test_rest_time.reset_index(drop=True)
+                df_data_length = len(df_test_rest_time)
+                if (df_data_length > 30) & ((df_test_rest_time[df_data_length - 1] - df_test_rest_time[0])/pd.Timedelta(1, 'min') > 40):#静置时间大于40min
+                    df_test_rest_time_dif_temp = np.diff(df_test_rest_time)/pd.Timedelta(1, 'min')
+                    num_list = []
+                    data_jump_pos = np.where(df_test_rest_time_dif_temp > 3)
+                    if len(data_jump_pos[0]) > 0:
+                        if data_jump_pos[0][0] > 100:
+                            for i in range(0,data_jump_pos[0][0],15):##采样密集时每隔10行取数据
+                                num_list.append(i)
+                            df_rest_data_temp = df_test_rest_data.iloc[num_list]
+                            df_test_rest_data_choose = pd.DataFrame(df_rest_data_temp)
+                            df_test_rest_data_choose_else = df_test_rest_data.iloc[data_jump_pos[0][0]+1:len(df_test_rest_data)-1]
+                            df_rest_data_recon_temp = df_test_rest_data_choose.append(df_test_rest_data_choose_else)
+                            df_rest_data_recon =df_rest_data_recon_temp.reset_index(drop=True)
+                        else:
+                            df_rest_data_recon = df_test_rest_data
+                    else:
+                        df_rest_data_recon = df_test_rest_data
+                    df_rest_time = pd.to_datetime(df_rest_data_recon['时间戳'],format='%Y-%m-%d %H:%M:%S')
+                    df_rest_time = df_rest_time.reset_index(drop=True)
+                    df_rest_time_dif_temp = np.diff(df_rest_time)/pd.Timedelta(1, 'min')
+                    df_rest_volt = df_rest_data_recon[cellvolt_list]
+                    for item in cellvolt_list:
+                        window_temp = int(len(df_rest_volt[item])/3)
+                        if window_temp%2:#滤波函数的窗口长度需为奇数
+                            window = window_temp
+                        else:
+                            window = window_temp - 1
+                        step = min(int(window/3),5)
+                        df_volt_smooth = savgol_filter(df_rest_volt[item],window,step)
+                        df_rest_volt_smooth[item] = df_volt_smooth
+                    df_test_rest_volt_diff_temp = np.diff(df_rest_volt_smooth,axis=0)
+                    df_test_rest_time_dif = pd.DataFrame(df_rest_time_dif_temp)
+                    df_test_rest_volt_diff = pd.DataFrame(df_test_rest_volt_diff_temp)
+                    df_test_rest_volt_diffdt_temp = np.divide(df_test_rest_volt_diff,df_test_rest_time_dif)
+                    df_test_rest_volt_diffdt = pd.DataFrame(df_test_rest_volt_diffdt_temp)
+                    df_test_rest_volt_diffdt = df_test_rest_volt_diffdt.append(df_test_rest_volt_diffdt.iloc[len(df_test_rest_volt_diffdt)-1])
+                    df_test_rest_volt_diffdt.columns = cellvolt_list
+                    if len(df_test_rest_volt_diffdt) > 25:
+                        for item in cellvolt_list:
+                            df_volt_diffdt_smooth = savgol_filter(df_test_rest_volt_diffdt[item],13,3)
+                            df_test_rest_volt_diffdt[item] = df_volt_diffdt_smooth
+                        df_test_rest_volt_diffdt['chrgr_rest'] = k
+                        df_test_rest_volt_diffdt['时间戳'] = list(df_rest_time)
+                        k = k+1
+                        df_rest_volt_diffdt = df_rest_volt_diffdt.append(df_test_rest_volt_diffdt)
+                        df_rest_volt_diffdt.reset_index()
+            #--------------------------------------------------------确认是否析锂----------------------------------------------------------------------------
+            # df_lipltd_data = pd.DataFrame(columns=['sn','date','liplated'])
+            for item in range(0,k):
+                lipltd_confirm = []
+                lipltd_amount = []
+                df_check_liplated_temp = df_rest_volt_diffdt.loc[df_rest_volt_diffdt['chrgr_rest'] == item].reset_index(drop = True)
+                df_lipltd_volt_temp = df_check_liplated_temp[cellvolt_list]
+                df_lipltd_volt_len = len(df_lipltd_volt_temp)
+                df_data_temp_add = df_lipltd_volt_temp.iloc[df_lipltd_volt_len-4:df_lipltd_volt_len-1]
+                df_lipltd_volt_temp_add = df_lipltd_volt_temp.append(df_data_temp_add)
+                df_lipltd_volt_temp_dif = np.diff(df_lipltd_volt_temp_add,axis=0)#电压一次微分,计算dv/dt
+                df_lipltd_volt_temp_dif = pd.DataFrame(df_lipltd_volt_temp_dif)
+                df_lipltd_volt_temp_dif.columns = cellvolt_list
+                df_lipltd_volt_temp_difdif = np.diff(df_lipltd_volt_temp_dif,axis=0)#电压二次微分,判断升降
+                df_lipltd_volt_temp_difdif = pd.DataFrame(df_lipltd_volt_temp_difdif)
+                df_lipltd_volt_temp_difdif.columns = cellvolt_list
+                df_lipltd_volt_temp_difdif_temp = df_lipltd_volt_temp_difdif
+                df_lipltd_volt_temp_difdif_temp[df_lipltd_volt_temp_difdif_temp >= 0] = 1
+                df_lipltd_volt_temp_difdif_temp[df_lipltd_volt_temp_difdif_temp < 0] = -1
+                df_lipltd_volt_temp_difdifdif = np.diff(df_lipltd_volt_temp_difdif_temp,axis=0)#三次微分,利用-2,2判断波分和波谷
+                df_lipltd_volt_difdifdif = pd.DataFrame(df_lipltd_volt_temp_difdifdif)
+                df_lipltd_volt_difdifdif.columns = cellvolt_list
+                df_lipltd_volt_difdifdif['chrgr_rest'] = k
+                df_lipltd_volt_difdifdif['时间戳'] = list(df_check_liplated_temp['时间戳'])
+                df_lipltd_volt_difdifdif = df_lipltd_volt_difdifdif.reset_index(drop = True)
+                df_lipltd_data_temp = df_lipltd_volt_difdifdif.loc[df_lipltd_volt_difdifdif['时间戳'] < (df_check_liplated_temp['时间戳'][0] + datetime.timedelta(minutes=90))]
+                for cell_name in cellvolt_list:#对每个电芯判断
+                    df_check_plated_data = df_lipltd_data_temp[cell_name]
+                    peak_pos = np.where(df_check_plated_data == -2)
+                    bot_pos = np.where(df_check_plated_data == 2)
+                    if len(peak_pos[0]) & len(bot_pos[0]):
+                        if (peak_pos[0][0] > bot_pos[0][0]) & (df_lipltd_volt_temp_dif[cell_name][peak_pos[0][0] + 1] < 0):
+                            lipltd_confirm.append(1)#1为析锂,0为非析锂
+                            lipltd_amount.append((df_check_liplated_temp['时间戳'][bot_pos[0][0] + 2] - df_check_liplated_temp['时间戳'][0])/pd.Timedelta(1, 'min'))
+                        else:
+                            lipltd_confirm.append(0)
+                            lipltd_amount.append(0)
+                    else:
+                        lipltd_confirm.append(0)
+                        lipltd_amount.append(0)
+                if any(lipltd_confirm) & (max(lipltd_amount) > 5):
+                    df_lipltd_confir_temp = pd.DataFrame({"sn":[self.sn], "time":[df_check_liplated_temp['时间戳'][0]], "liplated":[str(lipltd_confirm)], "liplated_amount":[str(lipltd_amount)]})
+                    df_lipltd_result = df_lipltd_result.append(df_lipltd_confir_temp)
+                    df_lipltd_result = df_lipltd_result.reset_index(drop = True)
+                    df_lipltd_result.sort_values(by = ['time'], axis = 0, ascending=True,inplace=True)#对故障信息按照时间进行排序
+        # df_lipltd_data.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\liplated\算法开发_检测\滤波后图片\析锂.csv',index=False,encoding='GB18030')
+        #返回诊断结果...........................................................................................................
+        if not df_lipltd_result.empty:
+            return df_lipltd_result
+        else:
+            return pd.DataFrame()
+
+

+ 94 - 0
LIB/MIDDLE/SaftyCenter/Liplated/main.py

@@ -0,0 +1,94 @@
+import datetime
+import pandas as pd
+from LIB.BACKEND import DBManager, Log
+import time, datetime
+from apscheduler.schedulers.blocking import BlockingScheduler
+import log
+from pandas.core.frame import DataFrame
+import Li_plated
+
+#...................................电池包电芯安全诊断函数......................................................................................................................
+def cell_platd_test():
+    global SNnums
+    global df_Diag_lipltd
+    start=time.time()
+    now_time=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
+    now_time=datetime.datetime.strptime(now_time,'%Y-%m-%d %H:%M:%S')
+    start_time=now_time-datetime.timedelta(days=3)
+    end_time=str(now_time)
+    start_time=str(start_time)
+    for sn in SNnums:
+        if 'PK500' in sn:
+            celltype=1 #6040三元电芯
+        elif 'PK502' in sn:
+            celltype=2 #4840三元电芯
+        elif 'K504B' in sn:
+            celltype=99    #60ah林磷酸铁锂电芯
+        elif 'MGMLXN750' in sn:
+            celltype=3 #力信50ah三元电芯
+        elif 'MGMCLN750' or 'UD' in sn: 
+            celltype=4 #CATL 50ah三元电芯
+        else:
+            print('SN:{},未找到对应电池类型!!!'.format(sn))
+            continue
+            # sys.exit()
+        #读取原始数据库数据........................................................................................................................................................
+        start_time = '2021-11-15 12:00:00'
+        end_time = '2021-11-18 12:00:00'
+        dbManager = DBManager.DBManager()
+        df_data = dbManager.get_data(sn=sn, start_time=start_time, end_time=end_time, data_groups=['bms'])
+        df_bms = df_data['bms']
+        df_Diag_lipltd_add = pd.DataFrame(columns = ['sn','time','liplated', 'liplated_amount'])
+
+        #析锂诊断................................................................................................................................................................
+        if not df_bms.empty:
+            Diag_lipltd_temp = Li_plated.Liplated_test(sn,celltype,df_bms)#析锂检测
+            df_Diag_lipltd_add = Diag_lipltd_temp.liplated_detect()        
+        if not df_Diag_lipltd_add.empty:
+            df_Diag_lipltd_temp = df_Diag_lipltd.append(df_Diag_lipltd_add)
+            df_Diag_lipltd = df_Diag_lipltd_temp.drop_duplicates(subset = ['sn','time'], keep = 'first', inplace = False)
+            df_Diag_lipltd.sort_values(by = ['sn'], axis = 0, ascending=True,inplace=True)#对故障信息按照时间进行排序
+            df_Diag_lipltd.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\格林美-力信7255\SNnums_6040_liplated_sn.csv',index=False,encoding='GB18030')
+        end=time.time()
+        print(end-start)
+
+#...............................................主函数.......................................................................................................................
+if __name__ == "__main__":
+    global SNnums
+    global df_Diag_lipltd
+    
+    excelpath=r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\04故障诊断\01Screen_Problem\sn-20210903.xlsx'
+    SNdata_6060 = pd.read_excel(excelpath, sheet_name='科易6060')
+    SNdata_6040 = pd.read_excel(excelpath, sheet_name='科易6040')
+    SNdata_4840 = pd.read_excel(excelpath, sheet_name='科易4840')
+    SNdata_L7255 = pd.read_excel(excelpath, sheet_name='格林美-力信7255')
+    SNdata_C7255 = pd.read_excel(excelpath, sheet_name='格林美-CATL7255')
+    SNdata_U7255 = pd.read_excel(excelpath, sheet_name='优旦7255')
+    SNnums_6060=SNdata_6060['SN号'].tolist()
+    SNnums_6040=SNdata_6040['SN号'].tolist()
+    SNnums_4840=SNdata_4840['SN号'].tolist()
+    SNnums_L7255=SNdata_L7255['SN号'].tolist()
+    SNnums_C7255=SNdata_C7255['SN号'].tolist()
+    SNnums_U7255=SNdata_U7255['SN号'].tolist()
+    #SNnums=SNnums_L7255 + SNnums_C7255 + SNnums_6040 + SNnums_4840 + SNnums_U7255+ SNnums_6060
+    # SNnums=['MGMCLN750N215I005','PK504B10100004341','PK504B00100004172','MGMLXN750N2189014']
+    SNnums = SNnums_6040 #SNnums_C7255 #SNnums_6040['MGMCLN750N215N049'] 
+    # SNnums = pd.read_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\liplated\疑似析锂电池sn.csv',encoding='GB18030')
+    
+    mylog=log.Mylog('log_diag.txt','error')
+    mylog.logcfg()
+    #............................模块运行前,先读取数据库中所有结束时间为0的数据,需要从数据库中读取................
+    df_Diag_lipltd=pd.read_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\格林美-力信7255\析锂.csv',encoding='GB18030')
+
+    print('----------------输入--------')
+    print('-------计算中-----------')
+    #定时任务.......................................................................................................................................................................
+    scheduler = BlockingScheduler()
+    scheduler.add_job(cell_platd_test, 'interval', seconds=10, id='diag_job')
+
+    try:  
+        scheduler.start()
+    except Exception as e:
+        scheduler.shutdown()
+        print(repr(e))
+        mylog.logopt(e)

BIN
LIB/MIDDLE/SaftyCenter/Liplated/析锂.xlsx


+ 35 - 0
LIB/MIDDLE/SaftyCenter/Low_Soc_Alarm/low_soc_alarm.py

@@ -0,0 +1,35 @@
+import numpy as np
+import pandas as pd
+from pandas.core.frame import DataFrame
+from LIB.MIDDLE.SaftyCenter.Common import QX_BatteryParam
+from LIB.BACKEND import DBManager
+import datetime,time
+
+class Low_soc_alarm():
+    def low_soc_alarm(param,df_bms,low_soc_bat_list,sn,df_OprtnSta):
+        if len(df_bms) and df_OprtnSta.loc[0,'status'] !=3:#0禁用 1正常 2故障 3返修 4 损毁 5丢失已赔偿,6丢失未赔偿:
+            VoltageNum=['单体电压'+str(i) for i in range(1,param.CellVoltNums+1)]
+            df_bms[VoltageNum]=df_bms[VoltageNum]/1000
+            CellVol=df_bms[VoltageNum]
+            PackCrnt=df_bms['总电流[A]']
+            ZeroCrntCount=len(df_bms[abs(df_bms['总电流[A]'])<=1])
+            CrntCount=len(PackCrnt)-ZeroCrntCount
+            if CrntCount>0:
+                ZeroCrntRate=(ZeroCrntCount/len(PackCrnt))*100
+            else:
+                ZeroCrntRate=100
+            if ZeroCrntRate>99.85:#静置比大于99.85%
+                ZeroSoc_Volt=np.interp(0,param.LookTab_SOC,param.LookTab_OCV)
+                FiveSoc_Volt=np.interp(10,param.LookTab_SOC,param.LookTab_OCV)
+                CellVolMean=DataFrame()
+                CellVolMean=CellVol.mean()
+                CellVolMin_Index=CellVolMean.idxmin()
+                print(ZeroSoc_Volt)
+                CellLowVolZERO=df_bms[df_bms[CellVolMin_Index] < ZeroSoc_Volt]
+                CellLowVolFive=df_bms[df_bms[CellVolMin_Index] > FiveSoc_Volt]
+                CellLowVolZeroCrnt=CellLowVolZERO[abs(CellLowVolZERO['总电流[A]'])<1]
+                CellLowVolFiveCrnt=CellLowVolFive[abs(CellLowVolFive['总电流[A]'])<1]
+                if len(CellLowVolZeroCrnt)>3 and len(CellLowVolFiveCrnt)<3:
+                    CellLowVolZeroCrnt=CellLowVolZeroCrnt.reset_index(drop=True)
+                    low_soc_bat_list.loc[len(low_soc_bat_list)]=[sn,CellLowVolZeroCrnt.loc[len(CellLowVolZeroCrnt)-1,'时间戳'],3]
+        return low_soc_bat_list

+ 86 - 0
LIB/MIDDLE/SaftyCenter/Low_Soc_Alarm/main.py

@@ -0,0 +1,86 @@
+import datetime
+import pandas as pd
+from LIB.BACKEND import DBManager, Log
+from sqlalchemy import create_engine
+import time, datetime
+from apscheduler.schedulers.blocking import BlockingScheduler
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import DBDownload as DBDownload
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import log
+from pandas.core.frame import DataFrame
+import datacompy
+from LIB.MIDDLE.SaftyCenter.Common import QX_BatteryParam
+from LIB.MIDDLE.SaftyCenter.Common import DBDownload as DBDw
+from low_soc_alarm import Low_soc_alarm
+def Low_Soc_Alarm():
+    end_time=datetime.datetime.now()
+    start_time=end_time-datetime.timedelta(days=1)
+    start_time=start_time.strftime('%Y-%m-%d %H:%M:%S')
+    end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
+    #-------------------------读取数据-------------------------------------------------------------------
+    excelpath=r'D:\ZLWORK\code\data_analyze_platform\USER\eric\SaftyCenter_CODE_V1\sn-20210903.xlsx'
+    SNdata_6060 = pd.read_excel(excelpath, sheet_name='科易6060')
+    SNdata_6040 = pd.read_excel(excelpath, sheet_name='科易6040')
+    SNdata_4840 = pd.read_excel(excelpath, sheet_name='科易4840')
+    SNdata_L7255 = pd.read_excel(excelpath, sheet_name='格林美-力信7255')
+    SNdata_C7255 = pd.read_excel(excelpath, sheet_name='格林美-CATL7255')
+    SNdata_U7255 = pd.read_excel(excelpath, sheet_name='优旦7255')
+    SNnums_6060=SNdata_6060['SN号'].tolist()
+    SNnums_6040=SNdata_6040['SN号'].tolist()
+    SNnums_4840=SNdata_4840['SN号'].tolist()
+    SNnums_L7255=SNdata_L7255['SN号'].tolist()
+    SNnums_C7255=SNdata_C7255['SN号'].tolist()
+    SNnums_U7255=SNdata_U7255['SN号'].tolist()
+    SNnums=SNnums_L7255 + SNnums_C7255 + SNnums_6040 + SNnums_4840 + SNnums_U7255+ SNnums_6060
+    #SNnums=['MGMCLN750N215I009']
+    #-------------------------执行循环----------------------------------------------------------------------
+    low_soc_bat_list=DataFrame(columns=['sn','time','level'])
+    for sn in SNnums:#SN遍历
+        print(sn)
+        if 'PK500' in sn:
+            celltype=1 #6040三元电芯
+        elif 'PK502' in sn:
+            celltype=2 #4840三元电芯
+        elif 'K504B' in sn:
+            celltype=99    #60ah林磷酸铁锂电芯
+        elif 'MGMLXN750' in sn:
+            celltype=3 #力信50ah三元电芯
+        elif 'MGMCLN750' or 'UD' in sn: 
+            celltype=4 #CATL 50ah三元电芯
+        else:
+            print('SN:{},未找到对应电池类型!!!'.format(sn))
+            continue
+            # sys.exit()
+        param=QX_BatteryParam.BatteryInfo(celltype)   
+        #读取原始数据库数据.....................................................................................
+        dbManager = DBManager.DBManager()
+        df_data = dbManager.get_data(sn=sn, start_time=start_time, end_time=end_time, data_groups=['bms'])
+        df_bms = df_data['bms']
+        #读取电池当前运营状态.....................................................................................................................................................
+        host='rm-bp10j10qy42bzy0q7.mysql.rds.aliyuncs.com'
+        port=3306
+        db='qixiang_manage'
+        user='qx_query'
+        password='@Qx_query'
+        mode=4
+        tablename1='py_battery'     
+        DBRead=DBDw.DBDownload(host, port, db, user, password,mode)
+        with DBRead as DBRead:
+            df_OprtnSta=DBRead.getdata('qrcode','status', tablename=tablename1, sn=sn, timename='', st='', sp='',factory='')#取最后一条运营状态
+        
+        
+        
+        #执行主程序-------------------------------------------------------------------------------------------
+        low_soc_bat_list=Low_soc_alarm.low_soc_alarm(param,df_bms,low_soc_bat_list,sn,df_OprtnSta)
+
+
+    return low_soc_bat_list
+mylog=log.Mylog('log_diag.txt','error')
+mylog.logcfg()
+
+
+try:  
+    low_soc_bat_list=Low_Soc_Alarm()
+    low_soc_bat_list.to_excel('low_soc_bat_list.xlsx')
+except Exception as e:
+    print(repr(e))
+    mylog.logopt(e)

+ 28 - 0
LIB/MIDDLE/SaftyCenter/StatusSta/V1_0_0/status_sta.py

@@ -0,0 +1,28 @@
+# 获取数据
+import pandas as pd
+from LIB.BACKEND import DataPreProcess
+
+
+def status_sta(df_bms, df_gps, start_time, charge_count, drive_count, stand_count):
+    dataPrePro = DataPreProcess.DataPreProcess()
+    if not df_bms.empty:
+    # 时间完全相同的数据仅保留一行
+        df_bms_pro, df_gps_pro = dataPrePro.time_filter(df_bms, df_gps)
+
+        # bms数据按照电流和状态分段, 然后在状态分段内部,根据时间跳变继续分段(解决段内数据丢失)
+
+        df_bms_pro = dataPrePro.data_split_by_status(df_bms_pro)
+        df_bms_pro = dataPrePro.data_split_by_time(df_bms_pro)
+
+        if 'charge' in df_bms_pro['data_status'].tolist():
+            charge_count = charge_count + 1
+        elif 'drive' in df_bms_pro['data_status'].tolist():
+            drive_count = drive_count + 1
+        else:
+            stand_count = stand_count + 1
+    else:
+        stand_count = stand_count + 1
+
+    return charge_count, drive_count, stand_count
+    
+    

+ 952 - 0
LIB/MIDDLE/SaftyCenter/StatusSta/main.ipynb

@@ -0,0 +1,952 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "### start to get data PK504B10100004341 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 8, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004342 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004344 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004345 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 204, gps_count is 88, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004346 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004347 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 4, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004349 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 7, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004350 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 2, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004351 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004352 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 328, gps_count is 163, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004353 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004354 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004355 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 188, gps_count is 93, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004356 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004357 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 60, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004358 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004359 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 45, gps_count is 12, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004360 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 2, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004361 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 182, gps_count is 89, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004362 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004363 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 339, gps_count is 166, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004364 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 130, gps_count is 62, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004365 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004366 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 323, gps_count is 158, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004367 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004368 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004369 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004370 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 60, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004371 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004372 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004373 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004374 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004376 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 75, gps_count is 34, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004377 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 77, gps_count is 17, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004378 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004379 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 114, gps_count is 54, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004380 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004381 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 60, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004383 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004384 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004385 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004386 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004387 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 9, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004390 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 4, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004391 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004392 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004393 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 268, gps_count is 134, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004394 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004395 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 166, gps_count is 83, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004396 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 173, gps_count is 85, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004397 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 4, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004398 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004399 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004400 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004401 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004402 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004403 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004404 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 150, gps_count is 70, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004405 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 60, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMLXN750N2189031 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004406 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004407 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004408 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 9, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004409 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 84, gps_count is 40, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004410 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 3, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004411 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004412 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004413 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 7, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004414 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004415 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 14, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004416 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 2, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004417 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 80, gps_count is 40, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004418 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004419 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004420 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 147, gps_count is 61, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMLXN750N218B019 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 120, gps_count is 122, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004421 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 66, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004422 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004423 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 55, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004424 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004425 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 353, gps_count is 77, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004426 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 9, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004427 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004428 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004429 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 139, gps_count is 68, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004430 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004431 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004432 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004433 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 341, gps_count is 167, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004434 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 239, gps_count is 109, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004435 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 2, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004436 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 134, gps_count is 62, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004437 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data K504B10100004438 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004439 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004441 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004442 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004443 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004444 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004445 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004446 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004447 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004448 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004449 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 8, gps_count is 3, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004450 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004451 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 9, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004452 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004453 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 5, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004454 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 8, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004455 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004456 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004457 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 339, gps_count is 169, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004458 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 60, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004459 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 60, gps_count is 19, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004460 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 60, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004461 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 319, gps_count is 40, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004462 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 262, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004463 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 3, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004464 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004465 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 352, gps_count is 176, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004468 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 58, gps_count is 27, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004469 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 52, gps_count is 14, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004470 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004471 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 3, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004472 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004473 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004474 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 63, gps_count is 29, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004475 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 59, gps_count is 29, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004476 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004477 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 4, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004478 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 4, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004479 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004480 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 85, gps_count is 41, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004481 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 53, gps_count is 25, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004482 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004483 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 229, gps_count is 73, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004484 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004485 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004486 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 58, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004487 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004488 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 214, gps_count is 29, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004489 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004490 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 304, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004491 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 4, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004492 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 227, gps_count is 4, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004493 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 4, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004494 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004495 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004496 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 93, gps_count is 47, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004497 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 4, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004498 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 88, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004499 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 60, gps_count is 7, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK504B10100004500 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 323, gps_count is 158, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK505B00100004166 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK50301A000001018 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data PK50301A000001029 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMLXN750N218C011 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 36, gps_count is 32, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMLXN750N2189029 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 361, gps_count is 121, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMLXN750N21AC017 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 111, gps_count is 101, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data UD02030118B4C0001 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 178, gps_count is 178, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data UD02030118B4C0012 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I034 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 75, gps_count is 75, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I035 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 12, gps_count is 12, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I036 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 7, gps_count is 7, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I037 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I038 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMLXN750N21AC029 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 119, gps_count is 119, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I039 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 190, gps_count is 190, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I040 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I041 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 315, gps_count is 315, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I042 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I043 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 7, gps_count is 7, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data UD02030118B4C0013 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 346, gps_count is 346, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I044 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 12, gps_count is 12, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I045 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 173, gps_count is 173, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I046 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I047 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 10, gps_count is 10, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I048 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 360, gps_count is 360, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I049 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 360, gps_count is 360, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I050 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I051 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I052 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 8, gps_count is 8, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I053 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 8, gps_count is 8, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data UD02030118B4C0014 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 239, gps_count is 239, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I054 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 131, gps_count is 131, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I055 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 12, gps_count is 12, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I056 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 360, gps_count is 360, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I057 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 316, gps_count is 316, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I058 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 8, gps_count is 8, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I059 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 361, gps_count is 361, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I060 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I061 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 9, gps_count is 9, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I062 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 12, gps_count is 12, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I063 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data UD02030118B4C0015 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I064 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 171, gps_count is 171, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I065 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 12, gps_count is 12, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I066 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I067 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 6, gps_count is 6, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I068 from 2021-11-07 22:00:00 to 2021-11-07 23:00:00\n",
+      "# get data from 2021-11-07 22:00:00 to 2021-11-07 23:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n"
+     ]
+    }
+   ],
+   "source": [
+    "# 获取数据\n",
+    "import sys\n",
+    "from LIB.BACKEND import DBManager\n",
+    "import pymysql\n",
+    "import time, datetime\n",
+    "import dateutil.relativedelta\n",
+    "import pandas as pd\n",
+    "from LIB.BACKEND import DataPreProcess\n",
+    "import V1_0_0.status_sta as status_sta\n",
+    "dataPrePro = DataPreProcess.DataPreProcess()\n",
+    "\n",
+    "host='rm-bp10j10qy42bzy0q7.mysql.rds.aliyuncs.com'\n",
+    "port=3306\n",
+    "db='qixiang_oss'\n",
+    "user='qixiang_oss'\n",
+    "password='Qixiang2021'\n",
+    "conn = pymysql.connect(host=host, port=port, user=user, password=password, database=db)\n",
+    "cursor = conn.cursor()\n",
+    "cursor.execute(\"select sn, imei, add_time from app_device\")\n",
+    "res = cursor.fetchall()\n",
+    "df_sn = pd.DataFrame(res, columns=['sn', 'imei', 'add_time'])\n",
+    "df_sn = df_sn.reset_index(drop=True)\n",
+    "\n",
+    "now_time = datetime.datetime.now()\n",
+    "pre_time = now_time + dateutil.relativedelta.relativedelta(hours=-1)#上个月时间\n",
+    "end_time=datetime.datetime.strftime(now_time,\"%Y-%m-%d %H:00:00\")\n",
+    "start_time=datetime.datetime.strftime(pre_time,\"%Y-%m-%d %H:00:00\")\n",
+    "\n",
+    "dbManager = DBManager.DBManager()\n",
+    "charge_count = 0\n",
+    "drive_count = 0\n",
+    "stand_count = 0\n",
+    "for sn in df_sn['sn'].tolist()[0:200]:\n",
+    "\n",
+    "    df_data = dbManager.get_data(sn=sn, start_time=start_time, end_time=end_time, data_groups=['bms', 'gps'])\n",
+    "    # \n",
+    "    df_bms = df_data['bms']\n",
+    "    df_gps = df_data['gps']\n",
+    "    charge_count, drive_count, stand_count = status_sta.status_sta(df_bms, df_gps, start_time, charge_count, drive_count, stand_count)\n",
+    "df_result = pd.DataFrame({'factory':['骑享'], 'time':[start_time], 'charge_count':[charge_count], 'drive_count':[drive_count], 'stand_count':stand_count})\n",
+    "\n",
+    "    "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div>\n",
+       "<style scoped>\n",
+       "    .dataframe tbody tr th:only-of-type {\n",
+       "        vertical-align: middle;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe tbody tr th {\n",
+       "        vertical-align: top;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe thead th {\n",
+       "        text-align: right;\n",
+       "    }\n",
+       "</style>\n",
+       "<table border=\"1\" class=\"dataframe\">\n",
+       "  <thead>\n",
+       "    <tr style=\"text-align: right;\">\n",
+       "      <th></th>\n",
+       "      <th>factory</th>\n",
+       "      <th>time</th>\n",
+       "      <th>charge_count</th>\n",
+       "      <th>drive_count</th>\n",
+       "      <th>stand_count</th>\n",
+       "    </tr>\n",
+       "  </thead>\n",
+       "  <tbody>\n",
+       "    <tr>\n",
+       "      <th>0</th>\n",
+       "      <td>骑享</td>\n",
+       "      <td>2021-11-07 22:00:00</td>\n",
+       "      <td>19</td>\n",
+       "      <td>18</td>\n",
+       "      <td>163</td>\n",
+       "    </tr>\n",
+       "  </tbody>\n",
+       "</table>\n",
+       "</div>"
+      ],
+      "text/plain": [
+       "  factory                 time  charge_count  drive_count  stand_count\n",
+       "0      骑享  2021-11-07 22:00:00            19           18          163"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "df_result"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "interpreter": {
+   "hash": "b3ba2566441a7c06988d0923437866b63cedc61552a5af99d1f4fb67d367b25f"
+  },
+  "kernelspec": {
+   "display_name": "Python 3.8.8 64-bit ('base': conda)",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.8.8"
+  },
+  "orig_nbformat": 4
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 84 - 0
LIB/MIDDLE/SaftyCenter/diagfault/SC_SamplingSafty.py

@@ -0,0 +1,84 @@
+import sys
+import numpy as np
+import pandas as pd
+import string
+import os
+from pandas import Series
+from matplotlib import pyplot as plt
+from pandas.core.frame import DataFrame
+from pandas.core.indexes.base import Index
+from pymysql import NULL
+from LIB.BACKEND import DBManager
+import datetime
+import time
+import string
+import re
+
+
+
+class SamplingSafty:
+    def __init__(self):
+        pass
+    def main(sn,param,bms_info,df_Diag_Ram_in):
+        df_Diag_Ram_Update_inside=DataFrame(columns=['start_time', 'end_time', 'product_id', 'code', 'level', 'info','advice'])
+        df_Diag_Ram_Update_inside=df_Diag_Ram_Update_inside.append(df_Diag_Ram_in)
+        global QuitErrCount 
+        VolStarkCount=[0 for i in range(param.CellVoltNums)]
+        VolCount=0
+        QuitErrCount=[0 for i in range(param.FaultCount)]
+        df_Diag_Ram=DataFrame(columns=['start_time', 'end_time', 'product_id', 'code', 'level', 'info','advice'])
+        st_tp=[]
+        #--------------该电池的所有当前故障-------------
+
+        VoltageNum=['单体电压'+str(i) for i in range(1,param.CellVoltNums+1)]#单体电压替换cellvolt_
+        CellVoltage=bms_info[VoltageNum]/1000
+        CellMaxVoltage=CellVoltage.max(axis=1)
+        CellMinVoltage=CellVoltage.min(axis=1)
+        InVMaxBatNo=CellVoltage[CellVoltage>=param.CellOVlmt].dropna(axis=0,how='all',inplace=False)
+        InVMinBatNo=CellVoltage[CellVoltage<=param.CellUVlmt].dropna(axis=0,how='all',inplace=False)
+        #date替换为'时间戳'
+        if len(InVMaxBatNo):
+            indexValue=InVMaxBatNo.index.values
+            df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[indexValue[0],'时间戳'],'0000-00-00 00:00:00',sn,50,3,'单体电压大于{:.2f}V,采样无效'.format(param.CellOVlmt),'建议返厂维修']
+            for i in range(1,len(indexValue)):
+                if indexValue[i]- indexValue[i-1]>10:
+                    df_Diag_Ram.loc[len(df_Diag_Ram)-1,'end_time']=bms_info.loc[indexValue[i-1],'时间戳']
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[indexValue[i],'时间戳'],'0000-00-00 00:00:00',sn,50,3,'单体电压大于{:.2f}V,采样无效'.format(param.CellOVlmt),'建议返厂维修']                         
+        if len(InVMinBatNo):
+            indexValue=InVMinBatNo.index.values
+            df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[indexValue[0],'时间戳'],'0000-00-00 00:00:00',sn,50,3,'电压小于{:.2f}V,采样无效'.format(param.CellUVlmt),'建议返厂维修']
+            for i in range(1,len(indexValue)):
+                if indexValue[i]- indexValue[i-1]>10:
+                    df_Diag_Ram.loc[len(df_Diag_Ram)-1,'end_time']=bms_info.loc[indexValue[i-1],'时间戳']
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[indexValue[i],'时间戳'],'0000-00-00 00:00:00',sn,50,3,'电压小于{:.2f}V,采样无效'.format(param.CellUVlmt),'建议返厂维修']           
+        MedianVol=CellVoltage.median(axis=1).tolist()
+        MediaVolGap=abs(CellVoltage.sub(MedianVol,axis=0))
+        OutlineVol=MediaVolGap[MediaVolGap>=param.AvgVolGap][CellMaxVoltage<param.CellOVlmt][CellMinVoltage>param.CellUVlmt][abs(bms_info['总电流[A]'])<1].dropna(axis=0,how='all',inplace=False)
+        #OutlineVol=OutlineVol[CellMaxVoltage<param.CellOVlmt][CellMinVoltage>param.CellUVlmt].dropna(axis=0,how='all',inplace=False)
+        
+        
+        if len(OutlineVol):
+            indexValue=OutlineVol.index.values
+            df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[indexValue[0],'时间戳'],'0000-00-00 00:00:00',sn,50,3,sn,10,3,'电池电压发生偏移或发生断线','建议返厂维修']
+            for i in range(1,len(indexValue)):
+                if indexValue[i]- indexValue[i-1]>10:
+                    df_Diag_Ram.loc[len(df_Diag_Ram)-1,'end_time']=bms_info.loc[indexValue[i-1],'时间戳']
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[indexValue[i],'时间戳'],'0000-00-00 00:00:00',sn,10,3,'电池电压发生偏移或发生断线','建议返厂维修'] 
+        CellTemp=bms_info['单体温度1']
+        InVMaxTempBatNo=CellTemp[CellTemp>=param.PackOTlmt].dropna(axis=0,how='all',inplace=False)
+        InVMinTempBatNo=CellTemp[CellTemp<=param.PackUTlmt].dropna(axis=0,how='all',inplace=False)
+        if len(InVMaxTempBatNo):
+            indexValue=InVMaxTempBatNo.index.values
+            df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[indexValue[0],'时间戳'],'0000-00-00 00:00:00',sn,50,3,'电池温度大于{:.0f}摄氏度,采样无效'.format(param.PackOTlmt),'请立即确认状态']
+            for i in range(1,len(indexValue)):
+                if indexValue[i]- indexValue[i-1]>10:
+                    df_Diag_Ram.loc[len(df_Diag_Ram)-1,'end_time']=bms_info.loc[indexValue[i-1],'时间戳']
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[indexValue[i],'时间戳'],'0000-00-00 00:00:00',sn,50,3,'电池温度大于{:.0f}摄氏度,采样无效'.format(param.PackOTlmt),'请立即确认状态'] 
+        if len(InVMinTempBatNo):
+            indexValue=InVMinTempBatNo.index.values
+            df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[indexValue[0],'时间戳'],'0000-00-00 00:00:00',sn,50,3,'电池温度小于{:.0f}摄氏度,采样无效'.format(param.PackUTlmt),'建议返厂维修']
+            for i in range(1,len(indexValue)):
+                if indexValue[i]- indexValue[i-1]>10:
+                    df_Diag_Ram.loc[len(df_Diag_Ram)-1,'end_time']=bms_info.loc[indexValue[i-1],'时间戳']
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_info.loc[indexValue[i],'时间戳'],'0000-00-00 00:00:00',sn,50,3,'电池温度小于{:.0f}摄氏度,采样无效'.format(param.PackUTlmt),'建议返厂维修'] 
+        return df_Diag_Ram

+ 171 - 0
LIB/MIDDLE/SaftyCenter/diagfault/main.py

@@ -0,0 +1,171 @@
+import CBMSBatDiag
+from SC_SamplingSafty import SamplingSafty
+import datetime
+import pandas as pd
+from LIB.BACKEND import DBManager, Log
+from sqlalchemy import create_engine
+import time, datetime
+from apscheduler.schedulers.blocking import BlockingScheduler
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import DBDownload as DBDownload
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import log
+from pandas.core.frame import DataFrame
+import datacompy
+from LIB.MIDDLE.SaftyCenter.Common import FeiShuData
+from LIB.MIDDLE.SaftyCenter.Common import QX_BatteryParam
+from LIB.MIDDLE.SaftyCenter.Common import DBDownload as DBDw
+
+#...................................电池包电芯安全诊断函数......................................................................................................................
+def diag_cal():
+    global SNnums
+    global df_Diag_Ram
+  
+    start=time.time()
+    end_time=datetime.datetime.now()
+    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()#运维表格数据
+    df_read_Yunw.rename(columns={'电池编码':'product_id'},inplace=True)
+    df_read_Yunw.rename(columns={'内容描述':'info'},inplace=True)
+    df_read_Yunw.rename(columns={'发生时间':'start_time'},inplace=True)
+    df_read_Yunw.rename(columns={'维修信息':'advice'},inplace=True)
+    for sn in SNnums:
+        print(sn)
+        if 'PK500' in sn:
+            celltype=1 #6040三元电芯
+        elif 'PK502' in sn:
+            celltype=2 #4840三元电芯
+        elif 'K504B' in sn:
+            celltype=99    #60ah林磷酸铁锂电芯
+        elif 'MGMLXN750' in sn:
+            celltype=3 #力信50ah三元电芯
+        elif 'MGMCLN750' or 'UD' in sn: 
+            celltype=4 #CATL 50ah三元电芯
+        else:
+            print('SN:{},未找到对应电池类型!!!'.format(sn))
+            continue
+            # sys.exit()
+        param=QX_BatteryParam.BatteryInfo(celltype)   
+        #读取原始数据库数据........................................................................................................................................................
+        dbManager = DBManager.DBManager()
+        df_data = dbManager.get_data(sn=sn, start_time=start_time, end_time=end_time, data_groups=['bms'])
+        df_bms = df_data['bms']
+
+        #读取结果数据库数据........................................................................................................................................................
+        host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
+        port=3306
+        db='qx_cas'
+        user='qx_read'
+        password='Qx@123456'
+        mode=1
+        tablename1='cellstateestimation_soh'
+        tablename2='cellstateestimation_uniform_socvoltdiff'       
+        #电池诊断................................................................................................................................................................
+        DBRead=DBDownload.DBDownload(host, port, db, user, password,mode)
+        with DBRead as DBRead:
+            df_soh=DBRead.getdata('time_st,sn,soh,cellsoh', tablename=tablename1, sn=sn, timename='time_sp', st=start_time, sp=end_time)
+            df_uniform=DBRead.getdata('time,sn,cellsoc_diff,cellmin_num,cellmax_num', tablename=tablename2, sn=sn, timename='time', st=start_time, sp=end_time)
+
+        #电池诊断................................................................................................................................................................
+        CellFltInfo=DataFrame(columns=['start_time', 'end_time', 'product_id', 'code', 'level', 'info','advice'])
+        df_Diag_Ram = df_Diag_Ram.drop_duplicates(subset=['product_id','code','start_time','Batpos','info'],keep='first')#sn之外的故障
+        df_Diag_Ram_sn = df_Diag_Ram.loc[df_Diag_Ram['product_id']==sn]#历史故障
+        df_Diag_Ram_sn_else = pd.concat([df_Diag_Ram,df_Diag_Ram_sn,df_Diag_Ram_sn]).drop_duplicates(subset=['product_id','code','start_time','Batpos','info'],keep=False)#sn之外的故障
+        CellFltInfo = df_Diag_Ram_sn.drop('Batpos',axis=1)
+        df_Diag_Ram_add = pd.DataFrame()
+        df_Diag_Ram_Update_change = pd.DataFrame()
+        if not df_bms.empty:
+            df_Diag_Batdiag_update_xq=SamplingSafty.main(sn,param,df_bms,CellFltInfo)#学琦计算故障   
+            BatDiag=CBMSBatDiag.BatDiag(sn,celltype,df_bms, df_soh, df_uniform, CellFltInfo)#鹏飞计算
+            df_Diag_Batdiag_update=BatDiag.diag() 
+            df_Diag_Cal_Update_add = pd.concat([df_Diag_Batdiag_update_xq,df_Diag_Batdiag_update])#重新计算的该SN下的故障
+            df_Diag_Cal_Update_temp = df_Diag_Cal_Update_add.drop_duplicates(subset=['product_id','start_time','end_time','code','info'], keep='first', inplace=False, ignore_index=False)#去除相同故障
+            df_Diag_cal_early_unfix = pd.DataFrame()
+            df_Diag_Cal_finish = pd.DataFrame()
+            df_Diag_cal_early_fix = pd.DataFrame()
+            if not df_Diag_Cal_Update_temp.empty:
+                #------------------------------合并两者故障,并将同一sn号下的车辆故障放一起----------------------------------------------
+                df_Diag_Cal_Update = df_Diag_Cal_Update_temp#替换上一行
+                df_Diag_Cal_finish = df_Diag_Cal_Update.loc[df_Diag_Cal_Update['end_time'] != '0000-00-00 00:00:00']
+                df_Diag_Cal_new = df_Diag_Cal_Update.loc[df_Diag_Cal_Update['end_time'] == '0000-00-00 00:00:00']
+                df_Diag_Cal_finish['Batpos'] = 1
+                df_Diag_Cal_new['Batpos'] = 0
+                df_feishu_sta = df_read_Yunw.loc[(df_read_Yunw['product_id'] == sn)]#飞书中该sn车辆状态
+                if df_feishu_sta.empty:#飞书中没有该sn记录故障的新增
+                    df_Diag_cal_early_unfix = df_Diag_Cal_new#如果为新出故障,则直接记录在df_diag_frame中
+                else:
+                    df_Diag_cal_later = df_Diag_Cal_new.loc[pd.to_datetime(df_Diag_Cal_new['start_time']) > max(pd.to_datetime(df_feishu_sta['start_time']))]#故障表中故障时间晚于飞书记录时间的新增
+                    df_Diag_cal_early = pd.concat([df_Diag_Cal_new,df_Diag_cal_later,df_Diag_cal_later]).drop_duplicates(subset=['product_id','code','start_time'],keep=False)#故障表中故障时间早于飞书记录时间
+                    df_feishu_sta_latest = df_feishu_sta.loc[pd.to_datetime(df_feishu_sta['start_time']) == max(pd.to_datetime(df_feishu_sta['start_time']))]#飞书中该SN下的最新故障
+                    df_feishu_diag_unfix = (df_feishu_sta_latest['advice'] == '需正常返仓') | (df_feishu_sta_latest['advice'] == '需紧急返仓')
+                    if any(df_feishu_diag_unfix):
+                        df_Diag_cal_early_unfix = df_Diag_Cal_new
+                    else:
+                        df_Diag_cal_early_fix = df_Diag_cal_early
+                        df_Diag_cal_early_unfix = df_Diag_cal_later
+                if not df_Diag_cal_early_fix.empty:
+                    df_Diag_cal_early_fix['Batpos'] = 1
+            df_Diag_Ram_Update = pd.concat([df_Diag_cal_early_unfix,df_Diag_cal_early_fix,df_Diag_Cal_finish])
+            df_Diag_Ram_Update['start_time'] = pd.to_dateime(df_Diag_Ram_Update['start_time'])
+            df_Diag_Ram_Update.sort_values(by = ['start_time'], axis = 0, ascending=True,inplace=True)#该sn下当次诊断的故障状态
+            df_Diag_Ram_add = pd.concat([df_Diag_Ram_Update,df_Diag_Ram_sn,df_Diag_Ram_sn]).drop_duplicates(subset=['start_time','code'],keep=False)#此次判断中新增故障
+            df_Diag_Ram_Update_old = pd.concat([df_Diag_Ram_Update,df_Diag_Ram_add,df_Diag_Ram_add]).drop_duplicates(subset=['start_time','code'],keep=False)#此次判断中新增故障
+            df_Diag_Ram_Update_change = pd.concat([df_Diag_Ram_Update_old,df_Diag_Ram_sn,df_Diag_Ram_sn]).drop_duplicates(subset=['start_time','code','Batpos'],keep=False)#此次判断中新增故障
+            df_Diag_Ram_sav = df_Diag_Ram_Update.loc[df_Diag_Ram_Update['Batpos'] == 0]
+            df_Diag_Ram = pd.concat([df_Diag_Ram_sn_else,df_Diag_Ram_sav])
+
+        if len(df_Diag_Ram_sav) > 0:#历史及现有故障
+            df_Diag_Ram.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\04故障诊断\01Screen_Problem\result.csv',index=False,encoding='GB18030')
+        if len(df_Diag_Ram_add) > 0:#新增故障
+            df_Diag_Ram_add.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\04故障诊断\01Screen_Problem\result_add.csv',index=False,encoding='GB18030')
+        if len(df_Diag_Ram_Update_change) > 0:#更改故障
+            df_Diag_Ram_Update_change.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\04故障诊断\01Screen_Problem\result_change.csv',index=False,encoding='GB18030')
+        end=time.time()
+        print(end-start)
+
+#...............................................主函数.......................................................................................................................
+if __name__ == "__main__":
+    global SNnums
+    
+    excelpath=r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\04故障诊断\01Screen_Problem\sn-20210903.xlsx'
+    SNdata_6060 = pd.read_excel(excelpath, sheet_name='科易6060')
+    SNdata_6040 = pd.read_excel(excelpath, sheet_name='科易6040')
+    SNdata_4840 = pd.read_excel(excelpath, sheet_name='科易4840')
+    SNdata_L7255 = pd.read_excel(excelpath, sheet_name='格林美-力信7255')
+    SNdata_C7255 = pd.read_excel(excelpath, sheet_name='格林美-CATL7255')
+    SNdata_U7255 = pd.read_excel(excelpath, sheet_name='优旦7255')
+    SNnums_6060=SNdata_6060['SN号'].tolist()
+    SNnums_6040=SNdata_6040['SN号'].tolist()
+    SNnums_4840=SNdata_4840['SN号'].tolist()
+    SNnums_L7255=SNdata_L7255['SN号'].tolist()
+    SNnums_C7255=SNdata_C7255['SN号'].tolist()
+    SNnums_U7255=SNdata_U7255['SN号'].tolist()
+    #SNnums=SNnums_L7255 + SNnums_C7255 + SNnums_6040 + SNnums_4840 + SNnums_U7255+ SNnums_6060
+    # SNnums=['MGMCLN750N215I005','PK504B10100004341','PK504B00100004172','MGMLXN750N2189014']
+    SNnums = ['MGMLXN750N21B5004'] #SNnums_6040
+    
+    mylog=log.Mylog('log_diag.txt','error')
+    mylog.logcfg()
+    #............................模块运行前,先读取数据库中所有结束时间为0的数据,需要从数据库中读取................
+    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='')
+    # result=pd.read_csv(r'D:\Work\Code_write\data_analyze_platform\USER\01Screen_Problem\result.csv',encoding='gbk')
+
+    #定时任务.......................................................................................................................................................................
+    scheduler = BlockingScheduler()
+    scheduler.add_job(diag_cal, 'interval', seconds=300, id='diag_job')
+
+    try:  
+        scheduler.start()
+    except Exception as e:
+        scheduler.shutdown()
+        print(repr(e))
+        mylog.logopt(e)

+ 24 - 0
LIB/MIDDLE/SaftyCenter/log.py

@@ -0,0 +1,24 @@
+import logging
+import traceback
+
+class Mylog:
+
+    def __init__(self,log_name,log_level):
+        self.name=log_name
+        self.level=log_level
+    
+    def logcfg(self):
+        if len(self.level) > 0:
+            if self.level == 'debug':
+                Level=logging.DEBUG
+            elif self.level == 'info':
+                Level=logging.INFO
+            elif self.level == 'warning':
+                Level=logging.WARNING
+            else:
+                Level=logging.ERROR
+        logging.basicConfig(filename=self.name, level=Level,format='%(asctime)s - %(levelname)s - %(message)s')
+
+    def logopt(self,*info):
+        logging.error(info)
+        logging.error(traceback.format_exc())

+ 1947 - 0
LIB/MIDDLE/WinterCharging/V1_0_0/main.ipynb

@@ -0,0 +1,1947 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "source": [
+    "\r\n",
+    "from LIB.BACKEND import DBManager\r\n",
+    "from LIB.MIDDLE.CellStateEstimation.Common import log\r\n",
+    "import datetime\r\n",
+    "import pandas as pd\r\n",
+    "import numpy as np\r\n",
+    "import os   \r\n",
+    "from DataPreProcessMGMC import DataPreProcess\r\n",
+    "\r\n",
+    "#log信息配置\r\n",
+    "mylog=log.Mylog('log.txt','error')\r\n",
+    "mylog.logcfg()\r\n",
+    "\r\n",
+    "dbManager = DBManager.DBManager()\r\n",
+    "dataSOH = pd.read_excel('sn-20210903.xlsx',sheet_name='MGMC')\r\n",
+    "fileNames = dataSOH['sn']\r\n",
+    "fileNames = list(fileNames)\r\n",
+    "\r\n",
+    "data_GMGC=pd.DataFrame()\r\n",
+    "for k in range(len(fileNames)):\r\n",
+    "    try:    \r\n",
+    "        sn = fileNames[k]\r\n",
+    "        df_data = dbManager.get_data(sn=sn, start_time='2021-10-28 00:00:00', end_time='2021-11-04 00:00:00', data_groups=['bms','gps'])\r\n",
+    "        data_bms = df_data['bms']\r\n",
+    "        data_gps = df_data['gps']\r\n",
+    "        df_merge=pd.merge(data_bms, data_gps,how='outer',sort=True)\r\n",
+    "        df_merge['sn']=sn\r\n",
+    "        df_sheetCat=DataPreProcess.data_split_by_status(DataPreProcess,df_merge, drive_interval_threshold=120, charge_interval_threshold=300, drive_stand_threshold=120, charge_stand_threshold=300)\r\n",
+    "        data_charge=df_sheetCat[df_sheetCat['data_status']=='charge']\r\n",
+    "        unique_status_idx=np.unique(data_charge.data_split_by_status.values)\r\n",
+    "        data_I3=pd.DataFrame()\r\n",
+    "        for n in unique_status_idx:\r\n",
+    "            df_charge_buff=data_charge[data_charge.data_split_by_status==n]\r\n",
+    "            list_I=df_charge_buff['总电流[A]'].values.tolist()[1:8]\r\n",
+    "            if((3 in list_I) and (df_charge_buff['总电流[A]'].value_counts()[3]>5)): \r\n",
+    "                data_I3=data_I3.append(df_charge_buff)\r\n",
+    "        data_GMGC=data_GMGC.append(data_I3)\r\n",
+    "        data_I3.to_csv('./result.csv', mode='a', header=None)\r\n",
+    "        \r\n",
+    "    except Exception as e:\r\n",
+    "        print(repr(e))\r\n",
+    "        mylog.logopt(sn,e)\r\n",
+    "        pass  \r\n",
+    "\r\n",
+    "\r\n"
+   ],
+   "outputs": [
+    {
+     "output_type": "stream",
+     "name": "stdout",
+     "text": [
+      "### start to get data MGMCLN750N215H001 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1104, gps_count is 1104, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H002 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 48871, gps_count is 48871, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H003 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 19558, gps_count is 19558, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H004 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1312, gps_count is 1312, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H005 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 25772, gps_count is 25772, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H006 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 32373, gps_count is 32373, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H007 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "IndexError('index 0 is out of bounds for axis 0 with size 0')\n",
+      "### start to get data MGMCLN750N215H008 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36524, gps_count is 36524, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H009 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 45377, gps_count is 45377, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H010 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3787, gps_count is 3787, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H011 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1127, gps_count is 1127, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H012 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 37174, gps_count is 37174, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H013 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 37241, gps_count is 37241, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H014 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 31706, gps_count is 31706, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H015 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 35835, gps_count is 35835, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215H016 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 60298, gps_count is 60298, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I001 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 62134, gps_count is 62134, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I002 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1263, gps_count is 1263, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I003 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 33297, gps_count is 33297, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I004 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 6283, gps_count is 6283, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I005 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 34782, gps_count is 34782, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I006 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 51345, gps_count is 51345, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I007 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 28445, gps_count is 28445, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I008 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 54775, gps_count is 54776, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I009 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1232, gps_count is 1232, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I010 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 44674, gps_count is 44674, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I011 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1026, gps_count is 1026, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I012 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 27630, gps_count is 27630, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I013 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1060, gps_count is 1060, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I014 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 10035, gps_count is 10035, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I015 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1977, gps_count is 1977, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I016 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 30604, gps_count is 30604, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I017 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 30563, gps_count is 30563, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I018 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3728, gps_count is 3728, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I019 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16804, gps_count is 16804, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I020 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 38882, gps_count is 38882, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I021 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1312, gps_count is 1312, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I022 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 12583, gps_count is 12583, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I023 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 10047, gps_count is 10047, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I024 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 38583, gps_count is 38583, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I025 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 48116, gps_count is 48116, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I026 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 25821, gps_count is 25821, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I027 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 30496, gps_count is 30496, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I028 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 47464, gps_count is 47464, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I029 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3398, gps_count is 3398, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I030 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 14284, gps_count is 14284, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I031 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 31194, gps_count is 31194, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I032 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21636, gps_count is 21636, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I033 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 39783, gps_count is 39783, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I034 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 32968, gps_count is 32968, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I035 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 17597, gps_count is 17597, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I036 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1470, gps_count is 1470, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I037 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 6902, gps_count is 6902, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I038 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 50338, gps_count is 50338, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I039 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 44460, gps_count is 44460, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I040 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 24830, gps_count is 24830, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I041 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 32609, gps_count is 32609, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I042 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1159, gps_count is 1159, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I043 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3134, gps_count is 3134, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I044 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 29682, gps_count is 29682, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I045 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3217, gps_count is 3217, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I046 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1433, gps_count is 1433, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I047 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1441, gps_count is 1441, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I048 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 46007, gps_count is 46007, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I049 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 44572, gps_count is 44572, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I050 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 29576, gps_count is 29576, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I051 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1270, gps_count is 1270, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I052 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1219, gps_count is 1219, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I053 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1103, gps_count is 1103, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I054 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36703, gps_count is 36703, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I055 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 26760, gps_count is 26760, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I056 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 28644, gps_count is 28644, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I057 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 38779, gps_count is 38779, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I058 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1269, gps_count is 1269, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I059 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 43312, gps_count is 43312, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I060 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 9676, gps_count is 9676, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I061 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1372, gps_count is 1372, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I062 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 46308, gps_count is 46308, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I063 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16559, gps_count is 16559, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I064 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40384, gps_count is 40384, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I065 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21301, gps_count is 21301, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I066 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "IndexError('index 0 is out of bounds for axis 0 with size 0')\n",
+      "### start to get data MGMCLN750N215I067 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1135, gps_count is 1135, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I068 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "IndexError('index 0 is out of bounds for axis 0 with size 0')\n",
+      "### start to get data MGMCLN750N215I069 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1169, gps_count is 1169, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I070 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 17389, gps_count is 17389, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I071 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16084, gps_count is 16084, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I072 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 43895, gps_count is 43895, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I073 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1341, gps_count is 1341, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I074 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 528, gps_count is 528, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I075 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 45429, gps_count is 45429, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I076 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40165, gps_count is 40165, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I077 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1226, gps_count is 1226, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I078 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "IndexError('index 0 is out of bounds for axis 0 with size 0')\n",
+      "### start to get data MGMCLN750N215I079 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 28569, gps_count is 28569, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I080 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 52944, gps_count is 52944, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I081 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1092, gps_count is 1092, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I082 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 31392, gps_count is 31392, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I083 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1335, gps_count is 1335, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I084 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 39770, gps_count is 39770, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I085 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 10449, gps_count is 10449, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I086 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 54703, gps_count is 54703, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I087 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16637, gps_count is 16637, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I088 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 14034, gps_count is 14034, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I089 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16596, gps_count is 16596, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I090 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 23694, gps_count is 23694, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I091 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 61135, gps_count is 61136, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I092 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 18645, gps_count is 18645, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I093 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21728, gps_count is 21728, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I094 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3228, gps_count is 3228, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I095 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40443, gps_count is 40443, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I096 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 6432, gps_count is 6432, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I097 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 37254, gps_count is 37254, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I098 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 33770, gps_count is 33770, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I099 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1059, gps_count is 1059, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I100 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 37959, gps_count is 37959, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I101 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 18223, gps_count is 18223, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I102 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 50508, gps_count is 50508, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I103 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16708, gps_count is 16708, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I104 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1161, gps_count is 1161, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I105 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1258, gps_count is 1258, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I106 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 44026, gps_count is 44026, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I107 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 29850, gps_count is 29850, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I108 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 43478, gps_count is 43478, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I109 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 19177, gps_count is 19177, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I110 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 7455, gps_count is 7455, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I111 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 26699, gps_count is 26699, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I112 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1244, gps_count is 1244, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I113 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21771, gps_count is 21771, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I114 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1242, gps_count is 1242, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I115 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 9846, gps_count is 9846, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I116 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 44513, gps_count is 44513, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I117 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 55948, gps_count is 55948, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I118 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 51996, gps_count is 51996, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I119 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "IndexError('index 0 is out of bounds for axis 0 with size 0')\n",
+      "### start to get data MGMCLN750N215I120 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 51542, gps_count is 51542, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I121 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16501, gps_count is 16501, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I122 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1263, gps_count is 1263, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I123 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 4058, gps_count is 4058, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I124 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 13812, gps_count is 13812, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I125 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1078, gps_count is 1078, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I126 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1179, gps_count is 1179, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I127 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 7166, gps_count is 7166, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I128 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1385, gps_count is 1385, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I129 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 24930, gps_count is 24930, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I130 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40866, gps_count is 40866, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I131 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 15228, gps_count is 15228, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I132 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 42108, gps_count is 42108, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I133 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 56550, gps_count is 56550, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215I134 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1117, gps_count is 1117, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215L001 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 14176, gps_count is 14176, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215L002 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1111, gps_count is 1111, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215L003 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 20281, gps_count is 20281, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215L004 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 49545, gps_count is 49545, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215L005 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 25500, gps_count is 25500, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215L006 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 9270, gps_count is 9270, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215L007 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1226, gps_count is 1226, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215L008 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 13011, gps_count is 13011, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N001 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 34318, gps_count is 34318, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N002 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 5206, gps_count is 5206, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N003 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 14023, gps_count is 14023, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N004 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 13921, gps_count is 13921, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N005 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 42830, gps_count is 42830, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N006 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 32410, gps_count is 32410, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N007 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 48434, gps_count is 48434, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N008 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 27976, gps_count is 27976, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N009 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1232, gps_count is 1232, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N010 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 24196, gps_count is 24196, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N011 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 9915, gps_count is 9915, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N012 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 22159, gps_count is 22159, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N013 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 60595, gps_count is 60595, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N015 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 18407, gps_count is 18407, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N016 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 8054, gps_count is 8054, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N017 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 33971, gps_count is 33971, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N018 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 55089, gps_count is 55089, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N019 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 39175, gps_count is 39175, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N020 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40843, gps_count is 40843, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N021 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40609, gps_count is 40609, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N022 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 8161, gps_count is 8161, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N023 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 56591, gps_count is 56591, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N024 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 27292, gps_count is 27292, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N025 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1288, gps_count is 1288, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N026 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-10-31 00:00:00 to 2021-11-01 00:00:00......... 'cellTempList'\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 43019, gps_count is 43022, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N027 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 8622, gps_count is 8622, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N028 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3539, gps_count is 3539, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N029 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 50081, gps_count is 50081, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N030 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 37940, gps_count is 37940, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N031 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1096, gps_count is 1096, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N032 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1052, gps_count is 1052, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N033 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1309, gps_count is 1309, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N034 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 10291, gps_count is 10291, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N035 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 55154, gps_count is 55154, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N036 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1125, gps_count is 1125, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N037 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 38086, gps_count is 38086, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N038 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 7653, gps_count is 7653, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N039 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1249, gps_count is 1249, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N040 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 53029, gps_count is 53029, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N041 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 23753, gps_count is 23753, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N042 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 32030, gps_count is 32030, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N043 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "IndexError('index 0 is out of bounds for axis 0 with size 0')\n",
+      "### start to get data MGMCLN750N215N044 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1208, gps_count is 1208, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N045 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 27857, gps_count is 27857, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N046 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 42742, gps_count is 42742, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N047 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 23542, gps_count is 23543, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N048 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 22246, gps_count is 22246, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N049 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 18119, gps_count is 18119, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N050 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 38646, gps_count is 38646, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N051 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 2696, gps_count is 2696, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N052 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 51852, gps_count is 51852, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N053 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 55840, gps_count is 55840, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N054 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 6290, gps_count is 6290, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N055 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 42650, gps_count is 42650, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N056 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 35831, gps_count is 35831, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N057 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 48800, gps_count is 48800, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N058 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 44433, gps_count is 44433, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N059 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 25946, gps_count is 25946, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N060 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1283, gps_count is 1283, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N061 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 42013, gps_count is 42013, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N062 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1344, gps_count is 1344, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N063 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 28991, gps_count is 28991, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N064 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1193, gps_count is 1193, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N065 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 19454, gps_count is 19454, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N066 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21080, gps_count is 21080, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N067 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 27704, gps_count is 27704, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N068 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 54705, gps_count is 54705, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N069 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 45133, gps_count is 45133, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N070 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 52868, gps_count is 52868, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N071 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 44519, gps_count is 44519, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N072 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 20938, gps_count is 20938, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N073 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 33997, gps_count is 33997, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N074 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 6387, gps_count is 6387, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N075 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21559, gps_count is 21559, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N076 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 25958, gps_count is 25958, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N077 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 10054, gps_count is 10054, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N078 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-10-29 00:00:00 to 2021-10-30 00:00:00......... 'cellVoltageList'\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 7693, gps_count is 7696, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N079 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 33592, gps_count is 33592, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N080 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 41947, gps_count is 41947, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N081 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 50995, gps_count is 50995, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N082 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 28607, gps_count is 28607, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N083 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40506, gps_count is 40506, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N084 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 50376, gps_count is 50376, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N085 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 26009, gps_count is 26009, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N086 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 39184, gps_count is 39184, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N087 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 17465, gps_count is 17465, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N088 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 52012, gps_count is 52012, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N089 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1344, gps_count is 1344, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N090 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 29876, gps_count is 29876, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N091 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 8958, gps_count is 8958, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N092 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1144, gps_count is 1144, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N093 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1246, gps_count is 1246, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N094 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 38922, gps_count is 38922, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N095 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 33527, gps_count is 33527, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N096 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 10212, gps_count is 10212, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N097 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 10730, gps_count is 10730, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N098 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 15825, gps_count is 15825, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N099 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 12553, gps_count is 12553, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N100 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 28779, gps_count is 28779, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N101 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36319, gps_count is 36319, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N102 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36515, gps_count is 36515, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N103 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 2423, gps_count is 2423, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N104 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 32179, gps_count is 32179, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N105 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 44844, gps_count is 44844, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N106 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36389, gps_count is 36389, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N107 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 23939, gps_count is 23939, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N108 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 45387, gps_count is 45387, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N109 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 33808, gps_count is 33808, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N110 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36247, gps_count is 36247, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N111 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 46213, gps_count is 46213, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N112 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16308, gps_count is 16308, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N113 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36673, gps_count is 36673, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N114 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 22023, gps_count is 22023, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N115 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 42752, gps_count is 42752, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N116 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "IndexError('index 0 is out of bounds for axis 0 with size 0')\n",
+      "### start to get data MGMCLN750N215N117 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 24697, gps_count is 24697, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N118 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 38469, gps_count is 38469, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N119 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 43266, gps_count is 43266, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N120 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16865, gps_count is 16865, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N121 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1104, gps_count is 1104, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N122 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 28672, gps_count is 28672, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N123 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 28843, gps_count is 28843, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N124 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 30691, gps_count is 30691, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N125 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 26177, gps_count is 26177, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N126 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 41933, gps_count is 41933, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N127 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 30177, gps_count is 30177, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N128 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 43749, gps_count is 43749, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N129 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36242, gps_count is 36242, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N130 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 50785, gps_count is 50785, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N131 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 13856, gps_count is 13856, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N132 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 10919, gps_count is 10919, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N133 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 47084, gps_count is 47084, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N134 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 46365, gps_count is 46365, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N135 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1245, gps_count is 1245, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N136 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 42805, gps_count is 42805, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N137 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 31199, gps_count is 31199, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N138 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 25812, gps_count is 25812, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N139 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 26808, gps_count is 26808, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N140 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3876, gps_count is 3876, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N141 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1107, gps_count is 1107, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N142 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 9684, gps_count is 9684, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N143 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 24400, gps_count is 24400, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N144 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1260, gps_count is 1260, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N145 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 30899, gps_count is 30899, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N146 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36636, gps_count is 36636, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N147 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 35180, gps_count is 35180, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N148 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40236, gps_count is 40236, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N149 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 7177, gps_count is 7177, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N150 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 24856, gps_count is 24856, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N151 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 14833, gps_count is 14833, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N152 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 56629, gps_count is 56629, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N153 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1229, gps_count is 1229, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N154 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 24708, gps_count is 24708, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N155 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1288, gps_count is 1288, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N156 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 11902, gps_count is 11902, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N157 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 31374, gps_count is 31374, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N158 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21316, gps_count is 21316, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N159 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 35915, gps_count is 35915, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N160 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36939, gps_count is 36939, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N161 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 58661, gps_count is 58661, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N162 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 35629, gps_count is 35629, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N163 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 53709, gps_count is 53709, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N164 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36295, gps_count is 36295, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N165 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1026, gps_count is 1026, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N166 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1206, gps_count is 1206, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N167 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 39040, gps_count is 39040, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N168 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 12158, gps_count is 12158, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N169 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 38396, gps_count is 38396, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N170 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1751, gps_count is 1751, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N171 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3862, gps_count is 3862, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N172 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 23760, gps_count is 23760, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N173 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 19016, gps_count is 19016, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N174 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 32288, gps_count is 32288, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N175 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 24060, gps_count is 24060, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N176 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1076, gps_count is 1076, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N177 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 59634, gps_count is 59634, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N178 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 472, gps_count is 472, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N179 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1182, gps_count is 1182, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N180 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21006, gps_count is 21006, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N181 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 8126, gps_count is 8126, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N182 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 11378, gps_count is 11378, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N183 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 23295, gps_count is 23295, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N184 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1364, gps_count is 1364, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N185 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 5012, gps_count is 5012, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N186 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 37299, gps_count is 37299, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N187 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 17529, gps_count is 17529, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N188 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 41306, gps_count is 41306, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N189 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 35099, gps_count is 35099, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N190 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 54662, gps_count is 54662, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N191 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 6786, gps_count is 6786, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N192 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 17101, gps_count is 17101, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N193 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 22736, gps_count is 22736, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N194 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 12579, gps_count is 12579, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N195 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 29513, gps_count is 29513, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N196 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21996, gps_count is 21996, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N197 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 20109, gps_count is 20109, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N198 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 37346, gps_count is 37346, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N199 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 42018, gps_count is 42018, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N200 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 22349, gps_count is 22349, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N201 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40036, gps_count is 40036, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N202 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 37326, gps_count is 37326, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N203 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 513, gps_count is 513, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N204 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 50098, gps_count is 50098, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N205 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1073, gps_count is 1073, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N206 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 51438, gps_count is 51438, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N207 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 7247, gps_count is 7247, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N208 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 52957, gps_count is 52957, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N209 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 27133, gps_count is 27133, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N210 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 50549, gps_count is 50549, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N211 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 27652, gps_count is 27652, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N212 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 35572, gps_count is 35572, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N213 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1094, gps_count is 1094, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N214 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21882, gps_count is 21882, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N215 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 10269, gps_count is 10269, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N216 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40223, gps_count is 40223, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N217 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 42418, gps_count is 42418, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N218 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21033, gps_count is 21033, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N219 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3286, gps_count is 3286, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N220 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16492, gps_count is 16492, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N221 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40753, gps_count is 40753, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N222 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1305, gps_count is 1305, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N223 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 25350, gps_count is 25350, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N224 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1263, gps_count is 1263, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N225 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 28378, gps_count is 28378, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N226 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 49495, gps_count is 49495, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N227 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 32731, gps_count is 32731, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N228 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3696, gps_count is 3696, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N229 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1299, gps_count is 1299, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N230 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1304, gps_count is 1304, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N231 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 30648, gps_count is 30648, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N232 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 23247, gps_count is 23247, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N233 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1174, gps_count is 1174, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N234 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1258, gps_count is 1258, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N235 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 5974, gps_count is 5974, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N236 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 39709, gps_count is 39709, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N237 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 45384, gps_count is 45384, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N238 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 31172, gps_count is 31172, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N239 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 54369, gps_count is 54369, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N240 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 37279, gps_count is 37280, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N241 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 43748, gps_count is 43748, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N242 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 42780, gps_count is 42780, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N243 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 9988, gps_count is 9988, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N244 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 4214, gps_count is 4214, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N245 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 40476, gps_count is 40476, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N246 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 60457, gps_count is 60457, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N247 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 49223, gps_count is 49223, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N248 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 48130, gps_count is 48130, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N249 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 47641, gps_count is 47641, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N250 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 41514, gps_count is 41514, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N251 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 45235, gps_count is 45235, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N252 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1247, gps_count is 1247, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N253 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 3745, gps_count is 3745, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N254 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 45182, gps_count is 45182, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N255 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 56849, gps_count is 56849, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N256 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 18175, gps_count is 18175, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N257 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 33893, gps_count is 33893, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N258 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1219, gps_count is 1219, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N259 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 8595, gps_count is 8595, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N260 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "IndexError('index 0 is out of bounds for axis 0 with size 0')\n",
+      "### start to get data MGMCLN750N215N261 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21038, gps_count is 21038, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N262 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 36929, gps_count is 36929, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N263 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 50068, gps_count is 50068, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N264 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 19959, gps_count is 19959, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N265 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 5662, gps_count is 5662, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N266 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 14799, gps_count is 14799, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N267 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 15490, gps_count is 15490, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N268 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 41713, gps_count is 41713, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N269 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 19337, gps_count is 19337, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N270 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 16552, gps_count is 16552, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N271 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1063, gps_count is 1063, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N272 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 12537, gps_count is 12537, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N273 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 44072, gps_count is 44072, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N274 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 21809, gps_count is 21809, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N275 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 52156, gps_count is 52156, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N276 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1091, gps_count is 1091, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N277 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 62873, gps_count is 62873, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N278 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 25194, gps_count is 25194, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N279 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 25958, gps_count is 25958, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N280 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1310, gps_count is 1310, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N281 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 27331, gps_count is 27331, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N282 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 56373, gps_count is 56373, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N283 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1270, gps_count is 1270, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N284 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 56745, gps_count is 56745, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N285 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 22864, gps_count is 22864, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N286 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 2341, gps_count is 2341, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N287 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "IndexError('index 0 is out of bounds for axis 0 with size 0')\n",
+      "### start to get data MGMCLN750N215N288 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 17721, gps_count is 17721, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N289 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 55913, gps_count is 55913, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N290 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 52796, gps_count is 52796, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N291 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 66067, gps_count is 66067, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N292 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 49231, gps_count is 49231, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N293 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1272, gps_count is 1272, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N294 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1183, gps_count is 1183, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N295 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 56473, gps_count is 56473, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N296 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 38297, gps_count is 38297, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N297 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 49614, gps_count is 49614, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N298 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 29160, gps_count is 29160, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N299 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 0, gps_count is 0, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "IndexError('index 0 is out of bounds for axis 0 with size 0')\n",
+      "### start to get data MGMCLN750N215N300 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 22575, gps_count is 22575, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N301 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 1196, gps_count is 1196, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N302 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 20357, gps_count is 20357, system_count is 0, accum_count is 0 \n",
+      "\n",
+      "### start to get data MGMCLN750N215N303 from 2021-10-28 00:00:00 to 2021-11-04 00:00:00\n",
+      "# get data from 2021-11-03 00:00:00 to 2021-11-04 00:00:00......... \n",
+      "all data-getting done, bms_count is 5145, gps_count is 5145, system_count is 0, accum_count is 0 \n",
+      "\n"
+     ]
+    }
+   ],
+   "metadata": {}
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "source": [],
+   "outputs": [],
+   "metadata": {}
+  }
+ ],
+ "metadata": {
+  "orig_nbformat": 4,
+  "language_info": {
+   "name": "python",
+   "version": "3.8.10",
+   "mimetype": "text/x-python",
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "pygments_lexer": "ipython3",
+   "nbconvert_exporter": "python",
+   "file_extension": ".py"
+  },
+  "kernelspec": {
+   "name": "python3",
+   "display_name": "Python 3.8.10 64-bit (conda)"
+  },
+  "interpreter": {
+   "hash": "69976922f58704918d459eb5dccc4a4074095a997db3fffa9f9946bbc3807710"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 121 - 0
LIB/MIDDLE/WinterCharging/V1_0_1/Data_Analyse2.py

@@ -0,0 +1,121 @@
+from LIB.BACKEND import DBManager
+from LIB.MIDDLE.CellStateEstimation.Common import log
+import datetime
+import pandas as pd
+import numpy as np
+import os   
+from DataPreProcessMGMC import DataPreProcess
+from scipy import stats
+
+#log信息配置
+mylog=log.Mylog('log.txt','error')
+mylog.logcfg()
+
+dbManager = DBManager.DBManager()
+dataSOH = pd.read_excel('sn-20210903.xlsx',sheet_name='MGMC')
+fileNames = dataSOH['sn']
+fileNames = list(fileNames)
+
+data_GMGC=[]
+for k in range(len(fileNames)):
+    try:    
+        sn = fileNames[k]
+        df_data = dbManager.get_data(sn=sn, start_time='2021-10-15 00:00:00', end_time='2021-11-06 00:00:00', data_groups='bms')
+        data_bms = df_data['bms']
+        data_bms['sn'] = sn
+        df_sheetCat = DataPreProcess.data_split_by_status(DataPreProcess,data_bms, drive_interval_threshold=120, charge_interval_threshold=300, drive_stand_threshold=120, charge_stand_threshold=300)
+        unique_status_idx = np.unique(df_sheetCat.data_split_by_status.values)
+        data_result = pd.DataFrame()
+        list_result = []
+        for n in unique_status_idx:
+            list_result.append(df_sheetCat[df_sheetCat.data_split_by_status==n]) 
+        
+        maxI=[]
+        modI=[]
+        lenI=[]
+        temp1_start=[]
+        temp2_start=[]
+        temp1_fin=[]
+        temp2_fin=[]
+        time_start=[]
+        time_fin=[]
+        time_drivefin=[]
+        temp1_drivefin=[]
+        temp2_drivefin=[]
+        sn=[]
+        
+        for i in range(1,len(list_result)):
+            if list_result[i]['data_status'].values[0]=='charge':
+            
+                maxI.append(max(list_result[i]['总电流[A]'].values[:10]))
+                modI.append(stats.mode(list_result[i]['总电流[A]'].values[:10])[0][0])
+                lenI.append(len(list_result[i]['总电流[A]'].values))
+                temp1_start.append(list_result[i]['单体温度1'].values[0])
+                temp2_start.append(list_result[i]['单体温度2'].values[0])
+                temp1_fin.append(list_result[i]['单体温度1'].values[-1])
+                temp2_fin.append(list_result[i]['单体温度2'].values[-1])
+                time_start.append(list_result[i]['时间戳'].values[0])
+                time_fin.append(list_result[i]['时间戳'].values[-1])
+                time_drivefin.append(list_result[i-1]['时间戳'].values[0])
+                temp1_drivefin.append(list_result[i-1]['单体温度1'].values[0])
+                temp2_drivefin.append(list_result[i-1]['单体温度2'].values[0])           
+                sn.append(list_result[i]['sn'].values[0])
+        dic={"初始充电电流max":maxI,"初始充电电流mod":modI,"电流长度":lenI,"初始充电温度1":temp1_start,"初始充电温度2":temp2_start,
+            "结束充电温度1":temp1_fin,"结束充电温度2":temp2_fin,"初始充电时间":time_start,
+            "结束充电时间":time_fin,"行驶结束时间":time_drivefin,"行驶结束温度1":temp1_drivefin,
+            "行驶结束温度2":temp2_drivefin,"sn":sn}
+        df_analyse=pd.DataFrame(dic)
+
+        data_analyse=df_analyse[df_analyse['电流长度'].values>5]
+
+        mean_temp1=[]
+        mean_temp2=[]
+        mean_temp3=[]
+        time_diff_stand=[]
+        time_diff_charge=[]
+
+        for i in range(len(data_analyse)):
+            meantemp1=(data_analyse['初始充电温度1'].values[i]+data_analyse['初始充电温度2'].values[i])/2
+            mean_temp1.append(meantemp1)
+            meantemp2=(data_analyse['结束充电温度1'].values[i]+data_analyse['结束充电温度2'].values[i])/2
+            mean_temp2.append(meantemp2)
+            meantemp3=(data_analyse['行驶结束温度1'].values[i]+data_analyse['行驶结束温度2'].values[i])/2
+            mean_temp3.append(meantemp3)
+            td_charge=float(np.diff([data_analyse['初始充电时间'].values[i],data_analyse['结束充电时间'].values[i]])/np.timedelta64(1, 'm'))
+            time_diff_charge.append(td_charge)
+            td_stand=float(np.diff([data_analyse['行驶结束时间'].values[i],data_analyse['初始充电时间'].values[i]])/np.timedelta64(1, 'm'))
+            time_diff_stand.append(td_stand) 
+   
+        data_analyse['初始充电温度']=mean_temp1
+        data_analyse['结束充电温度']=mean_temp2
+        data_analyse['行驶结束温度']=mean_temp3
+        data_analyse['闲置时长']=time_diff_stand
+        data_analyse['充电时长']=time_diff_charge
+
+        diff_temp=[]
+        for i in range(len(data_analyse)):
+            difftemp=data_analyse['结束充电温度'].values[i]-data_analyse['初始充电温度'].values[i]
+            diff_temp.append(difftemp)
+        data_analyse['充电温差']=diff_temp
+
+        data_select=data_analyse[data_analyse['充电时长'].values>5]
+
+        data_select.to_csv('data'+sn+'.csv')
+
+        data_GMGC.append(data_select)
+        data_GMGC.to_csv('dataGMGC.csv')
+
+    except Exception as e:
+        print(repr(e))
+        mylog.logopt(sn,e)
+        pass  
+
+
+
+
+
+
+
+
+
+

File diff suppressed because it is too large
+ 149 - 0
LIB/MIDDLE/WinterCharging/V1_0_1/main.ipynb


BIN
Low_Soc_Alarm.xlsx


BIN
df_file.xlsx


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