首页 理论 架构 工程 文档 白皮书 著作 研究 案例 下载 博客 关于 开始使用 →

第87章 让 Individual 感知世界

第87章 让 Individual 感知世界

本章大纲

  1. Information
  2. Scene
  3. SceneCollector
  4. Perception
  5. Element
  6. Object
  7. Relation
  8. Cognition
  9. 场景理解

1. Information

Individual 要感知世界,第一步不是直接“理解世界”,而是接收世界进入系统的信息

Information 是 Individual 感知过程的输入单位。

信息来源可以包括:

Sensor
Vehicle
Industrial Device
Camera
Web
API
Operator
External System
Feedback
Internal State

统一进入:

InformationReceiver
        ↓
    Information

例如车辆传感器获得:

$information = array(
    'source' => 'Vehicle_A',

    'type' => 'SENSOR_DATA',

    'data' => array(
        'speed' => 40,
        'direction' => 'FORWARD',
        'distance' => 20,
        'object_type' => 'VEHICLE'
    ),

    'timestamp' => time()
);

此时 Individual 只是获得:

speed = 40
direction = FORWARD
distance = 20
object_type = VEHICLE

还没有形成:

Vehicle_A
Obstacle_A
front_of
danger

所以:

Information
    = 被 Individual 接收到的原始或结构化信息

Information 进入:

Information
     ↓
Scene
     ↓
Perception

2. Scene

Scene 是 Individual 对当前世界局部状态进行组织后的结构化场景

Scene 不是简单的数据集合。

它把当前相关的信息组织成:

对象
属性
状态
位置
关系
事件
环境条件

例如车辆当前场景:

Scene_A
├── Environment
│
├── Road_A
│
├── Lane_1
│
├── Vehicle_A
│
├── Obstacle_A
│
└── Relations

可以表示:

$scene = array(
    'id' => 'Scene_A',

    'environment' => array(
        'weather' => 'CLEAR',
        'visibility' => 'GOOD'
    ),

    'road' => array(
        'id' => 'Road_A',
        'lane' => 'Lane_1'
    ),

    'objects' => array(
        'Vehicle_A',
        'Obstacle_A'
    ),

    'state' => 'ACTIVE',

    'timestamp' => time()
);

Scene 的作用是回答:

当前环境中有什么?
这些对象有什么属性?
对象处于什么状态?
对象在哪里?
对象之间有什么关系?

因此:

Information
    = 获取到的信息

Scene
    = 当前相关信息组织形成的场景

3. SceneCollector

如果只有一次 Information,Individual 只能看到一个瞬间。

SceneCollector 负责把多个 Information 组织成连续 Scene。

基本流程:

Information_001
        ↓
Information_002
        ↓
Information_003
        ↓
SceneCollector
        ↓
Scene

例如:

t1:
Vehicle_A speed = 40
Obstacle_A distance = 30

t2:
Vehicle_A speed = 40
Obstacle_A distance = 25

t3:
Vehicle_A speed = 40
Obstacle_A distance = 20

SceneCollector:

Scene_001
      ↓
Scene_002
      ↓
Scene_003

于是 Individual 可以得到:

Obstacle_A
distance:
30
25
20

进一步形成:

distance decreasing

然后:

Obstacle_A approaching

SceneCollector 可以记录:

Scene ID
Timestamp
Environment
Objects
Properties
States
Relations
Changes
Source

例如:

class SceneCollector
{
    protected $scenes = array();

    public function collect($information)
    {
        $scene = array(
            'timestamp' => time(),
            'information' => $information,
            'objects' => array(),
            'relations' => array(),
            'changes' => array()
        );

        $this->scenes[] = $scene;

        return $scene;
    }

    public function getScenes()
    {
        return $this->scenes;
    }
}

SceneCollector 的核心职责是:

接收 Information
      ↓
识别属于哪个 Scene
      ↓
组织当前 Scene
      ↓
比较历史 Scene
      ↓
记录 Scene Change

因此:

SceneCollector
    = 场景收集与连续场景组织机制

它不是 Cognition。


4. Perception

Perception 是 Individual 对 Information 进行感知和结构化提取的过程。

前面定义:

感知 = 获取

这里的“获取”不是简单接收数据,而是把进入 Individual 的信息转换成可以进一步处理的结构化元素。

流程:

Information
      ↓
Perception
      ↓
Element

例如:

Information:

Vehicle_A
speed = 40
direction = FORWARD

Object:
Vehicle_B
distance = 20
speed = 10

Perception 提取:

Element:

Vehicle_A
speed
direction

Vehicle_B
distance
speed

然后进一步组织:

Element
   ↓
Object
   ↓
Property
   ↓
State
   ↓
Relation

Perception 的结果例如:

$perception = array(
    'objects' => array(
        array(
            'id' => 'Vehicle_A',
            'type' => 'VEHICLE'
        ),

        array(
            'id' => 'Vehicle_B',
            'type' => 'VEHICLE'
        )
    ),

    'properties' => array(
        'Vehicle_A.speed' => 40,
        'Vehicle_A.direction' => 'FORWARD',
        'Vehicle_B.distance' => 20,
        'Vehicle_B.speed' => 10
    )
);

