# 序列模式挖掘

序列模式挖掘是一种数据挖掘方法，它在由序列构成的数据库（如客户购买历史或事件日志）中发现频繁出现的有序事件序列，称为序列模式。频繁项集挖掘发现的是在一次事务中一起购买的项（事务内模式），而序列模式挖掘发现的则是跨事务模式：即以一致顺序跨事务出现的项集。

| 关键事实 | 详情 |
|---|---|
| 输出 | 所有支持度不低于用户指定最小支持度的序列；支持度是数据库中包含该模式的序列所占的比例 <sup>[1](https://rsrikant.com/papers/icde95.pdf)</sup> |
| 开创性论文 | Agrawal 与 Srikant，《Mining Sequential Patterns》，ICDE 1995，提出三种算法：AprioriSome、AprioriAll 和 DynamicSome <sup>[1](https://rsrikant.com/papers/icde95.pdf)</sup> |
| 主要算法族 | 候选生成-测试（GSP）、垂直 id-list 交集（SPADE）和模式增长（FreeSpan、PrefixSpan、SPAM）<sup>[2](http://hanj.cs.illinois.edu/pdf/jcst04_han.pdf)</sup> |
| 关键剪枝规则 | 反单调性：若一个序列不频繁，则其所有超序列都不频繁，因此 \( X \subseteq Y \Rightarrow \mathrm{support}(Y) \le \mathrm{support}(X) \) <sup>[3](https://cezeife.myweb.cs.uwindsor.ca/acmsurvey_paper.pdf)</sup> |
| 主要约束 | 相邻元素之间的最小与最大间隔、滑动窗口、持续时间、分类体系以及正则表达式风格的约束 <sup>[4](http://rsrikant.com/papers/edbt96.pdf)</sup> |
| 压缩表示 | 闭合模式（不存在具有相同支持度的超序列）与极大模式（不存在频繁的真超序列）；在一个示例数据库中，29 个模式中有 16 个是闭合模式、10 个是极大模式 <sup>[5](https://www.philippe-fournier-viger.com/dspr/dspr-paper5.pdf)</sup> |
| 已知失效模式 | 模式爆炸：在随机数据上，当序列长度为 50 时，短模式 ⟨(A)(A)⟩ 因偶然因素在 1000 条序列中的 610 条里出现 <sup>[6](http://web.cs.ucla.edu/%7Eweiwang/paper/DKE07.pdf)</sup> |

## 工作原理

输入是一个序列数据库：每条记录是一个有序的项集（事务）列表，例如某位客户随时间推移的购买记录。若序列 \( \alpha \) 的每个项集都按顺序出现（其间可能穿插其他项），则称 \( \alpha \) 被包含在某个数据序列中；例如，序列 ⟨(3)(4 5)(8)⟩ 被包含在 ⟨(7)(3 8)(9)(4 5 6)(8)⟩ 中。<sup>[1](https://rsrikant.com/papers/icde95.pdf)</sup> 一个模式的支持度是数据库中包含它的序列所占的比例，当支持度达到阈值 \( \xi \) 时，该模式即为频繁模式。<sup>[3](https://cezeife.myweb.cs.uwindsor.ca/acmsurvey_paper.pdf)</sup> 某些表述统计的是在所有序列中的总出现次数，而非包含该模式的序列数；按出现次数统计的表述称为重复序列模式挖掘，而普通支持度则对每条至少包含一次出现的序列计数一次。<sup>[7](https://link.springer.com/article/10.1007/s10618-025-01110-w)</sup>

搜索空间通过 Apriori 性质或反单调性质进行剪枝：频繁序列的任意子序列必定频繁，因此任何不频繁序列都排除了它的所有超序列。<sup>[3](https://cezeife.myweb.cs.uwindsor.ca/acmsurvey_paper.pdf)</sup> 这一性质继承自关联规则挖掘，1994 年的 Apriori 算法正是基于“大项集的任意子集必定也是大的”这一直觉。<sup>[8](https://agrawal-family.com/rakesh/papers/vldb94apriori.pdf)</sup> 一个 \( k \)-序列有 \( 2^{k} \) 个子序列，因此搜索空间增长迅速，正是剪枝使挖掘变得可行。<sup>[9](https://arpi.unipi.it/bitstream/11568/1172332/1/10.3934_aci.2023004.pdf)</sup>

## 实现方法

算法分为三大遍历族 <sup>[2](http://hanj.cs.illinois.edu/pdf/jcst04_han.pdf)</sup>：

- **候选生成-测试（GSP）。** GSP 将集合 \( L_{k-1} \) 与自身连接以构建候选 \( k \)-序列，然后删除任何含有低于最小支持度的连续 \( (k-1) \)-子序列的候选。<sup>[4](http://rsrikant.com/papers/edbt96.pdf)</sup> 它每处理一个长度层级就扫描一次数据库，并将所有频繁的长度为 \( k \) 的序列保存在内存中。<sup>[5](https://www.philippe-fournier-viger.com/dspr/dspr-paper5.pdf)</sup>
- **垂直交集（SPADE）。** 每条序列存储为（客户，事件）对的 id-list，频繁序列通过对 id-list 进行时间连接来枚举。搜索被分解为基于前缀的等价类，在主存中独立处理，通常只需三次数据库扫描。<sup>[10](https://cs.rpi.edu/~zaki/PaperDir/CIKM98.pdf)</sup>
- **模式增长（FreeSpan、PrefixSpan、SPAM）。** PrefixSpan 仅检查频繁前缀，并仅将相应的后缀子序列投影到投影数据库中，从局部频繁项增长模式，无需候选生成。<sup>[11](https://www2.cs.sfu.ca/~jpei/publications/span.pdf)</sup> SPAM 使用垂直位图表示和深度优先搜索。<sup>[12](https://philippe-fournier-viger.com/spmf/SPAM.pdf)</sup>

实测表现：在合成数据上，GSP 比 AprioriAll 快 30% 到 5 倍，在三个客户数据集上快 2 到 20 倍。<sup>[4](http://rsrikant.com/papers/edbt96.pdf)</sup> 在低支持度下，SPADE 约为 GSP 的两倍速度，使用预计算的频繁 2-序列时可快一个数量级。<sup>[10](https://cs.rpi.edu/~zaki/PaperDir/CIKM98.pdf)</sup> 在小数据集上 SPAM 比 SPADE 快约 2.5 倍，在大型数据集上快一个数量级以上；在极小型数据集上 PrefixSpan 略快于 SPAM，但在大型数据集上 SPAM 以超过一个数量级的优势胜出。<sup>[12](https://philippe-fournier-viger.com/spmf/SPAM.pdf)</sup> AprioriSome 和 AprioriAll 均从 25,000 到 250 万客户呈线性扩展（最大规模时数据集为 368 MB）<sup>[1](https://rsrikant.com/papers/icde95.pdf)</sup>，SPADE 从 10 万到 100 万客户呈线性扩展。<sup>[10](https://cs.rpi.edu/~zaki/PaperDir/CIKM98.pdf)</sup>

## 起源

该问题在 ICDE 的《Mining Sequential Patterns》中首次提出，动机来自客户交易数据库；该论文提出了 AprioriSome、AprioriAll 和 DynamicSome。<sup>[1](https://rsrikant.com/papers/icde95.pdf)</sup> AprioriAll 是第一个序列模式挖掘算法，由用于频繁项集的 Apriori 算法衍生而来。<sup>[3](https://cezeife.myweb.cs.uwindsor.ca/acmsurvey_paper.pdf)</sup> GSP 是其推广版本。<sup>[5](https://www.philippe-fournier-viger.com/dspr/dspr-paper5.pdf)</sup><sup> • </sup><sup>[9](https://arpi.unipi.it/bitstream/11568/1172332/1/10.3934_aci.2023004.pdf)</sup> 模式增长源自 FP-growth，即 Han、Pei 和 Yin（2000）提出的无候选项集方法 <sup>[13](https://doi.org/10.1145/335191.335372)</sup>，它启发了 FreeSpan，进而启发了 ICDE 2001 上的 PrefixSpan。<sup>[11](https://www2.cs.sfu.ca/~jpei/publications/span.pdf)</sup> SPADE 的垂直表示借鉴了 Eclat 项集算法。<sup>[5](https://www.philippe-fournier-viger.com/dspr/dspr-paper5.pdf)</sup> Mabroukeh 和 Ezeife 于 2010 年在《ACM Computing Surveys》上发表了这些算法的一个广泛使用的分类体系。<sup>[3](https://cezeife.myweb.cs.uwindsor.ca/acmsurvey_paper.pdf)</sup>

## 变体

**闭合模式与极大模式。** 若一个频繁序列不存在具有相同支持度的真超序列，则称其为闭合的；若不存在任何频繁超序列，则称其为极大的；极大模式集包含于闭合模式集，闭合模式集又包含于完整频繁模式集。<sup>[5](https://www.philippe-fournier-viger.com/dspr/dspr-paper5.pdf)</sup> 引入这些压缩表示是为了应对低支持度阈值下的冗余问题。<sup>[9](https://arpi.unipi.it/bitstream/11568/1172332/1/10.3934_aci.2023004.pdf)</sup> CloSpan 在当时是唯一的先前的闭合序列算法；BIDE 使用双向扩展闭合检查和 BackScan 剪枝来挖掘闭合序列，无需维护候选，内存消耗低几个数量级，运行速度比早期的闭合序列算法快一个数量级以上。<sup>[14](https://dl.acm.org/doi/10.1109/TKDE.2007.1043)</sup> 极大模式算法包括 VMSP，这是第一个用于极大序列模式的垂直算法。<sup>[9](https://arpi.unipi.it/bitstream/11568/1172332/1/10.3934_aci.2023004.pdf)</sup>

**约束。** GSP 是第一个集成间隔约束（连续项集之间的最小和最大时间）和持续时间约束的算法，同时还包括滑动窗口和分类体系。<sup>[4](http://rsrikant.com/papers/edbt96.pdf)</sup><sup> • </sup><sup>[5](https://www.philippe-fournier-viger.com/dspr/dspr-paper5.pdf)</sup> 约束分为反单调、单调、简洁和可转换四类；反单调约束剪枝效果最好，因为向下闭包性质适用。<sup>[5](https://www.philippe-fournier-viger.com/dspr/dspr-paper5.pdf)</sup> 间隔约束可写作 \( p = \langle ev_{1}[\min_{1},\max_{1}]\, ev_{2}[\min_{2},\max_{2}] \dots ev_{n} \rangle \)，限定相邻事件之间的间隔。<sup>[7](https://link.springer.com/article/10.1007/s10618-025-01110-w)</sup> Top-k 挖掘在无法预先确定合适支持度阈值时返回 \( k \) 个最频繁的模式。<sup>[9](https://arpi.unipi.it/bitstream/11568/1172332/1/10.3934_aci.2023004.pdf)</sup> 负序列模式挖掘寻找特定项被有意排除的模式，例如 \( \langle a, \neg b \rangle \)。<sup>[7](https://link.springer.com/article/10.1007/s10618-025-01110-w)</sup> 带间隔约束的非重叠挖掘由 NOSEP 算法和 Nettree 结构形式化。<sup>[15](https://doi.org/10.1109/tcyb.2017.2750691)</sup>

## 应用

已记录的应用领域包括购物篮分析、治疗与诊断分析、生物信息学、药物发现、推荐系统、物联网应用、旅游规划、轨迹数据分析、教育规划和网页点击流分析。<sup>[16](https://link.springer.com/article/10.1007/s41060-024-00659-x)</sup><sup> • </sup><sup>[5](https://www.philippe-fournier-viger.com/dspr/dspr-paper5.pdf)</sup>

## 局限与替代方案

**模式爆炸与虚假模式。** 仅靠支持度无法将显著模式与偶然巧合区分开来：在包含 1000 条长度为 50 的序列的随机数据上，模式 ⟨(A)(A)⟩ 因偶然因素出现在 61% 的序列中，且虚假模式的数量随序列长度呈指数增长。<sup>[6](http://web.cs.ucla.edu/%7Eweiwang/paper/DKE07.pdf)</sup> 在一个嵌入了 10 个基础模式的数据集上，支持度模型返回了 128,936 个模式，约为序列数的 129 倍，其中 128,910 个是冗余的。<sup>[6](http://web.cs.ucla.edu/%7Eweiwang/paper/DKE07.pdf)</sup> 候选生成也呈算术级爆炸：当有 1000 个频繁 1-序列时，基于 Apriori 的方法生成 1,499,500 个候选 2-序列和 166,167,000 个候选 3-序列。<sup>[3](https://cezeife.myweb.cs.uwindsor.ca/acmsurvey_paper.pdf)</sup> 闭合模式等压缩表示通过计算一个简洁的无损集合来解决这一问题，从中可以推导出整个集合而无需回到数据。<sup>[17](https://ceur-ws.org/Vol-3334/KDID2022_bruno.pdf)</sup>

**内存与阈值敏感性。** GSP 需要多次数据库扫描和大量内存候选集，对长模式效率低下。<sup>[18](https://faculty.cc.gatech.edu/~hic/CS7616/pdf/lecture13.pdf)</sup> PrefixSpan 的内存消耗随投影数据库的创建而增加 <sup>[3](https://cezeife.myweb.cs.uwindsor.ca/acmsurvey_paper.pdf)</sup>；SPAM 以空间换速度，当 \( 16T < N \) 时 SPADE 使用的空间约少 5 到 20 倍。<sup>[12](https://philippe-fournier-viger.com/spmf/SPAM.pdf)</sup> 低支持度阈值会使所有这些问题成倍放大。<sup>[9](https://arpi.unipi.it/bitstream/11568/1172332/1/10.3934_aci.2023004.pdf)</sup>

**相关领域。** 情节挖掘（episode mining）由 Mannila、Toivonen 和 Verkamo 于 1995 年提出，将事件序列中的频繁情节视为一种并行的问题表述。

**近期发展。** 2023 年后的工作包括：RNP-Miner 用于重复非重叠模式，按序列统计出现次数，在聚类上优于原始数据和经典频繁模式 <sup>[19](https://doi.org/10.1109/tkde.2023.3334300)</sup>；TaSPM 用于定向序列模式挖掘 <sup>[20](https://doi.org/10.1145/3639827)</sup>；LUSPM 主张频率忽视了利润、成本和风险，使用序列-效用链结构挖掘低效用模式 <sup>[21](https://arxiv.org/html/2510.10243v2)</sup>；SEQRET 在最小描述长度原则下从事件序列中挖掘规则集 \( X \rightarrow Y \)。<sup>[22](https://doi.org/10.48550/arxiv.2505.06049)</sup> 2024 年的一篇技术综述还记录了并行和分布式变体，如基于 MapReduce 的挖掘器。<sup>[16](https://link.springer.com/article/10.1007/s41060-024-00659-x)</sup>

## References

1. [Mining Sequential Patterns (Agrawal & Srikant, ICDE 1995)](https://rsrikant.com/papers/icde95.pdf)
2. [From Sequential Pattern Mining to Structured Pattern Mining: A Pattern-Growth Approach (Han, Yan, Pei, JCST 2004)](http://hanj.cs.illinois.edu/pdf/jcst04_han.pdf)
3. [A Taxonomy of Sequential Pattern Mining Algorithms (Mabroukeh & Ezeife, ACM Computing Surveys)](https://cezeife.myweb.cs.uwindsor.ca/acmsurvey_paper.pdf)
4. [Mining Sequential Patterns: Generalizations and Performance Improvements (Srikant & Agrawal, EDBT 1996, GSP)](http://rsrikant.com/papers/edbt96.pdf)
5. [A Survey of Sequential Pattern Mining (Fournier-Viger et al.)](https://www.philippe-fournier-viger.com/dspr/dspr-paper5.pdf)
6. [A multiple alignment approach to mining sequential patterns / evaluating support model output (Data & Knowledge Engineering, 2007)](http://web.cs.ucla.edu/%7Eweiwang/paper/DKE07.pdf)
7. [Sequential pattern detection: similarities and differences across various fields (Data Mining and Knowledge Discovery, 2025)](https://link.springer.com/article/10.1007/s10618-025-01110-w)
8. [Fast Algorithms for Mining Association Rules (Agrawal & Srikant, VLDB 1994)](https://agrawal-family.com/rakesh/papers/vldb94apriori.pdf)
9. [From basic approaches to novel challenges and applications in Sequential Pattern Mining (Bechini, Bondielli, Dell'Oglio, Marcelloni, 2023)](https://arpi.unipi.it/bitstream/11568/1172332/1/10.3934_aci.2023004.pdf)
10. [Efficient Enumeration of Frequent Sequences (Zaki, CIKM 1998, conference version of SPADE)](https://cs.rpi.edu/~zaki/PaperDir/CIKM98.pdf)
11. [PrefixSpan: Mining Sequential Patterns Efficiently by Prefix-Projected Pattern Growth (Pei et al., ICDE 2001)](https://www2.cs.sfu.ca/~jpei/publications/span.pdf)
12. [Sequential PAttern Mining using A Bitmap Representation (Ayres et al., KDD 2002, SPAM)](https://philippe-fournier-viger.com/spmf/SPAM.pdf)
13. [Jiawei Han, Jian Pei, Yiwen Yin (2000). Mining frequent patterns without candidate generation. ACM SIGMOD Record.](https://doi.org/10.1145/335191.335372)
14. [Frequent Closed Sequence Mining without Candidate Maintenance (Wang, Han, Li, IEEE TKDE 19(8), 2007); the ICDE 2004 conference version is BIDE: Efficient Mining of Frequent Closed Sequences](https://dl.acm.org/doi/10.1109/TKDE.2007.1043)
15. [Youxi Wu and colleagues (2017). NOSEP: Nonoverlapping Sequence Pattern Mining With Gap Constraints. IEEE Transactions on Cybernetics.](https://doi.org/10.1109/tcyb.2017.2750691)
16. [Sequential pattern mining algorithms and their applications: a technical review (Int. J. of Data Science and Analytics, 2024)](https://link.springer.com/article/10.1007/s41060-024-00659-x)
17. [Condensed Survey on Condensed Representations of Patterns (Soulet, Rioult, Crémilleux, KDID 2022)](https://ceur-ws.org/Vol-3334/KDID2022_bruno.pdf)
18. [Sequential Pattern Mining lecture notes (Georgia Tech CS7616)](https://faculty.cc.gatech.edu/~hic/CS7616/pdf/lecture13.pdf)
19. [Meng Geng and colleagues (2023). RNP-Miner: Repetitive Nonoverlapping Sequential Pattern Mining. IEEE Transactions on Knowledge and Data Engineering.](https://doi.org/10.1109/tkde.2023.3334300)
20. [Gengsen Huang, Wensheng Gan, Philip S. Yu (2024). TaSPM: Targeted Sequential Pattern Mining. ACM Transactions on Knowledge Discovery from Data.](https://doi.org/10.1145/3639827)
21. [Efficient Mining of Low-Utility Sequential Patterns (arXiv, 2025)](https://arxiv.org/html/2510.10243v2)
22. [Siji, Aleena and colleagues (2025). Seqret: Mining Rule Sets from Event Sequences. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2505.06049)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Databases and data systems › Data mining, warehousing, and big data › Data mining concepts and tasks

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/sequential-pattern-mining

English original: https://www.edgepedia.org/sequential-pattern-mining
