Text translation method and device, electronic equipment and storage medium

By obtaining and scoring multiple translated texts, determining and writing back the most accurate translated text in the target development project, the problems of low translation accuracy and large human resources investment in the existing technology are solved, and higher translation accuracy and efficiency.

CN119443123APending Publication Date: 2025-02-14XIAMEN HITHIUM DIGITAL POWER TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411547056.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In the prior art, the internationalized function translation accuracy of application programs and software systems is low, and the translation process is mechanical and repetitive, which requires a lot of human resources to be invested.

Method used

By receiving instructions, the first text in the target development project is translated into a second language, multiple translated texts are obtained, and the translation score is calculated based on the calculation weights of the translation source and the number of occurrences of the result, the most accurate second text is determined, and the It writes back to the target development project.

Benefits of technology

It improves the translation accuracy of the first text in the target development project, reduces human resources investment, and improves the accuracy of translation scores and the credibility of calculation weights.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443123A_ABST
    Figure CN119443123A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a text translation method and device, electronic equipment and a storage medium, and the method comprises the steps that a first instruction is received, the first instruction indicates that a first text of a target development project is translated into a second language, and the first text corresponds to a first language; scanning a development text in the target development project to obtain a first text; obtaining a plurality of translated texts corresponding to the first text; determining a second text from the plurality of translated texts, wherein the second text corresponds to a second language; and writing the second text back to the target development project based on the development text format of the target development project. By implementing the steps in the invention, the text translation accuracy of an application program and a software system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric power equipment, and in particular to a text translation method, device, electronic equipment and storage medium. Background Art

[0002] In the era of globalization, in order to better serve global users, applications and software systems need to be able to automatically match and display the corresponding language interface when they are accessed based on the user's geographic location and language preference. For example, if the management interface of the user terminal of the energy management system cannot adapt to the user's language to display the corresponding language interface, it will greatly affect the user's normal use.

[0003] Therefore, language internationalization has become an indispensable function in modern software systems. Traditional internationalization methods usually require developers to manually add internationalization functions to the code to cover the parts that require multi-language support. In the above process, developers are often required to organize resource files and translate them by themselves. The translation process in the above development process is mechanical and repetitive, requiring a lot of human resources, which leads to the problem of low translation accuracy of internationalization functions of applications and software systems. Summary of the invention

[0004] In response to the above problems, the present application example provides a text translation method, device, electronic device and storage medium, which are conducive to improving the translation accuracy of text in application programs and software systems.

[0005] To achieve the above-mentioned purpose, in a first aspect, an embodiment of the present application provides a text translation method, which includes: receiving a first instruction, the first instruction instructing to translate a first text of a target development project into a second language, the first text corresponding to the first language; scanning the development text in the target development project to obtain the first text; obtaining multiple translation texts corresponding to the first text; determining a second text from the multiple translation texts, the second text corresponding to the second language; and writing the second text back to the target development project based on the development text format of the target development project.

[0006] It can be seen that in the embodiment of the present application, by obtaining multiple translation texts of the first text, the most accurate second text can be determined among the multiple translation texts, and then the second text is written back to the target development project, thereby improving the accuracy of the first text in the target development project.

[0007] In combination with the first aspect, in a possible embodiment, determining the second text from multiple translation texts includes: obtaining a calculation weight of a translation source corresponding to a target translation text, the target translation text being one of the multiple translation texts; obtaining a result occurrence count corresponding to the target translation text, the result occurrence count being the number of times a text whose similarity to the target translation text is higher than a first preset threshold value appears in the target translation text and multiple translation texts; calculating a translation score corresponding to the target translation text according to the calculation weight of the translation source corresponding to the target translation text and the result occurrence count; and determining the translation result with the highest translation score as the second text.

[0008] It can be seen that in the embodiment of the present application, the translation score of each translated text is calculated by the calculation weight of the corresponding translation source of the translated text and the number of occurrences of the translation result of the translated text, and the influence of the translation source and the number of result calculations of each translated text on the translation score is taken into account, thereby improving the accuracy of the translation score, and then improving the translation accuracy of the second text determined according to the translation score.

[0009] In combination with the first aspect, in a possible embodiment, obtaining the calculation weight corresponding to the target translation text includes: obtaining the default initial weight of the translation source corresponding to the target translation text; obtaining the correction coefficient of the target translation source; the correction coefficient includes the accuracy coefficient corresponding to the target translation source and / or the user feedback coefficient corresponding to the target translation source, the accuracy coefficient represents the translation accuracy of the historical translation text of the target translation source, and the user feedback coefficient represents the user's feedback on the historical translation text of the target translation source; the default initial weight is corrected according to the correction coefficient to obtain the calculation weight corresponding to the target translation text.

[0010] It can be seen that in the embodiment of the present application, when selecting the second text from multiple translation texts, the accuracy coefficient of the historical translation text of the translation source corresponding to each target translation text and the user feedback coefficient for the translation source corresponding to the target translation text are taken into consideration, thereby improving the translation accuracy of the second text finally determined.

[0011] In combination with the first aspect, in a possible embodiment, after writing the second text back to the target development project based on the development text format of the target development project, the accuracy of the target translation text is calculated, and the smaller the difference between the target translation text and the second text, the higher the accuracy of the target translation text; obtain a first smoothing coefficient, and update the accuracy coefficient according to the first smoothing coefficient and the accuracy of the target translation text.

[0012] It can be seen that in the embodiment of the present application, the accuracy coefficient of each translated text is updated by the degree of similarity between each translated text and the second text, so that when the calculation weight of each translated text is calculated next time, the translation accuracy of the historical translation text obtained by the last translation of the translation source corresponding to each translated text is taken into account, so that the translation accuracy of each translation source can affect the calculation weight of the corresponding translation source, thereby improving the credibility of the calculation weight of each translated text.

[0013] In combination with the first aspect, in a possible embodiment, after the second text is written back to the target development project based on the development text format of the target development project, a user score of the target translation text is obtained, and the higher the target user's evaluation of the target translation text, the higher the user score of the target translation text; a second smoothing coefficient is obtained, and a user feedback coefficient of the target translation text is updated according to the second smoothing coefficient and the user score of the target translation text.

