Eliminate the application levels, a new concept on equipment/automation/Logistic control software 消除

本文探讨了工业4.0背景下,通过扩展CPS概念,打破传统软件应用层级结构,实现更高效的企业信息系统架构。

This article continues the discussion of my previous 2 articles ’Extend the CPS concept, remodel the company organization ’ and ‘ Self-aware value network in the context of i4.0’.
 
With the development of an enterprise, the numbers of application software increases, and this for sure will create silos and barriers. So shall this situation to be continued in the era of i 4.0? What if we change mind, we don’t implement for enterprises with applications with system boundaries?
Quote from one the most famous writer in China: There’s no road in the world, as people keeping walking on it, there’s a road.
Similarly, there’s no systems in the physical world of an enterprise or the physical world, neither any boundaries.
 
The following picture from ISA88 standards shows a enterprise physical structure:


And accordingly, in ISA95 there’s level structure for software applications:


The interfaces between each level, especially between level 3 and level4, between level 3 and level 2, are the root cause of silos. And that’s why i4.0 mentioned about the keyword vertical integration.


What I’m suggesting is, to eliminate the level structure.
If you’ve experience with the control software of equipment or automation control, you shall know, the control PC of an equipment master all the information about the equipment, it can display in real-time the information about each chamber, transferring unit, sensors and even each pumps, and some of them may support 3D view; it has full control rights to all the actionable units, it provides recipe edit and other execution functions, some even can have some routing and scheduling function over works.


Extend the control software, other than existing functions, it shall also have the CPS functions as described(You can check my previous blog article ‘Extend the CPS concept, remodel the company organization’), to maintain the basic self-definitions, input/output, service definition, cost management, work plan and scheduling, the communication semantics and the scenarios to outside.


As following picture: 


As my concept described in the ‘Extend the CPS concept, remodel the company organization , the enterprise’s gonna be formed by many different CPS objects, each of them have full control over the physical assets and provide some service to others. There’s no levels, only the combination of CPS objects and the connection of their services. Thus accordingly, the software application can be in following loose and open way:


2 examples to explain the usages:
1)Cost management
CPS objects define and monitor all the input/output materials and the power supply。
The consumption of power supply can be calculated in real-time, the consumption during idle time and meanwhile the equipment depreciation won’t be allocated to WIPs.          
Before processing(Including material handling/logistics), the cost information of input material/WIP shall be provided by upstream CPS object(can be upstream equipment, material handling system or a facility pipe), after processing, this CPS object adds up the supply and depreciation to the WIP cost and pass it over to downstream.(You can refer to my blog article ‘A new way of real-time product costing’)
2) Work plan and scheduling
You can look into my blog article ’Self-aware value network in the context of i4.0 ’, I described 4 steps scenario. Supply chain is pull mode. Similarly, the interaction between the CPS objects is pull mode. 1) Fore-ward CPS objects receives the request from back-ward ones; 2) calculate, pass it backward, assess respond from back-ward then respond to initial request; 3) Select the final decided path. 4) Execution step by step.


Each CPS objects maintain its own capacity plan, we can refer to ISA95 here, you might be familiar with the following picture, but as in here, this information are maintained by CPS object, not an upper system.



I will explain using a classical logistic example.


One of the most mentioned example of the total cost approach for logistic system is: A factory might need 2 service from a same logistic vendor in one single day. For say, ship some raw material to the factory in the morning and deliver the final goods to customer in the afternoon. If you don’t take the total cost approach, the logistic vendor might need deploy double capacity. That is, one loaded truck ship the raw material and left in the morning, another empty truck come in the afternoon and wait to ship out the final goods.
If we take my CPS object concept, the logistic company is a CPS object, while receiving the request from the factory, it publishes the information inside, question all the truck CPS object, each truck CPS object, according to its own schedule and status, calculates the feasibility(current location, time on road) and the cost info, provide feedback to logistic company’s CPS object. 


Assume that the logistic company CPS object release the raw material delivery request first.
The respond from each truck might be as following:

 

Truck 1

Truck 2

Truck 3

Truck 4

Shipping request 1, time,location, 

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it



Then the logistic company CPS object can publish the final goods shipping request.

Truck 1

Truck 2

Truck 3

Truck 4

Shipping request 1, time,location, 

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it

Shipping request 2, time,location, 

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it


Of course the respond from each truck CPS object is based on the selection the company CPS made for previous requests.


