Software code multi-language real-time translation method based on deep learning

Through deep learning-based methods, stable and differentiated character encoding vectors are generated and the context-related features of the code are captured, which solves the problems of unstable identification results and context-breaking in the prior art, and achieves high-quality code multilingual translation effect.

CN119720950APending Publication Date: 2025-03-28山东衡昊信息技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411768692.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When existing software code multilingual real-time translation methods deal with source code in multiple languages, it is difficult to generate stable and differentiated character encoding vectors, resulting in unstable recognition results, and the semantics and structure of the code are highly dependent on contextual relationships. Modeling short-term or long-term related features alone may lead to feature loss or contextual splitting.

Method used

A deep learning-based method is adopted to generate character-encoded vectors through multilingual code vectorization encoding algorithms, and nonlinear processing and smoothing are performed in combination with sine transformation and logarithmic operations, and normalization factors are introduced to improve the stability and difference of vectors. At the same time, the context dynamic correlation embedding generation algorithm is used to capture short-term and long-term context correlation features, generate context feature embedding values, and generate translation results of the target language through a multilingual code translation algorithm.

Benefits of technology

Effectively capture subtle feature differences between characters, improve the stability and distribution uniformity of character encoding vectors, ensure the accuracy and fluency of feature extraction and translation results, avoid context splitting, and enhance the consistency of translation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119720950A_ABST
    Figure CN119720950A_ABST
Patent Text Reader

Abstract

The invention relates to the field of natural language processing, in particular to a software code multi-language real-time translation method based on deep learning. Comprising the steps of obtaining a source code text, segmenting a code into characters, storing the characters into a character matrix, and converting the character matrix into a numerical matrix through a coding mapping table; on the basis of the numerical matrix, using a multi-language code vectorization coding algorithm to generate a character coding vector, and using a multi-language code feature recognition algorithm to calculate and obtain a final language feature value; and generating a context feature embedded value by using a context dynamic association embedding generation algorithm, and generating a translation result of the target language by using a multi-language code translation algorithm. The problem that character coding vectors with stability and differentiation are difficult to generate when characters are processed and compared due to the fact that character sets and coding characteristics of different languages are different is solved. And the characteristic value of the character coding vector matched with the language characteristic possibly fluctuates greatly, so that the instability of the identification result is caused.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing, and in particular to a method for real-time multi-language translation of software codes based on deep learning. Background Art

[0002] With the globalization and diversification of software development, developers often face the need to use multiple programming languages ​​for project development. Different programming languages ​​have significant differences in syntax, features, ecosystems, etc., which not only increases the learning cost of developers, but also brings challenges in cross-language collaboration and code maintenance. In order to solve these problems, code multi-language real-time translation technology has emerged, aiming to convert code between different programming languages ​​through automated means to improve development efficiency, promote code reuse and enhance the flexibility of software systems. With the rapid development of deep learning technology, a software code multi-language real-time translation method based on deep learning provides new methods and ideas for code translation. Compared with traditional methods, deep learning methods can automatically learn the complex mapping relationship between the source language and the target language, reduce the dependence on manual rules, and have better generalization ability and adaptability.

[0003] With the continuous advancement of deep learning technology and the continuous expansion of application scenarios, the multi-language real-time translation method of software code based on deep learning will play an increasingly important role in software development and promote the integration and development of the programming language ecosystem.

[0004] However, the existing software code multi-language real-time translation methods have the following technical problems: the source code text contains multiple languages, and the character sets and encoding characteristics of different languages ​​are different, which makes it difficult to generate stable and differentiated character encoding vectors when processing and comparing characters; the feature values ​​of the character encoding vector matching the language characteristics may fluctuate greatly, resulting in instability in the recognition results; the semantics and structure of the code are highly dependent on the contextual relationship, and the short-term association features and long-term association features must be modeled at the same time, and modeling short-term or long-term association features separately may lead to feature loss or context fragmentation, and fail to accurately capture the global features of the code; in the multi-language translation of code, the fragmentation of context information will cause the translation results to lose logical coherence. Summary of the invention