[0014] It can be seen that in the embodiment of the present application, the user feedback coefficient of the translated text is updated by the user rating of the translated text, so that when the calculation weight of each translated text is calculated next time, the user rating of the translation source corresponding to each translated text reflects the user's satisfaction with the corresponding translation source, so that the user's satisfaction with each translation source can affect the calculation weight of the corresponding translation source, thereby improving the credibility of the calculation weight of each translated text.

[0015] In combination with the first aspect, in a possible embodiment, before obtaining multiple translation texts corresponding to the first text, the method also includes: obtaining a first identifier corresponding to the first text, the first identifier corresponding to a third text, and the third text corresponding to the second language; if the first identifier is obtained successfully, then obtaining the third text corresponding to the first identifier; writing the third text back to the target development project based on the development text format of the target development project; if the first identifier fails to be obtained, executing the steps of obtaining multiple translation texts corresponding to the first text and subsequent steps.

[0016] It can be seen that in the embodiment of the present application, different translated texts of the first text in different languages ​​are recorded by different identifiers. When there is a third text that has been translated into the second language of the first text, the first text is translated into the third text by direct calling, which further improves the development efficiency of the application and software system.

[0017] In combination with the first aspect, in a possible embodiment, if the first identifier fails to be obtained, after determining the second text from multiple translated texts, the method also includes: generating a second identifier based on the second text, the second identifier being at least one character in the second text that is not greater than a second preset number; determining whether the second identifier is the same as multiple preset identifiers, the preset identifiers respectively corresponding to different third texts; if the second identifier is different from all the preset identifiers, determining the second identifier as the first identifier corresponding to the first text; if the second identifier is the same as any one of the multiple preset identifiers, deduplicating the second identifier to obtain a processed second identifier, so that the second identifier is different from all the preset identifiers; and determining the processed second identifier as the first identifier corresponding to the first text.

[0018] It can be seen that in the embodiment of the present application, by generating a first identifier of the first text, when the first text needs to be translated again in the future, the third text of the first text can be obtained through the first identifier as the translation result of the first text, thereby further improving the development efficiency of the application and software system.

[0019] In a second aspect, an embodiment of the present application provides a text translation device for executing a text translation method, the device comprising:

[0020] A receiving unit, configured to receive a first instruction, the first instruction instructing to translate a first text of a target development project into a second language, the first text corresponding to the first language;

[0021] A scanning unit, used for scanning a development text in a target development project to obtain a first text;

[0022] An acquisition unit, used for acquiring a plurality of translation texts corresponding to the first text;

[0023] a determining unit, configured to determine a second text from a plurality of translated texts, the second text corresponding to a second language;

[0024] The writing-back unit is used to write the second text back to the target development project based on the development text format of the target development project.

[0025] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and one or more instructions are suitable for being loaded by the processor and executing part or all of the method of the first aspect.

[0026] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the method of the first aspect.

[0027] In a fifth aspect, the present application provides a computer program product. When a computer reads and executes the computer program product, the computer executes part or all of the method of the first aspect.

[0028] It can be understood that the beneficial effects of the embodiments described in the second to fifth aspects can refer to the beneficial effects of the method described in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0030] Figure 1 A schematic diagram of an application scenario of a text translation method provided in an embodiment of the present application;

[0031] Figure 2 A flowchart of a text translation method provided in an embodiment of the present application;

[0032] Figure 3 A schematic diagram of a connection between a development terminal and a translation server provided in an embodiment of the present application;

[0033] Figure 4 A schematic diagram of a database provided in an embodiment of the present application;

[0034] Figure 5 A flowchart of another text translation method provided in an embodiment of the present application;

[0035] Figure 6 A schematic diagram of the structure of an energy storage device provided in an embodiment of the present application;

[0036] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0039] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0040] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0041] See also Figure 1 , Figure 1 A schematic diagram of an application scenario of a text translation method provided in an embodiment of the present application, the application scenario 100 includes a development terminal 101, a user terminal 102, and a translation source 103. The development terminal 101 is specifically used to develop applications and software systems through different software development frameworks (such as the Flutter framework for developing mobile applications, etc.), the development terminal 101 is connected to the user terminal 102, and the user terminal 102 obtains the application and software system developed by the development terminal 101, and the software implements various functions. The translation source 103 here is used to translate the text provided by the translation development terminal into text in other languages, and can specifically be a translation server that provides translation services and is connected to the development terminal 101, and a translation model and algorithm running in the development terminal 101.

[0042] In the embodiment of the present application, the development terminal 101 receives a first instruction, where the first instruction is input by a developer to the development terminal 101, and is used to instruct the development terminal 101 to translate a first text in a target development project into a second language, where the first text corresponds to the first language and the second text corresponds to the second language. The development project here specifically includes text related to the code, function, object, comment, etc. that implements the target program.

[0043] The development terminal 101 scans the development text in the development project according to the first instruction to obtain the first text. The first text is a text in the first language in the development project, and can specifically be an internationalization function, which is used to be displayed to the user of the user terminal 102 when the application program and the software system in the user terminal 102 are running. If the first language is a language such as Chinese that will not be confused with the program code, the first text can be directly obtained from the development project. If the first language is a language such as English that is easily confused with the program code, it is necessary to obtain it from the program code through keyword recognition, semantic recognition, format recognition, etc.

[0044] The development terminal 101 translates the first text through the translation source 103 . The development terminal 101 can be connected to multiple different translation sources 103 , so that multiple translation texts corresponding to the first text can be obtained, and the multiple translation texts come from different translation sources 103 .

[0045] The development terminal 101 determines a second text from the multiple translation texts. The second text here is a text with the highest translation accuracy determined by the development terminal 101 from the multiple translation texts based on the predicted translation accuracy of each translation text.

[0046] After determining the second text, the development terminal writes the second text back to the target development project based on the development text format of the target development project to replace the first text. The development text format here specifically refers to the format requirements of the development framework of the target development project for the first text and the second text.

[0047] It can be seen that in the embodiment of the present application, by obtaining multiple translation texts of the first text, the most accurate second text can be determined among the multiple translation texts, and then the second text is written back to the target development project, thereby improving the accuracy of the first text in the target development project.

