你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 独居老人 (Elderly Living Alone)
- 重点房间 living_room: 客厅灯[dimmable_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor], 客厅烟雾报警器[smoke_co_alarm]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 bedroom: 卧室灯[dimmable_light], 床头灯[onoff_light], 卧室运动传感器[occupancy_sensor], 卧室窗帘[window_covering], 卧室窗户传感器[contact_sensor], 卧室温度传感器[temperature_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房运动传感器[occupancy_sensor], 厨房漏水传感器[water_leak_detector]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ3
- 重点房间: living_room
- 重点设备: bedroom_window_contact, living_room_occupancy, living_room_window_contact
- 已选事件数: 101

## 跨天活动摘要
- 2026-07-07: living_room=212, bedroom=243, kitchen=239, entrance=230, bathroom=60

## 设备事件日志
[2026-07-07T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T00:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2286
[2026-07-07T01:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2304
[2026-07-07T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T01:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2294
[2026-07-07T01:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2300
[2026-07-07T01:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-07-07T01:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-07-07T01:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2297
[2026-07-07T01:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2302
[2026-07-07T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-07-07T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-07-07T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2307
[2026-07-07T01:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2224
[2026-07-07T01:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-07-07T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-07-07T01:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2228
[2026-07-07T01:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2324
[2026-07-07T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-07-07T01:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2233
[2026-07-07T01:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-07-07T02:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2220
[2026-07-07T02:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-07-07T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T02:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-07T02:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2238
[2026-07-07T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-07-07T02:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2236
[2026-07-07T02:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-07-07T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-07-07T02:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2237
[2026-07-07T02:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2330
[2026-07-07T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2331
[2026-07-07T02:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2240
[2026-07-07T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2330
[2026-07-07T02:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2239
[2026-07-07T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-07T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-07-07T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2345
[2026-07-07T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T02:30:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T02:31:00] living_room_window_contact | BooleanState.StateValue = False
[2026-07-07T02:32:00] bedroom_window_contact | BooleanState.StateValue = False
[2026-07-07T02:34:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-07T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2345
[2026-07-07T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-07-07T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-07T02:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2243
[2026-07-07T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-07-07T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-07-07T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2259
[2026-07-07T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-07T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2354
[2026-07-07T02:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2258
[2026-07-07T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-07-07T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2264
[2026-07-07T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-07T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-07-07T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-07-07T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T03:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-07-07T03:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2255
[2026-07-07T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-07-07T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-07-07T03:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2272
[2026-07-07T03:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-07-07T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-07-07T03:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2274
[2026-07-07T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-07-07T03:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-07-07T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2281
[2026-07-07T03:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-07-07T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2379
[2026-07-07T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2374
[2026-07-07T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384
[2026-07-07T03:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-07-07T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2402
[2026-07-07T03:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-07-07T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2409
[2026-07-07T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-07T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2393
[2026-07-07T04:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2415
[2026-07-07T09:42:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-07T12:32:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-07T15:20:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-07T18:10:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-07T20:57:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-07T23:47:00] living_room_occupancy | OccupancySensing.Occupancy = 1

## 任务
以下是过去一段时间的设备活动记录。请识别其中是否存在可疑行为模式，并解释你的判断。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "多个窗户传感器短时依次触发",
  "reasoning": [
    "推理步骤1: 短时间内两个不同房间窗户先后打开",
    "推理步骤2: 触发时间位于深夜",
    "推理步骤3: 随后出现室内运动"
  ],
  "key_evidence": [
    "短时间内两个不同房间窗户先后打开",
    "触发时间位于深夜",
    "随后出现室内运动"
  ],
  "recommended_actions": [
    "判定为扫描式入侵尝试，建议重点检查窗户和周边摄像头。"
  ]
}

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "health_concern",
  "threat_description": "独居老人在凌晨时段出现长时间无活动且室内温度异常升高，存在严重的健康风险或意外滞留风险。",
  "reasoning": [
    "推理步骤 1: 时间窗口分析。日志显示在 2026-07-07T00:00:00 至 2026-07-07T09:42:09 之间，客厅 (living_room) 和卧室 (bedroom) 的运动传感器持续报告无人状态 (Occupancy = 0)，长达近 10 小时。对于独居老人而言，整夜无活动是极不正常的，通常意味着老人可能已经入睡但长时间未醒来，或者发生了跌倒/突发疾病导致无法移动。",
    "推理步骤 2: 环境参数异常关联。在此期间，客厅温度传感器读数从约 22.8°C (2286 mK) 持续上升至 23.8°C (2384 mK) 甚至更高，且在清晨接近 24.1°C (2415 mK)。考虑到夜间空调通常关闭或处于节能模式，且门窗传感器在 T02:31 和 T02:32 才短暂变为 False（开启），这种持续的升温趋势表明室内热量积聚，缺乏人员调节（如开空调、开窗通风）。",
    "推理步骤 3: 行为模式对比。直到上午 09:42 才有第一次 occupancy=1 的记录，随后在中午 12:32 再次检测到活动。这种“长时静止 + 环境温度被动升高”的模式，与正常睡眠周期（通常伴随翻身等微动）不符，高度疑似老人因健康问题（如中风、昏迷）或意外（如跌倒）被困在房间内，未能及时获得救助。",
    "推理步骤 4: 排除误报。虽然 T02:31 窗户传感器有变化，但随后运动传感器仍为 0，说明有人进入房间的可能性极低（如果是入侵者，通常会触发更多设备或改变温度分布模式，而非仅局部缓慢升温）。因此，最合理的解释是屋内原住户（老人）处于非正常静止状态。"
  ],
  "key_evidence": [
    "2026-07-07T00:00:00 至 2026-07-07T09:42:09 期间，living_room_occupancy 和 bedroom_occupancy 连续超过 9 小时保持为 0。",
    "同一时间段内，living_room_temp_sensor 数值从 2286 持续攀升至 2415，显示室内温度在无人为干预下显著上升。",
    "作为独居老人的家庭场景，整夜无生命体征活动记录属于高危异常事件。"
  ],
  "recommended_actions": [
    "立即启动紧急响应协议：通过智能家居系统向监护人或紧急联系人发送最高级别警报。",
    "联系当地急救中心或社区服务中心，请求上门核查老人状况。",
    "检查并确认入户门锁状态，确保救援人员能够顺利进入；若老人已失联，需考虑破门救援预案。",
    "待人员安全确认后，重新校准传感器并审查该时段的设备日志以完善应急预案。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 独居老人 (Elderly Living Alone)
- 重点房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 bedroom: 卧室灯[dimmable_light], 床头灯[onoff_light], 卧室运动传感器[occupancy_sensor], 卧室窗帘[window_covering], 卧室窗户传感器[contact_sensor], 卧室温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房运动传感器[occupancy_sensor], 厨房漏水传感器[water_leak_detector]
- 房间 living_room: 客厅灯[dimmable_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor], 客厅烟雾报警器[smoke_co_alarm]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: entrance
- 重点设备: front_door_lock, living_room_light
- 已选事件数: 29

## 设备事件日志
[2026-08-14T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:06:00] front_door_lock | DoorLock.LockState = 2
[2026-08-14T04:07:00] front_door_lock | DoorLock.LockState = 1
[2026-08-14T04:09:00] living_room_light | OnOff.OnOff = True
[2026-08-14T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:30:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T04:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T05:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-14T07:04:06] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-14T07:04:06] front_door_lock | DoorLock.LockState = 2
[2026-08-14T07:04:11] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-14T07:04:11] front_door_lock | DoorLock.LockState = 1
[2026-08-14T08:20:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-14T08:20:00] front_door_lock | DoorLock.LockState = 2
[2026-08-14T08:20:13] living_room_light | OnOff.OnOff = True
[2026-08-14T12:36:00] living_room_light | OnOff.OnOff = False
[2026-08-14T13:58:17] living_room_light | OnOff.OnOff = True
[2026-08-14T19:30:06] living_room_light | LevelControl.CurrentLevel = 37
[2026-08-14T20:22:00] living_room_light | OnOff.OnOff = False
[2026-08-14T20:47:16] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-14T20:47:16] front_door_lock | DoorLock.LockState = 1

## 任务
系统刚记录到以下一段设备状态变化。请评估这些变化是否已经构成安全风险，并说明原因。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "门锁状态变化但没有对应开门链路",
  "reasoning": [
    "推理步骤1: 门锁状态先解锁再回锁",
    "推理步骤2: 缺乏门磁开关记录",
    "推理步骤3: 却伴随室内灯光变化"
  ],
  "key_evidence": [
    "门锁状态先解锁再回锁",
    "缺乏门磁开关记录",
    "却伴随室内灯光变化"
  ],
  "recommended_actions": [
    "判为异常门锁状态切换，建议核查锁日志与物理门状态。"
  ]
}

{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "intrusion",
  "threat_description": "门锁状态变化但没有对应开门链路",
  "reasoning": [
    "推理步骤1: 日志中出现了不存在的额外报警事件。"
  ],
  "key_evidence": [
    "我假设看到了一个未在日志中出现的 critical 告警。"
  ],
  "recommended_actions": [
    "判为异常门锁状态切换，建议核查锁日志与物理门状态。"
  ]
}


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅副灯[dimmable_light], 客厅氛围灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘1[window_covering], 客厅窗户传感器1[contact_sensor], ... 共10个设备
- 房间 master_bathroom: 主卫灯[onoff_light], 主卫运动传感器[occupancy_sensor], 主卫漏水传感器[water_leak_detector]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧床头灯[onoff_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bathroom: 次卫灯[onoff_light], 次卫漏水传感器[water_leak_detector]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧空调[air_conditioner], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: balcony
- 重点设备: balcony_door_contact, balcony_light, living_room_occupancy
- 已选事件数: 24

## 设备事件日志
[2026-08-29T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:07:00] balcony_door_contact | BooleanState.StateValue = False
[2026-08-29T02:08:00] balcony_light | OnOff.OnOff = True
[2026-08-29T02:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-29T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T07:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-29T11:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0

## 任务
请分析下面的实时设备事件，判断是否需要将其视为异常安全事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "阳台门深夜打开且室内无对应活动",
  "reasoning": [
    "推理步骤1: 深夜阳台门突然打开",
    "推理步骤2: 阳台灯随即被点亮",
    "推理步骤3: 随后出现客厅活动"
  ],
  "key_evidence": [
    "深夜阳台门突然打开",
    "阳台灯随即被点亮",
    "随后出现客厅活动"
  ],
  "recommended_actions": [
    "判定为高风险边界入侵，建议立即检查阳台出入口。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示凌晨时段阳台门被打开并短暂开启灯光，随后客厅检测到人员活动，符合住户夜间起夜或起床查看阳台的正常行为模式。",
  "reasoning": [
    "推理步骤 1: 时间分析。事件发生在凌晨 02:07 至 02:09，属于深夜时段。此时大部分房间（卧室、餐厅等）的运动传感器均报告无人状态（Occupancy = 0），表明家庭处于睡眠或低活动状态。",
    "推理步骤 2: 行为序列分析。首先阳台门接触传感器状态变为 False（打开），紧接着阳台灯开启，随后仅过了 2 分钟（02:09），客厅运动传感器即检测到有人（Occupancy = 1）。这种‘开门 -> 开灯 -> 进入室内’的短序列是典型的住户夜间起夜、去阳台透气或检查物品后返回室内的正常行为逻辑。",
    "推理步骤 3: 异常排除。如果是入侵者，通常不会在开门后立即开灯暴露自己，且很难在 2 分钟内从阳台移动到客厅而不触发其他路径（如玄关）的传感器（虽然日志未包含玄关开门瞬间，但客厅随即有人证实了内部人员的存在）。此外，后续时间点（02:30, 03:00 等）所有区域再次恢复无人状态，说明该活动已结束，没有持续滞留迹象。"
  ],
  "key_evidence": [
    "02:07 阳台门打开 (False) 且 02:08 立即开灯",
    "02:09 客厅运动传感器检测到人员 (Occupancy = 1)，证明有人从阳台进入室内",
    "02:30 之后所有房间运动传感器再次全部归零，无持续入侵迹象"
  ],
  "recommended_actions": [
    "无需采取紧急措施，该行为符合正常生活规律。",
    "建议用户确认家中是否确实有成员在凌晨时段起夜活动，以验证日志真实性。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅副灯[dimmable_light], 客厅氛围灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘1[window_covering], 客厅窗户传感器1[contact_sensor], ... 共10个设备
- 房间 master_bathroom: 主卫灯[onoff_light], 主卫运动传感器[occupancy_sensor], 主卫漏水传感器[water_leak_detector]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧床头灯[onoff_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bathroom: 次卫灯[onoff_light], 次卫漏水传感器[water_leak_detector]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧空调[air_conditioner], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: entrance
- 重点设备: front_door_lock, living_room_light_1
- 已选事件数: 24

## 设备事件日志
[2026-08-27T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:06:00] front_door_lock | DoorLock.LockState = 2
[2026-08-27T04:07:00] front_door_lock | DoorLock.LockState = 1
[2026-08-27T04:09:00] living_room_light_1 | OnOff.OnOff = True
[2026-08-27T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T04:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T05:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-27T07:25:35] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-27T07:25:44] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-27T16:16:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-27T18:02:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)

## 任务
系统刚记录到以下一段设备状态变化。请评估这些变化是否已经构成安全风险，并说明原因。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "门锁状态变化但没有对应开门链路",
  "reasoning": [
    "推理步骤1: 门锁状态先解锁再回锁",
    "推理步骤2: 缺乏门磁开关记录",
    "推理步骤3: 却伴随室内灯光变化"
  ],
  "key_evidence": [
    "门锁状态先解锁再回锁",
    "缺乏门磁开关记录",
    "却伴随室内灯光变化"
  ],
  "recommended_actions": [
    "判为异常门锁状态切换，建议核查锁日志与物理门状态。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示的家庭活动模式符合正常的夜间至清晨作息，未发现入侵、异常操作或设备故障迹象。",
  "reasoning": [
    "时间线分析：日志记录的时间段为凌晨 03:00 至次日早晨 07:25，随后是下午和傍晚的正常开门记录。凌晨时段全屋 occupancy 传感器均报告为 0（无人），且门锁在 04:06-04:09 期间经历了短暂的解锁 (1) 后重新上锁 (2)，这极可能是住户起床如厕或短暂离开房间后的正常行为，而非入侵尝试。",
    "行为逻辑验证：04:09 客厅灯开启，但此时 occupancy 仍为 0，可能存在延迟上报或用户刚进入尚未触发运动检测的情况，但随后未出现持续的高频开关门或长时间停留的异常模式。",
    "关键事件确认：后续记录的 07:25、16:16、18:02 均为 Manual 来源的 LockOperationType=1（上锁）事件，时间点分别对应清晨离家、下午回家、傍晚再次出门/回家，完全符合家庭日常出入规律，无尾随（tailgating）或非法闯入特征。"
  ],
  "key_evidence": [
    "凌晨 03:00-07:25 期间所有房间 occupancy 持续为 0，表明家中无人滞留。",
    "门锁状态变化 (LockState 1->2) 发生在凌晨 04:06-04:09，间隔仅 3 分钟，符合短暂外出后立即返回并上锁的习惯。",
    "所有 DoorLock.LockOperation 事件的 OperationSource 均为 Manual，且时间分布合理，无异常高频操作。"
  ],
  "recommended_actions": [
    "无需采取紧急措施，系统运行正常。",
    "建议保持当前监控策略，继续观察后续时间段的活动模式。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅副灯[dimmable_light], 客厅氛围灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘1[window_covering], 客厅窗户传感器1[contact_sensor], ... 共10个设备
- 房间 master_bathroom: 主卫灯[onoff_light], 主卫运动传感器[occupancy_sensor], 主卫漏水传感器[water_leak_detector]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧床头灯[onoff_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bathroom: 次卫灯[onoff_light], 次卫漏水传感器[water_leak_detector]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧空调[air_conditioner], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ5
- 重点房间: entrance
- 重点设备: front_door_lock, kitchen_light, living_room_occupancy
- 已选事件数: 27

## 跨天活动摘要
- 2026-08-02: entrance=49, living_room=49, dining_room=48, master_bedroom=48, second_bedroom=48, kids_room=48

## 设备事件日志
[2026-08-02T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T12:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T16:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T20:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T22:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T22:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T22:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T22:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:18:00] front_door_lock | DoorLock.LockState = 2
[2026-08-02T23:24:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-02T23:25:00] kitchen_light | OnOff.OnOff = True
[2026-08-02T23:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-02T23:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0

## 任务
请根据以下设备记录评估当前是否需要安全响应；若需要，请说明原因与处置建议。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "credential_theft",
  "threat_description": "远程解锁后室内活动延迟出现",
  "reasoning": [
    "推理步骤1: 先出现远程解锁结果",
    "推理步骤2: 几分钟后才有室内活动",
    "推理步骤3: 中间缺乏正常进门链路"
  ],
  "key_evidence": [
    "先出现远程解锁结果",
    "几分钟后才有室内活动",
    "中间缺乏正常进门链路"
  ],
  "recommended_actions": [
    "标记为可疑远程开锁事件，建议核查账户凭证与远程授权。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的夜间归家及短暂活动模式，未发现安全威胁。",
  "reasoning": [
    "推理步骤 1: 在 23:18 门锁解锁（LockState=2）后，客厅运动传感器在 6 分钟后（23:24）检测到人员进入，时间间隔符合正常开门进屋的行为逻辑，排除了尾随入侵的可能。",
    "推理步骤 2: 厨房灯光在 23:25 开启，紧接着在 23:30 所有房间（包括客厅、餐厅、卧室等）的运动传感器均报告无人状态（Occupancy=0）。这表明住户仅进行了极短时间的活动（如取物或查看），随后立即离开并锁门（虽然日志未显式记录关门事件，但全屋无人的状态暗示了离开）。",
    "推理步骤 3: 从 23:30 开始直到日志结束，所有关键区域（entrance, living_room, kitchen 等）持续保持无人状态，且没有再次触发门锁操作或其他异常设备报警，符合深夜休息时的正常家庭状态。"
  ],
  "key_evidence": [
    "门锁解锁后 6 分钟才检测到室内有人，符合正常行为时序。",
    "厨房灯开启后迅速关闭，且随后全屋运动传感器同时变为无人状态，表明活动已结束。",
    "23:30 之后所有房间持续保持无人状态，无后续异常事件。"
  ],
  "recommended_actions": [
    "无需采取紧急措施，系统运行正常。",
    "建议继续保持当前的监控频率，关注后续是否有长时间无人状态下的门窗异常开启事件。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 一室一厅 (Studio/1BR)
- 重点房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 bedroom: 卧室灯[dimmable_light], 卧室运动传感器[occupancy_sensor], 卧室窗帘[window_covering], 卧室窗户传感器[contact_sensor], 卧室温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅台灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ5
- 重点房间: entrance
- 重点设备: front_door_lock, kitchen_light, living_room_occupancy
- 已选事件数: 33

## 跨天活动摘要
- 2026-07-15: entrance=15, living_room=110, bedroom=71, bathroom=57, kitchen=9

## 设备事件日志
[2026-07-15T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T07:06:10] kitchen_light | OnOff.OnOff = True
[2026-07-15T07:19:00] kitchen_light | OnOff.OnOff = False
[2026-07-15T07:19:14] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-15T07:19:14] front_door_lock | DoorLock.LockState = 2
[2026-07-15T07:19:24] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-15T07:19:24] front_door_lock | DoorLock.LockState = 1
[2026-07-15T08:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T17:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T18:20:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-15T18:20:00] front_door_lock | DoorLock.LockState = 2
[2026-07-15T19:07:00] kitchen_light | OnOff.OnOff = True
[2026-07-15T19:30:21] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T20:55:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T21:46:26] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-15T21:46:26] front_door_lock | DoorLock.LockState = 1
[2026-07-15T21:50:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T22:10:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T22:30:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T22:36:09] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T22:37:33] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T22:50:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T22:56:09] bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T22:59:00] bedroom_light | OnOff.OnOff = False
[2026-07-15T23:01:18] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T23:07:33] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T23:10:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T23:18:00] front_door_lock | DoorLock.LockState = 2
[2026-07-15T23:24:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T23:25:00] kitchen_light | OnOff.OnOff = True
[2026-07-15T23:30:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-15T23:31:18] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-15T23:37:33] bathroom_occupancy | OccupancySensing.Occupancy = 0

## 任务
监控系统标记了潜在异常。请分析下面的日志，判断是否需要采取响应措施，并给出建议。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "credential_theft",
  "threat_description": "远程解锁后室内活动延迟出现",
  "reasoning": [
    "推理步骤1: 先出现远程解锁结果",
    "推理步骤2: 几分钟后才有室内活动",
    "推理步骤3: 中间缺乏正常进门链路"
  ],
  "key_evidence": [
    "先出现远程解锁结果",
    "几分钟后才有室内活动",
    "中间缺乏正常进门链路"
  ],
  "recommended_actions": [
    "标记为可疑远程开锁事件，建议核查账户凭证与远程授权。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的家庭作息模式，无安全威胁或异常行为。",
  "reasoning": [
    "推理步骤 1: 分析入户门锁 (front_door_lock) 事件。07:19 和 21:46 分别记录了手动上锁 (LockState=2) 和解锁 (LockState=1) 操作，且时间间隔合理（约 14 小时），符合典型的离家与回家场景，未见未授权访问迹象。",
    "推理步骤 2: 分析厨房灯光 (kitchen_light) 事件。07:19 开启后于 07:19:14 关闭，随后在 19:07、23:25 等时间点根据住户活动规律开启，持续时间短且逻辑连贯，排除了无人看管烹饪或设备卡死的风险。",
    "推理步骤 3: 分析客厅 occupancy 传感器数据。传感器状态变化（0->1->0）与卧室/卫生间的使用时间高度吻合（例如 22:36 进入卧室，23:01 离开；23:10 回到客厅），体现了连贯的家庭内部移动轨迹，未发现传感器故障或长时间异常静止导致的误报风险。"
  ],
  "key_evidence": [
    "前门在 07:19 和 21:46 有明确的手动上锁/解锁记录，符合正常作息。",
    "厨房灯光仅在有人活动时短暂开启，无长时间持续开启现象。",
    "各房间运动传感器状态变化逻辑一致，反映了正常的室内人员流动。"
  ],
  "recommended_actions": [
    "无需采取紧急措施，系统运行正常。",
    "建议继续保持当前的监控频率，定期审查此类跨天摘要以确认长期模式的一致性。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅副灯[dimmable_light], 客厅氛围灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘1[window_covering], 客厅窗户传感器1[contact_sensor], ... 共10个设备
- 房间 master_bathroom: 主卫灯[onoff_light], 主卫运动传感器[occupancy_sensor], 主卫漏水传感器[water_leak_detector]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧床头灯[onoff_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bathroom: 次卫灯[onoff_light], 次卫漏水传感器[water_leak_detector]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧空调[air_conditioner], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: balcony
- 重点设备: balcony_door_contact, balcony_light, living_room_occupancy
- 已选事件数: 24

## 设备事件日志
[2026-08-04T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:07:00] balcony_door_contact | BooleanState.StateValue = False
[2026-08-04T02:08:00] balcony_light | OnOff.OnOff = True
[2026-08-04T02:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-04T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T16:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T19:15:08] living_room_occupancy | OccupancySensing.Occupancy = 1

## 任务
请分析下面的实时设备事件，判断是否需要将其视为异常安全事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "阳台门深夜打开且室内无对应活动",
  "reasoning": [
    "推理步骤1: 深夜阳台门突然打开",
    "推理步骤2: 阳台灯随即被点亮",
    "推理步骤3: 随后出现客厅活动"
  ],
  "key_evidence": [
    "深夜阳台门突然打开",
    "阳台灯随即被点亮",
    "随后出现客厅活动"
  ],
  "recommended_actions": [
    "判定为高风险边界入侵，建议立即检查阳台出入口。"
  ]
}

{
  "is_anomaly": false,
  "confidence": "medium",
  "threat_type": "none",
  "threat_description": "这些变化仍可视为正常波动。",
  "reasoning": [
    "推理步骤1: 没有看到必须报警的直接证据。"
  ],
  "key_evidence": [
    "设备状态变化幅度看起来仍在可接受范围内。"
  ],
  "recommended_actions": [
    "保持观察即可。"
  ]
}


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 两室一厅 (2BR)
- 重点房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅落地灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor], 次卧温度传感器[temperature_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: entrance
- 重点设备: front_door_lock, living_room_light_1
- 已选事件数: 20

## 设备事件日志
[2026-08-22T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:06:00] front_door_lock | DoorLock.LockState = 2
[2026-08-22T04:07:00] front_door_lock | DoorLock.LockState = 1
[2026-08-22T04:09:00] living_room_light_1 | OnOff.OnOff = True
[2026-08-22T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T05:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T10:11:07] living_room_light_1 | OnOff.OnOff = True
[2026-08-22T22:55:00] living_room_light_1 | OnOff.OnOff = False
[2026-08-22T22:55:24] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-22T22:55:24] front_door_lock | DoorLock.LockState = 1

## 任务
请分析下面的实时设备事件，判断是否需要将其视为异常安全事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "门锁状态变化但没有对应开门链路",
  "reasoning": [
    "推理步骤1: 门锁状态先解锁再回锁",
    "推理步骤2: 缺乏门磁开关记录",
    "推理步骤3: 却伴随室内灯光变化"
  ],
  "key_evidence": [
    "门锁状态先解锁再回锁",
    "缺乏门磁开关记录",
    "却伴随室内灯光变化"
  ],
  "recommended_actions": [
    "判为异常门锁状态切换，建议核查锁日志与物理门状态。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示的是正常的夜间离家模式及次日清晨的常规开门行为，未发现安全威胁。",
  "reasoning": [
    "推理步骤 1: 凌晨 03:00 至 04:00 期间，所有房间（包括玄关、客厅、卧室）的运动传感器均报告 Occupancy = 0，表明住户已完全离家，处于正常的睡眠或外出状态。",
    "推理步骤 2: 04:06 门锁解锁 (LockState=1) 后于 04:07 重新上锁 (LockState=2)，随后在 04:09 打开客厅灯。结合此时全屋无人且时间较早，这极可能是住户早起出门前进行的例行检查（如确认灯光、查看门口情况），属于正常的人为操作序列。",
    "推理步骤 3: 后续日志中，白天 10:11 再次开启客厅灯，晚上 22:55 关闭灯光并手动记录了一次开门事件 (LockOperationType=0, OperationSource=Manual)。这些时间点符合典型的居家作息规律，且没有伴随异常入侵迹象（如有人进入但无运动检测，或门被非法撬动）。",
    "推理步骤 4: 综合来看，设备状态变化逻辑连贯，符合‘离家 - 晨起检查 - 日间活动 - 晚间归家’的正常生活模式，不存在尾随、非法入侵或设备故障的特征。"
  ],
  "key_evidence": [
    "03:00-04:00 全屋运动传感器持续报告无人 (Occupancy=0)。",
    "04:06-04:07 门锁快速完成‘解锁 - 上锁’循环，紧接着是开灯动作，符合单人操作特征。",
    "22:55 的关门/开门事件标记为 Manual 来源，且发生在合理的晚间回家时间段。"
  ],
  "recommended_actions": [
    "无需采取紧急措施，系统运行正常。",
    "建议继续保持当前的日志监控频率，关注未来是否有非授权时间的频繁开关门行为。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 living_room: 客厅主灯[dimmable_light], 客厅副灯[dimmable_light], 客厅氛围灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘1[window_covering], 客厅窗户传感器1[contact_sensor], ... 共10个设备
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 master_bathroom: 主卫灯[onoff_light], 主卫运动传感器[occupancy_sensor], 主卫漏水传感器[water_leak_detector]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧床头灯[onoff_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bathroom: 次卫灯[onoff_light], 次卫漏水传感器[water_leak_detector]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧空调[air_conditioner], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ3
- 重点房间: living_room
- 重点设备: kitchen_light, living_room_occupancy
- 已选事件数: 135

## 跨天活动摘要
- 2026-08-04: living_room=111, kids_room=231, entrance=230, master_bedroom=227, master_bathroom=222, dining_room=220
- 2026-08-05: living_room=114, master_bedroom=227, kids_room=227, entrance=227, dining_room=222, master_bathroom=53
- 2026-08-06: living_room=111, kids_room=233, master_bedroom=232, entrance=229, dining_room=220, master_bathroom=53

## 设备事件日志
[2026-08-04T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2322
[2026-08-04T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2336
[2026-08-04T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-08-04T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-08-04T02:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-08-04T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-08-04T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-08-04T02:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2339
[2026-08-04T02:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-08-04T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-08-04T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-08-04T02:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-08-04T03:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-08-04T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T03:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T03:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-08-04T03:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-08-04T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-04T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-08-04T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-08-04T03:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-08-04T03:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2382
[2026-08-04T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2386
[2026-08-04T03:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-08-04T03:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T03:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2395
[2026-08-04T03:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-08-04T03:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-08-04T03:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2385
[2026-08-04T03:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2397
[2026-08-04T03:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-08-04T04:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2397
[2026-08-04T04:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T04:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2409
[2026-08-04T04:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2418
[2026-08-04T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-04T04:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2428
[2026-08-04T07:20:02] kitchen_light | OnOff.OnOff = False
[2026-08-05T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-08-05T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-08-05T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-08-05T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-08-05T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-08-05T02:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2338
[2026-08-05T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-08-05T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-08-05T02:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-08-05T02:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2353
[2026-08-05T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-08-05T02:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-08-05T03:00:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-08-05T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T03:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T03:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-08-05T03:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-08-05T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-05T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-08-05T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2374
[2026-08-05T03:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2369
[2026-08-05T03:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-05T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-08-05T03:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2389
[2026-08-05T03:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T03:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T03:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2390
[2026-08-05T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-08-05T03:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2395
[2026-08-05T03:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2382
[2026-08-05T03:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2388
[2026-08-05T03:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2397
[2026-08-05T03:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2398
[2026-08-05T04:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2398
[2026-08-05T04:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T04:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2401
[2026-08-05T04:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2414
[2026-08-05T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-05T04:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2422
[2026-08-05T07:36:06] kitchen_light | OnOff.OnOff = False
[2026-08-05T23:41:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-06T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2320
[2026-08-06T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-08-06T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-08-06T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2337
[2026-08-06T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-08-06T02:30:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-08-06T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-08-06T02:40:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-08-06T02:45:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-08-06T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-08-06T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-08-06T02:55:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-08-06T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T03:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T03:05:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-06T03:10:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2375
[2026-08-06T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-06T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2373
[2026-08-06T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-08-06T03:15:00] kitchen_light | OnOff.OnOff = True
[2026-08-06T03:20:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-08-06T03:25:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-08-06T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2371
[2026-08-06T03:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-06T03:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T03:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T03:35:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-08-06T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2395
[2026-08-06T03:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2390
[2026-08-06T03:45:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2389
[2026-08-06T03:50:00] master_bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2394
[2026-08-06T03:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-08-06T03:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2388
[2026-08-06T04:00:00] kids_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2400
[2026-08-06T04:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T04:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2410
[2026-08-06T04:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2395
[2026-08-06T04:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2412
[2026-08-06T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T04:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2420
[2026-08-06T06:34:09] kitchen_light | OnOff.OnOff = True

## 任务
以下是过去 3 天的设备活动记录。请识别其中是否存在可疑行为模式，并解释你的判断。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "intrusion",
  "threat_description": "检测到凌晨时段（03:14-04:30）客厅存在持续的人员活动，且伴随厨房灯光开启，疑似非正常作息下的入侵或异常行为。",
  "reasoning": [
    "1. 时间异常：日志显示在连续三天（8月4日、5日、6日）的凌晨 03:14 左右，客厅运动传感器（living_room_occupancy）从空闲（0）变为有人（1），并在约1.5小时后（04:30）再次变为空闲。这种深夜时段的活跃不符合常规睡眠习惯。",
    "2. 关键设备联动异常：在8月6日凌晨 03:15，即客厅检测到有人后的1分钟内，厨房灯（kitchen_light）被开启（OnOff.OnOff = True）。此前两天同一时间段厨房灯未开启。深夜开启厨房灯通常意味着有人在厨房进行取水、进食或其他操作，结合客厅的活动，构成了完整的“进入-移动-使用设施”的行为链。",
    "3. 排除误报：虽然温度传感器数据有波动，但这是正常的物理现象。重点在于 occupancy_sensor 和 actuator（灯）的状态变化。凌晨3点并非典型的起夜时间（通常更晚或更早），且持续一个多小时的活动周期较长，增加了非法入侵或醉酒/药物影响下异常行为的嫌疑。"
  ],
  "key_evidence": [
    "[2026-08-06T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1",
    "[2026-08-06T03:15:00] kitchen_light | OnOff.OnOff = True",
    "[2026-08-06T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0"
  ],
  "recommended_actions": [
    "立即检查入户门锁（entrance_door_lock）及窗户传感器（window_covering/contact_sensor）在过去72小时内是否有未授权的开启记录。",
    "调取家庭监控录像（如有），确认凌晨3点左右客厅和厨房内的人员身份及行为特征。",
    "若确认为非家庭成员，请立即报警并加强安防措施；若为家庭成员，建议核实其健康状况或精神状态。"
  ]
}
```

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "过去三天的设备日志显示正常的夜间温度调节模式和规律的日间活动，未发现安全威胁或异常行为。",
  "reasoning": [
    "推理步骤 1: 温度数据分析。日志中的温度值（如 2322-2428）符合 Matter 协议中摄氏度乘以 10 的编码格式，换算后为 23.2°C - 24.3°C。该数值范围在夏季夜间至清晨的正常居住舒适区间内，且多房间传感器读数高度一致，表明传感器工作正常，无漂移或故障。",
    "推理步骤 2: 占用模式分析。所有房间的占用传感器（occupancy_sensor）在凌晨 00:00 至 04:30 期间均报告为 0（无人），直到早上 07:20 左右厨房灯关闭（可能是定时或手动），随后在 07:36 和 06:34 再次开启，符合典型的起床/离家准备流程。没有发现非授权人员进入的迹象。",
    "推理步骤 3: 跨天一致性检查。三天（8 月 4 日、5 日、6 日）的活动摘要和设备事件序列表现出极高的规律性：夜间无人、温度稳定、早晨特定时间唤醒灯光。这种重复性排除了随机入侵或设备被恶意篡改的可能性。"
  ],
  "key_evidence": [
    "所有房间在凌晨时段（00:00-04:30）持续报告 Occupancy = 0，且无窗户/门接触传感器触发报警。",
    "温度传感器读数在三天内保持稳定的 23°C-24°C 区间，无异常高温或低温波动。",
    "厨房灯光状态变化（关闭 -> 开启）与典型的人类作息时间表吻合，未出现逻辑冲突。"
  ],
  "recommended_actions": [
    "继续保持当前的监控策略，无需额外干预。",
    "建议定期校准温度传感器以确保长期准确性，尽管当前数据表现良好。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅副灯[dimmable_light], 客厅氛围灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘1[window_covering], 客厅窗户传感器1[contact_sensor], ... 共10个设备
- 房间 master_bathroom: 主卫灯[onoff_light], 主卫运动传感器[occupancy_sensor], 主卫漏水传感器[water_leak_detector]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧床头灯[onoff_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bathroom: 次卫灯[onoff_light], 次卫漏水传感器[water_leak_detector]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧空调[air_conditioner], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: balcony
- 重点设备: balcony_door_contact, balcony_light, living_room_occupancy
- 已选事件数: 24

## 设备事件日志
[2026-08-06T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:07:00] balcony_door_contact | BooleanState.StateValue = False
[2026-08-06T02:08:00] balcony_light | OnOff.OnOff = True
[2026-08-06T02:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-06T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T08:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T17:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-06T19:21:07] living_room_occupancy | OccupancySensing.Occupancy = 1

## 任务
请分析下面的实时设备事件，判断是否需要将其视为异常安全事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "阳台门深夜打开且室内无对应活动",
  "reasoning": [
    "推理步骤1: 深夜阳台门突然打开",
    "推理步骤2: 阳台灯随即被点亮",
    "推理步骤3: 随后出现客厅活动"
  ],
  "key_evidence": [
    "深夜阳台门突然打开",
    "阳台灯随即被点亮",
    "随后出现客厅活动"
  ],
  "recommended_actions": [
    "判定为高风险边界入侵，建议立即检查阳台出入口。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示凌晨时段存在正常的夜间活动模式，无入侵或异常行为迹象。",
  "reasoning": [
    "推理步骤 1: 分析时间线，在 02:07 阳台门传感器状态变为 False（打开），紧接着 02:08 阳台灯开启，随后 02:09 客厅运动传感器检测到有人（Occupancy=1）。这一序列符合住户起夜、经过阳台区域并进入客厅的正常行为逻辑。",
    "推理步骤 2: 检查后续状态，住户在 02:30 离开客厅后，所有房间（包括卧室、厨房等）的运动传感器均报告无人（Occupancy=0），且直到次日傍晚 19:21 才再次检测到客厅有人。这表明该次夜间活动是孤立的，并未伴随其他可疑的徘徊或重复进出行为。",
    "推理步骤 3: 结合家庭布局，阳台门与客厅相邻，起夜时短暂开启阳台门并开灯查看或通行是常见场景。由于没有发现入户门锁被非法操作、窗户传感器异常触发或其他安防设备报警，因此判定为正常的生活习惯而非安全威胁。"
  ],
  "key_evidence": [
    "02:07 阳台门打开后立即有灯光和人员活动记录",
    "02:30 之后所有区域持续保持无人状态直至次日傍晚",
    "未检测到入户门锁状态变化或其他安防警报"
  ],
  "recommended_actions": [
    "无需采取紧急措施，系统运行正常。",
    "建议用户确认是否记得当时起夜经过阳台，若不确定可忽略此条提示。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 一室一厅 (Studio/1BR)
- 重点房间 living_room: 客厅主灯[dimmable_light], 客厅台灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 bedroom: 卧室灯[dimmable_light], 卧室运动传感器[occupancy_sensor], 卧室窗帘[window_covering], 卧室窗户传感器[contact_sensor], 卧室温度传感器[temperature_sensor]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ3
- 重点房间: living_room
- 重点设备: kitchen_light, living_room_occupancy
- 已选事件数: 135

## 跨天活动摘要
- 2026-08-15: living_room=197, bedroom=210, bathroom=56, kitchen=14, entrance=3
- 2026-08-16: living_room=195, bedroom=208, bathroom=56, kitchen=14, entrance=3
- 2026-08-17: living_room=110, bedroom=64, bathroom=54, entrance=14, kitchen=9

## 设备事件日志
[2026-08-15T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-15T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2317
[2026-08-15T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2314
[2026-08-15T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-08-15T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-08-15T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-08-15T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-08-15T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-08-15T02:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2253
[2026-08-15T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-15T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-15T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2242
[2026-08-15T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2358
[2026-08-15T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-08-15T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2261
[2026-08-15T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-08-15T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-15T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2262
[2026-08-15T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2366
[2026-08-15T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-15T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-15T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-08-15T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-15T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-08-15T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2377
[2026-08-15T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2280
[2026-08-15T03:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-08-15T03:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2278
[2026-08-15T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-15T03:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-15T03:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2284
[2026-08-15T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2395
[2026-08-15T03:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384
[2026-08-15T03:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2281
[2026-08-15T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2400
[2026-08-15T03:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-08-15T03:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2303
[2026-08-15T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2407
[2026-08-15T04:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2404
[2026-08-15T04:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-15T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2409
[2026-08-15T04:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2406
[2026-08-15T04:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2413
[2026-08-15T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-15T04:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2422
[2026-08-15T04:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2437
[2026-08-15T12:14:00] kitchen_light | OnOff.OnOff = True
[2026-08-15T17:45:00] kitchen_light | OnOff.OnOff = True
[2026-08-16T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2315
[2026-08-16T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-08-16T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2313
[2026-08-16T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-16T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2333
[2026-08-16T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-08-16T02:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2249
[2026-08-16T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2336
[2026-08-16T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-08-16T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-16T02:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-08-16T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2352
[2026-08-16T02:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2241
[2026-08-16T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-08-16T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2348
[2026-08-16T02:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2259
[2026-08-16T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-08-16T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2357
[2026-08-16T03:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2267
[2026-08-16T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-16T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-16T03:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2271
[2026-08-16T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2373
[2026-08-16T03:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2359
[2026-08-16T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-16T03:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-08-16T03:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2364
[2026-08-16T03:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2269
[2026-08-16T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-08-16T03:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2375
[2026-08-16T03:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-16T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2374
[2026-08-16T03:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2390
[2026-08-16T03:40:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2284
[2026-08-16T03:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2400
[2026-08-16T03:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-08-16T03:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2294
[2026-08-16T03:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2405
[2026-08-16T03:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-08-16T04:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2298
[2026-08-16T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-16T04:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-16T04:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2402
[2026-08-16T04:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2418
[2026-08-16T04:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2422
[2026-08-16T04:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2421
[2026-08-16T04:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2436
[2026-08-16T09:05:04] kitchen_light | OnOff.OnOff = True
[2026-08-16T12:17:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-16T18:57:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-17T01:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2308
[2026-08-17T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-08-17T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-08-17T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2328
[2026-08-17T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2335
[2026-08-17T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-08-17T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2336
[2026-08-17T02:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2234
[2026-08-17T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2236
[2026-08-17T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2355
[2026-08-17T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2341
[2026-08-17T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2258
[2026-08-17T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-17T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-08-17T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2267
[2026-08-17T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-08-17T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-08-17T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2375
[2026-08-17T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2362
[2026-08-17T03:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2276
[2026-08-17T03:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-17T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-08-17T03:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2372
[2026-08-17T03:15:00] kitchen_light | OnOff.OnOff = True
[2026-08-17T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2265
[2026-08-17T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2371
[2026-08-17T03:30:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2275
[2026-08-17T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T03:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-17T03:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2293
[2026-08-17T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-08-17T03:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2381
[2026-08-17T03:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2295
[2026-08-17T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2384

## 任务
请从下面 3 天的时序日志中分析住户或环境是否出现异常模式，不要只看单个事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "连续多天同一时段出现陌生运动模式",
  "reasoning": [
    "推理步骤1: 连续 3 天都在 03:14 出现客厅运动",
    "推理步骤2: 时间点高度一致",
    "推理步骤3: 第 3 天继续延伸到厨房活动"
  ],
  "key_evidence": [
    "连续 3 天都在 03:14 出现客厅运动",
    "时间点高度一致",
    "第 3 天继续延伸到厨房活动"
  ],
  "recommended_actions": [
    "标记为重复异常夜间活动，建议排查入侵或异常访客。"
  ]
}

```json
{
  "is_anomaly": true,
  "confidence": "high",
  "threat_type": "sensor_drift",
  "threat_description": "客厅温度传感器存在严重的数值漂移和异常读数，导致环境数据不可信，可能掩盖真实的火灾风险或设备故障。",
  "reasoning": [
    "推理步骤 1: 分析日志发现，所有温度传感器的原始读数均以 '23xx' 开头（例如 2317, 2437），这明显不符合摄氏度 (°C) 的正常范围（通常为 -10 到 50）。结合 Matter 协议标准，这些数值极有可能是以 0.01°C 为单位的整数表示，即实际温度为 23.17°C 至 24.37°C，这在物理上是合理的室温范围。",
    "推理步骤 2: 尽管基础数值转换后合理，但观察同一时间段内不同房间的温度变化模式发现严重的不一致性。在 2026-08-15T02:00 至 04:00 期间，卧室温度稳定在 22.4°C - 22.9°C 之间，而客厅温度却从 23.1°C 持续攀升至 24.3°C，且厨房温度也同步升高。这种跨房间的剧烈温差（>2°C）在没有人员活动（occupancy=0）的情况下是不自然的，暗示传感器校准失效或受到局部热源干扰。",
    "推理步骤 3: 最关键的异常在于数据的非物理性波动。例如在 2026-08-15T02:25:00，客厅温度瞬间从 23.42 跳变到 23.41，随后又迅速爬升；而在 2026-08-16T04:45:00，温度出现无规律的锯齿状波动（2421 -> 2436）。这种高频、无逻辑的数值跳动超出了正常热惯性变化的范畴，表明传感器硬件可能已损坏、固件读取错误，或者通信链路存在严重的丢包/重传导致的数值错乱（Sensor Drift/Malfunction）。",
    "推理步骤 4: 由于温度是火灾检测的关键指标，且日志中包含了烟雾报警器（smoke_co_alarm）但未触发报警，如果真实环境温度因传感器故障未能被正确记录（例如实际过热但显示正常），将构成重大的安全隐患。因此，必须将此类数据异常视为高优先级事件处理。"
  ],
  "key_evidence": [
    "温度读数格式异常：原始值如 '2317' 远超常规摄氏度范围，需按 0.01 倍率换算，但换算后的趋势仍存疑。",
    "跨房间温差异常：在无人员活动的深夜时段，客厅与卧室温差持续超过 2°C，违背热力学平衡常识。",
    "数据波动非物理性：温度在短时间内出现无规律的剧烈跳变（如 23.42 -> 23.41 -> 23.42...），符合传感器故障特征而非真实环境变化。"
  ],
  "recommended_actions": [
    "立即标记客厅温度传感器 [living_room_temp_sensor] 为‘故障’状态，并在智能家居系统中暂时禁用其自动温控逻辑，防止基于错误数据做出危险决策。",
    "安排技术人员现场检修或更换客厅温度传感器，并检查其安装位置是否靠近空调出风口或其他热源。",
    "在修复前，建议用户手动监测客厅实际温度，并留意是否有异味或烟雾，以防传感器失灵掩盖了潜在的火灾隐患。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 三室两厅 (3BR)
- 重点房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 dining_room: 餐厅灯[dimmable_light], 餐厅运动传感器[occupancy_sensor]
- 房间 kids_room: 儿童房灯[dimmable_light], 儿童房运动传感器[occupancy_sensor], 儿童房窗帘[window_covering], 儿童房窗户传感器[contact_sensor], 儿童房温度传感器[temperature_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher], 厨房漏水传感器[water_leak_detector]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅副灯[dimmable_light], 客厅氛围灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘1[window_covering], 客厅窗户传感器1[contact_sensor], ... 共10个设备
- 房间 master_bathroom: 主卫灯[onoff_light], 主卫运动传感器[occupancy_sensor], 主卫漏水传感器[water_leak_detector]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧床头灯[onoff_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bathroom: 次卫灯[onoff_light], 次卫漏水传感器[water_leak_detector]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧空调[air_conditioner], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: entrance
- 重点设备: front_door_lock, living_room_light_1
- 已选事件数: 24

## 设备事件日志
[2026-08-20T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:06:00] front_door_lock | DoorLock.LockState = 2
[2026-08-20T04:07:00] front_door_lock | DoorLock.LockState = 1
[2026-08-20T04:09:00] living_room_light_1 | OnOff.OnOff = True
[2026-08-20T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T04:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T05:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-20T07:16:34] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-20T07:16:37] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-20T15:56:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-20T17:57:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)

## 任务
系统刚记录到以下一段设备状态变化。请评估这些变化是否已经构成安全风险，并说明原因。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "门锁状态变化但没有对应开门链路",
  "reasoning": [
    "推理步骤1: 门锁状态先解锁再回锁",
    "推理步骤2: 缺乏门磁开关记录",
    "推理步骤3: 却伴随室内灯光变化"
  ],
  "key_evidence": [
    "门锁状态先解锁再回锁",
    "缺乏门磁开关记录",
    "却伴随室内灯光变化"
  ],
  "recommended_actions": [
    "判为异常门锁状态切换，建议核查锁日志与物理门状态。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示的家庭活动模式符合正常的夜间至清晨作息，未发现入侵、异常操作或设备故障迹象。",
  "reasoning": [
    "时间线分析：所有事件发生在凌晨 03:00 至次日早晨 07:16 之间，且随后在白天（15:56, 17:57）有正常的开门记录，表明这是典型的夜间无人居住时段及随后的正常离家/回家流程。",
    "门锁状态验证：凌晨 04:06-04:09 的门锁状态变化（LockState=2 解锁 -> LockState=1 上锁）发生在入户运动传感器持续报告'无人'(Occupancy=0) 的情况下，且紧接着客厅灯光被打开，这完全符合住户从外部返回家中并自行开门开灯的正常行为逻辑，而非非法闯入（非法闯入通常伴随传感器未检测到人员或强行开启）。",
    "环境一致性：整个时间段内，除玄关和客厅外，其他房间（卧室、厨房等）均无人员活动报告，与深夜休息状态一致；后续白天的开门事件也均为手动正常操作，未见异常徘徊或重复尝试开锁的行为。"
  ],
  "key_evidence": [
    "04:06-04:09 期间 entrance_occupancy 持续为 0，排除了有人尾随进入的可能性。",
    "04:09 客厅灯光 (living_room_light_1) 开启，佐证了住户主动进入并照明的意图。",
    "白天 07:16 及之后的开门事件标记为 Manual 且间隔合理，属于正常生活轨迹。"
  ],
  "recommended_actions": [
    "无需采取紧急措施，系统运行正常。",
    "建议继续监控日常模式，若未来出现非手动解锁或夜间长时间无人却频繁触发门锁事件，则需重新评估。"
  ]
}
```


你是一个智能家居安全分析 AI 助手。你的职责是分析智能家居设备的状态日志，判断是否存在安全威胁或异常情况。

你需要基于以下能力进行分析：
1. 从设备状态变化中识别异常模式
2. 结合时间、住户习惯、设备类型进行推理
3. 区分真实威胁和正常行为（减少误报）
4. 对发现的问题给出具体的风险评估和建议

所有设备基于 Matter 协议标准，设备状态通过 Cluster.Attribute 的形式报告。

## 家庭环境信息
家庭布局: 两室一厅 (2BR)
- 重点房间 balcony: 阳台灯[onoff_light], 阳台门传感器[contact_sensor], 洗衣机[laundry_washer]
- 房间 bathroom: 卫生间灯[onoff_light], 卫生间运动传感器[occupancy_sensor], 卫生间漏水传感器[water_leak_detector]
- 房间 entrance: 入户门锁[door_lock], 入户门传感器[contact_sensor], 玄关灯[onoff_light], 玄关运动传感器[occupancy_sensor]
- 房间 kitchen: 厨房灯[onoff_light], 厨房灶具[cook_surface], 厨房烟雾报警器[smoke_co_alarm], 厨房温度传感器[temperature_sensor], 厨房窗户传感器[contact_sensor], 洗碗机[dishwasher]
- 房间 living_room: 客厅主灯[dimmable_light], 客厅落地灯[onoff_light], 客厅空调[air_conditioner], 客厅温度传感器[temperature_sensor], 客厅运动传感器[occupancy_sensor], 客厅窗帘[window_covering], 客厅窗户传感器[contact_sensor]
- 房间 master_bedroom: 主卧灯[dimmable_light], 主卧空调[air_conditioner], 主卧运动传感器[occupancy_sensor], 主卧窗帘[window_covering], 主卧窗户传感器[contact_sensor], 主卧温度传感器[temperature_sensor]
- 房间 second_bedroom: 次卧灯[dimmable_light], 次卧运动传感器[occupancy_sensor], 次卧窗帘[window_covering], 次卧窗户传感器[contact_sensor], 次卧温度传感器[temperature_sensor]

## 已选日志说明
以下日志不是整天原始全量心跳，而是围绕关键设备、关键时间窗和跨天模式筛出的训练片段。
- 任务类型: SQ2
- 重点房间: balcony
- 重点设备: balcony_door_contact, balcony_light, living_room_occupancy
- 已选事件数: 23

## 设备事件日志
[2026-08-01T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T02:07:00] balcony_door_contact | BooleanState.StateValue = False
[2026-08-01T02:08:00] balcony_light | OnOff.OnOff = True
[2026-08-01T02:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-01T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-01T10:54:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-01T13:29:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-01T16:04:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-01T18:39:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-01T21:14:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-01T23:49:00] living_room_occupancy | OccupancySensing.Occupancy = 1

## 任务
请分析下面的实时设备事件，判断是否需要将其视为异常安全事件。

请按以下 JSON 格式回答：

```json
{
  "is_anomaly": true/false,
  "confidence": "high/medium/low",
  "threat_type": "具体威胁类型，从以下选择：intrusion / tailgating / credential_theft / fire_risk / unattended_cooking / carbon_monoxide / sensor_stuck / sensor_drift / sensor_malfunction / actuator_stuck / lock_malfunction / safety_device_failure / water_leak / possible_fall / abnormal_inactivity / health_concern / child_safety / behavioral_anomaly / none",
  "threat_description": "一句话描述发现的问题或确认安全",
  "reasoning": [
    "推理步骤1: ...",
    "推理步骤2: ...",
    "推理步骤3: ..."
  ],
  "key_evidence": [
    "关键证据1",
    "关键证据2"
  ],
  "recommended_actions": [
    "建议措施1",
    "建议措施2"
  ]
}
```

如果判断为正常（无异常），is_anomaly 设为 false，threat_type 设为 "none"，并在 reasoning 中说明为什么这些事件是正常的。

{
  "is_anomaly": true,
  "confidence": "medium",
  "threat_type": "intrusion",
  "threat_description": "阳台门深夜打开且室内无对应活动",
  "reasoning": [
    "推理步骤1: 深夜阳台门突然打开",
    "推理步骤2: 阳台灯随即被点亮",
    "推理步骤3: 随后出现客厅活动"
  ],
  "key_evidence": [
    "深夜阳台门突然打开",
    "阳台灯随即被点亮",
    "随后出现客厅活动"
  ],
  "recommended_actions": [
    "判定为高风险边界入侵，建议立即检查阳台出入口。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示夜间阳台门被打开并开启灯光，随后客厅检测到人员活动，符合住户夜间起夜或起床活动的正常行为模式。",
  "reasoning": [
    "推理步骤 1: 在凌晨 02:07，阳台门传感器（balcony_door_contact）状态变为 False（打开），紧接着在 02:08 阳台灯（balcony_light）被开启。这表明有人主动打开了阳台门并打开了灯，而非入侵者强行闯入（通常不会立即开灯）。",
    "推理步骤 2: 在 02:09，客厅运动传感器（living_room_occupancy）检测到人员出现（Occupancy = 1）。时间序列上，先有阳台门动作，后有客厅人员活动，逻辑连贯，说明是同一人从阳台区域移动到了客厅。",
    "推理步骤 3: 结合上下文，所有卧室在 02:00 均无人员活动，且后续在 02:30 和 03:00 客厅人员再次消失，这非常符合居民深夜起床、短暂活动（如喝水、上厕所或查看阳台）后返回休息的正常生活场景。没有发现门窗异常保持开启、长时间无人值守或设备故障的迹象。"
  ],
  "key_evidence": [
    "02:07 阳台门打开后立即于 02:08 开启灯光",
    "02:09 客厅随即检测到人员活动，形成完整的‘开门 - 开灯 - 进入’行为链"
  ],
  "recommended_actions": [
    "无需采取紧急措施，该事件属于正常家庭活动。",
    "建议确认用户是否有意保留阳台门开启状态，若需安全起见可设置自动关闭延时或提醒用户检查门锁状态。"
  ]
}
```