Upload cleaned data

This commit is contained in:
DingZQ
2025-05-03 22:19:27 +08:00
parent b8dcec9349
commit d775c1a9f9

View File

@@ -3379,20 +3379,20 @@ if __name__ == "__main__":
token = influxdb_info.token token = influxdb_info.token
org_name = influxdb_info.org org_name = influxdb_info.org
client = InfluxDBClient(url=url, token=token) # client = InfluxDBClient(url=url, token=token)
# step1: 检查连接状态初始化influxdb的buckets # # step1: 检查连接状态初始化influxdb的buckets
try: # try:
delete_buckets(org_name) # delete_buckets(org_name)
create_and_initialize_buckets(org_name) # create_and_initialize_buckets(org_name)
except Exception as e: # except Exception as e:
print(f"连接失败: {e}") # print(f"连接失败: {e}")
# step2: 先查询pg数据库中scada_info的信息然后存储SCADA数据到SCADA_data这个bucket里 # step2: 先查询pg数据库中scada_info的信息然后存储SCADA数据到SCADA_data这个bucket里
query_pg_scada_info_realtime('bb') # query_pg_scada_info_realtime('bb')
query_pg_scada_info_non_realtime('bb') # query_pg_scada_info_non_realtime('bb')
query_corresponding_query_id_and_element_id('bb') # query_corresponding_query_id_and_element_id('bb')
@@ -3501,7 +3501,7 @@ if __name__ == "__main__":
# print(leakage) # print(leakage)
# 示例upload_cleaned_SCADA_data_to_influxdb # 示例upload_cleaned_SCADA_data_to_influxdb
# upload_cleaned_SCADA_data_to_influxdb(file_path='./标准cleaned_demand_data.csv') upload_cleaned_SCADA_data_to_influxdb(file_path='./标准cleaned_demand_data.csv')
# 示例query_cleaned_SCADA_data_by_device_ID_and_timerange # 示例query_cleaned_SCADA_data_by_device_ID_and_timerange
# result = query_cleaned_SCADA_data_by_device_ID_and_timerange(query_ids_list=['9485'], start_time='2024-03-24T00:00:00+08:00', # result = query_cleaned_SCADA_data_by_device_ID_and_timerange(query_ids_list=['9485'], start_time='2024-03-24T00:00:00+08:00',