[0048] See also Figure 2 , Figure 2 A flowchart of a text translation method provided in an embodiment of the present application can be based on Figure 1 The application scenario shown is implemented as follows Figure 2 As shown, steps S201-S205 are included.

[0049] S201: A development terminal receives a first instruction, where the first instruction instructs to translate a first text of a target development project into a second language, the first text corresponding to the first language.

[0050] Specifically, the first instruction here is used to instruct the development terminal to translate a first text in a first language in the target development project into a second text in a second language, so that the application program and software system of the target development project can support the use of users who use the second language.

[0051] S202: The development terminal scans the development text in the target development project to obtain a first text.

[0052] Specifically, the development terminal obtains a first text from the target development project. The first text is specifically a function in the target development project, and its expression form is a plurality of continuous character strings in a first language, and is mostly used for displaying to the user in an application and a software system of the user terminal.

[0053] Furthermore, the development text in the target development project includes one or more first texts. If there are identical first texts in the multiple first texts, the development terminal will merge the multiple identical first texts.

[0054] S203: The development terminal obtains multiple translation texts corresponding to the first text.

[0055] Specifically, in the embodiment of the present application, the development terminal has not translated the first text, and therefore it is necessary to obtain multiple translation texts corresponding to the first text, where the multiple translation texts are obtained based on translation sources such as different translation servers and algorithms.

[0056] Furthermore, if the first text also exists in the development project before the target development project, and the development terminal translates the first text and determines the translation result (third text) of the first text in the second language, a first identifier of the first text is generated, and the correspondence between the first identifier and the first text and the third text is recorded in the database. At this time, the first identifier corresponding to the first text can be obtained, and then the corresponding third text can be obtained according to the first identifier, and the third text can be written back to the target development project to complete the first instruction.

[0057] In a possible embodiment, obtaining multiple translation texts corresponding to a first text includes: generating a translation request based on the first text and a second language, the translation request being used to indicate translation of the first text into a text in a second language; sending the translation request to multiple translation servers; and receiving multiple translation texts sent by the multiple translation servers in response to the translation request.

[0058] Specifically, the translation server here is used to provide a translation server to the development terminal. The translation server is specifically a server of a third-party translation website, a ChatGPT server, etc.

[0059] In the embodiment of the present application, the development terminal generates a translation request according to the first text and the second language, and the translation request indicates that the first text is translated into the second reason. Figure 3 , Figure 3A schematic diagram of a connection between a development terminal and a translation server provided in an embodiment of the present application. It can be seen that a development terminal 301 is connected to multiple translation servers 302, each of which represents a third-party translation website, and the development terminal sends a translation request to each translation server through the application program and software system programming interface (API) of each translation server 302, and receives the translation text sent by each translation server in response to the translation request.

[0060] It can be seen that in the embodiment of the present application, by sending a translation request to multiple translation servers, multiple translation texts are obtained, and a second text with the best translation accuracy is selected from the multiple translation texts, and then the first text in the target development project is automatically translated into the second language, thereby improving the development efficiency of applications and software systems while improving the accuracy of the translation.

[0061] Optionally, in a possible embodiment, obtaining multiple translation texts corresponding to the first text includes: inputting the first text and the second language into multiple different translation models respectively, and obtaining translation texts output by multiple different translation models. The multiple different translation models here are based on different technical implementations, such as neural networks, attention mechanisms, transformers, etc. If the multiple different translation models are implemented based on the same technical principles, the multiple different translation models are trained through different samples, and each training data corresponds to a technical scenario, such as a social application and software system scenario, a tool application and software system scenario, etc.

[0062] In a possible embodiment, if the translation server is a ChatGPT server, before sending translation requests to multiple translation servers, the method further includes: obtaining associated text of the first text, the associated text corresponds to the first language, and the associated text is a text whose distance from the first text during the display stage of the user terminal does not exceed a preset distance; when sending translation requests to multiple translation servers, the associated text is sent to the ChatGPT server. So that the ChatGPT server can translate the first text based on the associated text of the first text, thereby improving the translation accuracy of the translation text provided by the ChatGPT server.

[0063] S204: The development terminal determines a second text from the multiple translation texts, where the second text corresponds to the second language.

[0064] Specifically, the development terminal selects one from the multiple translation texts as the second text by calculating the predicted translation accuracies of the multiple translation texts and determining the text with the highest predicted translation accuracy among the multiple translation texts as the second text.

[0065] In a possible embodiment, determining the second text from multiple translated texts includes: obtaining a calculation weight of a translation source corresponding to a target translated text, the target translated text being one of the multiple translated texts; obtaining a result occurrence count of the target translated text, the result occurrence count being the number of times the target translated text and texts in the multiple translated texts whose similarity to the target translated text is higher than a first preset threshold appear in the multiple translated texts; calculating a translation score of the target translated text according to the calculation weight of the translation source corresponding to the target translated text and the result occurrence count; and determining the translation result with the highest translation score as the second text.

[0066] Specifically, in the embodiment of the present application, the translation score of each translation text is calculated by the calculation weight of each translation text and the number of occurrences of the result. Here, the calculation process is explained by taking one target translation text among multiple translation texts.

[0067] The development terminal first obtains the calculation weight of the translation source corresponding to the target translation text. The corresponding translation source here is the source of generating the target translation text, which can be a translation model or translation server running locally on the development terminal. There is a direct correspondence between the translation source and the calculation weight. The calculation weight here is calculated based on the historical translation accuracy of the corresponding translation source.

[0068] After determining the calculation weight of the target translation text, the development terminal calculates the number of occurrences of the target translation text result, where the number of occurrences of the result specifically refers to the number of times a text having a similarity with the target translation text higher than a first preset threshold value appears in multiple translation texts.

[0069] For example, if the first text includes four translation texts, namely "ABCDE", "ABCDE", "AACDE" and "ACCDE", and if the first preset threshold is 90%, it can be seen that the number of times "ABCDE" appears in the four translation texts is 2, so the number of times the results corresponding to the two "ABCDE"s appear is "2". The number of times the results corresponding to "AACDE" and "ACCDE" appear is "1".

