第九章
嗅觉感知元素理论
Smell Perception Element Theory
9.1 嗅觉在 WSaiOS 感知体系中的定义
嗅觉是生物感知系统获取环境信息的重要方式。
人类通过嗅觉感知:
- 物质存在;
- 环境变化;
- 状态变化;
- 食品品质;
- 危险信号。
不同感知方式承担不同的信息获取任务:
视觉:
发现:
对象是什么
听觉:
发现:
发生了什么
触觉:
发现:
接触到了什么
味觉:
发现:
进入身体的物质属性
嗅觉:
发现:
环境中存在什么变化
例如:
人在房间中闻到烟味。
嗅觉输入:
Smoke Odor
人类认知:
可能存在燃烧
↓
环境异常
闻到水果香味:
嗅觉输入:
Fruit Odor
认知:
水果成熟
↓
品质判断
因此,WSaiOS 将嗅觉信息抽象为:
嗅觉感知元素
Smell Perception Element
定义:
嗅觉感知元素是 WSaiOS 对环境中的气味信息进行组织、关联和描述后形成的感知信息单元,用于表达气味来源、对象关系、环境状态和变化意义。
嗅觉感知过程:
环境信息
↓
气味输入
↓
嗅觉感知元素
↓
对象关联
↓
状态理解
↓
认知元素
↓
判断与决策
9.2 嗅觉作为环境感知输入
嗅觉是一种特殊感知方式。
视觉主要获取:
空间外观
声音主要获取:
时间变化
触觉主要获取:
物理状态
嗅觉主要获取:
环境状态
例如:
厨房环境。
视觉:
看到食物
嗅觉:
闻到香味
结合:
形成:
正在烹饪的厨房环境
例如:
工业环境。
视觉:
设备存在
嗅觉:
异常气味出现
形成:
设备状态可能发生变化
WSaiOS 中:
气味不是独立信息。
而是:
环境认知元素的一部分。
结构:
Smell Input
↓
Smell Element
↓
Environment Element
↓
Cognitive Element
9.3 嗅觉感知元素组成
WSaiOS 将嗅觉信息组织为:
嗅觉元素。
基本结构:
Smell Element
{
ID
Object
Source
Attribute
Intensity
Location
State
Relation
Event
}
9.3.1 ID(元素标识)
用于识别嗅觉元素。
例如:
smell_001
odor_001
作用:
保证感知信息能够:
- 保存;
- 追踪;
- 更新。
9.3.2 Object(气味对象)
气味必须对应具体对象。
例如:
咖啡气味:
Object:
Coffee
花香:
Object:
Flower
机器异味:
Object:
Machine
关系:
Smell
↓
Object
9.3.3 Source(气味来源元素)
嗅觉理解首先需要确定来源。
例如:
闻到:
Burning Smell
系统需要理解:
来源可能是:
Fire
Machine
Electrical Equipment
来源类型:
Food
Plant
Machine
Chemical
Environment
Human
来源结构:
Odor
↓
Source Object
↓
Meaning
9.3.4 Attribute(气味属性元素)
气味具有不同属性。
例如:
食品:
Fresh
Sweet
Natural
异常:
Burning
Rotten
Chemical
属性描述:
气味表现形式
结构:
Smell Attribute
{
Type
Character
State
}
9.3.5 Intensity(气味强度元素)
气味具有程度变化。
例如:
烟味:
轻微
↓
明显
↓
强烈
强度表示:
气味存在程度
结构:
Intensity
{
Level
Change
Duration
}
强度变化可以帮助判断:
环境是否正在变化。
9.3.6 Location(气味位置元素)
气味存在空间传播关系。
例如:
办公室出现异味。
系统需要判断:
来自哪里
结构:
Smell
↓
Location
↓
Source Area
例如:
Kitchen
↓
Smoke Smell
9.3.7 State(气味状态元素)
气味可以反映对象状态。
例如:
食品:
正常:
Fresh Smell
变化:
Odor Change
异常:
Spoiled State
状态:
State(t)
↓
State(t+1)
表示:
对象状态发生变化。
9.4 气味关系元素理论
气味不能单独理解。
必须建立关系。
例如:
烟味:
不是最终结果。
关系:
Smoke
↓
Produced By
↓
Fire
例如:
水果香:
关系:
Fruit
↓
Has
↓
Fresh Odor
关系结构:
Smell Relation
{
Object
Smell
Meaning
}
9.5 环境气味元素理论
环境本身具有气味状态。
例如:
办公室:
正常:
Clean Environment
异常:
Smoke
Chemical Odor
工厂:
正常:
Machine Environment
异常:
Burning Odor
环境气味元素:
Environment Smell Element
{
Location
Odor
State
Relation
}
9.6 气味状态变化理论
嗅觉的重要作用:
发现变化。
例如:
设备。
原状态:
Normal
变化:
Abnormal Odor
理解:
Possible Equipment Problem
变化过程:
Normal State
↓
Odor Change
↓
Abnormal State
WSaiOS 关注:
不是气味本身。
而是:
气味变化代表的状态变化。
9.7 气味事件元素理论
气味变化可以形成事件。
例如:
发现:
Burning Smell
同时:
Temperature Increase
形成:
Fire Risk Event
事件结构:
Smell Event
{
Source
Change
Time
Location
Meaning
}
气味事件:
表示:
环境中发生了某种变化。
9.8 嗅觉元素到认知元素转换
嗅觉元素解决:
闻到了什么
认知元素解决:
意味着什么
转换:
Smell Element
↓
Source Understanding
↓
State Understanding
↓
Event Understanding
↓
Cognitive Element
案例:
输入:
Burning Smell
形成:
Equipment Abnormal Risk
案例:
输入:
Fresh Fruit Odor
形成:
Fruit Freshness Understanding
9.9 嗅觉与其他感知融合
真实认知不是单一感觉。
例如:
火灾判断。
视觉:
Smoke Image
听觉:
Alarm Sound
嗅觉:
Burning Odor
融合:
Multi Perception Element
↓
Fire Event Cognitive Element
形成:
Danger Understanding
9.10 嗅觉在 WSaiOS 感知体系中的位置
嗅觉属于:
环境状态感知层。
完整结构:
Environment
↓
Smell Input
↓
Smell Element
↓
State Element
↓
Event Element
↓
Cognitive Element
↓
Knowledge
↓
Reasoning
↓
Decision
9.11 本章总结
本章建立 WSaiOS 嗅觉感知元素理论。
核心观点:
- 嗅觉是一种环境状态感知方式;
- 气味元素描述气味对象、来源和属性;
- 气味必须与环境和对象建立关系;
- 气味变化能够反映状态变化;
- 气味事件能够表达环境异常;
- 嗅觉元素通过映射形成认知元素;
- 嗅觉需要与其他感知融合形成完整理解。
最终模型:
Environment
↓
Smell Element
↓
Source Element
↓
State Element
↓
Event Element
↓
Cognitive Element
↓
Knowledge
↓
Decision
下一章建议:
第十章
空间感知元素理论
Space Perception Element Theory
重点:
- 空间作为人工认知基础;
- 点、线、面、体元素;
- 位置关系;
- 距离关系;
- 空间布局;
- 环境结构认知。
9.12 嗅觉感知元素的 PHP OOP 对象化
前面建立了:
Smell Element
{
ID
Object
Source
Attribute
Intensity
Location
State
Relation
Event
}
在 WSaiOS 面向对象编程中,可以将其对应为:
SmellElement
即:
class SmellElement
{
protected $id;
protected $object;
protected $source;
protected $attributes = [];
protected $intensity;
protected $location;
protected $state;
protected $relations = [];
protected $events = [];
}
因此:
嗅觉感知元素理论开始正式进入 PHP OOP 工程对象。
9.13 SmellElement 类设计
第一版可以建立:
<?php
class SmellElement
{
protected $id;
protected $object;
protected $source;
protected $attributes = [];
protected $intensity;
protected $location;
protected $state;
protected $relations = [];
protected $events = [];
public function __construct(array $data = [])
{
$this->id = $data['id'] ?? null;
$this->object = $data['object'] ?? null;
$this->source = $data['source'] ?? null;
$this->attributes = $data['attributes'] ?? [];
$this->intensity = $data['intensity'] ?? 0;
$this->location = $data['location'] ?? null;
$this->state = $data['state'] ?? null;
$this->relations = $data['relations'] ?? [];
$this->events = $data['events'] ?? [];
}
public function getId()
{
return $this->id;
}
public function getObject()
{
return $this->object;
}
public function getSource()
{
return $this->source;
}
public function getAttributes()
{
return $this->attributes;
}
public function getIntensity()
{
return $this->intensity;
}
public function getLocation()
{
return $this->location;
}
public function getState()
{
return $this->state;
}
public function getRelations()
{
return $this->relations;
}
public function getEvents()
{
return $this->events;
}
}
这里的:
SmellElement
就是嗅觉领域中的核心对象。
9.14 为什么 SmellElement 不负责全部功能
不能把所有嗅觉处理逻辑都写进:
SmellElement
例如不应该:
class SmellElement
{
public function detect()
{
// 气味检测
}
public function save()
{
// 数据库保存
}
public function analyze()
{
// 状态分析
}
public function render()
{
// 页面输出
}
}
这样会造成:
Domain Object
+
Detection
+
Analysis
+
Database
+
View
全部耦合。
WSaiOS 应该继续保持前面视觉系统形成的工程原则:
Element
↓
Service
↓
Engine
↓
Repository
↓
Database
Controller
↓
Smarty
9.15 SmellAttribute 属性对象
气味属性可以进一步对象化。
建立:
<?php
class SmellAttribute
{
protected $name;
protected $value;
protected $type;
protected $confidence;
public function __construct(
$name,
$value,
$type = 'string',
$confidence = 1.0
) {
$this->name = $name;
$this->value = $value;
$this->type = $type;
$this->confidence = $confidence;
}
public function getName()
{
return $this->name;
}
public function getValue()
{
return $this->value;
}
public function getType()
{
return $this->type;
}
public function getConfidence()
{
return $this->confidence;
}
}
例如:
SmellElement
│
├── SmellAttribute
├── SmellAttribute
└── SmellAttribute
9.16 SmellIntensity 强度对象
气味强度也可以独立对象化。
<?php
class SmellIntensity
{
protected $level;
protected $change;
protected $duration;
public function __construct(
$level = 0,
$change = 0,
$duration = 0
) {
$this->level = $level;
$this->change = $change;
$this->duration = $duration;
}
public function getLevel()
{
return $this->level;
}
public function getChange()
{
return $this->change;
}
public function getDuration()
{
return $this->duration;
}
public function toArray()
{
return [
'level' => $this->level,
'change' => $this->change,
'duration' => $this->duration
];
}
}
于是:
SmellElement
│
└── SmellIntensity
9.17 SmellSource 来源对象
嗅觉认知的重要问题:
这个气味来自什么?
因此可以建立:
<?php
class SmellSource
{
protected $objectId;
protected $objectType;
protected $objectName;
protected $confidence;
public function __construct(
$objectId = null,
$objectType = null,
$objectName = null,
$confidence = 1.0
) {
$this->objectId = $objectId;
$this->objectType = $objectType;
$this->objectName = $objectName;
$this->confidence = $confidence;
}
public function getObjectId()
{
return $this->objectId;
}
public function getObjectType()
{
return $this->objectType;
}
public function getObjectName()
{
return $this->objectName;
}
public function getConfidence()
{
return $this->confidence;
}
}
形成:
Smell
↓
SmellSource
↓
Source Object
9.18 SmellLocation 空间位置对象
气味具有空间传播特征。
因此位置不应该永远只是:
$location = 'Kitchen';
而应该逐步对象化。
<?php
class SmellLocation
{
protected $area;
protected $x;
protected $y;
protected $z;
public function __construct(
$area = null,
$x = 0,
$y = 0,
$z = null
) {
$this->area = $area;
$this->x = $x;
$this->y = $y;
$this->z = $z;
}
public function getArea()
{
return $this->area;
}
public function toArray()
{
return [
'area' => $this->area,
'x' => $this->x,
'y' => $this->y,
'z' => $this->z
];
}
}
这样为后续:
Space Engine
预留接口。
9.19 SmellRelation 关系对象
嗅觉元素必须能够与其他对象建立关系。
例如:
Smoke
↓
Produced By
↓
Machine
建立:
<?php
class SmellRelation
{
protected $sourceId;
protected $relation;
protected $targetId;
protected $confidence;
public function __construct(
$sourceId,
$relation,
$targetId,
$confidence = 1.0
) {
$this->sourceId = $sourceId;
$this->relation = $relation;
$this->targetId = $targetId;
$this->confidence = $confidence;
}
public function toArray()
{
return [
'source_id' => $this->sourceId,
'relation' => $this->relation,
'target_id' => $this->targetId,
'confidence' => $this->confidence
];
}
}
因此:
SmellElement
↓
SmellRelation
↓
Object
形成嗅觉关系网络。
9.20 SmellEvent 事件对象
气味变化最终可以形成事件。
建立:
<?php
class SmellEvent
{
protected $source;
protected $change;
protected $time;
protected $location;
protected $meaning;
public function __construct(
$source,
$change,
$time = null,
$location = null,
$meaning = null
) {
$this->source = $source;
$this->change = $change;
$this->time = $time;
$this->location = $location;
$this->meaning = $meaning;
}
public function toArray()
{
return [
'source' => $this->source,
'change' => $this->change,
'time' => $this->time,
'location' => $this->location,
'meaning' => $this->meaning
];
}
}
于是:
Smell
↓
Change
↓
SmellEvent
↓
Cognitive Event
9.21 SmellScene 气味场景对象
多个嗅觉元素可以形成一个场景。
<?php
class SmellScene
{
protected $id;
protected $location;
protected $elements = [];
protected $relations = [];
protected $events = [];
protected $state;
public function __construct(
$id = null,
$location = null
) {
$this->id = $id;
$this->location = $location;
}
public function addElement(SmellElement $element)
{
$this->elements[] = $element;
}
public function addRelation(SmellRelation $relation)
{
$this->relations[] = $relation;
}
public function addEvent(SmellEvent $event)
{
$this->events[] = $event;
}
public function getElements()
{
return $this->elements;
}
public function getRelations()
{
return $this->relations;
}
public function getEvents()
{
return $this->events;
}
}
形成:
SmellScene
│
├ SmellElement
├ SmellElement
├ SmellRelation
├ SmellEvent
└ State
9.22 嗅觉 Engine 工程结构
在 WSaiOS 中建立独立:
Smell Engine
建议目录:
engine/
└── Smell/
├── SmellElement.php
├── SmellAttribute.php
├── SmellIntensity.php
├── SmellSource.php
├── SmellLocation.php
├── SmellRelation.php
├── SmellEvent.php
├── SmellScene.php
│
├── SmellParser.php
├── SourceAnalyzer.php
├── AttributeExtractor.php
├── IntensityAnalyzer.php
├── StateAnalyzer.php
├── RelationBuilder.php
├── EventBuilder.php
└── SmellAnalyzer.php
形成:
Parser
↓
Source
↓
Attribute
↓
Intensity
↓
State
↓
Relation
↓
Event
↓
Scene
9.23 SmellParser
SmellParser 负责输入标准化。
<?php
class SmellParser
{
public function parse($input)
{
return [
'source' => $input,
'type' => 'odor'
];
}
}
它不负责最终认知。
职责只是:
将原始输入转换为 WSaiOS 可以处理的标准结构。
9.24 SourceAnalyzer
来源分析:
<?php
class SourceAnalyzer
{
public function analyze(array $smellData)
{
return [
'object' => 'Machine',
'source' => 'Motor',
'confidence' => 0.91
];
}
}
形成:
Smell
↓
SourceAnalyzer
↓
Source Object
9.25 AttributeExtractor
提取气味属性:
<?php
class AttributeExtractor
{
public function extract(array $smellData)
{
return [
'type' => 'burning',
'character' => 'abnormal',
'state' => 'warning'
];
}
}
形成:
Smell
↓
AttributeExtractor
↓
SmellAttribute
9.26 IntensityAnalyzer
分析强度变化:
<?php
class IntensityAnalyzer
{
public function analyze(array $smellData)
{
return [
'level' => 0.75,
'change' => 0.20,
'duration' => 15
];
}
}
形成:
Intensity(t)
↓
Intensity(t+1)
↓
Change
9.27 StateAnalyzer
状态分析:
<?php
class StateAnalyzer
{
public function analyze(
array $current,
array $history = []
) {
return [
'current' => 'abnormal',
'previous' => 'normal',
'change' => 'odor_increase'
];
}
}
形成:
Historical State
+
Current State
↓
State Change
9.28 RelationBuilder
建立嗅觉对象关系:
<?php
class RelationBuilder
{
public function build(array $elements)
{
$relations = [];
return $relations;
}
}
例如规则:
Smell
↓
Produced By
↓
Machine
或者:
Smell
↓
Located In
↓
Kitchen
形成:
SmellRelation
9.29 EventBuilder
气味变化形成事件:
<?php
class EventBuilder
{
public function build(
array $smellElements,
array $stateChanges
) {
$events = [];
return $events;
}
}
例如:
Burning Odor
+
Temperature Increase
+
Machine
通过规则:
↓
Equipment Abnormal Event
9.30 SmellAnalyzer
最终建立统一分析入口:
<?php
class SmellAnalyzer
{
protected $parser;
protected $sourceAnalyzer;
protected $attributeExtractor;
protected $intensityAnalyzer;
protected $stateAnalyzer;
protected $relationBuilder;
protected $eventBuilder;
public function analyze($input)
{
$data = $this->parser->parse($input);
$source =
$this->sourceAnalyzer->analyze($data);
$attributes =
$this->attributeExtractor->extract($data);
$intensity =
$this->intensityAnalyzer->analyze($data);
return [
'source' => $source,
'attributes' => $attributes,
'intensity' => $intensity
];
}
}
因此:
WSaiOS Smell Engine
形成:
Smell Input
↓
SmellParser
↓
SourceAnalyzer
↓
AttributeExtractor
↓
IntensityAnalyzer
↓
StateAnalyzer
↓
RelationBuilder
↓
EventBuilder
↓
SmellScene
9.31 Repository 数据访问层
数据库操作继续与领域对象分离。
建立:
<?php
class SmellElementRepository
{
protected $db;
public function __construct(PDO $db)
{
$this->db = $db;
}
public function save(SmellElement $element)
{
// 保存嗅觉元素
}
public function find($id)
{
// 查询嗅觉元素
}
public function findByLocation($location)
{
// 根据空间位置查询
}
}
形成:
SmellElement
↓
Repository
↓
MySQL
9.32 嗅觉数据库设计
第一版可以建立:
smell_elements
smell_attributes
smell_relations
smell_events
smell_scenes
smell_elements
CREATE TABLE smell_elements (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
object_name VARCHAR(255) DEFAULT NULL,
source_name VARCHAR(255) DEFAULT NULL,
smell_type VARCHAR(100) DEFAULT NULL,
intensity DECIMAL(6,4) DEFAULT 0,
location VARCHAR(255) DEFAULT NULL,
state VARCHAR(100) DEFAULT NULL,
confidence DECIMAL(6,4) DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_object_name (object_name),
INDEX idx_source_name (source_name),
INDEX idx_smell_type (smell_type),
INDEX idx_location (location),
INDEX idx_state (state)
);
9.33 smell_attributes
CREATE TABLE smell_attributes (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
element_id INT UNSIGNED NOT NULL,
attribute_name VARCHAR(100) NOT NULL,
attribute_value TEXT,
attribute_type VARCHAR(50) DEFAULT 'string',
confidence DECIMAL(6,4) DEFAULT 1,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_element_id (element_id),
INDEX idx_attribute_name (attribute_name)
);
9.34 smell_relations
CREATE TABLE smell_relations (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
source_element_id INT UNSIGNED NOT NULL,
relation_type VARCHAR(100) NOT NULL,
target_element_id INT UNSIGNED NOT NULL,
confidence DECIMAL(6,4) DEFAULT 1,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_source (source_element_id),
INDEX idx_relation_type (relation_type),
INDEX idx_target (target_element_id)
);
9.35 smell_events
CREATE TABLE smell_events (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
element_id INT UNSIGNED NOT NULL,
event_type VARCHAR(100) DEFAULT NULL,
change_type VARCHAR(100) DEFAULT NULL,
location VARCHAR(255) DEFAULT NULL,
meaning VARCHAR(255) DEFAULT NULL,
event_time DATETIME DEFAULT NULL,
confidence DECIMAL(6,4) DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_element_id (element_id),
INDEX idx_event_type (event_type),
INDEX idx_event_time (event_time)
);
9.36 smell_scenes
CREATE TABLE smell_scenes (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
scene_name VARCHAR(255) DEFAULT NULL,
location VARCHAR(255) DEFAULT NULL,
scene_state VARCHAR(100) DEFAULT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_location (location),
INDEX idx_scene_state (scene_state)
);
9.37 数据库与 OOP 对象映射
形成:
MySQL
smell_elements
↓
SmellElement
smell_attributes
↓
SmellAttribute
smell_relations
↓
SmellRelation
smell_events
↓
SmellEvent
smell_scenes
↓
SmellScene
因此:
数据库负责保存状态,PHP OOP 负责表达领域对象。
9.38 SmellService
Service 负责业务流程。
<?php
class SmellService
{
protected $repository;
protected $analyzer;
public function __construct(
SmellElementRepository $repository,
SmellAnalyzer $analyzer
) {
$this->repository = $repository;
$this->analyzer = $analyzer;
}
public function analyze($input)
{
return $this->analyzer->analyze($input);
}
public function get($id)
{
return $this->repository->find($id);
}
}
形成:
Controller
↓
SmellService
↓
SmellAnalyzer
↓
SmellElement
↓
Repository
↓
Database
9.39 SmellController
Controller 不负责嗅觉分析算法。
它只负责:
Request
↓
Service
↓
View
例如:
<?php
class SmellController
{
protected $service;
protected $smarty;
public function __construct(
SmellService $service,
Smarty $smarty
) {
$this->service = $service;
$this->smarty = $smarty;
}
public function detail($id)
{
$element = $this->service->get($id);
$this->smarty->assign(
'element',
$element
);
$this->smarty->display(
'smell/detail.tpl'
);
}
}
9.40 Smarty 在嗅觉系统中的位置
Smarty 继续保持:
View
职责只有:
SmellElement
↓
Smarty
↓
HTML
例如:
<h1>嗅觉感知元素</h1>
<div class="smell-element">
<div>
Object:
{$element->getObject()}
</div>
<div>
Source:
{$element->getSource()}
</div>
<div>
Intensity:
{$element->getIntensity()}
</div>
<div>
State:
{$element->getState()}
</div>
</div>
9.41 MVC 完整链路
用户访问:
/smell/detail/100
系统:
Router
↓
SmellController
↓
SmellService
↓
SmellAnalyzer
↓
SmellElement
↓
Repository
↓
MySQL
显示:
SmellElement
↓
Controller
↓
Smarty
↓
HTML
9.42 嗅觉感知完整工程架构
综合起来:
WSaiOS Smell System
│
┌────────────┴────────────┐
↓ ↓
Smell Engine Smell Domain
│ │
↓ ↓
SmellAnalyzer SmellElement
│ / | \
│ / | \
│ Attribute Source Location
│ \ | /
│ Relation
│ │
│ Event
│ │
└──────────────→ SmellScene
应用层:
Controller
↓
Service
↓
Engine
↓
Repository
↓
MySQL
↓
Smarty
↓
HTML
9.43 嗅觉与空间感知连接
嗅觉本身不能完整表达:
气味在哪里
因此需要连接下一章的:
Space Element
形成:
SmellElement
+
SpaceElement
↓
EnvironmentElement
例如:
Burning Smell
+
Factory Area
↓
Factory Environmental Abnormality
这说明:
嗅觉系统天然需要空间系统支持。
9.44 嗅觉与视觉融合
例如:
视觉:
Machine
嗅觉:
Burning Odor
两者建立共同对象:
Machine
形成:
VisualElement
+
SmellElement
↓
MultiPerceptionElement
进一步:
Machine Abnormal State
9.45 嗅觉与音频融合
例如:
机器:
Abnormal Sound
同时:
Burning Odor
形成:
Audio Element
+
Smell Element
↓
Equipment Abnormal Event
因此:
单一感知
逐步进入:
多感知认知
9.46 嗅觉元素进入 Cognitive Engine
最终:
SmellElement
↓
SmellRelation
↓
SmellEvent
↓
Semantic Mapping
↓
CognitiveElement
例如:
Object:
Machine
Smell:
Burning
Intensity:
High
State:
Abnormal
转换为:
CognitiveElement
Type:
EquipmentAbnormal
Subject:
Machine
State:
Abnormal
Risk:
PossibleFailure
于是:
Smell Engine
↓
Cognitive Engine
正式连接。
9.47 嗅觉感知系统最终 OOP 结构
最终形成:
SmellElement
│
├── SmellAttribute
├── SmellIntensity
├── SmellSource
├── SmellLocation
├── SmellRelation
├── SmellEvent
└── SmellScene
处理:
SmellParser
↓
SourceAnalyzer
↓
AttributeExtractor
↓
IntensityAnalyzer
↓
StateAnalyzer
↓
RelationBuilder
↓
EventBuilder
↓
SmellAnalyzer
应用:
SmellController
↓
SmellService
↓
SmellEngine
↓
SmellRepository
↓
MySQL
显示:
Controller
↓
Smarty
↓
HTML
9.48 第九章完整工程目录
综合本章:
wsaios/
│
├── app/
│ │
│ ├── Controllers/
│ │ └── Smell/
│ │ └── SmellController.php
│ │
│ ├── Models/
│ │ └── Smell/
│ │ ├── SmellElement.php
│ │ ├── SmellAttribute.php
│ │ ├── SmellIntensity.php
│ │ ├── SmellSource.php
│ │ ├── SmellLocation.php
│ │ ├── SmellRelation.php
│ │ ├── SmellEvent.php
│ │ └── SmellScene.php
│ │
│ ├── Services/
│ │ └── Smell/
│ │ └── SmellService.php
│ │
│ ├── Repositories/
│ │ └── Smell/
│ │ └── SmellElementRepository.php
│ │
│ └── Views/
│ └── smell/
│ ├── detail.tpl
│ └── scene.tpl
│
├── engine/
│ └── Smell/
│ ├── SmellParser.php
│ ├── SourceAnalyzer.php
│ ├── AttributeExtractor.php
│ ├── IntensityAnalyzer.php
│ ├── StateAnalyzer.php
│ ├── RelationBuilder.php
│ ├── EventBuilder.php
│ └── SmellAnalyzer.php
│
├── config/
│ └── database.php
│
└── public/
└── index.php
9.49 人类嗅觉 → WSaiOS Smell Engine
这里同样需要保持理论边界。
WSaiOS:
不是复制人类嗅觉神经系统。
而是:
将嗅觉感知过程中“来源识别、属性识别、状态判断、环境关联和事件形成”等信息处理过程进行软件工程抽象。
因此:
人类嗅觉
↓
气味感知
↓
来源判断
↓
状态判断
↓
环境理解
抽象为:
WSaiOS Smell Input
↓
SmellParser
↓
SourceAnalyzer
↓
AttributeExtractor
↓
StateAnalyzer
↓
RelationBuilder
↓
SmellEvent
↓
CognitiveElement
9.50 本章核心工程结论
到这里,第九章已经从:
嗅觉理论
进入:
WSaiOS Smell OOP Architecture
核心关系:
SMELL INPUT
│
↓
SmellParser
│
↓
SmellElement
/ | \
/ | \
Attribute Source Location
\ | /
\ | /
Relation
│
↓
SmellEvent
│
↓
SmellScene
│
↓
CognitiveElement
│
↓
Cognitive Engine
PHP MVC 工程化:
WSaiOS
│
┌────────┴────────┐
│ │
Smell Engine Cognitive Engine
│
┌─────┴─────┐
│ │
Domain Service
Objects │
│ │
└─────┬──────┘
│
Repository
│
MySQL
│
Controller
│
Smarty
│
View
因此,第九章最终建立的是:
SmellElement → SmellAttribute → SmellRelation → SmellEvent → SmellScene → CognitiveElement
以及:
Class → Object → Engine → Service → Repository → Controller → Smarty → Database
这与前面的视觉、音频、触觉、味觉保持同一套 WSaiOS OOP 工程思想。
9.51 五种感知元素进入统一架构
至此,WSaiOS 已经形成:
VisualElement
AudioElement
TouchElement
TasteElement
SmellElement
它们分别负责:
Visual
↓
空间与对象
Audio
↓
时间与声音变化
Touch
↓
物理接触与状态
Taste
↓
物质属性
Smell
↓
环境与化学属性
最终进入:
VisualElement
│
AudioElement
│
TouchElement
│
TasteElement
│
SmellElement
│
↓
MultiPerceptionElement
│
↓
CognitiveElement
│
↓
Cognitive Engine
这也为下一章的:
第十章——空间感知元素理论
提供工程基础。
下一章将重点把:
Point
Line
Plane
Volume
Position
Distance
Direction
Boundary
Region
Space
进一步对象化为:
SpaceElement
PointElement
PositionElement
DistanceElement
DirectionElement
RegionElement
SpaceRelation
SpaceScene
并继续按照同一套:
PHP OOP
↓
MVC
↓
Service
↓
Repository
↓
Smarty
↓
MySQL
结构实现。