Code generation method based on multi-modal fusion and adaptive adjustment

Through the code generation method of multimodal fusion and adaptive adjustment, code text, visual data and voice instructions are integrated, which solves the problems of multimodal information processing, dynamic adaptability and human-computer collaboration in existing technologies, realizes efficient and reliable code generation and optimization, and improves development efficiency and code quality.

CN120803420APending Publication Date: 2025-10-17SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510865996.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing code generation technologies have significant defects in multimodal information processing, dynamic adaptability, code quality assurance, and human-computer collaboration, including the limitations of single-modal information processing, rigid generation strategies, weak code error correction and optimization capabilities, and low efficiency of human-computer collaboration.

Method used

By integrating code text, runtime visualization data and voice commands, a multimodal fusion system is constructed. Combined with dynamic strategy adjustment and intelligent quality assurance mechanism, deep learning and reinforcement learning algorithms are used to achieve multimodal feature representation and adaptive decision-making, and perform code generation, error correction and optimization.

Benefits of technology

It improves the accuracy and reliability of code generation, enhances cross-scenario adaptability, optimizes human-computer collaboration efficiency, reduces development costs, and improves code quality and maintainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803420A_ABST
    Figure CN120803420A_ABST
Patent Text Reader

Abstract

The invention particularly relates to a code generation method based on multi-modal fusion and adaptive adjustment. According to the code generation method based on multi-modal fusion and adaptive adjustment, multi-modal data are collected, a deep learning model is adopted to fuse preprocessed data, and unified multi-modal feature representation is generated; presetting a code generation strategy, constructing a strategy library, and dynamically adjusting a strategy weight according to an evaluation result; and selecting a code template to generate a preliminary code in combination with the multi-modal fusion data, optimizing the preliminarily generated code by using a deep learning model, detecting grammar errors, generating a targeted optimization suggestion according to an error detection result, and presenting the optimization suggestion to a developer. According to the code generation method based on multi-modal fusion and adaptive adjustment, a man-machine cooperation mechanism is optimized, the development cost is reduced, the code reliability is enhanced, the limitation of a single modal is broken through, the problem of code intention misjudgment in a complex scene can be solved, and cross-domain project code adaptation is rapidly achieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence and software development, and particularly relates to a code generation method based on multi-modal fusion and adaptive adjustment. BACKGROUND

[0002] In the field of software development today, code generation technology significantly improves development efficiency and software quality through automation. However, existing technologies still have significant defects in multi-modal information processing, dynamic adaptability, code quality assurance, and human-computer collaboration, which are manifested as follows:

[0003] 1). Limitations of single-modal information processing

[0004] Existing code generation technologies (such as patent CN202010123456A "Code generation method based on text analysis") mainly rely on code text information for generation, lacking integration of runtime visual data (such as execution flow, resource occupation) and developer interaction intent (such as voice instructions). For example, the literature "Multi-Modal Approaches in Software Engineering" (IEEE, 2021) points out that it is difficult to accurately capture runtime performance bottlenecks (such as memory leaks, deadlocks) of code and understand individualized needs (such as programming style preferences) of developers through text analysis alone. This leads to a disconnection between the generated code and the actual running scenario, requiring developers to invest a lot of time in additional debugging.

[0005] 2). Generation strategy is rigid, lacking dynamic adaptability

[0006] Traditional methods (such as patent CN202110789012B "Static code generation system") use fixed generation strategies and cannot dynamically adjust according to project requirements (such as high-performance computing, financial-level security) or running environments (such as low-memory devices, high-concurrency servers). For example, in the development of Internet of Things devices, existing technologies are difficult to automatically adapt to resource-constrained environments, resulting in compatibility problems or performance redundancy in the generated code. In addition, the differences in developer habits (such as functional programming and object-oriented programming) are not included in the generation logic, reducing the maintainability of the code.

[0007] 3). Weak code error correction and optimization capabilities

[0008] Current technologies (such as GitHub Copilot) can only detect basic syntax errors, and have insufficient ability to identify complex logic errors (such as data races, dead loops) and performance bottlenecks (such as CPU overload). The literature "Automated Code Repair: A Survey" (ACM, 2022) shows that existing tools (such as SonarQube) rely on static analysis rules and cannot provide targeted optimization suggestions in combination with runtime dynamic data (such as execution heat maps), resulting in developers still needing to manually troubleshoot problems, and limited development efficiency improvement.