所以:

Information
    = 输入

Perception
    = 感知过程

Perception Result
    = 结构化感知结果

5. Element

Element 是 Individual 感知世界时形成的基本信息元素

它可以是:

Object
Property
State
Relation
Value
Time
Location
Event
Condition
Method

例如:

Vehicle_A

是一个 Object Element。

speed = 40

是 Property Element。

RUNNING

是 State Element。

Vehicle_A located_on Road_A

是 Relation Element。

基本结构:

$element = array(
    'id' => 'Element_001',

    'type' => 'PROPERTY',

    'object' => 'Vehicle_A',

    'name' => 'speed',

    'value' => 40,

    'unit' => 'km/h',

    'state' => 'OBSERVED'
);

Element 的重要作用是把复杂世界拆成可以处理的离散结构。

例如:

现实世界
    ↓
Information
    ↓
Elements

得到:

Vehicle_A
speed
40
km/h
FORWARD
Road_A
Lane_1

Individual 就可以进一步组织这些元素。


6. Object

Object 是 Individual 对世界中某个实体建立的结构化对象表示。

例如:

Vehicle_A
Road_A
Obstacle_A
Machine_A
Person_A
Product_A

Object 可以拥有:

Identity
Properties
State
Position
Relations
Methods
Abilities

例如:

$object = array(
    'id' => 'Vehicle_A',

    'type' => 'VEHICLE',

    'properties' => array(
        'speed' => 40,
        'direction' => 'FORWARD'
    ),

    'state' => 'MOVING',

    'position' => array(
        'road' => 'Road_A',
        'lane' => 'Lane_1',
        'distance' => 125
    )
);

于是:

Element
   ↓
Object

并形成:

Vehicle_A
├── speed = 40
├── direction = FORWARD
├── state = MOVING
├── road = Road_A
└── lane = Lane_1

需要注意:

Object
    ≠ Physical Object

例如:

Physical Vehicle_A

是真实车辆。

而:

Vehicle Object

是 Individual 内部对真实车辆的结构化表示。

这与第84章、第85章保持一致。


7. Relation

如果 Individual 只有 Object 和 Property,它只能知道:

Vehicle_A
speed = 40

Obstacle_A
speed = 10

但还不知道二者之间是什么关系。

Relation 用来表示对象之间的结构关系。

例如:

Vehicle_A
    ↓
located_on
    ↓
Road_A

或者:

Vehicle_A
    ↓
in_lane
    ↓
Lane_1

又或者:

Vehicle_A
    ↓
front_of
    ↓
Obstacle_A

Relation 基本结构:

$relation = array(
    'id' => 'Relation_001',

    'subject' => 'Vehicle_A',

    'type' => 'front_of',

    'object' => 'Obstacle_A',

    'state' => 'OBSERVED'
);

Relation 可以包括:

located_on
in_lane
front_of
behind
near
far
connected_to
contains
belongs_to
produces
uses
depends_on

例如:

Vehicle_A
    ↓
front_of
    ↓
Obstacle_A

再结合:

Vehicle_A.speed = 40
Obstacle_A.speed = 10
Obstacle_A.distance = 20

Individual 才能够继续形成:

Vehicle_A
    front_of
Obstacle_A

distance = 20m

relative_speed = 30km/h

Relation 是从“对象集合”进入“场景结构”的关键。


8. Cognition

Perception 以后,Individual 已经获得:

Object
Property
State
Relation

但是:

感知到了什么

还不等于:

理解了什么

因此进入 Cognition。

根据前面的定义:

感知 = 获取

认知 = 理解

例如 Perception 得到:

Vehicle_A
speed = 40

Obstacle_A
distance = 20
speed = 10

Relation:
Vehicle_A front_of Obstacle_A

Cognition 对这些信息进行组织:

Vehicle_A
    ↓
front_of
    ↓
Obstacle_A

同时:

relative_speed = 40 - 10
               = 30km/h

于是形成:

Cognitive Result
{
    subject: Vehicle_A,

    relation: front_of,

    object: Obstacle_A,

    distance: 20,

    relative_speed: 30,

    state: UNDERSTOOD
}

这时 Individual 才真正形成:

当前场景的结构化理解

Cognition 的输入:

Elements
Objects
Properties
States
Relations
Scene
Memory

输出:

Cognition Result

例如:

Scene
 ↓
Objects
 ↓
Properties
 ↓
Relations
 ↓
Cognition
 ↓
Understanding

Cognition 不直接决定:

停车
减速
转向

那属于:

Reasoning
Risk
Decision

9. 场景理解

场景理解是本章最终目标。

Individual 并不是只要知道:

世界有什么

而是需要形成:

当前世界是什么状态

例如:

Information

获得:

Vehicle_A speed = 40
Obstacle_A distance = 20
Obstacle_A speed = 10
Road_A
Lane_1

