科研数据最耗时的环节从来不是采集,而是清洗、对齐与标注。V3.0 的目标很直接:让三个硬件形态、两条传输通道产出的数据,在 PC 端呈现完全一致的解析结果——算法代码一行都不用改。 The most time-consuming part of research data is never acquisition — it is cleaning, alignment and labelling. V3.0 has a single objective: make data from three hardware forms and two transport channels parse identically on the PC side — without changing a single line of your algorithm code.
| 层级Layer | 产物Artifact | 典型用途Typical use | 关键属性Key properties |
|---|---|---|---|
| L1 | SampleFrame | 固件内部唯一数据模型Single in-firmware data model | 通道字典 + 统一时间戳 + 质量位 + 事件标记;各通道原生速率Channel dictionary + unified timestamp + quality bits + event markers; per-channel native rates |
| L2a | BLE 实时流 / .ftrawlive stream / .ftraw | 实时监视、预实验、交互式采集Live monitoring, pilot work, interactive acquisition | 低延迟;边收边存;断点可续Low latency; write-while-receiving; resumable |
| L2b | U 盘二进制文件USB-drive binary files | 长时程归档、临床佩戴、离线研究Long-duration archiving, clinical wear, offline studies | 定长帧;逐帧校验;断电最多丢 1 秒Fixed-length frames; per-frame checksums; at most 1 s lost on power loss |
| L3 | PC 端数据对象PC-side data object | 算法开发、统计分析、格式转换Algorithm development, statistics, format conversion | 统一输入;可导出为科研数据标准格式Unified input; exportable to research data standards |
| 帧型Frame | 内容布局Payload layout | 帧长Length | 采样率Rate | 用途Purpose |
|---|---|---|---|---|
| F1 | 时间戳timestamp (4) + ECG (4) + status (2) + CRC16 (2) + 保留reserved (4) | 16 B | 512 / 1024 Hz | 心电主通道(双档采样率可选)Primary ECG channel (two selectable rates) |
| F2a | 时间戳timestamp (4) + BIOZ (4) + BIOZ_AUX (4) + CRC16 (2) + 保留reserved (2) | 16 B | 16 Hz | BioZ 标量通道(EDA / 呼吸等低频模式)BioZ scalar channel (EDA, respiration and other low-rate modes) |
| F2b | 时间戳timestamp (4) + PPG ×8 (32) + IMU ×6 (12) + flags (4) + LED 电流current (4) + 保留reserved (4) + CRC16 (2) + 保留reserved (2) | 64 B | 128 Hz | 8 波长 PPG 与六轴 IMU 同帧同步8-wavelength PPG and 6-axis IMU synchronised in one frame |
| F3 | 时间戳timestamp (4) + TEMP ×4 (8) + ILLUM (2) + MARKER (1) + QUALITY (1) + CRC16 (2) | 16 B | 1 Hz / 事件event | 慢变通道、光照、事件标记与质量位Slow channels, illumination, event markers and quality bits |
存储设备以扇区为单位写入。16 字节帧每扇区正好装 32 帧,64 字节帧正好装 8 帧——没有半个帧跨扇区的问题,写入逻辑可以做得非常简单可靠。 Storage writes happen in sectors. A 16-byte frame fits exactly 32 times per sector and a 64-byte frame exactly 8 times — no frame straddles a sector boundary, keeping write logic simple and reliable.
16 与 64 字节的帧长组合,使得在任意字节偏移处重新同步时几乎不会出现歧义匹配。这是长时程文件损坏后仍能恢复数据的关键设计。 The 16/64-byte combination means resynchronisation at any byte offset is almost never ambiguous. This is what allows data recovery from long recordings after corruption.
每一帧独立校验。坏帧可被单独定位与剔除,不会污染相邻数据——对临床长时程记录尤为重要。 Each frame carries its own checksum. A corrupt frame can be located and dropped in isolation without contaminating neighbours — critical for long clinical recordings.
| ID 区段ID range | 通道组Channel group | 包含通道Members | 原生速率Native rate |
|---|---|---|---|
| 0x01–0x02 | ECG | 心电主通道、辅助/参考通道Primary ECG, auxiliary/reference | 512 / 1024 Hz |
| 0x10–0x12 | BIOZ | BIOZ, BIOZ_AUX, BIOZ_PHASE | 16 Hz |
| 0x20–0x27 | PPG | 8 个波长:525 / 660 / 850 / 940 / 1050 / 1300 / 1550 / 1650 nmEight wavelengths: 525 / 660 / 850 / 940 / 1050 / 1300 / 1550 / 1650 nm | 128 Hz |
| 0x30–0x35 | IMU | 三轴加速度 + 三轴陀螺仪3-axis accelerometer + 3-axis gyroscope | 128 Hz |
| 0x40–0x43 | TEMP | 四路温度——每个电极附近各 1 路(组织温度梯度同步可见)Four temperature channels, one adjacent to each electrode (tissue temperature gradient visible in sync) | 1 Hz |
| 0x50 | ILLUM | 环境光Ambient illumination | 1 Hz |
| 0x60 | MARKER | 事件标记(按键短按 / 远程触发 / 刺激事件)Event markers (key press / remote trigger / stimulus events) | 事件驱动Event-driven |
| 0x70 | QUALITY | 数据质量位图:导联脱落 / 佩戴状态 / 接触质量等Data-quality bitmap: lead-off, wear state, contact quality etc. | 1 Hz |
每个采集会话在元数据中记录一个绝对起始时间(UTC,毫秒精度),每帧只携带相对该起点的毫秒偏移。这样做的原因有两个: Each acquisition session records one absolute start time (UTC, millisecond precision) in its metadata, and every frame carries only a millisecond offset relative to that origin. There are two reasons:
元数据中同时给出浮点间隔与精确分数形式(分子 / 分母)。分数形式的分母取 2 的整数次幂,便于用移位与整数运算精确重建每一帧的时间,完全避免浮点累积误差。 Metadata provides both a floating-point interval and an exact fractional form (numerator / denominator). The denominator is a power of two so frame times can be reconstructed exactly with shifts and integer arithmetic, eliminating floating-point accumulation error.
/ ├── sub-S005/ # subject ID (subject-level) │ ├── ses-20260927/ # session (session-level) │ │ ├── META.BIN # metadata snapshot │ │ ├── F1_ecg.bin # 16 B frames @512/1024 Hz │ │ ├── F2a_bioz.bin # 16 B frames @16 Hz │ │ ├── F2b_ppg_imu.bin # 64 B frames @128 Hz │ │ ├── F3_slow.bin # 16 B frames @1 Hz / events │ │ └── session.log # human-readable event log │ └── ses-20260928/ │ └── … └── sub-UNKNOWN/ # when no subject ID was set
目录层级采用"受试者 → 会话"两段式,命名规则与主流科研数据组织的习惯一致,便于批量导入与脚本遍历。未设置受试者编号时落入 sub-UNKNOWN,事后可重命名而无需改动文件内容。
The two-level subject → session hierarchy follows common research data organisation conventions, easing bulk import and scripted traversal. When no subject ID is set, data lands in sub-UNKNOWN and can be renamed later without touching file contents.
科研可复现的关键:把"当时设备处于什么状态"完整记录下来。 Reproducibility hinges on recording exactly what state the device was in.
| 字段组Field group | 内容Content |
|---|---|
| 会话时间Session time | 绝对起始时间(UTC 毫秒)+ 采样间隔浮点值与精确分数形式 Absolute start time (UTC ms) + sampling interval as both float and exact fraction |
| 通道配置Channel config | 各通道启用状态、采样率档位、增益设置 Per-channel enable state, sampling-rate tier, gain settings |
| BioZ 工作参数BioZ operating parameters | 工作模式(EDA / ICG / 呼吸 / 阻抗谱)、激励幅度与频段 Operating mode (EDA / ICG / respiration / spectroscopy), drive amplitude and frequency band |
| 寄存器快照Register snapshot | 采集开始时刻前端全部寄存器的完整快照 Complete snapshot of all front-end registers at acquisition start |
| 文件清单File manifest | 四个数据文件的帧计数、字节长度、校验摘要 Frame count, byte length and checksum digest for each of the four data files |
| 界面设置UI settings | 界面语言、受试者编号、固件版本 Interface language, subject ID, firmware version |
# SampleFrame — the single truth source on the PC side class SampleFrame: t_utc_ms: int # absolute UTC time (ms) t_ms: int # offset from session origin channels: dict[int, float] # ChID -> value quality: int # quality bitmap (0x70) marker: int # event marker (0x60) # FrameSource — abstract, two concrete implementations class FrameSource: # iterable of SampleFrame ... class BluetoothSource(FrameSource): # live / .ftraw ... class UDiskSource(FrameSource): # .bin files ...
from ft_core import UDiskSource, BluetoothSource # Option A — read from a USB drive dump src = UDiskSource("E:/sub-S005/ses-20260927") # Option B — read from a BLE session capture # src = BluetoothSource("capture.ftraw") # Downstream is identical for both for frame in src: ecg = frame.channels[0x01] eda = frame.channels[0x10] ppg = frame.channels[0x20] # ... your algorithm here, unchanged
除原始二进制归档外,PC 端工具可把会话导出为科研数据标准格式(按通道分组的表格文件 + 结构化元数据),直接兼容常见分析生态与数据校验工具。转换在 PC 端完成,设备端固件完全不参与——固件只负责产出可靠的二进制原始数据。 Beyond the raw binary archive, the PC-side tool exports sessions into a research data standard format (per-channel tabular files plus structured metadata) compatible with common analysis ecosystems and validation tools. Conversion happens entirely on the PC; firmware only produces reliable binary raw data.
蓝牙通道传序号与确认机制,会话中断后可继续,不重不漏。 The BLE channel uses sequence numbers and acknowledgements so interrupted sessions resume without duplication or loss.
周期性刷盘策略把断电数据损失控制在 1 秒以内;断电后文件系统结构保持可解析。 Periodic flush strategies bound power-loss exposure to under a second, and filesystem structures remain parseable after an unexpected outage.
帧内校验失败时能精确定位到具体帧序号,便于事后报告数据完整性。 Checksum failures resolve to a specific frame index, allowing data completeness to be reported after the fact.
元数据记录每个文件的帧计数;PC 端解析时逐一比对,直接产出"丢帧率"指标供论文方法学引用。 Metadata records a frame count per file; the PC parser cross-checks each one and emits a frame-loss metric ready for citation in a Methods section.
8 s 窗口 · 幅值单位 kLSB · QRS 形态清晰,基线噪声受指压影响可见——这就是我们交付的"真实数据"口径。 8 s window · amplitude in kLSB · crisp QRS morphology with visible finger-pressure baseline noise — this is exactly the "real data" standard we deliver.
6 s 窗口 · 高倍采样下 QRS 切迹与除极细节保留完整,适合形态学与 HRV 类算法开发。 6 s window · at the higher rate, QRS notches and depolarisation detail are fully preserved — suited to morphology and HRV-class algorithm work.
50 s 窗口 · 激励 1.41 µA(寄存器 0xA4=0xC5)· 显示为基线参考化 ΔZ。可见缓慢的电极稳定与低频漂移——0.5 V 直流体系的典型特征,科研团队可据此设计漂移补偿。 50 s window · excitation 1.41 µA (register 0xA4=0xC5) · shown baseline-referenced as ΔZ. The slow electrode settling and low-frequency drift are typical of the 0.5 V DC system — a useful basis for designing drift compensation.
| 文件File | 内容Contents | 时长Duration | 实测采样率Measured Fs | 大小Size |
|---|---|---|---|---|
| ecg-500hz-sample.csv | ECG 单通道 + 14 行寄存器快照头 + UTC 毫秒时间戳single-channel ECG + 14-line register snapshot header + UTC ms timestamps | 55.8 s | 516.21 Hz | 1.4 MB |
| ecg-1000hz-sample.csv | 同上,高倍采样档same layout, high-rate tier | 63.8 s | 1032.36 Hz | 3.2 MB |
| bioz-dc-16hz-sample.csv | BioZ DC 0.5 V 单标量 + 寄存器快照(含 0xA2/0xA4 配置)BioZ DC 0.5 V scalar + register snapshot (incl. 0xA2/0xA4 config) | 61.0 s | 16.13 Hz | 53 KB |
| ecg-500hz-rawframe.bin bioz-dc-16hz-rawframe.bin |
设备端原始帧存档(.bin),与 V3.0 帧型对应,供解析器开发比对device-side raw frame archives (.bin) matching the V3.0 frame types, for parser development | — | — | 97 / 4.6 KB |
把格式能力转化为研究设计:三硬件协同范式、数据质量门控、可对接的世界领先方向。 Turning format capability into study design: the three-hardware paradigm, quality gates, and world-leading directions open to collaboration.
打开科研平台 →Open the research platform →IEC 60601-1、YY 9706 系列、ISO 20495、ISO 10993 及其检验方法与判定标准。 IEC 60601-1, the YY 9706 series, ISO 20495, ISO 10993 with test methods and acceptance criteria.
查看合规资料 →View compliance material →