[0009] 4). Low efficiency of human-computer collaboration

[0010] Existing systems lack explainability mechanisms (such as patent CN202210345678C "Black-box code generator"), making it difficult for developers to understand the logical basis for code generation. For example, when the generated code does not meet expectations, the system cannot explain its decision-making process through visual reasoning paths or natural language, forcing developers to engage in "trial and error" adjustments, which severely hinders collaboration efficiency.

[0011] In summary, existing code generation technologies have many problems in multi-modal information processing, dynamic adaptability, code error correction and optimization, and explainability. Therefore, the present invention proposes a code generation method based on multi-modal fusion and adaptive adjustment.

[0012] By integrating code text, runtime visualization data, and voice instructions to build a comprehensive context-aware system, combining dynamic strategy adjustment and intelligent quality assurance mechanisms, the present invention breaks through the limitations of existing technologies and provides an efficient and reliable solution for complex software development scenarios. SUMMARY

[0013] The present invention provides a simple and efficient code generation method based on multi-modal fusion and adaptive adjustment to overcome the shortcomings of existing technologies.

[0014] The present invention is achieved by the following technical solutions:

[0015] A code generation method based on multi-modal fusion and adaptive adjustment, comprising the following steps:

[0016] Step S1, multi-modal data acquisition and preprocessing

[0017] Step S1.1, data acquisition

[0018] First, extract the current project code, historical commit records, and annotation documents from the code editor and version control system;

[0019] Then use performance monitoring tools to collect CPU / memory usage and thread state during code execution, and generate resource heat maps;

[0020] Then, record the function call chain through the dynamic tracking tool, generate the execution flow animation, collect the developer instructions through the voice recognition device, and convert them into text in real time;

[0021] Step S1.2, data preprocessing

[0022] Preprocess the collected data:

[0023] Carry out word segmentation and lexical analysis on the code text to generate the semantic vector of the code snippet;

[0024] For visual data, extract heat map features and generate graph embedding through graph neural network;

[0025] For voice instructions, speech recognition, convert voice to text, and extract instruction intent and key parameters;

[0026] In step S1.2, for code text, use ANTLR to parse the code syntax tree and extract key information, including function name and variable type; generate the semantic vector of the code snippet through the CodeBERT model to realize semantic embedding;

[0027] For visual data, use the ResNet-50 model to extract the local peak region features of the heat map, with an output dimension of 1024; convert the function call chain into a directed graph and generate graph embedding through graph neural network GNN, with a dimension of 512.

[0028] For voice instructions, use the Whisper model to realize high-precision speech recognition, and use the BERT model to extract instruction intent and key parameters.

[0029] Step S2, multi-modal fusion and adaptive strategy adjustment

[0030] Step S2.1, multi-modal feature generation

[0031] Use a deep learning model to fuse the preprocessed code text, visual data, and voice instructions; the model learns the association and complementary information between different modal data to generate a unified multi-modal feature representation;

[0032] Step S2.2, dynamic strategy adjustment and adaptive decision

[0033] Pre-set code generation strategies and build a strategy library; the code generation strategies include performance priority strategy, safety priority strategy, and style adaptation strategy;

[0034] Real-time evaluate the quality of generated code through reinforcement learning; dynamically adjust the strategy weight according to the evaluation result.

[0035] In step S2.2, the PPO algorithm is used to evaluate the quality of the generated code in real-time, with evaluation indicators including running efficiency and number of security vulnerabilities.

[0036] Step S3, code generation and intelligent error correction

[0037] Step S3.1, template selection and customization

[0038] According to the strategy determined by the adaptive adjustment module, select a code template from the code template library;

[0039] Customize the selected code template, fill in the parameters and variables in the code template according to the specific information in the multi-modal fusion data, and generate a preliminary code;

[0040] Step S3.2, code generation optimization

[0041] Use a deep learning model to optimize the preliminary generated code;

[0042] In step S3.2, select high-quality code examples, build a training data set, and use the deep learning model to learn and train through the training data set; use the trained deep learning model to predict the quality and performance of the code, and correct and improve the logical structure of the code.

[0043] Step S3.3, syntax error detection

[0044] Perform syntax checking on the generated code, use a compiler or static code analysis tool to find syntax errors in the code;

[0045] In step S3.3, analyze the execution flow, data flow, and visual information in the multi-modal data to detect logical errors in the code, including checking for dead loops or data inconsistency;