经过:

Perception

形成:

Objects
Properties
States

再通过 Relation:

Vehicle_A
    ↓
front_of
    ↓
Obstacle_A

然后 Cognition:

Vehicle_A
    ↓
正在接近
    ↓
Obstacle_A

形成场景:

Scene_A
├── Road_A
│
├── Lane_1
│
├── Vehicle_A
│   ├── speed = 40
│   └── state = MOVING
│
├── Obstacle_A
│   ├── distance = 20
│   └── speed = 10
│
└── Relation
    └── Vehicle_A front_of Obstacle_A

进一步结合 Scene Collection:

Scene_001
Obstacle_A = 30m

Scene_002
Obstacle_A = 25m

Scene_003
Obstacle_A = 20m

得到:

distance decreasing

进一步得到:

Obstacle_A approaching

于是 Individual 的场景理解可以表示为:

Scene Understanding
{
    road: Road_A,

    lane: Lane_1,

    vehicle: Vehicle_A,

    vehicle_state: MOVING,

    vehicle_speed: 40,

    obstacle: Obstacle_A,

    obstacle_distance: 20,

    obstacle_speed: 10,

    relation: front_of,

    movement_relation: approaching,

    state: UNDERSTOOD
}

这时才完成:

信息
 ↓
场景
 ↓
感知
 ↓
元素
 ↓
对象
 ↓
关系
 ↓
认知
 ↓
场景理解

Individual 感知世界的完整过程

第86章建立了 Individual。

第87章让这个 Individual 开始真正面对外部世界:

                    External World
                          │
                          ↓
                    Information
                          │
                          ↓
                 InformationReceiver
                          │
                          ↓
                       Scene
                          │
                          ↓
                   SceneCollector
                          │
                          ↓
                      Perception
                          │
                          ↓
                       Element
                          │
             ┌────────────┼────────────┐
             ↓            ↓            ↓
          Object       Property      State
             │
             └────────────┬────────────┘
                          ↓
                       Relation
                          ↓
                       Cognition
                          ↓
                  Scene Understanding

Information → Scene → Perception 的关系

三个概念必须严格区分:

Information
    = Individual 收到的信息

Scene
    = 当前相关信息组织形成的场景

Perception
    = 从信息和场景中提取结构化感知内容

例如:

Information:
temperature = 92
speed = 800
Machine_A

形成:

Scene:
Machine_A
├── temperature = 92
└── speed = 800

Perception 得到:

Object:
Machine_A

Properties:
temperature = 92
speed = 800

然后:

Cognition

才能进一步判断:

Machine_A
temperature is high

因此:

Information ≠ Scene
Scene ≠ Perception
Perception ≠ Cognition

第一个 Individual 感知世界

现在将第86章的 Individual 与本章连接:

Individual_A
      │
      ├── Identity
      ├── State
      ├── Ability
      ├── Memory
      ├── Central
      └── InformationReceiver
                     │
                     ↓
                Information
                     │
                     ↓
                   Scene
                     │
                     ↓
              SceneCollector
                     │
                     ↓
                Perception
                     │
                     ↓
                  Element
                     │
              ┌──────┼──────┐
              ↓      ↓      ↓
           Object Property State
              │      │      │
              └──────┼──────┘
                     ↓
                  Relation
                     │
                     ↓
                  Cognition
                     │
                     ↓
             Scene Understanding

这样,第一个 Individual 就从:

“能够运行”

进一步进入:

“能够感知世界”

本章核心模型

External World
      ↓
Information
      ↓
InformationReceiver
      ↓
Scene
      ↓
SceneCollector
      ↓
Perception
      ↓
Element
      ↓
Object
      ↓
Property / State
      ↓
Relation
      ↓
Cognition
      ↓
Scene Understanding

核心定义:

Information
    = 外部或内部进入 Individual 的信息

Scene
    = 当前相关世界状态的结构化场景

SceneCollector
    = 连续收集和组织 Scene 的机制

Perception
    = 从信息中获取并形成结构化感知内容

Element
    = Individual 感知世界的基本离散元素

Object
    = 对世界实体的结构化表示

Relation
    = 对象、属性、状态之间的结构关系

Cognition
    = 对感知结构进行理解

Scene Understanding
    = 对当前场景中的对象、属性、状态和关系形成整体结构化理解

因此,第87章完成了一个非常重要的转换:

第86章:

Individual
    ↓
能够运行


第87章:

Individual
    ↓
接收 Information
    ↓
组织 Scene
    ↓
进行 Perception
    ↓
形成 Element
    ↓
建立 Object
    ↓
建立 Relation
    ↓
进行 Cognition
    ↓
形成 Scene Understanding

Individual 从这一章开始,不再只是一个“运行主体”,而成为一个能够通过信息、场景、感知、元素、对象、关系和认知,对外部世界建立内部结构化表示的 SAI 个体。

Leave a Reply

Your email address will not be published. Required fields are marked *