西南石油大学学报（自然版）  2015, Vol. 37 Issue (2): 131-137

1. 西南石油大学计算机科学学院, 四川 成都 610500;
2. 西南石油大学石油与天然气工程学院, 四川 成都 610500;
3. 西南石油大学理学院, 四川 成都 610500

Drilling Site Risk Assessment Based on Bayesian Network
Wang Bing1 , Yang Xiaoying2, Zhao Chunlan3, Xiao Bin1
1. School of Computer Science, Southwest Petroleum University, Chengdu, Sichuan, 610500, China;
2. School of Petroleum and Natural Gas Engineering, Southwest Petroleum University, Chengdu, Sichuan 610500, China;
3. School of Science, Southwest Petroleum University, Chengdu, Sichuan 610500, China
Abstract: In view of the high investment and risk and uncertainties in drilling operation, the safety evaluation about the drilling operation is carried out in the paper. The method of evaluating risk and seeking risk resource during drilling operation has been developed by using Bayes network. The 32 risk factors during the drilling operation could be classified into manmade risk factors and natural risk factors by analyzing the history data and identifying the dangerous factors with the help of expertise. The Bayes network topological structure and conditional probability table(CPT) was developed for drilling operation risk; the probability was predicted forward and diagnosed backward; the safety probability of drilling operation was evaluated quantitative and the most dangerous factor was found out. After applying the Bayes network model to Well L gas drilling operation, we got the risk probability of man-made risk and natural risk at 0.108 and 0.165, respectively, the risk probability of Well L gas drilling operation at 0.137. The many dangerous factors are defects in monitor during the drilling process, lack of security protection facilities, hidden trouble induced by drilling operation, defect in well-control equipment and management in production. This will provide precise diagnostic data for operators and decision-making for safe production.
Key words: drilling operation     safety assessment     Bayes network model     prediction forward     diagnosis backward

1 贝叶斯网络模型

(1) X的网络拓扑结构GG为用 < A, E >表示具有n个节点的有向无环图；E={(Ai, Aj)}代表节点间的有向边，表示变量节点间的因果关系。对于有向边(Ai, Aj)而言，Ai称为Aj的父节点，而Aj称为Ai的子节点。构造贝叶斯网络结构的方法有两种：一种是通过咨询专家，依靠节点之间的因果关系构造；另一种是通过大量的历史数据分析计算来获得。由于龙岗油田已有大量钻井作业现场安全数据，采用数据分析计算和专家咨询两者兼顾的方法来构造贝叶斯网络结构。

