你是一个智能家居安全分析 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
- 重点设备: entrance_light, front_door_contact, front_door_lock, living_room_occupancy
- 已选事件数: 37

## 设备事件日志
[2026-08-28T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:11:00] front_door_lock | DoorLock.LockState = 2
[2026-08-28T02:11:00] front_door_contact | BooleanState.StateValue = False
[2026-08-28T02:12:00] entrance_light | OnOff.OnOff = True
[2026-08-28T02:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:30:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-28T06:59:04] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-28T06:59:04] front_door_lock | DoorLock.LockState = 2
[2026-08-28T06:59:06] front_door_contact | BooleanState.StateValue = False
[2026-08-28T06:59:10] front_door_contact | BooleanState.StateValue = True
[2026-08-28T06:59:11] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-28T06:59:11] front_door_lock | DoorLock.LockState = 1
[2026-08-28T08:26:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-28T08:26:00] front_door_lock | DoorLock.LockState = 2
[2026-08-28T08:26:02] front_door_contact | BooleanState.StateValue = False
[2026-08-28T09:46:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T12:36:07] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T15:25:13] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T18:15:13] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T20:43:11] front_door_contact | BooleanState.StateValue = True
[2026-08-28T20:43:12] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-28T20:43:12] front_door_lock | DoorLock.LockState = 1
[2026-08-28T21:01:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-28T23:51: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": "credential_theft",
  "threat_description": "临时访客码在非预约时段使用",
  "reasoning": [
    "推理步骤1: 凌晨 02:11 门锁解锁并开门",
    "推理步骤2: 玄关灯随后开启",
    "推理步骤3: 紧接着出现室内活动，不像误触"
  ],
  "key_evidence": [
    "凌晨 02:11 门锁解锁并开门",
    "玄关灯随后开启",
    "紧接着出现室内活动，不像误触"
  ],
  "recommended_actions": [
    "标记为异常入户，建议检查临时访客码使用记录并立即重置。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的夜间无人状态及白天的常规出入活动，未发现安全威胁。",
  "reasoning": [
    "推理步骤 1: 凌晨 02:11 至 02:30 期间，门锁解锁、门接触传感器触发（False）、玄关灯开启以及客厅有人检测，随后在 02:30 所有房间 occupancy 归零且门锁重新上锁。结合独居老人的作息习惯，这符合老人夜间起夜如厕或短暂外出后返回并锁门的正常行为模式，且后续长时间无活动直至次日清晨，排除了入侵可能。",
    "推理步骤 2: 06:59 和 08:26 的日志记录了手动解锁、开门、关门及重新上锁的操作序列，时间间隔合理，符合老人早晨起床出门上班或外出的常规流程。",
    "推理步骤 3: 傍晚 20:43 记录了一次完整的开门 - 关门 - 上锁操作，随后在 21:01 检测到客厅有人，表明老人已安全回家。整段日志中设备状态变化逻辑连贯，传感器读数与物理动作一致，未出现异常滞留、非法闯入或设备故障迹象。"
  ],
  "key_evidence": [
    "02:11-02:30 期间的完整‘解锁 - 进门 - 离开 - 上锁’闭环且之后长时间无活动",
    "06:59 和 08:26 的手动操作序列符合日常出行规律",
    "20:43 的关门上锁操作紧随其后 21:01 的室内有人检测，确认住户安全归位"
  ],
  "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
- 重点设备: entrance_light, front_door_contact, front_door_lock, living_room_occupancy
- 已选事件数: 24

## 设备事件日志
[2026-07-20T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:11:00] front_door_lock | DoorLock.LockState = 2
[2026-07-20T02:11:00] front_door_contact | BooleanState.StateValue = False
[2026-07-20T02:12:00] entrance_light | OnOff.OnOff = True
[2026-07-20T02:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-20T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T07:35:29] 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": "credential_theft",
  "threat_description": "临时访客码在非预约时段使用",
  "reasoning": [
    "推理步骤1: 凌晨 02:11 门锁解锁并开门",
    "推理步骤2: 玄关灯随后开启",
    "推理步骤3: 紧接着出现室内活动，不像误触"
  ],
  "key_evidence": [
    "凌晨 02:11 门锁解锁并开门",
    "玄关灯随后开启",
    "紧接着出现室内活动，不像误触"
  ],
  "recommended_actions": [
    "标记为异常入户，建议检查临时访客码使用记录并立即重置。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的夜间离家模式及次日早晨手动上锁行为，未发现安全威胁。",
  "reasoning": [
    "推理步骤 1: 凌晨 02:11 至 02:13 的事件序列（门锁解锁、门接触传感器断开、玄关灯开启）符合住户夜间起床如厕或短暂离开房间后返回的典型行为模式，且随后在 02:30 所有房间 occupancy 均恢复为 0，表明住户已重新进入并处于休息状态，非入侵迹象。",
    "推理步骤 2: 凌晨 02:30 之后直到 07:35，所有重点房间（entrance, living_room 等）的 occupancy 持续为 0，符合家庭夜间无人活动的正常状态。",
    "推理步骤 3: 07:35 发生的 LockOperation (LockOperationType=1, OperationSource=Manual) 表示住户在早晨出门前手动锁门，这是标准的日常安全操作，与之前的异常事件无关联，整体时间线逻辑连贯且合理。"
  ],
  "key_evidence": [
    "02:11-02:13 的门锁/传感器变化后立即伴随 occupancy 归零，符合内部人员活动特征。",
    "02:30 全房 occupancy 同时变为 0，确认了‘空屋’状态的建立。",
    "07:35 的手动上锁操作发生在长时间的空屋期之后，符合早晨离家的常规流程。"
  ],
  "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-07-20T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:07:00] balcony_door_contact | BooleanState.StateValue = False
[2026-07-20T02:08:00] balcony_light | OnOff.OnOff = True
[2026-07-20T02:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-20T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T08:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T17:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T19:21:08] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-20T20:51:08] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-20T22:21:08] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-20T23:51: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": true,
  "confidence": "low",
  "threat_type": "fire_risk",
  "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]

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

## 跨天活动摘要
- 2026-08-19: entrance=235, living_room=114, bathroom=56, master_bedroom=48, second_bedroom=48, kitchen=8

## 设备事件日志
[2026-08-19T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T01:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T01:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T01:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T01:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:11:00] front_door_lock | DoorLock.LockState = 2
[2026-08-19T02:11:00] front_door_contact | BooleanState.StateValue = False
[2026-08-19T02:12:00] entrance_light | OnOff.OnOff = True
[2026-08-19T02:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-19T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-19T07:14:19] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-19T07:14:19] front_door_lock | DoorLock.LockState = 2

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