I delete the ones not been selected in each step for different request sequences to show the result.

 

Truck 1

Truck 2

Truck 3

Truck 4

Shipping request 1, time,location, 

 

ETA,

cost if I do it

 

 

Shipping request 2, time,location, 

 

 

 

ETA,

cost if I do it

 

 

Truck 1

Truck 2

Truck 3 

Truck 4

Shipping request 2, time,location, 

 

 

ETA,

cost if I do it

 

Shipping request 1, time,location, 

 

 

ETA,

cost if I do it

 

 
The logistics company CPS need to select the best one. Because the best selection for each step won’t leads to the best select for the big picture. So, the logistic company CPS needs to publish N! different combinations of requests. After receiving the respond from each truck CPS for each step, sum up and select best one.

This can apply to process equipment, and the physical combinations of equipment and automation/logistic.



本文是之前的两篇文章:“扩展CPS概念,对企业信息系统进行重新建模”和“ 工业4.0背景下,具有感知能力的价值网络”的延续。

 

企业发展过程中,会不断地增加应用系统,久而久之之必然产生应用竖井和壁垒。那么工业4.0的时代,会否要出现类似的状况呢?如果换一个思路,我们从一开始就不尝试去给企业部署有系统边界的应用,那么结果会是如何?

套用鲁迅的话,世界上本没有路,走的人多了,也便成了路。

同样地,企业或物理世界中,本来就没有系统,也无所谓边界。

下图是ISA88标准里列出的一个企业物理架构的图。

ISA95里面对应用系统进行了分层:




每一层之间的接口,特别是第三层和第四层之间、第二和第三层之间,都是应用竖井产生的根源,也是工业4.0提出的关键字垂直化整合的根源。

 

我要提出的是,直接打通第二层到第四层。

如果你有接触过设备或自动化控制软件的话,你应该了解,设备控制电脑掌握设备所有信息,可以实时地显示各个腔体、传输机构、传感器、泵等等信息,有些可能会支持3D模式的显示;同时针对所有的可动作的元件有完全控制,提供配方编辑或其他命令执行功能;有些设备控制软件还可以对工作进行一定的排序。

 

在当前的这种设备控制软件基础上进行扩展,扩展后的功能包含两部分功能,一部分便是传统设备控制电脑所能提供的所有功能;另一部分则是这个设备的CPS对象功能(你可以回顾看一下我在“扩展CPS概念,对企业信息系统进行重新建模”里对设备CPS对象的描述。

),维护包括设备的基本定义、输入输出、服务能力和自身工作计划、成本管理、与外部CPS对象沟通的语义定义和通讯机制(它可以运行在云端,只需要保证和实体设备的通讯链接即可)。

 

如下图:


按照我在“扩展CPS概念,对企业信息系统进行重新建模”里的构想,企业会由多个CPS对象构成,每个对象对自身的实体拥有完全的掌控,都可以提供一些服务。再没有所谓的层级,而只是CPS对象及其服务的组合。那么相应的,企业的软件架构则可以是如下松散开放的结构:


举两个例子来阐述实际应用。

1)成本的计算

CPS对象针对本对象的实体定义并监控所有的输入输出的物料,能源。

实际消耗的能源可以实时统计,设备空闲状态时的能耗和设备折旧可以不归集给具体的产品。在加工处理(包括搬送)WIP时本对象收到的各种物料由输入方的CPS对象(可以是上游加工设备,可以是搬送物流系统,甚至可以是气体管路)提供成本信息,在加上本对象加工处理时消耗的能源和本对象折旧后,汇总成本信息到输出。(你可以参考一下我的博客里的“A new way of real-time costing”一文)

 

2)工作计划和调度

你可以回顾一下我在另一篇文章“工业4.0背景下,具有感知能力的价值网络”里描述的四段机制,价值链是拉式的。同样的,企业内的各个CPS对象的交互也是拉式的。1)前端的CPS对象收到后端的CPS对象的请求 2)逐级发出响应预案并向前传导评估最优方案并向后传导,3) 最前节点选定最终路径再逐级向后传导 4)从最后节点开始逐级完成实际工作或响应。

每个CPS对象维护自身的服务能力计划,这个我们可以再参考一下ISA95,你可能对下图也不陌生。不过这次,这个信息由CPS对象来维护。


下面就以一个经典的物流案例来阐述。

 

