6
- 1 - http://www.ivypub.org/mt - 1 - Modern Transportation December 2012, Volume 1, Issue 1, PP.1-6 Formalization and Verification for Mid-block Street Crossing Signal Control Xiangjun Cheng # , Peng Du MOE Key Laboratory for Urban Transportation Complex Systems Theory and Technology, Beijing Jiaotong University, Beijing 100044, China #Email: [email protected] Abstract Current methods, for modeling urban traffic controlling system, are lack of formal description of system behaviors and cannot verify the specifications. The process of mid-block street crossing is a typical course which involves human behavior, vehicle behavior, traffic control behavior, and safety issue of transportation. This process has the character of sequential process with concurrent event. Description method for concurrent event and communication by Communication Sequential Processes (CSP) and basic notation, axiom, theorem and deducing rules of Duration Calculus (DC) are used for modeling. On the basis of analysis of mid-block street crossing, a formal model of the process of signal control based on CSP and DC is established. Through verification, the model satisfies the safety requirements. Key words: Formal Methods; Mid-block Street Crossing; Communication Sequential Processes; Duration Calculus; Safety Analysis 路段行人过街信号控制形式化模型与安全分析 承向军,杜鹏 北京交通大学 城市交通复杂系统理论与技术教育部重点实验室,北京 100044 摘 要:现有方法对道路交通控制系统建立的模型,缺乏对系统行为的形式化描述,而且无法给出系统的严格验证。路段 行人过街是涉及人员交通行为、车辆行为、交通控制和交通安全问题的典型过程,同时具有顺序进程和并发事件的特点。 利用顺序通信进程(CSP)对并发事件和通信的描述,以及时段演算(DC)的基本符号、公理、定理和推演规则,根据 行人过街信号控制过程的分析,建立了基于 CSP DC 的行人过街信号控制过程的形式化模型,并通过推演验证了模型 满足安全需求。 关键词:形式化方法;路段行人过街;顺序通信进程;时段演算;安全分析 引言 道路交通控制和诱导系统作为道路交通系统的两个重要的实时系统,是道路交通安全和畅通的重要保 证。对于交通控制和诱导系统的研究,传统方法缺乏抽象和形式化的模型,在研究此类实时、并发系统的可 靠性方面欠缺有效的工具和手段 [1-3] Yasunori Shiono [4] 应用顺序通信进程的方法,对并发系统的通信和分 类进行了探讨,并给出了形式化的方法。Ryo Mizutani [5] 应用顺序通信进程、事件驱动及多线程处理器等 方法,对涉及通信的具有多方交互的复杂网络系统进行建模。Touta Hayashi [6] 在开发用于车辆自动驾驶的 软件和硬件的过程中,使用了多线程和事件驱动技术,其中参考了顺序通信进程相关的原理和方法。路段行 人过街信号控制作为道路交通控制系统的重要组成部分,在保证行人过街安全和路段畅通作用明显。本文通

Formalization and Verification for Mid-Block Street Crossing Signal Control

Embed Size (px)

DESCRIPTION

Current methods, for modeling urban traffic controlling system, are lack of formal description of system behaviors and cannot verify the specifications. The process of mid-block street crossing is a typical course which involves human behavior, vehicle behavior, traffic control behavior, and safety issue of transportation. This process has the character of sequential process with concurrent event. Description method for concurrent event and communication by Communication Sequential Processes (CSP) and basic notation, axiom, theorem and deducing rules of Duration Calculus (DC) are used for modeling. On the basis of analysis of mid-block street crossing, a formal model of the process of signal control based on CSP and DC is established. Through verification, the model satisfies the safety requirements.

Citation preview

Page 1: Formalization and Verification for Mid-Block Street Crossing Signal Control

- 1 - http://www.ivypub.org/mt

- 1 -

Modern Transportation

December 2012, Volume 1, Issue 1, PP.1-6

