Intelligent assisted coding system and method based on large model and machine learning
Through the intelligent auxiliary coding system based on large models and machine learning, the problem of insufficient readability and maintainability of the traditional coding system in large code bases is solved, intelligent auxiliary coding is realized, and the efficiency and reliability of software development are improved. .
Patent Information
- Application Number
- CN202410871600.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-01
AI Technical Summary
Traditional coding systems lack unified standards and intelligent auxiliary functions when dealing with large and complex code bases, making it difficult to meet the needs of software developers, especially in terms of code readability and maintainability.
An intelligent auxiliary coding system based on large models and machine learning is used to generate optimized codes through original code collection, sentence-granular semantic understanding, semantic correlation optimization and salience enhancement modules to achieve intelligent auxiliary coding.
It improves the readability and maintainability of the code, understands the code semantics and structure through the deep learning model, provides more accurate suggestions and optimization solutions, and improves the efficiency and reliability of software development.
Smart Images

Figure CN118535142B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent assisted coding, and specifically to an intelligent assisted coding system and method based on large models and machine learning. Background Art
[0002] Coding systems are a core component of the software development process. They are tools for developers to create and maintain software, which can convert human-readable code into computer-executable instructions. In traditional coding systems, the readability and maintainability of code often rely on the personal habits and team norms of programmers, and lack unified standards. For large and complex code bases, traditional coding systems often perform poorly. In addition, traditional coding systems lack intelligent code assistance functions, such as automatic code completion, error detection, and code optimization, which all require programmers to complete manually. As the scale and complexity of software continue to increase, traditional coding systems often find it difficult to meet the needs of developers.
[0003] Therefore, an intelligent assisted encoding system is desired. Summary of the invention
[0004] This application is made in consideration of the above problems. One purpose of this application is to provide an intelligent assisted coding system and method based on a large model and machine learning.
[0005] The embodiment of the present application provides an intelligent assisted coding system based on a large model and machine learning, which includes:
[0006] The original code acquisition module is used to obtain the original code input by the user;
[0007] An original code sentence granularity semantic understanding module, used for performing sentence granularity-based semantic encoding on the original code to obtain a sequence of original code sentence unit semantic encoding vectors;
[0008] A code sentence unit semantic correlation optimization module, used for inputting the sequence of the original code sentence unit semantic coding vectors into a semantic optimization module based on internal sequence correlation to obtain a sequence of optimized original code sentence unit semantic coding vectors;
[0009] A code sentence unit semantic saliency enhancement module, used for inputting the sequence of optimized original code sentence unit semantic coding vectors into a saliency-global context semantic enhancement module to obtain a sequence of optimized original code sentence unit saliency semantic coding vectors;
[0010] The optimized code generation module is used to generate optimized code based on the sequence of significant semantic encoding vectors of the optimized original code sentence units.
[0011] For example, according to the intelligent assisted coding system based on a large model and machine learning according to an embodiment of the present application, the original code sentence granularity semantic understanding module includes:
[0012] An original code sentence unit, used for performing sentence processing on the original code to obtain a sequence of original code sentence units;
[0013] The original code sentence unit semantic encoding unit is used to semantically encode each original code sentence unit in the sequence of original code sentence units to obtain a sequence of original code sentence unit semantic encoding vectors.
[0014] For example, according to the intelligent assisted coding system based on a large model and machine learning according to an embodiment of the present application, the code sentence unit semantic relevance optimization module includes:
[0015] A vector cascading unit, used for cascading every two original code sentence unit semantic coding vectors in the sequence of original code sentence unit semantic coding vectors to obtain a sequence of multiple original code sentence unit semantic cascade representation row vectors;
[0016] An autocorrelation feature capturing unit, used to capture the autocorrelation feature of each sequence of original code sentence unit semantic cascade representation row vectors in the sequence of the plurality of original code sentence unit semantic cascade representation row vectors to obtain a sequence of autocorrelation coefficients of the plurality of original code sentence unit semantic row vectors;
[0017] A sequence arrangement unit, used to arrange the sequences of the multiple original code sentence unit semantic row vector autocorrelation coefficients into multiple original code sentence unit semantic autocorrelation coefficient row vectors;
[0018] a class support weight vector calculation unit, used to calculate the class support weight vector of each original code sentence unit semantic autocorrelation coefficient row vector in the plurality of original code sentence unit semantic autocorrelation coefficient row vectors to obtain a plurality of original code sentence unit semantic autocorrelation weight vectors;
[0019] A counting unit, used for calculating the number of vectors between every two original code sentence unit semantic coding vectors in the sequence of the original code sentence unit semantic coding vectors to obtain a plurality of original code sentence unit semantic counting vectors;
[0020] a vector weighted sum unit, configured to calculate a weighted sum of the plurality of original code sentence unit semantic count vectors by using each position feature value of each original code sentence unit semantic autocorrelation weight vector in the plurality of original code sentence unit semantic autocorrelation weight vectors as a weight, so as to obtain a sequence of original code sentence unit semantic correlation representation vectors;
[0021] An activation processing unit, used for inputting the sequence of semantic relevance representation vectors of the original code sentence units into an activation function for activation processing to obtain a sequence of semantic relevance activation representation vectors of the original code sentence units;
[0022] A first vector product calculation unit, used for calculating the product of each original code sentence unit semantic relevance activation representation vector in the sequence of original code sentence unit semantic relevance activation representation vectors and a first hyperparameter to obtain a sequence of original code sentence unit semantic relevance semantic weighted optimized feature vectors;
[0023] A second vector product calculation unit, used for calculating the product of each original code sentence unit semantic coding vector in the sequence of the original code sentence unit semantic coding vector and a second hyperparameter to obtain a sequence of original code sentence unit semantic weighted modulation representation vectors;
[0024] A positional summation unit is used to calculate the positional summation between each group of corresponding original code sentence unit semantic relevance semantic weighted optimized feature vectors and original code sentence unit semantic weighted modulation representation vectors in the sequence of the original code sentence unit semantic relevance semantic weighted optimized feature vectors and the sequence of the original code sentence unit semantic weighted modulation representation vectors to obtain the sequence of optimized original code sentence unit semantic coding vectors.
[0025] For example, according to the intelligent assisted coding system based on a large model and machine learning according to an embodiment of the present application, the autocorrelation feature capturing unit is used to:
[0026] Calculating the product between each original code sentence unit semantic cascade representation row vector in the sequence of the original code sentence unit semantic cascade representation row vectors and a preset weight feature vector to obtain a sequence of original code sentence unit semantic autocorrelation weight values;
[0027] The sequence of the original code sentence unit semantic autocorrelation weight values is subjected to nonlinear activation processing to obtain a sequence of the original code sentence unit semantic row vector autocorrelation coefficients.
[0028] For example, according to the intelligent assisted coding system based on large model and machine learning according to an embodiment of the present application, the class supports a weight vector calculation unit for:
[0029] Taking each eigenvalue in the original code sentence unit semantic autocorrelation coefficient row vector as the exponent of the natural constant to calculate the exponential function value with the natural constant as the base according to the position to obtain the original code sentence unit semantic autocorrelation class support row vector;
[0030] Calculate the sum of the feature values of each position in the semantic autocorrelation class support row vector of the original code sentence unit to obtain the semantic global autocorrelation measurement coefficient of the original code sentence unit;
[0031] The positional division between each eigenvalue in the original code sentence unit semantic autocorrelation class support row vector and the original code sentence unit semantic global autocorrelation measurement coefficient is calculated to obtain the original code sentence unit semantic autocorrelation weight vector.
[0032] For example, according to the intelligent assisted coding system based on a large model and machine learning according to an embodiment of the present application, the code sentence unit semantic significance enhancement module includes:
[0033] A mean and maximum processing unit, used to respectively calculate the mean and maximum of each optimized original code sentence unit semantic coding vector in the sequence of the optimized original code sentence unit semantic coding vector to obtain an optimized original code sentence unit semantic global representation vector composed of multiple vector means and an optimized original code sentence unit semantic salient representation vector composed of multiple vector maximum values;
[0034] A one-dimensional convolutional coding unit is used to perform one-dimensional convolutional coding on the semantic global representation vector of the optimized original code sentence unit and then pass it through The activation function is used to process the original code sentence unit semantic global representation vector to obtain the activation expression optimization;
[0035] A first matrix multiplication unit is used to perform matrix multiplication of the activation expression optimized original code sentence unit semantic global representation vector with a first trainable linear transformation weight matrix after one-dimensional convolution encoding to obtain an optimized original code sentence unit context semantic global representation feature vector;
[0036] The encoding activation unit is used to perform one-dimensional convolution encoding on the semantically prominent representation vector of the optimized original code sentence unit and then pass it through The activation function is used to process the original code sentence unit semantic salient representation vector by obtaining the activation expression optimization;
[0037] A second matrix multiplication unit is used to perform matrix multiplication of the activation expression optimized original code sentence unit semantic salient representation vector with a second trainable linear transformation weight matrix after one-dimensional convolution encoding to obtain an optimized original code sentence unit context semantic salient representation feature vector;
[0038] a non-linear activation unit, for fusing the optimized original code sentence unit context semantic global activation representation feature vector and the optimized original code sentence unit context semantic salient activation representation feature vector to obtain an optimized original code sentence unit global-salient feature context association activation feature vector, and then performing non-linear activation processing on the optimized original code sentence unit global-salient feature context association activation feature vector to obtain an optimized original code sentence unit global-salient feature context association weight feature vector;
[0039] A positional dot multiplication unit is used to perform positional dot multiplication on the sequence of semantic coding vectors of the optimized original code sentence unit using the global-salient feature context-associated weight feature vector of the optimized original code sentence unit as a weight and add the sequence of semantic coding vectors of the optimized original code sentence unit to obtain the sequence of salient semantic coding vectors of the optimized original code sentence unit.
[0040] For example, according to the intelligent assisted coding system based on a large model and machine learning according to an embodiment of the present application, the nonlinear activation unit is used to:
[0041] Fusion of the optimized original code sentence unit context semantic global activation representation feature vector and the optimized original code sentence unit context semantic prominent activation representation feature vector to obtain the optimized original code sentence unit global-prominent feature context association activation feature vector;
[0042] Using the hyperbolic tangent function and The function performs activation processing on the optimized original code sentence unit global-prominent feature context-related activation feature vector to obtain the optimized original code sentence unit global-prominent feature hyperbolic tangent activation semantic representation vector and the optimized original code sentence unit global-prominent feature S-type activation semantic representation vector;
[0043] The global-salient feature hyperbolic tangent activation semantic representation vector of the optimized original code sentence unit and the global-salient feature S-type activation semantic representation vector of the optimized original code sentence unit are multiplied by position point to obtain the global-salient feature context-related weight feature vector of the optimized original code sentence unit.
[0044] For example, according to the intelligent assisted coding system based on large models and machine learning according to the embodiments of the present application, the optimized code generation module is used to: input the sequence of optimized original code sentence unit significant semantic coding vectors into a code optimizer based on the AIGC model to obtain the optimized code.
[0045] For example, according to the intelligent assisted coding system based on a large model and machine learning according to an embodiment of the present application, it further includes a training module for training the semantic optimization module based on internal correlation of the sequence, the contextual semantic enhancement module based on significance-globality, and the code optimizer based on the AIGC model;
[0046] Wherein, the training module includes:
[0047] A training data acquisition unit, used to acquire training data, wherein the training data includes an original training code input by a user and a real optimized code;
[0048] A training original code sentence granularity semantic understanding unit, used for performing sentence granularity-based semantic encoding on the training original code to obtain a sequence of training original code sentence unit semantic encoding vectors;
[0049] A training code sentence unit semantic correlation optimization unit, used for inputting the sequence of the semantic coding vectors of the training original code sentence unit into the semantic optimization module based on internal correlation of the sequence to obtain a sequence of optimized semantic coding vectors of the training original code sentence unit;
[0050] A training code sentence unit semantic saliency reinforcement unit, used for inputting the sequence of optimized training original code sentence unit semantic coding vectors into the saliency-global-based contextual semantic reinforcement module to obtain a sequence of training optimized original code sentence unit saliency semantic coding vectors;
[0051] A training optimized code generation unit, used for inputting the sequence of significant semantic coding vectors of the training optimized original code sentence unit into the AIGC model-based code optimizer to obtain the trained optimized code;
[0052] A loss function value calculation unit, used to calculate the cross entropy loss function value between the training optimized code and the real optimized code to obtain the optimized code information loss function value;
[0053] A loss training unit is used to train the semantic optimization module based on internal sequence correlation, the contextual semantic enhancement module based on significance-globality and the code optimizer based on the AIGC model based on the optimized code information loss function value.
[0054] The embodiment of the present application also provides an intelligent assisted encoding method based on a large model and machine learning, which includes:
[0055] Get the original code entered by the user;
[0056] Performing sentence-granularity-based semantic coding on the original code to obtain a sequence of original code sentence unit semantic coding vectors;
[0057] Inputting the sequence of semantic coding vectors of the original code sentence units into a semantic optimization module based on internal correlation of the sequence to obtain a sequence of optimized semantic coding vectors of the original code sentence units;
[0058] Inputting the sequence of optimized original code sentence unit semantic coding vectors into a contextual semantic enhancement module based on saliency-globality to obtain a sequence of optimized original code sentence unit saliency semantic coding vectors;
[0059] Based on the sequence of the salient semantic encoding vectors of the optimized original code sentence units, an optimized code is generated.
[0060] According to the intelligent assisted coding system and method based on big models and machine learning in the embodiments of the present application, the original code data input by the user is collected, and the data processing and semantic understanding algorithms based on big models and machine learning are introduced in the back end to analyze the original code data, so as to learn and capture the contextual semantics based on sentence units in the original code, thereby generating optimized code. In this way, developers can be assisted in writing and optimizing codes in a smarter and more efficient way to realize intelligent assisted coding, making the software development process more efficient, intelligent and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings of the embodiments of the present application are briefly introduced below. Obviously, the drawings described below only relate to some embodiments of the present application, and are not intended to limit the present application.
[0062] Figure 1 A schematic diagram of the application architecture of an intelligent assisted coding system based on a large model and machine learning in an embodiment of the present application is shown;
[0063] Figure 2 A schematic diagram of the structure of an intelligent assisted coding system based on a large model and machine learning in an embodiment of the present application is shown;
[0064] Figure 3 A schematic diagram of the structure of the original code sentence granularity semantic understanding module of the intelligent assisted coding system based on a large model and machine learning in an embodiment of the present application is shown;
[0065] Figure 4 A flow chart of an intelligent assisted encoding method based on a large model and machine learning in an embodiment of the present application is shown;
[0066] Figure 5 An application scenario diagram of an intelligent assisted coding system based on a large model and machine learning in an embodiment of the present application is shown; and
[0067] Figure 6 A schematic diagram of a storage medium according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0068] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work also fall within the scope of protection of the present application.
[0069] The terms used in this specification are those common terms currently widely used in the art in consideration of the functions of the present application, but these terms may vary according to the intention of a person of ordinary skill in the art, precedents, or new technologies in the art. In addition, specific terms may be selected by the applicant, and in this case, their detailed meanings will be described in the detailed description of the present application. Therefore, the terms used in the specification should not be understood as simple names, but rather as a general description based on the meaning of the terms and the present application.
[0070] Although the present application makes various references to certain modules in the system according to the embodiments of the present application, any number of different modules can be used and run on the user terminal and / or server. The modules are only illustrative, and different aspects of the system and method can use different modules.
[0071] Flowcharts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps may be processed in reverse order or simultaneously as required. At the same time, other operations may also be added to these processes, or a certain step or several steps of operations may be removed from these processes.
[0072] Figure 1 A schematic diagram of the application architecture of an intelligent assisted coding system based on a large model and machine learning in an embodiment of the present application is shown, including a server 100 and a terminal device 200.
[0073] The terminal device 200 and the server 100 can be connected via the Internet to achieve mutual communication. Optionally, the above-mentioned Internet uses standard communication technology and / or protocol. The Internet is usually the Internet, but it can also be any network, including but not limited to any combination of a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or a virtual private network. In some embodiments, the data exchanged through the network can be represented by technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec), etc. can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above-mentioned data communication technologies.
[0074] The server 100 can provide various network services for the terminal device 200, wherein the server 100 can be a single server, a server cluster consisting of several servers, or a cloud computing center. Specifically, the server 100 may include a processor 110 (Center Processing Unit, CPU), a memory 120, an input device 130, and an output device 140, etc. The input device 130 may include a keyboard, a mouse, a touch screen, etc., and the output device 140 may include a display device, such as a liquid crystal display (Liquid Crystal Display, LCD), a cathode ray tube (Cathode Ray Tube, CRT), etc.
[0075] The memory 120 may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor 110 with program instructions and data stored in the memory 120. In the embodiment of the present application, the memory 120 may be used to store the corresponding method of the intelligent assisted coding system based on a large model and machine learning in the embodiment of the present application.
[0076] The processor 110 calls the program instructions stored in the memory 120, and the processor 110 is used to execute the steps of any one of the intelligent assisted encoding methods based on large models and machine learning in the embodiments of the present application according to the obtained program instructions.
[0077] In addition, the application architecture diagram in the embodiment of the present application is intended to more clearly illustrate the technical solution in the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. Of course, for other application architectures and business applications, the technical solution provided in the embodiment of the present application is also applicable to similar problems.
[0078] The following is a non-restrictive description of the intelligent assisted coding system based on large models and machine learning provided according to at least one embodiment of the present application through several examples or embodiments. As described below, different features in these specific examples or embodiments can be combined with each other without conflicting with each other to obtain new examples or embodiments, and these new examples or embodiments also fall within the scope of protection of the present application.
[0079] In response to the above technical problems, in the technical solution of this application, an intelligent assisted coding system based on a large model and machine learning is proposed, which can apply a new generation of intelligent assisted coding system to parse the original code input by the user through a large language model and a deep learning algorithm. Through the learning and reasoning capabilities of the deep learning model, the intelligent assisted coding system can understand the semantics and structure of the code, thereby providing more accurate suggestions and optimization solutions, helping developers save time and energy.
[0080] Specifically, the technical concept of this application is to collect the original code data input by the user, and introduce data processing and semantic understanding algorithms based on large models and machine learning in the back end to analyze the original code data, so as to learn and capture the contextual semantics based on sentence units in the original code, thereby generating optimized code. In this way, it is possible to assist developers in writing and optimizing code in a smarter and more efficient way, so as to realize intelligent auxiliary coding methods and make the software development process more efficient, intelligent and reliable.
[0081] Figure 2The structural schematic diagram of the intelligent assisted coding system 800 based on a large model and machine learning in the embodiment of the present application is shown. The intelligent assisted coding system 800 based on a large model and machine learning includes: an original code acquisition module 810, which is used to obtain the original code input by the user; an original code sentence granularity semantic understanding module 820, which is used to perform sentence granularity-based semantic coding on the original code to obtain a sequence of original code sentence unit semantic coding vectors; a code sentence unit semantic correlation optimization module 830, which is used to input the sequence of original code sentence unit semantic coding vectors into a semantic optimization module based on sequence internal correlation to obtain a sequence of optimized original code sentence unit semantic coding vectors; a code sentence unit semantic significance reinforcement module 840, which is used to input the sequence of optimized original code sentence unit semantic coding vectors into a contextual semantic reinforcement module based on significance-globality to obtain a sequence of optimized original code sentence unit significant semantic coding vectors; an optimized code generation module 850, which is used to generate optimized code based on the sequence of optimized original code sentence unit significant semantic coding vectors.
[0082] More specifically, in the technical solution of the present application, first, the original code input by the user is obtained. It should be understood that since the code is usually composed of multiple different code statements, each statement has its specific function and semantics. Therefore, in order to be able to analyze the semantic information in each code sentence unit more carefully, and to help better understand the relationship and function between each code fragment in the future, so as to improve the performance of code optimization, in the technical solution of the present application, it is necessary to perform sentence processing on the original code to obtain a sequence of original code sentence units, and to semantically encode each original code sentence unit in the sequence of original code sentence units to obtain a sequence of original code sentence unit semantic encoding vectors. By performing sentence segmentation and sentence-granular semantic encoding processing on the original code, it is possible to identify and understand the code semantic information in each sentence unit, rather than the entire code block. In this way, it helps the system to understand the meaning and intention of the code more deeply, rather than just relying on the surface grammatical structure.
[0083] Accordingly, if Figure 3 As shown, the original code sentence granularity semantic understanding module 820 includes: an original code sentence segmentation unit 821, used to perform sentence segmentation processing on the original code to obtain a sequence of original code sentence units; an original code sentence unit semantic encoding unit 822, used to semantically encode each original code sentence unit in the sequence of original code sentence units to obtain a sequence of original code sentence unit semantic encoding vectors.
[0084] Then, considering that in the process of semantic understanding and optimization of the original code, the semantics of each code sentence unit do not exist independently, these codes have contextual associations and logical structures based on the semantic features of sentence granularity. Based on this, in the technical solution of the present application, the sequence of the original code sentence unit semantic coding vectors is further input into the semantic optimization module based on the internal correlation of the sequence to obtain the sequence of optimized original code sentence unit semantic coding vectors. Through the processing of the semantic optimization module based on the internal correlation of the sequence, the internal correlation relationship and hidden interactive feature information between the semantics of each code sentence unit can be automatically learned and captured, so that the overall structure and logic of the code can be understood more deeply, not just the semantics of a single statement, and the internal correlation features between the semantic features of these sentence units are further used to optimize the expression of the semantics of each code sentence granularity, so as to highlight the important content semantic features therein, and ensure that the code is more coherent and consistent in semantics, so that the code is clearer and easier to understand, and the risks of subsequent development and code optimization are reduced.
[0085] Correspondingly, the code sentence unit semantic relevance optimization module 830 includes: a vector cascading unit, used to cascade every two original code sentence unit semantic coding vectors in the sequence of the original code sentence unit semantic coding vectors to obtain a sequence of multiple original code sentence unit semantic cascade representation row vectors; an autocorrelation feature capturing unit, used to capture the autocorrelation feature of each original code sentence unit semantic cascade representation row vector in the sequence of the multiple original code sentence unit semantic cascade representation row vectors to obtain a sequence of multiple original code sentence unit semantic row vector autocorrelation coefficients; a sequence arrangement unit, used to arrange the autocorrelation coefficients of the multiple original code sentence unit semantic row vectors. The sequence is arranged into a plurality of original code sentence unit semantic autocorrelation coefficient row vectors; a class support weight vector calculation unit is used to calculate the class support weight vector of each original code sentence unit semantic autocorrelation coefficient row vector in the plurality of original code sentence unit semantic autocorrelation coefficient row vectors to obtain a plurality of original code sentence unit semantic autocorrelation weight vectors; a counting unit is used to calculate the number of vectors between every two original code sentence unit semantic coding vectors in the sequence of the original code sentence unit semantic coding vectors to obtain a plurality of original code sentence unit semantic counting vectors; a vector weighted sum unit is used to respectively calculate the class support weight vector of each original code sentence unit in the plurality of original code sentence unit semantic autocorrelation weight vectors. The weighted sum of the semantic count vectors of the plurality of original code sentence units is calculated by taking the feature values of each position of the semantic autocorrelation weight vector as weights to obtain a sequence of the semantic correlation representation vectors of the original code sentence units; an activation processing unit is used to input the sequence of the semantic correlation representation vectors of the original code sentence units into an activation function for activation processing to obtain a sequence of the semantic correlation activation representation vectors of the original code sentence units; a first vector product calculation unit is used to calculate the product of the semantic correlation activation representation vectors of each original code sentence unit in the sequence of the semantic correlation activation representation vectors and the first hyperparameter to obtain the semantic weighted optimization feature of the semantic correlation of the original code sentence units. A sequence of feature vectors; a second vector product calculation unit, used to calculate the product of each original code sentence unit semantic coding vector in the sequence of original code sentence unit semantic coding vectors and a second hyperparameter to obtain a sequence of original code sentence unit semantic weighted modulation representation vectors; a positional summation unit, used to calculate the positional summation between each group of corresponding original code sentence unit semantic relevance semantic weighted optimization feature vectors and original code sentence unit semantic weighted modulation representation vectors in the sequence of original code sentence unit semantic relevance semantic weighted optimization feature vectors and the original code sentence unit semantic weighted modulation representation vectors to obtain the sequence of optimized original code sentence unit semantic coding vectors.
[0086] Among them, the autocorrelation feature capture unit is used to: calculate the product between each original code sentence unit semantic cascade representation row vector and a preset weight feature vector in the sequence of original code sentence unit semantic cascade representation row vectors to obtain a sequence of original code sentence unit semantic autocorrelation weight values; perform nonlinear activation processing on the sequence of original code sentence unit semantic autocorrelation weight values to obtain a sequence of autocorrelation coefficients of the original code sentence unit semantic row vectors.
[0087] Among them, the class support weight vector calculation unit is used to: use each eigenvalue in the original code sentence unit semantic autocorrelation coefficient row vector as the exponent of the natural constant to calculate the position-based exponential function value with the natural constant as the base to obtain the original code sentence unit semantic autocorrelation class support row vector; calculate the sum of the eigenvalues at each position in the original code sentence unit semantic autocorrelation class support row vector to obtain the original code sentence unit semantic global autocorrelation measurement coefficient; calculate the position-based division between each eigenvalue in the original code sentence unit semantic autocorrelation class support row vector and the original code sentence unit semantic global autocorrelation measurement coefficient to obtain the original code sentence unit semantic autocorrelation weight vector.
[0088] In a specific example, the code sentence unit semantic relevance optimization module 830 is used to: input the sequence of the original code sentence unit semantic coding vectors into the semantic optimization module based on internal sequence relevance to process the sequence with the following semantic optimization formula to obtain the sequence of optimized original code sentence unit semantic coding vectors; wherein the semantic optimization formula is: ;in, Respectively represent the first and The semantic encoding vector of the original code sentence unit, represents the weight feature vector, represents the vector concatenation operation, is a nonlinear activation function, Represents the eigenvalues of each position in the semantic autocorrelation matrix of the original code sentence unit, is the exponential operation with the natural constant e as the base, is the number of vectors in the sequence of semantic encoding vectors of the original code sentence unit minus one, is the eigenvalue of each position in the semantic autocorrelation weight matrix of the original code sentence unit, is the first unit in the semantic autocorrelation weight matrix of the original code sentence. The original code sentence unit semantic autocorrelation weight row vector, for and The number of eigenvectors between and represents a trainable hyperparameter, represents the activation function, The first one in the sequence of the optimized original code sentence unit semantic encoding vector Optimize the semantic encoding vector of the original code sentence unit.
[0089] Further, considering that each optimized original code sentence unit semantic coding vector in the sequence of the optimized original code sentence unit semantic coding vector respectively contains the semantic feature information of each code sentence unit after the optimization expression of the internal correlation of the code sentence granularity semantics, these semantic feature information have a global semantic association relationship, and there are also different importance related to the code optimization task. Based on this, in order to further improve the semantic understanding ability of the original code, thereby improving the performance of the subsequent code optimization and auxiliary coding system, in the technical solution of the present application, the sequence of the optimized original code sentence unit semantic coding vector is further input into the contextual semantic enhancement module based on saliency-globality to obtain the sequence of optimized original code sentence unit saliency semantic coding vectors. Through the processing of the contextual semantic enhancement module based on saliency-globality, the global contextual association features and association relationships between the semantic features of each code sentence unit can be captured, and the key information and important semantics related to the subsequent code optimization task in the semantics of each sentence unit in the code can be further highlighted, helping developers to better understand the main logic and functions of the code and improve the comprehensibility and maintainability of the code.
[0090] Accordingly, the code sentence unit semantic saliency enhancement module 840 includes: a mean and maximum processing unit, which is used to respectively calculate the mean and maximum of each optimized original code sentence unit semantic coding vector in the sequence of the optimized original code sentence unit semantic coding vector to obtain an optimized original code sentence unit semantic global representation vector composed of multiple vector means and an optimized original code sentence unit semantic salient representation vector composed of multiple vector maximum values; a one-dimensional convolution encoding unit, which is used to perform one-dimensional convolution encoding on the optimized original code sentence unit semantic global representation vector and then generate a saliency vector. The activation function is used to process the activation expression optimized original code sentence unit semantic global representation vector; the first matrix multiplication unit is used to perform matrix multiplication with the first trainable linear transformation weight matrix after the activation expression optimized original code sentence unit semantic global representation vector is again subjected to one-dimensional convolution encoding to obtain the optimized original code sentence unit context semantic global representation feature vector; the encoding activation unit is used to perform one-dimensional convolution encoding on the optimized original code sentence unit semantic salient representation vector and then perform matrix multiplication with the first trainable linear transformation weight matrix to obtain the optimized original code sentence unit context semantic global representation feature vector. The activation function is used to process to obtain the semantic salient representation vector of the activated expression optimized original code sentence unit; the second matrix multiplication unit is used to matrix-multiply the semantic salient representation vector of the activated expression optimized original code sentence unit with the second trainable linear transformation weight matrix after one-dimensional convolution encoding to obtain the contextual semantic salient representation feature vector of the optimized original code sentence unit; the non-linear activation unit is used to fuse the contextual semantic global activation representation feature vector of the optimized original code sentence unit and the contextual semantic salient activation representation feature vector of the optimized original code sentence unit to obtain the global-salient feature context-associated activation feature vector of the optimized original code sentence unit, and then perform non-linear activation processing on the global-salient feature context-associated activation feature vector of the optimized original code sentence unit to obtain the global-salient feature context-associated weight feature vector of the optimized original code sentence unit; the position point multiplication unit is used to use the global-salient feature context-associated weight feature vector of the optimized original code sentence unit as the weight, perform position point multiplication on the sequence of the semantic coding vectors of the optimized original code sentence unit, and add the sequence of the semantic coding vectors of the optimized original code sentence unit to obtain the sequence of the significant semantic coding vectors of the optimized original code sentence unit.
[0091] The nonlinear activation unit is used to: fuse the optimized original code sentence unit context semantic global activation representation feature vector and the optimized original code sentence unit context semantic salient activation representation feature vector to obtain the optimized original code sentence unit global-salient feature context association activation feature vector; respectively use the hyperbolic tangent function and The function activates the global-salient feature context-associated activation feature vector of the optimized original code sentence unit to obtain the global-salient feature hyperbolic tangent activation semantic representation vector of the optimized original code sentence unit and the global-salient feature S-type activation semantic representation vector of the optimized original code sentence unit; the global-salient feature hyperbolic tangent activation semantic representation vector of the optimized original code sentence unit and the global-salient feature S-type activation semantic representation vector of the optimized original code sentence unit are multiplied by position points to obtain the global-salient feature context-associated weight feature vector of the optimized original code sentence unit.
[0092] In a specific example, the code sentence unit semantic saliency enhancement module 840 is used to: input the sequence of optimized original code sentence unit semantic coding vectors into the context semantic enhancement module based on saliency-globality to process it with the following saliency semantic enhancement formula to obtain the sequence of optimized original code sentence unit saliency semantic coding vectors; wherein the saliency semantic enhancement formula is: ;in, For each optimized original code sentence unit semantic coding vector in the sequence of optimized original code sentence unit semantic coding vectors, represents the global mean operation in the calculation vector, Represents the maximum value operation in the vector. To optimize the semantic mean representation vector of the original code sentence unit, To optimize the original code sentence unit semantic maximum representation vector, represents one-dimensional convolutional coding, express Activation function, and They represent the trainable weight matrices for linear transformation, and They are respectively to optimize the original code sentence unit context semantic mean representation feature vector and to optimize the original code sentence unit context semantic maximum representation feature vector. for function, for function, It means point multiplication by position. An optimized original code sentence unit salient semantic coding vector is generated for each of the sequences of optimized original code sentence unit salient semantic coding vectors.
[0093] Then, the sequence of the optimized original code sentence unit significant semantic coding vectors is input into the code optimizer based on the AIGC model to obtain the optimized code. In other words, the optimized code is generated through the large model using the contextual semantic significant expression features based on sentence granularity in the original code. In this way, developers can be assisted in writing and optimizing codes in a smarter and more efficient way to realize an intelligent auxiliary coding method, making the software development process more efficient, intelligent and reliable.
[0094] Correspondingly, the optimized code generation module 850 is used to: input the sequence of the optimized original code sentence unit significant semantic coding vectors into the code optimizer based on the AIGC model to obtain the optimized code.
[0095] Furthermore, in the technical solution of the present application, the intelligent assisted coding system based on a large model and machine learning also includes a training module for training the semantic optimization module based on internal sequence correlation, the contextual semantic enhancement module based on significance-globality, and the code optimizer based on the AIGC model.
[0096] The training module includes: a training data acquisition unit for acquiring training data, wherein the training data includes the training original code input by the user and the real optimized code; a training original code sentence granularity semantic understanding unit for performing sentence granularity-based semantic encoding on the training original code to obtain a sequence of training original code sentence unit semantic encoding vectors; a training code sentence unit semantic relevance optimization unit for inputting the sequence of training original code sentence unit semantic encoding vectors into the semantic optimization module based on sequence internal relevance to obtain a sequence of optimized training original code sentence unit semantic encoding vectors; a training code sentence unit semantic saliency reinforcement unit for inputting the sequence of optimized training original code sentence unit semantic encoding vectors into the semantic optimization module based on saliency; A saliency-global contextual semantic reinforcement module is used to obtain a sequence of saliency semantic coding vectors of training optimized original code sentence units; a training optimized code generation unit is used to input the sequence of saliency semantic coding vectors of training optimized original code sentence units into the code optimizer based on the AIGC model to obtain trained optimized code; a loss function value calculation unit is used to calculate the cross entropy loss function value between the trained optimized code and the real optimized code to obtain the optimized code information loss function value; a loss training unit is used to train the semantic optimization module based on sequence internal correlation, the saliency-global contextual semantic reinforcement module and the code optimizer based on the AIGC model based on the optimized code information loss function value.
[0097] Preferably, the training optimization code generation unit is used to: cascade the sequence of the training optimized original code sentence unit significant semantic coding vectors into a training optimized original code sentence unit significant semantic joint coding vector; multiply each eigenvalue of the training optimized original code sentence unit significant semantic joint coding vector by the length of the training optimized original code sentence unit significant semantic joint coding vector, subtract the first norm of the training optimized original code sentence unit significant semantic joint coding vector, and calculate the square root of the absolute value of the subtraction result to obtain a first optimized original code sentence unit significant semantic joint intermediate coding vector; multiply each eigenvalue of the training optimized original code sentence unit significant semantic joint coding vector by the square root of the length of the training optimized original code sentence unit significant semantic joint coding vector, subtract the second norm of the training optimized original code sentence unit significant semantic joint coding vector, and calculate the square root of the absolute value of the subtraction result to obtain a second optimized original code sentence unit significant semantic joint intermediate coding vector; respectively calculate the The logarithmic value with base 2 of each eigenvalue of the first optimized original code sentence unit significant semantic joint intermediate coding vector and the second optimized original code sentence unit significant semantic joint intermediate coding vector is obtained to obtain the first optimized original code sentence unit significant semantic joint intermediate information vector and the second optimized original code sentence unit significant semantic joint intermediate information vector; the weighted sum of the first optimized original code sentence unit significant semantic joint intermediate information vector and the second optimized original code sentence unit significant semantic joint intermediate information vector is calculated to obtain the corrected training optimized original code sentence unit significant semantic joint coding vector; the corrected training optimized original code sentence unit significant semantic joint coding vector is split into a sequence of corrected training optimized original code sentence unit significant semantic coding vectors according to the cascade of the sequence of the training optimized original code sentence unit significant semantic coding vectors; and the sequence of the corrected training optimized original code sentence unit significant semantic coding vectors is input into the code optimizer based on the AIGC model to obtain the trained optimized code.
[0098] Here, for the encoded semantic features of the user-input training original code expressed by the sequence of semantic coding vectors of the training original code sentence units in the local semantic space domain, after the optimization of the internal correlation semantics in the local semantic space domain and the reinforcement of the significance-global context semantics in the local-global semantic space domain, due to the differences in the distribution of internal correlation semantics and significance-global semantic weights caused by the distribution differences between local semantic space domains in the global semantic space domain, the sequence of significant semantic coding vectors of the training optimized original code sentence units will also have the problem of insufficient aggregation of the distribution of fused semantic features, thereby affecting its generation efficiency through the code optimizer based on the AIGC model, that is, affecting the efficiency of code generation training and the code quality of the generated code.
[0099] Based on this, the applicant of the present application takes the training optimized original code sentence unit significant semantic joint coding vector after the sequence cascade of the training optimized original code sentence unit significant semantic coding vector as a feature set, wherein the change semantics represented by the characteristic value of the training optimized original code sentence unit significant semantic joint coding vector is used as a unit. In order to dynamically aggregate the semantic set as a whole composed of different change semantics of the training optimized original code sentence unit significant semantic joint coding vector without ignoring the individual semantic change information, the individual features of the training optimized original code sentence unit significant semantic joint coding vector and the collective expression of their aggregation scale are used as the feature full amplitude and half amplitude, and the low-rank negative correlation of different dimensions of the overall semantics of the feature set of the training optimized original code sentence unit significant semantic joint coding vector is used as the phase and scaled to dynamically adjust the change relationship of the semantic content of the training optimized original code sentence unit significant semantic joint coding vector, thereby improving the overall semantic information expression aggregation of the feature set of the sequence of the training optimized original code sentence unit significant semantic coding vector, and improving the generation efficiency of the sequence of the training optimized original code sentence unit significant semantic coding vector through the code optimizer based on the AIGC model, that is, improving the efficiency of code generation training and the code quality of the generated code. In this way, the original code input by the user can be optimized more effectively based on the large language model to achieve a more intelligent auxiliary coding method, making the software development process more efficient, intelligent and reliable.
[0100] Based on the above embodiments, see Figure 4 As shown in FIG. 1 , a flow chart of an intelligent assisted encoding method based on a large model and machine learning in an embodiment of the present application is shown. For example, the intelligent assisted encoding method based on a large model and machine learning can be executed by a server, which can be Figure 1 The server 100 shown in FIG. Figure 4 As shown, according to the embodiment of the present application, the intelligent assisted coding method based on a large model and machine learning includes the following steps: S510, obtaining the original code input by the user; S520, performing sentence granularity-based semantic coding on the original code to obtain a sequence of original code sentence unit semantic coding vectors; S530, inputting the sequence of original code sentence unit semantic coding vectors into a semantic optimization module based on internal sequence correlation to obtain a sequence of optimized original code sentence unit semantic coding vectors; S540, inputting the sequence of optimized original code sentence unit semantic coding vectors into a contextual semantic reinforcement module based on significance-globality to obtain a sequence of optimized original code sentence unit significant semantic coding vectors; S550, generating optimized code based on the sequence of optimized original code sentence unit significant semantic coding vectors.
[0101] Here, those skilled in the art can understand that the specific operations of each step in the above-mentioned intelligent assisted encoding method based on large models and machine learning have been referred to above. Figure 2 to Figure 3 The description of the intelligent assisted coding system 800 based on large models and machine learning has been introduced in detail, and therefore, its repeated description will be omitted.
[0102] Figure 5 FIG. 1 is an application scenario diagram of an intelligent assisted coding system based on a large model and machine learning according to an embodiment of the present application. Figure 5 As shown, in this application scenario, first, the original code entered by the user is obtained (for example, Figure 5 D), and then the original code is input into a server (for example, Figure 5 In S) as shown in , the server is capable of using the intelligent assisted coding algorithm based on the big model and machine learning to process the original code to obtain the optimized code.
[0103] Based on the above embodiments, another exemplary embodiment of an electronic device is also provided in the embodiments of the present application. In some possible implementations, the electronic device in the embodiments of the present application may include a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor can implement the steps of the intelligent assisted encoding method based on a large model and machine learning in the above embodiments when executing the program.
[0104] For example, in the case of electronic equipment Figure 1 Taking the server 100 in the example as an example, the processor in the electronic device is the processor 110 in the server 100, and the memory in the electronic device is the memory 120 in the server 100.
[0105] An embodiment of the present application also provides a computer-readable storage medium. Figure 6 1 shows a schematic diagram of a computer-readable storage medium 1000 according to an embodiment of the present application. Figure 6 As shown, the computer-readable storage medium 1000 stores computer-executable instructions 1001. When the computer-executable instructions 1001 are executed by the processor, the intelligent assisted encoding method based on a large model and machine learning according to the embodiment of the present application described with reference to the above figures can be executed. The computer-readable storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc.
[0106] The embodiment of the present application also provides a computer program product or a computer program, which includes computer executable instructions, and the computer executable instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer executable instructions from the computer-readable storage medium, and the processor executes the computer executable instructions, so that the computer device executes the intelligent assisted encoding method based on a large model and machine learning according to the embodiment of the present application.
[0107] Those skilled in the art will appreciate that the contents disclosed in this application may be subject to various modifications and improvements. For example, the various devices or components described above may be implemented by hardware, or by software, firmware, or a combination of some or all of the three.
[0108] In addition, although the present application makes various references to certain units in the system according to embodiments of the present application, any number of different units can be used and run on the client and / or server. The units are illustrative only, and different aspects of the system and method can use different units.
[0109] Those skilled in the art will appreciate that all or part of the steps in the above method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk. Optionally, all or part of the steps in the above embodiment can also be implemented using one or more integrated circuits. Accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or in the form of software function modules. The present application is not limited to any particular form of combination of hardware and software.
[0110] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art to which this application belongs. It should also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology, and should not be interpreted in an idealized or extremely formal sense, unless explicitly defined as such herein.
[0111] The above is an explanation of the present application and should not be considered as a limitation thereof. Although several exemplary embodiments of the present application have been described, it will be readily understood by those skilled in the art that many modifications may be made to the exemplary embodiments without departing from the novel teachings and advantages of the present application. Therefore, all of these modifications are intended to be included within the scope of the present application as defined by the claims. It should be understood that the above is an explanation of the present application and should not be considered to be limited to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are intended to be included within the scope of the appended claims. The present application is defined by the claims and their equivalents.
Claims
1. An intelligent assisted coding system based on large models and machine learning, It is characterized in that include: The original code acquisition module is used to obtain the original code input by the user; An original code sentence granularity semantic understanding module, used for performing sentence granularity-based semantic encoding on the original code to obtain a sequence of original code sentence unit semantic encoding vectors; A code sentence unit semantic correlation optimization module, used for inputting the sequence of the original code sentence unit semantic coding vectors into a semantic optimization module based on internal sequence correlation to obtain a sequence of optimized original code sentence unit semantic coding vectors; A code sentence unit semantic saliency enhancement module, used for inputting the sequence of optimized original code sentence unit semantic coding vectors into a saliency-global context semantic enhancement module to obtain a sequence of optimized original code sentence unit saliency semantic coding vectors; An optimized code generation module, used to generate optimized code based on the sequence of significant semantic encoding vectors of the optimized original code sentence units; The code sentence unit semantic relevance optimization module is used to: input the sequence of the original code sentence unit semantic coding vectors into the semantic optimization module based on internal sequence relevance to process the sequence with the following semantic optimization formula to obtain the sequence of optimized original code sentence unit semantic coding vectors; wherein the semantic optimization formula is: ;in, Respectively represent the first and The semantic encoding vector of the original code sentence unit, represents the weight feature vector, represents the vector concatenation operation, is a nonlinear activation function, Represents the eigenvalues of each position in the semantic autocorrelation matrix of the original code sentence unit, is the exponential operation with the natural constant e as the base, is the number of vectors in the sequence of semantic encoding vectors of the original code sentence unit minus one, is the eigenvalue of each position in the semantic autocorrelation weight matrix of the original code sentence unit, is the first unit in the semantic autocorrelation weight matrix of the original code sentence. The original code sentence unit semantic autocorrelation weight row vector, for and The number of eigenvectors between and represents a trainable hyperparameter, represents the activation function, The first one in the sequence of the optimized original code sentence unit semantic encoding vector Optimize the semantic encoding vector of the original code sentence unit; The code sentence unit semantic saliency enhancement module is used to: input the sequence of optimized original code sentence unit semantic coding vectors into the context semantic enhancement module based on saliency-globality to process the sequence with the following saliency semantic enhancement formula to obtain the sequence of optimized original code sentence unit saliency semantic coding vectors; wherein the saliency semantic enhancement formula is: ;in, For each optimized original code sentence unit semantic coding vector in the sequence of optimized original code sentence unit semantic coding vectors, represents the global mean operation in the calculation vector, Represents the maximum value operation in the vector. To optimize the semantic mean representation vector of the original code sentence unit, To optimize the original code sentence unit semantic maximum representation vector, represents one-dimensional convolutional coding, express Activation Function and They represent the trainable weight matrices for linear transformation, and They are respectively to optimize the original code sentence unit context semantic mean representation feature vector and to optimize the original code sentence unit context semantic maximum representation feature vector. for function, for function, It means point multiplication by position. An optimized original code sentence unit salient semantic coding vector is generated for each of the sequences of optimized original code sentence unit salient semantic coding vectors.
2. The intelligent assisted coding system based on large models and machine learning according to claim 1, It is characterized in that The original code sentence granular semantic understanding module includes: An original code sentence unit, used for performing sentence processing on the original code to obtain a sequence of original code sentence units; The original code sentence unit semantic encoding unit is used to semantically encode each original code sentence unit in the sequence of original code sentence units to obtain a sequence of original code sentence unit semantic encoding vectors.
3. The intelligent assisted coding system based on large model and machine learning according to claim 2, It is characterized in that The code sentence unit semantic relevance optimization module includes: A vector cascading unit, used for cascading every two original code sentence unit semantic coding vectors in the sequence of original code sentence unit semantic coding vectors to obtain a sequence of multiple original code sentence unit semantic cascade representation row vectors; An autocorrelation feature capturing unit, used to capture the autocorrelation feature of each sequence of original code sentence unit semantic cascade representation row vectors in the sequence of the plurality of original code sentence unit semantic cascade representation row vectors to obtain a sequence of autocorrelation coefficients of the plurality of original code sentence unit semantic row vectors; A sequence arrangement unit, used to arrange the sequences of the multiple original code sentence unit semantic row vector autocorrelation coefficients into multiple original code sentence unit semantic autocorrelation coefficient row vectors; a class support weight vector calculation unit, used to calculate the class support weight vector of each original code sentence unit semantic autocorrelation coefficient row vector in the plurality of original code sentence unit semantic autocorrelation coefficient row vectors to obtain a plurality of original code sentence unit semantic autocorrelation weight vectors; A counting unit, used for calculating the number of vectors between every two original code sentence unit semantic coding vectors in the sequence of the original code sentence unit semantic coding vectors to obtain a plurality of original code sentence unit semantic counting vectors; a vector weighted sum unit, configured to calculate a weighted sum of the plurality of original code sentence unit semantic count vectors by using each position feature value of each original code sentence unit semantic autocorrelation weight vector in the plurality of original code sentence unit semantic autocorrelation weight vectors as a weight, so as to obtain a sequence of original code sentence unit semantic correlation representation vectors; An activation processing unit, used for inputting the sequence of semantic relevance representation vectors of the original code sentence units into an activation function for activation processing to obtain a sequence of semantic relevance activation representation vectors of the original code sentence units; A first vector product calculation unit, used for calculating the product of each original code sentence unit semantic relevance activation representation vector in the sequence of original code sentence unit semantic relevance activation representation vectors and a first hyperparameter to obtain a sequence of original code sentence unit semantic relevance semantic weighted optimized feature vectors; A second vector product calculation unit, used for calculating the product of each original code sentence unit semantic coding vector in the sequence of the original code sentence unit semantic coding vector and a second hyperparameter to obtain a sequence of original code sentence unit semantic weighted modulation representation vectors; A positional summation unit is used to calculate the positional summation between each group of corresponding original code sentence unit semantic relevance semantic weighted optimized feature vectors and original code sentence unit semantic weighted modulation representation vectors in the sequence of the original code sentence unit semantic relevance semantic weighted optimized feature vectors and the sequence of the original code sentence unit semantic weighted modulation representation vectors to obtain the sequence of optimized original code sentence unit semantic coding vectors.
4. The intelligent assisted coding system based on large model and machine learning according to claim 3, It is characterized in that The autocorrelation feature capturing unit is used to: Calculating the product between each original code sentence unit semantic cascade representation row vector in the sequence of the original code sentence unit semantic cascade representation row vectors and a preset weight feature vector to obtain a sequence of original code sentence unit semantic autocorrelation weight values; The sequence of the original code sentence unit semantic autocorrelation weight values is subjected to nonlinear activation processing to obtain a sequence of the original code sentence unit semantic row vector autocorrelation coefficients.
5. The intelligent assisted coding system based on large model and machine learning according to claim 4, It is characterized in that The class supports weight vector calculation units for: Taking each eigenvalue in the original code sentence unit semantic autocorrelation coefficient row vector as the exponent of the natural constant to calculate the exponential function value with the natural constant as the base according to the position to obtain the original code sentence unit semantic autocorrelation class support row vector; Calculate the sum of the feature values of each position in the semantic autocorrelation class support row vector of the original code sentence unit to obtain the semantic global autocorrelation measurement coefficient of the original code sentence unit; The positional division between each eigenvalue in the original code sentence unit semantic autocorrelation class support row vector and the original code sentence unit semantic global autocorrelation measurement coefficient is calculated to obtain the original code sentence unit semantic autocorrelation weight vector.
6. The intelligent assisted coding system based on large model and machine learning according to claim 5, It is characterized in that The code sentence unit semantic significance enhancement module includes: A mean and maximum processing unit, used to respectively calculate the mean and maximum of each optimized original code sentence unit semantic coding vector in the sequence of the optimized original code sentence unit semantic coding vector to obtain an optimized original code sentence unit semantic global representation vector composed of multiple vector means and an optimized original code sentence unit semantic salient representation vector composed of multiple vector maximum values; A one-dimensional convolutional coding unit is used to perform one-dimensional convolutional coding on the semantic global representation vector of the optimized original code sentence unit and then pass it through The activation function is used to process the original code sentence unit semantic global representation vector to obtain the activation expression optimization; A first matrix multiplication unit is used to perform matrix multiplication of the activation expression optimized original code sentence unit semantic global representation vector with a first trainable linear transformation weight matrix after one-dimensional convolution encoding to obtain an optimized original code sentence unit context semantic global representation feature vector; The encoding activation unit is used to perform one-dimensional convolution encoding on the semantic salient representation vector of the optimized original code sentence unit and then pass it through The activation function is used to process the original code sentence unit semantic salient representation vector by obtaining the activation expression optimization; A second matrix multiplication unit is used to perform matrix multiplication of the activation expression optimized original code sentence unit semantic salient representation vector with a second trainable linear transformation weight matrix after one-dimensional convolution encoding to obtain an optimized original code sentence unit context semantic salient representation feature vector; a non-linear activation unit, for fusing the optimized original code sentence unit context semantic global activation representation feature vector and the optimized original code sentence unit context semantic salient activation representation feature vector to obtain an optimized original code sentence unit global-salient feature context association activation feature vector, and then performing non-linear activation processing on the optimized original code sentence unit global-salient feature context association activation feature vector to obtain an optimized original code sentence unit global-salient feature context association weight feature vector; A positional dot multiplication unit is used to perform positional dot multiplication on the sequence of semantic coding vectors of the optimized original code sentence unit using the global-salient feature context-associated weight feature vector of the optimized original code sentence unit as a weight and add the sequence of semantic coding vectors of the optimized original code sentence unit to obtain the sequence of salient semantic coding vectors of the optimized original code sentence unit.
7. The intelligent assisted coding system based on large model and machine learning according to claim 6, It is characterized in that The nonlinear activation unit is used to: Fusion of the optimized original code sentence unit context semantic global activation representation feature vector and the optimized original code sentence unit context semantic prominent activation representation feature vector to obtain the optimized original code sentence unit global-prominent feature context association activation feature vector; Using the hyperbolic tangent function and The function performs activation processing on the optimized original code sentence unit global-prominent feature context-related activation feature vector to obtain the optimized original code sentence unit global-prominent feature hyperbolic tangent activation semantic representation vector and the optimized original code sentence unit global-prominent feature S-type activation semantic representation vector; The global-salient feature hyperbolic tangent activation semantic representation vector of the optimized original code sentence unit and the global-salient feature S-type activation semantic representation vector of the optimized original code sentence unit are multiplied by position point to obtain the global-salient feature context-related weight feature vector of the optimized original code sentence unit.
8. The intelligent assisted coding system based on large model and machine learning according to claim 7, It is characterized in that The optimized code generation module is used to: input the sequence of the optimized original code sentence unit significant semantic coding vectors into the code optimizer based on the AIGC model to obtain the optimized code.
9. The intelligent assisted coding system based on large model and machine learning according to claim 8, It is characterized in that It also includes a training module for training the semantic optimization module based on internal sequence correlation, the contextual semantic enhancement module based on saliency-globality, and the code optimizer based on the AIGC model; Wherein, the training module includes: A training data acquisition unit, used to acquire training data, wherein the training data includes an original training code input by a user and a real optimized code; A training original code sentence granularity semantic understanding unit, used for performing sentence granularity-based semantic encoding on the training original code to obtain a sequence of training original code sentence unit semantic encoding vectors; A training code sentence unit semantic correlation optimization unit, used for inputting the sequence of the semantic coding vectors of the training original code sentence unit into the semantic optimization module based on internal correlation of the sequence to obtain a sequence of optimized semantic coding vectors of the training original code sentence unit; A training code sentence unit semantic saliency reinforcement unit, used for inputting the sequence of optimized training original code sentence unit semantic coding vectors into the saliency-global-based contextual semantic reinforcement module to obtain a sequence of training optimized original code sentence unit saliency semantic coding vectors; A training optimized code generation unit, used for inputting the sequence of significant semantic coding vectors of the training optimized original code sentence unit into the AIGC model-based code optimizer to obtain the trained optimized code; A loss function value calculation unit, used to calculate the cross entropy loss function value between the training optimized code and the real optimized code to obtain the optimized code information loss function value; A loss training unit is used to train the semantic optimization module based on internal sequence correlation, the contextual semantic enhancement module based on significance-globality and the code optimizer based on the AIGC model based on the optimized code information loss function value.
10. An intelligent assisted coding method based on large models and machine learning, It is characterized in that include: Get the original code entered by the user; Performing sentence-granularity-based semantic coding on the original code to obtain a sequence of original code sentence unit semantic coding vectors; Inputting the sequence of semantic coding vectors of the original code sentence units into a semantic optimization module based on internal correlation of the sequence to obtain a sequence of optimized semantic coding vectors of the original code sentence units; Inputting the sequence of optimized original code sentence unit semantic coding vectors into a contextual semantic enhancement module based on saliency-globality to obtain a sequence of optimized original code sentence unit saliency semantic coding vectors; Generate optimized code based on the sequence of significant semantic encoding vectors of the optimized original code sentence units; The sequence of the semantic coding vectors of the original code sentence units is input into the semantic optimization module based on internal correlation of the sequence and processed by the following semantic optimization formula to obtain the sequence of the optimized semantic coding vectors of the original code sentence units; wherein the semantic optimization formula is: ;in, Respectively represent the first and The semantic encoding vector of the original code sentence unit, represents the weight feature vector, represents the vector concatenation operation, is a nonlinear activation function, Represents the eigenvalues of each position in the semantic autocorrelation matrix of the original code sentence unit, is the exponential operation with the natural constant e as the base, is the number of vectors in the sequence of semantic encoding vectors of the original code sentence unit minus one, is the eigenvalue of each position in the semantic autocorrelation weight matrix of the original code sentence unit, is the first unit in the semantic autocorrelation weight matrix of the original code sentence. The original code sentence unit semantic autocorrelation weight row vector, for and The number of eigenvectors between and represents a trainable hyperparameter, represents the activation function, The first one in the sequence of the optimized original code sentence unit semantic encoding vector Optimize the semantic encoding vector of the original code sentence unit; The sequence of the optimized original code sentence unit semantic coding vectors is input into the contextual semantic enhancement module based on saliency-globality and processed by the following saliency semantic enhancement formula to obtain the sequence of the optimized original code sentence unit saliency semantic coding vectors; wherein the saliency semantic enhancement formula is: ;in, For each optimized original code sentence unit semantic coding vector in the sequence of optimized original code sentence unit semantic coding vectors, represents the global mean operation in the calculation vector, Represents the maximum value operation in the vector. To optimize the semantic mean representation vector of the original code sentence unit, To optimize the original code sentence unit semantic maximum representation vector, represents one-dimensional convolutional coding, express Activation Function and They represent the trainable weight matrices for linear transformation, and They are respectively to optimize the original code sentence unit context semantic mean representation feature vector and to optimize the original code sentence unit context semantic maximum representation feature vector. for function, for function, It means point multiplication by position. An optimized original code sentence unit salient semantic coding vector is generated for each of the sequences of optimized original code sentence unit salient semantic coding vectors.
