日度聚烯烃上传八大维度配置更改

This commit is contained in:
jingboyitiji 2025-03-28 13:12:20 +08:00
parent b9b23dbf77
commit c7dac7586d
3 changed files with 64 additions and 23 deletions

View File

@ -132,12 +132,17 @@ ClassifyId = 1161
# 变量定义--测试环境
server_host = '192.168.100.53'
server_host = '192.168.100.53' # 内网
# server_host = '183.242.74.28' # 外网
login_pushreport_url = f"http://{server_host}:8080/jingbo-dev/api/server/login"
# 上传报告
upload_url = f"http://{server_host}:8080/jingbo-dev/api/analysis/reportInfo/researchUploadReportSave"
# 停更预警
upload_warning_url = f"http://{server_host}:8080/jingbo-dev/api/basicBuiness/crudeOilWarning/save"
# 查询数据项编码
query_data_list_item_nos_url = f"http://{server_host}:8080/jingbo-dev/api/warehouse/dwDataItem/queryDataListItemNos"
# 上传数据项值
push_data_value_list_url = f"http://{server_host}:8080/jingbo-dev/api/dw/dataValue/pushDataValueList"
login_data = {
"data": {
@ -190,6 +195,31 @@ query_data_list_item_nos_data = {
}
}
push_data_value_list_data = {
"funcModule": "数据表信息列表",
"funcOperation": "新增",
"data": [
{"dataItemNo": "91230600716676129",
"dataDate": "20230113",
"dataStatus": "add",
"dataValue": 100.11
},
{"dataItemNo": "91230600716676129P|ETHYL_BEN|CAPACITY",
"dataDate": "20230113",
"dataStatus": "add",
"dataValue": 100.55
},
{"dataItemNo": "91230600716676129P|ETHYL_BEN|CAPACITY",
"dataDate": "20230113",
"dataStatus": "add",
"dataValue": 100.55
}
]
}
# 八大维度数据项编码
bdwd_items = {
'ciri': 'jxtppbdwdcr',

View File

@ -33,6 +33,7 @@ global_config.update({
'test_size': test_size,
'modelsindex': modelsindex,
'rote': rote,
'bdwd_items': bdwd_items,
# 特征工程开关
'is_del_corr': is_del_corr,
@ -44,13 +45,13 @@ global_config.update({
# 时间参数
'start_year': start_year,
'end_time': end_time or datetime.datetime.now().strftime("%Y-%m-%d"),
'end_time': end_time ,
'freq': freq, # 保持列表结构
# 接口配置
'login_pushreport_url': login_pushreport_url,
'login_data': login_data,
'upload_url': upload_url,
'upload_url': upload_url,
'upload_warning_url': upload_warning_url,
'warning_data': warning_data,
@ -58,6 +59,10 @@ global_config.update({
'query_data_list_item_nos_url': query_data_list_item_nos_url,
'query_data_list_item_nos_data': query_data_list_item_nos_data,
# 上传数据项
'push_data_value_list_url': push_data_value_list_url,
'push_data_value_list_data': push_data_value_list_data,
# eta 配置
'APPID': APPID,
'SECRET': SECRET,
@ -354,7 +359,7 @@ def predict_main():
reportname=reportname, sqlitedb=sqlitedb),
logger.info('制作报告end')
logger.info('模型训练完成')
logger.info('模型训练完成')
push_market_value()
@ -383,12 +388,14 @@ def predict_main():
if __name__ == '__main__':
# global end_time
# 遍历2024-11-25 到 2024-12-3 之间的工作日日期
for i_time in pd.date_range('2025-2-1', '2025-3-18', freq='M'):
try:
global_config['end_time'] = i_time.strftime('%Y-%m-%d')
predict_main()
except Exception as e:
logger.info(f'预测失败:{e}')
continue
# for i_time in pd.date_range('2025-2-1', '2025-3-18', freq='B'):
# try:
# global_config['end_time'] = i_time.strftime('%Y-%m-%d')
# predict_main()
# except Exception as e:
# logger.info(f'预测失败:{e}')
# continue
# predict_main()
push_market_value()

View File

@ -371,8 +371,8 @@ def ex_Model_Juxiting(df, horizon, input_size, train_steps, val_check_steps, ear
scaler_type='standard', early_stop_patience_steps=early_stop_patience_steps),
TFT(h=horizon, input_size=input_size, max_steps=train_steps, val_check_steps=val_check_steps,
scaler_type='standard', early_stop_patience_steps=early_stop_patience_steps),
FEDformer(h=horizon, input_size=input_size, max_steps=train_steps, val_check_steps=val_check_steps,
scaler_type='standard', early_stop_patience_steps=early_stop_patience_steps),
# FEDformer(h=horizon, input_size=input_size, max_steps=train_steps, val_check_steps=val_check_steps,
# scaler_type='standard', early_stop_patience_steps=early_stop_patience_steps),
StemGNN(h=horizon, input_size=input_size, n_series=1, max_steps=train_steps, val_check_steps=val_check_steps,
scaler_type='standard', early_stop_patience_steps=early_stop_patience_steps),
MLPMultivariate(h=horizon, input_size=input_size, n_series=1, max_steps=train_steps,
@ -461,16 +461,20 @@ def ex_Model_Juxiting(df, horizon, input_size, train_steps, val_check_steps, ear
if config.is_update_eta:
df_predict['ds'] = pd.to_datetime(df_predict['ds'])
dates = df_predict['ds'].dt.strftime('%Y-%m-%d')
for m in modelsindex.keys():
list = []
for date, value in zip(dates, df_predict[m]):
list.append({'Date': date, 'Value': value})
data['DataList'] = [list[-1]]
data['IndexCode'] = modelsindex[m]
data['IndexName'] = f'聚烯烃价格预测{m}模型'
data['Remark'] = m
etadata.push_data(data=data)
try:
list = []
for date, value in zip(dates, df_predict[m].round(2)):
list.append({'Date': date, 'Value': value})
data['DataList'] = [list[-1]]
data['IndexCode'] = modelsindex[m]
data['IndexName'] = f'聚烯烃价格预测{m}模型'
data['Remark'] = m
etadata.push_data(data=data)
except Exception as e:
config.logger.error(f'上传eta数据失败{e}')
# return nf_test_preds
return