Formalization and Verification for Mid-block Street Crossing Signal Control Xiangjun Cheng# , Peng Du MOE Key Laboratory for Urban Transportation Complex Systems Theory and Technology, Beijing Jiaotong University, Beijing

100044, China

#Email: [email protected]

Abstract Current methods, for modeling urban traffic controlling system, are lack of formal description of system behaviors and cannot

verify the specifications. The process of mid-block street crossing is a typical course which involves human behavior, vehicle

behavior, traffic control behavior, and safety issue of transportation. This process has the character of sequential process with

concurrent event. Description method for concurrent event and communication by Communication Sequential Processes (CSP)

and basic notation, axiom, theorem and deducing rules of Duration Calculus (DC) are used for modeling. On the basis of analysis

of mid-block street crossing, a formal model of the process of signal control based on CSP and DC is established. Through

verification, the model satisfies the safety requirements.

Key words: Formal Methods; Mid-block Street Crossing; Communication Sequential Processes; Duration Calculus; Safety

Analysis

路段行人过街信号控制形式化模型与安全分析

承向军,杜鹏

北京交通大学 城市交通复杂系统理论与技术教育部重点实验室,北京 100044

摘 要:现有方法对道路交通控制系统建立的模型,缺乏对系统行为的形式化描述,而且无法给出系统的严格验证。路段

行人过街是涉及人员交通行为、车辆行为、交通控制和交通安全问题的典型过程,同时具有顺序进程和并发事件的特点。

利用顺序通信进程(CSP)对并发事件和通信的描述,以及时段演算(DC)的基本符号、公理、定理和推演规则,根据

行人过街信号控制过程的分析,建立了基于 CSP 和 DC 的行人过街信号控制过程的形式化模型,并通过推演验证了模型

满足安全需求。

关键词:形式化方法;路段行人过街;顺序通信进程;时段演算;安全分析

引言

道路交通控制和诱导系统作为道路交通系统的两个重要的实时系统,是道路交通安全和畅通的重要保

证。对于交通控制和诱导系统的研究,传统方法缺乏抽象和形式化的模型,在研究此类实时、并发系统的可

靠性方面欠缺有效的工具和手段[1-3]

。Yasunori Shiono 等[4]应用顺序通信进程的方法,对并发系统的通信和分

类进行了探讨,并给出了形式化的方法。Ryo Mizutani 等[5]应用顺序通信进程、事件驱动及多线程处理器等

方法,对涉及通信的具有多方交互的复杂网络系统进行建模。Touta Hayashi 等[6]在开发用于车辆自动驾驶的

软件和硬件的过程中,使用了多线程和事件驱动技术,其中参考了顺序通信进程相关的原理和方法。路段行

人过街信号控制作为道路交通控制系统的重要组成部分,在保证行人过街安全和路段畅通作用明显。本文通

Page 2: Formalization and Verification for Mid-Block Street Crossing Signal Control

- 2 - http://www.ivypub.org/mt

- 2 -

过对路段行人过街信号控制的研究,建立基于顺序通信进程(Communicating Sequential Processes, CSP)和时段

演算(Duration Calculus, DC)的行人过街信号形式化模型,并进行推演验证,为提高路段行人过街信号控制系

统的安全性提供一种有效的建模工具和分析方法。

1 建模基础

CSP 作为进程代数方法的一种,可以通过限制所允许的可观察进程间通信来表示系统的行为,并允许并

发进程以显式的方式来表示。DC 是一种实时区间时态逻辑,用逻辑来描述系统的预期性能,包括底层规约、

时序和可能行为。采用与所选逻辑相关的公理系统证明系统具有预期的性能。

1.1 基本符号和含义

(1)CSP 基本符号和含义[7]

CSP 的基本成分是事件和进程,进程是事件或者活动的序列。

表 1 CSP 基本符号

符号 含义

a P→ 事件 a 发生,进程 P 执行

QP ||

进程 P 和进程Q并发

P Q

进程 P 和进程Q的选择进程

?c v 从信道 c 输入消息 v

(2)DC 基本符号和含义[8]