Total cost approach的一个经典问题是:一个工厂同一天可能会需要来自同一个物流供应商两项服务,比如上午运送原料到本厂,下午运出成品到客户。如果不采用Total cost approach的话,物理供应商可能需要调度双倍的运力。

如果以CPS对象的架构来看,物流企业本身是一个CPS对象,它在会收到工厂的送原料和运输成品的需求后,在对象内部发送信息,询问所有的货车CPS对象,每个货车CPS对象根据自身的能力计划,计算可行性(自身的位置,路途上可能花的时间)与相应成本,然后进行响应。

 

假设物流企业CPS对象先发布的是送原料的信息,那么各货车可以进行响应,

 

Truck 1

Truck 2

Truck3

Truck4

Shipping request 1, time,location, 

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it

接着物流企业CPS对象再次对内发出运输成品的请求,

 

 

Truck 1

Truck 2

Truck3

Truck4

Shipping request 1, time,location, 

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it

Shipping request 2, time,location, 

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it

ETA,

cost if I do it

当然,每个货车在针对后一个需求的响应是在决定了前一个响应的基础之上做出的。

所以如下,删掉每一个需求中未被选中的格子来标示:

 

Truck 1

Truck 2

Truck3

Truck4

Shipping request 1, time,location, 

 

ETA,

cost if I do it

 

 

Shipping request 2, time,location, 

 

 

 

ETA,

cost if I do it

 

 

Truck 1

Truck 2

Truck3

Truck4

Shipping request 2, time,location, 

 

 

ETA,

cost if I do it

 

Shipping request 1, time,location, 

 

 

ETA,

cost if I do it


物流企业CPS对象面临的则是如何选择最优,由于每一步的最优并不能保证全局的最优,所以,物流企业的选择是,N个需求则会有N!个不同的需求发布顺序,每个货车CPS对象都据此顺序做出响应。物流企业CPS在收到所有需求的响应后,对每一个需求选出最优解,并计算总成本。

你可以想象一下,以上对工作计划和调度的讨论可以同样地套用在具体的生产工艺设备或者工厂内产线上的物流自动化上。


