Documentation Index
Fetch the complete documentation index at: https://docs.mirobody.ai/llms.txt
Use this file to discover all available pages before exploring further.
数据流概览
健康数据通过多个处理阶段,以确保所有提供商之间的一致性、质量和标准化。
完整流程
数据采集
提供商(Provider)使用经过 OAuth 身份验证的请求从厂商 API 拉取原始数据。raw_data = await provider.pull_from_vendor_api(
access_token, refresh_token, days=2
)
原始数据存储
原始数据存储在数据库中,用于审计追踪和重新处理。await provider.save_raw_data_to_db(raw_data)
转换
将厂商特定的数据转换为标准化格式。formatted_data = await provider.format_data(raw_data)
平台上传
标准化数据被上传到 Mirobody 平台。await push_service.push_data(platform="theta", data=formatted_data)
数据转换
转换阶段将厂商特定的格式转换为标准化的 StandardPulseData 格式:
StandardPulseData(
metaInfo=StandardPulseMetaInfo(
userId="user_123",
requestId="req_abc",
source="theta",
timezone="America/Los_Angeles"
),
healthData=[
StandardPulseRecord(
source="garmin",
type="HEART_RATE",
timestamp=1705276800000,
unit="count/min",
value=72.0,
timezone="America/Los_Angeles"
)
]
)
更多关于数据映射的细节,请参见 数据映射指南。