请按以下 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: 凌晨 02:11 门锁解锁并开门",
    "推理步骤2: 玄关灯随后开启",
    "推理步骤3: 紧接着出现室内活动，不像误触"
  ],
  "key_evidence": [
    "凌晨 02:11 门锁解锁并开门",
    "玄关灯随后开启",
    "紧接着出现室内活动，不像误触"
  ],
  "recommended_actions": [
    "标记为异常入户，建议检查临时访客码使用记录并立即重置。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的夜间离家与清晨入户行为模式，未发现安全威胁。",
  "reasoning": [
    "推理步骤 1: 凌晨 02:11 至 02:13 的事件序列（门锁解锁、门接触传感器断开、玄关灯开启）随后在 02:13 检测到客厅有人，符合住户夜间起床如厕或短暂活动后离家的正常行为逻辑。",
    "推理步骤 2: 该时段内所有房间运动传感器均报告无人状态（0），且后续长时间无异常闯入迹象，排除了非法入侵的可能性。",
    "推理步骤 3: 早晨 07:14 的锁操作事件标记为手动操作且状态变为锁定（LockState=2），结合时间戳符合住户正常出门上班/上学的日常习惯。"
  ],
  "key_evidence": [
    "02:11-02:13 的门锁/传感器联动与随后短暂的客厅 occupancy 信号一致于内部人员活动。",
    "07:14 的 LockOperation 类型为 Manual 且发生在早晨通勤时间，符合预期行为。",
    "全时段无其他房间传感器触发报警或异常占用记录。"
  ],
  "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
- 重点设备: entrance_light, front_door_contact, front_door_lock, living_room_occupancy
- 已选事件数: 37

## 设备事件日志
[2026-07-21T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T02:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T02:11:00] front_door_lock | DoorLock.LockState = 2
[2026-07-21T02:11:00] front_door_contact | BooleanState.StateValue = False
[2026-07-21T02:12:00] entrance_light | OnOff.OnOff = True
[2026-07-21T02:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-21T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T02:30:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-21T06:56:10] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-21T06:56:10] front_door_lock | DoorLock.LockState = 2
[2026-07-21T06:56:12] front_door_contact | BooleanState.StateValue = False
[2026-07-21T06:56:14] front_door_contact | BooleanState.StateValue = True
[2026-07-21T06:56:15] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-21T06:56:15] front_door_lock | DoorLock.LockState = 1
[2026-07-21T08:30:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-21T08:30:00] front_door_lock | DoorLock.LockState = 2
[2026-07-21T08:30:02] front_door_contact | BooleanState.StateValue = False
[2026-07-21T09:45:08] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-21T12:35:08] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-21T15:24:10] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-21T18:14:10] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-21T20:35:12] front_door_contact | BooleanState.StateValue = True
[2026-07-21T20:35:13] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-21T20:35:13] front_door_lock | DoorLock.LockState = 1
[2026-07-21T21:00:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-21T23:50: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": "credential_theft",
  "threat_description": "临时访客码在非预约时段使用",
  "reasoning": [
    "推理步骤1: 凌晨 02:11 门锁解锁并开门",
    "推理步骤2: 玄关灯随后开启",
    "推理步骤3: 紧接着出现室内活动，不像误触"
  ],
  "key_evidence": [
    "凌晨 02:11 门锁解锁并开门",
    "玄关灯随后开启",
    "紧接着出现室内活动，不像误触"
  ],
  "recommended_actions": [
    "标记为异常入户，建议检查临时访客码使用记录并立即重置。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示独居老人正常的夜间外出、日间活动及晚间归家模式，未发现入侵或异常行为迹象。",
  "reasoning": [
    "推理步骤 1: 凌晨 02:11 至 02:30 期间，门锁解锁 (LockState=1)、门接触传感器断开 (False) 随后在 02:14 恢复闭合 (True)，紧接着玄关灯亮起且客厅有人 (Occupancy=1)，随后人在 02:30 离开。这符合老人起夜如厕后短暂外出（可能是去阳台或小区散步）并返回的完整闭环，且门锁最终处于锁定状态 (LockState=2)。",
    "推理步骤 2: 早晨 06:56 和 08:30 的门锁操作均为手动上锁，伴随门接触传感器先断后合再断的过程，这是典型的开门离家动作，时间规律且逻辑正常。",
    "推理步骤 3: 傍晚 20:35 门锁被手动解锁并打开，随后客厅运动传感器在 21:00 检测到人员存在，表明老人已安全归家。整个时间轴内的所有设备状态变化均符合独居老人的生活习惯，无强行闯入、尾随或设备故障特征。"
  ],
  "key_evidence": [
    "02:11-02:30 时间段内，门锁状态经历了 '解锁 -> 开门 -> 关门 -> 重新上锁' 的完整序列，且后续未检测到非法入侵尝试。",
    "所有门接触传感器 (front_door_contact) 的状态变化均与门锁操作事件 (LockOperation) 在时间上紧密耦合，排除了传感器卡死或恶意篡改的可能性。",
    "人员出现 (living_room_occupancy = 1) 的时间点与门锁开启后的合理延迟一致，确认了合法住户的存在。"
  ],
  "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
- 已选事件数: 24

## 设备事件日志
[2026-08-26T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T02:07:00] balcony_door_contact | BooleanState.StateValue = False
[2026-08-26T02:08:00] balcony_light | OnOff.OnOff = True
[2026-08-26T02:09:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T16:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-26T19:21:15] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T20:43:05] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T22:08:05] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T23:33:05] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-26T23:53:05] 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": true,
  "confidence": "low",
  "threat_type": "fire_risk",
  "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]

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

