Patents
Literature
Patsnap Eureka AI that helps you search prior art, draft patents, and assess FTO risks, powered by patent and scientific literature data.

69 results about "Code Translation" patented technology

An automated procedure that uses a specialized set of concept descriptors for conversion of the target concept descriptors into executable elements of other code systems with the equivalent semantics.

Large language models for creating a multi-lingual, low-resource code translation dataset

One or more unit-test cases are generated from a monolingual code corpus and the generated unit-test cases are filtered to generate a corpus of unit-test cases which have acceptability scores exceeding one or more predefined thresholds. One or more of the code samples of the monolingual code corpus are translated from a source language to a target language using a pretrained Large Language Model and the generated unit-test cases are translated from the source language to the target language. The LLM-translated code samples are validated using the translated unit-test cases and a parallel-data training corpus comprising the LLM-translated code samples that pass the validation is created. The pretrained large language model (LLM) is fine-tuned using the parallel-data training corpus, a given code segment is translated using the fine-tuned large language model (LLM), the translated given code segment is tested and the tested given code segment is deployed.
Owner:INTERNATIONAL BUSINESS MACHINE CORPORATION +1

Validation of code translation using intermediate representation

In some implementations, a code translation validation platform may convert source code, associated with a source application, to an intermediate representation that supports a source programing language and a target programing language. The code translation validation platform may identify metamorphic relations in the intermediate representation based on program constructs and program interactions. The code translation validation platform may generate test cases based on the identified metamorphic relations. The code translation validation platform may perform symbolic execution of the intermediate representation to generated test cases. The code translation validation platform may apply the generated test cases to the source programming language and to the target programming language.
Owner:INTERNATIONAL BUSINESS MACHINE CORPORATION

Neural network-based context-aware code translation and optimization

Systems and methods for efficiently translating program code from a source language to a target language. Input source code is parsed, using a processor device, into an Intermediate Representation (IR). A structural and semantic model of the source code are established by applying static analysis to the IR, and a program skeleton of the target code is constructed from the IR, including generating context-aware placeholders. The IR is transformed into a Single Static Assignment (SSA) form, and a System Dependency Graph (SDG) is built from the SSA form. The SDG is traversed to order translation tasks, and ordered tasks are translated into the target language using a Large Language Model (LLM). A translated program is generated by integrating translated code segments into a coherent program structure in the target language.
Owner:INTERNATIONAL BUSINESS MACHINE CORPORATION

Code translation method and system, electronic equipment and computer readable storage medium

The invention discloses a code translation method and system, electronic equipment and a computer readable storage medium, which are applied to a code translation model, and the code translation method comprises the following steps: generating an abstract syntax tree corresponding to a source code; segmenting the source code according to the code structure of the abstract syntax tree to obtain a plurality of code blocks; matching a corresponding code mapping relationship in a code mapping library; translating the plurality of code blocks into a plurality of target code blocks of a target code language according to a code mapping relationship; and compiling the plurality of target code blocks into target code in a target code language. According to the code translation model, the abstract syntax tree corresponding to the source code is firstly generated, then the whole source code is segmented into the multiple code blocks based on the abstract syntax tree, therefore, the whole task is segmented, then code translation is conducted through the code mapping relation in the code mapping library, the transfer speed and efficiency are improved, and the code translation efficiency is improved. And finally, compiling the plurality of translated target code blocks into a whole section of target code to ensure the integrity and accuracy of compiling.
Owner:DIGITAL CHINA FINANCIAL SOFTWARE LTD

Large language model code translation error detection

Large language model code translation error detection include receiving a code portion of a first programming language, and converting the code portion to a second programming language. A first accuracy of the converting of the code portion to the second programming language is calculated. A difference between the first accuracy and an historical accuracy of a conversion from the first programming language to the second programming language is determined. A potential error in the code portion of the first programming language is indicated based on the difference between the first accuracy and the historical accuracy being greater than a predetermined value is indicated.
Owner:INTERNATIONAL BUSINESS MACHINE CORPORATION

