2024-10-08 09:38:54 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 抖音关注:程序员三丙
|
|
|
|
|
|
* 知识星球:https://t.zsxq.com/j9b21
|
|
|
|
|
|
*/
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
|
|
|
|
package infrastructureProto;
|
|
|
|
|
|
|
|
|
|
|
|
option java_package = "sanbing.jcpp.proto.gen";
|
|
|
|
|
|
option java_outer_classname = "ProtocolProto";
|
|
|
|
|
|
|
2024-10-22 17:11:05 +08:00
|
|
|
|
service ProtocolDownlinkInterface {
|
|
|
|
|
|
rpc onDownlink(stream DownlinkRequestMessage) returns (stream DownlinkResponseMessage) {}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-23 17:07:57 +08:00
|
|
|
|
message TracerProto {
|
|
|
|
|
|
string id = 1;
|
|
|
|
|
|
string origin = 2;
|
|
|
|
|
|
int64 ts = 3;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 09:38:54 +08:00
|
|
|
|
message UplinkQueueMessage {
|
|
|
|
|
|
int64 messageIdMSB = 1;
|
|
|
|
|
|
int64 messageIdLSB = 2;
|
|
|
|
|
|
int64 sessionIdMSB = 3;
|
|
|
|
|
|
int64 sessionIdLSB = 4;
|
|
|
|
|
|
string messageKey = 5;
|
|
|
|
|
|
string protocolName = 6;
|
|
|
|
|
|
bytes requestData = 10;
|
|
|
|
|
|
LoginRequest loginRequest = 21;
|
|
|
|
|
|
HeartBeatRequest heartBeatRequest = 22;
|
|
|
|
|
|
VerifyPricingRequest verifyPricingRequest = 23;
|
|
|
|
|
|
QueryPricingRequest queryPricingRequest = 24;
|
|
|
|
|
|
GunRunStatusProto gunRunStatusProto = 25;
|
|
|
|
|
|
ChargingProgressProto chargingProgressProto = 26;
|
|
|
|
|
|
SetPricingResponse setPricingResponse = 27;
|
|
|
|
|
|
RemoteStartChargingResponse remoteStartChargingResponse = 28;
|
|
|
|
|
|
RemoteStopChargingResponse remoteStopChargingResponse = 29;
|
|
|
|
|
|
TransactionRecord transactionRecord = 30;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-22 17:11:05 +08:00
|
|
|
|
message DownlinkRequestMessage {
|
2024-10-08 09:38:54 +08:00
|
|
|
|
int64 messageIdMSB = 1;
|
|
|
|
|
|
int64 messageIdLSB = 2;
|
|
|
|
|
|
int64 sessionIdMSB = 3;
|
|
|
|
|
|
int64 sessionIdLSB = 4;
|
|
|
|
|
|
string protocolName = 6;
|
|
|
|
|
|
string pileCode = 7;
|
|
|
|
|
|
optional int64 requestIdMSB = 8;
|
|
|
|
|
|
optional int64 requestIdLSB = 9;
|
|
|
|
|
|
optional bytes requestData = 10;
|
2024-10-23 17:07:57 +08:00
|
|
|
|
TracerProto tracer = 12;
|
|
|
|
|
|
string downlinkCmd = 20;
|
|
|
|
|
|
LoginResponse loginResponse = 21;
|
|
|
|
|
|
VerifyPricingResponse verifyPricingResponse = 22;
|
|
|
|
|
|
QueryPricingResponse queryPricingResponse = 23;
|
|
|
|
|
|
SetPricingRequest setPricingRequest = 24;
|
|
|
|
|
|
RemoteStartChargingRequest remoteStartChargingRequest = 25;
|
|
|
|
|
|
RemoteStopChargingRequest remoteStopChargingRequest = 26;
|
|
|
|
|
|
TransactionRecordAck transactionRecordAck = 27;
|
2024-10-08 09:38:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-22 17:11:05 +08:00
|
|
|
|
message DownlinkResponseMessage {
|
|
|
|
|
|
bool success = 1;
|
|
|
|
|
|
optional string error = 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 09:38:54 +08:00
|
|
|
|
message LoginRequest {
|
2024-10-09 20:44:44 +08:00
|
|
|
|
string pileCode = 2;
|
|
|
|
|
|
string credential = 3;
|
2024-10-08 09:38:54 +08:00
|
|
|
|
string remoteAddress = 4;
|
|
|
|
|
|
string nodeId = 10;
|
2024-10-23 17:07:57 +08:00
|
|
|
|
string nodeHostAddress = 11;
|
|
|
|
|
|
int32 nodeRestPort = 12;
|
|
|
|
|
|
int32 nodeGrpcPort = 13;
|
2024-10-08 09:38:54 +08:00
|
|
|
|
optional string additionalInfo = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message LoginResponse {
|
|
|
|
|
|
bool success = 1;
|
|
|
|
|
|
string pileCode = 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message HeartBeatRequest {
|
|
|
|
|
|
string pileCode = 3;
|
|
|
|
|
|
string remoteAddress = 4;
|
|
|
|
|
|
string nodeId = 10;
|
2024-10-23 17:07:57 +08:00
|
|
|
|
string nodeHostAddress = 11;
|
|
|
|
|
|
int32 nodeRestPort = 12;
|
|
|
|
|
|
int32 nodeGrpcPort = 13;
|
2024-10-08 09:38:54 +08:00
|
|
|
|
optional string additionalInfo = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message VerifyPricingRequest {
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
int64 pricingId = 30;
|
|
|
|
|
|
optional string pricingModel = 31;
|
|
|
|
|
|
optional string additionalInfo = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message VerifyPricingResponse {
|
|
|
|
|
|
bool success = 1;
|
|
|
|
|
|
int64 pricingId = 30;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message QueryPricingRequest {
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
optional string additionalInfo = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message QueryPricingResponse {
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
int64 pricingId = 30;
|
|
|
|
|
|
PricingModelProto pricingModel = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message PricingModelProto {
|
|
|
|
|
|
PricingModelType type = 3;
|
|
|
|
|
|
PricingModelRule rule = 4;
|
2024-10-08 16:56:29 +08:00
|
|
|
|
string standardElec = 5;
|
|
|
|
|
|
string standardServ = 6;
|
2024-10-08 09:38:54 +08:00
|
|
|
|
map<int32, FlagPriceProto> flagPrice = 8;
|
|
|
|
|
|
repeated PeriodProto period = 9;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message PeriodProto {
|
|
|
|
|
|
int32 sn = 1;
|
|
|
|
|
|
string begin = 2;
|
|
|
|
|
|
string end = 3;
|
|
|
|
|
|
PricingModelFlag flag = 4;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message FlagPriceProto {
|
|
|
|
|
|
PricingModelFlag flag = 1;
|
2024-10-08 16:56:29 +08:00
|
|
|
|
string elec = 2;
|
|
|
|
|
|
string serv = 3;
|
2024-10-08 09:38:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
enum PricingModelType {
|
|
|
|
|
|
CHARGE = 0; // 充电费率模型
|
|
|
|
|
|
DISCHARGE = 1; // 放电费率模型
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
enum PricingModelRule {
|
|
|
|
|
|
STANDARD = 0;
|
|
|
|
|
|
SPLIT_TIME = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
enum PricingModelFlag {
|
|
|
|
|
|
TOP = 0; // 尖峰
|
|
|
|
|
|
PEAK = 1; // 峰
|
|
|
|
|
|
FLAT = 2; // 平
|
|
|
|
|
|
VALLEY = 3; // 谷
|
|
|
|
|
|
DEEP = 4; // 深谷
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
enum GunRunStatus {
|
|
|
|
|
|
IDLE = 0; // 空闲
|
|
|
|
|
|
INSERTED = 1; // 已插枪
|
|
|
|
|
|
CHARGING = 2; // 充电中
|
|
|
|
|
|
CHARGE_COMPLETE = 3; // 充电完成
|
|
|
|
|
|
DISCHARGE_READY = 4; // 放电准备
|
|
|
|
|
|
DISCHARGING = 5; // 放电中
|
|
|
|
|
|
DISCHARGE_COMPLETE = 6; // 放电完成
|
|
|
|
|
|
RESERVED = 7; // 预约
|
|
|
|
|
|
FAULT = 8; // 故障
|
|
|
|
|
|
UNKNOWN = 9; // 未知
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message GunRunStatusProto {
|
|
|
|
|
|
int64 ts = 1;
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
string gunCode = 5;
|
|
|
|
|
|
GunRunStatus GunRunStatus = 41;
|
|
|
|
|
|
repeated string faultMessages = 6;
|
|
|
|
|
|
optional string additionalInfo = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message ChargingProgressProto {
|
|
|
|
|
|
int64 ts = 1;
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
string gunCode = 5;
|
|
|
|
|
|
string tradeNo = 6;
|
2024-10-08 16:56:29 +08:00
|
|
|
|
string outputVoltage = 7;
|
|
|
|
|
|
string outputCurrent = 8;
|
|
|
|
|
|
int32 soc = 9;
|
2024-10-08 09:38:54 +08:00
|
|
|
|
int32 totalChargingDurationMin = 10;
|
2024-10-08 16:56:29 +08:00
|
|
|
|
string totalChargingEnergyKWh = 11;
|
|
|
|
|
|
string totalChargingCostYuan = 12;
|
2024-10-08 09:38:54 +08:00
|
|
|
|
optional string additionalInfo = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message SetPricingRequest {
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
int64 pricingId = 30;
|
|
|
|
|
|
PricingModelProto pricingModel = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message SetPricingResponse {
|
|
|
|
|
|
bool success = 1;
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
int64 pricingId = 30;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message RemoteStartChargingRequest {
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
string gunCode = 5;
|
|
|
|
|
|
string tradeNo = 6;
|
2024-10-08 16:56:29 +08:00
|
|
|
|
int32 limitYuan = 7;
|
2024-10-08 09:38:54 +08:00
|
|
|
|
optional string additionalInfo = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message RemoteStartChargingResponse {
|
|
|
|
|
|
int64 ts = 1;
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
string gunCode = 5;
|
|
|
|
|
|
string tradeNo = 6;
|
|
|
|
|
|
bool success = 7;
|
|
|
|
|
|
string failReason = 8;
|
|
|
|
|
|
optional string additionalInfo = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message RemoteStopChargingRequest {
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
string gunCode = 5;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message RemoteStopChargingResponse {
|
|
|
|
|
|
int64 ts = 1;
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
string gunCode = 5;
|
|
|
|
|
|
bool success = 7;
|
|
|
|
|
|
string failReason = 8;
|
|
|
|
|
|
optional string additionalInfo = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message TransactionRecord {
|
|
|
|
|
|
string pileCode = 4;
|
|
|
|
|
|
string gunCode = 5;
|
|
|
|
|
|
string tradeNo = 6;
|
|
|
|
|
|
int64 startTs = 51;
|
|
|
|
|
|
int64 endTs = 52;
|
2024-10-08 16:56:29 +08:00
|
|
|
|
string topEnergyKWh = 53;
|
|
|
|
|
|
string topAmountYuan = 54;
|
|
|
|
|
|
string peakEnergyKWh = 55;
|
|
|
|
|
|
string peakAmountYuan = 56;
|
|
|
|
|
|
string flatEnergyKWh = 57;
|
|
|
|
|
|
string flatAmountYuan = 58;
|
|
|
|
|
|
string valleyEnergyKWh = 59;
|
|
|
|
|
|
string valleyAmountYuan = 60;
|
|
|
|
|
|
string deepEnergyKWh = 61;
|
|
|
|
|
|
string deepAmountYuan = 62;
|
|
|
|
|
|
string totalEnergyKWh = 63;
|
|
|
|
|
|
string totalAmountYuan = 64;
|
2024-10-08 09:38:54 +08:00
|
|
|
|
int64 tradeTs = 65;
|
|
|
|
|
|
string stopReason = 66;
|
|
|
|
|
|
optional string additionalInfo = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message TransactionRecordAck {
|
|
|
|
|
|
string tradeNo = 6;
|
|
|
|
|
|
bool success = 7;
|
|
|
|
|
|
}
|