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

第二十二章:WSaiOS EOM系统总体架构设计——从理论模型到软件系统

第二部分:WSaiOS EOM人工认知工程实现篇

第二十二章:WSaiOS EOM系统总体架构设计——从理论模型到软件系统


22.1 从认知理论进入工程实现

前面第一部分建立:

WSaiOS EOM理论模型:

信息

↓

元素 Element

↓

对象 Object

↓

关系 Relationship

↓

知识 Knowledge

↓

方法 Method

↓

行动 Action

↓

经验 Experience

↓

记忆 Memory

但是:

理论必须能够进入计算机。


因此:

第二部分研究:

如何将EOM认知模型转换为软件系统结构。


核心问题:

包括:

  1. 如何定义认知对象?
  2. 如何保存认知关系?
  3. 如何管理知识?
  4. 如何实现记忆?
  5. 如何通过程序完成认知流程?

22.2 WSaiOS系统设计思想

传统软件:

以功能模块设计。

例如:

电商系统:

用户模块

商品模块

订单模块

支付模块

WSaiOS:

以认知过程设计。


核心模块:

Element

Object

Relationship

Knowledge

Memory

Method

Reasoning

因此:

软件结构围绕:

认知生命周期。


22.3 WSaiOS总体架构

系统分为:

五个层次。


第一层:输入感知层(Perception Layer)

负责:

接收信息。


来源:

用户输入

文件

数据库

外部数据

例如:

用户输入:

深圳电动牙刷供应商

进入:

感知模块。



第二层:认知处理层(Cognitive Layer)

核心层。


负责:

EOM过程。


包括:

Element Engine

Object Engine

Relationship Engine

Matching Engine

Method Engine


第三层:知识记忆层(Knowledge & Memory Layer)

负责:

保存认知资源。


包括:

Knowledge Base

Long Memory

Short Memory

Sequence Memory

Probability Memory


第四层:应用逻辑层(Application Layer)

负责:

具体业务。


例如:

SEO分析

供应商分析

客户分析

市场分析


第五层:表现层(Presentation Layer)

负责:

结果展示。


使用:

Smarty Template

整体:


              User


                ↓


          Presentation

             Smarty


                ↓


          Application


                ↓


       Cognitive Kernel


                ↓


 --------------------------------

 Element

 Object

 Relationship

 Matching

 Method

 Memory

 --------------------------------


                ↓


        Knowledge Database


22.4 Cognitive Kernel设计

WSaiOS核心:

Cognitive Kernel。


它不是操作系统内核。


而是:

人工认知流程控制核心。


负责协调:

所有认知模块。


结构:

CognitiveKernel

{

ElementEngine

ObjectEngine

RelationshipEngine

KnowledgeEngine

MemoryEngine

MethodEngine


}


22.5 PHP OOP类结构设计

按照面向对象思想:

每一个认知概念:

对应一个类。


Element类

表示:

认知元素。


class Element
{

private $name;

private $type;

private $value;


public function getValue()
{

}


}

例如:

对象:

Element

name:
深圳

type:
Location

22.6 Object类设计

认知对象:

是核心。


class CognitiveObject
{


private $elements;


private $attributes;


private $state;


private $relations;


private $methods;



public function addElement($element)
{

}


public function addRelation($relation)
{

}


}

对应:

现实对象:

供应商

产品

客户

市场

22.7 Relationship类设计

关系对象:

单独设计。


原因:

关系本身具有意义。


class Relationship
{


private $source;


private $relationType;


private $target;


private $weight;



public function analyze()
{


}


}

例如:

供应商A

生产

电动牙刷

不是:

两个字符串。


而是:

一个关系对象。


22.8 Knowledge类设计

知识:

由对象和关系组成。


class Knowledge
{


private $objects;


private $relationships;


private $rules;


private $experience;



public function match()
{


}


}

知识不是:

单条数据。


而是:

认知结构集合。


22.9 Memory类设计

记忆:

独立模块。


class Memory
{


private $type;


private $content;


private $weight;


private $time;



public function store()
{


}



public function recall()
{


}


}

支持:

四类记忆:

Short Memory

Long Memory

Sequence Memory

Probability Memory

22.10 Method类设计

方法:

代表对象能力。


class CognitiveMethod
{


private $name;


private $action;



public function execute()
{


}


}

例如:

供应商对象:

推荐()

筛选()

比较()

22.11 CognitiveKernel运行流程

完整流程:


输入

↓

CognitiveKernel

↓

Element分析


↓

Object形成


↓

Relationship建立


↓

Knowledge匹配


↓

Method选择


↓

Action执行


↓

Memory保存


代码思想:

class CognitiveKernel
{


public function process($input)
{


$elements =
$this->elementEngine->parse($input);


$object =
$this->objectEngine->create($elements);


$result =
$this->matchingEngine->match($object);


$this->memoryEngine->store($result);



return $result;


}


}

22.12 MVC架构中的位置

传统MVC:

Controller

↓

Model

↓

View

WSaiOS:

增加:

认知层。


结构:


Controller


↓

CognitiveKernel


↓

Model


↓

Database


↓

Smarty


Controller:

负责流程。


CognitiveKernel:

负责认知。


Model:

负责数据。


Smarty:

负责表达。


22.13 WSaiOS MVC目录结构

PHP项目:

例如:

wsaios/

│

├── app/

│

├── controllers/

│

├── models/

│

├── cognitive/

│

│    ├── ElementEngine.php

│    ├── ObjectEngine.php

│    ├── RelationshipEngine.php

│    ├── MemoryEngine.php

│    └── CognitiveKernel.php

│

├── views/

│

│    └── smarty/

│

├── database/

│

└── public/

22.14 本章总结

WSaiOS EOM工程实现的核心思想:

不是:

先写业务。


而是:

先建立认知结构。


软件映射:


EOM理论

↓

PHP Class

↓

Cognitive Kernel

↓

MVC管理

↓

Smarty展示

↓

Knowledge Database

↓

Memory System

因此:

WSaiOS是一种:

面向认知对象的软件工程模型。


下一章:

第二十三章:WSaiOS EOM元素引擎设计——从信息输入到认知元素生成

重点研究:

  • Element在系统中的作用;
  • 信息如何转换为元素;
  • Element类设计;
  • Element Engine流程;
  • PHP OOP实现。

Leave a Reply

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