<think>我们注意到用户的问题是关于Delphi 10.3中IdTcp组件的FTP相关状态:ftpTransfer、ftpReady、ftpAborted。然而,在Indy组件中,这些状态实际上属于TIdFTP组件的连接状态,而不是TIdTCPClient的直接状态。因此,我们需要区分清楚: 1. TIdTCPClient的Status属性是TIdStatus类型,它包含的是TCP连接的状态(如之前回答的hsResolving, hsConnected等)。 2. 用户提到的ftpTransfer、ftpReady、ftpAborted是TIdFTP组件的状态,属于TIdFTPStatus枚举。 因此,我们需要调整回答方向,解释TIdFTP组件的这三个状态。 在Delphi 10.3的Indy组件中,TIdFTP组件有一个OnStatus事件,该事件传递的状态参数是TIdFTPStatus类型。该枚举包含多个值,其中就包括用户询问的ftpTransfer, ftpReady, ftpAborted。 ### TIdFTPStatus枚举中这三个状态的含义: | 状态值 | 含义 | |----------------|------| | `ftpTransfer` | 表示FTP客户端正在传输文件(上传或下载)。当开始传输一个文件时,会触发此状态。 | | `ftpReady` | 表示FTP客户端已经完成上一个命令,准备好接收新的命令。通常在传输完成后或连接建立后的空闲状态触发。 | | `ftpAborted` | 表示FTP传输被中止(通常由用户或程序调用Abort方法导致)。 | ### 状态变化示例: 1. 当连接FTP服务器并登录成功后,状态会变为`ftpReady`,表示可以执行命令。 2. 当开始传输文件(如调用Get或Put方法)时,状态变为`ftpTransfer`。 3. 传输完成后,状态会回到`ftpReady`。 4. 如果在传输过程中调用了Abort方法,则状态会变为`ftpAborted`,然后可能回到`ftpReady`(如果连接未中断)或变为断开状态。 ### 示例代码:监控FTP状态事件 ```delphi procedure TForm1.IdFTP1Status(ASender: TObject; const AStatus: TIdFTPStatus; const AStatusText: string); begin case AStatus of ftpTransfer: Memo1.Lines.Add('正在传输: ' + AStatusText); ftpReady: Memo1.Lines.Add('准备就绪: ' + AStatusText); ftpAborted: Memo1.Lines.Add('传输已中止: ' + AStatusText); // 其他状态... end; end; ``` ### 注意事项: - `ftpTransfer`状态在文件传输期间会持续触发(可能多次),因为Indy可能会分块传输,但通常我们只在状态改变时记录。 - `ftpAborted`状态只会在传输被明确中止时触发,而不是在传输失败时(传输失败可能会触发异常或直接断开连接)。 - `ftpReady`状态在FTP连接建立后和每次命令执行完毕后都会触发,表示空闲状态。 ### 相关问题: 1. 如何判断FTP文件传输是否完成? 2. 在TIdFTP中,如何正确中止一个正在进行的文件传输? 3. TIdFTP还有哪些其他重要的状态值? </think>在 Delphi 10.3 的 Indy 组件中,`ftpTransfer`、`ftpReady` 和 `ftpAborted` 是 `TIdFTP` 组件的连接状态(属于 `TIdFTPStatus` 枚举),而非 `TIdTCP` 的直接状态。这些状态专门用于监控 FTP 连接的处理流程: ### FTP 连接状态详解 | 状态值 | 枚举值 | 含义 | |----------------|--------|----------------------------------------------------------------------| | **`ftpReady`** | 0 | FTP 连接已就绪,可以执行新命令[^1] | | **`ftpTransfer`** | 1 | 文件传输中(上传/下载),数据通道活跃 | | **`ftpAborted`** | 2 | 传输被用户主动中止(调用 `Abort` 方法)[^2] | ### 状态转换流程 ```mermaid graph LR A[ftpReady] -->|开始传输| B[ftpTransfer] B -->|传输完成| A B -->|调用Abort| C[ftpAborted] C --> A ``` ### 关键特性说明 1. **`ftpReady` (准备状态)** - 连接建立后的初始状态 - 完成登录认证后的等待命令状态 - 传输结束后的空闲状态 ```delphi // 示例:检测就绪状态 if IdFTP1.Status = ftpReady then IdFTP1.Get('file.zip', 'C:\file.zip'); // 发起传输 ``` 2. **`ftpTransfer` (传输状态)** - 通过 `OnWork`/`OnWorkBegin`/`OnWorkEnd` 事件监控进度 - 支持大文件分块传输(显示部分完成) - 自动管理数据端口连接 ```delphi procedure TForm1.IdFTPWork(Sender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64); begin ProgressBar1.Position := AWorkCount; // 更新进度条 end; ``` 3. **`ftpAborted` (中止状态)** - 仅通过显式调用 `Abort` 方法触发 - 不会自动清除传输缓冲区 - 需手动处理中断后的清理: ```delphi procedure AbortTransfer; begin IdFTP1.Abort; // 触发 ftpAborted 状态 DeleteFile('C:\partial_file.zip'); // 清理残留文件 end; ``` ### 典型应用场景 ```pascal // FTP状态事件处理 procedure TForm1.IdFTPStatus(ASender: TObject; const AStatus: TIdFTPStatus; const AStatusText: string); begin case AStatus of ftpReady: Log('准备执行新命令'); ftpTransfer: Log('传输进度: ' + AStatusText); ftpAborted: Log('传输已中止! 错误: ' + AStatusText); end; end; ``` ### 注意事项 1. **超时中断 ≠ `ftpAborted`** 网络超时会导致连接直接断开(`hsDisconnected`),不会触发 `ftpAborted`[^3] 2. **状态重置机制** 中止后需显式调用 `Noop` 或新命令使状态返回 `ftpReady` 3. **并行操作限制** 在 `ftpTransfer` 状态下尝试新操作会引发 `EIdFTPProtocolException` --- ### 相关问题 1. 如何通过 `TIdFTP` 状态机实现断点续传功能? 2. `ftpAborted` 和 TCP 连接断开(`hsDisconnected`)在资源清理上有何区别? 3. 监测 FTP 传输进度有哪些高效的方法? 4. 为什么在 `ftpTransfer` 状态下调用命令会产生异常? 5. 如何自定义 `ftpAborted` 后的自动恢复机制? [^1]: Indy 10 官方文档 - TIdFTPStatus 枚举 [^2]: `TIdFTP.Abort` 方法源码分析 (IdFTP.pas) [^3]: FTP 协议规范 RFC 959 - 异常中断处理
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值