HM-SPMS/product/common/sysconfig/potobuf/TsdbSaveMessage.proto
2025-03-13 11:01:20 +08:00

71 lines
2.9 KiB
Protocol Buffer
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.

//========================================================================================
// @file TsdbSaveMessage.proto
// @brief 时间序列型数据库存库服务tsdb_save使用的消息
// @author yikenan
//========================================================================================
syntax="proto2";
package iot_idl;
// 用到了SVariable
import "Public.proto";
// 缩写说明:
// TSS : TSDB Save Server 时序库存库服务程序
// APP : Application 应用程序,比如采样程序
// SRV : Server 服务端程序(存库服务)
// CLT : Client 客户端程序(暂无)
// MEAS : Measurement 时序库中的“表”
//========================================================================================
// 消息类型枚举
//========================================================================================
enum enTssMsgType
{
// CMbMessagePara1是消息序号Para2是DomainID
MT_TSS_APP2SRV_ADD = 1; // 应用程序(比如采样程序)添加写库
MT_TSS_SRV2APP_ADD_ACK = 2; // 服务回复确认收到添加消息
}
//========================================================================================
// save_action 类型枚举
//========================================================================================
enum enTssSaveAction
{
SA_TSS_DO_NOTHING = 0; // 无
SA_TSS_LOCAL_ONLY = 1; // 仅保存到本域时序库
SA_TSS_REMOTE_ONLY = 2; // 仅保存到远程域时序库
SA_TSS_LOCAL_REMOTE = 3; // 保存到本域以及远程域时序库
}
//========================================================================================
// 时序库中一条记录的消息结构TssInsert中用到
//========================================================================================
message STsdbPoint
{
required int64 time_stamp =1; // 时标RFC1305、POSIX时标标准
repeated string tag_val =2; // tag的值与TssInsert中tag_name对应
repeated SVariable field_val =3; // field的值与TssInsert中field_name对应
}
//========================================================================================
// 应用程序插入记录的消息结构
//========================================================================================
message STssInsert
{
required enTssSaveAction save_action =1; // 保存行为见enTssSaveAction注释
required string meas_name =2; // 时序库中的“表”名
repeated string tag_name =3; // 时序库中的属性“列”名
repeated string field_name =4; // 时序库中的数据“列”名
repeated STsdbPoint point =5; // 插入的记录与tag_name、field_name对应
}