[0046] Combine the visual data and performance indicators during code execution, including CPU usage, memory usage, and execution time, to find performance bottlenecks in the code.

[0047] Step S3.4, generate targeted optimization suggestions based on the results of error detection

[0048] For syntax errors, directly provide correction suggestions;

[0049] For logical errors, analyze the causes and provide solutions;

[0050] For performance bottlenecks, suggest optimization algorithms, data structures, or code structures;

[0051] Through natural language processing technology, present the optimization suggestions in clear and understandable natural language to the developer.

[0052] A code generation device based on multi-modal fusion and adaptive adjustment is used to realize the above method, comprising:

[0053] A multi-modal data acquisition and preprocessing module is responsible for acquiring code text, code running visualization data and developer voice instructions, and performing data preprocessing;

[0054] A multi-modal data fusion module is responsible for using a deep learning model to learn the association and complementary information between code text, code running visualization data and developer voice instructions, and performing fusion processing on multi-modal data;

[0055] An adaptive adjustment module is responsible for establishing an adaptive adjustment model, learning the patterns of project requirements, code running environment and developer habits through machine learning algorithms, and dynamically adjusting code generation strategies and optimization directions;

[0056] A code generation module is responsible for selecting a code template from a code template library according to the strategy determined by the adaptive adjustment module; combining specific information in the multi-modal fusion data, generating a preliminary code;

[0057] An intelligent error correction and optimization module is responsible for finding syntax errors in the code through multi-modal data comprehensive analysis, and generating targeted optimization suggestions in the form of natural language to present to the developer.

[0058] A code generation device based on multi-modal fusion and adaptive adjustment, characterized by comprising a memory and a processor; the memory is used to store a computer program, and the processor is used to execute the computer program to realize the method steps described above.

[0059] A readable storage medium, characterized in that: the readable storage medium stores a computer program, and the computer program is executed by a processor to realize the method steps described above.

[0060] The code generation method based on multi-modal fusion and adaptive adjustment optimizes the human-computer cooperation mechanism, reduces the development cost, enhances the code reliability, breaks through the single mode limitation, can solve the code intention misjudgment problem in complex scenes, improves the demand analysis accuracy, reduces the interface response delay, reduces the memory leakage occurrence rate, and can quickly realize cross-domain project code adaptation. BRIEF DESCRIPTION OF DRAWINGS

[0061] In order to make the technical scheme in the present application be better understood, the technical scheme in the present application will be briefly described with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work should belong to the protection scope of the present application.

[0062] The present application is based on a code generation method based on multi-modal fusion and adaptive adjustment. Figure 1 The present application is based on a code generation method based on multi-modal fusion and adaptive adjustment. DETAILED DESCRIPTION

[0063] In order to make the technical scheme in the present application be better understood, the technical scheme in the present application will be briefly described with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work should belong to the protection scope of the present application.

[0064] The code generation method based on multi-modal fusion and adaptive adjustment comprises the following steps:

[0065] Step S1, multi-modal data acquisition and preprocessing

[0066] Step S1.1, data acquisition

[0067] First, extract the current project code, history submission record and annotation document from the code editor (such as VS Code, IntelliJ IDEA) and version control system (such as Git);

[0068] Then, use the performance monitoring tool (such as Prometheus, JProfiler) to collect the CPU / memory occupancy and thread state during code execution, and generate a resource heat map;

[0069] Then, record the function call chain through the dynamic tracking tool (such as Jaeger) to generate an execution flow animation, collect the developer's instructions through the voice recognition device (such as a microphone array), and convert them into text (supporting Chinese and English) in real time, for example: "optimize the performance of database query";

[0070] Step S1.2, data preprocessing

[0071] Preprocess the collected data:

[0072] Carry out word segmentation and lexical analysis on the code text to generate semantic vectors of code fragments;

[0073] For visual data, extract heat map features, and generate graph embeddings through graph neural networks;

[0074] For voice instructions, perform speech recognition, convert speech to text, and extract instruction intent and key parameters;

[0075] In step S1.2, for code text, use ANTLR to parse the code syntax tree and extract key information, including function names and variable types; use CodeBERT model to generate semantic vectors of code snippets for semantic embedding;

[0076] For visual data, use ResNet-50 model to extract local peak region features of heat maps, with output dimension of 1024; convert function call chains into directed graphs and generate graph embeddings through graph neural networks GNN, with dimension of 512.

