一句话:提出 ReinforceORM,用强化学习搜索 ORM Schema 的多目标帕累托最优解,并以 Alloy 形式验证保证正确性。
传统 ORM 框架只生成单一方案,难以在性能与存储间取得最优折衷,穷举设计空间分析对真实系统不可行。ReinforceORM 将 ORM Schema 合成建模为多目标优化,用多种强化学习算法搜索映射策略,平衡插入时间、查询性能与存储开销,并用 Alloy 形式分析对有界结构与语义正确性进行验证。在 15 个真实系统上,它发现超过 80% 的真实帕累托最优 ORM 配置,较 Hibernate、Django ORM、SQLAlchemy 和 Entity Framework 等框架提升约 18 倍;相比规范驱动搜索,运行时和内存分别降低约 4 个和 5 个数量级,且解质量接近最优。
Object-relational mapping (ORM) frameworks are widely used to bridge object-oriented models and relational databases, but conventional tools generate only single point solutions and often miss optimal trade-offs between performance and storage consumption. Exhaustive tradespace analysis can discover Pareto-optimal database designs, but it is computationally prohibitive for realistic systems. This paper introduces ReinforceORM, an automated and scalable framework that formulates ORM schema synthesis as a multi-objective optimization problem solved via reinforcement learning with formal verification. Our approach integrates multiple RL algorithms to efficiently search the vast space of mapping strategies, balancing insertion time, query performance, and storage consumption, while employing Alloy-based formal analysis to provide bounded verification of structural and semantic correctness in generated schemas. Evaluation across fifteen diverse, real-world software systems shows that ReinforceORM identifies over 80% of ground-truth Pareto-optimal ORM configurations—an 18-fold improvement over leading ORM frameworks such as Hibernate, Django ORM, SQLAlchemy, and Entity Framework. Compared to state-of-the-art specification-driven search, ReinforceORM reduces analysis runtime and memory usage by four and five orders of magnitude, respectively, while maintaining near-optimal solution quality.