C-to-Rust code translation large model construction method based on intermediate representation

PendingCN119166162AMachine learningCode compilationCode TranslationFunctional semantics
The invention belongs to the field of software engineering, and particularly relates to a C-to-Rust code translation large model construction method based on intermediate representation, which can be used for constructing an efficient code translation large model so as to improve the efficiency of translating a C code into a Rust code. The method is mainly divided into two stages. Firstly, a large number of Rust codes are collected through software project hosting platforms such as Githaub and the like, and the Rust codes are converted into corresponding intermediate representations used for training a large model to achieve translation from the intermediate representations to the Rust codes. Then, C codes and Rust codes with the same functional semantics are collected, and the C codes are converted into corresponding intermediate representations, so that the large model is finely adjusted, and intermediate representation differences in the translation process from the C codes to the Rust codes are aligned; the method can be used for automatically translating codes written in a C language in a software project into Rust codes with the same functional semantics.
Owner:DALIAN UNIV OF TECH

Code translation method and device based on large language model

The invention discloses a code translation method and device based on a large language model, and the method comprises the steps: firstly executing an architecture understanding workflow, and forming an architecture design document O1 of a code library; according to the architecture design document O1 of the code library, in combination with the demand document P1, code translation task decomposition workflow is executed, and a task planning list O2 is formed; elements in the task planning list O2 are sequentially extracted, and the code debugging workflow is executed to complete code translation and debugging work. A warehouse-level code architecture understanding workflow, a code translation task planning workflow and a code debugging workflow are constructed based on a large language model (LLM), and the workflows are organically combined to realize automatic translation of warehouse-level codes. According to the method, the limitation of function level translation in the prior art can be broken through, automatic translation of warehouse level codes is realized, the development cost is greatly reduced, and the translation efficiency is improved.
Owner:ZHEJIANG LAB

Translation of vulnerable code to remediated code

A code translation apparatus receives a source code including one or more code vulnerabilities and automatically generates remediated code. The source code provided to the code translation apparatus is converted to a source directional graph. The edges of the source directional graph are augmented with additional edge attributes. The source directional graph thus augmented is further converted into a source graph vector representation. The source graph vector representation is provided to an encoder of a trained code transformer. The remediated code is obtained from the decoder of the trained code transformer.
Owner:ACCENTURE GLOBAL SOLUTIONS LTD

Code translation method based on tree instruction large language model

The invention belongs to the field of software engineering, and particularly relates to a code translation method based on a tree instruction large language model, which can be used for converting a source programming language into a target programming language. According to the method, key tree structure information is extracted from a linearized AST, and a similarity model is trained to align a tree structure with a code structure, so that a more accurate instruction data set is constructed, and the understanding ability of a large language model to an AST structure is improved; through combination with a large language model, human intervention is greatly reduced, and the code translation cost is greatly reduced; an additional function evaluation scheme is added, so that the friendliness of a translation result to a user result is improved; in addition, the method has high expandability, different large language models can be easily switched and used, the user experience can be improved, and the professional skill threshold needed by use is lowered.
Owner:DALIAN UNIV OF TECH +1

Standardizing enterprise software code through LLMs

A computer-implemented method and system standardize code patterns within enterprise software environments. A code modernization system utilizes a Large Language Model (LLM) and a specialized prompt library. The library includes pattern recognition prompts to guide the LLM in identifying specific code patterns within selected software code, potentially using enterprise-specific context. It also includes standardized solution prompts to guide the LLM in generating replacement code conforming to predefined enterprise standards for the identified patterns. The system orchestrates communication, transmitting code and relevant prompts to the LLM and receiving identified patterns and subsequently the generated standardized replacement code. This automated approach facilitates improved code quality, consistency, maintainability, and can support code translation efforts within the enterprise.
Owner:MORGAN STANLEY SERVICES GROUP INC

Program-oriented cross-processor architecture execution method and system, equipment and medium