## 跨天活动摘要
- 2026-08-22: entrance=49, living_room=49, master_bedroom=48, second_bedroom=48, bathroom=48, kitchen=1

## 设备事件日志
[2026-08-22T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T12:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T16:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T20:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T22:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T22:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T22:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T22:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T23:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T23:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T23:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T23:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T23:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T23:18:00] front_door_lock | DoorLock.LockState = 2
[2026-08-22T23:24:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-22T23:25:00] kitchen_light | OnOff.OnOff = True
[2026-08-22T23:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T23:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T23:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T23:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-22T23: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:00 至 23:18 期间，所有房间（包括客厅、卧室、卫生间）的运动传感器均报告无人 (Occupancy=0)，且入户门锁状态为未锁定 (LockState != 2)，表明此时家中无人且大门紧闭，处于安全的离家/睡眠状态。",
    "推理步骤 2: 23:18 发生门锁解锁事件 (LockState = 2)，紧接着在 6 分钟后 (23:24) 检测到客厅有人 (Occupancy=1)，随后在 23:25 开启厨房灯。这一时间序列完全符合住户正常回家的行为逻辑：进门 -> 进入客厅 -> 前往厨房。",
    "推理步骤 3: 异常点排查：虽然从开门到客厅有人仅间隔 6 分钟，但考虑到入户门位于玄关，而客厅运动传感器可能受墙体遮挡或距离较远，存在合理的物理延迟；此外，用户可能在玄关停留整理物品或换鞋。随后用户在厨房短暂停留后离开，并在 23:30 时所有区域再次恢复无人状态，整体行为连贯且无入侵迹象。"
  ],
  "key_evidence": [
    "23:18 门锁解锁后立即于 23:24 检测到客厅有人，时间差符合正常步行速度。",
    "23:25 厨房灯光开启与人员出现在客厅后的行为顺序一致，排除了尾随入侵的可能性。",
    "23:30 所有区域运动传感器重新变为 0，确认活动结束后房屋已恢复安全状态。"
  ],
  "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]

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

