第十五章 状态感知元素理论
第十五章 状态感知元素理论
📅 2026年08月13日
👤 东塬一老翁
📂 第二卷:感知元素理论(Perceptual Elements Theory)
第十五章
状态感知元素理论
State Perception Element Theory
15.1 状态感知基本概念
Basic Concept of State Perception
前面的空间感知、运动感知和时间感知,分别解决了不同的问题:
空间感知
↓
对象在哪里
运动感知
↓
对象如何变化
时间感知
↓
变化什么时候发生
但是,仅仅知道对象的位置、运动和时间,还不能完整理解对象。
例如一台机器:
位置:
Factory A
运动:
停止
时间:
10:30
这些信息仍然不能完整回答:
机器现在是什么情况?
可能是:
正常停止
等待任务
故障停止
维修中
关闭
因此,WSaiOS 需要建立独立的:
状态感知元素。
状态感知关注:
对象当前处于什么状态;
对象之前是什么状态;
状态什么时候发生变化;
状态向什么方向变化;
状态变化是否正常;
状态与空间、运动、时间之间有什么关系。
WSaiOS 定义:
状态感知元素是描述认知对象在特定时间和环境条件下所处状态、状态属性以及状态变化过程的结构化认知元素。
基本过程:
对象
↓
对象状态
↓
状态观察
↓
状态比较
↓
状态变化
↓
状态转换
↓
状态认知
因此:
State Perception
=
Current State
+
Previous State
+
State Change
+
Context
15.2 状态作为认知元素
State as a Cognitive Element
状态不是简单的字符串。
例如:
Machine = Running
只能表达:
运行
但是 WSaiOS 真正需要保存的是:
对象:
Machine_001
当前状态:
Running
之前状态:
Idle
开始时间:
10:20
所在区域:
Factory_A
速度:
30
相关任务:
Production
状态来源:
Sensor
因此:
Running
只是一个状态值。
完整的:
State Element
才是一个认知元素。
状态可以抽象为:
State
{
Object
Value
Time
Context
Source
}
例如:
{
"object": "Machine_001",
"state": "Running",
"time": "10:20:00",
"context": "Factory_A",
"source": "Sensor"
}
由此可以形成:
对象
↓
状态
↓
上下文
↓
状态认知
15.3 对象状态元素
Object State Element
状态必须依附于对象。
不存在脱离对象的:
State
而应该是:
Object
+
State
例如:
Robot
Moving
Machine
Running
Person
Working
Door
Open
因此:
Object State
{
ObjectID
StateType
StateValue
StateSource
Timestamp
}
例如:
{
"object_id": "robot_001",
"state_type": "motion",
"state_value": "moving",
"state_source": "motion_sensor",
"timestamp": "2026-08-13 10:20:00"
}
状态元素的核心不是:
状态是什么
而是:
谁的状态
+
什么状态
+
什么时候
+
什么条件下
15.4 初始状态元素
Initial State Element
对象进入 WSaiOS 感知系统时,需要建立初始状态。
例如:
Machine
↓
Initial State
↓
Idle
初始状态:
S0 = Idle
之后:
S0
↓
Running
初始状态结构:
InitialState
{
Object
State
Timestamp
Source
}
例如:
{
"object": "machine_001",
"state": "idle",
"timestamp": "10:00:00",
"source": "system"
}
初始状态的作用是建立:
状态变化起点
没有初始状态,就很难判断:
状态从哪里变化而来
15.5 当前状态元素
Current State Element
当前状态表示:
对象在当前认知时刻所处的状态。
例如:
Machine
Current State
Running
状态结构:
CurrentState
{
Object
Value
Timestamp
Context
Confidence
}
例如:
{
"object": "machine_001",
"state": "running",
"timestamp": "10:30:00",
"context": "factory_a",
"confidence": 95
}
当前状态是 WSaiOS 进行实时认知的重要依据。
系统每次获得新的感知数据,都可能更新:
CurrentState
形成:
PreviousState
↓
New Observation
↓
CurrentState
15.6 历史状态元素
Historical State Element
如果 WSaiOS 只保存当前状态:
Machine = Running
那么系统不知道:
之前是什么?
因此需要保存历史状态。
例如:
10:00 Idle
10:10 Starting
10:11 Running
10:30 Warning
10:35 Running
形成:
State History
结构:
StateHistory
{
Object
States[]
}
例如:
{
"object": "machine_001",
"states": [
{
"state": "idle",
"time": "10:00"
},
{
"state": "starting",
"time": "10:10"
},
{
"state": "running",
"time": "10:11"
}
]
}
历史状态使 WSaiOS 获得:
Current State
+
Past State
从而形成:
State Evolution
即:
状态演化过程。
15.7 状态变化元素
State Change Element
状态感知的核心不是:
状态
而是:
状态变化
例如:
Idle
↓
Running
就是一次状态变化。
状态变化:
StateChange
{
Object
PreviousState
CurrentState
Time
Reason
}
例如:
{
"object": "machine_001",
"previous_state": "idle",
"current_state": "running",
"time": "10:11:00",
"reason": "start_command"
}
形成:
Idle
↓
Running
状态变化可以进一步成为:
State Transition
15.8 状态转换元素
State Transition Element
状态变化强调:
状态发生了变化。
状态转换进一步描述:
一个合法状态如何进入另一个状态。
例如:
Idle
↓
Starting
↓
Running
可以建立状态转换图:
┌─────────┐
│ Idle │
└────┬────┘
↓
┌─────────┐
│Starting │
└────┬────┘
↓
┌─────────┐
│ Running │
└────┬────┘
↓
┌─────────┐
│ Stopped │
└─────────┘
状态转换结构:
StateTransition
{
From
To
Condition
Time
Method
}
例如:
{
"from": "idle",
"to": "running",
"condition": "start_command",
"time": "10:10:00"
}
这为 WSaiOS 后面的:
Rule Engine
State Machine
Reasoning
提供基础。
15.9 状态趋势元素
State Trend Element
单次状态变化:
Normal
↓
Warning
只能说明一次变化。
连续变化:
Normal
↓
Warning
↓
Critical
↓
Failure
则形成:
State Trend
趋势可以表示:
Improving
Stable
Declining
Fluctuating
Deteriorating
状态趋势结构:
StateTrend
{
Object
History
Direction
Rate
Pattern
}
例如:
Temperature
70
↓
75
↓
80
↓
85
系统可能形成:
Temperature Increasing
进一步:
Increasing
+
Threshold Exceeded
形成:
Potential Warning
15.10 正常状态与异常状态
Normal and Abnormal State
WSaiOS 不应该简单地认为:
State = Error
而应该建立:
Normal State Model
然后将当前状态与正常状态进行比较。
例如机器正常:
Speed = 1000 RPM
Temperature = 60°C
当前:
Speed = 1000 RPM
Temperature = 61°C
属于:
Normal
如果变成:
Temperature = 95°C
则可能形成:
Warning
继续:
Temperature = 110°C
可能形成:
Abnormal
因此:
Observed State
↓
Compare
↓
Normal Model
↓
State Classification
状态分类:
Normal
Warning
Abnormal
Critical
Unknown
这里的核心思想是:
异常不是一种原始感知元素,而是状态分析之后形成的判断结果。
15.11 状态组合元素
Composite State Element
现实对象往往不是只有一个状态。
例如机器人:
Motion:
Moving
Power:
Normal
Task:
Transporting
Position:
Factory_A
Connection:
Online
这些状态共同组成:
Robot Composite State
结构:
CompositeState
{
MotionState
PowerState
TaskState
LocationState
ConnectionState
}
例如:
{
"object": "robot_001",
"state": {
"motion": "moving",
"power": "normal",
"task": "transporting",
"connection": "online"
}
}
形成:
Multi-dimensional State
这也是后面:
第十七章
多维空间感知
的重要基础。
15.12 状态与时间关系
State and Time
状态一定存在于时间中。
例如:
10:00
Idle
10:10
Running
10:30
Warning
因此:
State
+
Time
↓
State History
状态不仅需要保存:
Value
还需要保存:
StartTime
EndTime
Duration
状态持续时间:
Duration
=
EndTime
-
StartTime
例如:
Running
Start:
10:00
End:
10:30
则:
Duration = 30 minutes
这说明:
Time Element
↓
State Duration
↓
State Cognition
15.13 状态与空间关系
State and Spatial Relation
对象状态与空间环境存在关系。
例如:
Robot
Region:
Factory A
State:
Working
而:
Factory B
State:
Maintenance
同一个对象进入不同区域:
Factory A
↓
Working
Factory B
↓
Maintenance
因此:
State
+
Spatial Context
↓
Contextual State
例如:
{
"object": "robot_001",
"region": "factory_a",
"state": "working"
}
空间可以成为状态判断条件。
例如:
Robot Inside Maintenance Area
可能意味着:
Maintenance State
15.14 状态与运动关系
State and Motion Relation
运动状态本身就是状态的重要来源。
例如:
Robot
Position A
↓
Position B
说明:
Moving
如果:
Position A
↓
Position A
持续没有变化:
Static / Stopped
因此:
Motion Element
↓
Position Change
↓
State Analysis
↓
Motion State
例如:
Moving
↓
Decelerating
↓
Stopping
↓
Stopped
这里可以形成完整状态链:
Motion
↓
State Change
↓
State Transition
15.15 状态与多感知融合
State and Multi-perception Fusion
状态通常不是由单一传感器决定。
例如机器:
视觉:
Machine visible
空间:
Machine Position
运动:
Machine Static
音频:
Motor Sound
温度:
High Temperature
最终:
Machine
State = Warning
形成:
Visual Element
+
Spatial Element
+
Motion Element
+
Audio Element
+
Sensor Element
↓
State Analysis
↓
State Element
因此:
状态是多种感知信息经过分析后形成的重要认知结果。
15.16 状态记忆元素
State Memory Element
状态具有历史性。
因此 WSaiOS 必须能够保存:
Current State
+
Previous State
+
State History
形成:
State Memory
例如:
Machine_001
10:00 Idle
10:10 Running
10:30 Warning
10:35 Running
11:00 Stopped
状态记忆可以支持:
状态回溯
历史比较
状态趋势
异常分析
经验学习
与 WSaiOS Memory 系统连接:
State Element
↓
State Memory
↓
Experience
↓
Pattern
↓
Cognition
15.17 StateElement PHP OOP 模型
StateElement Object Model
状态元素应该采用面向对象方式实现。
基础模型:
class StateElement
{
protected $objectId;
protected $stateType;
protected $stateValue;
protected $previousState;
protected $timestamp;
protected $context;
protected $source;
protected $confidence;
public function getCurrentState()
{
return $this->stateValue;
}
public function getPreviousState()
{
return $this->previousState;
}
public function hasChanged()
{
return $this->stateValue !== $this->previousState;
}
public function getContext()
{
return $this->context;
}
}
对象结构:
StateElement
│
├── Object
├── StateType
├── StateValue
├── PreviousState
├── Timestamp
├── Context
├── Source
└── Confidence
这里体现 WSaiOS 的 OOP 原则:
StateElement
=
State Data
+
State Behavior
而不是简单的:
$array['state']
15.18 StateAnalyzer
State Analyzer
StateElement 负责描述状态。
而复杂的状态分析应该交给:
StateAnalyzer
职责:
读取当前状态
↓
读取历史状态
↓
比较状态
↓
识别变化
↓
分析趋势
↓
判断状态类型
↓
输出 State Element
PHP:
class StateAnalyzer
{
public function analyze(array $current, array $previous)
{
return [
'current' => $current,
'previous' => $previous,
'changed' => $this->detectChange(
$current,
$previous
),
'trend' => $this->analyzeTrend(
$current,
$previous
)
];
}
protected function detectChange($current, $previous)
{
return $current != $previous;
}
protected function analyzeTrend($current, $previous)
{
// 状态趋势分析
}
}
重要原则:
StateElement
负责:
表达状态。
StateAnalyzer
负责:
分析状态。
15.19 StateTransitionService
State Transition Service
状态转换属于 Service 层。
它负责:
Previous State
↓
Transition Rule
↓
Current State
PHP:
class StateTransitionService
{
protected $rules;
public function transition(
$previousState,
$currentState
) {
if (
$previousState === 'idle'
&&
$currentState === 'running'
) {
return 'START';
}
if (
$previousState === 'running'
&&
$currentState === 'stopped'
) {
return 'STOP';
}
return 'UNKNOWN';
}
}
形成:
Idle
↓
Running
↓
Stopped
对应:
START
STOP
这里尤其重要:
状态转换规则属于业务/认知方法,不应该放进 Smarty,也不应该全部塞进 Controller。
15.20 MVC 结构实现
MVC Architecture
WSaiOS 状态感知模块采用:
Model
View
Controller
Service
Analyzer
目录:
state/
│
├── controllers/
│ └── StateController.php
│
├── models/
│ ├── StateElement.php
│ ├── InitialState.php
│ ├── CurrentState.php
│ ├── HistoricalState.php
│ ├── StateChange.php
│ └── StateTransition.php
│
├── services/
│ ├── StateAnalyzer.php
│ ├── StateTransitionService.php
│ └── StateMemoryService.php
│
└── views/
└── state.tpl
总体:
Request
↓
StateController
↓
StateService
↓
StateAnalyzer
↓
StateElement
↓
StateTransition
↓
Cognitive Mapping
↓
Smarty
15.21 Smarty 模板实现
Smarty 只负责:
状态结果展示。
例如 Controller:
$result = $stateService->analyze($input);
$smarty->assign(
'state',
$result
);
$smarty->display(
'state.tpl'
);
模板:
<h2>状态感知结果</h2>
<p>
对象:
{$state.object}
</p>
<p>
当前状态:
{$state.current}
</p>
<p>
之前状态:
{$state.previous}
</p>
<p>
变化:
{$state.changed}
</p>
<p>
趋势:
{$state.trend}
</p>
必须坚持:
Smarty
↓
Presentation
而不是:
Smarty
↓
State Analysis
例如不要在模板中完成:
{if $state == 'running'}
来承担复杂状态认知。
复杂判断应该已经在:
StateAnalyzer
StateTransitionService
完成。
15.22 状态数据库结构
State Database Model
WSaiOS 可以使用数据库保存状态历史。
例如:
CREATE TABLE state_elements (
id INT AUTO_INCREMENT PRIMARY KEY,
object_type VARCHAR(100),
object_id VARCHAR(100),
state_type VARCHAR(100),
state_value VARCHAR(100),
previous_state VARCHAR(100),
context VARCHAR(255),
source VARCHAR(100),
confidence DECIMAL(5,2),
started_at DATETIME,
ended_at DATETIME,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
状态历史:
Object
↓
State
↓
Database
↓
History
状态转换可以单独保存:
CREATE TABLE state_transitions (
id INT AUTO_INCREMENT PRIMARY KEY,
object_id VARCHAR(100),
from_state VARCHAR(100),
to_state VARCHAR(100),
transition_type VARCHAR(100),
trigger_method VARCHAR(100),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
形成:
State
↓
Transition
↓
History
↓
Memory
15.23 状态认知映射
State to Cognition Mapping
状态元素本身不是最终认知。
例如:
Machine
State:
Warning
这只是:
State Element
继续分析:
Temperature High
+
Speed Abnormal
+
State Warning
可能形成:
Machine Possible Overheating
因此:
State Element
↓
State Analysis
↓
State Meaning
↓
Cognitive Element
例如:
Person
State:
Walking
Location:
Office
Time:
09:00
Direction:
Desk
综合以后:
Person Moving To Workspace
进一步:
Working Activity
所以状态认知映射可以抽象为:
State
+
Context
+
Relation
+
Time
↓
Meaning
↓
Cognition
15.24 本章总结
本章建立了 WSaiOS 状态感知元素理论。
状态感知解决的核心问题是:
对象现在处于什么状态,以及这个状态是如何形成、变化和演化的。
本章主要建立了以下概念:
对象状态元素——描述对象当前状态;
初始状态元素——建立状态变化起点;
当前状态元素——描述对象当前情况;
历史状态元素——保存状态演化过程;
状态变化元素——描述状态发生变化;
状态转换元素——描述状态之间的合法转换;
状态趋势元素——分析状态连续变化方向;
正常与异常状态——通过状态模型进行比较;
组合状态元素——描述对象的多维状态;
时间关系——建立状态持续时间和历史;
空间关系——建立状态与环境区域之间关系;
运动关系——通过运动判断对象动态状态;
多感知融合——利用视觉、音频、空间、运动等信息共同判断状态;
状态记忆——将状态历史连接到 WSaiOS Memory;
StateAnalyzer——负责状态分析;
StateTransitionService——负责状态转换;
MVC + Service + Smarty——实现状态感知工程化;
State Cognition Mapper——将状态结果映射为认知元素。
WSaiOS 状态感知核心模型
Object
↓
Initial State
↓
Current State
↓
Previous State
↓
State Change
↓
State Transition
↓
State Trend
↓
State Classification
↓
State Context
↓
State Memory
↓
State Meaning
↓
Cognitive Element
WSaiOS 状态感知 OOP 模型
StateElement
│
├── InitialState
├── CurrentState
├── HistoricalState
├── StateChange
└── StateTransition
│
↓
StateAnalyzer
│
↓
StateTransitionService
│
↓
StateMemoryService
│
↓
StateCognitionMapper
│
↓
CognitiveElement
MVC + Smarty 总体结构
WSaiOS State System
Request
↓
StateController
↓
StateService
↓
StateAnalyzer
↓
StateElement Layer
↓
State Change / Transition
↓
State Memory
↓
Cognitive Mapper
↓
Cognition
↓
Smarty View
↓
Outpu