第六篇 Scene 场景采集
第23章 Scene
本章大纲
- Scene 定义
- 场景与信息
- 场景环境
- 场景对象
- 场景空间
- 场景时间
- 场景状态
- 场景关系
- Scene 数据结构
- 完整场景示例
23.1 Scene 定义
**Scene(场景)**是 SAI Framework 用于描述某一时间、某一空间范围内,外部环境、对象、状态以及对象之间关系的综合信息结构。
简单来说:
Scene 不是一个单独的对象,而是对“某个时空范围内发生了什么”的整体描述。
例如一个房间:
时间:14:20:00
空间:客厅
环境:
温度 = 32℃
湿度 = 65%
对象:
人
风扇
温度传感器
状态:
人 = 在场
风扇 = OFF
关系:
人 → 位于 → 客厅
风扇 → 位于 → 客厅
传感器 → 检测 → 客厅温度
这些信息组合起来,才形成一个完整的:
Scene
23.2 场景与信息
Scene 与 Information 有直接关系,但两者不是同一个概念。
Information
Information 是一条具体的信息:
温度 = 32℃
或者:
风扇 = OFF
或者:
人员 = 在场
这些都是独立 Information。
Scene
Scene 则把同一时间、空间范围内的多个 Information 组织起来:
温度 = 32℃
湿度 = 65%
人员 = 在场
风扇 = OFF
位置 = 客厅
形成:
Scene
├── Information
├── Information
├── Information
├── Information
└── Information
因此:
Information
→ 一条信息
Scene
→ 一组具有时间、空间和上下文关系的信息
可以进一步表示:
InformationSource
↓
InformationReceiver
↓
Information
↓
Scene
↓
SceneObject / State / Relation
↓
Perception
这里需要特别注意:
Scene 不是简单的信息列表。
因为 Scene 还需要描述:
时间
空间
对象
状态
关系
环境
上下文
所以 Scene 是一种有组织的信息集合。
23.3 场景环境
环境是 Scene 的重要组成部分。
环境可以包括:
Environment
├── Temperature
├── Humidity
├── Light
├── Sound
├── Weather
├── Air
├── Terrain
├── Road
└── Other Conditions
例如室内场景:
Temperature = 32℃
Humidity = 65%
Light = 500 lx
Sound = 40 dB
室外场景可能是:
Temperature = 28℃
Weather = Rain
Wind = 5 m/s
Light = Low
机器人场景可能进一步包括:
Terrain = Road
Obstacle = 3
Distance = 12m
Weather = Rain
因此:
Scene
└── Environment
├── Temperature
├── Humidity
├── Light
├── Weather
└── ...
环境描述的是场景中的外部条件。
23.4 场景对象
场景不仅需要知道环境,还需要知道场景中有哪些对象。
例如:
Scene
├── Person
├── Fan
├── Table
├── Chair
└── TemperatureSensor
对象可以具有:
ID
Name
Type
Property
State
Position
例如:
Person
├── id = person-001
├── type = person
├── position = living-room
└── state = present
风扇:
Fan
├── id = fan-001
├── type = device
├── position = living-room
└── state = off
温度传感器:
TemperatureSensor
├── id = sensor-001
├── type = sensor
├── position = living-room
└── state = online
所以 Scene 中的对象实际上可以继续连接到 SAI 的:
Object
Property
State
Relation
Method
23.5 场景空间
Scene 必须回答一个重要问题:
这些信息发生在哪里?
这就是 Scene 的空间属性。
空间可以简单到:
客厅
也可以更加精确:
Building A
↓
Floor 2
↓
Room 203
↓
Living Area
对于机器人、车辆、无人机等系统,还可以使用坐标:
x = 120
y = 80
z = 2
或者:
latitude
longitude
altitude
因此 Scene 的空间信息可以是:
Scene
└── Space
├── location
├── area
├── position
└── coordinate
空间与对象
空间还可以用于描述对象位置:
Person
↓
located_at
↓
LivingRoom
或者:
Car
↓
position
↓
x=100, y=50
所以:
Scene
├── Space
└── Objects
│
└── Position
共同构成场景空间结构。
23.6 场景时间
Scene 不仅需要空间,还需要时间。
因为同一个空间在不同时间可能完全不同。
例如:
10:00
Room.temperature = 25
Fan = OFF
Person = ABSENT
到了:
14:00
Room.temperature = 32
Fan = OFF
Person = PRESENT
同一个房间:
Room
因为时间不同形成两个不同的场景状态。
因此 Scene 应该具有:
time
startTime
endTime
duration
对于瞬时场景:
time = 2026-09-12 14:20:00
对于持续场景:
startTime = 14:20:00
endTime = 14:30:00
时间的重要性
时间可以支持:
Scene History
State History
Event
Experience
Trend
Learning
例如:
12:00 → 25℃
13:00 → 28℃
14:00 → 32℃
15:00 → 34℃
SAI 可以从多个 Scene 中发现:
温度正在持续上升
这就为后面的:
Reasoning
Decision
Experience
Learning
提供基础数据。
23.7 场景状态
Scene 也具有自己的整体状态。
例如:
Scene.state = normal
或者:
Scene.state = warning
也可以更加具体:
Room
├── temperature = high
├── humidity = normal
├── person = present
└── fan = off
这里需要区分:
Object State
Fan.state = OFF
描述的是风扇。
Scene State
Scene.state = HOT
描述的是整个场景。
因此:
Object State
→ 某个对象当前状态
Scene State
→ 整个场景当前状态
Scene State 可以由多个对象和环境状态共同形成。
例如:
Temperature = 32
Person = PRESENT
Fan = OFF
经过场景状态判断:
Scene.state = HOT_OCCUPIED
这里仍然只是场景状态表示,不等于已经进行了决策。
23.8 场景关系
Scene 中最重要的结构之一就是Relation(关系)。
对象孤立存在时,系统知道:
Person
Fan
Room
Sensor
但还不知道它们之间发生了什么。
加入关系以后:
Person
↓
located_at
↓
Room
Fan
↓
located_at
↓
Room
Sensor
↓
detects
↓
Temperature
于是形成:
Room
/ \
/ \
Person Fan
|
located_at
Sensor
|
detects
|
Temperature
Scene Relation 的基本形式
依然使用:
Subject → Relation → Object
例如:
Person → located_at → LivingRoom
Fan → located_at → LivingRoom
Sensor → detects → Temperature
Temperature → belongs_to → LivingRoom
这样 Scene 就从简单数据集合变成了一个具有结构的场景模型。
23.9 Scene 数据结构
一个基础 Scene 可以设计成:
Scene
{
id
name
type
time
startTime
endTime
space
environment
objects
states
relations
context
metadata
}
进一步展开:
Scene
├── ID
├── Name
├── Type
├── Time
│ ├── time
│ ├── startTime
│ └── endTime
│
├── Space
│ ├── location
│ ├── area
│ └── position
│
├── Environment
│ ├── temperature
│ ├── humidity
│ ├── light
│ └── weather
│
├── Objects
│ ├── Person
│ ├── Device
│ └── Sensor
│
├── States
│
├── Relations
│
├── Context
│
└── Metadata
Scene 与 Object 的关系
可以理解为:
Scene
│
├── contains → Object
├── contains → Environment
├── contains → State
└── contains → Relation
而 Object 自己仍然具有:
Object
├── Property
├── State
├── Method
└── Relation
所以 Scene 并不是替代 Object。
它只是:
把特定时间和空间中的对象组织到同一个场景上下文中。
23.10 完整场景示例
下面建立一个完整的室内场景。
场景
Scene ID:
scene-001
Name:
Living Room
Type:
indoor
Time:
2026-09-12 14:20:00
Space:
Living Room
环境
Environment
Temperature = 32℃
Humidity = 65%
Light = 500
对象
Person
id = person-001
state = PRESENT
Fan
id = fan-001
state = OFF
TemperatureSensor
id = sensor-001
state = ONLINE
关系
Person
→ located_at
→ LivingRoom
Fan
→ located_at
→ LivingRoom
TemperatureSensor
→ located_at
→ LivingRoom
TemperatureSensor
→ detects
→ Temperature
场景整体状态
Scene.state = HOT_OCCUPIED
因此完整场景:
Scene: LivingRoom
│
├── Time
│ └── 14:20:00
│
├── Space
│ └── LivingRoom
│
├── Environment
│ ├── Temperature = 32℃
│ ├── Humidity = 65%
│ └── Light = 500
│
├── Objects
│ ├── Person
│ │ └── State = PRESENT
│ │
│ ├── Fan
│ │ └── State = OFF
│ │
│ └── TemperatureSensor
│ └── State = ONLINE
│
├── Relations
│ ├── Person → located_at → LivingRoom
│ ├── Fan → located_at → LivingRoom
│ └── Sensor → detects → Temperature
│
└── State
└── HOT_OCCUPIED
23.11 Scene 在 SAI 中的位置
前面第19~22章建立了:
Information
InformationType
InformationSource
InformationReceiver
现在 Scene 加入之后:
External World
↓
InformationSource
↓
InformationReceiver
↓
Information
↓
Scene
↓
Scene Object / State / Relation
↓
Perception
↓
Cognition
例如温度传感器产生:
32℃
Receiver 接收:
Information
多个信息组合:
32℃
65%
Person PRESENT
Fan OFF
结合:
时间
空间
对象
关系
状态
形成:
Scene
然后 Scene 才可以进入后面的感知处理。
23.12 Scene 与 Perception 的关系
两者也必须严格区分。
Scene
→ 描述当前场景是什么
Perception
→ SAI 对场景进行了什么感知
例如:
Scene:
Temperature = 32℃
Person = PRESENT
Fan = OFF
这是场景数据。
Perception:
发现:
当前房间温度较高;
房间有人;
风扇当前关闭。
这是感知结果。
进一步:
Cognition
→ 理解当前状态及其意义
Reasoning
→ 根据事实、关系、规则进行推理
Decision
→ 选择是否启动风扇
Behavior
→ 执行开启风扇
所以完整关系:
Scene
↓
Perception
↓
Cognition
↓
Memory
↓
Reasoning
↓
Decision
↓
Behavior
本章完整结构
Scene
│
┌────────────────┼────────────────┐
│ │ │
▼ ▼ ▼
Environment Space Time
│ │ │
└────────────────┼────────────────┘
▼
Objects
│
┌────────┼────────┐
▼ ▼ ▼
Property State Method
│
▼
Relations
│
▼
Context
│
▼
Scene State
│
▼
Perception
本章小结
Scene 是 SAI Framework 对特定时间、特定空间范围内外部世界状态的综合描述。
它至少包含:
Scene
├── Environment
├── Object
├── Space
├── Time
├── State
├── Relation
└── Context
核心关系可以总结为:
Information
↓
Scene
├── Time
├── Space
├── Environment
├── Object
├── State
└── Relation
↓
Perception
↓
Cognition
其中:
Information 是一条信息,Scene 是具有时空和上下文结构的信息集合。
进一步说:
Scene 解决的是“某个时间、某个空间里,环境、对象、状态和关系是什么”。
这为下一章 SceneCollector(场景采集器) 奠定基础:Scene 定义“场景是什么”,而 SceneCollector 将负责如何从多个 InformationSource / Sensor / Device 中持续采集并构建 Scene。
本章的数据结构与 PHP 设计均属于 SAI Framework 教程中的架构示例,未作为实际项目代码执行验证。