第129章 Object Relation
对象关系
第127章建立了:
Cognitive Object
第128章进一步建立:
Object
↓
Attributes
↓
Stable Attributes
+
Dynamic Attributes
但是,一个对象从来不是完全孤立存在的。
现实世界通常表现为:
Object A
↕
Object B
例如:
Hand
Egg
Table
Robot
Door
Wall
机器真正需要理解的并不只是:
Egg
具有什么属性,而是:
Egg 在哪里?
Egg 与 Table 是什么关系?
Egg 与 Hand 是什么关系?
Hand 是否正在接近 Egg?
Egg 是否正在离开 Table?
因此,本章建立:
Object A
↕
Relation
↕
Object B
即:
Object Relation 是两个或多个认知对象之间具有认知意义的结构化关联。
而且这种关系并不是固定标签。
现实中的关系会:
建立
变化
增强
减弱
消失
重新建立
因此:
Near
Far
Contact
Supported
Blocked
Approaching
Leaving
都应该被理解为:
Dynamic Relation
129.1 什么是 Object Relation
可以定义:
Object Relation 是认知系统中用于表示两个或多个 Cognitive Object 在空间、时间、物理、运动、功能或行为上的关联结构。
最基本形式:
R =
(Object A, Relation Type, Object B)
例如:
R1 =
(Egg, On, Table)
或者:
R2 =
(Hand, Near, Egg)
或者:
R3 =
(Door, BlockedBy, Box)
因此:
Object A
↓
Relation Type
↓
Object B
形成:
Cognitive Relation
129.2 Relation 不是 Object Attribute
这是一个非常重要的架构边界:
Attribute ≠ Relation
例如:
Egg
├── Shape = Oval
├── Fragility = High
└── Weight = 60g
这些属于:
Object Attribute
而:
Egg
↓ on
Table
属于:
Object Relation
因为:
Shape
描述:
Egg 自身是什么样。
而:
On
描述:
Egg 与另一个 Object 之间是什么关系。
所以:
Attribute
=
Object → Property
而:
Relation
=
Object → Object
129.3 Relation 的基本结构
最小的关系模型:
Relation
{
source,
type,
target
}
例如:
{
source: O001,
type: "near",
target: O002
}
表示:
O001
↓
Near
↓
O002
但真正的认知系统需要更完整的结构:
Relation
{
id,
source,
type,
target,
state,
timestamp,
confidence
}
进一步:
Relation
{
id,
source,
type,
target,
state,
value,
timestamp,
confidence,
history
}
这样关系本身也成为:
Cognitive Entity
而不是一个简单字符串。
129.4 Relation 具有方向
有些关系具有明显方向:
Egg
↓
SupportedBy
↓
Table
不能简单理解为:
Egg ↔ SupportedBy ↔ Table
因为:
Egg is supported by Table
与:
Table is supported by Egg
意义不同。
因此:
Source
+
Relation
+
Target
通常应该保留方向。
例如:
Egg
──supported_by──>
Table
129.5 有些 Relation 可以反向表达
某些关系存在自然的反向形式:
Egg
↓ on
Table
可以反向表示:
Table
↓ supports
Egg
因此系统可以建立:
on
↔
supports
以及:
inside
↔
contains
例如:
Egg
↓ inside
Box
对应:
Box
↓ contains
Egg
这意味着 Relation 系统可以维护:
Inverse Relation
从而提高认知查询效率。
129.6 Near
最基本的空间关系之一:
Near
例如:
Hand
↓
Near
↓
Egg
但:
Near
不是一个绝对固定的事实。
因为距离不断变化:
50cm
↓
30cm
↓
10cm
↓
2cm
于是:
Far
↓
Near
↓
VeryNear
↓
Contact
可能形成一个连续变化过程。
因此:
Near 是由对象之间的空间状态计算出来的关系,而不是对象永久携带的标签。
129.7 Far
同样:
Far
描述两个 Object 当前具有较大的空间距离。
例如:
Robot
Egg
可能:
Distance = 5m
Relation = Far
机器人移动后:
Distance = 1m
关系可能变成:
Near
因此:
Far
↓
Distance Change
↓
Near
关系随着空间状态变化。
129.8 Contact
Contact 是一个重要的物理关系:
Hand
↓
Contact
↓
Egg
其形成可能来自:
Distance ≈ 0
+
Force > threshold
或者来自:
Touch Sensor
Contact 的生命周期可能是:
NoContact
↓
Approaching
↓
Contact
↓
Pressure
↓
Release
↓
NoContact
因此 Contact 同时具有:
Spatial
+
Physical
+
Temporal
属性。
129.9 Supported
例如:
Egg
↓
SupportedBy
↓
Table
表示:
Table
对:
Egg
提供物理支撑。
它与:
Near
不同。
两个对象可以:
Near = TRUE
但:
Supported = FALSE
例如:
Egg
悬浮在:
Table
上方几厘米:
Near = TRUE
Supported = FALSE
因此:
不同 Relation 描述的是不同的认知约束,而不是简单的空间距离。
129.10 Blocked
例如:
Robot
↓
BlockedBy
↓
Wall
这不是简单:
Near
因为:
Robot
可能距离:
Wall
很近。
但真正重要的是:
Wall
阻止:
Robot
沿某个方向运动。
因此:
Blocked
是一种:
Spatial
+
Motion
+
Constraint
关系。
129.11 Approaching
这是典型的动态关系。
例如:
Hand
→→→
Egg
如果:
Distance(t2) < Distance(t1)
则可以建立:
Hand
↓
Approaching
↓
Egg
注意:
Approaching
不是一个静态空间事实。
它来自:
Distance
+
Velocity
+
Direction
+
Time
因此:
Dynamic Attributes
↓
Relation Evaluation
↓
Approaching
129.12 Leaving
与:
Approaching
相反:
Distance(t2) > Distance(t1)
则可能形成:
Hand
↓
Leaving
↓
Egg
例如:
Contact
↓
Release
↓
Distance Increasing
↓
Leaving
所以:
Approaching
↔
Leaving
可以作为一组动态关系。
129.13 Relation 不是固定的
这是本章最重要的观点之一:
Object Relation 是时态性的认知结构。
例如:
t1
Hand ──Far──> Egg
随后:
t2
Hand ──Near──> Egg
随后:
t3
Hand ──Approaching──> Egg
随后:
t4
Hand ──Contact──> Egg
随后:
t5
Hand ──Leaving──> Egg
所以关系形成:
Far
↓
Near
↓
Approaching
↓
Contact
↓
Leaving
这实际上是:
Relation State Transition
129.14 Relation 的生命周期
一个 Relation 可以经历:
Unknown
↓
Detected
↓
Confirmed
↓
Active
↓
Changed
↓
Inactive
↓
Removed
例如:
Hand ──Contact──> Egg
最初:
Unknown
传感器检测:
Detected
多源数据确认:
Confirmed
持续接触:
Active
手离开:
Inactive
关系消失:
Removed
因此 Relation 本身需要状态管理。
129.15 Relation 的强度
有些关系不是简单的:
TRUE
FALSE
例如:
Near
可以存在程度:
VeryFar
Far
Medium
Near
VeryNear
或者使用:
Distance = 10cm
表示关系强度的依据。
同样:
Contact
可以进一步关联:
Pressure = 0.2N
所以:
Relation
+
Value
可以形成:
Quantitative Relation
例如:
Distance(Egg, Hand) = 5cm
再由规则得到:
Near(Egg, Hand) = TRUE
129.16 Relation Confidence
关系也可能存在不确定性。
例如系统观察:
Hand
Egg
视觉上两者距离很近。
系统可能得到:
Near
Confidence = 0.95
但:
Contact
Confidence = 0.62
因为视觉系统无法完全确认是否真正接触。
因此:
Relation
├── Type
├── Value
└── Confidence
是必要结构。
129.17 Relation Source
关系也可以来自不同来源:
Camera
Depth Sensor
Force Sensor
Motion Model
Memory
Rule Engine
例如:
Camera
↓
Near
而:
Force Sensor
↓
Contact
然后:
Motion Model
↓
Approaching
因此:
Relation
+
Source
可以形成:
Evidence-Based Relation
129.18 Relation 与 Object Attribute 的计算关系
很多 Relation 实际上是通过 Object Attribute 计算得到的。
例如:
Object A Position
Object B Position
计算:
Distance(A,B)
然后:
Distance < Threshold
得到:
Near(A,B)
所以:
Object Attributes
↓
Relation Calculation
↓
Object Relation
例如:
Position A
+
Position B
+
Distance Rule
↓
Near
又例如:
Velocity A
+
Velocity B
+
Relative Direction
↓
Approaching
因此:
Relation 是对象属性经过空间、时间、物理或逻辑计算以后形成的高层认知结构。
129.19 Relative Position
最基本的 Object Relation 可以从相对位置产生:
LeftOf
RightOf
Above
Below
InFrontOf
Behind
例如:
Egg
↓
LeftOf
↓
Box
这些关系来自:
Position(Egg)
+
Position(Box)
因此:
Position
属于 Object Dynamic Attribute。
而:
LeftOf
属于 Object Relation。
129.20 Containment
对象之间还存在包含关系:
Egg
↓
Inside
↓
Box
反向:
Box
↓
Contains
↓
Egg
这种关系非常重要,因为它能够建立:
Object Hierarchy
例如:
Room
├── Table
│ ├── Box
│ │ └── Egg
│ └── Cup
└── Chair
因此 Relation 可以形成复杂的对象空间结构。
129.21 Ownership 与 Functional Relation
某些关系不是纯空间关系。
例如:
Robot
↓
Controls
↓
Door
或者:
Hand
↓
Holds
↓
Egg
或者:
Tool
↓
UsedFor
↓
Object
这些属于:
Functional / Behavioral Relations
因此 Object Relation 可以划分为:
Spatial
Physical
Temporal
Motion
Functional
Causal
Social
Semantic
129.22 Relation 类型体系
可以建立一个基础 Relation Taxonomy:
Object Relation
│
├── Spatial
│ ├── Near
│ ├── Far
│ ├── LeftOf
│ ├── RightOf
│ ├── Above
│ └── Below
│
├── Physical
│ ├── Contact
│ ├── SupportedBy
│ ├── AttachedTo
│ └── BlockedBy
│
├── Motion
│ ├── Approaching
│ ├── Leaving
│ ├── Following
│ └── MovingWith
│
├── Containment
│ ├── Inside
│ └── Contains
│
└── Functional
├── Holds
├── Controls
└── UsedFor
这使 Relation 从简单标签变成:
Relation Knowledge Structure
129.23 Relation 与时间
Relation 必须能够表达:
Relation(t)
例如:
Near(A,B,t1)
Near(A,B,t2)
Contact(A,B,t3)
甚至:
Approaching(A,B,t1)
Contact(A,B,t2)
Leaving(A,B,t3)
因此:
Relation
=
Object A
+
Type
+
Object B
+
Time
是更加准确的模型。
129.24 Relation Transition
关系变化可以形成:
Far
↓
Near
↓
Approaching
↓
Contact
或者:
Contact
↓
Release
↓
Leaving
↓
Far
因此可以建立:
Relation State Machine
例如:
Far
↓
Approaching
↓
Near
↓
Contact
↓
Holding
↓
Leaving
↓
Far
这与第105章建立的:
Cognitive State Machine
产生直接联系。
129.25 Relation Change 产生 Event
例如:
Near
↓
Contact
意味着:
ContactStarted
而:
Contact
↓
Near
可能意味着:
ContactEnded
因此:
Relation Change
↓
Event
可以建立:
Approaching
↓
ContactStarted
↓
Holding
↓
Release
↓
Leaving
于是 Relation 成为事件系统的重要来源。
129.26 Relation 与 Situation
当多个关系同时存在:
Hand ──Holding──> Egg
Egg ──On──> Table
Robot ──Near──> Table
机器就不再只理解单个 Object。
它理解:
Situation
例如:
Robot
↓ near
Table
↑
on
Egg
↑
holding
Hand
因此:
Objects
+
Relations
=
Situation Structure
这是从:
Object Cognition
进入:
Situation Cognition
的关键步骤。
129.27 Relation Network
多个 Object 和 Relation 可以形成图:
Robot
│
near
↓
Table
/ \
on near
↓ ↓
Egg Hand
│
holding
↓
Egg
可以抽象为:
Nodes
=
Objects
Edges
=
Relations
于是:
Cognitive World
=
Object Graph
这是一个非常重要的架构转换。
机器不再只是保存:
Object List
而开始构建:
Relational World Model
129.28 Relation 与 Cognitive World
如果系统只有:
O001
O002
O003
那么机器只知道:
There are three objects.
如果增加:
O001 ──near──> O002
O002 ──on──> O003
O001 ──controls──> O003
机器开始知道:
How these objects form a world.
因此:
Object
↓
Relation
↓
World Model
是认知系统从“对象集合”进入“世界模型”的关键过程。
129.29 Relation 的工程模型
可以建立:
CognitiveRelation
{
id,
source_object,
relation_type,
target_object,
value,
state,
timestamp,
confidence,
source,
history
}
例如:
{
id: R001,
source_object: O001,
relation_type: "approaching",
target_object: O002,
value: {
distance: 15cm,
relative_velocity: 0.8m/s
},
state: "active",
timestamp: T1001,
confidence: 0.94,
source: "motion_engine"
}
这样 Relation 就可以被:
Perception
Reasoning
Memory
Prediction
Decision
共同使用。
129.30 Relation 的最小认知模型
最小形式:
R(A,B)
表示:
Object A
与
Object B
存在某种关系。
完整形式:
R =
(A, T, B, S, V, C, Time)
其中:
A = Source Object
T = Relation Type
B = Target Object
S = Relation State
V = Relation Value
C = Confidence
Time = Timestamp
例如:
R =
(
Hand,
Approaching,
Egg,
Active,
15cm,
0.94,
T1001
)
129.31 Object Relation 的核心特征
Object Relation 至少具有六个重要特征:
1. 双对象性
通常连接:
Object A
↕
Object B
2. 类型性
关系必须具有:
Near
Contact
Blocked
...
明确类型。
3. 方向性
部分关系需要:
Source
→
Target
4. 时态性
关系可以:
开始
持续
改变
结束
5. 可计算性
关系可以由:
Attributes
+
Rules
计算得到。
6. 可组合性
多个 Relation 可以组成:
Situation
甚至:
Cognitive World
129.32 Object Relation 的完整链条
因此可以形成:
Object Attributes
↓
Attribute Comparison
↓
Spatial / Physical / Temporal Analysis
↓
Relation Detection
↓
Relation
↓
Relation State
↓
Relation Change
↓
Event
↓
Situation
例如:
Position(A)
Position(B)
Velocity(A)
Velocity(B)
↓
Distance + Relative Motion
↓
Approaching(A,B)
↓
Contact(A,B)
↓
ContactStarted
↓
Interaction Situation
129.33 本章核心架构
最终建立:
Cognitive World
│
┌────────┴────────┐
↓ ↓
Object A Object B
│ │
└───────┬─────────┘
↓
Relation
│
┌───────────┼───────────┐
↓ ↓ ↓
Spatial Physical Motion
│ │ │
Near Contact Approaching
Far Supported Leaving
LeftOf Blocked Following
关系不是:
Object
+
Permanent Label
而是:
Object A
+
Object B
+
Current Conditions
+
Time
+
Rules
↓
Current Relation
因此:
Distance
+
Velocity
+
Direction
+
Contact
+
Force
+
Time
共同决定:
Near
Far
Approaching
Leaving
Contact
Supported
Blocked
129.34 本章核心定义
Object Relation 是 Cognitive Object 之间在空间、时间、运动、物理、功能或其他认知维度上形成的、具有方向、状态、时间和变化能力的结构化关系。
形式化表示:
OR =
(Source Object
+
Relation Type
+
Target Object
+
State
+
Value
+
Time
+
Confidence)
其最基本结构:
Object A
↓
Relation
↓
Object B
而关系不是静态的:
Far
↓
Approaching
↓
Near
↓
Contact
↓
Leaving
↓
Far
因此:
Object
↓
Attribute
↓
Relation
↓
Relation Change
↓
Event
↓
Situation
↓
World Model
至此,WSaiOS-ICAI 的认知结构开始从:
Object List
转变为:
Object
↕
Relation
↕
Object
↕
Relation
↕
Object
最终形成:
Cognitive World
机器真正开始“理解世界”,不是因为它知道了更多 Object,而是因为它开始知道 Object 之间发生了什么。
下一步自然进入一个更加关键的问题:
如果 Object 与 Object 之间的 Relation 会不断建立、变化和消失,那么机器如何在连续时间中维护整个关系网络?
由此进入:
Object
↓
Relation
↓
Relation State
↓
Relation Change
第130章:Dynamic Object Relation——动态对象关系。