[0070] The development terminal calculates the translation score of the target translation text according to the calculation weight of the translation source corresponding to the target translation text and the number of occurrences of the result. The calculated translation score satisfies the following formula (1):

[0071] S i =w i ·f i (1)

[0072] Where S i The translation score of the target translation text, w i is the calculation weight of the translation source corresponding to the target translation text, fi The number of occurrences of the result for the target translation text.

[0073] After the development terminal calculates the translation score of each translation text, the translation result with the highest translation score is determined as the second text.

[0074] Furthermore, the translation score of each translated text is calculated synchronously.

[0075] It can be seen that in the embodiment of the present application, the translation score of each translated text is calculated by the calculation weight of the corresponding translation source of the translated text and the number of occurrences of the translation result of the translated text, and the influence of the translation source and the number of result calculations of each translated text on the translation score is taken into account, thereby improving the accuracy of the translation score, and then improving the translation accuracy of the second text determined according to the translation score.

[0076] In a possible embodiment, obtaining a calculation weight corresponding to a target translation text includes: obtaining a default initial weight of a translation source corresponding to the target translation text; obtaining a correction coefficient of the target translation source; the correction coefficient includes an accuracy coefficient corresponding to the target translation source and / or a user feedback coefficient corresponding to the target translation source, the accuracy coefficient represents the translation accuracy of a historical translation text of the target translation source, and the user feedback coefficient represents user feedback on the historical translation text of the target translation source; and correcting the default initial weight according to the correction coefficient to obtain a calculation weight corresponding to the target translation text.

[0077] Specifically, in the embodiment of the present application, after determining a plurality of translation texts, the development terminal determines the calculation weight of each translation text based on the default initial weight of the translation source of each translation text and the correction coefficient of the target translation source, thereby determining the translation text with the highest calculation weight, that is, the most accurate translation. The correction coefficient includes the accuracy coefficient corresponding to the target translation source and / or the user feedback coefficient corresponding to the target translation source.

[0078] The accuracy coefficient here is determined based on the difference between the translation text obtained from the translation source history corresponding to the target translation text and the translation text finally determined as the second text. Figure 1 The user of the user terminal 102 shown in the figure determines the evaluation information of the historical translation text determined as the second text of the translation source corresponding to the target translation text.

[0079] For example, taking the correction coefficient including the accuracy coefficient and the user feedback coefficient as an example, the calculation weight corresponding to the target translation text satisfies the following formula (2):

[0080] w i =w basic ·u i ·hi (2)

[0081] where w i is the calculation weight corresponding to the target translation text; w basic is the default initial weight of the translation source corresponding to the target translation text, u i h is the user feedback coefficient of the translation source corresponding to the target translation text; i The accuracy coefficient of the translation source corresponding to the target translation text.

[0082] It can be seen that in the embodiment of the present application, when selecting the second text from multiple translation texts, the accuracy coefficient of the historical translation text of the translation source corresponding to each target translation text and the user feedback coefficient for the translation source corresponding to the target translation text are taken into consideration, thereby improving the translation accuracy of the second text finally determined.

[0083] In a possible embodiment, after writing the second text back to the target development project based on the development text format of the target development project, the accuracy of the target translation text is calculated, and the smaller the difference between the target translation text and the second text, the higher the accuracy of the target translation text; a first smoothing coefficient is obtained, and the accuracy coefficient is updated according to the first smoothing coefficient and the accuracy of the target translation text.

[0084] Specifically, after writing the second text back to the target development project based on the development text format of the target development project, the development terminal will update the accuracy coefficients of multiple translation texts and corresponding translation sources based on the differences between the multiple translation texts and the second text. In the embodiment of the present application, the target translation text is taken as an example, and the target translation text here is one of the multiple translation texts.

[0085] The development terminal first obtains the current accuracy coefficient of the translation source corresponding to the target translation text. Then the accuracy of the target translation text is calculated. The accuracy here is calculated based on the similarity between the target translation text and the second text.

[0086] For example, if the target translation text is "QWERT" and the second text is "QWERR", the similarity between the target translation text and the second text is 80%, and the translation accuracy of the target translation server is "8". If the target translation text is the second text, the translation accuracy of the target translation server is "10".

[0087] The accuracy coefficient is updated according to the first smoothing coefficient and the accuracy of the target translation text, and the updated accuracy coefficient satisfies the following formula (3):

[0088] h 2 =α·h 1 +(1-α)vaccuracy i(3)

[0089] Among them, h 2 is the updated translation accuracy coefficient; h 1 is the accuracy coefficient before updating; α is the first smoothing coefficient, 0<α<1; accuracy i For translation accuracy.

[0090] It can be seen that in the embodiment of the present application, the user feedback coefficient of the translated text is updated by the user rating of the translated text, so that when the calculation weight of each translated text is calculated next time, the user rating of the translation source corresponding to each translated text reflects the user's satisfaction with the corresponding translation source, so that the user's satisfaction with each translation source can affect the calculation weight of the corresponding translation source, thereby improving the credibility of the calculation weight of each translated text.

[0091] In a possible embodiment, after writing the second text back to the target development project based on the development text format of the target development project, a user score of the target translation text is obtained, and the higher the target user's evaluation of the target translation text, the higher the user score of the target translation text; a second smoothing coefficient is obtained, and a user feedback coefficient of the target translation text is updated according to the second smoothing coefficient and the user score of the target translation text.

[0092] Specifically, after writing the second text back to the target development project based on the development text format of the target development project, the development terminal will update the corresponding user feedback coefficient of the target translation text based on the user score of the target user for the target translation text. Since only the second text will be written back to the target development project and sent to the user terminal, and evaluated by the target user of the user terminal, the target translation text here actually refers to the translation text determined as the second text.

[0093] The user rating of the target translation text is generated based on the target user's evaluation of the readability, translation accuracy, translation speed, etc. of the target translation text, and is sent to the development terminal through the user terminal. The user rating can be 5 points, 10 points, etc.

[0094] The user feedback coefficient of the target translation text is updated according to the second smoothing coefficient and the user rating of the target translation text. The updated user feedback coefficient satisfies the following formula (4):