表 2 DC 基本符号

符号 含义 符号 含义

D 时段内几乎处处满足 D ∨ 析取

□D 时段内几乎处处满足 D ∧ 合取

◇D 时段内某处满足 D ¬ 非

D1→D2 由状态 D1 转移到状态 D2 ⇒ 蕴涵

D1⌒D2 D2 与 D1 相邻,D1 在 D2 之前,D2 在 D1 之后 ⇔ 等价

符号优先级

第一级 第二级 第三级

¬,□,◇ ⌒,∨,∧ ⇒,→,⇔,

1.2 基本公理和定理[9]

(1)基本公理

公理 1: 0l ≥ 公理 2: ( )( ) ( )( ) φ ϕ ψ φ ϕ ψ⇔⌒⌒⌒⌒

公理3: ( ) ( )1 2 1 2 1 2S S S S S S+ = ∨ + ∧∫ ∫ ∫ ∫ 公理4: ( ) ( )( ) ( )S l x S l y S x y= = = = ⇔ = +∫ ∫ ∫⌒

(2)基本定理

Page 3: Formalization and Verification for Mid-Block Street Crossing Signal Control

- 3 - http://www.ivypub.org/mt

- 3 -

定理 1:如果 1 2S S⇒ 那么 1 2S S≤∫ ∫ 定理 2:如果 S x≥∫ 那么 S x true=∫ ⌒

定理 3: ( )0 0 x y S x y S x S y≥∧ ≥ ⇒ = + ⇔ = =∫ ∫ ∫⌒ 定理 4:( ) S x S y S x y≥ ≥ ⇒ ≥ +∫ ∫ ∫⌒

2 建模与验证

2.1非形式化描述

城市干道设有人行横道,分别在道路方向和行人方向设置信号机,同时行人方向信号机设有供行人触发

的按钮,保证车辆通行和行人过街的安全需要。行人过街信号控制是由干道信号机和行人信号机两个独立部

分组成,并发处理、相互通信,共同实现行人的安全过街。 当人行道有行人按下触发按钮时,系统根据干道信号机当前的持续绿灯时长,判断行人方向信号机是否

立即开放行人过街信号,同时给出干道信号机的下一个变迁的状态。这里假定行人过街采用一次过街的方式,

而且行人绿灯相位的时间是固定时长。 基于 CSP 和 DC 的路段行人过街信号控制模型与验证流程如下图所示:

路段行人过街的

非形式化描述

形式化的符号、

公理和定理系统

基于CSP和DC的行人过街

信号控制形式化模型

给出基于CSP的信号控制并发过程的

显式表示

给出基于DC的信

号机状态集合

给出基于CSP和DC的触发按钮行为

给出基于DC的信

号控制策略

模型验证

安全需求验证

功能需求验证

图 1 基于 CSP 和 DC 的路段行人过街信号控制形式化建模与验证流程图

2.2 形式化描述

2.2.1 信号控制并发过程的显式表示

定义干道信号机和行人信号机分别为 TLC1、TLC2,则干道信号控制和行人过街信号控制并发过程的显式

表示为: 1 2A

TLC TLC TLC= 。因为 CSP 中规定一个信道只能用于两个进程间的单向通信,因此定义三个

进程间的通信事件分别为:c1?v1、c2?v2、c3?v3。TLC1、TLC2 两个进程间通过通信事件传递信号机的状态

变迁信息,以此表示并发。三个进程间的通信都是即时的,没有延误。

Page 4: Formalization and Verification for Mid-Block Street Crossing Signal Control

- 4 - http://www.ivypub.org/mt

- 4 -

图 2 进程间的通信

2.2.2 信号机状态

(1)状态

干道信号机: 1

Re dTLC Yellow

Green

(1)

人行道信号机一般为红、绿和绿闪三种状态,为了方便,用黄代替绿闪,定义行人过街信号机的状态如

式(2):

人行道信号机: 2

Re dTLC Yellow

Green

(2)

(2)状态变迁

