فهرست منبع

refactor(tower): 基站库改用固定路径,不再读取系统配置 cellLocal

- CELL_TOWER_PATH_BIN 指向实际库文件 BSSinfo_sc.bin
- TowerUtils.init 固定加载 qingjian/system/libs/cell/BSSinfo_sc.bin,
  不再依赖 conf/c5e503ad.json 的 cellLocal(缺失时查询会静默返回空)
- cell_init 增加返回值校验,失败时复位标记并允许下次重试
- 同步更新 QUICK_START / storage-layout 文档
cc 2 هفته پیش
والد
کامیت
2882188365

+ 1 - 1
QUICK_START.md

@@ -94,7 +94,7 @@ qingjian/
 | `qingjian/system/rocksdb/d5e03ad1/` | 内置银行卡 BIN、手机号运营商 RocksDB |
 | `qingjian/system/rocksdb/uy76tkp8/data.db` | RogueMap 数据 |
 | `qingjian/system/db/5w8mf4kf` | 基础案件库模板(保持原名);`system/db/` 同时放平台库与临时库 |
-| `qingjian/system/libs/cell/` | 基站库 `cellinfo.bin` + `libCell.dll/.so`(JNI) |
+| `qingjian/system/libs/cell/` | 基站库 `BSSinfo_sc.bin` + `libCell.dll/.so`(JNI,路径固定在 `PathConst.CELL_TOWER_PATH_BIN`) |
 | `qingjian/system/libs/7zip/` | 7z 解压工具 |
 | `qingjian/system/license/` | 授权文件 `license.xlts` 与 `regInfo` 工具 |
 | `qingjian/system/models/` | bge-m3、vosk-model |

+ 1 - 1
ai-server/src/main/java/com/zsjz/ai/common/constants/PathConst.java

@@ -76,7 +76,7 @@ public class PathConst {
     public static final Path CELL_TOWER_DIR = SYSTEM_PATH.resolve("libs").resolve("cell");
     public static final Path CELL_TOWER_PATH = CELL_TOWER_DIR.resolve("libCell.dll");
     public static final Path CELL_TOWER_PATH_SO = CELL_TOWER_DIR.resolve("libCell.so");
-    public static final Path CELL_TOWER_PATH_BIN = CELL_TOWER_DIR.resolve("cellinfo.bin");
+    public static final Path CELL_TOWER_PATH_BIN = CELL_TOWER_DIR.resolve("BSSinfo_sc.bin");
 
     /**
      * 系统配置文件路径

+ 10 - 18
ai-server/src/main/java/com/zsjz/ai/common/utils/TowerUtils.java

@@ -1,17 +1,14 @@
 package com.zsjz.ai.common.utils;
 
-import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.ReUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zsjz.ai.common.constants.PathConst;
 import com.sun.jna.ptr.DoubleByReference;
-import com.zsjz.ai.common.constants.PathConst;
 import lombok.extern.slf4j.Slf4j;
 
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
@@ -57,26 +54,21 @@ public class TowerUtils {
             return;
         }
         try {
-            String cellLocal = SystemConfManager.INSTANCE.getCellLocal();
-            if (StrUtil.isEmpty(cellLocal)) {
-                log.info("请先设置基站数据库路径!");
+            // 固定路径:基站库随程序资产放在 qingjian/system/libs/cell/ 下,
+            // 不再读取系统配置里的 cellLocal(配置缺失会让基站查询静默返回空结果)
+            Path path = PathConst.CELL_TOWER_PATH_BIN;
+            if (Files.notExists(path)) {
+                log.error("基站数据库文件不存在: {}", path);
                 FLAG.set(false);
                 return;
             }
-            Path path = Paths.get(cellLocal);
-            if (Files.exists(path)) {
-                String name = FileUtil.getName(path);
-                if (!StrUtil.endWith(name, ".bin")) {
-                    log.info("基站数据库文件名不正确!");
-                    FLAG.set(false);
-                    return;
-                }
-                CellDll.INSTANCE_DLL.cell_init(cellLocal);
-                log.info("基站数据库路径已经加载!");
+            int status = CellDll.INSTANCE_DLL.cell_init(path.toString());
+            if (status != 0) {
+                log.error("基站数据库初始化失败, status={}, path={}", status, path);
+                FLAG.set(false);
                 return;
             }
-            log.info("基站数据库路径不存在!");
-            FLAG.set(false);
+            log.info("基站数据库已加载: {}", path);
         } catch (Throwable t) {
             FLAG.set(false);
             throw t;

+ 1 - 1
docs/design/storage-layout.md

@@ -27,7 +27,7 @@ qingjian/
 │   ├── db/plat、db/temp              # 平台库 / 全局临时库
 │   ├── license/                      # license.xlts、regInfo
 │   ├── rocksdb/d5e03ad1、uy76tkp8    # 银行卡 BIN、运营商、RogueMap
-│   ├── libs/cell/                    # libCell.dll/.so、cellinfo.bin
+│   ├── libs/cell/                    # libCell.dll/.so、BSSinfo_sc.bin
 │   ├── libs/7zip/                    # 7z.exe / 7zz
 │   ├── native/                       # OpenCV 原生库
 │   ├── models/bge-m3、models/vosk-model