计算机技术与发展2026,Vol.36Issue(1):24-30,7.DOI:10.20165/j.cnki.ISSN1673-629X.2025.0188
基于深度学习的编译型语言代码转换技术研究
Research on Compiler Language Code Conversion Technology Based on Deep Learning
摘要
Abstract
With the increasing demand for cross-platform and language diversity of software systems,automatic source code conversion technology has become a key research direction in modern software engineering.Traditional code conversion methods based on rules and statistical approaches are limited by problems such as small grammar coverage and weak semantic consistency,making it difficult to meet the requirements of large-scale and high-precision code migration.We focus on the code conversion task between compiled languages and propose an automatic code conversion method from Java to C++based on deep learning.This method integrates the Transformer encoder-decoding structure,syntactic tree modeling,hierarchical attention mechanism and pointer generation mechanism,which can sim-ultaneously capture the lexical and structural features of the source code and effectively handle the translation problem of unregistered identifiers.We conduct systematic experiments on the constructed Java-C++parallel dataset.The results show that the proposed model has increased the BLEU score by6.4 percentage points,the CodeBLEU score by4.7 percentage points,the exact matching rate by 5.7 percentage points,and the functional accuracy rate by 7.8 percentage points.It is significantly superior to the existing mainstream methods in multiple evaluation indicators.关键词
代码转换/编译型语言/Transformer/语法树/指针生成网络Key words
code conversion/compiled language/Transformer/syntax tree/pointer generation network分类
信息技术与安全科学引用本文复制引用
张明明,张富林,刘建戈,张鹏宇,洪涛..基于深度学习的编译型语言代码转换技术研究[J].计算机技术与发展,2026,36(1):24-30,7.基金项目
国家电网有限公司总部管理科技项目资助(5700-202418244A-1-1-ZN) (5700-202418244A-1-1-ZN)