干道信号机的状态变迁如式(3):

1 1 1 1 1( Re )nTLC Asm TLC Green TLC Yellow TLC d TLC Green= → = → = → = (3)

同样,行人过街信号机的状态变迁如式(4):

2 2 2 2 2( Re )nTLC Asm TLC Green TLC Yellow TLC d TLC Green= → = → = → = (4)

2.2.3 触发按钮行为

行人过街信号机设有触发按钮,按钮的触发行为如式(5):

pressBUTTON

unpress

=

(5)

触发行为与信号机 TCL 的通信进程描述如式(6):

3? 3P press c v TLC= → → (6)

式(6)表示,当按钮触发后,通过信道 c3 向控制进程 TLC 发送触发信息 v3。

2.2.4 信号机控制策略

定义干道信号机 TLC1 的持续绿灯时长为 1t∫ ,阈值为 T1;人行道信号机 TLC2的持续绿灯时长为 2t∫ ,

阈值为 T2;TLC1 与 TLC2 的全红时间阈值为 T3。

策略 1:如果按钮触发并且 TLC1 的持续绿灯时长为 1t∫ 大于等于阈值 T1 时,TLC1 的状态变为 Yellow。

1 1 1 1 1( )RSC BUTTON press TLC Green t T TLC Yellow= ∧ = ∧ ≥ ⇒ = ∫ (7)

Page 5: Formalization and Verification for Mid-Block Street Crossing Signal Control

- 5 - http://www.ivypub.org/mt

- 5 -

策略 2:行人过街的绿灯时间累计不超过阈值 T2,当 2t∫ > T2时,TLC1 的状态保持 Red,同时 TLC2的

状态变为 Yellow。

2 2 2 1 2( ) ReRSC t T TLC d TLC Yellow> ⇒ = ∧ = ∫ (8)

策略 3:为了安全,TLC1 和 TLC2 有不超过阈值 T3的全红时间,确保冲突区的车辆或行人可以清空。

3 1 2 3( Re Re )RSC TLC d TLC d l l T= ∧ = = ⇒ ≤ (9)

策略 4:黄灯是过渡,TLC1 和 TLC2 有不超过阈值 T4的黄灯时间。

4 1 4RSC TLC Yellow l l T= = ⇒ ≤ (10)

4 2 4'RSC TLC Yellow l l T= = ⇒ ≤ (11)

2.3 需求和验证

(1)安全需求

干道方向和行人方向的信号机不能同时为绿、一绿一黄、或同时为黄,即两个方向的相位组合不能为

(Green, Green)、(Green, Yellow)、(Yellow, Green)或(Yellow, Yellow),否则有发生碰撞的可能。

1 2( )TLC Green TLC Green= ∧ = ∨ 1 2( )TLC Green TLC Yellow= ∧ = ∨

1 2( )TLC Yellow TLC Green= ∧ = ∨ 1 2( )TLC Yellow TLC Yellow= ∧ = =false

(2)通过需求

干道方向和行人方向的信号机同时为红灯的时间不能过长,即两个方向的信号相位组合为(Red, Red)的时间不能过长,否则降低道路的通行能力。

1 2 Re( Re Re ) all dTLC d TLC d l T= ∧ = = ≤

(3)需求验证

1TLC Green= ⇒ 1 2( Re )TLC Green TLC d= ∧ =

1 2( Re )TLC Yellow TLC d= ∧ =

1 2( Re Re )TLC d TLC d= ∧ =

1 2( Re )TLC d TLC Green= ∧ =

1 2( Re )TLC d TLC Yellow= ∧ =

1 2( Re )TLC Green TLC d= ∧ =

RSC1,RSC2,TLC1Asm,TLC2Asm

2TLC Green= ⇒ 1 2( Re )TLC d TLC Green= ∧ =

1 2( Re )TLC d TLC Yellow= ∧ =

1 2( Re Re )TLC d TLC d= ∧ =

1 2( Re )TLC Green TLC d= ∧ =