[0095] u 2 =β·u 1 +(1-β) feedback i (4)

[0096] Among them, u 2 is the updated user feedback coefficient; β is the second smoothing coefficient, 0<β<1; u 1is the user feedback coefficient before the update; feedback i Rate the user.

[0097] After the user feedback coefficient and the second accuracy coefficient of the target translation server are determined, the new calculation weight of the target translation server can be calculated according to formula (2).

[0098] It can be seen that in the embodiment of the present application, the user feedback coefficient of the translated text is updated by the user rating of the translated text, so that when the calculation weight of each translated text is calculated next time, the satisfaction degree of the translated text once provided by the user for the translation source of each translated text is taken into account, thereby improving the credibility of the calculation weight of each translated text.

[0099] It can be seen that in the embodiment of the present application, the user feedback coefficient of the translated text is updated by the user rating of the translated text, so that when the calculation weight of each translated text is calculated next time, the user rating of the translation source corresponding to each translated text reflects the user's satisfaction with the corresponding translation source, so that the user's satisfaction with each translation source can affect the calculation weight of the corresponding translation source, thereby improving the credibility of the calculation weight of each translated text.

[0100] S205: The development terminal writes the second text back to the target development project based on the development text format of the target development project.

[0101] Specifically, the development terminal writes the second text back to the target development project based on the development text format of the target development project so that the second text replaces the first text here, thereby achieving translation of the first text.

[0102] In addition, the second text here will be saved in a dedicated folder named after the second language instruction, and saved in a development text format as a language file specified by the development framework corresponding to the target development project, so that the application and software system corresponding to the target development project can support the second language.

[0103] In a possible embodiment, before obtaining multiple translation texts corresponding to the first text, the method also includes: obtaining a first identifier corresponding to the first text, the first identifier corresponding to a third text, and the third text corresponding to the second language; if the first identifier is successfully obtained, then obtaining the third text corresponding to the first identifier; writing the third text back to the target development project based on the development text format of the target development project; if the first identifier is failed to be obtained, executing the steps of obtaining multiple translation texts corresponding to the first text and subsequent steps.

[0104] Specifically, before obtaining multiple translation texts corresponding to the first text, the development terminal also attempts to obtain the first identifier corresponding to the first text from the database, where the first identifier corresponds to the third text, the third text corresponds to the second language, and is the translation text of the first text in the second language. The third text was previously obtained according to the second instruction, and the second instruction instructs the first text of the historical development project to be translated into the second language.

[0105] After determining the third text, the development terminal will generate a first identifier for the third text and store the first identifier in the database of the development terminal. The database here is specifically a key-value pair database (map) for storing identifiers (key) of different first texts. Each identifier corresponds to a value (value) in a different language, that is, the translated text in a different language.

[0106] For example, see Figure 4 , Figure 4 A schematic diagram of a database provided in an embodiment of the present application, wherein a first text corresponds to two first identifiers, and each first identifier corresponds to a third text of the first text in a language. Figure 4 The database shown also records the correspondence between other texts and other translated texts according to preset identifiers, which will not be described in detail here.

[0107] If the first identifier is obtained successfully, the development terminal can determine that a translation of the first text in the second text (i.e., the third text) exists in the database. When the third text exists in the database, the third text can be directly written back to the target development project based on the development text format of the target development project.

[0108] If the first identifier fails to be obtained, the multiple translation texts corresponding to the first text and subsequent steps are obtained. For details, please refer to steps S201-S205 and related descriptions, which will not be repeated here.

[0109] It can be seen that in the embodiment of the present application, different translated texts of the first text in different languages ​​are recorded by different identifiers. When there is a third text that has been translated into the second language of the first text, the first text is translated into the third text by direct calling, which further improves the development efficiency of the application and software system.

[0110] In a possible embodiment, if the acquisition of the first identifier fails, after determining the second text from multiple translated texts, the method also includes: generating a second identifier based on the second text, the second identifier being at least one character in the second text that is not greater than a second preset number; determining whether the second identifier is the same as multiple preset identifiers, the preset identifiers respectively corresponding to different third texts; if the second identifier is different from all the preset identifiers, determining the second identifier as the first identifier corresponding to the first text; if the second identifier is the same as any one of the multiple preset identifiers, deduplicating the second identifier to obtain a processed second identifier, so that the second identifier is different from all the preset identifiers; and determining the processed second identifier as the first identifier corresponding to the first text.

[0111] Specifically, in the embodiment of the present application, the first text does not have a corresponding first identifier, which means that in the previous project development process, the development terminal has never translated the first text into a text in the second language. Therefore, in the embodiment of the present application, the first text will be translated into the second text.

[0112] After determining the second text corresponding to the first text in the second language, the development terminal further generates a second identifier according to the second text, where the second identifier is at least one character in the second text that is not greater than a second preset number.

[0113] For example, if the second text is "aabbccddee", the second identifier of the second text is generated by the first three characters of the second text, that is, "aab". If the second text is "aabrrtttt", the second identifier of the second text is also generated by the first three characters of the second text, and the second identifier here will also be "aab". In order to prevent the second identifier generated by the development terminal from being repeated, it is necessary to determine whether the second identifier is the same as multiple preset identifiers.

[0114] The preset identifiers correspond to different third texts respectively; the preset identifiers here are generated by the development text in the process of determining other historical translation texts that need to be translated, and the preset identifiers are used to record the correspondence between the corresponding historical translation texts and the third texts corresponding to the historical translation texts, so that when the development terminal receives other translation instructions indicating that the translated text is the same as the historical translation text, the corresponding third text can be directly obtained according to the preset identifier here, without the need to determine the second text from multiple translation texts of the text.

[0115] If the second identifier is different from any of the multiple preset identifiers, the second identifier is determined as the first identifier corresponding to the first text, so that when the first text is required to be translated again in a subsequent instruction, the corresponding third text can be directly determined according to the second identifier here.

[0116] If the second identifier is the same as any one of the multiple preset identifiers, the second identifier is deduplicated to obtain a processed second identifier, so that the second identifier is different from the multiple preset identifiers; the processed second identifier is determined as the first identifier corresponding to the first text. For example, "aab" in the above example is processed as "AAB".

