A multimodal code generation and progressive delivery method

Through multimodal code generation and progressive delivery methods, using the PLBART model and Kubernetes grayscale release, the flexibility and scalability issues of low-code platforms in complex scenarios are solved, efficient systematic code generation and progressive delivery are achieved, and development efficiency and system reliability are improved.

CN120447885BActive Publication Date: 2025-09-30YUNNAN PROVINCIAL BIG DATA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510941709.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-09-30
Estimated Expiration
2045-07-09

AI Technical Summary

Technical Problem

Existing low-code platforms lack flexibility and scalability in complex scenarios, cannot adapt to dynamic changes, and cannot achieve grayscale releases and code rollbacks, resulting in low development efficiency and poor system performance. The PLBART model cannot directly generate software systems that meet user needs.

Method used

A multimodal code generation method is adopted, pre-trained through the PLBART model, combined with a visual low-code platform and the Kubernetes grayscale release strategy to achieve systematic code generation and progressive delivery, including data preprocessing, basic template construction, configuration data generation, code automatic completion and grayscale release.

Benefits of technology

It significantly improves development efficiency and code quality, enables precise version rollback and full lifecycle management, reduces system failure rate and maintenance costs, and supports rapid iteration and optimization of complex business systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120447885B_ABST
    Figure CN120447885B_ABST
Patent Text Reader

Abstract

The present invention relates to a method based on multimodal code generation and progressive delivery, which belongs to the field of code generation technology and natural language processing. The present invention builds a visual low-code development platform based on a basic template, which sets configuration data through a visual page; generates database model data based on the configuration data, and pregenerates basic code in combination with the basic template; inputs the generated basic code into a pre-trained PLBART model; uses the PLBART model to reason and complete the language syntax and semantics, and outputs executable code; pushes the executable code to a code warehouse, and automatically builds, tests, and packages the executable code; uses a grayscale release strategy to achieve grayscale release and progressive delivery; the present invention realizes systematic code generation through multi-modal data processing, organically combines grayscale release, and achieves progressive delivery, significantly improving development efficiency, code quality, and system reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a multimodal code generation and progressive delivery method, belonging to the technical fields of code generation technology and natural language processing. Background Art

[0002] In the software development process, user needs are the core and foundation of the entire process. With the advent of the information and intelligent era, user demands for software products are constantly increasing and becoming increasingly complex. During demand research, most users describe their needs inaccurately, resulting in frequent changes in requirements during the software development process. This reduces development efficiency, and issues such as long development cycles, slow delivery, and difficulty in maintenance are becoming increasingly prominent. Therefore, it is extremely important to develop a method that can quickly iterate and deliver products while meeting user needs, while facilitating subsequent maintenance and expansion of the software.

[0003] With the continuous advancement of digital development, low-code development technology has emerged. The concept of "low-code" was formally proposed by Forrester Research in 2014. From 2014 to 2019, domestic low-code development platforms entered a period of rapid development; by 2023, a complete low-code ecosystem will have formed. Common low-code platforms primarily dynamically render data based on specific rules. Users configure the data through a page, storing it in a database. After configuration is complete, the page display retrieves the configuration item data through a request interface, rendering tables and forms. Users then complete data reporting or querying based on the rendered page. These methods can meet user needs for adding, deleting, modifying, and querying structured data. However, since low-code development platforms rely more on rendering structured data rather than actual code generation, user requests for page customization or changes to page interaction methods cannot be implemented through low-code platforms, forcing developers to implement them through coding. Furthermore, these platforms often exhibit problems such as lack of flexibility, poor scalability, and difficulty adapting to dynamic changes when faced with complex scenarios.

[0004] During the project implementation process, low-code platforms often deploy services after the project is launched. After the deployment is completed, developers configure user needs based on the low-code platform. Since the configuration data is stored in the database, the page is only rendered according to specific rules, so there is no redeployment. As a result, after the developer completes the function development, the user can directly use the function, and grayscale release or progressive delivery cannot be achieved.