1 2( Re )TLC Yellow TLC d= ∧ =

1 2( Re )TLC d TLC Green= ∧ =

RSC1,RSC2,TLC1Asm,TLC2Asm

两个独立的信号机并发,得到的所有可能相位的组合用集合 A 表示,如下:

Page 6: Formalization and Verification for Mid-Block Street Crossing Signal Control

- 6 - http://www.ivypub.org/mt

- 6 -

A={(Green, Red), (Yellow, Red), (Red, Red),(Red, Green), (Red, Yellow)} 集合 A 没有出现(Green, Green)、(Green, Yellow)、(Yellow, Green)或(Yellow, Yellow)的情况,满足

安全需求。 当出现(Red, Red)情况时,根据 RSC3, 1 2 3 Re( Re Re ) all dTLC d TLC d l T T= ∧ = = ≤ < ,满足通

过需求。

3 结论 本文在分析城市路段行人过街控制基础上,采用 CSP 和 DC 对控制系统进行建模。通过对信号控制规则

和并发模型的推演,得到了所有可能的相位组合集合,证明系统满足安全需求和通过需求,为路段行人过街

控制建模提供了一种可行的方法和思路。路段行人过街控制只是交通控制系统中的一个子系统,虽然简单但

是具有典型性。应用形式化方法对更为复杂的道路控制和诱导系统进行形式化建模和验证,是今后研究的方

向。

REFERENCES [1] Antonio Cerone,Simon Connelly,Peter Lindsay. Formal Analysis of Human Operator Behavioral Patterns in Interactive

Surveillance Systems. SoftwSystModel (2008)7:273–286

[2] Lindsay, P. and Connelly, S.. Modeling Erroneous Operator Behaviors for an Air-Traffic Control Task. In J. Grundy and P. Calder,

editors, Third Australasian User Interfaces Conference (AUIC2002), volume 7 of Conferences in Research and Practice in

Information Technology, pages 43–54. Australian Computer Society, Inc, 2002

[3] Aleksandra, Veljko. Formal Specification and Preliminary Design of an Asynchronous Traffic Light Controller. PROC. 23nd

International Conference on Microelectronics (MIEL 2002): 679-682

[4] Yasunori Shiono, etc. Efficiency of concurrent processing of sort using CSP[C]. 2012 13th ACIS International Conference on

Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing. Pp:524-529

[5] Ryo Mizutani, Kenji Ohmori. A Design and Implementation Method for Embedded Systems using Communicating Sequential

Processes with an Event-Driven and Multi-Thread Processor[C]. 2012 International Conference on Cyberworlds. Pp:221-225

[6] Touta Hayashi, Kenji Ohmori. An Autonomous Vehicle Using a Multi-Thread and Event-Driven Processor[C]. 2011 International

Symposium on Integrated Circuits. Pp:305-308

[7] C. A. R. Hoare, Communicating Sequential Processes, Prentice-Hall, Inc., Upper Saddle River, NJ, 1985

[8] Zhou Chaochen.Michael R. Hansen. Duration Calculus: A Formal Approach to Real-Time Systems [M]. Springer-Verlag Berlin

Heidelberg, 2004

[9] 承向军,应志鹏,杜鹏。高速列车 ATP 控制模式的形式化模型与安全性分析[J]。中国安全科学学报,2008 年第 3 期,pp:

28-32。[Cheng Xiangjun, Ying Zhipeng, Du Peng. Formalization Model of High Speed Train in ATP Control and Its Safety

Analysis[J]. China Safety Science Journal, Vol. 18, No.3, 2008:28-32.]

【作者简介】 承向军(1968-),男,汉族,博士,

讲师。主要研究:智能交通、交通控

制、交通仿真。1987.9-1991.7 在北

京交通大学运输管理工程系攻读学

士学位,1991.9-1994.3 在北京交通

大学应用系统分析研究所攻读硕士

学位,2000.9-2005.6 在北京交通大学交通运输学院

攻读博士学位。E-mail:[email protected]