arXiv:2508.07486cs.SEcs.AI2025-08被引 1

用软聚类方法从单体代码中提取重叠微服务,提升系统结构质量。

Extracting Overlapping Microservices from Monolithic Code via Deep Semantic Embeddings and Graph Neural Network-Based Soft Clustering

  • 将微服务提取建模为软聚类,允许组件归属多个服务
  • 在4个基准上实现最高40.97%的结构模块化提升
  • 适合关注系统解耦与部署灵活性的开发者

现代软件系统正从单体架构转向微服务以提升可扩展性、可维护性和部署灵活性。现有微服务提取方法通常依赖硬聚类,将每个组件唯一分配给一个服务,常导致服务间耦合增加、内部凝聚力下降。我们提出Mo2oM(Monolithic to Overlapping Microservices)框架,将微服务提取视为软聚类问题,允许组件以概率方式归属多个微服务。该思路受专家实践启发:有意复制某些组件以减少通信开销。Mo2oM结合深度语义嵌入与方法调用图提取的结构依赖,捕捉功能与架构关系,再通过基于图神经网络的软聚类算法生成最终微服务集。我们在四个开源单体基准上评估了Mo2oM,对比八种先进基线。结果表明,Mo2oM在所有基准上实现最高40.97%的结构模块化提升(平衡内聚与耦合)、58%的跨服务调用占比(通信开销)、26.16%的接口数量减少(模块化与解耦)以及38.96%的非极端分布(服务大小均衡)。

原文摘要 · Abstract (English)

Modern software systems are increasingly shifting from monolithic architectures to microservices to enhance scalability, maintainability, and deployment flexibility. Existing microservice extraction methods typically rely on hard clustering, assigning each software component to a single microservice. This approach often increases inter-service coupling and reduces intra-service cohesion. We propose Mo2oM (Monolithic to Overlapping Microservices), a framework that formulates microservice extraction as a soft clustering problem, allowing components to belong probabilistically to multiple microservices. This approach is inspired by expert-driven decompositions, where practitioners intentionally replicate certain software components across services to reduce communication overhead. Mo2oM combines deep semantic embeddings with structural dependencies extracted from methodcall graphs to capture both functional and architectural relationships. A graph neural network-based soft clustering algorithm then generates the final set of microservices. We evaluate Mo2oM on four open-source monolithic benchmarks and compare it against eight state-of-the-art baselines. Our results demonstrate that Mo2oM achieves improvements of up to 40.97% in structural modularity (balancing cohesion and coupling), 58% in inter-service call percentage (communication overhead), 26.16% in interface number (modularity and decoupling), and 38.96% in non-extreme distribution (service size balance) across all benchmarks.

微服务软聚类代码分析图神经网络

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。