The invention provides a program-oriented cross-processor architecture execution method and system, equipment and a medium, and is applied to the technical field of computers. The method comprises the steps of obtaining a target format file of a target program for a source platform, and extracting dependency library information and a dynamic symbol table of the target program from the target format file; associating each symbol with each dependency library by dereferencing each symbol in the dynamic symbol table to obtain an association relationship of each symbol in each dependency library; based on the dependency relationship between the dependency libraries and the incidence relationship of the symbols in each dependency library, determining the dependency relationship between the code blocks in the target program; and translating each code block in the target program based on a preset instruction mapping relationship and the dependency relationship between the code blocks, and executing a code translation result in the target platform. The problem that under different processor architectures, due to the problems of code version conflicts, code logic disorder, library missing and the like, programs cannot run stably and normally is solved.
Owner:CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +2

Large model code translation method and device fusing code functions and styles

The invention provides a large model code translation method and device fusing code functions and styles, and relates to the technical field of natural language processing. The method comprises the steps that code pairs composed of source codes and target codes are obtained from an online programming platform, the code pairs are processed according to similarity retrieval, fine granularity scoring and difference testing, and a function consistency data set is constructed; performing functional learning training on the large model according to the functional consistency data set and an instruction fine tuning method to obtain a large model subjected to functional learning training; obtaining a source code, generating positive sample translation and negative sample translation of the source code, and constructing a style-oriented data set; and according to the style-oriented data set, style learning training is carried out on the large model subjected to function learning training, and a trained code translation large model is obtained. According to the method, a low-cost and high-efficiency code translation model is developed around a large-scale language model, and the correctness and readability of translated codes are enhanced.
Owner:HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)

Java-to-Cangjie code translation method based on large model and compiling feedback

The invention discloses a Java-to-Cangjie code translation method based on a large model and compilation feedback, and particularly belongs to the technical field of software engineering program language processing, and the method comprises the following steps: step 1, performing structured semantic pre-training by constructing a grammar knowledge base of a target language, and injecting grammar prior knowledge of the target language; step 2, performing semantic enhanced supervision fine tuning training by constructing a high-quality data set containing semantic information, and enhancing semantic alignment and cross-language migration ability of the model; 3, introducing an AST structure perception embedded prompt mechanism in a parallel corpus supervision fine tuning training stage, and guiding the model to perform structure perception translation; and 4, establishing a compiler feedback repair loop, and iteratively correcting output based on error information to form a self-optimized closed-loop system. According to the method, an efficient training path is constructed, dependence on large-scale parallel corpora is effectively reduced, and an extensible and high-reliability technical path is provided for cross-language code translation of low-resource programming languages.
Owner:NANJING UNIV OF AERONAUTICS & ASTRONAUTICS

Warehouse level code translation method and device based on large model

The invention discloses a warehouse level code translation method and device based on a large model, and is used for solving the technical problem that the existing warehouse level code translation method only relates to a function translation pair, so that a code translation task in a warehouse level context is poor in performance. The method comprises the steps that a tree-shaped analyzer is utilized, a large model is preset, and a target language code sample self-evolution knowledge base, a dependent use example self-evolution knowledge base and a successful translation function pair self-evolution knowledge base are constructed according to an obtained open source project, a to-be-translated warehouse and a plurality of historical successful translation function pairs; and outputting the target triple translation knowledge corresponding to each to-be-translated function, and outputting a warehouse level code translation result in combination with the obtained implementation code corresponding to each to-be-translated function and the generated warehouse architecture.
Owner:SUN YAT SEN UNIV

Large language models for creating a multi-lingual, low-resource code translation dataset

One or more unit-test cases are generated from a monolingual code corpus and the generated unit-test cases are filtered to generate a corpus of unit-test cases which have acceptability scores exceeding one or more predefined thresholds. One or more of the code samples of the monolingual code corpus are translated from a source language to a target language using a pretrained Large Language Model and the generated unit-test cases are translated from the source language to the target language. The LLM-translated code samples are validated using the translated unit-test cases and a parallel-data training corpus comprising the LLM-translated code samples that pass the validation is created. The pretrained large language model (LLM) is fine-tuned using the parallel-data training corpus, a given code segment is translated using the fine-tuned large language model (LLM), the translated given code segment is tested and the tested given code segment is deployed.
Owner:INTERNATIONAL BUSINESS MACHINE CORPORATION +1