[0005] The present invention provides a multi-language real-time translation method for software codes based on deep learning, so as to solve the problems that the source code text contains multiple languages, the character sets and encoding characteristics of different languages ​​are different, which makes it difficult to generate stable and differentiated character encoding vectors when processing and comparing characters; the feature values ​​of the character encoding vectors matching the language characteristics may fluctuate greatly, resulting in instability of the recognition results; the semantics and structure of the code are highly dependent on the contextual relationship, the short-term associated features and the long-term associated features must be modeled at the same time, and the modeling of short-term or long-term associated features separately may lead to feature loss or context fragmentation, and the global features of the code cannot be accurately captured; in the multi-language translation of the code, the fragmentation of context information will cause the translation results to lose logical coherence.

[0006] The present invention provides a method for real-time translation of software codes in multiple languages ​​based on deep learning, which specifically includes the following technical solutions:

[0007] A method for real-time multi-language translation of software code based on deep learning, comprising the following steps:

[0008] S1: Obtain source code text, divide the code into characters, store them in a character matrix, and convert the character matrix into a numerical matrix through a coding mapping table; based on the numerical matrix, use a multi-language code vectorization coding algorithm to generate a character coding vector;

[0009] S2: Based on the character encoding vector, the final language feature value is calculated using the multi-language code feature recognition algorithm;

[0010] S3: Based on the character encoding vector and the final language feature value, a contextual feature embedding value is generated using a contextual dynamic association embedding generation algorithm;

[0011] S4: Based on the context feature embedding value, a multilingual code translation algorithm is used to generate the translation result of the target language.

[0012] Preferably, the S1 specifically includes:

[0013] In the process of implementing the multi-language code vectorization encoding algorithm, the character value is processed nonlinearly and smoothed by combining sine transform and logarithmic operation, and a normalization factor is introduced to obtain the character encoding vector. The calculation formula of the character encoding vector is:

[0014]

[0015] Among them, v i,j represents the encoding vector of the jth character in the i-th row after vectorization; c i,j Represents the value of the jth character in the i-th line of the source code; sin(c i,j+φ) means adding a random phase offset to the character value and performing a nonlinear transformation through a sine function; φ means a random phase offset; log(1+|c i,j |) means taking the logarithm of the absolute value of the character value plus 1; Indicates taking the square root of the absolute value of the character value plus 1; 1+|c i,j |+∈ represents a normalization operation; ∈ represents a very small positive number.

[0016] Preferably, the S2 specifically includes:

[0017] In the implementation process of the multi-language code feature recognition algorithm, the character encoding vector is extracted and matched with the language weight vector to obtain the feature value. The matching process generates a comprehensive language feature value by weighting each character encoding vector and language weight vector.

[0018] Preferably, the S2 specifically includes:

[0019] In the process of implementing the multi-language code feature recognition algorithm, the range of the comprehensive language feature value is constrained by using the inverse tangent function, and the exponential smoothing method is introduced to smooth and suppress the minimum eigenvalue, generate the final language feature value, and form a language feature matrix.

[0020] Preferably, the S2 specifically includes:

[0021] The calculation formula for the final language feature value is:

[0022]

[0023] Among them, L i,j represents the final language feature value, that is, the element of the language feature matrix; v i,j represents the encoding vector of the jth character in the i-th row after vectorization; W k represents the language weight vector; m represents the number of supported languages; represents the weighted sum of the character encoding vector and all language weight vectors; arctan represents the inverse tangent function; represents an exponential smoothing term.

[0024] Preferably, the S3 specifically includes:

[0025] In the implementation process of the context dynamic association embedding generation algorithm, short-term and long-term context association features are captured to generate context feature embedding values. The calculation formula is:

[0026]