[0005] During the software development process, if the implementation is based on code, code rollback and other operations are often carried out due to changes in user needs and other reasons. If the development is based on a low-code platform, the function configuration will be converted into structured data for storage after completion, so the code rollback operation cannot be implemented. If the low-code platform version control is introduced, the configuration data will continue to increase, which will slow down the page rendering speed and affect the overall performance of the software.

[0006] With the continuous development of deep learning technology, technologies such as automatic code generation and large-model assisted encoding have continued to mature. In particular, methods based on pre-trained language models have achieved remarkable results in the field of natural language processing. However, their implementation is limited to using pre-trained language generation decoders, and therefore still requires a large amount of parallel data to train the decoders. To address this type of problem, the PLBART model was established. Based on bidirectional and autoregressive transformer pre-training on unlabeled data of programming languages ​​(PL) and natural languages ​​(NL), programs can understand and generate language, thereby performing tasks such as code generation, translation, program repair, clone detection, and vulnerability detection. However, the PLBART model currently lacks an effective solution for combining with low-code platforms, and directly relying on the PLBART model cannot directly generate software or programs that meet user needs.

[0007] Existing research on progressive delivery technology primarily focuses on modular development and incremental delivery. This involves breaking down a program into multiple functional modules. Once the module coding is complete, incremental content is released in a phased release. However, this approach only works for software using program coding. It's not feasible to achieve progressive delivery through phased releases for software configured using low-code.

[0008] In summary, although existing technologies have made some progress in the field of low-code and progressive delivery, the following major problems still exist: (1) Common low-code platforms mainly perform dynamic rendering of data based on specific rules, and do not directly generate code. In complex scenarios, they often exhibit problems such as insufficient flexibility, poor scalability, and difficulty in adapting to dynamic changes. (2) Code generation technology is currently limited to generating code snippets through question-and-answer methods or through intelligent prompts and intelligent error correction in the field of natural language processing, but it cannot form a system to generate a complete and usable system based on user needs. (3) Although the PLBART model can perform tasks such as code generation, translation, program repair, clone detection, and vulnerability detection, it cannot directly generate a system that meets user needs. (4) Progressive delivery capabilities have now matured. By modularizing the software system, the system is released through grayscale deployment after the functional modules are developed, achieving progressive delivery. However, there are currently few cases of progressive delivery being combined with low-code platforms. (5) Although existing methods can improve the speed of software delivery in practical applications, their overall efficiency is low, and as software requirements change, they lead to problems such as poor system readability, poor performance, and weak robustness.

[0009] Therefore, there is an urgent need for a new method based on the combination of multimodal code generation technology and progressive delivery to solve the above technical difficulties and promote further development in the field of software development. Summary of the Invention

[0010] To address the above issues, the present invention provides a method based on multimodal code generation and progressive delivery. The present invention realizes systematic code generation through multi-modal data processing, organically combines grayscale release, realizes progressive delivery, and significantly improves development efficiency, code quality and system reliability.

[0011] The technical solution of the present invention is: a method based on multimodal code generation and progressive delivery, the method comprising:

[0012] S1. Comprehensively collect code and natural language text data from multiple programming languages ​​for preprocessing, and perform sequence-to-sequence pre-training based on the Transformer architecture to obtain the PLBART model.

[0013] S2. Build a basic template for code generation and build a visual low-code development platform based on the basic template;

[0014] S3. Set configuration data through the visualization page based on the visual low-code development platform;

[0015] S4. Generate database model data based on the configuration data and pre-generate basic code based on the basic template;

[0016] S5. Input the generated basic code into the PLBART model; use the PLBART model to reason and complete the language syntax and semantics, and output executable code;

[0017] S6. Push the executable code to the code repository and use dependency management tools to automatically build, test, and package the executable code.

[0018] S7. Use the grayscale release strategy to implement grayscale release and achieve progressive delivery.

[0019] Furthermore, the S1 specifically includes:

[0020] S11. Collect a large number of mixed sequences of codes, functions and natural language descriptions to aggregate data of different modalities. In the aggregation process, when aggregating data of different modalities, according to the probability multinomial distribution ( ) to pre-train the instance, the specific formula is:

[0021] ;

[0022] in, represents the ratio of text after upsampling and downsampling in the i-th language, N is the total number of languages, is the total number of instances in the i-th language, is the total number of instances of the jth language, α is the smoothing parameter, represents the proportion of the i-th language in the total languages, express α to the power of represents the proportion of the jth language in the total languages, express α to the power of

[0023] S12. During the training process, a sequence-to-sequence Transformer is used to achieve stable accuracy training through encoders, decoders, and additional normalization layers.

[0024] In the normalization layer, the mean and standard deviation of different dimensions of the same feature and the same sample are calculated. The formula for the standard deviation is:

[0025] ;

[0026] in, Batch data input for language i, is the variance of each feature, is the mean of each feature, m is the size of the batch data, is the standard deviation of the batch data input in the i-th language, is a constant used to prevent division by zero. represents the i1th data in the batch data input in the i-th language;

[0027] S13. During the denoising autoencoder, the original input text sequence is destroyed by reconstructing the noise function, and the tokens are masked by replacing the randomly sampled tokens with masked tokens or deleting them from the input text sequence.

[0028] S14. The encoder input is a noisy text sequence, and the decoder input is a raw text with a position bias. A language ID tag is appended to the encoder and decoder inputs respectively.

[0029] S15, PLBART model is pre-trained in N languages; each language has an unlabeled instance set, and each instance is trained using a noise function. The PLBART model is trained from the noise function To predict instances in the input batch data, the PLBART model is trained to maximize The specific formula is:

[0030]

[0031] in, is the loss function, f( ) is the noise function, which is used to learn the grammatical and semantic features of the language. is the noise intensity hyperparameter, P( ) is the probability function during decoding, the decoding process estimated after standard sequence-to-sequence decoding, and θ is the training parameter in the neural network;

[0032] S16: Implement overall training of the PLBART model through S11 to S15 to obtain a trained PLBART model.

[0033] Furthermore, the S2 specifically includes:

[0034] S21. Pre-configure the velocity template in the project, including setting up the business code for generating the MVC three-tier framework and the front-end React page template. Set the fixed format and variable position in the velocity template.

[0035] S22. Adopting the front-end and back-end separation mode, based on the MVC three-tier architecture and React page templates set by Velocity, using the set basic templates to build a visual low-code platform;

[0036] S23. Integrate components to connect the visual low-code development platform with the code repository.

[0037] Furthermore, the S3 specifically includes:

[0038] S31, based on the basic template configured in S2, relies on the visual low-code development platform to configure micro-processes, pages, logic, annotations, and model information through the code-free visual operation page;

[0039] S32. After the configuration is completed, the backend interface is called. After receiving the information, the backend interface maps the configuration data to the database entity and stores the configuration data.

[0040] Furthermore, the S4 specifically includes:

[0041] S41. After triggering the build code event, the visual low-code development platform queries the user configuration data in the database;

[0042] S42. Render the queried data using the velocity engine and automatically pregenerate basic code.

[0043] S43. The visual low-code development platform pushes the basic code directly to the code repository through integrated components.

[0044] Furthermore, the S5 specifically includes:

[0045] S51. Pull relevant basic code data from the code repository, including backend JAVA code and frontend JavaScript code, and push it to the PLBART model as input source, and use the model for code auto-completion.

[0046] S52. The PLBART model uses denoising pre-training to process generation tasks and jointly learns multi-language processing of programming languages ​​and natural languages ​​to generate runnable code.

[0047] Furthermore, the S6 specifically includes:

[0048] S61. Push the finally generated executable front-end code and back-end code to the code repository;

[0049] S62. Download and install dependencies and test the entire program.

[0050] S63. After the program is tested, the front-end code and the back-end code are compiled and packaged.

[0051] Furthermore, the S7 specifically includes:

