顧佩月 劉崢 李云 李濤



摘 要:對于事件序列中的時序依賴發現,傳統的頻繁情節發現方法一方面使用時間窗口機制挖掘事件之間簡單的關聯依賴,另一方面無法有效處理事件的交叉時序關聯。針對以上問題,提出了時滯情節發現的概念,在頻繁情節發現的基礎上,設計了一種基于相鄰事件匹配集(AEM)的時滯情節發現算法。首先,引入時滯的概率統計模型進行事件序列匹配,避免預先設定時間窗口,處理可能存在的交叉關聯;然后,將時滯挖掘轉化為最優化問題,使用迭代的方式得到時滯情節之間的時間間隔分布;最后,利用假設檢驗區分串行時滯情節和并行時滯情節。理論分析與實驗結果表明,與目前最新的時滯挖掘方法迭代最近事件(ICE)算法相比,基于AEM的時滯情節發現算法模擬的時滯分布與真實時滯分布的平均KL距離為0.056,縮短了20.68%?;贏EM的時滯情節發現算法通過時滯的概率統計模型衡量事件多種匹配情況的可能性,獲得一對多的相鄰事件匹配集,比ICE算法中的一對一匹配更加有效地模擬了實際情況。
關鍵詞:時序依賴;事件序列;頻繁情節;時滯;概率統計模型
中圖分類號: TP391
文獻標志碼:A
Abstract: Concerning the problem that a predefined time window is usually used to mine simple association dependencies between events in the traditional frequent episode discovery, which cannot effectively handle interleaved temporal correlations between events, a concept of time-lag episode discovery was proposed. And on the basis of frequent episode discovery, Adjacent Event Matching set (AEM) based time-lag episode discovery algorithm was proposed. Firstly, a probability statistical model introduced with time-lag was introduced to realize event sequence matching and handle optional interleaved associations without a predefined time window. Then the discovery of time lag was formulated as an optimization problem which can be solved iteratively to obtain time interval distribution between time-lag episodes. Finally, the hypothesis test was used to distinguish serial and parallel time-lag episodes. The experimental results show that compared with Iterative Closest Event (ICE) algorithm which is the latest method of time-lag mining, the Kullback-Leibler (KL) divergence between true and experimental distributions discovered by AEM is 0.056 on average, which is decreased by 20.68%. AEM algorithm measures the possibility of multiple matches of events through a probability statistical model of time lag and obtains a one-to-many adjacent event matching set, which is more effective than the one-to-one matching set in ICE for simulating the actual situation.
Key words: temporal dependency; event sequence; frequent episode; time lag; probability statistical model
0 引言
近年來,隨著數據采集和存儲技術的不斷發展,各領域海量時序數據的研究逐漸成為數據挖掘和知識發現的熱點問題[1]。時序數據通常記錄了事物隨著時間變化發展的不同狀態。
在各類領域中,時序數據通常會有兩種形式:第一種是時間序列,記錄連續時間內事物變化值,例如股票數據、系統內存占用率等;第二種是事件數據,記錄離散時間內事物變化情況,例如購物籃數據[2]、Web數據[3]、社交網絡事件數據[4]等。同一事物的發展往往蘊含著一些不為人知的規律或固有模式,從事件數據中發現學習這些隱藏的有趣時序依賴模式,有助于對未來事物的發展進行預測或是對引起事件的根源進行追查。不同形式的時序數據依賴發現方式也有很大不同,本文主要研究離散時間上的序列集合,即事件數據中的時序依賴發現。
關聯規則[5]是現有工作中針對事件序列最簡單的時序依賴發現,也是后續許多時序依賴發現方法的基礎。關聯規則旨在發現時序數據中頻繁出現的項集,比較經典的應用就是購物籃數據。在此數據集中,每一條記錄代表一個客戶所有的購買記錄,通過關聯分析得到客戶可能同時購買的商品組合,從而幫助商場進行營銷。但是關聯規則的依賴事件是不考慮時間先后關系的,隨之又衍生了頻繁情節挖掘[6],即在關聯規則的基礎上添加簡單的時間約束,通過設定時間窗口從發現的依賴中得知事件發生的先后順序。隨著生產應用的需求變化,時序依賴發現中的時間參數從先后關系再到模糊的時間區間進而轉向具體的滯后時間挖掘。
在考慮兩類事件A、B之間的依賴時,通常是基于依賴存在于相鄰事件的假設上進行挖掘的,即若事件A、B是依賴的,那么事件B的發生只能與它之前的第一個事件A有關。但在實際復雜的生產環境中,事件之間的依賴不僅僅存在于相鄰發生,也有可能出現交叉依賴[7]的情況,導致無法判斷事件之間的對應關系。例如圖1,在關聯規則、序列模式等時序依賴發現中,通常只考慮彼此相鄰的兩類事件依賴,即實線箭頭表示的依賴關系,但真實的時序依賴是相互交叉的,事件B可能與它之前的第一個或第二個甚至更前面的A有關,即b3不僅可能與a3有關,也可能與a2或a1有關。以上這些需求的變化都為事件時序依賴發現帶來了更多的問題和困難。
1 相關工作
來自不同領域的多樣化需求衍生了多種類型的事件依賴,一般根據處理的數據類型分為兩類。第一類是事務數據庫,其中每個事務是一系列事件的集合。每個事務通常記錄的是同一個實體的事件,例如銀行賬戶流水、顧客購物記錄。這種類型的時序依賴主要用于發現在某些事務中頻繁出現的子序列,關注不同個體之間相同的依賴模式。序列模式[8-9]、全依賴模式[10]、互依賴模式[11]、部分周期模式[12]是該類事件依賴中比較典型的模式依賴發現。
在實際應用中因為某些條件限制,用戶無法獲得足夠的信息將事件數據劃分為事務,此時用戶面對的就是一系列事件。這就是第二類的時序依賴,也是本文重點關注的類型。其中,最基本的時序依賴是頻繁情節發現[6]。同一個情節中的事件發生在相近的時間區間內,所以情節發現的一般方式都是采用用戶預定義時間窗口機制。通過滑動時間窗口將發生在同一個窗口中的事件視作一個事務,然后將從事務數據庫中發現頻繁子序列的思想應用到頻繁情節發現中。傳統的情節發現只能揭示在一個預定義窗口內頻繁發生的有序事件,情節內事件之間發生的具體時間間隔是未知的。例如在大小為5的時間窗口中發現的情節〈A,B〉表示事件B會在事件A發生之后的4個單位時間內發生,但不能準確提供具體的發生時刻。文獻[13]提出了固定間隔情節的概念,構建了一種基于前綴樹的精確位置情節規則(Precise-Position Episode Rule trie, PER-trie)挖掘框架,用于獲得事件之間準確發生的時間間隔區間。
以上這些挖掘算法通常都需要用戶提前選定一個合適的時間窗口大小,這在實際應用中是一件非常困難的事情,因為實際應用中時序依賴發現的時間區間可能會從1秒到1天甚至更長不等,而不合適的時間窗口可能會導致一些超出窗口以外的依賴被忽視。文獻[14]算法不需要預先定義窗口,將空間統計學中的思想應用到事件的時序依賴發現中,用空間點過程的距離度量計算事件發生的無條件分布和條件分布,將成對事件之間的依賴關系問題轉化為這兩個概率分布的比較,而事件之間的等待時間用一個卡方檢驗來計算。Tang等[7]考慮到時間間隔的隨機性,將交錯事件存在關聯的可能性納入依賴發現過程中,構建了一個基于有序表的算法STScan (Sorted Table Scan),將成對事件之間可能存在的所有時間間隔都保存在鏈表中,通過掃描鏈表的子段得到所有的合格滯后區間。文獻[15]將時序依賴發現問題轉化為成對事件的時間間隔分布的學習,提出了一種基于期望最大化(Expectation Maximization, EM)的方法用于發現時序依賴中時滯的最大似然模型。Zller[16]基于迭代最近點(Iterative Closest Point, ICP)算法[17]思想構建了迭代最近事件(Iterative Closest Event, ICE)算法尋找最合適的事件匹配集合滿足時滯分布波動性最小。
6 結語
本文針對事件數據中的時序依賴問題進行研究,提出了時滯情節發現這一概念,采用基于相鄰事件匹配集(AEM)的時滯情節發現算法,不需要預先定義時間窗口,通過時滯的概率統計模型發現成對并行和串行時滯情節。與算法ICE相比,基于AEM的時滯情節發現算法有效地提高了時滯模擬效果。但目前本文研究只關注了成對的時滯情節,三個及三個以上事件類型之間的時滯情節發現需要在事件序列匹配中構建更加復雜的概率模型,這也是我們未來工作的重點研究方向,以便更好地將時滯情節發現應用于實際生產中。
參考文獻:
[1] 李濤,劉崢,周綺鳳.應用驅動的大數據挖掘[J].中興通訊技術,2016,22(2):49-52. (LI T, LIU Z, ZHOU Q F. Application-driven big data mining[J]. ZTE Communications, 2016,22(2):49-52.)
[2] WU C-W, LIN Y-F, YU P S, et al. Mining high utility episodes in complex event sequences [C]// Proceedings of the 2013 ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. New York: ACM, 2013: 536-544.
[3] 武健.時序Web數據挖掘方法[J].計算機應用,2014,34(S2):120-122. (WU J. Data mining method from time series Web data [J]. Journal of Computer Applications, 2014, 34(S2): 120-122.)
[4] 郭跇秀,呂學強,李卓.基于突發詞聚類的微博突發事件檢測方法[J].計算機應用,2014,34(2):486-490. (GUO Y X, LYU X Q, LI Z. Bursty topics detection approach on Chinese microblog based on burst words clustering [J]. Journal of Computer Applications, 2014, 34(2): 486-490.)
[5] AGRAWAL R, IMIELINSKI T, SWAMI A N. Mining association rules between sets of items in large databases [C]// Proceedings of the 1993 ACM SIGMOD International Conference on Management of Data. New York: ACM, 1993: 207-216.
[6] MANNILA H, TOIVONEN H, VERKAMO A I. Discovery of frequent episodes in event sequences [J]. Data Mining & Knowledge Discovery, 1997, 1(3):259-289.
[7] TANG L, LI T, SHWARTZ L. Discovering lag intervals for temporal dependencies [C]// Proceedings of the 2012 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. New York: ACM, 2012: 633-641.
[8] AGRAWAL R, SRIKANT R. Mining sequential patterns [C]// Proceedings of the 1995 Eleventh International Conference on Data Engineering. Washington, DC: IEEE Computer Society, 1995: 3-14.
[9] 李艷輝,劉浩,袁野,等.基于差分隱私的頻繁序列模式挖掘算法[J].計算機應用,2017,37(2):316-321. (LI Y H, LIU H, YUAN Y. Frequent sequence pattern mining with differential privacy[J]. Journal of Computer Applications, 2017, 37(2): 316-321.)
[10] LIANG F, MA S, HELLERSTEIN J L. Discovering fully dependent patterns [C]// Proceedings of the 2002 SIAM International Conference on Data Mining. Philadelphia, PA: Society for Industrial and Applied Mathematics (SIAM), 2002: 511-527.
[11] MA S, HELLERSTEIN J L. Mining mutually dependent patterns [C]// Proceedings of the 2001 IEEE International Conference on Data Mining. Washington, DC: IEEE Computer Society, 2001: 409-416.
[12] MA S, HELLERSTEIN J L. Mining partially periodic event patterns with unknown periods [C]//Proceedings of the 2001 17th International Conference on Data Engineering. Piscataway, NJ: IEEE, 2001:205-214.
[13] AO X, LUO P, WANG J, et al. Mining precise-positioning episode rules from event sequences [J]. IEEE Transactions on Knowledge and Data Engineering, 2018, 30(3): 530-543.
[14] LI T, MA S. Mining temporal patterns without predefined time windows [C]// Proceedings of the 4th IEEE International Conference on Data Mining. Washington, DC: IEEE Computer Society, 2004: 451-454.
[15] ZENG C, TANG L, LI T, et al. Mining temporal lag from fluctuating events for correlation and root cause analysis [C]// Proceedings of the 2014 10th International Conference on Network and Service Management. Washington, DC: IEEE Computer Society, 2014: 19-27.
[16] ZLLER M-A, BAUM M, HUBER M F. Framework for mining event correlations and time lags in large event sequences [C]// Proceedings of the IEEE 2017 15th International Conference of Industrial Informatics. Piscataway, NJ: IEEE, 2017: 3-4.
[17] BESL P J, McKAY N D. A method for registration of 3-D shapes [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2002, 14(2):239-256.
[18] GUO S, LIU Z, CHEN W, et al. Event extration from streaming system logs [C]// ICISA 2018Proceedings of the 9th International Conference on Information Science and Applications, LNEE 514. Singapore: Springer, 2018: 465-474.
[19] LI T, JIANG Y, ZENG C, et al. FLAP: an end-to-end event log analysis platform for system management [C]// Proceedings of the 2017 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. New York: ACM, 2017: 1547-1556.
[20] FISCHLER M A, BOLLES R C. Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography [J]. Readings in Computer Vision, 1987: 726-740.
[21] LI T, LIANG F, MA S, et al. An integrated framework on mining logs files for computing system management[C]// Proceedings of the 2005 Eleventh ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. New York: ACM, 2005: 776-781.