[0027] Among them, h i,jrepresents the context feature embedding value of the jth character in the i-th row; tanh represents the hyperbolic tangent activation function; L i,j Represents the final language feature value; v i,j represents the encoding vector of the jth character in the i-th row after vectorization; b (1) represents the short-term correlation feature bias term; h i-1,j represents the context feature embedding value of the jth character in the i-1th row; W (2) represents the long-term correlation feature weight matrix; b (2) represents the bias term of long-term correlation features; ln represents the natural logarithm function, which extracts the smoothed eigenvalues ​​of long-term correlation features across rows; 1+ Represents the long-term correlation feature normalization factor.

[0028] Preferably, the S4 specifically includes:

[0029] In the implementation of the multi-language code translation algorithm, the context feature embedding value is mapped through a weight matrix specific to the target language, and the bias parameter in the translation process is added to correct the translation result; and a smoothing term is introduced to smooth the amplitude of the context feature embedding value.

[0030] Preferably, the S4 specifically includes:

[0031] In the implementation process of the multi-language code translation algorithm, the context feature embedding values ​​of the current row and the previous row are combined, and the context feature embedding value of the previous row is activated after being mapped by the target language weight matrix and combined with the context feature embedding value of the current row to obtain the translation result of the target language.

[0032] Preferably, the S4 specifically includes:

[0033] The formula for generating the translation result in the target language is:

[0034]

[0035] Among them, T i,j represents the jth character in the i-th row after translation, i.e., the translation result in the target language; tanh represents the hyperbolic tangent activation function; h i,j represents the context feature embedding value of the jth character in the i-th row; h i-1,j represents the context feature embedding value of the jth character in the i-1th row; W T represents the target language specific weight matrix; b (3) Represents the bias parameter in the translation process; represents the smoothing term; tanh(h i-1,j ·W T ) represents the target language mapping of the embedding value of the context feature in the previous row.

[0036] The beneficial effects of the technical solution of the present invention are:

[0037] 1. By dividing the source code text into independent characters line by line and storing them as a character matrix, and mapping each character to a numerical matrix, the refined processing of the source code characters is ensured. With the help of a multi-language code vectorization encoding algorithm, the numerical value of each character is mapped to a unique encoding vector, realizing the differentiated representation of the source code characters and effectively capturing the subtle feature differences between characters. The difference of the character encoding vector is enhanced by random phase offset and sine transform, so that even characters with similar numerical values ​​can generate significantly different vector representations. Smoothing and normalization processing improve the stability and distribution uniformity of the character encoding vector, providing high-quality input for subsequent feature extraction and translation.

[0038] 2. Use a multi-language code feature recognition algorithm to match character encoding vectors with language weight vectors one by one to calculate eigenvalues. The matching process is achieved by weighted processing of each character encoding vector and language weight vector to generate a comprehensive language eigenvalue. The multi-language matching degree of each character in the source code is accurately extracted, which can reflect the similarity between the code and different languages. The eigenvalue range limitation and exponential smoothing method ensure the stability and controllability of the eigenvalue and avoid the error accumulation caused by extreme eigenvalues.

[0039] 3. Use the contextual dynamic association embedding generation algorithm to generate context feature embedding values. Capture the local association between characters in the current line through short-term association features. Add short-term association feature bias items to balance feature distribution and improve the expressiveness of local features. Use long-term association features to associate the context feature embedding value of the previous line with the context feature embedding value of the current line. Cross-line association modeling effectively captures the global context semantics of the code and enhances the overall understanding of the code structure and logic.

[0040] 4. Map the context feature embedding value to the target language-specific weight space, perform semantic correction on the translation result through the bias parameter, and combine the context feature embedding values ​​of the current and previous rows to effectively capture the specific semantic features of the target language, enhance the accuracy and fluency of the translation result, and further ensure the coherence of the translation result by cross-row context association, avoiding context fragmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a flow chart of a method for real-time multi-language translation of software codes based on deep learning according to the present invention. DETAILED DESCRIPTION