[0052] S71. Based on the container cluster technology Kubernetes, build multiple pods. A pod usually contains one or more closely cooperating containers. Different labels are set on multiple pods to distinguish them. Pods are the basic operating unit in Kubernetes.

[0053] S72. Use Kubernetes load balancing strategies to distribute network traffic based on different labels.

[0054] S73. When business code changes, use Kubernetes to manage the entire cluster and enable communication between node components by controlling pods with different labels.

[0055] S74. Forwarding to different pods is achieved through the IP hash algorithm. The formula for the IP hash algorithm is:

[0056]

[0057] Where M and W are both positive integers, M is set to a power of 2, W is the computer word length, a is a number close to W, and floor means rounding down the expression. Indicates remainder;

[0058] S75. When performing a grayscale release, by replacing some pods and performing a hash algorithm on the IP, only 10% to 15% of the network traffic is allocated to the new pods, thus achieving grayscale release for some users.

[0059] The present invention also provides a system for multimodal code generation and progressive delivery, which includes a module for executing the multimodal code generation and progressive delivery method.

[0060] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the multimodal code generation and progressive delivery method when executing the program.

[0061] The beneficial effects of the present invention are:

[0062] 1. This invention uses a low-code platform based on the PLBART model (Progressive Low-Code Application Release and Testing) to achieve automated code generation. By combining it with code repositories, image repositories, and CI / CD, it implements grayscale releases and achieves progressive delivery. This method not only enables efficient integration of multiple data sources and interaction methods, but also ensures the high maintainability and scalability of the generated code through modular design.

[0063] 2. In the software delivery phase, the PLBART model's low-code platform, combined with a progressive delivery approach, enables full lifecycle management of application changes, enabling precise version rollbacks, efficient grayscale releases, and comprehensive risk control. This series of innovations significantly enhances the functionality and reliability of existing low-code development platforms, providing strong technical support for the rapid iteration and continuous optimization of enterprise-level applications. Through this technology, enterprises can develop and operate complex business systems at lower costs and higher efficiency, while significantly reducing system failure rates and maintenance costs.

[0064] 3. The present invention realizes systematic code generation through multi-modal data processing, organically combines grayscale release, and realizes progressive delivery, which can significantly improve development efficiency, code quality and system reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 This is a flowchart of a multimodal code generation and progressive delivery method provided by the present invention;

[0066] Figure 2 This is an architectural diagram of a platform based on multimodal code generation and progressive delivery provided by the present invention;

[0067] Figure 3 Pre-training diagram for the PLBART model;

[0068] Figure 4 Pre-generate code diagrams for visual low-code platforms. DETAILED DESCRIPTION

[0069] The present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods. The present invention mainly addresses the shortcomings of existing low-code development platforms, PLBART models, and progressive delivery, and proposes a platform and method based on multimodal code generation and progressive delivery. Although traditional low-code platforms have significant advantages in improving development efficiency, they are difficult to cope with complex business scenarios. If there are complex requirements, code still needs to be written, and there are still obvious shortcomings in maintainability; large model-assisted coding technology can only support code fragmentation generation or optimization and repair based on code problems, and cannot systematically generate business systems that meet user needs. In response to these problems, the present invention proposes a complete solution - a method based on multimodal code generation and progressive delivery, which realizes systematic code generation through multi-modal data processing, organically combines grayscale release, and realizes progressive delivery, which can significantly improve development efficiency, code quality and system reliability.

[0070] like Figure 1As shown, the present invention provides a method based on multimodal code generation and progressive delivery, the method architecture diagram of the present invention is as follows: Figure 2 As shown, the method mainly uses a visual low-code platform for code pre-generation, uses a multimodal PLBART model to automatically complete and correct the generated code, and uses Kubernetes with a load balancing strategy to implement grayscale release for progressive delivery. The specific implementation method is: the method includes the following steps:

[0071] S1. Comprehensively collect code and natural language text data from multiple programming languages ​​for preprocessing, and perform sequence-to-sequence pre-training based on the Transformer architecture to obtain the PLBART model.