Systems, methods, and articles for code translation and program synthesis based on large language models

Technologies for code-to-code translation and program synthesis are disclosed. An example method includes analyzing input source code to generate dependency graphs corresponding to the input source code, creating a set of code generation tasks for generating target code based on the dependency graphs, and feeding the set of code generation tasks to a trained large language model (LLM) to generate one or more parts of the target code.
Owner:CODE METAL

Fuzzy testing method and device for closed source operating system

The invention belongs to the technical field of operating system security, and particularly discloses a fuzzy testing method and device for a closed source operating system, and the method comprises the steps: for a task in a target task set, in the process of executing a test case, when a TCG of virtualization software QEMU performs code translation on a translation block TB, performing code translation on the translation block TB by the TCG of the virtualization software QEMU; inserting the target intermediate code into the intermediate code translated by the TCG, wherein the target intermediate code is used for instruction tracking or vulnerability detection; and when the intermediate code is executed, obtaining test information of the closed source operating system through the target intermediate code. According to the method, the target intermediate code is inserted, so that when the intermediate code corresponding to the TB is executed, the target intermediate code is utilized to perform instruction tracking or vulnerability detection to obtain the test information, and the execution mode of the QEMU is switched into a hardware virtualization KVM mode for tasks except the target task set; fuzzy testing can be efficiently carried out on the closed source operating system.
Owner:HUAZHONG UNIV OF SCI & TECH +1

Code translation prompt augmented with compiled code candidates

PCT designated stage expiredWO2025102188A1Neural learning methodsCode compilationCode TranslationCompilation error
A prompt to a large language model for a source code translation of an input source code snippet written in a source programming language into a different target programming language is augmented with compiled code translations. The compiled code translations are identified from a ranked list of the top-k code candidates in the target programming language having a close similarity to an embedding of the input source code snippet. A reward model generates a reward score for each of the top-k code candidates which is used to identify the top-n code candidates having less compilation errors. The top-n code candidates are included in the prompt to the large language model to guide the model on the translation task.
Owner:MICROSOFT TECHNOLOGY LICENSING LLC

Program translation through code distillation

A source code translation system translates a source code snippet in an original source code programming language into distilled code that preserves the core semantics, logic flow, and data flow of the source code snippet in a language-independent format. The distilled code is then translated into a semantically-equivalent source code snippet in a different programming language by a decompiler. The decompiler is configured as a neural transformer model with attention pre-trained for translation using masked language modeling, denoising auto-encoding and multilingual program generation. The decompiler translates the distilled code into one of several different high-level programming languages.
Owner:MICROSOFT TECHNOLOGY LICENSING LLC

Deployment method and system of large model in power grid field

The invention belongs to the technical field of large model deployment in the power grid field, and provides a large model deployment method and system in the power grid field. The deployment method of the large model in the power grid field comprises the following steps of: based on single parameter memory overhead, single gradient memory overhead, single optimizer state memory overhead, model parameter quantity and data parallelism; according to the relationship between parameters such as the number of working nodes in model parallelism and pipeline parallelism and the memory overhead in the parallel decomposition strategy of calculation and storage collaboration, the parallel decomposition strategy of calculation and storage collaboration with the minimum memory overhead is calculated, and the parallel decomposition strategy of the large model in the power grid field is determined; on the basis of a parallel decomposition strategy of a large model in the power grid field, hardware resource allocation is automatically performed by using hyper-parameter input hardware equipment information and a deep learning framework, then deep learning model structure setting and parallel decomposition scheme configuration are performed by using guidance statements, automatic code translation is completed, and automatic conversion and training of a deep learning model are realized.
Owner:SHANDONG LUNENG SOFTWARE TECH