[0117] It can be seen that in the embodiment of the present application, by generating a first identifier of the first text, when the first text needs to be translated again in the future, the third text of the first text can be obtained through the first identifier as the translation result of the first text, thereby further improving the development efficiency of the application and software system.

[0118] In the above application embodiment, a text translation method for translating a first text by a translation server is described. Based on this, a method for translating by a local dictionary is also provided in the present application embodiment. Figure 5 , Figure 5 Another text translation method provided in an embodiment of the present application includes steps S501-S505:

[0119] S501: A development terminal receives a first instruction, where the first instruction instructs to translate a first text of a target development project into a second language, where the first text corresponds to the first language.

[0120] S502: The development terminal scans the development text in the target development project to obtain a first text.

[0121] For the detailed description of steps S501-S502, please refer to the relevant description of steps S201-S202, which will not be repeated here.

[0122] S503: The development terminal determines whether the first text is a professional text.

[0123] Specifically, the professional texts here are professional words and phrases in some professional fields, such as the remaining energy state and battery health state in the energy storage field. The development terminal can record these professional words and their translation texts in different languages ​​by importing local dictionaries.

[0124] If the first text is recorded in the local dictionary, the first text is a professional text; if the first text is not recorded in the local dictionary, the first text is not a professional text.

[0125] S504: If it is determined that the first text is a professional text, the development terminal obtains a fourth text corresponding to the first text in the local dictionary, where the fourth text corresponds to the second language.

[0126] Specifically, after determining that the first text is a professional text, the corresponding fourth text can be directly obtained from the local dictionary.

[0127] S505: Writing the fourth text back to the target development project based on the development text format of the target development project.

[0128] For a detailed description of writing the third text back to the target development project, please refer to the related description of writing the second text back to the target development project, which will not be repeated here.

[0129] It can be seen that in the embodiment of the present application, if the first text is a professional vocabulary, the first text is translated according to the local dictionary for professional vocabulary, thereby ensuring the professionalism of the translation and further improving the accuracy of the first text translation of the target development project.

[0130] In a possible embodiment, the target development project includes multiple first texts, and multiple translation texts corresponding to the first texts are obtained, including: determining the text serial numbers of the multiple first texts according to the semantic order of the multiple first texts; determining the associated texts of the multiple first texts respectively, the associated texts are first texts in the same display area as the corresponding first text and the difference between the text serial number and the text serial number of the corresponding first text is less than a preset threshold; if the number of associated texts of the target first text is not less than a first preset number, translating the target first text according to the associated text of the target first text to obtain multiple translation texts corresponding to the target first text; wherein the target first text is one of the multiple first texts. If the number of associated texts of the target first text is less than the first preset number, obtaining multiple candidate associated texts according to the target first text, the candidate associated texts include at least one expanded text generated according to the target first text; calculating the expansion scores of the multiple candidate associated texts respectively, the expansion score is used to characterize the fluency of the text obtained after the expanded text in the corresponding candidate associated text is merged with the target first text; determining the candidate associated text with the highest expansion score as the associated text of the target first text.

[0131] Specifically, in an embodiment of the present application, the target development project includes multiple first texts, each first text is used to be displayed in a different display area after the target development project is deployed on the user terminal, and one display area may include one or more texts.

[0132] Here, the first instruction requires that there are multiple first texts to be translated. The development terminal first determines the text requirements of the multiple first texts according to the semantic order of the multiple first texts, and determines the associated texts of the multiple first texts. The associated text here is the first text that is in the same display area as the corresponding first text and whose text sequence number is less than a preset threshold value from the text sequence number of the corresponding first text.

[0133] Exemplarily, the first text before or after the target first text is two first texts whose text sequence number difference with the target first text is less than a preset threshold "1", that is, two associated texts of the target first text. The target first text is one of the multiple first texts.

[0134] After determining the associated texts of the first text, if the number of associated texts of the target first text is not less than a first preset number, the target first text is translated according to the associated texts of the target first text to obtain multiple translation texts corresponding to the target first text. That is to say, if the target first text has a preset number (one or more) of associated texts, the target first text is translated according to multiple translation sources based on the target first text and the multiple associated texts, so that when translating the target first text, the target first text can be translated according to the associated texts of the target first text in context.

[0135] If the number of associated texts of the target first text is less than the first preset number, multiple candidate associated texts are obtained based on the target first text, and the candidate associated texts include at least one expanded text generated based on the target first text; the expanded text here is obtained by expanding the target first text by using an expansion selection algorithm, ChatGPT, etc. The expansion scores of the multiple candidate associated texts are calculated respectively, and the expansion scores are used to characterize the fluency of the text obtained by merging the expanded texts in the corresponding candidate associated texts with the target first text; the candidate associated text with the highest expansion score is determined as the associated text of the target first text.

[0136] It can be seen that in the embodiment of the present application, the first text is translated through multiple associated texts of the first text, and when there is no translated text for the first text, an expanded text is generated and the expanded text is determined as an associated text, so that the translation of the first text can be linked to the context of the first text, thereby improving the accuracy of the translated text of the first text.

[0137] By implementing the method in the above-mentioned application embodiment, it can be seen that the most accurate second text is determined in multiple translated texts, and the accuracy of the first text in the target development project is improved. The influence of the translation source corresponding to each translated text on the translation result and the influence of the number of result calculations on the translation score are considered to improve the accuracy of the translation score. The credibility of the calculation weight of each translated text is improved by the translation accuracy and user score. The different translated texts of the first text in different languages ​​are recorded by different identifiers, which improves the development efficiency of applications and software systems. By generating the first identifier of the first text, the development efficiency of applications and software systems is improved.

[0138] Based on the description of the above configuration method embodiment, the present application also provides a text translation device 600, which can be running on Figure 1 A computer program (including program code) in the application scenario shown in FIG. Figure 1 The application scenario shown in the figure is executed Figure 2 See the method shown in Figure 6 , the text translation device comprises:

[0139] A receiving unit 601 is configured to receive a first instruction, the first instruction instructing to translate a first text of a target development project into a second language, the first text corresponding to the first language;

[0140] A scanning unit 602 is used to scan the development text in the target development project to obtain a first text;