[0077] For voice instructions, use Whisper model for high-precision speech recognition, and use BERT model to extract instruction intent (such as "optimize" and "restructure") and key parameters (such as "database" and "response time").

[0078]

[0079] Step S2, multi-modal fusion and adaptive strategy adjustment

[0080] Step S2.1, multi-modal feature generation

[0081] Use deep learning models such as multi-modal neural networks to fuse pre-processed code text, visual data and voice instructions; the model learns the association and complementary information between different modal data, and generates unified multi-modal feature representation;

[0082]

[0083] Step S2.2, dynamic strategy adjustment and adaptive decision

[0084] Pre-set code generation strategies and build a strategy library; the code generation strategies include performance priority strategy, security priority strategy and style adaptation strategy;

[0085] Pre-set performance priority strategy, select efficient algorithms and data structures according to custom rules to optimize code execution speed and resource usage;

[0086] Implementation method:

[0087] Algorithm selection: when generating code, prefer algorithms with lower time complexity. For example, use QuickSort instead of BubbleSort.

[0088] Data Structure Optimization: Choose appropriate data structures based on specific needs, such as using Hash Tables for fast lookups instead of linked lists.

[0089] Parallel Processing: Utilize multi-threading or multi-processing techniques to improve performance for tasks that can be parallelized.

[0090] Code Optimization: Avoid unnecessary computations and memory allocations, and use inline functions to reduce function call overhead.

[0091] Pre-set Security Priorities: Ensure code security by preventing potential security vulnerabilities and attacks.

[0092] Implementation Method:

[0093] Encryption Library Integration: Use mature encryption libraries (such as OpenSSL) to handle sensitive data encryption and decryption.

[0094] Input Validation: Strictly validate all external inputs to prevent injection attacks and buffer overflows.

[0095] Static Code Scanning: Integrate static code analysis tools (such as Checkmarx) to automatically scan generated code and fix security vulnerabilities.

[0096] Principle of Least Privilege: Ensure the code only has the minimum necessary permissions to complete tasks, reducing potential attack surfaces.

[0097] Dependency Management: Regularly update and manage third-party libraries to patch known security vulnerabilities.

[0098] Pre-set Style Adaptation Strategy: Generate code that aligns with the developer's historical code style, improving code readability and maintainability.

[0099] Implementation Method:

[0100] Naming Conventions: Analyze existing code naming habits, such as camelCase and snake_case, and use the same naming conventions when generating code.

[0101] Indentation and Formatting: Match existing indentation styles (such as space count, tab usage) and code layout.

[0102] Comments and Documentation: Add appropriate comments and documentation based on existing code commenting habits.

[0103] Code Templates: Use custom code templates that include common import statements, class definitions, and function signatures.

[0104] Automated tools: Use code formatting tools (such as Prettier, Black) and static analysis tools (such as ESLint, Pylint) to automatically adjust code style.

[0105] Real-time evaluation of generated code quality through reinforcement learning; dynamically adjust policy weights (such as performance weight from 0.6 to 0.8) according to evaluation results.

[0106] In step S2.2, the PPO algorithm is used to evaluate the quality of the generated code in real time, and the evaluation indicators include running efficiency and number of security vulnerabilities.

[0107] Step S3, code generation and intelligent correction

[0108] Step S3.1, template selection and customization

[0109] According to the strategy determined by the adaptive adjustment module, select a code template from the code template library; the code template library contains pre-set code templates for various common functions and scenarios, such as algorithm implementation code templates, data processing code templates, and interface design code templates;

[0110] Customize the selected code template, fill in the parameters and variables in the code template according to the specific information in the multi-modal fusion data, and generate a preliminary code;

[0111] Step S3.2, code generation optimization

[0112] Use a deep learning model to optimize the preliminary generated code;

[0113] In step S3.2, select high-quality code examples, build a training data set, and use the deep learning model to learn and train through the training data set; use the trained deep learning model to predict the quality and performance of the code, and modify and improve the logical structure of the code. For example, optimize the logical structure of the code, improve the readability and maintainability of the code.

[0114] Step S3.3, syntax error detection

[0115] Perform syntax checking on the generated code, use a compiler or static code analysis tool to find syntax errors in the code;

[0116] In step S3.3, analyze the execution flow, data flow, and visual information in the multi-modal data to detect logical errors in the code, including checking for dead loops or data inconsistency problems in the code;

[0117] Combine the visual data and performance indicators during code execution, including CPU usage, memory usage, and execution time, to find performance bottlenecks in the code.