Deployment method and system of large model in power grid field

The invention belongs to the technical field of large model deployment in the power grid field, and provides a large model deployment method and system in the power grid field. The deployment method of the large model in the power grid field comprises the following steps of: based on single parameter memory overhead, single gradient memory overhead, single optimizer state memory overhead, model parameter quantity and data parallelism; according to the relationship between parameters such as the number of working nodes in model parallelism and pipeline parallelism and the memory overhead in the parallel decomposition strategy of calculation and storage collaboration, the parallel decomposition strategy of calculation and storage collaboration with the minimum memory overhead is calculated, and the parallel decomposition strategy of the large model in the power grid field is determined; on the basis of a parallel decomposition strategy of a large model in the power grid field, hardware resource allocation is automatically performed by using hyper-parameter input hardware equipment information and a deep learning framework, then deep learning model structure setting and parallel decomposition scheme configuration are performed by using guidance statements, automatic code translation is completed, and automatic conversion and training of a deep learning model are realized.
Owner:SHANDONG LUNENG SOFTWARE TECH

C-to-Rust code translation method and system and medium

The invention provides a translation method and system from a C code to a Rust code and a medium. The method comprises the following steps that a powerful basic model with code translation, grammar understanding and error repairing capacity at the same time is built based on a multi-task strengthening alignment grammar tuning training method; and performing multi-round correction on the basic model by depending on a guided consistency iterative optimization translation framework to ensure the correctness and functional consistency of translation grammar from the C language project to the Rust code. Compared with the prior art, the automation level and the final quality of code translation are improved.
Owner:HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN) +1

Method, system, and computer-readable program (neural network-based context-aware code translation and optimization)

To efficiently translate program code from a source language to a target language.SOLUTION: Input source code is parsed, using a processor device, into an Intermediate Representation (IR). A structural and semantic model of the source code are established by applying static analysis to the IR, and a program skeleton of the target code is constructed from the IR, including generating context-aware placeholders. The IR is transformed into a Single Static Assignment (SSA) form, and a System Dependency Graph (SDG) is built from the SSA form. The SDG is traversed to order translation tasks, and the ordered tasks are translated into the target language using a Large Language Model (LLM). A translated program is generated by integrating translated code segments into a coherent program structure in the target language.SELECTED DRAWING: Figure 6
Owner:INTERNATIONAL BUSINESS MACHINE CORPORATION

Wechat applet source code generation method based on WXCL and storage medium

According to the WXCL-based WeChat applet source code generation method and the storage medium, an intermediate code WXCL language capable of describing a WeChat applet structure is adopted, the intermediate code WXCL language is set based on a WeChat applet platform, and the method comprises the steps of setting a lexical and linguistic definition formula, a lexical analyzer, a syntactic analyzer and a translation program from the WXCL language to a target code; the generation module is used for generating final WeChat applet codes; the system further comprises a back-end code translation system, and translation software of the WXCL language is deployed in a server background to translate the WXCL language into a WeChat applet source code in real time and send the WeChat applet source code to a user. The high cost performance of the method is reflected in that the learning cost of the user is extremely low, the time is extremely short, and the effect is relatively good, so that the problems of complex structure, high learning threshold and high time cost of the WeChat applet development for the common user are solved.
Owner:NANJING UNIV OF POSTS & TELECOMM

A large model code translation method and device fusing code functions and styles

The application provides a large model code translation method and device fusing code functions and styles, and relates to the technical field of natural language processing. The method comprises the following steps: obtaining a code pair composed of a source code and a target code from an online programming platform, processing the code pair according to similarity retrieval, fine-grained scoring and differential testing, and constructing a function consistency dataset; performing function learning training on a large model according to the function consistency dataset and an instruction fine-tuning method to obtain the large model trained through the function learning training; obtaining the source code, generating positive sample translation and negative sample translation of the source code, and constructing a style guide dataset; and performing style learning training on the large model trained through the function learning training according to the style guide dataset to obtain a trained code translation large model. The application develops a low-cost and high-efficiency code translation model around a large-scale language model, and enhances the correctness and readability of translated codes.
Owner:HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)

Macro script conversion system and method, electronic device, medium, and program product

PCT designated stageWO2025231664A1Source to sourceCode generationCode Translation
Embodiments of this application mainly relate to the field of industrial digitization, and in particular, to a macro script conversion system and method, an electronic device, a medium, and a program product. A receiving module is configured to receive a first macro script, a name of source software, and a name of target software inputted by a user, where the first macro script includes a macro script of the source software. A code translation agent module is configured to convert the first macro script into corresponding natural language and pseudocode. A code generation agent module is configured to create a macro script corresponding to the name of the target software based on the natural language and the pseudocode.
Owner:SIEMENS AG +1

Generation method and device of malicious code semantic analysis model and storage medium

The invention provides a malicious code semantic analysis model generation method and device and a storage medium, and belongs to the field of network security, and the method comprises the steps: translating an original assembly code into a C code based on a semantic mapping process function in a large language model, and reversely compiling the C code into a new assembly code based on a GCC compiler; performing iterative solution on the large language model based on the similarity between the original assembly code and the new assembly code to obtain a semantic consistency evaluation model; preprocessing data obtained after preprocessing assembly codes to be trained are input into the semantic consistency evaluation model, and text semantic information is obtained; and based on the text semantic information, constructing a training set, and inputting the training set into a hybrid model formed by sequentially connecting a BERT model, an LSTM model, a maximum pooling layer and a linear layer for training to obtain a malicious code semantic analysis model. According to the invention, the problems of low identification efficiency and high false alarm rate of a malicious code identification method can be solved.
Owner:HUBEI UNIV OF TECH

Heterogeneous code translation method, apparatus, device, and medium

This application provides a method, apparatus, device, and medium for heterogeneous code translation. The method includes: acquiring heterogeneous source code running on a source heterogeneous hardware system; compiling the heterogeneous source code to generate an intermediate representation of the source heterogeneous hardware system; mapping the intermediate representation of the source heterogeneous hardware system to obtain an LLVM intermediate representation; and mapping the LLVM intermediate representation to obtain RISC-V extended code, which is used to run on a target hardware system. This application improves the compatibility between code and target hardware systems.
Owner:BEIJING ZHONGKE JIAHE INTELLIGENT TECHNOLOGY CO LTD

Method and system for machine learning based understanding of data elements in mainframe program code

Most of the existing production applications in different domains are still running on. Mainframe applications in production receive data from various resources and process these data within. Understanding the structure of input data and output data is extremely important. A method and system for machine learning based understanding of a plurality of data elements in a mainframe program code has been provided. The method discloses a machine learning model that understands the structure of data elements in a Mainframe program code. The model considered is a graph neural network based architecture model. The disclosed method replicates memory mapping happening in the application program environment. The method understands the structure of the data element and the impact created by each data element on other data elements in the application and interfacing applications. The disclosed solution serves as a building block in problems such as code translation, reverse engineering etc.
Owner:TATA CONSULTANCY SERVICES LTD

Application program running method and device, electronic equipment and storage medium

The invention discloses an application program running method and device, electronic equipment and a storage medium, and the method comprises the steps: translating a code of an application program into a first instruction and / or a second instruction; the first instruction is based on a first instruction set architecture and a data model is the same as a data model of a code of the application program; the second instruction is obtained based on the first instruction set architecture and through binary translation; compiling the code of the first shared library into a third instruction; the first shared library is a shared library of an operating system of the electronic equipment, the third instruction is based on a first instruction set architecture, and a data model is the same as a data model of a code of the application program; and executing the first instruction and / or the second instruction, and executing the third instruction to run the application program. According to the method, the binary translation range of the application program is reduced, the resource occupation of instruction expansion and instruction translation is reduced, and the compatibility of the translated instruction is improved.
Owner:HUAWEI TECH CO LTD