[0141] An acquisition unit 603 is used to acquire multiple translation texts corresponding to the first text;

[0142] A determining unit 604 is configured to determine a second text from the plurality of translated texts, where the second text corresponds to a second language;

[0143] The writing-back unit 605 is configured to write the second text back to the target development project based on the development text format of the target development project.

[0144] In a possible embodiment, in terms of determining the second text from multiple translation texts, the acquisition unit 603 is further specifically used to: acquire the calculation weight of the translation source corresponding to the target translation text, the target translation text being one of the multiple translation texts; acquire the number of result occurrences corresponding to the target translation text, the number of result occurrences being the number of times the target translation text and texts in the multiple translation texts whose similarity to the target translation text is higher than a first preset threshold appear in the multiple translation texts; calculate the translation score corresponding to the target translation text according to the calculation weight of the translation source corresponding to the target translation text and the number of result occurrences; and determine the translation result with the highest translation score as the second text.

[0145] In a possible embodiment, in terms of obtaining the calculation weight corresponding to the target translation text, the acquisition unit 603 is also specifically used to: obtain the default initial weight of the translation source corresponding to the target translation text; obtain the correction coefficient of the target translation source; the correction coefficient includes the accuracy coefficient corresponding to the target translation source and / or the user feedback coefficient corresponding to the target translation source, the accuracy coefficient represents the translation accuracy of the historical translation text of the target translation source, and the user feedback coefficient represents the user's feedback on the historical translation text of the target translation source; the default initial weight is corrected according to the correction coefficient to obtain the calculation weight corresponding to the target translation text.

[0146] In a possible embodiment, after writing the second text back to the target development project based on the development text format of the target development project, the determination unit 604 is further specifically used to: calculate the accuracy of the target translation text, the smaller the difference between the target translation text and the second text, the higher the accuracy of the target translation text; obtain a first smoothing coefficient, and update the accuracy coefficient according to the first smoothing coefficient and the accuracy of the target translation text.

[0147] In a possible embodiment, after writing the second text back to the target development project based on the development text format of the target development project, the acquisition unit 603 is further specifically used to: obtain a user score of the target translation text, wherein the higher the evaluation of the target user on the target translation text, the higher the user score of the target translation text; obtain a second smoothing coefficient, and update a user feedback coefficient of the target translation text according to the second smoothing coefficient and the user score of the target translation text.

[0148] In a possible embodiment, before obtaining multiple translation texts corresponding to the first text, the acquisition unit 603 is also specifically used to: obtain a first identifier corresponding to the first text, the first identifier corresponds to a third text, and the third text corresponds to the second language; if the first identifier is successfully obtained, then obtain the third text corresponding to the first identifier; write the third text back to the target development project based on the development text format of the target development project; if the first identifier fails to be obtained, execute the steps of obtaining multiple translation texts corresponding to the first text and subsequent steps.

[0149] In a possible embodiment, if the first identifier fails to be obtained, after determining the second text from multiple translated texts, the determination unit 604 is also specifically used to: generate a second identifier based on the second text, the second identifier being at least one character in the second text that is not greater than a second preset number; determine whether the second identifier is the same as multiple preset identifiers, and the preset identifiers respectively correspond to different third texts; if the second identifier is different from all the preset identifiers, determine the second identifier as the first identifier corresponding to the first text; if the second identifier is the same as any one of the multiple preset identifiers, deduplicate the second identifier to obtain a processed second identifier, so that the second identifier is different from all the preset identifiers; and determine the processed second identifier as the first identifier corresponding to the first text.

[0150] Based on the description of the above method embodiment and device embodiment, please refer to Figure 7 , Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 The electronic device 700 shown (the electronic device 700 may be a computer device, Figure 1The development terminal 101 shown includes a memory 701, a processor 702, a communication interface 703 and a bus 704. The memory 701, the processor 702 and the communication interface 703 are connected to each other through the bus 704.

[0151] The memory 701 may be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM).

[0152] The memory 701 can store programs. When the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used to perform each step of the text translation method of the embodiment of the present application.

[0153] The processor 702 can adopt a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the functions required to be performed by the units in the electronic device 700 of the embodiment of the present application, or to execute the text translation method of the method embodiment of the present application.

[0154] The processor 702 can also be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the text translation method of the present application can be completed by the hardware integrated logic circuit or software instructions in the processor 702. The above-mentioned processor 702 can also be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 701, and the processor 702 reads the information in the memory 701, and combines its hardware to complete the functions required to be performed by the units included in the electronic device 700 of the embodiment of the present application, or executes the text translation method of the method embodiment of the present application.

[0155] The communication interface 703 uses a transceiver such as, but not limited to, a transceiver to implement communication between the electronic device 700 and other devices or a communication network. For example, data can be acquired through the communication interface 703 .

[0156] The bus 704 may include a path for transmitting information between various components of the electronic device 700 (eg, the memory 701 , the processor 702 , and the communication interface 703 ).

[0157] It should be noted that although Figure 7 The electronic device 700 shown only shows a memory 701, a processor 702, and a communication interface 703. However, in the specific implementation process, those skilled in the art should understand that the electronic device 700 also includes other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the electronic device 700 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the electronic device 700 may also only include the devices necessary for implementing the embodiments of the present application, and does not necessarily include Figure 7 All devices shown in .

[0158] An embodiment of the present application further provides a chip, which includes a processor and a data interface. The processor reads instructions stored in a memory through the data interface to implement the text translation method.

[0159] Optionally, as an implementation manner, the chip may further include a memory, in which instructions are stored, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the text translation method.

[0160] An embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0161] The embodiment of the present application further provides a computer program product including instructions. When the computer program product is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0162] Those skilled in the art will appreciate that the functions described in conjunction with the various illustrative logic blocks, modules, and algorithm steps disclosed herein can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions described in the various illustrative logic blocks, modules, and steps can be stored or transmitted as one or more instructions or codes on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to tangible media, such as data storage media, or includes any media (e.g., based on a communication protocol) that facilitates the transfer of a computer program from one place to another. In this manner, computer-readable media may generally correspond to (1) non-temporary tangible computer-readable storage media, or (2) communication media, such as signals or carrier waves. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the techniques described in this application. A computer program product may include computer-readable media.

