import numpy as np import pandas as pd import datetime import pymysql from apscheduler.schedulers.blocking import BlockingScheduler from USER.SPF.alibaba.Common import log import CBMSBatCtrl #...................................SOC计算函数...................................................................................................................... def ctrl_cal(): global df_ram_rlyctrl global df_ram_statectrl global now_time global df_data1,df_data2,df_data3 end_time=now_time+datetime.timedelta(seconds=10) start_time=now_time now_time=now_time+datetime.timedelta(seconds=10) host='120.25.223.1' port=4901 user='root' password='123456' db='ali' mysql = pymysql.connect (host=host, user=user, password=password, port=port, database=db) #log信息配置............................................................................................................................................................................ mylog=log.Mylog('log_ctrl.txt','error') mylog.logcfg() sn_list=['KPD001','KPD002','KPD003','LS001','LS002'] #celltype=1康普盾 99力神 try: #读取所有康普盾电池包原始数据库最后一条数据........................................................................... df_bms1= df_data1[(df_data1['time']>=start_time) & (df_data1['time']=start_time) & (df_data2['time']=start_time) & (df_data3['time']