David 1 bulan lalu
induk
melakukan
c139fda69e

+ 2 - 1
app/common/neu.yaml

@@ -91,4 +91,5 @@ scaler_table: scaler
 model_table: model
 model_name: fmi
 switch_nwp_owner: false
-region: south
+region: south
+clean_power: true

+ 274 - 0
app/logs/2025-04-03/south-forecast.2025-04-03.0.log

@@ -224,3 +224,277 @@
   0.35231  0.35726  0.3452   0.35579  0.36291  0.3551   0.35916  0.3541
   0.34667  0.35812] - training
 2025-04-03 09:30:07,261 - dbmg.py - INFO - ❌ 数据库操作 - 详细错误: Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'} - insert_trained_model_into_mongo
+2025-04-03 13:33:12,420 - module_wrapper.py - WARNING - From E:\compete\app\model\losses.py:10: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.
+ - _tfmw_add_deprecation_warning
+2025-04-03 13:33:12,613 - tf_cnn_train.py - INFO - Program starts execution! - model_training
+2025-04-03 13:33:12,674 - data_cleaning.py - INFO - 开始清洗:训练集…… - cleaning
+2025-04-03 13:33:12,683 - data_cleaning.py - INFO - 列清洗:清洗的列有:{'HubSpeed', 'HubDireciton'} - data_column_cleaning
+2025-04-03 13:33:12,700 - data_cleaning.py - INFO - 行清洗:清洗的行数有:881,缺失的列有: - key_field_row_cleaning
+2025-04-03 13:33:12,721 - data_handler.py - INFO - 2022-05-05 23:45:00 ~ 2022-05-09 00:00:00 - missing_time_splite
+2025-04-03 13:33:12,721 - data_handler.py - INFO - 缺失点数:288.0 - missing_time_splite
+2025-04-03 13:33:12,754 - data_handler.py - INFO - 2022-06-25 07:45:00 ~ 2022-06-25 08:15:00 - missing_time_splite
+2025-04-03 13:33:12,754 - data_handler.py - INFO - 缺失点数:1.0 - missing_time_splite
+2025-04-03 13:33:12,754 - data_handler.py - INFO - 需要补值的点数:1.0 - missing_time_splite
+2025-04-03 13:33:12,756 - data_handler.py - INFO - 2022-06-27 06:45:00 ~ 2022-06-27 07:15:00 - missing_time_splite
+2025-04-03 13:33:12,756 - data_handler.py - INFO - 缺失点数:1.0 - missing_time_splite
+2025-04-03 13:33:12,756 - data_handler.py - INFO - 需要补值的点数:1.0 - missing_time_splite
+2025-04-03 13:33:12,760 - data_handler.py - INFO - 2022-07-01 06:30:00 ~ 2022-07-01 23:45:00 - missing_time_splite
+2025-04-03 13:33:12,760 - data_handler.py - INFO - 缺失点数:68.0 - missing_time_splite
+2025-04-03 13:33:12,765 - data_handler.py - INFO - 2022-07-08 06:15:00 ~ 2022-07-08 23:45:00 - missing_time_splite
+2025-04-03 13:33:12,765 - data_handler.py - INFO - 缺失点数:69.0 - missing_time_splite
+2025-04-03 13:33:12,767 - data_handler.py - INFO - 2022-07-09 06:15:00 ~ 2022-07-09 23:45:00 - missing_time_splite
+2025-04-03 13:33:12,767 - data_handler.py - INFO - 缺失点数:69.0 - missing_time_splite
+2025-04-03 13:33:12,768 - data_handler.py - INFO - 2022-07-10 06:15:00 ~ 2022-07-10 23:45:00 - missing_time_splite
+2025-04-03 13:33:12,768 - data_handler.py - INFO - 缺失点数:69.0 - missing_time_splite
+2025-04-03 13:33:12,769 - data_handler.py - INFO - 2022-07-11 06:00:00 ~ 2022-07-11 23:45:00 - missing_time_splite
+2025-04-03 13:33:12,769 - data_handler.py - INFO - 缺失点数:70.0 - missing_time_splite
+2025-04-03 13:33:12,770 - data_handler.py - INFO - 2022-07-12 06:00:00 ~ 2022-07-12 23:45:00 - missing_time_splite
+2025-04-03 13:33:12,770 - data_handler.py - INFO - 缺失点数:70.0 - missing_time_splite
+2025-04-03 13:33:12,772 - data_handler.py - INFO - 2022-07-13 06:00:00 ~ 2022-07-13 23:45:00 - missing_time_splite
+2025-04-03 13:33:12,772 - data_handler.py - INFO - 缺失点数:70.0 - missing_time_splite
+2025-04-03 13:33:12,773 - data_handler.py - INFO - 2022-07-14 23:00:00 ~ 2022-07-14 23:45:00 - missing_time_splite
+2025-04-03 13:33:12,773 - data_handler.py - INFO - 缺失点数:2.0 - missing_time_splite
+2025-04-03 13:33:12,773 - data_handler.py - INFO - 需要补值的点数:2.0 - missing_time_splite
+2025-04-03 13:33:12,785 - data_handler.py - INFO - 2022-08-01 20:00:00 ~ 2022-08-01 23:45:00 - missing_time_splite
+2025-04-03 13:33:12,785 - data_handler.py - INFO - 缺失点数:14.0 - missing_time_splite
+2025-04-03 13:33:12,787 - data_handler.py - INFO - 2022-08-02 21:00:00 ~ 2022-08-02 23:45:00 - missing_time_splite
+2025-04-03 13:33:12,788 - data_handler.py - INFO - 缺失点数:10.0 - missing_time_splite
+2025-04-03 13:33:12,789 - data_handler.py - INFO - 2022-08-04 00:00:00 ~ 2022-08-04 23:15:00 - missing_time_splite
+2025-04-03 13:33:12,789 - data_handler.py - INFO - 缺失点数:92.0 - missing_time_splite
+2025-04-03 13:33:12,790 - data_handler.py - INFO - 2022-08-05 00:00:00 ~ 2022-08-05 23:15:00 - missing_time_splite
+2025-04-03 13:33:12,790 - data_handler.py - INFO - 缺失点数:92.0 - missing_time_splite
+2025-04-03 13:33:12,791 - data_handler.py - INFO - 2022-08-06 00:00:00 ~ 2022-08-06 23:15:00 - missing_time_splite
+2025-04-03 13:33:12,791 - data_handler.py - INFO - 缺失点数:92.0 - missing_time_splite
+2025-04-03 13:33:12,792 - data_handler.py - INFO - 2022-08-07 00:00:00 ~ 2022-08-07 23:15:00 - missing_time_splite
+2025-04-03 13:33:12,792 - data_handler.py - INFO - 缺失点数:92.0 - missing_time_splite
+2025-04-03 13:33:12,793 - data_handler.py - INFO - 数据总数:8207, 时序缺失的间隔:3, 其中,较长的时间间隔:14 - missing_time_splite
+2025-04-03 13:33:12,793 - data_handler.py - INFO - 需要补值的总点数:4.0 - missing_time_splite
+2025-04-03 13:33:12,793 - data_handler.py - INFO - 再次测算,需要插值的总点数为:4.0 - fill_train_data
+2025-04-03 13:33:12,795 - data_handler.py - INFO - 2022-05-02 08:00:00 ~ 2022-05-05 23:45:00 有 352 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,799 - data_handler.py - INFO - 2022-05-09 00:00:00 ~ 2022-07-01 06:30:00 有 5115 个点, 填补 2 个点. - data_fill
+2025-04-03 13:33:12,800 - data_handler.py - INFO - 2022-07-01 23:45:00 ~ 2022-07-08 06:15:00 有 603 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,801 - data_handler.py - INFO - 2022-07-08 23:45:00 ~ 2022-07-09 06:15:00 有 27 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,802 - data_handler.py - INFO - 2022-07-09 23:45:00 ~ 2022-07-10 06:15:00 有 27 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,803 - data_handler.py - INFO - 2022-07-10 23:45:00 ~ 2022-07-11 06:00:00 有 26 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,804 - data_handler.py - INFO - 2022-07-11 23:45:00 ~ 2022-07-12 06:00:00 有 26 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,805 - data_handler.py - INFO - 2022-07-12 23:45:00 ~ 2022-07-13 06:00:00 有 26 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,807 - data_handler.py - INFO - 2022-07-13 23:45:00 ~ 2022-08-01 20:00:00 有 1810 个点, 填补 2 个点. - data_fill
+2025-04-03 13:33:12,808 - data_handler.py - INFO - 2022-08-01 23:45:00 ~ 2022-08-02 21:00:00 有 86 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,809 - data_handler.py - INFO - 2022-08-02 23:45:00 ~ 2022-08-04 00:00:00 有 98 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,810 - data_handler.py - INFO - 2022-08-04 23:15:00 ~ 2022-08-05 00:00:00 有 4 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,811 - data_handler.py - INFO - 2022-08-05 23:15:00 ~ 2022-08-06 00:00:00 有 4 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,812 - data_handler.py - INFO - 2022-08-06 23:15:00 ~ 2022-08-07 00:00:00 有 4 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,813 - data_handler.py - INFO - 2022-08-07 23:15:00 ~ 2022-08-07 23:45:00 有 3 个点, 填补 0 个点. - data_fill
+2025-04-03 13:33:12,813 - data_handler.py - INFO - 训练集分成了15段,实际一共补值4点 - data_fill
+2025-04-03 13:33:15,280 - data_handler.py - INFO - 特征处理-训练数据-不满足time_step - get_train_data
+2025-04-03 13:33:15,281 - data_handler.py - INFO - 特征处理-训练数据-无法进行最小分割 - get_train_data
+2025-04-03 13:33:15,281 - data_handler.py - INFO - 特征处理-训练数据-不满足time_step - get_train_data
+2025-04-03 13:33:15,281 - data_handler.py - INFO - 特征处理-训练数据-无法进行最小分割 - get_train_data
+2025-04-03 13:33:15,281 - data_handler.py - INFO - 特征处理-训练数据-不满足time_step - get_train_data
+2025-04-03 13:33:15,281 - data_handler.py - INFO - 特征处理-训练数据-无法进行最小分割 - get_train_data
+2025-04-03 13:33:15,281 - data_handler.py - INFO - 特征处理-训练数据-不满足time_step - get_train_data
+2025-04-03 13:33:15,281 - data_handler.py - INFO - 特征处理-训练数据-无法进行最小分割 - get_train_data
+2025-04-03 13:33:15,493 - dbmg.py - INFO - ❌ 系统异常: Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'} - get_keras_model_from_mongo
+2025-04-03 13:33:15,493 - tf_cnn.py - INFO - 加强训练加载模型权重失败:("Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'}",) - train_init
+2025-04-03 13:33:26,756 - tf_cnn.py - INFO - -----模型训练经过76轮迭代----- - training
+2025-04-03 13:33:26,756 - tf_cnn.py - INFO - 训练集损失函数为:[5.3196  2.96034 1.83915 1.399   1.15213 0.97754 0.84255 0.73772 0.66046
+ 0.60034 0.55292 0.51518 0.48333 0.45676 0.43364 0.41425 0.39769 0.3834
+ 0.37138 0.36097 0.35203 0.3447  0.33776 0.33146 0.32607 0.32143 0.31722
+ 0.31405 0.31122 0.30854 0.306   0.30391 0.30194 0.30016 0.29861 0.29733
+ 0.29619 0.29507 0.29394 0.29281 0.2917  0.29055 0.28939 0.28831 0.28746
+ 0.28662 0.28581 0.285   0.2843  0.28371 0.28309 0.28248 0.28181 0.28114
+ 0.28057 0.28002 0.27949 0.27907 0.27876 0.27847 0.27816 0.27786 0.27756
+ 0.27726 0.27697 0.27668 0.27638 0.27609 0.27581 0.27552 0.27525 0.27498
+ 0.27482 0.27454 0.27427 0.27401] - training
+2025-04-03 13:33:26,757 - tf_cnn.py - INFO - 验证集损失函数为:[3.92513 2.23538 1.60418 1.28774 1.08642 0.93493 0.81426 0.72426 0.65625
+ 0.6028  0.5611  0.52649 0.49804 0.47311 0.45227 0.43444 0.41905 0.40589
+ 0.39496 0.38506 0.37721 0.36995 0.3632  0.35745 0.35234 0.3479  0.34436
+ 0.34159 0.33884 0.33624 0.33404 0.33224 0.33051 0.32884 0.32741 0.32638
+ 0.32527 0.32424 0.32322 0.32202 0.32096 0.3199  0.31874 0.31774 0.31694
+ 0.31608 0.31535 0.31433 0.31367 0.31316 0.31234 0.3115  0.31067 0.30995
+ 0.30914 0.30852 0.30783 0.30739 0.30679 0.30646 0.30603 0.30568 0.30537
+ 0.3051  0.30508 0.3049  0.30503 0.30513 0.30515 0.30524 0.3053  0.30525
+ 0.30495 0.30523 0.30534 0.30523] - training
+2025-04-03 13:33:26,794 - dbmg.py - INFO - ❌ 数据库操作 - 详细错误: Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'} - insert_trained_model_into_mongo
+2025-04-03 13:51:00,688 - module_wrapper.py - WARNING - From E:\compete\app\model\losses.py:10: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.
+ - _tfmw_add_deprecation_warning
+2025-04-03 13:51:26,825 - module_wrapper.py - WARNING - From E:\compete\app\model\losses.py:10: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.
+ - _tfmw_add_deprecation_warning
+2025-04-03 13:51:26,937 - tf_cnn_pre.py - INFO - 算法状态异常:Traceback (most recent call last):
+  File "E:\compete\app\common\dbmg.py", line 436, in get_scaler_model_from_mongo
+    scaler_doc = collection.find_one(
+                 ^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\collection.py", line 1495, in find_one
+    for result in cursor.limit(-1):
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\cursor.py", line 1243, in next
+    if len(self.__data) or self._refresh():
+                           ^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\cursor.py", line 1160, in _refresh
+    self.__send_message(q)
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\cursor.py", line 1039, in __send_message
+    response = client._run_operation(
+               ^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\_csot.py", line 108, in csot_wrapper
+    return func(self, *args, **kwargs)
+           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 1425, in _run_operation
+    return self._retryable_read(
+           ^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 1534, in _retryable_read
+    return self._retry_internal(
+           ^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\_csot.py", line 108, in csot_wrapper
+    return func(self, *args, **kwargs)
+           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 1501, in _retry_internal
+    ).run()
+      ^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 2347, in run
+    return self._read() if self._is_read else self._write()
+           ^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 2479, in _read
+    with self._client._conn_from_server(self._read_pref, self._server, self._session) as (
+  File "D:\anaconda3\envs\py312\Lib\contextlib.py", line 137, in __enter__
+    return next(self.gen)
+           ^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 1351, in _conn_from_server
+    with self._checkout(server, session) as conn:
+  File "D:\anaconda3\envs\py312\Lib\contextlib.py", line 137, in __enter__
+    return next(self.gen)
+           ^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 1260, in _checkout
+    with server.checkout(handler=err_handler) as conn:
+  File "D:\anaconda3\envs\py312\Lib\contextlib.py", line 137, in __enter__
+    return next(self.gen)
+           ^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\pool.py", line 1763, in checkout
+    conn = self._get_conn(checkout_started_time, handler=handler)
+           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\pool.py", line 1921, in _get_conn
+    conn = self.connect(handler=handler)
+           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\pool.py", line 1725, in connect
+    conn.authenticate()
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\pool.py", line 1098, in authenticate
+    auth.authenticate(creds, self, reauthenticate=reauthenticate)
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\auth.py", line 656, in authenticate
+    auth_func(credentials, conn)
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\auth.py", line 560, in _authenticate_default
+    return _authenticate_scram(credentials, conn, "SCRAM-SHA-1")
+           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\auth.py", line 299, in _authenticate_scram
+    res = conn.command(source, cmd)
+          ^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\helpers.py", line 342, in inner
+    return func(*args, **kwargs)
+           ^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\pool.py", line 988, in command
+    return command(
+           ^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\network.py", line 212, in command
+    helpers._check_command_response(
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\helpers.py", line 248, in _check_command_response
+    raise OperationFailure(errmsg, code, response, max_wire_version)
+pymongo.errors.OperationFailure: Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'}
+
+The above exception was the direct cause of the following exception:
+
+Traceback (most recent call last):
+  File "E:\compete\app\predict\tf_cnn_pre.py", line 41, in model_prediction
+    feature_scaler, target_scaler = mgUtils.get_scaler_model_from_mongo(params)
+                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "E:\compete\app\common\dbmg.py", line 474, in get_scaler_model_from_mongo
+    raise RuntimeError(f"🔌 数据库操作失败: {str(e)}") from e
+RuntimeError: 🔌 数据库操作失败: Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'}
+ - model_prediction
+2025-04-03 13:51:26,942 - tf_cnn_pre.py - INFO - cnn预测任务:用了 0.01752614974975586 秒  - model_prediction
+2025-04-03 13:59:47,178 - module_wrapper.py - WARNING - From E:\compete\app\model\losses.py:10: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.
+ - _tfmw_add_deprecation_warning
+2025-04-03 13:59:47,295 - tf_cnn_pre.py - INFO - 算法状态异常:Traceback (most recent call last):
+  File "E:\compete\app\common\dbmg.py", line 436, in get_scaler_model_from_mongo
+    scaler_doc = collection.find_one(
+                 ^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\collection.py", line 1495, in find_one
+    for result in cursor.limit(-1):
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\cursor.py", line 1243, in next
+    if len(self.__data) or self._refresh():
+                           ^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\cursor.py", line 1160, in _refresh
+    self.__send_message(q)
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\cursor.py", line 1039, in __send_message
+    response = client._run_operation(
+               ^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\_csot.py", line 108, in csot_wrapper
+    return func(self, *args, **kwargs)
+           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 1425, in _run_operation
+    return self._retryable_read(
+           ^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 1534, in _retryable_read
+    return self._retry_internal(
+           ^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\_csot.py", line 108, in csot_wrapper
+    return func(self, *args, **kwargs)
+           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 1501, in _retry_internal
+    ).run()
+      ^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 2347, in run
+    return self._read() if self._is_read else self._write()
+           ^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 2479, in _read
+    with self._client._conn_from_server(self._read_pref, self._server, self._session) as (
+  File "D:\anaconda3\envs\py312\Lib\contextlib.py", line 137, in __enter__
+    return next(self.gen)
+           ^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 1351, in _conn_from_server
+    with self._checkout(server, session) as conn:
+  File "D:\anaconda3\envs\py312\Lib\contextlib.py", line 137, in __enter__
+    return next(self.gen)
+           ^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\mongo_client.py", line 1260, in _checkout
+    with server.checkout(handler=err_handler) as conn:
+  File "D:\anaconda3\envs\py312\Lib\contextlib.py", line 137, in __enter__
+    return next(self.gen)
+           ^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\pool.py", line 1763, in checkout
+    conn = self._get_conn(checkout_started_time, handler=handler)
+           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\pool.py", line 1921, in _get_conn
+    conn = self.connect(handler=handler)
+           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\pool.py", line 1725, in connect
+    conn.authenticate()
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\pool.py", line 1098, in authenticate
+    auth.authenticate(creds, self, reauthenticate=reauthenticate)
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\auth.py", line 656, in authenticate
+    auth_func(credentials, conn)
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\auth.py", line 560, in _authenticate_default
+    return _authenticate_scram(credentials, conn, "SCRAM-SHA-1")
+           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\auth.py", line 299, in _authenticate_scram
+    res = conn.command(source, cmd)
+          ^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\helpers.py", line 342, in inner
+    return func(*args, **kwargs)
+           ^^^^^^^^^^^^^^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\pool.py", line 988, in command
+    return command(
+           ^^^^^^^^
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\network.py", line 212, in command
+    helpers._check_command_response(
+  File "D:\anaconda3\envs\py312\Lib\site-packages\pymongo\helpers.py", line 248, in _check_command_response
+    raise OperationFailure(errmsg, code, response, max_wire_version)
+pymongo.errors.OperationFailure: Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'}
+
+The above exception was the direct cause of the following exception:
+
+Traceback (most recent call last):
+  File "E:\compete\app\predict\tf_cnn_pre.py", line 41, in model_prediction
+    feature_scaler, target_scaler = mgUtils.get_scaler_model_from_mongo(params)
+                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  File "E:\compete\app\common\dbmg.py", line 474, in get_scaler_model_from_mongo
+    raise RuntimeError(f"🔌 数据库操作失败: {str(e)}") from e
+RuntimeError: 🔌 数据库操作失败: Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'}
+ - model_prediction
+2025-04-03 13:59:47,299 - tf_cnn_pre.py - INFO - cnn预测任务:用了 0.01714491844177246 秒  - model_prediction

+ 1 - 1
app/model/main.py

@@ -87,7 +87,7 @@ def input_file_handler(input_file: str, model_name: str):
         plant_id = int(station_info['PlantID'][0])
         # 含有model,训练
         if 'model' in input_file.lower():
-            if env is not None:     # 进行限电清洗
+            if env is not None and params['clean_power']:     # 进行限电清洗
                 power = clean_power(power, env, plant_id)
             train_data = pd.merge(nwp_v_h, power, on=params['col_time'])
             if model_name == 'fmi':