Files
ns2.0/backend/app/crawler/UPGRADE.md
Nvex 720402ffe7 feat: NEXT Store 2.0 重大更新 - 完整重构前后端
🎉 主要更新:

后端:
- 全新华为应用市场爬虫系统
- 三表分离数据库设计 (app_info, app_metrics, app_rating)
- 完整的API接口 (搜索、分类、热门、上新等)
- 元服务自动识别和分类
- 智能Token管理和数据处理
- 修复热门应用重复显示问题

前端:
- 全新首页设计 (今日上架、热门应用)
- 应用页面 (彩色分类磁贴、智能图标匹配)
- 今日上新页面 (日期切换)
- 热门应用页面 (卡片布局)
- 应用详情页面 (完整信息展示)
- Apple风格搜索栏
- Footer组件
- 底部导航栏优化 (4个导航项)
- 骨架屏加载效果
- FontAwesome图标集成

UI/UX:
- 统一浅色背景 (#F5F5F7)
- 流畅的过渡动画
- 响应式设计
- 毛玻璃效果

文档:
- CHANGELOG.md - 完整更新日志
- QUICKSTART.md - 快速开始
- 多个技术文档和使用指南

版本: v2.0.0
2025-10-25 21:20:32 +08:00

79 lines
1.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.

# 爬虫升级说明
## 新功能
### 1. 增加更多字段
现在爬虫会保存以下额外信息:
- **开发者信息**: dev_id, supplier
- **分类信息**: kind_id, tag_name
- **价格信息**: price
- **设备支持**: main_device_codes手机、平板、智慧屏等
- **SDK信息**: target_sdk, min_sdk, compile_sdk_version, min_hmos_api_level
- **其他信息**: ctype, app_level, packing_type
### 2. 并发爬取
- 默认并发数5个应用同时爬取
- 速度提升:约 **5倍**
- 可自定义并发数
## 升级步骤
### 1. 数据库迁移
```bash
cd backend
python3 migrate_db.py
```
### 2. 重新爬取数据
```bash
cd app/crawler
python3 crawl.py --limit 10
```
## 使用方法
### 基本用法默认并发5
```bash
python3 app/crawler/crawl.py
```
### 自定义并发数
修改 `crawler.py` 中的 `batch_size` 参数:
```python
await crawler.crawl_by_ids(limit=10, batch_size=10) # 10个并发
```
## 性能对比
| 模式 | 爬取100个应用 | 爬取962个应用 |
|------|--------------|--------------|
| 旧版(串行) | ~50秒 | ~8分钟 |
| 新版并发5 | ~10秒 | ~2分钟 |
| 新版并发10 | ~5秒 | ~1分钟 |
## 注意事项
1. **并发数不宜过大**建议5-10之间避免触发API限流
2. **数据库连接**:确保数据库支持并发写入
3. **网络稳定性**:并发爬取对网络要求更高
## 新增字段说明
### 设备代码映射
- `0`: 手机
- `1`: 平板
- `2`: 智慧屏
- `3`: 手表
- `4`: 车机
- `5`: PC
### SDK版本
- `target_sdk`: 目标SDK版本
- `min_sdk`: 最低SDK版本
- `min_hmos_api_level`: 最低HarmonyOS API级别
### 应用级别
- `app_level`: 应用级别1-5
- `ctype`: 内容类型
- `packing_type`: 打包类型