OCPP1.6-1-文档概述

OCPP 1.6 文档概述

目前OCA官方OCPP1.6的最新版文档是 OCPP_1.6_documentation_2019_12

其中包含了6个文件和schemas文件夹:

序号 文档名 描述
0 ocpp-1.6 edition 2.pdf Open Charge Point Protocol 1.6 协议内容
1 ocpp-1.6-errata-sheet.pdf OCPP 1.6 勘误表
2 ocpp-j-1.6-errata-sheet.pdf OCPP 1.6 J 勘误表
3 ocpp-j-1.6-specification.pdf OCPP 1.6 J 规范
4 ocpp-s-1.6-specification.pdf OCPP 1.6 S 规范
5 ocpp-s-1.6-errata-sheet.pdf OCPP 1.6 S 勘误表
6 schemas OCPP 1.6 J & S 消息描述文档

这里的JS分别是jsonxml soap,这里我们只看使用最广泛的·json

OCPP 1.6 J 规范要求

连接方式

  1. 使用基于TCP的Websocket连接;
  2. 中央系统充当 WebSocket 服务器,充电点充当 WebSocket客户端;
  3. 充电点需要一个唯一标识用于连接,例:ws://centralsystem.example.com/ocpp/CP001
  4. OCPP-J 连接握手的 HTTP 请求示例 :
GET /ocpp/CP001 HTTP/1.1
Host: centralsystem.example.com:33033
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==
Sec-WebSocket-Protocol: ocpp1.6, ocpp1.5
Sec-WebSocket-Version: 13
  1. 服务器响应示例:
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
Sec-WebSocket-Protocol: ocpp1.6
  1. WebSocket Ping

WebsSocket 规范定义了 Ping 和 Pong 框架,用于检查远程端点是否仍在响应,类似于心跳信息。
ocpp 定义了一个 key 来配置这个功能:

配置键 说明
WebSocketPingInterval 0-禁用客户端 websocket Ping/Pong,客户端可以回复Pong。
>0 客户端ping的间隔秒数

消息框架

  1. 发送一条消息(CALL),收到一条回复(CALLRESULT)或无法正确处理的解释(CALLERROR);
  2. 除非之前发送的所有 CALL 信息都已响应或超时,否则充电点或中央系统不应向对方发送 CALL 信息,实施方可自由选择超时时间间隔;
  3. 字符编码:UTF8;
  4. 消息类型:
消息类型 类型编号 方向
CALL 2 客户端对服务器
CALLRESULT 3 服务器到客户端
CALLERROR 4 服务器到客户端
  1. 消息ID:
名称 数据类型 限制 要求
messageId 字符串 最多 36 个字符 1. ID 必须不同于同一发送方在同一 WebSocket 连接上用于 CALL 消息的所有消息 ID
2. CALLRESULT 或 CALLERROR 的消息 ID 必须等于所响应的 CALL 消息的 ID
  1. CALL 消息格式:

[<MessageTypeId>, "<UniqueId>", "<Action>", {<Payload>}]

  1. CallResult :

[<MessageTypeId>, "<UniqueId>", {<Payload>}]

  1. CallError:

[<MessageTypeId>, "<UniqueId>", "<errorCode>", "<errorDescription>", {<errorDetails>}]

错误码 描述
NotImplemented 未实施 Requested Action is not known by receiver 接收者不知道所请求的操作
NotSupported 不支持 Requested Action is recognized but not supported by the receiver 请求已被识别,但接收方不支持
InternalError 内部错误 An internal error occurred and the receiver was not able to process the requested Action successfully 接收方无法成功处理请求的操作
ProtocolError 协议错误 Payload for Action is incomplete 操作的消息内容不完整
SecurityError 安全错误 During the processing of Action a security issue occurred preventing receiver from completing the Action successfully 处理过程中出现安全问题,导致接收方无法成功完成操作
FormationViolation 违反形态 Payload for Action is syntactically incorrect or not conform the PDU structure for Action 操作的有效内容语法错误或不符合消息结构
PropertyConstraintViolation 违反属性限制 Payload is syntactically correct but at least one field contains an invalid value 消息语法正确,但至少有一个字段包含无效值
OccurenceConstraintViolation 违反事件限制 Payload for Action is syntactically correct but at least one of the fields violates occurence constraints 操作的消息语言正确,但至少有一个字段违反了限制条件
TypeConstraintViolation 违反类型限制 Payload for Action is syntactically correct but at least one of the fields violates data type constraints 操作的消息语言正确,但至少有一个字段的数据类型错误
GenericError 通用错误 Any other error not covered by the previous ones 前面未涵盖的其它错误
posted @   LLLLLLLLLK  阅读(131)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示