From 4f2a888dff4109eac07737080d81ba517e303ce8 Mon Sep 17 00:00:00 2001 From: workpc Date: Tue, 18 Feb 2025 09:55:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=91=8A=E4=B8=8A=E4=BC=A0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=B7=BB=E5=8A=A0=20groupNo=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config_jingbo.py | 4 +++- config_jingbo_pro.py | 2 ++ main_yongan.py | 6 +++--- main_yuanyou.py | 49 +++++++++++++++++++++++--------------------- 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/config_jingbo.py b/config_jingbo.py index f44df2d..e7ba947 100644 --- a/config_jingbo.py +++ b/config_jingbo.py @@ -112,6 +112,7 @@ login_data = { } upload_data = { + "groupNo":'', # 用户组id "funcModule":'研究报告信息', "funcOperation":'上传原油价格预测报告', "data":{ @@ -129,6 +130,7 @@ upload_data = { warning_data = { + "groupNo":'', # 用户组id "funcModule":'原油特征停更预警', "funcOperation":'原油特征停更预警', "data":{ @@ -161,7 +163,7 @@ table_name = 'v_tbl_crude_oil_warning' ### 开关 is_train = False # 是否训练 is_debug = False # 是否调试 -is_eta = False # 是否使用eta接口 +is_eta = True # 是否使用eta接口 is_market = True # 是否通过市场信息平台获取特征 ,在is_eta 为true 的情况下生效 is_timefurture = True # 是否使用时间特征 is_fivemodels = False # 是否使用之前保存的最佳的5个模型 diff --git a/config_jingbo_pro.py b/config_jingbo_pro.py index 6e27e32..0d53abd 100644 --- a/config_jingbo_pro.py +++ b/config_jingbo_pro.py @@ -114,6 +114,7 @@ upload_data = { "funcModule":'研究报告信息', "funcOperation":'上传原油价格预测报告', "data":{ + "groupNo":'', # 用户组id "ownerAccount":'27663', #报告所属用户账号 27663 - 刘小朋 "reportType":'OIL_PRICE_FORECAST', # 报告类型,固定为OIL_PRICE_FORECAST "fileName": '', #文件名称 @@ -127,6 +128,7 @@ upload_data = { } warning_data = { + "groupNo":'', # 用户组id "funcModule":'原油特征停更预警', "funcOperation":'原油特征停更预警', "data":{ diff --git a/main_yongan.py b/main_yongan.py index cf7a540..eac1976 100644 --- a/main_yongan.py +++ b/main_yongan.py @@ -242,9 +242,9 @@ def predict_main(): # logger.info('模型训练完成') - # logger.info('训练数据绘图ing') - # model_results3 = model_losss_yongan(sqlitedb,end_time=end_time,table_name_prefix=table_name_prefix) - # logger.info('训练数据绘图end') + logger.info('训练数据绘图ing') + model_results3 = model_losss_yongan(sqlitedb,end_time=end_time,table_name_prefix=table_name_prefix) + logger.info('训练数据绘图end') # 模型报告 logger.info('制作报告ing') diff --git a/main_yuanyou.py b/main_yuanyou.py index 7cf59ea..5c754dd 100644 --- a/main_yuanyou.py +++ b/main_yuanyou.py @@ -215,6 +215,9 @@ def predict_main(): warning_data_df.to_sql(table_name, con=engine, if_exists='append', index=False) if is_update_warning_data: upload_warning_info(len(warning_data_df)) + + # 发送钉钉消息 + upload_warning_info(len(warning_data_df)) except: logger.info('上传预警信息到数据库失败') @@ -226,32 +229,32 @@ def predict_main(): row, col = df.shape now = datetime.datetime.now().strftime('%Y%m%d%H%M%S') - ex_Model(df, - horizon=horizon, - input_size=input_size, - train_steps=train_steps, - val_check_steps=val_check_steps, - early_stop_patience_steps=early_stop_patience_steps, - is_debug=is_debug, - dataset=dataset, - is_train=is_train, - is_fivemodels=is_fivemodels, - val_size=val_size, - test_size=test_size, - settings=settings, - now=now, - etadata=etadata, - modelsindex=modelsindex, - data=data, - is_eta=is_eta, - end_time=end_time, - ) + # ex_Model(df, + # horizon=horizon, + # input_size=input_size, + # train_steps=train_steps, + # val_check_steps=val_check_steps, + # early_stop_patience_steps=early_stop_patience_steps, + # is_debug=is_debug, + # dataset=dataset, + # is_train=is_train, + # is_fivemodels=is_fivemodels, + # val_size=val_size, + # test_size=test_size, + # settings=settings, + # now=now, + # etadata=etadata, + # modelsindex=modelsindex, + # data=data, + # is_eta=is_eta, + # end_time=end_time, + # ) logger.info('模型训练完成') logger.info('训练数据绘图ing') - model_results3 = model_losss(sqlitedb,end_time=end_time) + # model_results3 = model_losss(sqlitedb,end_time=end_time) logger.info('训练数据绘图end') # 模型报告 @@ -259,8 +262,8 @@ def predict_main(): title = f'{settings}--{end_time}-预测报告' # 报告标题 reportname = f'Brent原油大模型预测--{end_time}.pdf' # 报告文件名 reportname = reportname.replace(':', '-') # 替换冒号 - brent_export_pdf(dataset=dataset,num_models = 5 if is_fivemodels else 22,time=end_time, - reportname=reportname,sqlitedb=sqlitedb), + # brent_export_pdf(dataset=dataset,num_models = 5 if is_fivemodels else 22,time=end_time, + # reportname=reportname,sqlitedb=sqlitedb), logger.info('制作报告end') logger.info('模型训练完成')