[0072] The code and natural language text data for multiple programming languages ​​mainly includes a large number of JAVA, JavaScript, SQL and other related data sets collected from open source code repositories. The PLBART model is pre-trained based on the Transformer architecture. Specifically, the PLBART model is pre-trained by collecting multimodal data and processing sample data of natural language (NL) and programming language (PL). The specific steps are described as follows:

[0073] S11. Collect a large number of mixed sequences of codes, functions and natural language descriptions, mainly including JAVA code, SQL code, JAVA method, code comments, project overview and other data, aggregate data of different modes, so that the model can learn the characteristics and patterns of NL and PL at the same time. In the aggregation process, when aggregating data of different modes, since NL data is much less than PL data, it is necessary to keep more data in the mode during data processing. Since the magnitude of PL and NL data is quite different, according to the probability multinomial distribution ( ) to pre-train the instance, the specific formula is:

[0074] ;

[0075] in, represents the ratio of text after upsampling and downsampling in the i-th language, N is the total number of languages, is the total number of instances in the i-th language, is the total number of instances of the jth language, α is the smoothing parameter, represents the proportion of the i-th language in the total languages, express α to the power of represents the proportion of the jth language in the total languages, express α to the power of

[0076] S12. During the training process, the PLBART model is implemented using a sequence-to-sequence (seq2seq) Transformer. Based on its built-in 6-layer encoder and 6-layer decoder, additional layer normalization layers (Normalization) are synchronously added to both the encoder and the decoder for stable training with FP16 precision.

[0077] In the normalization layer, the mean and standard deviation are calculated for different dimensions of the same feature of the same sample, while the traditional batch normalization calculates the mean and variance for different samples of the same feature of the same dimension. The formula for the standard deviation in this invention is:

[0078] ;

