第19章 Information
本章大纲
- Information 定义
- 信息与内容的区别
- 信息来源
- 信息类型
- 信息时间
- 信息状态
- 信息上下文
- 信息对象
- 信息结构
- Information 类
- 完整信息示例
19.1 Information 定义
**Information(信息)**是 SAI Framework 接收、识别、组织和传递外部或内部信息的基本数据结构。
在 SAI 中,Information 是 Individual 与外部世界发生联系的一个重要入口。
基本过程:
外部世界
↓
信息产生
↓
Information
↓
感知
↓
元素
↓
对象
↓
关系
↓
认知
因此可以把 Information 理解为:
进入 SAI 运行过程、能够被进一步处理的信息单位。
Information 本身并不等于感知,也不等于认知。
Information
↓
Perception
↓
Cognition
三者职责不同:
Information
获取到什么
Perception
识别到了什么
Cognition
理解了什么
例如传感器获取:
temperature = 32
这是 Information。
经过感知:
对象:Room
属性:temperature
值:32
经过认知:
房间当前温度较高
所以:
Information ≠ Perception
Information ≠ Cognition
19.2 信息与内容的区别
Information 和 Content 是两个不同层次的概念。
Content
Content 是信息中实际承载的内容。
例如:
content = "房间温度是32度"
这是内容。
而完整 Information 还需要知道:
谁提供?
什么时候提供?
属于什么类型?
当前状态?
处于什么场景?
涉及什么对象?
因此:
Information
├── Source
├── Type
├── Content
├── Time
├── State
├── Context
└── Object
例如:
Source = TemperatureSensor
Type = SensorInformation
Content = 32
Time = 2026-09-12 14:00:00
State = valid
Context = Room-01
Object = Room
可以看到:
Content = 信息里面“说了什么”
Information = 关于这条信息的完整描述
19.3 信息来源
Information 必须尽可能保留来源。
因为不同来源的信息,其可信程度、处理方式和意义可能不同。
基本结构:
Information Source
├── Human
├── Device
├── Sensor
├── Environment
├── System
├── Database
├── API
└── Other
19.3.1 人的信息
例如:
Source = Human
Content = "打开风扇"
19.3.2 设备信息
例如:
Source = Fan
State = ON
19.3.3 传感器信息
例如:
Source = TemperatureSensor
Value = 32
Unit = Celsius
19.3.4 环境信息
例如:
Source = Environment
Temperature = 32
Humidity = 70
19.3.5 外部系统信息
例如:
Source = API
Content = external data
或者:
Source = Database
Content = stored record
所以 InformationSource 可以进一步成为独立对象:
Information
↓
InformationSource
↓
identify source
↓
determine type
↓
process
19.4 信息类型
Information 可以根据来源、内容和用途划分类型。
例如:
Information
├── TextInformation
├── LanguageInformation
├── InstructionInformation
├── DataInformation
├── EventInformation
├── StateInformation
├── DeviceInformation
├── SceneInformation
└── SensorInformation
TextInformation
"今天温度很高"
InstructionInformation
"打开风扇"
SensorInformation
temperature = 32
StateInformation
fan.state = OFF
EventInformation
PersonEnteredRoom
SceneInformation
Room
├── Person
├── Fan
├── Table
└── Temperature
类型的意义在于:
帮助 SAI 确定这条信息应该如何进入后续处理流程。
例如:
InstructionInformation
↓
Instruction Processing
SensorInformation
↓
Perception Processing
StateInformation
↓
State Processing
SceneInformation
↓
Scene Processing
19.5 信息时间
Information 不是只有内容和来源,还应该记录时间。
因为 SAI 面对的是一个不断变化的世界。
例如:
10:00 temperature = 28
10:05 temperature = 30
10:10 temperature = 32
如果没有时间:
temperature = 32
SAI 无法准确知道:
什么时候发生?
之前是什么状态?
变化速度如何?
是否是最新信息?
因此 Information 可以保存:
time
created_at
received_at
updated_at
例如:
created_at = 10:10:00
received_at = 10:10:01
两者可以不同。
信息产生
↓
created_at
SAI 接收到
↓
received_at
这对于设备、传感器、网络和实时场景尤其重要。
19.6 信息状态
Information 本身也可能具有状态。
例如:
Information State
├── new
├── received
├── valid
├── invalid
├── processed
├── expired
└── error
例如:
new
↓
received
↓
valid
↓
processed
如果信息已经失效:
received
↓
expired
例如:
temperature = 32
time = 10:00
到了很久以后,这条温度信息可能已经不能代表当前环境。
因此:
Information State
可以帮助 SAI 判断:
这条信息是否有效?
是否已经处理?
是否过期?
是否发生错误?
需要注意:
Information State ≠ Object State
例如:
Information State = processed
表示这条信息已经被处理。
而:
Fan State = ON
表示风扇当前状态。
两者属于不同对象。
19.7 信息上下文
**Context(上下文)**用于描述 Information 所处的环境和条件。
同样的内容,在不同上下文中可能具有完全不同的意义。
例如:
temperature = 32
单独看只知道一个数值。
加入上下文:
Context
├── Location = Room-01
├── Person = PRESENT
├── Time = 14:00
├── Weather = HOT
└── Device = TemperatureSensor-01
信息就更加完整。
可以表示:
Information
│
└── Context
├── Location
├── Time
├── Environment
├── Object
├── Person
└── Device
上下文可以帮助后续:
Perception
Cognition
Reasoning
Decision
例如:
temperature = 32
如果:
Room = occupied
可能需要开启风扇。
如果:
Room = empty
则可能不需要开启。
因此:
Information
+
Context
比单独的 Content 更具有实际处理价值。
19.8 信息对象
Information 可以关联一个或者多个 Object。
例如:
Room.temperature = 32
这里至少存在:
Object = Room
Property = temperature
Value = 32
可以表示:
Information
↓
Object
↓
Property
↓
Value
再例如:
Fan.state = OFF
对应:
Object = Fan
Property = state
Value = OFF
如果信息描述关系:
Person uses Fan
则可以进一步形成:
Subject = Person
Relation = uses
Object = Fan
因此 Information 是进入 EOM 结构的重要入口:
Information
↓
Element
↓
Object
↓
Property
↓
Relation
这也是 SAI 后续从信息进入感知、认知的重要基础。
19.9 信息结构
综合前面的内容,一个基础 Information 可以设计成:
Information
{
id
type
source
content
time
state
context
object
metadata
}
例如:
$information = array(
'id' => 'info-001',
'type' => 'sensor',
'source' => 'temperature-sensor-01',
'content' => 32,
'time' => time(),
'state' => 'valid',
'context' => array(
'location' => 'room-01'
),
'object' => 'room-01',
'metadata' => array(
'unit' => 'C'
)
);
这只是一个数据结构示例。
更完整的结构:
Information
│
├── Identity
│ └── id
│
├── Type
│ └── sensor
│
├── Source
│ └── temperature-sensor-01
│
├── Content
│ └── 32
│
├── Time
│ └── timestamp
│
├── State
│ └── valid
│
├── Context
│ └── room-01
│
├── Object
│ └── Room
│
└── Metadata
└── unit = C
19.10 Information 类
在 PHP OOP 中,可以把 Information 设计成独立类。
下面是一个基础实现示例:
<?php
namespace SAI\Information;
class Information
{
protected $id;
protected $type;
protected $source;
protected $content;
protected $time;
protected $state;
protected $context;
protected $object;
protected $metadata;
public function __construct(
$id,
$type,
$source,
$content
) {
$this->id = $id;
$this->type = $type;
$this->source = $source;
$this->content = $content;
$this->time = time();
$this->state = 'new';
$this->context = array();
$this->metadata = array();
}
public function getId()
{
return $this->id;
}
public function getType()
{
return $this->type;
}
public function getSource()
{
return $this->source;
}
public function getContent()
{
return $this->content;
}
public function getTime()
{
return $this->time;
}
public function setState($state)
{
$this->state = $state;
}
public function getState()
{
return $this->state;
}
public function setContext($name, $value)
{
$this->context[$name] = $value;
}
public function getContext($name)
{
if (!isset($this->context[$name])) {
return null;
}
return $this->context[$name];
}
public function setObject($object)
{
$this->object = $object;
}
public function getObject()
{
return $this->object;
}
public function setMetadata($name, $value)
{
$this->metadata[$name] = $value;
}
public function getMetadata($name)
{
if (!isset($this->metadata[$name])) {
return null;
}
return $this->metadata[$name];
}
}
这个类负责的是:
保存 Information
+
提供 Information 属性访问
+
管理 Information 状态
+
管理 Context
+
关联 Object
它本身并不负责:
感知
认知
推理
决策
学习
这些工作由后续的 Engine 和相关模块负责。
因此:
Information
↓
InformationReceiver
↓
PerceptionEngine
↓
CognitionEngine
19.11 完整信息示例
现在建立一个完整的房间环境信息。
假设温度传感器产生:
Room-01 temperature = 32°C
创建 Information:
$information = new \SAI\Information\Information(
'info-001',
'sensor',
'temperature-sensor-01',
32
);
$information->setContext(
'location',
'room-01'
);
$information->setContext(
'environment',
'indoor'
);
$information->setObject(
'room-01'
);
$information->setMetadata(
'unit',
'C'
);
$information->setState(
'valid'
);
形成:
Information
│
├── ID
│ └── info-001
│
├── Type
│ └── sensor
│
├── Source
│ └── temperature-sensor-01
│
├── Content
│ └── 32
│
├── Time
│ └── current timestamp
│
├── State
│ └── valid
│
├── Context
│ ├── location = room-01
│ └── environment = indoor
│
├── Object
│ └── room-01
│
└── Metadata
└── unit = C
然后进入 SAI:
Temperature Sensor
↓
Information
↓
InformationReceiver
↓
PerceptionEngine
↓
Element
↓
Object
↓
Property
↓
Relation
↓
Cognition
最终可能形成:
Object: Room-01
Property:
temperature = 32
Context:
indoor
State:
temperature_high
随后才进入:
Cognition
↓
Memory
↓
Reasoning
↓
Decision
↓
Behavior
Information 的完整数据流
第19章最重要的是建立 Information → SAI 内部世界模型 的入口关系。
外部世界
│
┌───────────┼───────────┐
▼ ▼ ▼
人 设备 环境
│ │ │
└───────────┼───────────┘
▼
Information
│
┌────────────┼────────────┐
▼ ▼ ▼
Source Type Time
│ │ │
└────────────┼────────────┘
▼
State
│
Context
│
Object
│
▼
Perception
│
Element
│
Object
│
Relation
│
▼
Cognition
因此可以把 Information 在 SAI Framework 中的位置概括为:
Information
↓
信息接收层
↓
Perception
↓
认知层
↓
Memory / Reasoning / Decision
↓
Behavior
↓
External World
本章小结
Information 是 SAI Framework 的基础输入单位,也是 Information 接收体系的核心对象。
本章建立了几个重要区别:
Content
→ 信息里面有什么
Information
→ 关于这条信息的完整描述
Source
→ 信息从哪里来
Type
→ 信息是什么类型
Time
→ 信息什么时候产生/接收
State
→ 信息当前是否有效、是否已处理
Context
→ 信息发生在什么环境和条件下
Object
→ 信息涉及什么对象
最终形成:
Information
├── Identity
├── Type
├── Source
├── Content
├── Time
├── State
├── Context
├── Object
└── Metadata
而 Information 进入 SAI 后:
Information
↓
Perception
↓
Element
↓
Object
↓
Relation
↓
Cognition
↓
Memory
↓
Reasoning
↓
Decision
↓
Behavior
所以,Information 是 SAI 从外部世界进入内部认知体系的基础入口,而不是认知本身。
本章 PHP 代码、类结构和运行流程均为 SAI Framework 教程设计示例,未作为实际项目执行验证。