Files
MemRelay/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/CapacityReport 的 CellData.cellinfo 表来源.md
T
memrelay e00e5131fb create: CapacityReport 的 CellData.cellinfo 表来源
MemRelay-Operation: memory-save:capreport-cellinfo-source-20261110-1
MemRelay-Resource: 7cae0622-21fd-48db-ae5f-7b5162261a9c
2026-11-10 20:26:06 +08:00

40 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: CapacityReport 的 CellData.cellinfo 表来源
type: fact
permalink: main/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/capacity-report-的-cell-data.cellinfo-表来源
stable_id: 7cae0622-21fd-48db-ae5f-7b5162261a9c
scope: project
memory_type: fact
project_id: d5a7f581-c442-4554-87b9-ee723b8b0258
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
status: active
revision: 1
request_id: capreport-cellinfo-source-20261110-1
created_at: '2026-11-10T12:26:03.394405+00:00'
updated_at: '2026-11-10T12:26:03.394405+00:00'
tags:
- CapacityReport
- CellData
- cellinfo
- 工参
- 经纬度
---
## 来源
- 网管 300 表压缩包 `Result_300_*.zip`。默认扫描路径 `/网优日常优化数据文档/日常性能报表/{maxyear}年/300表`,下一级子目录是频段(2.6G、700M),每个频段目录取文件名末尾 14 位时间戳最大的 ZIP(不用 SFTP 修改时间)。
- 只解析 ZIP 内三类 CSV:`LTE_ITBBU_CellInfo`、`LTE_SDR_CellInfo`、`NR_CellInfo`(按文件名前缀 + 频段目录匹配)。编码先 UTF-8,回退 GB18030/GBK。
## 字段映射(Configure.json 的 CellData.mapping,可在设置页改)
- 表只有 11 列:CGI、eNodeBID、CellID、PLMN、基站名称、小区名称、频点、带宽、制式、功率、网络。没有经纬度。CapacityReport 全项目搜不到 longitude/latitude/经度/纬度。
- 4G:eNodeBID←eNBId,CellID←cellLocalId,PLMN←plmn,基站名称←eNBName,小区名称←CellName(LTE_SDR 是 cellName),频点←frequency,带宽←bandWidth,制式←radioMode,功率←cpSpeRefSigPwr,网络固定 4G。
- 5G:eNodeBID←gNBId,基站名称←gNBName,频点←ssbFrequency,带宽←carrierBandwidth,功率←powerPerRERef,制式固定为目录频段(2.6G/700M),网络固定 5G。
- CGI = `{PLMN}-{eNodeBID}-{CellID}`,例如 460-00-12683845-1。拼出空值或含 `--` 的行跳过;同 CGI 后读到的覆盖先读到的。
## 写入方式
- `app/services/cell_data.py::_replace_cellinfo`:CREATE TABLE IF NOT EXISTS 后 TRUNCATE 整表,再每 1000 行批量 INSERT,一个事务。只有 CGI 普通索引,不是主键。
- 触发:数据处理页 CellData 卡片上传文件夹(run_local)、远程下载并处理、以及容量处理前自动刷新(远程源启用时,失败只警告)。
- 之后执行 `CellData.sql`:把带宽规范成 `20M` 形式,再由 cellinfo 逆推 `sector`(扇区/物理站/制式/频段/带宽/站型/网络),sector 只补缺不覆盖人工修正。
- 容量处理时再把 celldata 库所有表 DROP+CREATE+整表复制到容量主库(两库相同则跳过)。
## 未确认
- 原始 CellInfo CSV 里有没有经纬度列:仓库里没有样本 ZIP,未看过完整表头。