[0079] Where, is the batch data input for the i-th language, is the variance of each feature, [[ID=​​​​​​​​​​​​​​​​​​To predict instances in the input batch data, the PLBART model is trained to maximize The specific formula is:

[0083]

[0084] in, is the loss function, f( ) is the noise function, which is used to learn the grammatical and semantic features of the language. is the noise intensity hyperparameter, P( ) is the probability function during decoding, the decoding process estimated after standard sequence-to-sequence decoding, and θ is the training parameter in the neural network;

[0085] By using structure-aware pre-training to learn program syntax and semantics, the model is continuously optimized by inputting bug-containing code and outputting bug-free code.

[0086] S16: Implement overall training of the PLBART model through S11 to S15 to obtain a trained PLBART model.

[0087] S2. Build a basic template for code generation and build a visual low-code development platform based on the basic template. Configure the page visually, including the front-end page style, layout, size, interaction method, data type, and back-end business code logic, calling method, data structure, etc. The specific steps are described as follows:

[0088] S21. Pre-configure the velocity template in the project, including setting up the business code for generating the MVC three-tier framework and the front-end React page template. Set the fixed format and variable position in the velocity template.

[0089] S22. Adopting the front-end and back-end separation mode, based on the MVC three-tier architecture and React page templates set by Velocity, using the set basic templates to build a visual low-code platform; the visual low-code platform mainly includes: front-end micro-process module, entity module, page module, monitoring module, component module, code generation module, rule engine module, data permission module, process engine module, etc.

[0090] S23. Integration includes Git components to achieve docking between the visual low-code development platform and the code repository.

[0091] S3. Configure data through the visualization page based on the visual low-code development platform. The specific steps are described as follows:

[0092] S31, based on the basic template configured in S2 and relying on the visual low-code development platform, configures micro-processes, pages, logic, annotations, and model information through code-free visual operation pages. Micro-processes mainly include business rules, process approval, process node control, process monitoring and other related data configurations. Annotations include page annotations, method annotations, class annotations, and property annotations. Models include database object names, types, lengths, etc.

[0093] S32. After the configuration is completed, the back-end interface is called. After receiving the information, the back-end interface maps the configuration data to the database entity and stores the configuration data; the database includes the DAMO database or the Renmin University of China Golden Warehouse database.

[0094] S4. Generate database model data based on configuration data and pre-generate basic code based on basic templates; Figure 4 As shown, after the user form is configured, the configured JSON data is transferred to the backend by calling the backend interface and stored in the database, and then rendered based on the database data and the template; the specific steps are described as follows:

[0095] S41. After triggering the build code event, the visual low-code development platform queries the user configuration data in the database; such as entity name, method name, method execution logic and other related codes.

[0096] S42, the queried data is rendered through the velocity engine, and the basic code is automatically pre-generated to form the back-end JAVA code and the front-end JavaScript code; Figure 4 As shown, the backend uses JAVA language to construct entity Bean, Service, Controller, and Mapper to form the backend basic code; the front end uses JavaScript language to render the page element position, layout, style, etc. to form the front end basic code.

[0097] S43. The visual low-code development platform pushes the generated basic code directly to the code repository through the integrated git component.

[0098] S5. Input the generated basic code into the PLBART model; use the PLBART model to reason and complete the language syntax and semantics, and output executable code. The specific steps are described as follows:

[0099] S51. Pull relevant basic code data from the code repository, including backend JAVA code and frontend JavaScript code, and push it to the PLBART model as input source, and use the model for code auto-completion.

[0100] S52. The PLBART model uses denoising pre-training to process generation tasks and jointly learns multi-language processing of programming languages ​​and natural languages ​​to generate syntactically and logically complete, runnable SpringBoot framework code and React framework code.

[0101] S6. Push the executable code to the code repository and use dependency management tools such as Maven and npm to automatically build, test, and package the executable code. The specific steps are described as follows:

[0102] S61. By integrating tools such as git, push the final generated executable front-end code and back-end code to the code repository;

[0103] S62. Use tools such as Maven and npm to automatically download and install dependencies and test the entire program.

[0104] S63. After the program is tested, use npm, maven and other instructions to compile and package the front-end code and back-end code.

[0105] S7. After the program code is built, it needs to be released so that users can access the system. When releasing, use automated build and release tools such as Jenkins and other tools in conjunction with the grayscale release strategy to implement grayscale release and ultimately complete progressive delivery. The specific steps are described as follows:

[0106] S71. Based on the container cluster technology Kubernetes, build multiple pods. A pod usually contains one or more closely cooperating containers. Different labels are set on multiple pods to distinguish them. Pods are the basic operating unit in Kubernetes.

[0107] S72, Kubernetes implements load balancing by exposing containers using DNS names or their own IP addresses, distributing network traffic based on different labels;

[0108] S73. When the business code changes, Kubernetes is used to manage the entire cluster. Communication between node components is achieved by controlling pods with different labels. Specifically, the API server is responsible for communication with other master node components, the Scheculer is responsible for scheduling applications to working nodes, and the Controller-Manage is responsible for continuously tracking working nodes and processing node failures and other data.

[0109] S74. Forwarding to different pods is achieved through the IP hash algorithm. The formula for the IP hash algorithm is:

[0110]

[0111] Where M and W are both positive integers, M is set to a power of 2, W is the computer word length, a is a number close to W, and floor means rounding down the expression. Remainder: This method extracts certain features of the input data through multiplication and modulo operations.

[0112] S75. When performing a grayscale release, by replacing some pods and performing a hash algorithm on the IP, only 10% to 15% of the network traffic is allocated to the new pods, thus achieving grayscale release for some users.

[0113] The present invention also provides a multimodal code generation and progressive delivery system, the system comprising:

[0114] A pre-trained model is used to comprehensively collect code and natural language text data from multiple programming languages ​​for pre-processing, and to perform sequence-to-sequence pre-training based on the Transformer architecture to obtain the PLBART model;

[0115] Building modules, used to build basic templates for code generation and build a visual low-code development platform based on the basic templates;

[0116] Configuration module, used to set configuration data through visual pages based on the visual low-code development platform;

[0117] Pre-generation module, used to generate database model data based on configuration data and pre-generate basic code based on basic templates;

[0118] The runnable code generation module is used to input the generated basic code into the PLBART model; the PLBART model is used to reason and complete the language syntax and semantics, and output runnable code;

[0119] The packaging module is used to push executable code to the code repository and use dependency management tools to automatically build, test, and package the executable code;

[0120] The delivery module is used to implement grayscale release and progressive delivery using a grayscale release strategy.

[0121] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the multimodal code generation and progressive delivery method when executing the program.

[0122] This invention innovatively proposes to achieve progressive delivery of software projects based on the combination of a visual low-code platform, multimodal code generation technology, and CI / CD process automated release.

[0123] Traditional manual coding requires significant labor and time costs, and results in a long delivery cycle. Traditional low-code platforms typically use user-configured elements on a page, storing structured data according to pre-defined rules without any code generation. This can lead to slow web page rendering and inability to meet complex user needs due to long data storage periods. Loss of configuration data can also cause system crashes. Table 1 compares the advantages and disadvantages of different approaches to progressive delivery:

[0124] Table 1: Comparison of the advantages and disadvantages of different methods of automation and progressive delivery

[0125]

[0126] This paper builds the PLBART model based on open source code and existing project code. The PLBART model uses denoising pre-training to handle generation tasks and jointly learns multilingual representations of programming languages ​​and natural languages. Compared with other existing models, accurate matching is the key metric for program repair tasks, as can be seen from the EM metric. The input and output are in the same language, but the input is buggy code and the output is bug-free code. In the Java small and medium datasets, the PLBART model can generate 17.13% and 74.03% more correct bug fixes than CodeBERT, respectively. The performance of the PLBART model is comparable to that of GraphCodeBERT, as shown in Table 2.

[0127] Table 2: Program repair effects of different methods

[0128]

[0129] By comprehensively comparing the effects of the above implementation methods with those of code generation, the system and method of the present invention can further effectively improve the existing system software delivery.

[0130] The specific embodiments of the present invention are described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in this field without departing from the scope of the present invention.

Claims

1. A method based on multimodal code generation and progressive delivery, characterized by: The method comprises: S1. Comprehensively collect code and natural language text data from multiple programming languages ​​for preprocessing, and perform sequence-to-sequence pre-training based on the Transformer architecture to obtain the PLBART model. S2. Build a basic template for code generation and build a visual low-code development platform based on the basic template; S3. Set configuration data through the visualization page based on the visual low-code development platform; S4. Generate database model data based on the configuration data and pre-generate basic code based on the basic template; S5. Input the generated basic code into the PLBART model; use the PLBART model to reason and complete the language syntax and semantics, and output executable code; S6. Push the executable code to the code repository and use dependency management tools to automatically build, test, and package the executable code. S7. Use a grayscale release strategy to implement grayscale release and achieve progressive delivery. Said S1 specifically includes: S11. Collect a large number of mixed sequences of codes, functions and natural language descriptions to aggregate data of different modalities. In the aggregation process, when aggregating data of different modalities, according to the probability multinomial distribution ( ) to pre-train the instance, the specific formula is: ; in, represents the ratio of text after upsampling and downsampling in the i-th language, N is the total number of languages, is the total number of instances in the i-th language, is the total number of instances of the jth language, α is the smoothing parameter, represents the proportion of the i-th language in the total languages, express α to the power of represents the proportion of the jth language in the total languages, express α to the power of S12. During the training process, a sequence-to-sequence Transformer is used to achieve stable accuracy training through encoders, decoders, and additional normalization layers. In the normalization layer, the mean and standard deviation of different dimensions of the same feature and the same sample are calculated. The formula for the standard deviation is: ; in, Batch data input for language i, is the variance of each feature, is the mean of each feature, m is the size of the batch data, is the standard deviation of the batch data input in the i-th language, is a constant used to prevent division by zero. represents the i1th data in the batch data input in the i-th language; S13. During the denoising autoencoder, the original input text sequence is destroyed by reconstructing the noise function, and the tokens are masked by replacing the randomly sampled tokens with masked tokens or deleting them from the input text sequence. S14. The encoder input is a noisy text sequence, and the decoder input is a raw text with a position bias. A language ID tag is appended to the encoder and decoder inputs respectively. S15, PLBART model is pre-trained in N languages; each language has an unlabeled instance set, and each instance is trained using a noise function. The PLBART model is trained from the noise function To predict instances in the input batch data, the PLBART model is trained to maximize The specific formula is: ; in, is the loss function, f( ) is the noise function, which is used to learn the grammatical and semantic features of the language. is the noise intensity hyperparameter, P( ) is the probability function during decoding, the decoding process estimated after standard sequence-to-sequence decoding, and θ is the training parameter in the neural network; By using structure-aware pre-training to learn program syntax and semantics, the model is continuously optimized by inputting buggy code and outputting bug-free code. The S7 specifically includes: S71. Based on the container cluster technology Kubernetes, build multiple pods. A pod contains one or more containers, and different labels are set for multiple pods to distinguish them. Pods are the basic operating unit in Kubernetes. S72. Use Kubernetes load balancing strategies to distribute network traffic based on different labels. S73. When business code changes, use Kubernetes to manage the entire cluster and enable communication between node components by controlling pods with different labels. S74. Forwarding to different pods is achieved through the IP hash algorithm. The formula for the IP hash algorithm is: ; Where M and W are both positive integers, M is set to a power of 2, W is the computer word length, a is a number close to W, and floor means rounding down the expression. Indicates remainder; S75. When performing a grayscale release, by replacing some pods and performing a hash algorithm on the IP, only 10% to 15% of the network traffic is allocated to the new pods, thus achieving grayscale release for some users.

2. The multimodal code generation and progressive delivery method according to claim 1, characterized in that: The S2 specifically includes: S21. Pre-configure the velocity template in the project, including setting up the business code for generating the MVC three-tier framework and the front-end React page template. Set the fixed format and variable position in the velocity template. S22. Adopting the front-end and back-end separation mode, based on the MVC three-tier architecture and React page templates set by Velocity, using the set basic templates to build a visual low-code platform; S23. Integrate components to connect the visual low-code development platform with the code repository.

3. The multimodal code generation and progressive delivery method according to claim 1, characterized in that: The S3 specifically includes: S31, based on the basic template configured in S2, relies on the visual low-code development platform to configure micro-processes, pages, logic, annotations, and model information through the code-free visual operation page; S32. After the configuration is completed, the backend interface is called. After receiving the information, the backend interface maps the configuration data to the database entity and stores the configuration data.

4. The multimodal code generation and progressive delivery method according to claim 1, characterized in that: The S4 specifically includes: S41. After triggering the build code event, the visual low-code development platform queries the user configuration data in the database; S42. Render the queried data using the velocity engine and automatically pregenerate basic code. S43. The visual low-code development platform pushes the basic code directly to the code repository through integrated components.

5. The method for multimodal code generation and progressive delivery according to claim 1, wherein: The S5 specifically includes: S51. Pull relevant basic code data from the code repository, including backend JAVA code and frontend JavaScript code, and push it to the PLBART model as input source, and use the model for code auto-completion. S52. The PLBART model uses denoising pre-training to process generation tasks and jointly learns multi-language processing of programming languages ​​and natural languages ​​to generate runnable code.

6. The method for multimodal code generation and progressive delivery according to claim 1, characterized in that: The S6 specifically includes: S61. Push the finally generated executable front-end code and back-end code to the code repository; S62. Download and install dependencies and test the entire program. S63. After the program is tested, the front-end code and the back-end code are compiled and packaged.

7. A multimodal code generation and progressive delivery system, characterized in that: The system includes: a module for executing a multimodal code generation and progressive delivery method according to any one of claims 1 to 6.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the multimodal code generation and progressive delivery method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Mixed code annotation generation method based on information retrieval and deep neural network

    CN115509604A

  • Cloud native low-code construction method and system based on micro-service architecture and application

    CN116185381A