[0042] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0044] The following is a detailed description of a method for real-time multi-language translation of software codes based on deep learning provided by the present invention in conjunction with the accompanying drawings.

[0045] See attached Figure 1 , which shows a flowchart of a method for real-time multi-language translation of software code based on deep learning provided by an embodiment of the present invention, the method comprising the following steps:

[0046] S1. Obtain source code text, divide the code into characters, store them in a character matrix, and convert the character matrix into a numerical matrix through a coding mapping table; based on the numerical matrix, use a multi-language code vectorization coding algorithm to generate a character coding vector;

[0047] Obtain source code text, split each line of code into independent characters, and store them line by line in a character matrix structure, where each cell of the character matrix represents a character in the source code, the line number corresponds to the code line, and the column number corresponds to the position of the character in the line;

[0048] Each character is converted into a corresponding numerical value through a coding mapping table (such as ASCII or Unicode), so that the character matrix is ​​converted into a numerical matrix, in which each cell contains the numerical value (character value) of the corresponding character;

[0049] The numerical matrix structure is as follows:

[0050]

[0051] Among them, c i,j Indicates the value of the jth character in the i-th line of the source code, that is, the character value; m indicates the number of code lines; n i Indicates the number of characters in the i-th line;

[0052] In the vectorization processing stage, a multi-language code vectorization encoding algorithm is used to take each character value in the numerical matrix as an independent input to generate a stable and differentiated character encoding vector;

[0053] In order to capture the differences of characters, nonlinear processing is performed through a specific sine transform, which applies a random phase offset to the character value. The random phase offset is generated by a pseudo-random number generator and the range is set to 0 to 2π to introduce uniqueness, so that different characters will generate different mapping results even if their values ​​are close, thereby enhancing the differences of character encoding vectors;

[0054] In order to improve the stability of vectorization processing, the multi-language code vectorization encoding algorithm smoothes each character value and takes the logarithm of the absolute value of the character value to reduce the volatility of large character values. This can reduce the situation where the numerical differences between characters are too large and make the overall distribution uniform. The square root operation is further performed to slow down the fluctuation of the character value. The square root operation ensures that even for characters with large values, the feature changes will not be too drastic.

[0055] A normalization factor is introduced, which is composed of the absolute value of the character value plus a very small positive number, and is used to prevent the influence of zero values ​​or extreme values ​​on the calculation, so as to ensure that the final vector value of each character fluctuates within a reasonable range;

[0056] The calculation formula of the character encoding vector is:

[0057]

[0058] Among them, v i,j represents the encoding vector of the jth character in the i-th row after vectorization; c i,j Represents the value of the jth character in the i-th line of the source code; sin(c i,j +φ) means adding a random phase offset to the character value and performing a nonlinear transformation through a sine function to introduce randomness and periodicity, so that the encoded feature values ​​are different between different input characters. Even if the input character values ​​are close, the results after random phase offset will be significantly different; φ represents the random phase offset, which is set in the range of 0 to 2π, and repeatability is guaranteed by a fixed pseudo-random seed; log(1+|c i,j |) means taking the logarithm of the absolute value of the character value plus 1 to reduce the difference between the values; Indicates taking the square root of the absolute value of the character value plus 1, further smoothing the fluctuation range of the character value and enhancing the delicate depiction of character differences; 1+|c i,j |+∈ represents a normalization operation to avoid abnormal character encoding vectors due to excessively large character values ​​and to prevent calculation errors caused by zero values ​​or extremely small values; ∈ represents a very small positive number;

[0059] S2. Based on the character encoding vector, a multi-language code feature recognition algorithm is used to calculate the final language feature value;

[0060] Based on the character encoding vector, the final language feature value is calculated using the multi-language code feature recognition algorithm;