## 设备事件日志
[2026-08-03T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T02:11:00] front_door_lock | DoorLock.LockState = 2
[2026-08-03T02:11:00] front_door_contact | BooleanState.StateValue = False
[2026-08-03T02:12:00] entrance_light | OnOff.OnOff = True
[2026-08-03T02:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-03T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T07:31:18] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-03T07:31:18] front_door_lock | DoorLock.LockState = 2
[2026-08-03T07:31:20] front_door_contact | BooleanState.StateValue = False
[2026-08-03T07:31:27] front_door_contact | BooleanState.StateValue = True
[2026-08-03T07:31:28] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-03T07:31:28] front_door_lock | DoorLock.LockState = 1
[2026-08-03T08:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T16:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-08-03T18:18:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-08-03T18:18:00] front_door_lock | DoorLock.LockState = 2
[2026-08-03T18:18:02] front_door_contact | BooleanState.StateValue = False
[2026-08-03T18:18:18] entrance_light | OnOff.OnOff = True
[2026-08-03T19:23:20] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-03T20:48:04] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-03T22:03:10] entrance_light | OnOff.OnOff = False
[2026-08-03T22:03:37] front_door_contact | BooleanState.StateValue = True
[2026-08-03T22:03:38] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-08-03T22:03:38] front_door_lock | DoorLock.LockState = 1
[2026-08-03T22:13:04] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-08-03T23:38:04] 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": "credential_theft",
  "threat_description": "临时访客码在非预约时段使用",
  "reasoning": [
    "推理步骤1: 凌晨 02:11 门锁解锁并开门",
    "推理步骤2: 玄关灯随后开启",
    "推理步骤3: 紧接着出现室内活动，不像误触"
  ],
  "key_evidence": [
    "凌晨 02:11 门锁解锁并开门",
    "玄关灯随后开启",
    "紧接着出现室内活动，不像误触"
  ],
  "recommended_actions": [
    "标记为异常入户，建议检查临时访客码使用记录并立即重置。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的夜间无人状态及白天的常规出入活动，未发现安全威胁。",
  "reasoning": [
    "推理步骤 1: 凌晨时段 (02:00-03:00) 所有房间运动传感器均为 0，且门锁保持锁定状态 (LockState=2)，符合夜间睡眠或离家后的正常无人模式。",
    "推理步骤 2: 早晨 (07:31) 和傍晚 (18:18) 的门锁操作均伴随门接触传感器短暂断开 (False) 后恢复闭合 (True)，且随后有手动上锁动作，这是标准的开门进出并重新锁门的正常行为序列。",
    "推理步骤 3: 晚间 (22:03) 检测到人员离开后，门锁被手动关闭并上锁 (LockState=1)，随后客厅运动传感器在深夜至凌晨持续报告有人 (Occupancy=1)，结合入户门已锁闭，这极可能是住户在室内休息或活动，而非入侵事件。"
  ],
  "key_evidence": [
    "02:00-03:00 期间所有 OccupancySensing.Occupancy = 0 且 DoorLock.LockState = 2",
    "07:31 和 18:18 的 LockOperation 事件后均有对应的 front_door_contact 状态变化及后续的上锁操作",
    "22:03 之后 front_door_lock 执行了关闭和上锁操作 (LockState=1)"
  ],
  "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, kitchen_light, living_room_occupancy
- 已选事件数: 32

## 设备事件日志
[2026-07-27T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-27T06:49:05] kitchen_light | OnOff.OnOff = True
[2026-07-27T07:28:00] kitchen_light | OnOff.OnOff = False
[2026-07-27T07:28:21] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-27T07:28:21] front_door_lock | DoorLock.LockState = 2
[2026-07-27T07:28:29] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-27T07:28:29] front_door_lock | DoorLock.LockState = 1
[2026-07-27T09:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-27T18:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-27T18:12:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-27T18:12:00] front_door_lock | DoorLock.LockState = 2
[2026-07-27T19:03:00] kitchen_light | OnOff.OnOff = True
[2026-07-27T19:37:20] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T21:03:04] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T22:08:04] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T22:10:03] entrance_light | OnOff.OnOff = False
[2026-07-27T22:10:33] front_door_contact | BooleanState.StateValue = True
[2026-07-27T22:10:34] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-27T22:10:34] front_door_lock | DoorLock.LockState = 1
[2026-07-27T22:12:06] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T22:28:04] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T22:32:06] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T22:48:04] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T22:50:05] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-27T22:52:06] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T23:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-27T23:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-27T23:08:04] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T23:12:06] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T23:18:00] front_door_lock | DoorLock.LockState = 2
[2026-07-27T23:24:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-27T23:25:00] kitchen_light | OnOff.OnOff = True

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

请按以下 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:28 和 18:12 的锁操作（LockOperationType=1 为锁定，Type=0 为解锁）与典型的早晨离家、傍晚回家时间吻合，且随后门状态正常切换，无未授权访问迹象。",
    "推理步骤 2: 分析客厅 occupancy 传感器数据。虽然白天 (09:00, 18:00) 显示无人，但晚上 (19:37 后) 持续有人，符合家庭成员晚间在家的生活习惯；凌晨时段虽有短暂波动，但未出现长时间无人却门窗开启等矛盾情况。",
    "推理步骤 3: 综合判断。厨房灯在 19:03 开启，随后有人员活动记录，属于正常的晚间烹饪或生活场景。所有设备状态变化逻辑自洽，未发现尾随、强行闯入或设备故障特征。"
  ],
  "key_evidence": [
    "07:28 和 18:12 的入户门锁操作时间与常规作息一致。",
    "晚间 (19:37-23:25) 客厅 occupancy 持续为 1，表明住户在家。",
    "22:10 开门进入后，玄关 occupancy 随即变为 1，逻辑连贯。"
  ],
  "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]

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

## 跨天活动摘要
- 2026-07-17: entrance=227, master_bedroom=229, living_room=116, second_bedroom=48, bathroom=48, kitchen=12

