# 模式匹配

模式匹配是一种数据集成技术，它以两个模式或其他元数据模型为输入，并生成两个模式中语义上相互对应的元素之间的映射。<sup>[1](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-2001-17.pdf)</sup> 匹配产生的是对应关系，而不是可执行映射或语义关系，因此下游步骤必须为这些对应关系补充语义，并将其转换为可运行的数据转换。<sup>[2](https://www.vldb.org/pvldb/vol4/p695-bernstein_madhavan_rahm.pdf)</sup> 匹配是面向Web的数据集成、电子商务、模式集成、模式演化与迁移、应用演化和数据仓库中的核心操作。<sup>[3](https://doi.org/10.1007/s007780100057)</sup>

| 关键事实 | 详情 |
|---|---|
| 输出 | 将对应模式元素配对的映射元素，每个带有一个位于[0, 1]的相似度值；k个匹配器产生一个 \( k \times m \times n \) 的相似度立方体<sup>[4](http://dit.unitn.it/~accord/RelatedWork/Matching/COMA%20-%20A%20system%20for%20flexible%20combination%20of.pdf)</sup> |
| 匹配器分类 | 模式级与实例级、元素级与结构级、语言型与约束型<sup>[3](https://doi.org/10.1007/s007780100057)</sup> |
| 典型组合 | Cupid的加权相似度 \( wsim = w_{\mathrm{struct}} \cdot ssim + (1 - w_{\mathrm{struct}}) \cdot lsim \)<sup>[5](https://arxiv.org/html/2406.01876)</sup> |
| 报告准确率 | LSD在受测领域达到71–92%的预测准确率<sup>[6](https://link.springer.com/content/pdf/10.1023/A:1021765902788.pdf)</sup> |
| 人工匹配成本 | 整合来自40个数据库的27,000个元素，估计耗时超过12人年<sup>[7](https://scholarworks.umb.edu/cgi/viewcontent.cgi?article=1002&context=management_wp)</sup> |
| 基准 | 截至2011年，尚无与OAEI本体竞赛相当的模式匹配基准<sup>[2](https://www.vldb.org/pvldb/vol4/p695-bernstein_madhavan_rahm.pdf)</sup> |

## 工作原理

来自拉姆与伯恩斯坦（Erhard Rahm and Philip A. Bernstein）综述的标准分类，区分了：模式级匹配器与实例级匹配器——前者仅使用名称和类型等元数据，后者还使用样本数据；元素级匹配器与结构级匹配器——前者孤立地比较单个属性或列，后者比较共同出现的元素组合，例如将“State”与“USState”匹配、将“ZIP”与“PostalCode”匹配；以及基于语言的匹配器与基于约束的匹配器——前者使用从叙词表和词典中提取的名称、同义词和上位词，后者使用数据类型与域的等价性、唯一键/主键/外键等键特征、关系基数以及“是一种”关系。<sup>[3](https://doi.org/10.1007/s007780100057)</sup><sup> • </sup><sup>[1](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-2001-17.pdf)</sup>

匹配基数包括1:1、1:n、n:1和n:m；元素级匹配通常限于1:1、n:1和1:n，而n:m匹配通常需要结构级匹配。<sup>[3](https://doi.org/10.1007/s007780100057)</sup> 系统以两种方式组合各项准则：混合匹配器将若干技术硬编码进一个算法，同时执行或按固定顺序执行；组合匹配器则从一组独立执行的模块化匹配器中选用，并合并其结果，因而更灵活。<sup>[3](https://doi.org/10.1007/s007780100057)</sup> Cupid是典型的混合匹配器，它为每个属性对计算加权相似度 \( wsim = w_{\mathrm{struct}} \cdot ssim + (1 - w_{\mathrm{struct}}) \cdot lsim \)，将结构相似度得分 \( ssim \) 与语言相似度得分 \( lsim \) 结合起来。<sup>[5](https://arxiv.org/html/2406.01876)</sup> Cupid的各阶段为：语言匹配（形态规范化、公共前缀与后缀测试等字符串技术，以及叙词表查找）；偏向叶节点的结构匹配，因为模式内容很大一部分位于叶节点；以及带阈值的映射生成。<sup>[8](https://inria.hal.science/hal-00922287/PDF/shvaiko2005a.pdf)</sup><sup> • </sup><sup>[9](https://www.microsoft.com/en-us/research/publication/generic-schema-matching-with-cupid/)</sup>

## 实施方式

以相似性泛洪（Similarity Flooding）系统为例，典型流水线如下：将每个模式转换为有向带标签图（例如通过SQL2Graph转换）；用快速字符串匹配器比较公共前缀和后缀，得到初始映射；通过迭代不动点计算细化映射，其中两个元素的相似度会部分传播给它们的邻居，就像IP数据包在网络中泛洪一样，每次迭代根据邻居对递增σ值并归一化，当变化低于阈值或经过固定迭代次数后终止；然后对结果进行过滤和阈值化，再由人工检查并调整。<sup>[10](https://dbs.uni-leipzig.de/files/research/publications/2002-1/pdf/icde2002-sf.pdf)</sup> [效率](https://www.edgepedia.org/zh/efficiency)方面的做法是，先用低阈值运行快速字符串匹配器，剪除大多数元素对，再应用较慢的匹配器。<sup>[11](https://dbs.uni-leipzig.de/files/research/publications/2018-1/pdf/enc-LS-Schema%20Matching.pdf)</sup>

COMA将工作组织为反复的匹配迭代，每次迭代包含可选的用户反馈阶段、多个匹配器的执行以及结果的组合；用户可以交互工作，在各次迭代中接受或拒绝候选匹配，也可以采用默认策略自动运行。<sup>[4](http://dit.unitn.it/~accord/RelatedWork/Matching/COMA%20-%20A%20system%20for%20flexible%20combination%20of.pdf)</sup> 质量以专家给出的“精确映射”为基准衡量：精确率是 \( t/(t+f) \)，即返回匹配中正确的比例；召回率是 \( t/c \)，即找到的真实匹配的比例；其中t为真实匹配，f为假阳性，c为预期映射规模；F度量将二者结合。<sup>[12](http://www.dit.unitn.it/~p2p/RelatedWork/Matching/p02-article-gal.pdf)</sup><sup> • </sup><sup>[7](https://scholarworks.umb.edu/cgi/viewcontent.cgi?article=1002&context=management_wp)</sup>

## 起源

模式匹配源于异构数据库方面的工作；在这类工作中，匹配通常由人工完成，且存在明显局限。<sup>[1](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-2001-17.pdf)</sup> 埃哈德·拉姆与菲利普·A·伯恩斯坦在2001年发表于《VLDB杂志》（The VLDB Journal）的论文中提出，将通用模式匹配视为一个独立问题，并贡献了现有技术的分类体系、Cupid算法以及一种比较评估方法；此后该领域发展成为一个重要研究课题。<sup>[3](https://doi.org/10.1007/s007780100057)</sup><sup> • </sup><sup>[2](https://www.vldb.org/pvldb/vol4/p695-bernstein_madhavan_rahm.pdf)</sup> Cupid由贾扬特·马达万（Jayant Madhavan）、菲利普·A·伯恩斯坦与埃哈德·拉姆在2001年第27届VLDB会议上提出，它基于名称、数据类型、约束和模式结构发现映射。<sup>[9](https://www.microsoft.com/en-us/research/publication/generic-schema-matching-with-cupid/)</sup>

## 变体

**相似性泛洪**将匹配视为带不动点计算的图匹配；图匹配是组合性的且计算代价高昂，因此近似不动点方法通常是实际解法。<sup>[10](https://dbs.uni-leipzig.de/files/research/publications/2002-1/pdf/icde2002-sf.pdf)</sup><sup> • </sup><sup>[8](https://inria.hal.science/hal-00922287/PDF/shvaiko2005a.pdf)</sup> **COMA**支持XML和关系模式，带有一个可扩展库，包含6个基本匹配器、5个混合匹配器和1个面向复用的匹配器；它也是首个复用整个模式映射、并通过组合已有映射来支持间接匹配的匹配工具。<sup>[4](http://dit.unitn.it/~accord/RelatedWork/Matching/COMA%20-%20A%20system%20for%20flexible%20combination%20of.pdf)</sup> **COMA++**由杜红海（Hong-Hai Do）与埃哈德·拉姆于2006年描述，增加了基于工作流的匹配策略、依赖上下文的匹配，以及一种基于片段的分治方法，可将大型匹配任务分解为较小任务。<sup>[13](https://doi.org/10.1016/j.is.2006.09.002)</sup> **LSD**走机器学习路线：先将少量数据源人工映射到一个中介模式，然后训练基学习器、元学习器、预测组合器和约束处理器，为后续数据源提出1:1的原子级映射，在受测领域达到71–92%的预测准确率。<sup>[6](https://link.springer.com/content/pdf/10.1023/A:1021765902788.pdf)</sup><sup> • </sup><sup>[1](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-2001-17.pdf)</sup> **S-Match**是一个开源框架，包含13个元素级匹配器和3个结构级匹配器，涵盖基于字符串、词义和释义的技术。<sup>[14](https://www.dai.ed.ac.uk/groups/ssp/members/openknowledge/Publications/Algorithms%20and%20Implementation.pdf)</sup><sup> • </sup><sup>[8](https://inria.hal.science/hal-00922287/PDF/shvaiko2005a.pdf)</sup> **eTuner**由李允京（Yoonkyong Lee）及其同事于2006年描述，使用合成场景来调优模式匹配软件。<sup>[15](https://doi.org/10.1007/s00778-006-0024-z)</sup> **ReMatch**由埃塔姆·希特里特（Eitam Sheetrit）及其同事于2024年描述，是一种检索增强的、基于大语言模型（LLM）的匹配器。<sup>[16](https://doi.org/10.48550/arxiv.2403.01567)</sup>

## 应用

除面向Web的数据集成、电子商务、模式集成、模式演化与迁移、应用演化和数据仓库之外，<sup>[3](https://doi.org/10.1007/s007780100057)</sup>匹配还通过基于[本体映射](https://www.edgepedia.org/zh/ontology-mapping)的语义实体消解，支持关联数据的链接发现。<sup>[2](https://www.vldb.org/pvldb/vol4/p695-bernstein_madhavan_rahm.pdf)</sup> 然而在商业实践中，Altova MapForce、IBM Infosphere、Microsoft BizTalk Server和SAP Netweaver等工具提供基于图形用户界面（GUI）的编辑器，用于人工指定映射，只能有限地自动确定匹配候选；大多数较新的匹配技术尚未被商业产品采用。<sup>[2](https://www.vldb.org/pvldb/vol4/p695-bernstein_madhavan_rahm.pdf)</sup><sup> • </sup><sup>[11](https://dbs.uni-leipzig.de/files/research/publications/2018-1/pdf/enc-LS-Schema%20Matching.pdf)</sup>

## 局限与替代方案

**失效模式。** 同名异义（homonyms），即相同或相似的名称指代不同元素，会误导匹配算法；叙词表和词典可利用同义词和上位词，但并不能消除歧义。<sup>[3](https://doi.org/10.1007/s007780100057)</sup> 更根本地说，模式和数据的句法表示并不能完全传达其语义，因此概念解释的歧义是主要障碍；不确定性通常形式化为一个带标签的二部图，边标签位于[0, 1]区间。<sup>[12](http://www.dit.unitn.it/~p2p/RelatedWork/Matching/p02-article-gal.pdf)</sup> 规模会加剧问题：对于更大的模式，自动匹配技术的有效性通常会下降，因为较大的搜索空间既会增加错误匹配，也会增加执行时间。<sup>[13](https://doi.org/10.1016/j.is.2006.09.002)</sup>

**人工投入。** 所评述的匹配方法无一达到完全自动化的程度，仍然需要人工干预；据报告，正确匹配的元素比例达到70–90%，其中最成功的方法结合了结构、元素、实例数据和既往匹配。<sup>[7](https://scholarworks.umb.edu/cgi/viewcontent.cgi?article=1002&context=management_wp)</sup> 自动确定的映射通常需要由人类领域专家检查和调整，删除错误对应关系并补充缺失的对应关系。<sup>[11](https://dbs.uni-leipzig.de/files/research/publications/2018-1/pdf/enc-LS-Schema%20Matching.pdf)</sup>

**基准测试。** 截至2011年，模式匹配与映射尚无与年度OAEI本体匹配竞赛相当的基准工作，早期测试模式大多很小，约50–100个元素。<sup>[2](https://www.vldb.org/pvldb/vol4/p695-bernstein_madhavan_rahm.pdf)</sup> 较新的基准包括：一个由MIMIC-IV源模式和OHDSI OMOP通用数据模型构建的医疗保健基准，其真值来自OHDSI ETL规范；以及SchemaNet，它源自跨三个企业领域的真实模式对。<sup>[17](https://tabular-data-analysis.github.io/tada2024/papers/TaDA.8.pdf)</sup><sup> • </sup><sup>[18](https://doi.org/10.48550/arxiv.2507.10897)</sup>

**相邻问题。** 匹配与映射是互补的：匹配在源模式与目标模式的元素之间建立对应关系，而映射则从这些对应关系生成断言，也就是查询。<sup>[19](https://cse.buffalo.edu/~chomicki/636/main-mapping.pdf)</sup><sup> • </sup><sup>[20](https://openproceedings.org/2011/conf/edbt/BonifatiV11.pdf)</sup> 模式匹配与本体匹配的不同之处在于，数据库模式往往缺乏显式语义，因此匹配必须猜测其编码含义；而本体是具有形式语义的逻辑系统，匹配可以直接利用这些语义。<sup>[21](http://disi.unitn.it/~p2p/RelatedWork/Matching/JoDS-IV-2005_SurveyMatching-SE.pdf)</sup>

## References

1. [On Matching Schemas Automatically (MSR-TR-2001-17, Rahm & Bernstein, February 2001)](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-2001-17.pdf)
2. [Generic Schema Matching, Ten Years Later (Bernstein, Madhavan, Rahm, PVLDB 4(11), 2011)](https://www.vldb.org/pvldb/vol4/p695-bernstein_madhavan_rahm.pdf)
3. [Erhard Rahm, Philip A. Bernstein (2001). A survey of approaches to automatic schema matching. The VLDB Journal.](https://doi.org/10.1007/s007780100057)
4. [COMA, A System for Flexible Combination of Schema Matching Approaches (Do & Rahm, ICDE 2003)](http://dit.unitn.it/~accord/RelatedWork/Matching/COMA%20-%20A%20system%20for%20flexible%20combination%20of.pdf)
5. [GRAM: Generative Retrieval Augmented Matching of Data Schemas in the Context of Data Security](https://arxiv.org/html/2406.01876)
6. [Learning to Match the Schemas of Data Sources: A Multistrategy Approach (LSD, Machine Learning journal)](https://link.springer.com/content/pdf/10.1023/A:1021765902788.pdf)
7. [Schema Matching: A Literature Review](https://scholarworks.umb.edu/cgi/viewcontent.cgi?article=1002&context=management_wp)
8. [A Survey of Techniques for Schema and Ontology Matching (Shvaiko & Euzenat)](https://inria.hal.science/hal-00922287/PDF/shvaiko2005a.pdf)
9. [Generic Schema Matching With Cupid (MSR-TR-2001-58; VLDB 2001)](https://www.microsoft.com/en-us/research/publication/generic-schema-matching-with-cupid/)
10. [Similarity Flooding: A Versatile Graph Matching Algorithm and its Application to Schema Matching (Melnik, Garcia-Molina, Rahm, ICDE 2002)](https://dbs.uni-leipzig.de/files/research/publications/2002-1/pdf/icde2002-sf.pdf)
11. [Schema Matching / Large-Scale Schema Matching (encyclopedia chapter, Rahm & Peukert)](https://dbs.uni-leipzig.de/files/research/publications/2018-1/pdf/enc-LS-Schema%20Matching.pdf)
12. [Why is Schema Matching Tough and What Can We Do About It? (Gal)](http://www.dit.unitn.it/~p2p/RelatedWork/Matching/p02-article-gal.pdf)
13. [Hong-Hai Do, Erhard Rahm (2006). Matching large schemas: Approaches and evaluation. Information Systems.](https://doi.org/10.1016/j.is.2006.09.002)
14. [Semantic schema matching / S-Match algorithms paper (Giunchiglia, Shvaiko, Yatskevich)](https://www.dai.ed.ac.uk/groups/ssp/members/openknowledge/Publications/Algorithms%20and%20Implementation.pdf)
15. [Yoonkyong Lee and colleagues (2006). eTuner: tuning schema matching software using synthetic scenarios. The VLDB Journal.](https://doi.org/10.1007/s00778-006-0024-z)
16. [Sheetrit, Eitam and colleagues (2024). ReMatch: Retrieval Enhanced Schema Matching with LLMs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2403.01567)
17. [Schema Matching with Large Language Models: an Experimental Study (VLDB TaDA 2024 workshop)](https://tabular-data-analysis.github.io/tada2024/papers/TaDA.8.pdf)
18. [Wang, Sha and colleagues (2025). LLMATCH: A Unified Schema Matching Framework with Large Language Models. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2507.10897)
19. [Data Integration: Schema Mapping (Chomicki, University at Buffalo lecture notes)](https://cse.buffalo.edu/~chomicki/636/main-mapping.pdf)
20. [Schema matching and mapping: from usage to evaluation (EDBT 2011 tutorial)](https://openproceedings.org/2011/conf/edbt/BonifatiV11.pdf)
21. [A Survey of Schema-based Matching Approaches (Journal on Data Semantics)](http://disi.unitn.it/~p2p/RelatedWork/Matching/JoDS-IV-2005_SurveyMatching-SE.pdf)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Databases and data systems › Database theory and data modeling › Schema and data modeling methods

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/schema-matching

English original: https://www.edgepedia.org/schema-matching