(2) X的局部概率分布PP表示一个与每个节点相关的条件概率分布，B(Ai)和C(Ai)分别表示Ai的父节点集合和非后代节点集合。当两个节点之间没有有向边时，表示这两个节点条件独立性，即在给定B(Ai)下，AiA(Ai)条件独立，则可得到

 $P({A_i}/(B({A_i}), A({A_i})) = P({A_i}/B({A_i}))$ (1)

P(Ai/B(Ai)条件概率分布表达了节点与其父节点的关联关系。如果在给定根节点先验概率分布和非根节点的条件概率分布的情况下，可以得到联合概率分布

 $P(A) = P({A_1}, {A_2}, \cdots {A_n}) = \prod\limits_{i = 1}^n {P({A_i}/{A_1}, \cdots {A_{i-1}})}$ (2)

(1) 向前预测：由原因事件推知结果事件。目的是由原因事件发生的概率预测出结果事件的概率。假设原因事件的先验概率为P(Ai)，并且假设经过调查所获得的新附加信息为P(R/Ai)，由此

 $P(R) = \sum\limits_{i = 1}^n {P(R{A_i})} = \prod\limits_{i = 1}^n {P({A_i})P(R/{A_i})}$ (3)

(2) 向后诊断推理：由结果事件推知原因事件。目的是在已知结果事件已经发生的情况下，找出导致该结果事件发生的原因事件的概率，根据这个概率的大小，诊断出发生结果事件（事故、故障、病理)的原因。已知某些结果事件发生，经推理计算，得到造成该结果事件发生的原因和发生的概率。设先验概率为P(Ai)，且假设经过调查所获得的新附加信息为P(R/Ai)，其中i=1, 2, ···, n，则后验概率为

 $P({A_i}/R) = \frac{{P(R{\rm{ }}/{A_i})P({A_i})}}{{\sum\limits_{j = 1}^n {P(R{\rm{ }}/{A_j})P({A_j})} }}$ (4)

2 现场安全评价

2.1 构建钻井作业现场的贝叶斯网络结构

 图1 钻井作业现场安全评价的贝叶斯网络结构图 Fig. 1 Bayes network for drilling security evaluation

2.2 贝叶斯网络向前预测

 ${\boldsymbol{M}_{r|a}} = \boldsymbol{P}(r|a) = \left[ {\begin{array}{*{20}{c}} {p({R_1}|{A_1})}&{p({R_2}|{A_1})}\\ {p({R_1}|{A_2})}&{p({R_2}|{A_2})} \end{array}} \right]$ (5)

2.2.1 人的不安全行为A1

A1子系统的不安全概率计算，其推理规则条件概率矩阵见表 1。根据表中数据，有

 $p\left( {{A_1}} \right) = \sum\limits_{i = 1}^7 p \left( {{A_1}{A_{1i}}} \right) = \sum\limits_{i = 1}^7 {p\left( {{A_1}|{A_{1i}}} \right)} p\left( {{A_{1i}}} \right)$ (6)

 $p({A_{11}}) = \sum\limits_{j = 1}^5 {p({A_{11}}{A_{11j}})} = \sum\limits_{j = 1}^5 {p({A_{11}}|{A_{11j}})} p({A_{11j}})$ (7)

(1) A1i的风险值

 $p({A_{11}}) = \sum\limits_{j = 1}^5 {p({A_{11}}{A_{11j}})} = \\ \sum\limits_{j = 1}^5 {p({A_{11}}|{A_{11j}})} p({A_{11j}}) = 0.2 \times 0.75 = 0.15$ (8)
 $p({A_{12}}) = \sum\limits_{j = 1}^5 {p({A_{12}}{A_{12j}})} = \\ \sum\limits_{j = 1}^5 {p({A_{12}}|{A_{12j}})} p({A_{12j}}) = 0.1 \times 0.4 = 0.04$ (9)

(2) A1的风险值

 $p({A_1}) = \sum\limits_{i = 1}^7 {p({A_1}{A_{1i}})} = \sum\limits_{i = 1}^7 {p({A_1}|{A_{1i}})} p({A_{1i}}) = \\ 0.2 \times 0.15 + 0.15 \times 0.04 + 0.3 \times 0.24 = 0.108$ (10)
2.2.2 物的不安全状态A2

(1) A2i的风险值

 $p({A_{21}}) = \sum\limits_{j = 1}^5 {p({A_{21}}{A_{21j}})} = \sum\limits_{j = 1}^5 {p({A_{21}}|{A_{21j}})} p({A_{21j}}) = \\ 0.3 \times 0.34 + 0.2 \times 0.16 + 0.1 \times 0.07 + 0.2 \times 0.18 + 0.3 \times 0.25 = 0.252$ (11)
 $p({A_{22}}) = \sum\limits_{j = 1}^2 {p({A_{22}}{A_{22j}})} = \sum\limits_{j = 1}^2 {p({A_{22}}|{A_{22j}})} p({A_{22j}}) = 0.3 \times 0.6 + 0.1 \times 0.4 = 0.22$ (12)

(2) A2的风险值

 $\begin{array}{*{20}{c}} {p({A_2}) = \sum\limits_{i = 1}^4 {p({A_2}{A_{2i}})} = \sum\limits_{i = 1}^4 {p({A_2}|{A_{2i}})} p({A_{2i}})}\\ { = 0.252 \times 0.35 + 0.22 \times 0.35 = 0.165} \end{array}$ (13)
2.2.3 整个风险R系统的不安全概率

R系统推理规则条件概率矩阵见表 3。由式(14)得到井在记录期间的风险指数为13.7%，即安全评价指数为86.3%。此外，还可根据实时监控的底层事件的概率对系统的安全指数进行预测。

 $p(R) = \sum\limits_{i = 1}^2 {p(R{A_i})} = \sum\limits_{i = 1}^2 {p(R|{A_i})} p({A_i}) \\ = 0.108 \times 0.5 + 0.165 \times 0.5 = 0.137$ (14)
2.3 贝叶斯网络向后诊断

 $P({A_i}|R) = \frac{{P(R|{A_i})P({A_i})}}{{\sum\limits_{j = 1}^n {P(R|{A_j})P({A_j})} }}$ (15)

(1) A2i的风险值

 $P({A_{111}}|{A_{11}}) = \frac{{P({A_{11}}|{A_{111}})P({A_{111}})}}{{\sum\limits_{j = 1}^n {P({A_{11}}|{A_{11j}})P({A_{11j}})} }} = 0.066$ (16)
 $P({A_{112}}|{A_{11}}) = \frac{{P({A_{11}}|{A_{112}})P({A_{112}})}}{{\sum\limits_{j = 1}^n {P({A_{11}}|{A_{11j}})P({A_{11j}})} }} = 0.034$ (17)

 $P({A_{111}}) = \frac{{0.066}}{{0.066 + 0.034 + 0.034 + 0.223 + 0.777}} \times {\rm{ }}P({A_{11}}|{A_1}) = 1.16\%$ (18)

(2) 其他状态集合的风险值

3 结语

(1) 利用贝叶斯网络在安全评价方面的优势，构建钻井作业现场安全评价的贝叶斯网络拓扑结构。该结构有2个子系统和32个底层指标组成，利用贝叶斯网络对其进行安全评价。

(2) 由贝叶斯网络的双向推理技术，在事故统计下计算出钻井作业系统故障的条件概率，即进行预测；并在系统故障条件下，计算出各个组件的后验概率，即进行诊断，找出导致系统故障的最可能因素，对钻井作业的安全隐患提出相应的对策措施。

(3) 实例证明，运用简单、便于操作的专家打分法得出的条件概率表，运用贝叶斯网络对井的安全评价，得到了可信的评价结果。

(4) 该模型具有较强的普适性，应用该模型评价具体其他钻井作业现场安全性分析，只需要调整CPT而不必改变网络架构。

 [1] 中国石油天然气集团公司质量安全环保部. HSE风险管理理论与实践[M]. 北京: 石油工业出版社, 2009 . [2] 谢传欣, 叶从胜, 黄飞. 国内外井喷事故回顾[J]. 安全、健康和环境, 2004, 4 (2) : 9 –19. [3] 董国永, 刘景凯. 中国石油集团公司HSE管理体系运行模式的研究[J]. 中国安全生产科学技术, 2005, 1 (3) : 47 –51. Dong Guoyong, Liu Jingkai. CNPC's HSE-MS model establishment and practice[J]. Journal of Safety Science and Technology, 2005, 1 (3) : 47 –51. [4] 李巍, 张震. 油田生产环境安全评价与管理[M]. 北京: 化学工业出版社, 2005 . [5] 刘景凯. 基于管理实践的HSE管理体系建设研究[J]. 中国安全生产科学技术, 2008, 4 (2) : 99 –102. Liu Jingkai. Study on HSE-MS establishment based on management practice[J]. Journal of Safety Science and Technology, 2008, 4 (2) : 99 –102. [6] 张明广, 蒋军成. 基于层次分析法的重大危险源模糊综合评价[J]. 南京工业大学学报, 2006, 28 (2) : 31 –34. Zhang Mingguang, Jiang Juncheng. Application of analytical hierarchy process in hazard degree assessment of major hazard installations[J]. Journal of Nanjing University of Technology, 2006, 28 (2) : 31 –34. [7] 崔文彩.钻井工程HSE危害识别与风险评价模式研究[D].武汉:中国地质大学, 2008. http://cdmd.cnki.com.cn/article/cdmd-10491-2008095732.htm [8] 赵春兰, 王兵, 郭平. 基于ARIMA模型的钻井作业风险预测[J]. 新疆石油地质, 2013, 34 (4) : 469 –472. Zhao Chunlan, Wang Bing, Guo Ping. The risk probability prediction of drilling operation site using ARIMA model[J]. Xinjiang Petroleum Geology, 2013, 34 (4) : 469 –472. [9] 何学秋. 安全工程学[M]. 徐州: 中国矿业大学出版社, 2000 : 23 -36. [10] 蒋希文. 钻井事故与复杂问题[M]. 北京: 石油工业出版社, 2006 . [11] 刘玉石, 白家址, 周煜辉, 等. 考虑井壁岩石损伤时保持井眼稳定的泥浆密度[J]. 石油学报, 1995, 16 (3) : 123 –128. Liu Yushi, Bai Jiazhi, Zhou Yihui, et al. Mud density for wellbore stability when formation rock is damaged[J]. Acta Petrolei Sinica, 1995, 16 (3) : 123 –128. [12] 刘菊梅, 王宏图, 李文华, 等. 陆上油气钻井作业评价指标体系的构建[J]. 油气田地面工程, 2009, 28 (8) : 28 –29. [13] 郭杰. 钻井施工现场风险源分析与风险控制措施[J]. 内蒙古石油化工, 2010 (20) : 31 –33. [14] 赵全民, 樊建春, 张洪. 天然气钻井人因失误事故风险定量评价方法[J]. 天然气工业, 2012, 32 (7) : 80 –83. Zhao Quanmin, Fan Jianchun, Zhang Hong. Quantitative risk evaluation of human factors and failures in the gas drilling industry[J]. Natural Gas Industry, 2012, 32 (7) : 80 –83. [15] 田岚. 石油天然气钻井工程风险识别与评价方法[J]. 钻采工艺, 2010, 33 (2) : 31 –33. Tian Lan. Risk identification and evaluation method in drilling engineering[J]. Drilling & Production Technology, 2010, 33 (2) : 31 –33. [16] 李美求, 周思柱. 基于模糊综合评价法的钻井作业安全性评价[J]. 石油化工安全技术, 2006, 22 (6) : 5 –7. Li Meiqiu, Zhou Sizhu. Safety assessment of drilling well based on the fuzzy integrative evaluate method[J]. Petrochemical Safety Technology, 2006, 22 (6) : 5 –7. [17] 张连文, 郭海鹏. 贝叶斯网引论[M]. 北京: 科学出版社, 2006 . [18] Lockamy III A, McCormack K. Modeling supplier risks using Bayesian networks[J]. Industrial Management & Data Systems, 2012, 112 (2) : 313 –333. [19] Maiti S, Tiwari R K. Automatic discriminations among geophysical signals via the Bayesian neural networks approach[J]. Geophysics, 2010, 75 (1) : E67 –E78. DOI:10.1190/1.3298501 [20] Abedi M, Norouzi G H. Integration of various geophysical data with geological and geochemical data to determine additional drilling for copper exploration[J]. Journal of Applied Geophysics, 2012, 83 : 35 –45. DOI:10.1016/j.jappgeo.2012.05.003 [21] Lan B, Persaud B. Evaluation of multivariate Poisson log normal Bayesian methods for before-after road safety evaluations[J]. Journal of Transportation Safety & Security, 2012, 4 (3) : 193 –210. [22] Heckerman D, Geiger D, Chickering D M. Learning Bayesian networks:The combination of knowledge and statistical data[J]. Machine learning, 1995, 20 (3) : 197 –243. [23] Cooper G F, Herskovits E. A Bayesian method for the induction of probabilistic networks from data[J]. Machine Learning, 1992, 9 (4) : 309 –347. [24] Martins M R, Maturana M C. Application of Bayesian belief networks to the human reliability analysis of an oil tanker operation focusing on collision accidents[J]. Reliability Engineering & System Safety, 2013, 110 : 89 –109. [25] Wilson A G, Huzurbazar A V. Bayesian networks for multilevel system reliability[J]. Reliability Engineering & System Safety, 2007, 92 (10) : 1413 –1420.