## 设备事件日志
[2026-07-17T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-17T07:10:10] kitchen_light | OnOff.OnOff = True
[2026-07-17T07:47:07] kitchen_light | OnOff.OnOff = False
[2026-07-17T07:47:17] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-17T07:47:17] front_door_lock | DoorLock.LockState = 2
[2026-07-17T07:47:27] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-17T07:47:27] front_door_lock | DoorLock.LockState = 1
[2026-07-17T09:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-17T16:04:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-17T16:04:00] front_door_lock | DoorLock.LockState = 2
[2026-07-17T17:46:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-17T17:46:00] front_door_lock | DoorLock.LockState = 2
[2026-07-17T17:46:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T18:45:00] kitchen_light | OnOff.OnOff = True
[2026-07-17T19:16:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T20:46:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T21:51:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T21:51:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T22:11:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T22:11:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T22:31:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T22:31:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T22:34:00] living_room_light_1 | OnOff.OnOff = False
[2026-07-17T22:34:08] living_room_ac | OnOff.OnOff = False
[2026-07-17T22:34:12] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T22:34:22] master_bedroom_window | WindowCovering.CurrentPositionLiftPercent100ths = 10000
[2026-07-17T22:34:25] front_door_contact | BooleanState.StateValue = True
[2026-07-17T22:34:26] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-17T22:34:26] front_door_lock | DoorLock.LockState = 1
[2026-07-17T22:34:34] master_bedroom_light | OnOff.OnOff = False
[2026-07-17T22:51:02] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T22:51:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T22:54:12] master_bedroom_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T23:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-17T23:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-17T23:18:00] front_door_lock | DoorLock.LockState = 2
[2026-07-17T23:24:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-17T23:25:00] kitchen_light | OnOff.OnOff = True

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