[0061] The multi-language code feature recognition algorithm extracts the character encoding vector and matches it with all the language weight vectors one by one in turn to calculate the feature value. The matching process is achieved by weighting each character encoding vector and language weight vector to generate a comprehensive language feature value, which reflects the degree of matching between the character encoding and the weights of multiple languages. In order to prevent the accumulated feature value from being too large or too small, resulting in unstable results, the comprehensive language feature value will be limited. The range of the comprehensive language feature value is constrained by using the inverse tangent function to limit the comprehensive language feature value to Within the range, an exponential smoothing method is introduced to smooth and suppress the extremely small eigenvalues; after a series of processing, the final language feature values ​​are generated to form a language feature matrix, in which each element corresponds to the language feature of a character;

[0062] The calculation formula for the final language feature value is:

[0063]

[0064] Among them, L i,j represents the final language feature value, that is, the element of the language feature matrix, which is used to describe the language feature of the jth character in the i-th row of the character matrix; v i,j represents the encoding vector of the jth character in the i-th row after vectorization; W k represents the language weight vector, which is used to distinguish the feature weights of different languages. The character encoding vector is projected into the language weight space to extract language-related feature values. m represents the number of supported languages. represents the weighted sum of the character encoding vector and all language weight vectors, aggregates the contribution of all language weights, and generates a comprehensive language feature value; arctan represents the inverse tangent function, which is used to limit the comprehensive language feature value to range, preventing extreme feature values ​​from having a significant impact on the results of language detection; represents the exponential smoothing term, which generates a smoothing coefficient in the range of (0, 1) by performing exponential smoothing on the absolute value of the character encoding vector, and is used to smooth and suppress the smallest eigenvalue;

[0065] S3, based on the character encoding vector and the final language feature value, using the contextual dynamic association embedding generation algorithm to generate a context feature embedding value;

[0066] Based on the character encoding vector and the final language feature value, a contextual dynamic association embedding generation algorithm is used to capture the short-term and long-term contextual association features of the code and generate a contextual feature embedding value;

[0067] In the calculation of short-term correlation features, each character encoding vector is multiplied by the language feature value of the current row, and a short-term correlation feature bias term is added to adjust the overall level of the short-term correlation feature to ensure the stability of the feature distribution;

[0068] In order to capture the long-term correlation features across rows, it is necessary to perform matrix multiplication on the context feature embedding value of the previous row and a long-term correlation feature weight matrix, and take the logarithm for smoothing to effectively reduce feature fluctuations and noise interference. A long-term correlation feature normalization factor is further introduced. The long-term correlation feature normalization factor is the square root of the long-term correlation feature value plus a long-term correlation feature bias term to ensure that the amplitude of the feature value remains within a reasonable range.

[0069] After adding the short-term correlation features and the long-term correlation features, a hyperbolic tangent activation function is applied to limit the context feature embedding value to the range of [-1, 1] to ensure the stability of the context feature embedding value and to capture complex feature interactions while maintaining the controllability of the context feature embedding value;

[0070] The calculation formula of the context feature embedding value is:

[0071]

[0072] Among them, h i,j represents the context feature embedding value of the ith character in the ith row, combining short-term and long-term context information; tanh represents the hyperbolic tangent activation function, which limits the context feature embedding value to the range of [-1, 1] to ensure the stability of the context feature embedding value; L i,j represents the final language feature value, that is, the element of the language feature matrix, which is used to describe the language feature of the jth character in the i-th row of the character matrix; v i,j represents the encoding vector of the ith character in the ith row after vectorization; b (1) It represents the short-term correlation feature bias item, which is used to adjust the overall level of the short-term correlation feature. It can be set according to the specific implementation scenario and is not limited here. i-1,j represents the context feature embedding value of the character in the i-1th row; W (2) represents the long-term correlation feature weight matrix, which is used to extract cross-bank long-term correlation features and can be set according to specific implementation scenarios and is not limited here; b (2) represents the long-term correlation feature bias term, which adjusts the offset of long-term correlation feature modeling. It can be set according to the specific implementation scenario and is not limited here. ln represents the natural logarithm function, which extracts the smoothed eigenvalue of the cross-row long-term correlation feature. Represents the normalization factor of long-term correlation features, limiting the amplitude of feature values;

