feat: 增加小区经纬度匹配

This commit is contained in:
2026-08-03 10:42:45 +08:00
parent 1a6658dd03
commit 470763a818
4 changed files with 222 additions and 7 deletions
+6 -2
View File
@@ -16,15 +16,17 @@ output/2026073110001100/
└── manifest.json
```
For every run, the script also reads the latest filename-dated XLSX from each configured CellData directory. It builds CellData CGI as `460-00-{eNB/gNB}-{CI}` and adds coordinates to matching interference rows. Unmatched rows keep empty coordinates.
The summary columns are:
```text
hour_start,hour_end,cgi,cell_name,interference_dbm
hour_start,hour_end,cgi,cell_name,interference_dbm,longitude,latitude
```
The script never modifies or deletes source storage files. By default it writes the complete selected hour to MySQL and keeps only that hour in the target table.
The database table contains one time column, `metric_time DATETIME`, which is the source KPI start time. A same-hour rerun replaces that whole batch. After a successful insert, rows for every other hour are deleted in the same transaction. The script refuses to replace a newer database hour with an older source hour.
The database table contains one time column, `metric_time DATETIME`, which is the source KPI start time, plus nullable `longitude` and `latitude` columns. A same-hour rerun replaces that whole batch. After a successful insert, rows for every other hour are deleted in the same transaction. The script refuses to replace a newer database hour with an older source hour.
CGI is generated with fixed rules:
@@ -33,6 +35,8 @@ CGI is generated with fixed rules:
MySQL connection values, database `interference_etl`, and table `interference_hourly_summary` are constants at the top of `main.py`; they are not project environment variables. The script creates its database and table automatically when they do not exist.
The five CellData directories are fixed in `CELL_DATA_DIRECTORIES`. In each directory, only XLSX files ending with a valid `YYYYMMDD.xlsx` date are considered, and the latest date is selected.
## Local development
```powershell