请按以下 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: 分析入户门锁状态，07:47 和 16:04 的锁闭操作（LockOperationType=1）符合住户早晨出门和下午回家的正常行为逻辑，且随后有相应的开门操作，无异常滞留或强制解锁迹象。",
    "推理步骤 2: 检查客厅与玄关的运动传感器数据，从 17:46 开始检测到人员进入（Occupancy=1），并在 22:34 左右检测到主卧有人并关闭灯光和空调，这是典型的晚间回家、休息前的正常生活流。",
    "推理步骤 3: 验证跨房间关联事件，22:34 分前后，客厅/玄关有人 -> 主卧有人 -> 关闭客厅设备 -> 关闭主卧设备 -> 最后再次确认门锁状态（23:18 锁闭），整个时间线连贯且符合单人或双人晚归后安顿睡觉的场景，不存在入侵、尾随或设备故障特征。"
  ],
  "key_evidence": [
    "22:34:25 前门锁处于锁定状态 (LockState=2)，随后在 22:34:26 执行了手动解锁操作，表明是住户主动进出而非外部闯入。",
    "运动传感器序列显示人员从公共区域 (living_room/entrance) 移动至私密区域 (master_bedroom)，并最终在 23:18 重新锁门，符合正常的夜间作息规律。"
  ],
  "recommended_actions": [
    "无需采取紧急措施，系统运行正常。",
    "建议继续保持当前的监控频率，关注后续是否有非授权访问尝试。"
  ]
}
```


你是一个智能家居安全分析 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
- 已选事件数: 100

## 跨天活动摘要
- 2026-07-28: living_room=211, bedroom=242, kitchen=240, entrance=232, bathroom=59

## 设备事件日志
[2026-07-28T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T00:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2286
[2026-07-28T01:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2292
[2026-07-28T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2306
[2026-07-28T01:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2299
[2026-07-28T01:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2302
[2026-07-28T01:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-07-28T01:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2314
[2026-07-28T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T01:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2305
[2026-07-28T01:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2316
[2026-07-28T01:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2208
[2026-07-28T01:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2310
[2026-07-28T01:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2326
[2026-07-28T01:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2215
[2026-07-28T01:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2327
[2026-07-28T01:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2319
[2026-07-28T01:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2229
[2026-07-28T01:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-07-28T02:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-07-28T02:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2323
[2026-07-28T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2329
[2026-07-28T02:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2219
[2026-07-28T02:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2325
[2026-07-28T02:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2324
[2026-07-28T02:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2240
[2026-07-28T02:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2321
[2026-07-28T02:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-07-28T02:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2244
[2026-07-28T02:15:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2336
[2026-07-28T02:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2332
[2026-07-28T02:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2247
[2026-07-28T02:20:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2346
[2026-07-28T02:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2350
[2026-07-28T02:25:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2242
[2026-07-28T02:25:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2342
[2026-07-28T02:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-28T02:30:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2334
[2026-07-28T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:30:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T02:31:00] living_room_window_contact | BooleanState.StateValue = False
[2026-07-28T02:32:00] bedroom_window_contact | BooleanState.StateValue = False
[2026-07-28T02:34:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-28T02:35:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2241
[2026-07-28T02:35:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2343
[2026-07-28T02:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2340
[2026-07-28T02:40:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2351
[2026-07-28T02:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-07-28T02:45:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2257
[2026-07-28T02:45:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2344
[2026-07-28T02:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2365
[2026-07-28T02:50:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2248
[2026-07-28T02:50:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2363
[2026-07-28T02:55:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2368
[2026-07-28T02:55:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2265
[2026-07-28T02:55:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2367
[2026-07-28T03:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2360
[2026-07-28T03:00:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2258
[2026-07-28T03:00:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2356
[2026-07-28T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T03:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T03:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T03:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T03:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-07-28T03:05:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2266
[2026-07-28T03:05:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2375
[2026-07-28T03:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2376
[2026-07-28T03:10:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2272
[2026-07-28T03:10:00] kitchen_temp_sensor | TemperatureMeasurement.MeasuredValue = 2361
[2026-07-28T03:15:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2373
[2026-07-28T03:15:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2261
[2026-07-28T03:20:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2378
[2026-07-28T03:20:00] bedroom_temp_sensor | TemperatureMeasurement.MeasuredValue = 2284
[2026-07-28T03:25:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2388
[2026-07-28T03:30:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2380
[2026-07-28T03:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T03:35:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2379
[2026-07-28T03:40:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2391
[2026-07-28T03:45:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2387
[2026-07-28T03:50:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2392
[2026-07-28T04:00:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2402
[2026-07-28T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-28T04:05:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2396
[2026-07-28T04:10:00] living_room_temp_sensor | TemperatureMeasurement.MeasuredValue = 2400
[2026-07-28T09:49:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-28T12:39:09] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-28T15:29:08] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-28T18:19:08] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-28T21:05:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-28T23:55: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": "fire_risk",
  "threat_description": "凌晨时段（02:31-04:10）检测到窗户被打开，随后客厅温度持续异常升高至 40°C 以上，且无人员活动记录，存在极高的火灾或过热风险。",
  "reasoning": [
    "时间窗口分析：事件发生在凌晨 02:31 至 04:10 之间，此时独居老人通常处于睡眠状态，属于高风险无人监管时段。",
    "环境异常关联：在 02:31 客厅窗户传感器报告开启（False）后，客厅温度从正常的 23°C 左右开始急剧上升，并在 04:00 达到 40.02°C（日志值 2402）。这种升温幅度远超自然昼夜温差，极可能是外部火源侵入或室内设备因通风受阻导致的严重过热。",
    "行为模式缺失：尽管温度飙升且窗户开启，但在整个升温过程中（02:34 到 04:10），所有房间的运动传感器均显示为 0（无人），这表明住户并未察觉危险并试图干预，符合‘未受监控的火灾/过热’特征。",
    "数据合理性校验：虽然温度数值（如 2402）看似超出常规摄氏度范围，但结合 Matter 协议中常见的整数编码习惯（可能代表 24.02°C 或其他缩放比例），其相对变化趋势（持续单调递增）明确指示了热失控现象，而非传感器故障。"
  ],
  "key_evidence": [
    "2026-07-28T02:31:00 living_room_window_contact 状态变为 False (Open)",
    "2026-07-28T04:00:00 living_room_temp_sensor 读数达到 2402 (对应约 40°C)，较初始值上升超过 10 度",
    "在此期间 (02:34 - 04:10) living_room_occupancy 持续为 0，表明无人发现并处理高温"
  ],
  "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-07-18T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T04:00:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T04:00:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T04:00:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T04:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T04:06:00] front_door_lock | DoorLock.LockState = 2
[2026-07-18T04:07:00] front_door_lock | DoorLock.LockState = 1
[2026-07-18T04:09:00] living_room_light | OnOff.OnOff = True
[2026-07-18T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T04:30:00] bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T04:30:00] kitchen_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T04:30:00] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T04:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T05:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T07:03:06] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-18T07:03:06] front_door_lock | DoorLock.LockState = 2
[2026-07-18T07:03:17] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-18T07:03:17] front_door_lock | DoorLock.LockState = 1
[2026-07-18T08:35:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-18T08:35:00] front_door_lock | DoorLock.LockState = 2
[2026-07-18T08:35:12] living_room_light | OnOff.OnOff = True
[2026-07-18T12:39:00] living_room_light | OnOff.OnOff = False
[2026-07-18T13:55:21] living_room_light | OnOff.OnOff = True
[2026-07-18T19:26:06] living_room_light | LevelControl.CurrentLevel = 49
[2026-07-18T20:40:00] living_room_light | OnOff.OnOff = False
[2026-07-18T20:45:13] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-18T20:45:13] 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": [
    "时间线分析：所有事件发生在白天（04:00 - 20:45），符合正常作息。凌晨 04:06-04:09 的锁状态变化（LockState 2->1）伴随随后 04:09 客厅灯开启，极可能是老人夜间起床上厕所后误触门锁或开门查看，且未发生入侵行为（门口传感器持续为 0，直到白天 07:03 才有人工解锁记录）。",
    "行为逻辑验证：07:03 和 08:35 的两次手动上锁操作（LockOperationType=1）与随后的离家/外出场景一致；20:45 的手动解锁（LockOperationType=0）对应回家场景，随后灯光关闭前的最后操作符合归家流程。",
    "环境状态确认：全时段各房间运动传感器在无人时均为 0，且无烟雾、漏水等报警设备触发记录，排除了火灾、漏水或非法入侵的可能性。",
    "设备状态健康：门锁状态切换流畅，无卡死现象；灯光控制响应正常，未见异常闪烁或无法控制的 stuck 状态。"
  ],
  "key_evidence": [
    "07:03 至 08:35 期间有明确的人工上锁操作记录，表明住户具备自主安全意识且门锁功能正常。",
    "全程无 motion_sensor 检测到非预期人员进入，且无 smoke_co_alarm 或 water_leak_detector 报警。",
    "凌晨疑似误操作后，白天活动规律且连贯，未发现尾随或强行闯入特征。"
  ],
  "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
- 重点设备: entrance_light, front_door_contact, front_door_lock, living_room_occupancy
- 已选事件数: 24

## 设备事件日志
[2026-07-18T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:11:00] front_door_lock | DoorLock.LockState = 2
[2026-07-18T02:11:00] front_door_contact | BooleanState.StateValue = False
[2026-07-18T02:12:00] entrance_light | OnOff.OnOff = True
[2026-07-18T02:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-18T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T02:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T03:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-18T03: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": "credential_theft",
  "threat_description": "临时访客码在非预约时段使用",
  "reasoning": [
    "推理步骤1: 凌晨 02:11 门锁解锁并开门",
    "推理步骤2: 玄关灯随后开启",
    "推理步骤3: 紧接着出现室内活动，不像误触"
  ],
  "key_evidence": [
    "凌晨 02:11 门锁解锁并开门",
    "玄关灯随后开启",
    "紧接着出现室内活动，不像误触"
  ],
  "recommended_actions": [
    "标记为异常入户，建议检查临时访客码使用记录并立即重置。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的夜间离家模式，无安全威胁迹象。",
  "reasoning": [
    "时间分析：事件发生在凌晨 02:11 至 02:13，属于典型的深夜时段，住户通常已入睡或外出。",
    "行为逻辑一致性：门锁状态变为'2'（通常代表解锁/未锁定）且门接触传感器变为 False（门打开），紧接着玄关灯亮起，随后客厅运动传感器在 2 分钟后检测到有人（可能是住户回家、宠物活动或误报后的短暂移动），但随后所有房间（包括客厅、餐厅、卧室等）的运动传感器均在 02:30 恢复为无人状态（0）。",
    "排除入侵风险：如果发生非法入侵，通常会伴随更长时间的活动轨迹、多个房间的连续触发或门窗反复开合。此处仅有一次短暂的开门和一次短暂的客厅活动，且之后全屋迅速恢复静默，符合住户短暂进出（如起夜、取物后离开）或系统对短暂干扰的响应特征，未见持续入侵迹象。",
    "设备状态正常：所有传感器读数变化符合物理规律，未发现传感器卡死、漂移或设备故障导致的异常数据。"
  ],
  "key_evidence": [
    "front_door_lock LockState 变为 2 且 front_door_contact StateValue 变为 False 后立即触发了 entrance_light 开启。",
    "living_room_occupancy 仅在 02:13 短暂检测到人 (1)，并在 02:30 即恢复为无人 (0)，其余房间全程保持无人状态。",
    "整个序列结束后，从 02:30 到 03: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-07-20T03:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T03:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:06:00] front_door_lock | DoorLock.LockState = 2
[2026-07-20T04:07:00] front_door_lock | DoorLock.LockState = 1
[2026-07-20T04:09:00] living_room_light_1 | OnOff.OnOff = True
[2026-07-20T04:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T04:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T05:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-20T07:31:24] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-20T07:31:31] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-20T15:56:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-20T17:55: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": [
    "推理步骤 1: 凌晨 03:00 至 04:00 期间，全屋（包括玄关、客厅、卧室等）运动传感器均报告无人状态 (Occupancy=0)，且入户门锁在 04:06-04:07 处于解锁状态 (LockState=1)，随后于 04:09 开启客厅灯光。结合时间判断，这是住户从睡眠中醒来并准备开始一天的正常行为，而非入侵迹象。",
    "推理步骤 2: 07:31 的日志记录了两次连续的锁操作：先解锁 (Type=1) 后上锁 (Type=0)，紧接着在 15:56 和 17:55 分别记录了上锁操作。这些时间点（早晨出门、下午回家/短暂外出、傍晚离开）与典型的家庭作息高度吻合，且所有操作源均为手动 (Manual)，排除了远程非法控制或自动攻击的可能性。",
    "推理步骤 3: 整个日志片段中，没有任何设备报告异常状态（如漏水、烟雾、温度极端变化）、传感器卡死或逻辑冲突（例如有人进入但门未关）。所有事件在时间和空间逻辑上自洽，属于正常的家庭生活轨迹。"
  ],
  "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, kitchen_light, living_room_occupancy
- 已选事件数: 30

## 设备事件日志
[2026-07-01T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T06:50:12] kitchen_light | OnOff.OnOff = True
[2026-07-01T07:27:00] kitchen_light | OnOff.OnOff = False
[2026-07-01T07:27:21] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-01T07:27:21] front_door_lock | DoorLock.LockState = 2
[2026-07-01T07:27:26] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-01T07:27:26] front_door_lock | DoorLock.LockState = 1
[2026-07-01T08:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T17:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T18:24:00] front_door_lock | Event: LockOperation(LockOperationType=1, OperationSource=Manual)
[2026-07-01T18:24:00] front_door_lock | DoorLock.LockState = 2
[2026-07-01T18:48:00] kitchen_light | OnOff.OnOff = True
[2026-07-01T19:34:13] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T20:59:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T21:59:39] front_door_lock | Event: LockOperation(LockOperationType=0, OperationSource=Manual)
[2026-07-01T21:59:39] front_door_lock | DoorLock.LockState = 1
[2026-07-01T22:09:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T22:09:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T22:29:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T22:29:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T22:49:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T22:49:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T22:51:05] bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T23:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T23:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-01T23:09:03] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T23:09:03] entrance_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T23:18:00] front_door_lock | DoorLock.LockState = 2
[2026-07-01T23:24:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-01T23:25:00] kitchen_light | OnOff.OnOff = True

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

请按以下 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:27 和 18:24 的 LockOperationType=1 (Lock) 配合随后 DoorLock.LockState=2 (Locked)，符合早晨离家锁门和傍晚归家后锁门的正常习惯；21:59 的 Unlock 操作发生在客厅有人且时间较晚，可能是家人在屋内移动或短暂外出取物后立即返回并重新上锁（虽然日志未显式记录再次上锁，但结合后续 23:18 的上锁事件，整体逻辑连贯）。",
    "推理步骤 2: 分析 occupancy_sensor 数据。Living room 和 entrance 的占用状态变化与门锁操作高度相关：早上离开时客厅无人，晚上回家时客厅先有人随后玄关有人，符合进门流程。23:00 所有卧室无人而客厅有人，符合晚间客厅休息或看电视的场景。",
    "推理步骤 3: 分析厨房灯光 (kitchen_light)。06:50 开启可能为早起准备早餐，18:48 和 23:25 开启对应晚餐时间和深夜加餐/活动，均属于合理的用户主动行为，无异常触发或长时间无人看管迹象。"
  ],
  "key_evidence": [
    "07:27 和 18:24 的门锁上锁操作与典型的早晚出行时间吻合。",
    "Occupancy 传感器数据显示的人员流动路径（客厅->玄关->室内）符合正常居住者的进出逻辑。",
    "厨房灯光仅在白天和傍晚有规律地开启，未见非工作时间的异常持续开启。"
  ],
  "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
- 重点设备: entrance_light, front_door_contact, front_door_lock, living_room_occupancy
- 已选事件数: 28

## 跨天活动摘要
- 2026-07-29: entrance=230, master_bedroom=232, kids_room=227, dining_room=223, living_room=114, master_bathroom=52

## 设备事件日志
[2026-07-29T00:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T01:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T01:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T01:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T01:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T01:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T01:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T01:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T01:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T01:30:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:00:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:00:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:00:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:00:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:00:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:00:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:00:00] entrance_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:11:00] front_door_lock | DoorLock.LockState = 2
[2026-07-29T02:11:00] front_door_contact | BooleanState.StateValue = False
[2026-07-29T02:12:00] entrance_light | OnOff.OnOff = True
[2026-07-29T02:13:00] living_room_occupancy | OccupancySensing.Occupancy = 1
[2026-07-29T02:30:00] living_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:30:00] dining_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:30:00] master_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:30:00] second_bedroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:30:00] kids_room_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02:30:00] master_bathroom_occupancy | OccupancySensing.Occupancy = 0
[2026-07-29T02: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: 凌晨 02:11 门锁解锁并开门",
    "推理步骤2: 玄关灯随后开启",
    "推理步骤3: 紧接着出现室内活动，不像误触"
  ],
  "key_evidence": [
    "凌晨 02:11 门锁解锁并开门",
    "玄关灯随后开启",
    "紧接着出现室内活动，不像误触"
  ],
  "recommended_actions": [
    "标记为异常入户，建议检查临时访客码使用记录并立即重置。"
  ]
}

```json
{
  "is_anomaly": false,
  "confidence": "high",
  "threat_type": "none",
  "threat_description": "日志显示正常的夜间离家/返回模式，无安全威胁。",
  "reasoning": [
    "推理步骤 1: 在凌晨 02:11，入户门锁状态变为 2（锁定），同时门接触传感器状态为 False（门已关闭），这表明住户正常锁门并离开或处于关门状态，符合常规行为。",
    "推理步骤 2: 随后在 02:12，玄关灯被开启，这是典型的‘回家’或‘进门’后的自动化或手动操作逻辑，与门锁动作时间紧密衔接，属于正常的生活习惯序列。",
    "推理步骤 3: 在 02:13，客厅运动传感器检测到有人（Occupancy = 1），紧接着在 02:30 所有房间（包括客厅、餐厅、卧室等）的运动传感器均报告无人（Occupancy = 0）。这种短暂的活跃后迅速恢复全屋空房的状态，完全符合单人短暂活动或系统误报后的快速复位，且没有伴随门窗异常开启或其他危险信号。"
  ],
  "key_evidence": [
    "02:11 门锁锁定 (LockState=2) 且门关闭 (Contact=False)",
    "02:12 玄关灯开启 (OnOff=True) 紧随其后",
    "02:30 全屋运动传感器统一报告无人 (Occupancy=0)"
  ],
  "recommended_actions": [
    "无需采取紧急措施，当前系统运行正常。",
    "建议继续监控后续日志，确认该时段无其他异常事件发生。"
  ]
}
```