[0073] The context feature embedding value reflects the comprehensive features of the current character, which includes both the short-term context information of the current line and the long-term context association of the previous line;

[0074] S4, based on the context feature embedding value, using a multilingual code translation algorithm to generate a translation result in the target language;

[0075] Based on the context feature embedding value, a multilingual code translation algorithm is used to generate the translation result of the target language;

[0076] The multi-language code translation algorithm maps the context feature embedding value through a weight matrix specific to the target language, thereby converting it into the semantic space of the target language, and correcting the translation result with the bias parameter in the translation process to ensure that the translation result can adapt to the distribution characteristics of the target language; at the same time, in order to prevent the context feature embedding value from being too large or too small during the calculation process, a smoothing term is used to perform smoothing processing, and the amplitude of the context feature embedding value is limited to a certain range, ensuring that the calculation result is always in a stable state;

[0077] In order to ensure the contextual consistency of the translation, the multi-language code translation algorithm combines the contextual feature embedding values ​​of the current row and the previous row, activates the contextual feature embedding value of the previous row after being mapped by the target language weight matrix, and combines it with the contextual feature embedding value of the current row, so as to achieve semantic coherence in the translation process;

[0078] The formula for generating the translation result in the target language is:

[0079]

[0080] Among them, T i,j represents the jth character in the i-th row after translation, i.e., the translation result in the target language; tanh represents the hyperbolic tangent activation function, which is used to perform nonlinear activation on the translation features and limit the output range to [-1, 1] to improve the smoothness and stability of the translation result; h i,j represents the context feature embedding value of the jth character in the i-th row; h i-1,j represents the context feature embedding value of the jth character in the i-1th row; W T represents the target language-specific weight matrix, which is used to adjust the translation direction of the context embedding; b (3) Represents the bias parameter in the translation process, which is used to correct the overall distribution of translation results; represents the smoothing term, which smoothes the amplitude of the context feature embedding value to prevent the context feature embedding value from being too large and causing numerical instability, while improving the stability and efficiency of the calculation; tanh(h i-1,j ·W T) represents the target language mapping of the previous line of context feature embedding values, which is processed by the hyperbolic tangent function to provide the previous line of context information to avoid the fragmentation of the translation context;

[0081] The use of multi-language code translation algorithms enhances the accuracy and fluency of translation results.

[0082] In summary, a method for real-time multi-language translation of software codes based on deep learning has been completed.

[0083] The order of the embodiments of the invention is for description only and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0084] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0085] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.

Claims

1. A method for real-time multi-language translation of software code based on deep learning, characterized in that: The following steps are involved: S1: Get the source code text, divide the code into characters, store them into character matrices, and convert the character matrices into numerical matrices through a coding mapping table; Based on the numerical matrix, a multi-language code vectorization encoding algorithm is used to generate a character encoding vector; S2: Based on the character encoding vector, the final language feature value is calculated using the multi-language code feature recognition algorithm; S3: Based on the character encoding vector and the final language feature value, a contextual feature embedding value is generated using a contextual dynamic association embedding generation algorithm; S4: Based on the context feature embedding value, a multilingual code translation algorithm is used to generate the translation result of the target language.

2. The method for real-time multi-language translation of software code based on deep learning according to claim 1, characterized in that: The S1 specifically includes: In the process of implementing the multi-language code vectorization encoding algorithm, the character value is processed nonlinearly and smoothed by combining sine transform and logarithmic operation, and a normalization factor is introduced to obtain the character encoding vector. The calculation formula of the character encoding vector is: Among them, v i,j represents the encoding vector of the jth character in the i-th row after vectorization; c i,j Represents the value of the jth character in the i-th line of the source code; sin(c i,j +φ) means adding a random phase offset to the character value and performing a nonlinear transformation through a sine function; φ means a random phase offset; log(1+|c i,j |) means taking the logarithm of the absolute value of the character value plus 1; Indicates taking the square root of the absolute value of the character value plus 1; 1+|c i,j |+∈ represents a normalization operation; ∈ represents a very small positive number.

