This commit is contained in:
HuangHai
2026-01-16 19:44:58 +08:00
parent f087fac666
commit 95a96e2f0e
6 changed files with 16 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
# 采集配置 # 采集配置
SCROLL_DISTANCE_RATIO = 0.3 SCROLL_DISTANCE_RATIO = 0.3
MAX_STATIONS_COUNT = 1 MAX_STATIONS_COUNT = 20
FIRST_RUN_ONLY_ONE_STATION = False FIRST_RUN_ONLY_ONE_STATION = False
REDIS_STATION_EXPIRE = 120 REDIS_STATION_EXPIRE = 120

View File

@@ -188,6 +188,10 @@ class TeLaiDianCrawler(BaseCrawler):
break break
name = station.get("name") name = station.get("name")
status_text = station.get("status_text") or ""
if station.get("is_closed") is True or ("歇业中" in status_text):
logger.info(f"列表标记为歇业中,跳过场站: {name}")
continue
point = station.get("point") point = station.get("point")
if not name or not point: if not name or not point:

View File

@@ -282,19 +282,22 @@ class ReadImageKit:
识别规则: 识别规则:
1. 必须是卡片形式的充电站信息区域。 1. 必须是卡片形式的充电站信息区域。
2. 每一个卡片通常包含以下要素: 2. 每一个卡片通常包含以下要素:
- **场站名称 (name)**: 通常位于卡片顶部,字体最大且加粗。 - 场站名称 (name)
- **距离信息 (distance)**: 例如 '5.3km' 或 '90m',通常在名称附近或卡片右上角。 - 距离信息 (distance),例如 '5.3km' 或 '90m'
- **价格 (price)**: 例如 '0.84',通常以 ¥ 开头。 - 价格信息
- **枪数信息**: 如 '快 闲10/12',请解析为 total_piles 与 free_piles(若不可判定则为 null)。 - 枪数信息,如 '快 闲10/12',用于解析 total_piles 与 free_piles
- 营业状态标签,例如“营业中”“歇业中”等
对于每张卡片,请输出: 对于每张卡片,请输出:
- name: 场站名称 - name: 场站名称
- distance: 距离信息字符串(例如 '5.3km' 或 '90m')。必须精准提取,不要遗漏单位。 - distance: 距离信息字符串(例如 '5.3km' 或 '90m')
- address: 场站地址(如果卡片上有显示则提取,无则为 null) - address: 场站地址(如果卡片上有显示则提取,无则为 null)
- point: 卡片中心点击坐标 [x, y],使用归一化坐标 [0-1000] - point: 卡片中心点击坐标 [x, y],使用归一化坐标 [0-1000]
- bbox: 卡片外接矩形边界 [x1, y1, x2, y2],使用归一化坐标 [0-1000] - bbox: 卡片外接矩形边界 [x1, y1, x2, y2],使用归一化坐标 [0-1000]
- total_piles: 卡片可见的总桩数(整数或 null) - total_piles: 卡片可见的总桩数(整数或 null)
- free_piles: 卡片可见的空闲桩数(整数或 null) - free_piles: 卡片可见的空闲桩数(整数或 null)
- status_text: 卡片上的营业状态原文字符串,例如“营业中”“歇业中”“暂停营业”等,如无则为 null
- is_closed: 是否为歇业状态,布尔值。只要卡片上出现“歇业中”“暂停营业”等含义的字样,请设为 true。
输出格式为 JSON 数组。 输出格式为 JSON 数组。
注意:严禁识别广告位、筛选标签或功能入口。真正的场站卡片通常是一个横跨屏幕的大区域。 注意:严禁识别广告位、筛选标签或功能入口。真正的场站卡片通常是一个横跨屏幕的大区域。
@@ -377,7 +380,9 @@ class ReadImageKit:
"point": actual_p, "point": actual_p,
"bbox": actual_bbox, "bbox": actual_bbox,
"total_piles": res.get("total_piles"), "total_piles": res.get("total_piles"),
"free_piles": res.get("free_piles") "free_piles": res.get("free_piles"),
"status_text": res.get("status_text"),
"is_closed": res.get("is_closed")
}) })
if final_stations: if final_stations: