WO2020206840A1 - 代码翻译方法、装置、计算机设备和存储介质 - Google Patents
代码翻译方法、装置、计算机设备和存储介质 Download PDFInfo
- Publication number
- WO2020206840A1 WO2020206840A1 PCT/CN2019/091851 CN2019091851W WO2020206840A1 WO 2020206840 A1 WO2020206840 A1 WO 2020206840A1 CN 2019091851 W CN2019091851 W CN 2019091851W WO 2020206840 A1 WO2020206840 A1 WO 2020206840A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- code
- translated
- segment
- corrected
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/52—Binary to binary
Definitions
- This application relates to a code translation method, device, computer equipment and storage medium.
- a code translation method, device, computer equipment, and storage medium are provided.
- a code translation method applied to a code server comprising:
- the analysis result set to be translated obtained by analyzing and processing the source code file to be translated; the analysis result set to be translated includes the code segment to be translated and the corresponding segment positioning information;
- the translator system Invoking the translator interface provided by the translator system, the translator system is deployed on the translation server, and the code segment to be translated is translated by the translation system to obtain the translated code segment;
- the target translation detail report contains target correction items
- Correction processing is performed on the source code file to be corrected according to the segment positioning information corresponding to the target correction item, and a corrected source code file is generated.
- a code translation device including:
- the obtaining module is used to obtain the analysis result set to be translated obtained by analyzing and processing the source code file to be translated; the analysis result set to be translated includes the code segment to be translated and the corresponding segment positioning information;
- the translation module is used to call the translator interface provided by the translator system, the translator system is deployed on the translation server, and the code fragment to be translated is translated by the translation system to obtain the translated code fragment;
- the replacement module is used to perform replacement processing on the source code file to be translated according to the segment location information corresponding to the translated code segment to generate the source code file to be corrected;
- the correction module is used to obtain the target translation detail report input for the source code file to be corrected; the target translation detail report contains the target correction item; and the source code to be corrected is corrected according to the segment positioning information corresponding to the target correction item
- the code file is corrected and the corrected source code file is generated.
- a computer device includes a memory and one or more processors.
- the memory stores computer-readable instructions.
- the computer-readable instructions are executed by the one or more processors, the one or more Each processor performs the following steps:
- the analysis result set to be translated obtained by analyzing and processing the source code file to be translated; the analysis result set to be translated includes the code segment to be translated and the corresponding segment positioning information;
- the translator system Invoking the translator interface provided by the translator system, the translator system is deployed on the translation server, and the code segment to be translated is translated by the translation system to obtain the translated code segment;
- the target translation detail report contains target correction items
- Correction processing is performed on the source code file to be corrected according to the segment positioning information corresponding to the target correction item, and a corrected source code file is generated.
- One or more non-volatile computer-readable storage media storing computer-readable instructions, which when executed by one or more processors, cause the one or more processors to perform the following steps:
- the analysis result set to be translated obtained by analyzing and processing the source code file to be translated; the analysis result set to be translated includes the code segment to be translated and the corresponding segment positioning information;
- the translator system Invoking the translator interface provided by the translator system, the translator system is deployed on the translation server, and the code segment to be translated is translated by the translation system to obtain the translated code segment;
- the target translation detail report contains target correction items
- Correction processing is performed on the source code file to be corrected according to the segment positioning information corresponding to the target correction item, and a corrected source code file is generated.
- Fig. 1 is an application scenario diagram of a code translation method according to one or more embodiments
- Figure 2 is a schematic flowchart of a code translation method according to one or more embodiments
- Figure 3 is a schematic flowchart of a code translation method in another embodiment
- Figure 4 is a structural block diagram of a code translation device according to one or more embodiments.
- Fig. 5 is an internal structure diagram of a computer device according to one or more embodiments.
- the code translation method provided in this application can be applied to the application environment as shown in FIG. 1.
- the code server 102 and the translation server 104 communicate through the network.
- the code server 102 and the translation server 104 can be implemented by independent servers or a server cluster composed of multiple servers.
- the code server 102 analyzes and processes the source code file to be translated, it can obtain a to-be-translated analysis result set containing the to-be-translated code segment and the corresponding segment location information.
- the code server 102 can call the translator interface to send the translated code segment to the translation server 104 corresponding to the translator for translation, and obtain the translated code segment.
- the code server 102 After the code server 102 receives the translated code fragment returned by the translation server 104, it can perform replacement processing on the source code file to be translated according to the fragment location information corresponding to the translated code fragment to generate the source code file to be corrected. After obtaining the target translation detail report input for the source code file to be corrected, the code server 102 may also perform correction processing on the source code file to be corrected according to the target correction items included in the target translation detail report, and generate a corrected source code file.
- a code translation method is provided. Taking the method applied to the code server 102 in FIG. 1 as an example for description, the method includes the following steps:
- Step 202 Obtain an analysis result set to be translated obtained by analyzing and processing the source code file to be translated; the analysis result set to be translated includes the code segment to be translated and corresponding segment location information.
- the source code file to be translated refers to the source code file that needs to be translated.
- Source code files refer to uncompiled text files written in accordance with certain programming language specifications.
- the source code file to be translated can be pre-stored in the database of the code server, and the code server can directly obtain the source code file to be translated from the local database; the code server can also receive the code file to be translated uploaded by the terminal or the source code to be translated sent by other servers file.
- the analysis result set to be translated refers to a set of analysis results to be translated corresponding to a plurality of code fragments to be translated, which is obtained after analyzing the source code file to be translated.
- the analysis result to be translated includes the code fragment to be translated in the source code file to be translated and related information.
- the analysis result set to be translated may contain one or more code fragments to be translated.
- the segment location information refers to the location information of the code segment to be translated in the source code file to be translated.
- the corresponding segment location information can be divided in the code to be processed where the code segment to be translated is located.
- a specific grammar code segment to be translated corresponds to a specific start character string and end character string, and the start positioning information of the start character string in the code to be processed and the end character string in the code to be processed can be detected respectively. End positioning information, and use the start positioning information and the end positioning information as segment positioning information.
- Step 204 call the translator interface to translate the code fragment to be translated, and obtain the translated code fragment.
- Translator interface refers to the interface provided by the translator system that can be used to implement translation functions by calling.
- the translator system can be deployed on the translation server.
- the translator system includes but is not limited to one or more of Baidu Translator or Google Translator.
- the translator system can translate the to-be-translated code segment into a corresponding translated code segment of the target language type based on the translation strategy.
- the target language types include but are not limited to one or more of Chinese, Khmer, Vietnamese, Burmese, and Lao.
- a translation request may be generated according to each code segment to be translated, and sent to the translation server for translation through the translator interface one by one. It is also possible to generate a translation request based on multiple code fragments to be translated, and realize the translation processing of multiple code fragments to be translated at one time, so as to reduce the number of calls of the overall translation request and improve the execution stability of the translation of multiple code fragments to be translated.
- Step 206 Perform replacement processing on the source code file to be translated according to the segment location information corresponding to the translated code segment, and generate the source code file to be corrected.
- the corresponding code segment to be translated can be found in the source code file to be translated, so that the corresponding translated code segment can be replaced with the corresponding code segment to be translated.
- the source code file to be translated may contain multiple code fragments to be translated, and the translated source code file can be obtained after it is detected that all the code fragments to be translated in the source code file to be translated have been replaced. Rewriting the translated source code file can generate a source code file to be corrected.
- Step 208 Obtain a target translation detail report input for the source code file to be corrected; the target translation detail report contains target correction items.
- the target translation detail report refers to a report that records the specific translation details of the translated source code file after the translation of the source code file to be translated, and the specific translation details that need to be corrected.
- the target translation detail report may contain multiple target correction items, and one target correction item corresponds to a code segment to be corrected in the source code file to be corrected.
- Each target correction project includes code fragments to be corrected, code fragments after correction, fragment location information, and context code fragments.
- Step 210 Perform correction processing on the source code file to be corrected according to the segment location information corresponding to the target correction item, and generate the corrected source code file.
- the source code file to be corrected can be found in the source code file to be corrected to be corrected, so as to correct the located code to be corrected based on the target correction project The segment is corrected. After correcting all the code fragments to be corrected in the source code file to be corrected, the corrected source code file can be generated.
- the code server after the code server analyzes and processes the source code file to be translated, it can obtain the to-be-translated analysis result set containing the to-be-translated code segment and the corresponding segment location information.
- the code server can call the translator interface to send the translated code fragment to the translation server corresponding to the translator for translation, and obtain the translated code fragment.
- the source code file to be translated After receiving the translated code fragment, the source code file to be translated can be replaced according to the fragment location information corresponding to the translated code fragment to generate the source code file to be corrected.
- the source code file to be corrected After obtaining the target translation detail report input for the source code file to be corrected, the source code file to be corrected can be corrected according to the target correction items contained in the target translation detail report to generate the corrected source code file.
- obtaining the analysis result set to be translated obtained by analyzing the source code file to be translated includes: obtaining the source code file to be translated; reading the source code directory in the source code file to be translated; and the source code to be translated
- the directory contains multiple initial file names; the initial code subfile corresponding to each initial file name is traversed to filter out the code subfile to be translated; the code subfile to be translated matches the preset language type, and the code subfile to be translated contains Translate code fragments; find a parser that matches the preset language type; use the parser to analyze and process the sub-files of the code to be translated to generate a set of analysis results to be translated.
- the source code directory refers to a directory that stores the initial file names of multiple initial code sub-files.
- the initial code sub-file refers to the source code file with the smallest granularity among the source code files to be translated and cannot be further expanded.
- the code sub-file to be translated refers to the initial code sub-file that matches the preset language type and needs to be translated into the target language type.
- the sub-file of the code to be translated contains the code fragment to be translated.
- a plurality of parsers corresponding to various preset language types can be pre-installed in the code server, and the sub-files of the code to be translated are processed through the matched parsers.
- the parser can be an independent application or a plug-in running under a specific system platform.
- the parser can be Babel parser (a JavaScript source code parser).
- Different parsers can also be preset for the sub-files of the code to be translated in different file formats.
- multiple parser sets corresponding to the file format type of the code sub-file to be translated can be searched for from Search the parser that matches the preset language type of the sub-file of the code to be translated in the set of parsers. For example, you can target the sub-files of the code to be translated with the suffixes ".js" (JavaScript, a literal scripting language) and ".jsx” (JavaScript XML, an XML-like syntax that builds tags inside React components). Different parsers are preset. Specific analysis processing is performed through a specific parser for sub-files of the source code to be translated that belong to different types, which can make the analysis result more accurate.
- traversing the initial code subfiles corresponding to each initial file name to filter out the code subfiles to be translated includes: obtaining regular expressions corresponding to multiple preset language types; traversing each initial file name The corresponding initial code sub-file is matched with each initial code sub-file through regular expressions; the preset language type matched by each initial code sub-file is determined according to the matched regular expression; any one of the preset languages is filtered out The initial code subfile of the type is used as the code subfile to be translated.
- Regular expression is a kind of logical formula for string manipulation. It uses some pre-defined specific characters and the combination of these specific characters to form a "rule string". This "rule string" can be used to express the right characters. A filtering logic for strings. Each preset language type has a corresponding one or more regular expressions. Through regular expressions, you can know whether there are any code fragments to be translated that need to be translated, so as to avoid errors that do not contain the code to be translated. The initial code sub-file of the segment is parsed, reducing the workload of parsing and improving parsing efficiency.
- the analysis result set to be translated also contains the contextual code fragments corresponding to the code fragments to be translated
- the translator interface is called to translate the code fragments to be translated to obtain the translated code fragments, including: finding matches with the code fragments to be translated
- the code processor through the code processor, according to the context code fragment, identify the target language type and translation strategy of the code fragment to be translated; call the translator interface through the code processor to obtain the target corresponding to the code fragment to be translated based on the translation strategy
- the translated code snippet of the language type is called to translate the code fragments to be translated to obtain the translated code fragments, including: finding matches with the code fragments to be translated
- the code processor through the code processor, according to the context code fragment, identify the target language type and translation strategy of the code fragment to be translated
- call the translator interface through the code processor to obtain the target corresponding to the code fragment to be translated based on the translation strategy
- the translated code snippet of the language type is called to translate the code fragments to be translated to obtain the translated code fragments
- the code processor refers to a processor used to perform operations such as grammar recognition, risk recognition, translation processing, and status labeling of the code segment to be translated.
- Different code processors can be set in advance for the code segments to be translated in different programming language types, so that the code processors can perform accurate operations on the code segments to be translated in a more targeted manner, so as to achieve more accurate code segment translation.
- the code processor can analyze the syntax of the code segment to be translated in combination with the context code segment, so as to identify the translation strategy corresponding to the code segment to be translated.
- Different translation strategies can be preset for different code fragments to be translated. Translation strategies include whether to perform replacement operations, and perform different translation operations for code fragments to be translated corresponding to different grammars.
- the obtained contextual code fragments can be used for grammatical analysis of the translated code fragments more accurately.
- searching for a code processor that matches the code segment to be translated includes: identifying the programming language type of the code segment to be translated; searching for a set of code processors corresponding to the programming language type; and comparing the code segment to be translated with the code The matching condition corresponding to each code processor in the processor set is matched; the code processor corresponding to the matched matching condition is used as the code processor that matches the code segment to be translated.
- a corresponding set of code processors can be predefined.
- Types of programming languages include but are not limited to JS (JavaScript), JSX (JavaScript XML, an XML-like grammar that builds tags inside React components), etc., and are not limited to this.
- Each code processor has custom matching conditions.
- the matching conditions include, but are not limited to, the condition that the code segment to be translated relates to the type of character string, the condition that the code segment to be translated relates to business logic, and the condition that the code segment to be translated relates to the configuration item attributes in the configuration file, but is not limited to this.
- a code processor that matches the translated code fragment can be found from the set of code processors.
- obtaining the target translation detail report input for the source code file to be corrected includes: generating an initial translation detail report according to the code fragment to be translated and the corresponding context code fragment, the translated code fragment and the fragment location information; Based on the corrected code snippets entered in the initial translation detail report; each to-be-corrected code snippet and the corresponding corrected code snippet are regarded as the target correction project; the target translation detail report is generated according to multiple target correction projects.
- the initial translation detail report refers to the report that records the translation details obtained through automatic translation processing of the source code file to be translated.
- Translation details include, but are not limited to, the code segment to be translated and the corresponding context code segment, the translated code segment, and segment location information.
- Developers can enter corrected code snippets based on the translation details in the initial translation details report.
- the code fragment to be corrected refers to the code fragment in the source code file to be corrected that is incorrectly translated and needs to be corrected. Developers can mark the translated code fragments that need to be corrected as code fragments to be corrected.
- the corrected code fragment refers to the code fragment used to correct the code fragment to be corrected.
- Developers do not need to open the source code file to be corrected, only need to report according to the target translation details, and can manually check the translated code snippets by consulting the context code snippets, so that the code to be corrected can be screened out more accurately from the translated code snippets Fragments reduce the time for developers to browse and find code.
- the code fragment to be corrected and the corresponding corrected code fragment corresponding to each target correction item in the target translation detail report when there are multiple target correction items, extract the code fragment to be corrected and the corresponding corrected code fragment corresponding to each target correction item in the target translation detail report; corresponding to each target correction item Find the to-be-corrected code snippet in the source code file to be corrected; replace the to-be-corrected code snippet in the source code file to be corrected with the corresponding corrected code snippet; when the execution is detected, it corresponds to all target correction items During the correction process, the source code file to be corrected after the correction process is rewritten to obtain the corrected source code file.
- the initial translation detail report may also include a risk level corresponding to each translated code segment.
- Risk levels include, but are not limited to, low risk levels, potential risk levels, and high risk levels.
- the code segment to be translated can be marked as a high risk level. Or when a code processor that matches the code segment to be translated is not found, the code segment to be translated can be marked as a high risk level. Developers can focus on the verification of translated code fragments with high risk levels to quickly determine the code fragments to be corrected, and input the corrected code fragments for the code fragments to be corrected.
- receiving the corrected code segment input based on the code segment to be corrected and the corresponding segment location information includes: obtaining a code jump instruction; the code jump instruction corresponds to the code segment to be corrected; based on the code jump Instruction to obtain the code file to be corrected to which the code segment to be corrected belongs; jump to display the source code file to be corrected according to the segment location information corresponding to the code segment to be corrected; detect the code correction operation acting on the displayed source code file to be corrected; extract Corrected code fragments based on code correction operations.
- the developer can trigger the code jump instruction, and the code server can jump based on the code
- the transfer instruction opens and displays the source code file to be corrected according to the segment location information, and jumps to the part containing the uncertain code segment to be corrected.
- the code server may also mark the part of the code fragment to be corrected in the source code file to be corrected, so that the developer can quickly browse the context fragment of the code fragment to be corrected, so as to perform code correction operations on the source code file to be corrected.
- the code correction operation can be that the developer directly modifies the source code file to be corrected, and the code server can compare the source code file to be corrected before and after the modification, and extract the code fragment to be corrected and the corrected code fragment. It can also be that the developer selects the part that needs to be modified in the source code file to be corrected as the code fragment to be corrected, so that the developer can input the corrected code fragment in the corresponding position of the target translation detail report.
- the fast code jump saves developers the time to find the code fragments to be corrected in the source code files to be corrected, thereby improving the efficiency of generating target translation detail reports.
- FIG. 3 another code translation method is provided. Taking the method applied to the code server 102 in FIG. 1 as an example, the method includes the following steps:
- Step 302 Obtain the source code file to be translated.
- Step 304 Read the source code directory in the source code file to be translated; the source code directory to be translated contains multiple initial file names.
- Step 306 traverse the initial code subfile corresponding to each initial file name, and filter out the code subfile to be translated; the code subfile to be translated matches the preset language type, and the code subfile to be translated contains the translated code fragments.
- Step 308 Search for a parser matching the preset language type.
- step 310 the code sub-file to be translated is parsed by the parser to generate an analysis result set to be translated; the analysis result set to be translated includes the code segment to be translated and the corresponding segment location information and context code segment.
- Step 312 Find a code processor that matches the code segment to be translated.
- step 314 the code processor identifies the target language type and translation strategy of the code segment to be translated according to the context code segment.
- step 316 the translator interface is invoked by the code processor to obtain the translated code fragments of the target language type corresponding to the code fragments to be translated based on the translation strategy.
- step 318 the source code file to be translated is replaced according to the segment location information corresponding to the translated code segment to generate the source code file to be corrected.
- Step 320 Generate an initial translation detail report based on the code segment to be translated and the corresponding context code segment, the translated code segment, and segment location information.
- Step 322 Obtain corrected code fragments input based on the initial translation detail report.
- Step 324 Use each code segment to be corrected and the corresponding corrected code segment as a target correction item.
- Step 326 Generate a target translation detail report based on multiple target correction items.
- Step 302 Perform correction processing on the source code file to be corrected according to the segment location information corresponding to the target correction item, and generate the corrected source code file.
- the code server after the code server analyzes and processes the source code file to be translated, it can obtain the to-be-translated analysis result set containing the to-be-translated code segment and the corresponding segment location information.
- the code server can call the translator interface to send the translated code fragment to the translation server corresponding to the translator for translation, and obtain the translated code fragment.
- the source code file to be translated After receiving the translated code fragment, the source code file to be translated can be replaced according to the fragment location information corresponding to the translated code fragment, the source code file to be corrected is generated, and an initial translation detail report can be obtained.
- the comprehensiveness, uniformity and reliability of the code translation can be ensured, thereby improving the efficiency of code translation.
- a code translation device 400 which includes: an acquisition module 402, configured to acquire a set of analysis results to be translated obtained by analyzing and processing source code files to be translated;
- the result set contains the code fragment to be translated and the corresponding fragment location information;
- the translation module 404 is used to call the translator interface to translate the code fragment to be translated to obtain the translated code fragment;
- the replacement module 406 is used to follow the fragment corresponding to the translated code fragment
- the location information performs replacement processing on the source code file to be translated to generate the source code file to be corrected;
- the correction module 408 is used to obtain the target translation detail report input for the source code file to be corrected;
- the target translation detail report contains the target correction items; according to the target
- the segment location information corresponding to the corrected project is corrected for the source code file to be corrected, and the corrected source code file is generated.
- the obtaining module 402 is also used to obtain the source code file to be translated; read the source code directory in the source code file to be translated; the source code directory to be translated contains multiple initial file names; The initial code sub-file corresponding to the file name, filter out the code sub-file to be translated; the code sub-file to be translated matches the preset language type, and the code sub-file to be translated contains the translation code fragment; finds the analysis that matches the preset language type
- the parser is used to analyze and process the sub-files of the code to be translated to generate the analysis result set to be translated.
- the obtaining module 402 is also used to obtain regular expressions corresponding to multiple preset language types; traverse the initial code sub-files corresponding to each initial file name, and use the regular expression to compare each initial code sub-file. The file is matched; the preset language type matched by each initial code subfile is determined according to the matched regular expression; the initial code subfile containing any one of the preset language types is screened out as the code subfile to be translated.
- the analysis result set to be translated also includes context code fragments corresponding to the code fragments to be translated
- the translation module 404 is also used to find a code processor that matches the code fragments to be translated
- Fragment identifies the target language type and translation strategy of the code fragment to be translated
- the translator interface is called through the code processor to obtain the translated code fragment of the target language type corresponding to the code fragment to be translated based on the translation strategy.
- the translation module 404 is also used to identify the programming language type of the code segment to be translated; to find the code processor set corresponding to the programming language type; to compare the code segment to be translated with each code in the code processor set The matching condition corresponding to the processor is matched; the code processor corresponding to the matched matching condition is used as the code processor matching the code segment to be translated.
- the correction module 408 is also used to generate an initial translation detail report based on the code segment to be translated and the corresponding context code segment, translated code segment, and segment location information; and obtain the corrected code input based on the initial translation detail report Fragments; take each code fragment to be corrected and the corresponding corrected code fragment as the target correction project; generate target translation detail reports based on multiple target correction projects.
- the correction module 408 is also used to obtain a code jump instruction; the code jump instruction corresponds to the code segment to be corrected; based on the code jump instruction to obtain the code file to be corrected to which the code segment belongs; The segment location information corresponding to the code segment jumps to display the source code file to be corrected; detects the code correction operation acting on the displayed source code file to be corrected; extracts the corrected code segment based on the code correction operation.
- Each module in the above-mentioned code translation device can be implemented in whole or in part by software, hardware, and a combination thereof.
- the foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
- a computer device is provided.
- the computer device may be a server, and its internal structure diagram may be as shown in FIG. 5.
- the computer equipment includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities.
- the memory of the computer device includes a non-volatile storage medium and an internal memory.
- the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
- the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium.
- the database of the computer equipment is used to store data such as the analysis result set to be translated.
- the network interface of the computer device is used to communicate with an external terminal through a network connection.
- the computer-readable instructions are executed by the processor to implement a code translation method.
- FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
- the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
- a computer device including a memory and one or more processors.
- the memory stores computer-readable instructions, and the computer-readable instructions are executed by the one or more processors.
- the one or more processors are caused to implement the steps of the code segment locating method in each of the foregoing embodiments.
- one or more non-volatile computer-readable storage media storing computer-readable instructions are provided.
- the computer-readable instructions are executed by one or more processors, the one Or multiple processors implement the steps of the code segment positioning method in each of the foregoing embodiments.
- Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
- ROM read only memory
- PROM programmable ROM
- EPROM electrically programmable ROM
- EEPROM electrically erasable programmable ROM
- Volatile memory may include random access memory (RAM) or external cache memory.
- RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Machine Translation (AREA)
Abstract
本申请涉及一种代码翻译方法,包括:获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息;调用翻译器系统提供的翻译器接口,翻译器系统部署于翻译服务器上,通过翻译系统翻译待翻译代码片段,得到翻译后代码片段;按照翻译后代码片段对应的片段定位信息对待翻译源代码文件进行替换处理,生成待纠正源代码文件;获取针对待纠正源代码文件输入的目标翻译细节报表;目标翻译细节报表中包含目标纠正项目;及按照目标纠正项目对应的片段定位信息对待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
Description
本申请要求于2019年4月12日提交中国专利局,申请号为2019102961237,申请名称为“代码翻译方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及一种代码翻译方法、装置、计算机设备和存储介质。
随着国际化的日益深入发展,已开发的软件系统会面临面向世界不同地区和国家的需求的情况,因此需要将软件系统的源代码从原始语言翻译为特定语言。传统方式中,通常是由业务分析人员收集翻译需求并写入文档,然后交与软件开发人员依据文档对源代码进行修改。然而,发明人意识到,传统的代码国际化翻译过程需要业务分析人员与开发人员进行合作完成,开发人员从代码中手动提取出待翻译的代码片段之后,由人工进行大量翻译工作,时间成本和人力成本高,通过人工进行代码国际化翻译难以准确全面地排查出所有需要翻译的代码片段,也难以保证代码翻译的统一性,从而导致翻译结果可靠性差,代码翻译效率较低。
发明内容
根据本申请公开的各种实施例,提供一种代码翻译方法、装置、计算机设备和存储介质。
一种代码翻译方法,应用于代码服务器,所述方法包括:
获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;所述待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息;
调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,通过所述翻译系统翻译所述待翻译代码片段,得到翻译后代码片段;
按照所述翻译后代码片段对应的片段定位信息对所述待翻译源代码文件进行替换处理,生成待纠正源代码文件;
获取针对所述待纠正源代码文件输入的目标翻译细节报表;所述目标翻译细节报表中包含目标纠正项目;及
按照所述目标纠正项目对应的片段定位信息对所述待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
一种代码翻译装置,包括:
获取模块,用于获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;所述待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息;
翻译模块,用于调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,通过所述翻译系统翻译所述待翻译代码片段,得到翻译后代码片段;
替换模块,用于按照所述翻译后代码片段对应的片段定位信息对所述待翻译源代码文件进行替换处理,生成待纠正源代码文件;及
纠正模块,用于获取针对所述待纠正源代码文件输入的目标翻译细节报表;所述目标翻译细节报表中包含目标纠正项目;按照所述目标纠正项目对应的片段定位信息对所述待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;所述待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息;
调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,通过所述翻译系统翻译所述待翻译代码片段,得到翻译后代码片段;
按照所述翻译后代码片段对应的片段定位信息对所述待翻译源代码文件进行替换处理,生成待纠正源代码文件;
获取针对所述待纠正源代码文件输入的目标翻译细节报表;所述目标翻译细节报表中包含目标纠正项目;及
按照所述目标纠正项目对应的片段定位信息对所述待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;所述待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息;
调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,通过所述翻译系统翻译所述待翻译代码片段,得到翻译后代码片段;
按照所述翻译后代码片段对应的片段定位信息对所述待翻译源代码文件进行替换处理,生成待纠正源代码文件;
获取针对所述待纠正源代码文件输入的目标翻译细节报表;所述目标翻译细节报表中包含目标纠正项目;及
按照所述目标纠正项目对应的片段定位信息对所述待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中代码翻译方法的应用场景图;
图2为根据一个或多个实施例中代码翻译方法的流程示意图;
图3为另一个实施例中代码翻译方法的流程示意图;
图4为根据一个或多个实施例中代码翻译装置的结构框图;
图5为根据一个或多个实施例中计算机设备的内部结构图。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的代码翻译方法,可以应用于如图1所示的应用环境中。其中,代码服务器102与翻译服务器104通过网络进行通信。其中,代码服务器102与翻译服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。代码服务器102对待翻译源代码文件进行解析处理之后,可得到包含待翻译代码片段和对应的片段定位信息的待翻译分析结果集。代码服务器102可调用翻译器接口将带翻译代码片段发送至翻译器对应的翻译服务器104进行翻译,得到翻译后代码片段。代码服务器102接收到翻译服务器104返回的翻译后代码片段之后,可按照翻译后代码片段对应的片段定位信息对待翻译源代码文件进行替换处理,生成待纠正源代码文件。代码服务器102在获取针对待纠正源代码文件输入的目标翻译细节报表之后,还可按照目标翻译细节报表中包含的目标纠正项目对待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
在其中一个实施例中,如图2所示,提供了一种代码翻译方法,以该方法应用于图1中的代码服务器102为例进行说明,包括以下步骤:
步骤202,获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息。
待翻译源代码文件是指需要进行翻译的源代码文件。源代码文件是指未编译的按照一定的程序设计语言规范书写的文本文件。待翻译源代码文件可预存在代码服务器的数据库中,代码服务器可直接从本地数据库中获取待翻译源代码文件;代码服务器也可接收终端上传的待翻译代码文件或其他服务器发送的待翻译源代码文件。待翻译分析结果集是指对待翻译源代码文件进行解析之后得到的,包含与多个待翻译代码片段对应的分别对应的待翻译分析结果的集合。待翻译分析结果包括待翻译源代码文件中待翻译代码片段及其相关信息。待翻译分析结果集中可包含一个或多个待翻译代码片段。片段定位信息是指待翻译代码片段在待翻译源代码文件中的定位信息。
在其中一个实施例中,可通过解析器对待翻译源代码文件进行解析处理得到待翻译代码片段之后,在待翻译代码片段所处的待处理代码中划分出对应的片段定位信息。比如,特定语法的待翻译代码片段对应有特定的起始字符串和结束字符串,可分别检测起始字符串在待处理代码中的起始定位信息和结束字符串在在待处理代码中的结束定位信息,将起始定位信息和结束定位信息作为片段定位信息。还可以预先在待处理代码中划分定位多个代码片段,比如将待处理代码中预设字符长度的代码作为一个代码片段,当检测到代码片段中包含特定字符串时,则可将该代码片段作为待翻译代码片段。
步骤204,调用翻译器接口翻译待翻译代码片段,得到翻译后代码片段。
翻译器接口是指翻译器系统提供的、可用于通过调用实现翻译功能的接口。翻译器系统可部署于翻译服务器上。翻译器系统包括但不限于百度翻译器或谷歌翻译器等其中一种或多种。翻译器系统可基于翻译策略将待翻译代码片段翻译为对应的目标语言类型的翻译后代码片段。目标语言类型包括但不限于中文、高棉语、泰语、缅甸语及老挝语等其中一种或多种语言类型。
在其中一个实施例中,当待翻译分析结果集中包含多个待翻译代码片段时,可以根据每个待翻译代码片段生成一个翻译请求,逐一通过翻译器接口发送至翻译服务器进行翻译。还可以根据多个待翻译代码片段生成一个翻译请求,一次性实现多个待翻译代码片段的翻译处理,以降低总体翻译请求的调用数量,提高对多个待翻译代码片段翻译的执行稳定性。
步骤206,按照翻译后代码片段对应的片段定位信息对待翻译源代码文件进行替换处理,生成待纠正源代码文件。
可基于片段定位信息在待翻译源代码文件中查找到相应的待翻译代码片 段,从而可将对应的翻译后代码片段替换相应的待翻译代码片段。待翻译源代码文件中可包含多个待翻译代码片段,可在当检测到对待翻译源代码文件中的所有待翻译代码片段都进行了替换操作之后,得到翻译后源代码文件。重写该翻译后源代码文件可生成待纠正源代码文件。
步骤208,获取针对待纠正源代码文件输入的目标翻译细节报表;目标翻译细节报表中包含目标纠正项目。
目标翻译细节报表是指记录了待翻译源代码文件经过翻译得到的翻译后源代码文件的具体翻译细节、以及需要进行纠正的具体翻译细节的报表。目标翻译细节报表中可包含多个目标纠正项目,一个目标纠正项目对应于待纠正源代码文件中需要进行纠正的一个待纠正代码片段。每个目标纠正项目中包括待纠正代码片段、纠正后代码片段、片段定位信息,还可以包括上下文代码片段等。由于在进行自动翻译的时候,翻译后代码片段的直接替换处理过程是没有考虑到待翻译源代码文件中待翻译代码片段的上下文,可导致翻译不准确的情况。因此需要对自动翻译后的带的待纠正源代码文件进行纠正。
步骤210,按照目标纠正项目对应的片段定位信息对待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
可基于目标翻译细节报表中的每个目标纠正项目对应的片段定位信息,在待纠正源代码文件中查找定位到需要进行纠正的待纠正代码片段,从而基于目标纠正项目对定位到的待纠正代码片段进行纠正处理。通过对待纠正源代码文件中所有需要进行的待纠正代码片段进行纠正处理之后,可以生成纠正后源代码文件。
上述代码翻译方法中,代码服务器对待翻译源代码文件进行解析处理之后,可得到包含待翻译代码片段和对应的片段定位信息的待翻译分析结果集。代码服务器可调用翻译器接口将带翻译代码片段发送至翻译器对应的翻译服务器进行翻译,得到翻译后代码片段。接收到翻译后代码片段之后,可按照翻译后代码片段对应的片段定位信息对待翻译源代码文件进行替换处理,生成待纠正源代码文件。在获取针对待纠正源代码文件输入的目标翻译细节报表之后,还可按照目标翻译细节报表中包含的目标纠正项目对待纠正源代码文件进行纠正处理,生成纠正后源代码文件。通过对待翻译源代码文件进行自动化的解析、翻译及纠正,能够保证代码翻译的全面性、统一性和可靠性,从而提高代码翻译效率。
在其中一个实施例中,获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集,包括:获取待翻译源代码文件;读取待翻译源代码文件中的源代码目录;待翻译源代码目录中包含多个初始文件名;遍 历每个初始文件名对应的初始代码子文件,筛选出待翻译代码子文件;待翻译代码子文件与预设语言类型相匹配,待翻译代码子文件中包含翻译代码片段;查找与预设语言类型匹配的解析器;通过解析器对待翻译代码子文件进行解析处理,生成待翻译分析结果集。
源代码目录是指存储了多个初始代码子文件的初始文件名的目录。初始代码子文件是指待翻译源代码文件中最小粒度的、无法进一步展开的源代码文件。待翻译代码子文件是指与预设语言类型相匹配的、需要翻译成目标语言类型的初始代码子文件。待翻译代码子文件中包含待翻译的代码片段。通过仅将包含待翻译代码片段的待翻译代码子文件筛选出来,避免对无需进行翻译的初始代码子文件进行无效处理,以节约系统资源。
可以在代码服务器中预置安装多个与各种预设语言类型对应的解析器,通过匹配的解析器对待翻译代码子文件进行处理。解析器可为独立存在的应用程序,也可以为运行在特定系统平台下的插件。比如解析器可以是Babel parser(一种JavaScript源代码解析器)。还可针对不同文件格式类型的待翻译代码子文件,预置不同的解析器。检测待翻译代码子文件的文件名后缀之后,可基于待翻译代码子文件的文件名后缀对应的文件格式类型,查找与待翻译代码子文件的文件格式类型对应的多个解析器集合,从解析器集合中查找与待翻译代码子文件的预设语言类型匹配的解析器。比如说,可分别针对后缀为“.js”(JavaScript,一种直译式脚本语言)和“.jsx”(JavaScript XML,一种在React组建内部构建标签的类XML语法)的待翻译代码子文件预置不同的解析器。针对属于不同类型的待翻译源代码子文件通过特定的解析器进行特定的解析处理,能够使得解析结果更加准确。
在其中一个实施例中,遍历每个初始文件名对应的初始代码子文件,筛选出待翻译代码子文件,包括:获取多种预设语言类型分别对应的正则表达式;遍历每个初始文件名对应的初始代码子文件,通过正则表达式与每个初始代码子文件进行匹配;根据匹配的正则表达式确定每个初始代码子文件匹配的预设语言类型;筛选出包含任意一种预设语言类型的初始代码子文件,作为待翻译代码子文件。
正则表达式是对字符串操作的一种逻辑公式,就是用事先定义好的一些特定字符、及这些特定字符的组合,组成一个“规则字符串”,这个“规则字符串”可用来表达对字符串的一种过滤逻辑。每一种预设语言类型都有相应的一个或多个正则表达式,通过正则表达式可以知道待处理代码中是否有需要进行翻译处理的待翻译代码片段,从而避免对不包含待翻译片代码段的初始代码子文件进行解析,减少解析的工作量,提高解析效率。
在其中一个实施例中,待翻译分析结果集中还包含与待翻译代码片段对 应的上下文代码片段,调用翻译器接口翻译待翻译代码片段,得到翻译后代码片段,包括:查找与待翻译代码片段匹配的代码处理器;通过代码处理器根据上下文代码片段,识别待翻译代码片段的目标语言类型以及翻译策略;通过代码处理器调用翻译器接口,得到基于翻译策略翻译的与待翻译代码片段对应的目标语言类型的翻译后代码片段。
代码处理器是指用于对待翻译代码片段进行语法识别、风险识别、翻译处理及状态标注等操作的处理器。可预先对不同编程语言类型的待翻译代码片段设置不同的代码处理器,从而使得代码处理器能够更有针对性地对待翻译代码片段进行准确的操作,以实现更为精准的代码片段翻译。代码处理器可结合上下文代码片段对待翻译代码片段的语法进行分析,从而识别待翻译代码片段所对应的翻译策略。针对不同的待翻译代码片段可预设不同的翻译策略。翻译策略包括是否进行替换操作、对应于不同语法的待翻译代码片段进行不同的翻译操作等。通过得到的上下文代码片段能够更准确地对待翻译代码片段进行语法分析。
在其中一个实施例中,查找与待翻译代码片段匹配的代码处理器,包括:识别待翻译代码片段的编程语言类型;查找与编程语言类型对应的代码处理器集合;将待翻译代码片段与代码处理器集合中的每个代码处理器对应的匹配条件进行匹配;将匹配的匹配条件对应的代码处理器,作为与待翻译代码片段匹配的代码处理器。
可对于每一种编程语言类型,预定义对应的代码处理器集合。编程语言类型包括但不限于JS(JavaScript)、JSX(JavaScript XML,一种在React组建内部构建标签的类XML语法)等,不限于此。每一个代码处理器都有自定义的匹配条件。匹配条件包括但不限于待翻译代码片段涉及字符串类型的条件、待翻译代码片段涉及业务逻辑的条件,以及待翻译代码片段涉及配置文件中配置项属性的条件,不限于此。根据匹配条件,可从代码处理器集合中查找到与翻译代码片段匹配的代码处理器。
在其中一个实施例中,获取针对待纠正源代码文件输入的目标翻译细节报表,包括:根据待翻译代码片段及对应的上下文代码片段、翻译后代码片段和片段定位信息生成初始翻译细节报表;获取基于初始翻译细节报表输入的纠正后代码片段;将每个待纠正代码片段和相应的纠正后代码片段作为目标纠正项目;根据多个目标纠正项目生成目标翻译细节报表。
初始翻译细节报表是指待翻译源代码文件经过自动化翻译处理得到的、记录了翻译细节的报表。翻译细节包括但不限于待翻译代码片段及对应的上下文代码片段、翻译后代码片段和片段定位信息等。开发人员 可基于初始翻译细节报表中的翻译细节输入纠正后代码片段。待纠正代码片段是指待纠正源代码文件中翻译不正确从而需要进行纠正处理的代码片段。开发人员可将需要进行纠正处理的翻译后代码片段标记为待纠正代码片段。纠正后代码片段是指用于纠正待纠正代码片段的代码片段。开发人员无需打开待纠正源代码文件,仅需根据目标翻译细节报表,便可通过查阅上下文代码片段对翻译后代码片段进行人工核查,从而能够更准确地从翻译后代码片段中筛选出待纠正代码片段减少了开发人员的浏览查找代码的时间。
在其中一个实施例中,当目标纠正项目为多个时,则提取目标翻译细节报表中的每个目标纠正项目对应的待纠正代码片段和相应的纠正后代码片段;按照每个目标纠正项目对应的片段定位信息,在待纠正源代码文件中查找待纠正代码片段;将待纠正源代码文件中的待纠正代码片段替换为相应的纠正后代码片段;当检测到执行完对应于所有目标纠正项目的纠正处理时,则重写经过纠正处理后的待纠正源代码文件,得到纠正后源代码文件。
在其中一个实施例中,初始翻译细节报表中还可包含与每个翻译后代码片段对应的风险等级。风险等级包括但不限于低风险等级、潜在风险等级以及高风险等级等。当经过对上下文代码片段进行检查后发现,该段待翻译代码片段是某个字符串拼接的一部分,则说明这种情况下的自动翻译往往不正确,可将该待翻译代码片段标注为潜在风险等级。或当对翻译结果进行检查后发现翻译后代码片段中仍然包含原始语言类型的字符串,则说明翻译器系统没有进行准确翻译,可将该待翻译代码片段标注为潜在风险等级。当检测到翻译器接口调用失败导致翻译没有完成时,可将该待翻译代码片段标注为高风险等级。或当未查找到与待翻译代码片段匹配的代码处理器时,可将该待翻译代码片段标注为高风险等级。开发人员可重点针对风险等级高的翻译后代码片段进行核验,以快速确定待纠正代码片段,从而针对待纠正代码片段输入纠正后代码片段。
在其中一个实施例中,接收基于待纠正代码片段和对应的片段定位信息,输入的纠正后代码片段,包括:获取代码跳转指令;代码跳转指令对应于待纠正代码片段;基于代码跳转指令获取待纠正代码片段所属的待纠正代码文件;按照待纠正代码片段对应的片段定位信息,跳转展示待纠正源代码文件;检测作用于所展示的待纠正源代码文件的代码纠正操作;提取基于代码纠正操作得到的纠正后代码片段。
当开发人员无法通过初始翻译细节报表确定待纠正代码片段的纠正后代码片段时,比如当出现代码逻辑问题或字符串拼接问题时,开发人员可通过触发代码跳转指令,代码服务器可基于代码跳转指令按照片段定位信息打开展示待纠正源代码文件,并跳转至包含该不确定的待纠正代码片段的部分。 代码服务器还可在待纠正源代码文件中标注出该部分待纠正代码片段,以使得开发人员可快速浏览待纠正代码片段的上下文片段,从而对待纠正源代码文件进行代码纠正操作。代码纠正操作可以是开发人员直接在待纠正源代码文件进行代码修改,则代码服务器可比对修改前后的待纠正源代码文件,提取出待纠正代码片段和纠正后代码片段。还可以是开发人员在待纠正源代码文件中选择需要修改的部分作为待纠正代码片段,从而开发人员可在目标翻译细节报表的对应位置输入纠正后代码片段。通过快速的代码跳转,节约了开发人员在待纠正源代码文件中查找待纠正代码片段的时间,从而提高了目标翻译细节报表的生成效率。
在其中一个实施例中,如图3所示,提供了另一种代码翻译方法,以该方法应用于图1中的代码服务器102为例进行说明,包括以下步骤:
步骤302,获取待翻译源代码文件。
步骤304,读取待翻译源代码文件中的源代码目录;待翻译源代码目录中包含多个初始文件名。
步骤306,遍历每个初始文件名对应的初始代码子文件,筛选出待翻译代码子文件;待翻译代码子文件与预设语言类型相匹配,待翻译代码子文件中包含翻译代码片段。
步骤308,查找与预设语言类型匹配的解析器。
步骤310,通过解析器对待翻译代码子文件进行解析处理,生成待翻译分析结果集;待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息和上下文代码片段。
步骤312,查找与待翻译代码片段匹配的代码处理器。
步骤314,通过代码处理器根据上下文代码片段,识别待翻译代码片段的目标语言类型以及翻译策略。
步骤316,通过代码处理器调用翻译器接口,得到基于翻译策略翻译的与待翻译代码片段对应的目标语言类型的翻译后代码片段。
步骤318,按照翻译后代码片段对应的片段定位信息对待翻译源代码文件进行替换处理,生成待纠正源代码文件。
步骤320,根据待翻译代码片段及对应的上下文代码片段、翻译后代码片段和片段定位信息生成初始翻译细节报表。
步骤322,获取基于初始翻译细节报表输入的纠正后代码片段。
步骤324,将每个待纠正代码片段和相应的纠正后代码片段作为目标纠正项目。
步骤326,根据多个目标纠正项目生成目标翻译细节报表。
步骤302,按照目标纠正项目对应的片段定位信息对待纠正源代码 文件进行纠正处理,生成纠正后源代码文件。
上述代码翻译方法中,代码服务器对待翻译源代码文件进行解析处理之后,可得到包含待翻译代码片段和对应的片段定位信息的待翻译分析结果集。代码服务器可调用翻译器接口将带翻译代码片段发送至翻译器对应的翻译服务器进行翻译,得到翻译后代码片段。接收到翻译后代码片段之后,可按照翻译后代码片段对应的片段定位信息对待翻译源代码文件进行替换处理,生成待纠正源代码文件,且能得到初始翻译细节报表。使得开发人员能基于初始翻译细节报表输入包含目标纠正项目的目标翻译细节报表,基于目标纠正项目对待纠正源代码文件进行纠正处理之后可生成纠正后源代码文件。通过对待翻译源代码文件进行自动化的解析、翻译及纠正,能够保证代码翻译的全面性、统一性和可靠性,从而提高代码翻译效率。
应该理解的是,虽然图2和3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2和3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在其中一个实施例中,如图3所示,提供了一种代码翻译装置400,包括:获取模块402,用于获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息;翻译模块404,用于调用翻译器接口翻译待翻译代码片段,得到翻译后代码片段;替换模块406,用于按照翻译后代码片段对应的片段定位信息对待翻译源代码文件进行替换处理,生成待纠正源代码文件;纠正模块408,用于获取针对待纠正源代码文件输入的目标翻译细节报表;目标翻译细节报表中包含目标纠正项目;按照目标纠正项目对应的片段定位信息对待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
在其中一个实施例中,获取模块402还用于获取待翻译源代码文件;读取待翻译源代码文件中的源代码目录;待翻译源代码目录中包含多个初始文件名;遍历每个初始文件名对应的初始代码子文件,筛选出待翻译代码子文件;待翻译代码子文件与预设语言类型相匹配,待翻译代码子文件中包含翻译代码片段;查找与预设语言类型匹配的解析器;通过解析器对待翻译代码子文件进行解析处理,生成待翻译分析结果集。
在其中一个实施例中,获取模块402还用于获取多种预设语言类型分别 对应的正则表达式;遍历每个初始文件名对应的初始代码子文件,通过正则表达式与每个初始代码子文件进行匹配;根据匹配的正则表达式确定每个初始代码子文件匹配的预设语言类型;筛选出包含任意一种预设语言类型的初始代码子文件,作为待翻译代码子文件。
在其中一个实施例中,待翻译分析结果集中还包含与待翻译代码片段对应的上下文代码片段,翻译模块404还用于查找与待翻译代码片段匹配的代码处理器;通过代码处理器根据上下文代码片段,识别待翻译代码片段的目标语言类型以及翻译策略;通过代码处理器调用翻译器接口,得到基于翻译策略翻译的与待翻译代码片段对应的目标语言类型的翻译后代码片段。
在其中一个实施例中,翻译模块404还用于识别待翻译代码片段的编程语言类型;查找与编程语言类型对应的代码处理器集合;将待翻译代码片段与代码处理器集合中的每个代码处理器对应的匹配条件进行匹配;将匹配的匹配条件对应的代码处理器,作为与待翻译代码片段匹配的代码处理器。
在其中一个实施例中,纠正模块408还用于根据待翻译代码片段及对应的上下文代码片段、翻译后代码片段和片段定位信息生成初始翻译细节报表;获取基于初始翻译细节报表输入的纠正后代码片段;将每个待纠正代码片段和相应的纠正后代码片段作为目标纠正项目;根据多个目标纠正项目生成目标翻译细节报表。
在其中一个实施例中,纠正模块408还用于获取代码跳转指令;代码跳转指令对应于待纠正代码片段;基于代码跳转指令获取待纠正代码片段所属的待纠正代码文件;按照待纠正代码片段对应的片段定位信息,跳转展示待纠正源代码文件;检测作用于所展示的待纠正源代码文件的代码纠正操作;提取基于代码纠正操作得到的纠正后代码片段。
关于代码翻译装置的具体限定可以参见上文中对于代码翻译方法的限定,在此不再赘述。上述代码翻译装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在其中一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图5所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机 可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储待翻译分析结果集等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种代码翻译方法。
本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在其中一个实施例中,提供了一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器实现上述各个实施例中的代码片段定位方法的步骤。
在其中一个实施例中,提供了一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器实现上述各个实施例中的代码片段定位方法的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干 变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。
Claims (20)
- 一种代码翻译方法,应用于代码服务器,所述方法包括:获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;所述待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息;调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,通过所述翻译系统翻译所述待翻译代码片段,得到翻译后代码片段;按照所述翻译后代码片段对应的片段定位信息对所述待翻译源代码文件进行替换处理,生成待纠正源代码文件;获取针对所述待纠正源代码文件输入的目标翻译细节报表;所述目标翻译细节报表中包含目标纠正项目;及按照所述目标纠正项目对应的片段定位信息对所述待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
- 根据权利要求1所述的方法,其特征在于,所述获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集包括:获取待翻译源代码文件;读取所述待翻译源代码文件中的源代码目录;所述待翻译源代码目录中包含多个初始文件名;遍历每个所述初始文件名对应的初始代码子文件,筛选出待翻译代码子文件;所述待翻译代码子文件与预设语言类型相匹配,所述待翻译代码子文件中包含翻译代码片段;查找与所述预设语言类型匹配的解析器;及通过所述解析器获取待翻译代码片段在所述待翻译代码子文件中的片段定位信息,基于所述片段定位信息提取待翻译代码片段,根据所述待翻译代码片段和所述片段定位信息,生成待翻译分析结果集。
- 根据权利要求2所述的方法,其特征在于,所述遍历每个所述初始文件名对应的初始代码子文件,筛选出待翻译代码子文件包括:获取多种预设语言类型分别对应的正则表达式;遍历每个所述初始文件名对应的初始代码子文件,通过所述正则表达式与每个初始代码子文件进行匹配;根据匹配的正则表达式确定每个初始代码子文件匹配的预设语言类型;及筛选出包含任意一种预设语言类型的初始代码子文件,作为待翻译代码子文件。
- 根据权利要求1所述的方法,其特征在于,所述待翻译分析结果集中还包含与所述待翻译代码片段对应的上下文代码片段,所述调用翻译器系统 提供的翻译器接口包括:查找与所述待翻译代码片段匹配的代码处理器;通过所述代码处理器根据所述上下文代码片段,对所述待翻译代码片段的语法进行分析,识别待翻译代码片段的目标语言类型以及翻译策略;及通过所述代码处理器调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,所述翻译器系统基于所述翻译策略翻译将所述待翻译代码片段翻译为对应的目标语言类型的翻译后代码片段。
- 根据权利要求4所述的方法,其特征在于,所述查找与所述待翻译代码片段匹配的代码处理器包括:基于正则表达式识别所述待翻译代码片段的编程语言类型;查找与所述编程语言类型对应的代码处理器集合;将所述待翻译代码片段与代码处理器集合中的每个代码处理器对应的匹配条件进行匹配;及将匹配的匹配条件对应的代码处理器,作为与所述待翻译代码片段匹配的代码处理器。
- 根据权利要求4所述的方法,其特征在于,所述获取针对所述待纠正源代码文件输入的目标翻译细节报表包括:根据所述待翻译代码片段及对应的上下文代码片段、翻译后代码片段和片段定位信息生成初始翻译细节报表;获取基于所述初始翻译细节报表通过终端输入的纠正后代码片段;将每个所述待纠正代码片段、相应的纠正后代码片段和上下文代码片段作为目标纠正项目;及根据多个所述目标纠正项目生成目标翻译细节报表。
- 根据权利要求5所述的方法,其特征在于,所述获取基于所述待纠正代码片段和对应的片段定位信息,通过终端输入的纠正后代码片段,包括:获取代码跳转指令;所述代码跳转指令对应于所述待纠正代码片段;基于代码跳转指令获取所述待纠正代码片段所属的待纠正代码文件;按照所述待纠正代码片段对应的片段定位信息,跳转展示所述待纠正源代码文件;检测作用于所展示的待纠正源代码文件的代码纠正操作;及提取基于所述代码纠正操作得到的纠正后代码片段。
- 一种代码翻译装置,包括:获取模块,用于获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;所述待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息;翻译模块,用于调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,通过所述翻译系统翻译所述待翻译代码片段,得到翻译后代码片段;替换模块,用于按照所述翻译后代码片段对应的片段定位信息对所述待翻译源代码文件进行替换处理,生成待纠正源代码文件;及纠正模块,用于获取针对所述待纠正源代码文件输入的目标翻译细节报表;所述目标翻译细节报表中包含目标纠正项目;按照所述目标纠正项目对应的片段定位信息对所述待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
- 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;所述待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息;调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,通过所述翻译系统翻译所述待翻译代码片段,得到翻译后代码片段;按照所述翻译后代码片段对应的片段定位信息对所述待翻译源代码文件进行替换处理,生成待纠正源代码文件;获取针对所述待纠正源代码文件输入的目标翻译细节报表;所述目标翻译细节报表中包含目标纠正项目;及按照所述目标纠正项目对应的片段定位信息对所述待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
- 根据权利要求9所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:获取待翻译源代码文件;读取所述待翻译源代码文件中的源代码目录;所述待翻译源代码目录中包含多个初始文件名;遍历每个所述初始文件名对应的初始代码子文件,筛选出待翻译代码子文件;所述待翻译代码子文件与预设语言类型相匹配,所述待翻译代码子文件中包含翻译代码片段;查找与所述预设语言类型匹配的解析器;及通过所述解析器获取待翻译代码片段在所述待翻译代码子文件中的片段定位信息,基于所述片段定位信息提取待翻译代码片段,根据所述待翻译代码片段和所述片段定位信息,生成待翻译分析结果集。
- 根据权利要求10所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:获取多种预设语言类型分别对应的正则表达式;遍历每个所述初始文件名对应的初始代码子文件,通过所述正则表达式与每个初始代码子文件进行匹配;根据匹配的正则表达式确定每个初始代码子文件匹配的预设语言类型;及筛选出包含任意一种预设语言类型的初始代码子文件,作为待翻译代码子文件。
- 根据权利要求9所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:查找与所述待翻译代码片段匹配的代码处理器;通过所述代码处理器根据所述上下文代码片段,对所述待翻译代码片段的语法进行分析,识别待翻译代码片段的目标语言类型以及翻译策略;及通过所述代码处理器调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,所述翻译器系统基于所述翻译策略翻译将所述待翻译代码片段翻译为对应的目标语言类型的翻译后代码片段。
- 根据权利要求12所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:基于正则表达式识别所述待翻译代码片段的编程语言类型;查找与所述编程语言类型对应的代码处理器集合;将所述待翻译代码片段与代码处理器集合中的每个代码处理器对应的匹配条件进行匹配;及将匹配的匹配条件对应的代码处理器,作为与所述待翻译代码片段匹配的代码处理器。
- 根据权利要求12所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:根据所述待翻译代码片段及对应的上下文代码片段、翻译后代码片段和片段定位信息生成初始翻译细节报表;获取基于所述初始翻译细节报表通过终端输入的纠正后代码片段;将每个所述待纠正代码片段、相应的纠正后代码片段和上下文代码片段作为目标纠正项目;及根据多个所述目标纠正项目生成目标翻译细节报表。
- 根据权利要求13所述的方法,其特征在于,所述获取基于所述待纠正代码片段和对应的片段定位信息,通过终端输入的纠正后代码片段,包括:获取代码跳转指令;所述代码跳转指令对应于所述待纠正代码片段;基于代码跳转指令获取所述待纠正代码片段所属的待纠正代码文件;按照所述待纠正代码片段对应的片段定位信息,跳转展示所述待纠正源代码文件;检测作用于所展示的待纠正源代码文件的代码纠正操作;及提取基于所述代码纠正操作得到的纠正后代码片段。
- 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:获取对待翻译源代码文件进行解析处理得到的待翻译分析结果集;所述待翻译分析结果集中包含待翻译代码片段及对应的片段定位信息;调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,通过所述翻译系统翻译所述待翻译代码片段,得到翻译后代码片段;按照所述翻译后代码片段对应的片段定位信息对所述待翻译源代码文件进行替换处理,生成待纠正源代码文件;获取针对所述待纠正源代码文件输入的目标翻译细节报表;所述目标翻译细节报表中包含目标纠正项目;及按照所述目标纠正项目对应的片段定位信息对所述待纠正源代码文件进行纠正处理,生成纠正后源代码文件。
- 根据权利要求16所述的算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:获取待翻译源代码文件;读取所述待翻译源代码文件中的源代码目录;所述待翻译源代码目录中包含多个初始文件名;遍历每个所述初始文件名对应的初始代码子文件,筛选出待翻译代码子文件;所述待翻译代码子文件与预设语言类型相匹配,所述待翻译代码子文件中包含翻译代码片段;查找与所述预设语言类型匹配的解析器;及通过所述解析器获取待翻译代码片段在所述待翻译代码子文件中的片段定位信息,基于所述片段定位信息提取待翻译代码片段,根据所述待翻译代码片段和所述片段定位信息,生成待翻译分析结果集。
- 根据权利要求17所述的算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:获取多种预设语言类型分别对应的正则表达式;获取多种预设语言类型分别对应的正则表达式;遍历每个所述初始文件名对应的初始代码子文件,通过所述正则表达式与每个初始代码子文件进行匹配;根据匹配的正则表达式确定每个初始代码子文件匹配的预设语言类型;及筛选出包含任意一种预设语言类型的初始代码子文件,作为待翻译代码子文件。
- 根据权利要求16所述的算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:查找与所述待翻译代码片段匹配的代码处理器;通过所述代码处理器根据所述上下文代码片段,对所述待翻译代码片段的语法进行分析,识别待翻译代码片段的目标语言类型以及翻译策略;及通过所述代码处理器调用翻译器系统提供的翻译器接口,所述翻译器系统部署于翻译服务器上,所述翻译器系统基于所述翻译策略翻译将所述待翻译代码片段翻译为对应的目标语言类型的翻译后代码片段。
- 根据权利要求19所述的算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:基于正则表达式识别所述待翻译代码片段的编程语言类型;查找与所述编程语言类型对应的代码处理器集合;将所述待翻译代码片段与代码处理器集合中的每个代码处理器对应的匹配条件进行匹配;及将匹配的匹配条件对应的代码处理器,作为与所述待翻译代码片段匹配的代码处理器。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| SG11201907337XA SG11201907337XA (en) | 2019-04-12 | 2019-06-19 | Code translation method, apparatus, computer equipment and storage medium |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910296123.7 | 2019-04-12 | ||
| CN201910296123.7A CN110134404A (zh) | 2019-04-12 | 2019-04-12 | 代码翻译方法、装置、计算机设备和存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020206840A1 true WO2020206840A1 (zh) | 2020-10-15 |
Family
ID=67569806
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/091851 Ceased WO2020206840A1 (zh) | 2019-04-12 | 2019-06-19 | 代码翻译方法、装置、计算机设备和存储介质 |
Country Status (3)
| Country | Link |
|---|---|
| CN (1) | CN110134404A (zh) |
| SG (1) | SG11201907337XA (zh) |
| WO (1) | WO2020206840A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115859149A (zh) * | 2022-11-25 | 2023-03-28 | 华润数字科技有限公司 | 基于语言转换的操作数据生成方法和系统、设备、介质 |
Families Citing this family (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110704042A (zh) * | 2019-10-15 | 2020-01-17 | 恩亿科(北京)数据科技有限公司 | 程序代码处理方法和装置、服务器及存储介质 |
| CN110853676B (zh) * | 2019-11-18 | 2023-06-09 | 广州国音智能科技有限公司 | 一种音频比对方法、装置及设备 |
| CN111160045B (zh) * | 2019-12-27 | 2021-03-23 | 苏州亿歌网络科技有限公司 | 一种游戏资源文件翻译方法、装置及设备 |
| CN111563389B (zh) * | 2020-04-20 | 2023-11-03 | 富途网络科技(深圳)有限公司 | 一种用户原创内容的翻译方法和装置 |
| CN113687883A (zh) * | 2020-05-18 | 2021-11-23 | 阿里巴巴集团控股有限公司 | 数据展示方法、装置、电子设备及计算机可读存储介质 |
| CN112015430B (zh) * | 2020-09-07 | 2024-08-16 | 平安国际智慧城市科技股份有限公司 | JavaScript代码翻译方法、装置、计算机设备及存储介质 |
| CN113342437B (zh) | 2021-06-10 | 2023-03-24 | 网易(杭州)网络有限公司 | 一种软件翻译方法和装置 |
| CN113342436B (zh) | 2021-06-10 | 2023-03-17 | 网易(杭州)网络有限公司 | 一种游戏翻译方法和装置 |
| CN113420569B (zh) * | 2021-06-22 | 2025-04-22 | 康键信息技术(深圳)有限公司 | 代码翻译方法、装置、设备及存储介质 |
| CN115718757A (zh) * | 2022-11-24 | 2023-02-28 | 奇安信网神信息技术(北京)股份有限公司 | 信息处理方法及装置 |
| CN119759480A (zh) * | 2025-03-05 | 2025-04-04 | 深圳中维世纪科技有限公司 | 面向嵌入式系统的多语言支持框架及其实现方法 |
| CN121031618A (zh) * | 2025-07-21 | 2025-11-28 | 深圳市生强科技有限公司 | 代码文本翻译方法、设备及计算机程序产品 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090125295A1 (en) * | 2007-11-09 | 2009-05-14 | William Drewes | Voice auto-translation of multi-lingual telephone calls |
| CN102073490A (zh) * | 2009-11-25 | 2011-05-25 | 阿里巴巴集团控股有限公司 | 转译数据库语言的方法及装置 |
| CN103365838A (zh) * | 2013-07-24 | 2013-10-23 | 桂林电子科技大学 | 基于多元特征的英语作文语法错误自动纠正方法 |
| CN105242932A (zh) * | 2015-10-21 | 2016-01-13 | 宁波三星医疗电气股份有限公司 | 一种基于delphi工具开发的软件的自动翻译方法 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8656372B2 (en) * | 2002-11-20 | 2014-02-18 | Purenative Software Corporation | System for translating diverse programming languages |
| CN106919434B (zh) * | 2017-03-22 | 2021-02-12 | 恒生电子股份有限公司 | 一种代码生成方法及装置 |
-
2019
- 2019-04-12 CN CN201910296123.7A patent/CN110134404A/zh active Pending
- 2019-06-19 WO PCT/CN2019/091851 patent/WO2020206840A1/zh not_active Ceased
- 2019-06-19 SG SG11201907337XA patent/SG11201907337XA/en unknown
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090125295A1 (en) * | 2007-11-09 | 2009-05-14 | William Drewes | Voice auto-translation of multi-lingual telephone calls |
| CN102073490A (zh) * | 2009-11-25 | 2011-05-25 | 阿里巴巴集团控股有限公司 | 转译数据库语言的方法及装置 |
| CN103365838A (zh) * | 2013-07-24 | 2013-10-23 | 桂林电子科技大学 | 基于多元特征的英语作文语法错误自动纠正方法 |
| CN105242932A (zh) * | 2015-10-21 | 2016-01-13 | 宁波三星医疗电气股份有限公司 | 一种基于delphi工具开发的软件的自动翻译方法 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115859149A (zh) * | 2022-11-25 | 2023-03-28 | 华润数字科技有限公司 | 基于语言转换的操作数据生成方法和系统、设备、介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| SG11201907337XA (en) | 2020-11-27 |
| CN110134404A (zh) | 2019-08-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020206840A1 (zh) | 代码翻译方法、装置、计算机设备和存储介质 | |
| WO2020206838A1 (zh) | 代码片段翻译方法、装置、计算机设备和存储介质 | |
| US8782609B2 (en) | Test failure bucketing | |
| WO2020206837A1 (zh) | 代码片段定位方法、装置、计算机设备和存储介质 | |
| WO2022227314A1 (zh) | 动态同步测试方法、装置、设备及存储介质 | |
| CN116226170A (zh) | 一种数据库语句转换方法、装置、电子设备及存储介质 | |
| CN108984612B (zh) | 目标sql语句的获取方法、装置、计算机设备及存储介质 | |
| US9304893B1 (en) | Integrated software development and test case management system | |
| CN114116268A (zh) | Flink SQL语句的校验方法、装置、计算机设备和存储介质 | |
| CN113778852B (zh) | 一种基于正则表达式的代码分析方法 | |
| US20150193213A1 (en) | Computer Implemented System and Method for Checking a Program Code | |
| WO2019153979A1 (zh) | 文本翻译方法、装置、计算机设备和存储介质 | |
| CN113778888B (zh) | 代码自动测试方法、系统、设备及存储介质 | |
| CN119576339A (zh) | 脚本代码的处理方法及装置、非易失性存储介质 | |
| CN121455537B (zh) | 版本更新方法、装置、设备及存储介质 | |
| CN113672512A (zh) | 代码检查规则生成方法、代码检查方法、装置、介质 | |
| CN116522959A (zh) | 可视化的代码处理方法及装置、存储介质、终端 | |
| CN120540960A (zh) | 规则引擎质检方法、设备、存储介质及计算机程序产品 | |
| CN116756173A (zh) | 一种数据库转换方法、装置、设备、介质及程序产品 | |
| CN110806896A (zh) | 基于maven插件实现软件开发中国际化信息提取方法 | |
| US20230028560A1 (en) | Identification of diagnostic messages corresponding to exceptions | |
| WO2020206839A1 (zh) | 代码片段纠正方法、装置、计算机设备和存储介质 | |
| CN115629765A (zh) | 一种代码格式化方法、装置及存储介质 | |
| CN115543477A (zh) | 数据库语句的处理方法、装置及电子设备 | |
| CN115470127A (zh) | 页面兼容性处理方法、装置、计算机设备和存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19924306 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 04/02/2022) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19924306 Country of ref document: EP Kind code of ref document: A1 |