ssh -p 8888 zhibo@123.56.228.244 密码:zhibo2022
cd /home/zhibo/806/zbsdk/bin/
数据库中原始数据导出至本地: sudo ./ztools export origin time(年月日时分秒) freq(采样率) terid(端机) chsid(1-32:通道) minutes(分钟) path(存储路径) type(类型: zb、pcm) 单通道数据导出[path路径设置为xx则导出至默认路径]: sudo ./ztools export origin 2024-03-05-12-13-14 8000 1 1 1 path zb 多通道数据导出[导出1,2,3,4, path路径设置为xx则导出至默认路径]: sudo ./ztools export origin 2024-03-05-12-13-14 8000 1 1,2,3,4 1 path zb
**注意:指令参数采样率分为32000、8000** sudo ./ztools export origin 2024-05-27-15-50-00 32000 1 1 1 /opt/data/export zb
czhibo@zb:~/806/zbsdk/bin$ sudo ./ztools export origin 2024-05-27-15-50-00 32000 1 1 1 /opt/data/export zb
sh: 1: cannot create /opt/data/record/startup_record.txt: Directory nonexistent
zlog: loading log config: ./tools_log.conf, name ztools
zlog: init failed
导出文件类型ZB: zb
chsid[1]: 1
export origin data path /opt/data/export
export origin data path /opt/data/export/20240527_155000
Conn taos DB
ts[2024-5-27-15-50-0]: 1716796200000
terid 1
minutes 1
find: ‘/opt/data/origin/export’: No such file or directory
chmod: cannot access '/opt/data/export/20240527_155000/ter1_chs1_2024-05-27-15-50-00_32000.zb': No such file or directory
....................
...................x // .表示输出数据完整
xxxxxxxxxxxxxxxxxxxx // X表示数据缺失补0
export origin data to file:/opt/data/export/20240527_155000/ter1_chs1_2024-05-27-15-50-00_32000.zb finshed
sudo chmod 777 /opt/data/export/20240527_155000/
cd Downloads mkdir 20240527_155000 //创建文件,保存sgy文件到本地windows scp -P 24509 zhibo@123.56.228.244:/opt/data/export/20240527_155000/* 20240527_155000 //远程拷贝sgy文件到本地windows
sudo rm -rf /opt/data/export/20240527_155000/
exit
按照原始数据追加,丢失的数据补0
注意:数据段1s一个时间戳,1s内数据不全补0 文件数据第一段: 头部信息 (0~500字节,偏移地址0处读取sizeof(origin_data_export_head_t)) typedef struct { uint32_t freq; //导出频率 uint64_t start_ts; //起始时间戳ms uint32_t minutes; //导出文件时长 uint32_t channel_id; // 通道 uint32_t terid; // 端机 } origin_data_export_head_t; //前500字节 文件数据第二段: 数据段信息 (偏移地址500处 每1s数据长度sizeof(origin_data_export_info_t) + freq*4) typedef struct { uint64_t ts; uint32_t data_length; // data长度 freq*4 uint32_t data_crc; // data crc uint32_t crc; // 本结构体总长度-4的 crc } origin_data_export_info_t; typedef struct { origin_data_export_info_t info; int8_t *data; // 原始数据 长度:freq*4 } origin_data_export_t;
本文作者:至博
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!