Commit Graph

17 Commits

Author SHA1 Message Date
Huamonarch
62a2e5568b fix: expression_engine.h 添加 <mix_cc/ihyper_db.h> 以解析 time_range_t 2026-05-15 15:46:37 +08:00
Huamonarch
4f8eecd828 refactor: 提取 StatCollector 统计学习组件
将 ExpBase::cron_proc() 中的 DAA::STA 统计学习逻辑提取到独立的
StatCollector 工具类,统一管理分布统计的生命周期(样本累积、分布
初始化、DB2 持久化、置信区间更新)。同时将 exec_task() 与
task_mon_pro() 中的任务相关 STA 操作也委托给 StatCollector。

新增:
- eqpalg/utility/stat_collector.h  -- StatCollector 接口
- eqpalg/utility/stat_collector.cpp -- StatCollector 实现

修改:
- eqpalg/algs/exp_base.h  -- 替换 sta_ptr_ 为 stat_collector_
- eqpalg/algs/exp_base.cpp -- cron_proc/reload_ci_dist/reset_dev_data/
                               exec_task/task_mon_pro 委托给 StatCollector
2026-05-15 14:21:36 +08:00
Huamonarch
b9cf5f4e9e refactor: 提取 BoundChecker 上下限检测组件
从 ExpBase 提取 detect_up_down() 逻辑和哨兵值处理至独立的 BoundChecker 类。
将 DetectMode 从 struct 升级为 enum class。
2026-05-15 14:09:56 +08:00
Huamonarch
9f66fc10b3 feat: FbStateMachine 状态转换 + 变量操作实现 2026-05-15 13:22:16 +08:00
Huamonarch
f2f6d6ffb1 feat: 添加 FbStateMachine 头文件 2026-05-15 13:19:19 +08:00
Huamonarch
e9b2c178ba refactor: 删除 ExpModule 类(已被 ExpressionEngine 替代) 2026-05-15 13:15:05 +08:00
Huamonarch
693d3b5197 feat: ExpressionEngine firstFill + printVars 实现 2026-05-15 12:32:20 +08:00
Huamonarch
e575efdc8a feat: ExpressionEngine FunVars 控制 + hold 变量管理 2026-05-15 12:30:11 +08:00
Huamonarch
50173683db feat: ExpressionEngine 变量刷新实现(MEMORY + IHDB) 2026-05-15 12:27:58 +08:00
Huamonarch
da9eb2ea2e feat: ExpressionEngine 核心实现(注册 + 求值) 2026-05-15 12:25:30 +08:00
Huamonarch
2f7ca1e123 feat: 添加 ExpressionEngine 头文件声明 2026-05-15 12:17:27 +08:00
Huamonarch
11e5a6aeef Use angle-bracket include for async_db_worker.h
Matches codebase convention: all includes use <> paths, never "".
2026-05-13 13:51:49 +08:00
Huamonarch
f80a917ab7 Async-ify ExpTimes DB persistence with global singleton worker thread
Add AsyncDbWorker: a persistent background thread with dedup queue that
executes DB2 writes asynchronously, keeping the mon 20ms cycle free of
blocking I/O.

Changes:
- async_db_worker.h/.cc: singleton worker, submit() with rule_id dedup,
  drain_and_stop() for clean shutdown
- eqp_stat.h/.cc: new update_static(ruleid, shear_times, running_time)
  overload that skips redundant DB reads for known values (reduces
  5 SELECTs to 3 per persist cycle)
- exp_times.cc: extract persist_exp_times() as a standalone function,
  update_history_times() snapshots values and submits to worker
  (returns immediately), reset_dev_data() uses direct SHM update
- eqpalg_icei.cpp: alg_mgr_.reset() → drain_and_stop() in destructor
  ensures all algorithm threads are stopped before draining the worker

Risk: re-run cmake .. to pick up the new async_db_worker.cc file.
2026-05-13 13:32:50 +08:00
Huamonarch
b3932b0af8 Fix: update_cold must not overwrite SHM stat_values and fetch_mark
Mon's update_map_rule() called update_cold() which blindly copied
RuleStatLocal's stat_values (always empty in mon) and fetch_mark
(always false in mon) into SHM, destroying accumulated data and
breaking the mon-cron handshake.

stat_values and fetch_mark are managed exclusively by the
add_stat_value/get_stat_value handshake. The cold sync path only
needs to transport running_time and shear_times.
2026-05-13 11:22:42 +08:00
Huamonarch
973921fc4b Split RuleStat display from cold data paths to reduce lock contention
Display data (alarm_value, current_value, limit_up/down, items, unit) now
goes to a local-memory DisplayCache and is serialized to JSON without any
shared memory lock. Cold data (stat_values, running_time, shear_times, etc.)
stays in shared memory for mon-cron IPC, protected by a real interprocess
mutex (boost::interprocess::interprocess_mutex) instead of the broken
process-local std::mutex. AlgBase::rule_stat_ is now RuleStatLocal with
standard types — zero changes to algorithm subclass code.
2026-05-12 15:46:01 +08:00
Huamonarch
224c2c45c4 Remove irrelevant comments from eqpalg source files
Cleaned 66 files across all eqpalg subdirectories:
- Removed commented-out dead code
- Removed redundant Chinese inline comments that restate variable/function names
- Removed trailing ///< annotations on self-explanatory fields
- Removed namespace closing comments
- Preserved all file headers, Doxygen documentation, and logic explanations
- No code changes — only comment removal
2026-05-09 13:30:09 +08:00
Huamonarch
7e602c7bc1 Initial commit: EIS C++ project with multi-process code 2026-05-09 11:23:45 +08:00