By DaYePython
Chinese utility for parsing cloud recharge communication protocols and handling related data processing tasks.
一个用于解析云快充充电桩通信协议报文的Python工具,支持云快充协议V1.6。
| 帧类型 | 说明 | 解析状态 |
|---|---|---|
| 0x01 | 充电桩登录认证 | ✅ 完整解析 |
| 0x02 | 登录认证应答 | ✅ 完整解析 |
| 0x12 | 读取实时监测数据 | ✅ 完整解析 |
| 0x13 | 上传实时监测数据 | ✅ 完整解析 |
| 其他 | 其他帧类型 | ⚠️ 返回原始数据 |
python scripts/parse_ykc.py "68 22 0000 00 01 55031412782305 00 02 0F 56342E312E353000 01 01010101010101010101 04 675A"
from scripts.parse_ykc import YKCParser
# 创建解析器实例
parser = YKCParser()
# 解析报文
hex_string = "68 22 0000 00 01 55031412782305 00 02 0F 56342E312E353000 01 01010101010101010101 04 675A"
result = parser.parse(hex_string)
# 输出结果
print(result)
输入报文:
68 22 0000 00 01 55031412782305 00 02 0F 56342E312E353000 01 01010101010101010101 04 675A
解析结果:
{
"code": 200,
"msg": "解析成功",
"start_flag": "0x68",
"data_length": 34,
"sequence_number": 0,
"encrypt_flag": "0x00",
"is_encrypted": false,
"frame_type": "0x01",
"frame_type_name": "充电桩登录认证",
"body_length": 28,
"crc16_received": "0x675A",
"crc16_calculated": "0x675A",
"crc16_valid": true,
"body_data": {
"pile_code": "55031412782305",
"pile_type": "直流桩",
"gun_count": 2,
"protocol_version": "v1.5",
"program_version": "v4.1.50",
"network_type": "LAN",
"sim_card": "01010101010101010101",
"operator": "其他"
}
}
输入报文:
68 40 1A03 00 13 01 01 00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 00000000 00000000 00 00 00 00 00 00 9DAC
解析结果:
{
"code": 200,
"msg": "解析成功",
"frame_type": "0x13",
"frame_type_name": "上传实时监测数据",
"body_data": {
"gun_no": 1,
"work_status": "空闲中",
"soc": 0,
"voltage": 0.0,
"current": 0.0,
"charged_kwh": 0.0,
"charged_duration": 0,
"reserved": "..."
}
}
ykc-parser/
├── scripts/
│ ├── parse_ykc.py # 主解析脚本
│ ├── crc16.py # CRC16校验模块
│ ├── frame_parsers.py # 帧类型解析器
│ └── parser_factory.py # 解析器工厂
├── references/
│ ├── docs/ # 完整协议文档
│ ├── protocol_structure.md # 协议结构快速参考
│ ├── data_formats.md # 数据格式定义
│ └── frame_types.md # 帧类型定义表
├── .claude-plugin/
│ └── marketplace.json # Claude技能配置
├── test_all_frames.py # 测试脚本
├── SKILL.md # 技能说明文档
└── README.md # 本文件
项目包含完整的云快充协议V1.6参考文档:
协议基础: references/docs/02-协议基础/
业务流程: references/docs/
附录: references/docs/11-附录/
| 类型 | 说明 | 转换方式 |
|---|---|---|
| BCD码 | 每字节表示两位十进制数 | 直接转十六进制字符串 |
| BIN小端 | 小端序二进制 | int.from_bytes(byteorder='little') |
| ASCII码 | ASCII字符串 | decode('ascii') 并移除尾部0x00 |
解析器提供完善的错误处理机制:
本项目可作为Claude Code技能使用,让Claude自动解析云快充报文。
/plugin marketplace add DaYePython/ykc-parser
/marketplace
ykc-parser 或 云快充,点击安装即可这是最简单的安装方式,Claude会自动下载和配置技能。只需在首次使用时注册一次marketplace。
cd ~/.claude/skills
git clone https://github.com/DaYePython/ykc-parser.git
下载本仓库的ZIP文件:
解压到Claude技能目录:
C:\Users\<你的用户名>\.claude\skills\ykc-parser~/.claude/skills/ykc-parser重启Claude Code
安装完成后,在Claude Code中输入:
/skills
查看技能列表中是否有ykc-parser。
安装成功后,你可以直接在Claude Code中使用:
帮我解析这个云快充报文: 68 22 0000 00 01 55031412782305 00 02 0F 56342E312E353000 01 01010101010101010101 04 675A
或者明确调用技能:
使用ykc-parser技能解析报文: 68 40 1A03 00 13 ...
Claude会自动:
MIT License
欢迎提交Issue和Pull Request!
如有问题或建议,请通过以下方式联系:
注意: 本项目用于云快充充电桩通信协议的学习和开发,请遵守相关协议规范和使用条款。
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-4 --plugin dayepython-ykc-parserUltra-compressed communication mode. Cuts 65% of output tokens (measured) while keeping full technical accuracy by speaking like a caveman.
UI/UX design intelligence. Searchable local database with 84 styles, 192 palettes, 74 font pairings, 25 charts, and 22 stacks (React, Next.js, Vue, Nuxt.js, Nuxt UI, Svelte, Astro, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, Jetpack Compose, Angular, Laravel, JavaFX, WPF, WinUI, Avalonia, Uno Platform, UWP, Three.js). Use when designing, building, or reviewing UI: pages, components, color schemes, typography, layout, accessibility, animation, or data visualization.
Frontend design skill for UI/UX implementation
Comprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.
Memory compression system for Claude Code - persist context across sessions
Marketing skills for AI agents — conversion optimization, copywriting, SEO, paid ads, ad creative, and growth