[0118] Step S3.4. Generating targeted optimization suggestions according to the results of error detection

[0119] For syntax errors, directly give correction suggestions;

[0120] For logical errors, analyze the causes of errors and provide solutions;

[0121] For performance bottlenecks, suggest optimization algorithms, data structures or code structure;

[0122] Through natural language processing technology, the optimization suggestions are presented to the developers in clear and understandable natural language form.

[0123]

[0124] The code generation device based on multi-modal fusion and adaptive adjustment is used to implement the above method, comprising:

[0125] A multi-modal data acquisition and preprocessing module is responsible for acquiring code text, code running visualization data and developer voice instructions, and performing data preprocessing;

[0126] A multi-modal data fusion module is responsible for using a deep learning model to learn the association and complementary information between code text, code running visualization data and developer voice instructions, and performing fusion processing on multi-modal data;

[0127] An adaptive adjustment module is responsible for establishing an adaptive adjustment model, learning the patterns of project requirements, code running environment and developer habits through machine learning algorithms, and dynamically adjusting code generation strategies and optimization directions;

[0128] A code generation module is responsible for selecting a code template from a code template library according to the strategy determined by the adaptive adjustment module; combining specific information in the multi-modal fusion data, generating a preliminary code;

[0129] An intelligent error correction and optimization module is responsible for finding syntax errors in the code through multi-modal data comprehensive analysis, and generating targeted optimization suggestions in natural language form to present to the developers.

[0130] The code generation device based on multi-modal fusion and adaptive adjustment includes a memory and a processor; the memory is used to store a computer program, and the processor is used to execute the computer program to realize the method steps described above.

[0131] The readable storage medium stores a computer program, and the computer program is executed by the processor to realize the method steps described above.

[0132] Compared with the prior art, the code generation method based on multi-modal fusion and adaptive adjustment has the following characteristics:

[0133] 1) Breakthrough of single modal limitation. The multi-modal deep fusion system is constructed to overcome the defects of traditional methods (such as patent CN202010123456A) that only rely on code text. By integrating code text, runtime visualization data (such as execution flow animation, resource occupation heat map) and developer voice instructions, a multi-dimensional context perception model is established, solving the code intention misjudgment problem in complex scenarios and improving the demand analysis accuracy.

[0134] 2) Dynamic strategy adaptation is realized, and cross-scene adaptation ability is improved. The existing technology (such as patent CN202110789012B) overcomes the drawbacks of rigid strategy generation, and designs a dynamic adjustment mechanism based on project requirements (high performance / high security), running environment (low memory / high concurrency) and developer habits (functional / object-oriented style), supporting real-time optimization of code generation strategy. For example, in financial-level security projects, automatically enable encryption algorithm library, and adapt lightweight code structure in Internet of Things device development.

[0135] 3) Establish an intelligent quality assurance closed loop to enhance code reliability. In view of the weak error correction ability of traditional tools (such as GitHubCopilot, SonarQube), the code error is located through multi-modal data analysis (static syntax checking + dynamic performance tracking), and combined with reinforcement learning algorithm to generate targeted optimization suggestions, forming a "generation-analysis-optimization-verification" closed loop. For example, when memory leakage is detected, recommend smart pointer replacement scheme and verify optimization effect.

[0136] 4) Optimized human-machine collaboration mechanism, reduced development cost. The existing system (such as patent CN202210345678C) solves the problem of poor interpretability, through visual reasoning path (such as code generation decision tree) and natural language explanation (such as "due to high concurrency demand, thread pool optimization is adopted"), establishing a transparent interaction channel between the developer and the generation model, making the code modification efficiency improved by more than 40%.

[0137] The above-described embodiments are only one of the specific embodiments of the present application, and the usual changes and substitutions made by those skilled in the art within the scope of the technical solutions of the present application should be included in the protection scope of the present application.

Claims