3. The method for real-time multi-language translation of software code based on deep learning according to claim 1, characterized in that: The S2 specifically includes: In the implementation process of the multi-language code feature recognition algorithm, the character encoding vector is extracted and matched with the language weight vector to obtain the feature value. The matching process generates a comprehensive language feature value by weighting each character encoding vector and language weight vector.

4. The method for real-time multi-language translation of software code based on deep learning according to claim 3, characterized in that: The S2 specifically includes: In the process of implementing the multi-language code feature recognition algorithm, the range of the comprehensive language feature value is constrained by using the inverse tangent function, and the exponential smoothing method is introduced to smooth and suppress the minimum eigenvalue, generate the final language feature value, and form a language feature matrix.

5. A method for real-time multi-language translation of software code based on deep learning according to claim 4, characterized in that: The S2 specifically includes: The calculation formula for the final language feature value is: Among them, L i,j represents the final language feature value, that is, the element of the language feature matrix; v i,j represents the encoding vector of the jth character in the i-th row after vectorization; W k represents the language weight vector; m represents the number of supported languages; represents the weighted sum of the character encoding vector and all language weight vectors; arctan represents the inverse tangent function; represents an exponential smoothing term.

6. The method for real-time multi-language translation of software code based on deep learning according to claim 1, characterized in that: The S3 specifically includes: In the implementation process of the context dynamic association embedding generation algorithm, short-term and long-term context association features are captured to generate context feature embedding values. The calculation formula is: Among them, h i,j represents the context feature embedding value of the jth character in the i-th row; tanh represents the hyperbolic tangent activation function; L i,j Represents the final language feature value; v i,j represents the encoding vector of the jth character in the i-th row after vectorization; b (1) represents the short-term correlation feature bias term; h i-1,j represents the context feature embedding value of the jth character in the i-1th row; W (2) represents the long-term correlation feature weight matrix; b (2) represents the bias term of long-term correlation features; ln represents the natural logarithm function, which extracts the smoothed eigenvalues ​​of the long-term correlation features across rows; Represents the long-term correlation feature normalization factor.

7. The method for real-time multi-language translation of software code based on deep learning according to claim 1, characterized in that: The S4 specifically includes: In the implementation of the multi-language code translation algorithm, the context feature embedding value is mapped through a weight matrix specific to the target language, and the bias parameter in the translation process is added to correct the translation result; and a smoothing term is introduced to smooth the amplitude of the context feature embedding value.

8. The method for real-time multi-language translation of software code based on deep learning according to claim 7, characterized in that: The S4 specifically includes: In the implementation process of the multi-language code translation algorithm, the context feature embedding values ​​of the current row and the previous row are combined, and the context feature embedding value of the previous row is activated after being mapped by the target language weight matrix and combined with the context feature embedding value of the current row to obtain the translation result of the target language.

9. The method for real-time multi-language translation of software code based on deep learning according to claim 8, characterized in that: The S4 specifically includes: The formula for generating the translation result in the target language is: Among them, T i,j represents the jth character in the i-th row after translation, i.e., the translation result in the target language; tanh represents the hyperbolic tangent activation function; h i,j represents the context feature embedding value of the jth character in the i-th row; h i-1,j represents the context feature embedding value of the jth character in the i-1th row; W T represents the target language specific weight matrix; b (3) Represents the bias parameter in the translation process; represents the smoothing term; tanh(h i-1,j ·W T ) represents the target language mapping of the embedding value of the context feature in the previous row.