[0163] As an example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and can be accessed by a computer. Also, any connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio and microwave are included in the definition of media. However, it should be understood that the computer-readable storage media and data storage media do not include connections, carrier waves, signals or other temporary media, but are actually directed to non-temporary tangible storage media. As used herein, disks and optical disks include compact disks (CDs), laser optical disks, optical optical disks, digital versatile disks (DVDs), and Blu-ray disks, where disks typically reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0164] Instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Thus, the term "processor" as used herein may refer to any of the aforementioned structures or any other structures suitable for implementing the techniques described herein. Additionally, in some aspects, the functions described by the various illustrative logic blocks, modules, and steps described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated in a combined codec. Moreover, the techniques may be fully implemented in one or more circuits or logic elements.

[0165] The techniques of the present application may be implemented in a variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this application to emphasize functional aspects of devices for performing the disclosed techniques, but do not necessarily need to be implemented by different hardware units. In fact, as described above, the various units may be combined in an encoded hardware unit in conjunction with appropriate software and / or firmware, or provided by interoperating hardware units (including one or more processors as described above).

[0166] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the specific descriptions of the corresponding steps in the aforementioned method embodiments, and will not be repeated here.

[0167] It should be understood that in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; wherein A and B can be singular or plural. Also, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, wherein a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be necessarily different. Meanwhile, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.

[0168] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the division of the unit is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling, direct coupling, or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0169] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0170] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrations. The available medium may be a read-only memory (ROM), or a random access memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a tape, a disk, or an optical medium, such as a digital versatile disc (DVD), or a semiconductor medium, such as a solid state disk (SSD), etc.

[0171] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

[0172] The device embodiments described above are merely illustrative, wherein the units and modules described as separate components may or may not be physically separated. In addition, some or all of the units and modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.

[0173] The above is only a specific implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A text translation method, characterized in that: The method comprises: receiving a first instruction, the first instruction instructing to translate a first text of a target development project into a second language, the first text corresponding to the first language; Scanning the development text in the target development project to obtain the first text; Obtaining multiple translation texts corresponding to the first text; Determining a second text from the plurality of translated texts, the second text corresponding to a second language; The second text is written back to the target development project based on a development text format of the target development project.

2. The method according to claim 1, characterized in that The determining the second text from the multiple translated texts comprises: Obtaining a calculation weight of a translation source corresponding to a target translation text, wherein the target translation text is one of the multiple translation texts; Obtaining the number of result occurrences corresponding to the target translation text, the number of result occurrences being the number of times the target translation text and texts in the multiple translation texts whose similarity to the target translation text is higher than a first preset threshold value appear in the multiple translation texts; Calculating a translation score corresponding to the target translation text according to the calculation weight of the translation source corresponding to the target translation text and the number of occurrences of the result; The translation result with the highest translation score is determined as the second text.

3. The method according to claim 2, characterized in that The step of obtaining the calculation weight corresponding to the target translation text includes: Obtaining a default initial weight of a translation source corresponding to the target translation text; Obtaining a correction coefficient of the target translation source; the correction coefficient includes an accuracy coefficient corresponding to the target translation source and / or a user feedback coefficient corresponding to the target translation source, the accuracy coefficient represents the translation accuracy of the historical translation text of the target translation source, and the user feedback coefficient represents the user's feedback on the historical translation text of the target translation source; The default initial weight is modified according to the correction coefficient to obtain a calculation weight corresponding to the target translation text.

4. The method according to claim 3, characterized in that After writing the second text back to the target development project based on the development text format of the target development project, the method further includes: Calculating the accuracy of the target translation text, the smaller the difference between the target translation text and the second text, the higher the accuracy of the target translation text; A first smoothing coefficient is obtained, and the accuracy coefficient is updated according to the first smoothing coefficient and the accuracy of the target translation text.

5. The method according to claim 3, characterized in that: After writing the second text back to the target development project based on the development text format of the target development project, the method further includes: Obtaining a user score of the target translation text, wherein the higher the evaluation of the target user on the target translation text is, the higher the user score of the target translation text is; A second smoothing coefficient is obtained, and a user feedback coefficient of the target translation text is updated according to the second smoothing coefficient and a user score of the target translation text.

6. The method according to claim 1, characterized in that Before obtaining a plurality of translation texts corresponding to the first text, the method further includes: Acquire a first identifier corresponding to the first text, the first identifier corresponds to a third text, and the third text corresponds to a second language; If the first identifier is successfully obtained, then a third text corresponding to the first identifier is obtained; writing the third text back to the target development project based on the development text format of the target development project; If the acquisition of the first identifier fails, the step of acquiring multiple translation texts corresponding to the first text and subsequent steps are executed.

7. The method according to claim 6, characterized in that If the acquisition of the first identifier fails, after determining the second text from the multiple translated texts, the method further includes: generating a second identifier according to the second text, where the second identifier is at least one character in the second text that is no greater than a second preset number; Determining whether the second identifier is the same as a plurality of preset identifiers, the preset identifiers respectively corresponding to different third texts; If the second identifier is different from any of the plurality of preset identifiers, determining the second identifier as the first identifier corresponding to the first text; If the second identifier is the same as any one of the plurality of preset identifiers, performing deduplication processing on the second identifier to obtain a processed second identifier, so that the second identifier is different from all of the plurality of preset identifiers; The processed second identifier is determined as the first identifier corresponding to the first text.

8. A text translation device, characterized in that: The device is used to perform a text translation method, and the device comprises: A receiving unit, configured to receive a first instruction, wherein the first instruction instructs to translate a first text of a target development project into a second language, the first text corresponding to the first language; A scanning unit, used for scanning a development text in a target development project to obtain a first text; An acquiring unit, configured to acquire a plurality of translation texts corresponding to the first text; a determining unit, configured to determine a second text from the plurality of translated texts, wherein the second text corresponds to a second language; A writing-back unit is used to write the second text back to the target development project based on the development text format of the target development project.

9. An electronic device, characterized in that: The method comprises a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for executing the steps in the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 7.