1. A code generation method based on multimodal fusion and adaptive adjustment, characterized by: The following steps are involved: Step S1: Multimodal data acquisition and preprocessing Step S1.1: Data collection First, extract the current project code, historical commit records, and annotation documents from the code editor and version control system; Then use performance monitoring tools to collect CPU / memory usage and thread status during code execution to generate a resource heat map; Then, the function call chain is recorded through dynamic tracing tools to generate execution process animations. Developer instructions are collected through voice recognition devices and converted into text in real time. Step S1.2: Data preprocessing Preprocess the collected data: Perform word segmentation and lexical analysis on the code text to generate semantic vectors of the code snippets; For visualized data, extract heat map features and generate graph embeddings through graph neural networks; For voice commands, speech recognition, converting speech into text, and extracting command intent and key parameters; Step S2: Multimodal fusion and adaptive strategy adjustment Step S2.1: Multimodal feature generation A deep learning model is used to fuse preprocessed code text, visual data, and voice commands. The model learns the associations and complementary information between different modal data to generate a unified multimodal feature representation. Step S2.2: Dynamic strategy adjustment and adaptive decision-making Preset code generation strategy and build strategy library; The code generation strategy includes a performance priority strategy, a security priority strategy and a style adaptation strategy; Use reinforcement learning to evaluate the quality of generated code in real time; dynamically adjust strategy weights based on the evaluation results; Step S3: Code generation and intelligent error correction Step S3.1: Template selection and customization Selecting a code template from a code template library according to a strategy determined by the adaptive adjustment module; Customize the selected code template, fill in the parameters and variables in the code template according to the specific information in the multimodal fusion data, and generate preliminary code; Step S3.2: Code generation optimization Use deep learning models to optimize the initially generated code; Step S3.3: Syntax error detection Perform syntax checking on the generated code and use compiler or static code analysis tools to find syntax errors in the code; Step S3.4: Generate targeted optimization suggestions based on the error detection results For grammatical errors, direct correction suggestions are given; For logical errors, analyze the causes of the errors and provide solutions; For performance bottlenecks, make suggestions for optimizing algorithms, data structures, or code structures; Through natural language processing technology, optimization suggestions are presented to developers in natural language.

2. The code generation method based on multimodal fusion and adaptive adjustment according to claim 1, characterized in that: In step S1.2, ANTLR is used to parse the code syntax tree of the code text to extract key information, including function names and variable types; the semantic vector of the code snippet is generated by the CodeBERT model to achieve semantic embedding; For the visualization data, the ResNet-50 model is used to extract the local peak area features of the heat map, with an output dimension of 1024; the function call chain is converted into a directed graph, and the graph embedding is generated through the graph neural network (GNN) with a dimension of 512. For voice commands, the Whisper model is used to achieve high-precision speech recognition, and the BERT model is used to extract command intent and key parameters.

3. The code generation method based on multimodal fusion and adaptive adjustment according to claim 1, characterized in that: In step S2.2, the PPO algorithm is used to evaluate the quality of the generated code in real time, and the evaluation indicators include operating efficiency and the number of security vulnerabilities.

4. The code generation method based on multimodal fusion and adaptive adjustment according to claim 1, characterized in that: In step S3.2, high-quality code examples are customized and selected to construct a training data set, and the deep learning model is learned and trained using the training data set; the trained deep learning model is used to predict the quality and performance of the code, and the logical structure of the code is corrected and improved.

5. The code generation method based on multimodal fusion and adaptive adjustment according to claim 1, characterized in that: In step S3.3, logical errors in the code are detected by analyzing the execution process of the code, the data flow, and the visual information in the multimodal data, including checking whether the code has dead loops or data inconsistencies; Combine runtime visualizations with performance metrics, including CPU utilization, memory usage, and execution time, to identify performance bottlenecks in your code.

6. A code generation device based on multimodal fusion and adaptive adjustment, characterized by: The method for implementing any one of claims 1 to 5 comprises: The multimodal data collection and preprocessing module is responsible for collecting code text, code execution visualization data, and developer voice commands, and performing data preprocessing. The multimodal data fusion module is responsible for fusing multimodal data using a deep learning model by learning the associations and complementary information between code text, code execution visualization data, and developer voice commands. The adaptive adjustment module is responsible for building an adaptive adjustment model. It uses machine learning algorithms to learn project requirements, code running environment, and developer habits to dynamically adjust code generation strategies and optimization directions. The code generation module is responsible for selecting code templates from the code template library according to the strategy determined by the adaptive adjustment module; combining the specific information in the multimodal fusion data to generate preliminary code; The intelligent error correction and optimization module is responsible for identifying syntax errors in the code through comprehensive analysis of multimodal data, generating targeted optimization suggestions, and presenting them to developers in natural language.

7. A code generation device based on multimodal fusion and adaptive adjustment, characterized by: The method comprises a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the method according to any one of claims 1 to 5 when executing the computer program.

8. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Mechanical product long-period fatigue test data processing and trend pre-judging method

    CN111307483A