Software code optimization method, system and equipment based on big data and medium
By processing code base and run log data and training machine learning model, the problem of difficulty in understanding the code base in depth in the existing technology is solved, and the rapid and accurate evaluation and optimization of code quality and performance bottlenecks are achieved.
Patent Information
- Application Number
- CN202411716444.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-18
AI Technical Summary
Existing code optimization tools rely on preset rules and heuristic algorithms, making it difficult to understand the code base in depth, and cannot effectively solve the deep-seated performance bottlenecks and quality defects of the code.
By obtaining the target code base and run log data, data cleaning, transformation and aggregation are performed, machine learning models are trained to identify code quality, performance bottlenecks and potential defects, and the trained model is used to analyze user code and generate optimized code segments.
It realizes a comprehensive and rapid evaluation of code quality, improves the accuracy and efficiency of analysis, can promptly detect and report code problems, and the process is highly automated, which lowers the threshold for use.
Smart Images

Figure CN119645416A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a software code optimization method, system, device and medium based on big data. Background Art
[0002] Software code optimization aims to improve software performance, reduce resource consumption, and improve code readability, maintainability, and security through in-depth analysis, modification, and improvement of software source code.
[0003] At present, although there are some code optimization tools on the market, they mostly rely on preset rules and heuristic algorithms and lack the ability to deeply learn and understand the code base. These tools can often only solve some superficial problems, but it is difficult to touch the deep performance bottlenecks and quality defects of the code. Summary of the invention
[0004] The purpose of this application is to provide a software code optimization method, system, device and medium based on big data, which can provide accurate and comprehensive code optimization suggestions.
[0005] This application is implemented as follows:
[0006] In a first aspect, the present application provides a software code optimization method based on big data, comprising the following steps: obtaining a target code library and corresponding operation log data to obtain a first data set; cleaning, converting and aggregating the first data set from the programming language dimension, framework dimension and project specification dimension to obtain a second data set; using the second data set to train a machine learning model so that the machine learning model can identify code quality, performance bottlenecks and potential defects; using the trained machine learning model to analyze the code modules written by the user to obtain code analysis results; based on the code analysis results, generating corresponding code segments from the target code library, and displaying the code segments using a visual interface.
[0007] In some implementations, the method of obtaining the target code library and the corresponding operation log data to obtain the first data set includes: collecting source code data of the project from an Internet open source platform, and obtaining data including source code, compilation logs, test results and performance indicators in real time from the version control system, build server and production environment for internal company projects to obtain the first data set.
[0008] In some implementations, the use of the second data set to train the machine learning model includes: extracting key features including code complexity, code style, and performance indicators from the second data set; using the key features to train the machine learning model, and optimizing and adjusting the machine learning model based on user feedback data and actual performance operation logs.
[0009] In some implementations, the use of a trained machine learning model to analyze a code module written by a user includes: using an API interface to receive the code written by the user, using the trained machine learning model to analyze the code module written by the user, and identifying code areas that need to be optimized.
[0010] In some implementations, generating corresponding code segments from the target code library according to the code analysis results includes: generating corresponding code segments from the target code library according to the code analysis results, and evaluating the code segments using automated testing and performance evaluation tools.
[0011] In some implementations, while generating corresponding code segments from a target code library based on code analysis results, the method also includes generating code refactoring results, algorithm improvement suggestion descriptions, and resource optimization suggestions.
[0012] In some implementations, the method further includes: optimizing and adjusting the machine learning model based on user feedback on the code segment and performance evaluation results.
[0013] In the second aspect, the present application provides a software code optimization system based on big data, which includes: a data acquisition module, used to acquire a target code library and corresponding operation log data to obtain a first data set; a data preprocessing module, used to clean, convert and aggregate the first data set from the programming language dimension, framework dimension and project specification dimension to obtain a second data set; a model training module, used to train a machine learning model using the second data set, so that the machine learning model can identify code quality, performance bottlenecks and potential defects; a code analysis module, used to use the trained machine learning model to analyze the code module written by the user to obtain a code analysis result; a results display module, used to generate a corresponding code segment from the target code library according to the code analysis result, and display the code segment using a visual interface.
[0014] In a third aspect, the present application provides an electronic device, comprising a memory for storing one or more programs; a processor; when the one or more programs are executed by the processor, a method as described in any one of the first aspects is implemented.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method as described in any one of the above-mentioned first aspects.
[0016] Compared with the prior art, the present invention has at least the following advantages or beneficial effects:
[0017] This application proposes a software code optimization method based on big data. By collecting a large amount of code base and operation log data, and using machine learning technology to process and analyze these data, a comprehensive and rapid evaluation of code quality can be achieved. This method not only overcomes the limitations of traditional code review, but also improves the accuracy and efficiency of analysis. At the same time, since the machine learning model can process the input code module in real time, this method can promptly discover and report problems in the code. In addition, the entire process is highly automated, without the need for manual triggering and analysis by the user, which greatly improves work efficiency. Moreover, the analysis results are displayed through a visual interface, allowing users to intuitively see the problems in the code, making it easier to understand and solve the problems. This intuitive presentation method also lowers the threshold for use, allowing non-professionals to easily understand and use this method for code optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 This is a flowchart of an embodiment of a software code optimization method based on big data of the present application;
[0020] Figure 2 This is a structural block diagram of an embodiment of a software code optimization system based on big data in this application;
[0021] Figure 3 A structural block diagram of an electronic device provided in an embodiment of the present application.
[0022] Icon: 101, data acquisition module; 102, data preprocessing module; 103, model training module; 104, code analysis module; 105, results display module; 201, processor; 202, memory; 203, communication interface. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0024] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0025] Example 1
[0026] See also Figure 1 , the software code optimization method based on big data comprises the following steps:
[0027] Step S101: Acquire a target code library and corresponding operation log data to obtain a first data set;
[0028] It should be noted that step S101 can serve as a basis for subsequent analysis by obtaining the target code library and the corresponding operation log data, wherein these data include source code files, compilation information, runtime logs, and error reports, etc. Exemplarily, the target code library can be a code library of an excellent Internet open source project or a company's internal project code library.
[0029] Step S102: Clean, transform and aggregate the first data set from the programming language dimension, the framework dimension and the project specification dimension to obtain a second data set;
[0030] It should be noted that step S102 cleans (such as removing invalid data and filling missing values), converts (such as data format conversion and standardization) and aggregates (such as by project and module classification) the collected data from the programming language dimension, framework dimension and project specification dimension. This step is intended to eliminate noise, outliers and redundant information in the data, ensure the consistency of the data, and convert it into a format suitable for machine learning model processing. Exemplarily, codes in different programming languages can be standardized, log information under different frameworks can be converted into a unified format, and data can be classified and aggregated according to project specifications.
[0031] Step S103: training a machine learning model using the second data set, so that the machine learning model can identify code quality, performance bottlenecks, and potential defects;
[0032] It should be noted that the machine learning model is trained using the second data set, and the model will gradually acquire the ability to identify code quality, performance bottlenecks, and potential defects by learning the features in the code base. For example, natural language processing (NLP) technology and program analysis methods can be applied to extract key features from the second data set, such as code complexity, code style, performance indicators, etc. The machine learning model is then trained using the extracted key features so that the model can identify code quality, performance bottlenecks, and potential defects. The machine learning model algorithm can also be optimized based on user feedback data and actual performance operation logs to make it more perfect.
[0033] Step S104: Analyze the code module written by the user using the trained machine learning model to obtain a code analysis result;
[0034] It should be noted that by taking the code module written by the user as input and analyzing it using the trained machine learning model, the model will output the corresponding analysis results based on the input code module, thereby providing users with fast and accurate code quality assessment, performance bottleneck detection and potential defect identification services, helping users to discover and solve problems in a timely manner.
[0035] Step S105: Generate corresponding code segments from the target code base according to the code analysis results, and display the code segments using a visual interface. The visual interface may include functions such as a code editor and a chart display, so as to present the code analysis results to the user in an intuitive and easy-to-understand manner, helping the user to better understand the problems in the code and take corresponding measures to improve them.
[0036] In summary, the above embodiments can achieve a comprehensive and rapid evaluation of code quality by collecting a large amount of code base and operation log data, and processing and analyzing these data using machine learning technology. This method not only overcomes the limitations of traditional code review, but also improves the accuracy and efficiency of analysis. At the same time, since the machine learning model can process the input code module in real time, the method can promptly discover and report problems in the code, effectively identify code performance bottlenecks, provide accurate optimization suggestions, and improve the running speed and interface response time of the software. Its intelligent code optimization process not only effectively reduces the workload of developers in code review and optimization, but also helps to reduce the long-term software maintenance costs of the project by reducing technical debt and improving the maintainability of the code.
[0037] In addition, the entire process is highly automated, without the need for manual triggering and analysis by the user, which greatly improves work efficiency. Moreover, the analysis results are displayed through a visual interface, allowing users to intuitively see the problems in the code, making it easier to understand and solve the problems. This intuitive presentation method also lowers the threshold for use, allowing non-professionals to easily understand and use this method for code optimization.
[0038] Based on the aforementioned scheme, in some implementation methods of the present application, the target code library and the corresponding operation log data are obtained to obtain the first data set, including: collecting source code data of the project from the Internet open source platform, and obtaining data including source code, compilation logs, test results and performance indicators in real time from the version control system, build server and production environment for internal company projects to obtain the first data set.
[0039] In the above implementation, the acquisition of the first data set is achieved from two perspectives: the Internet open source platform and the company's internal projects. For the collection of project source code data from the Internet open source platform, it is first necessary to clarify which open source code hosting platforms (such as GitHub, GitLab, Bitbucket, etc.) to collect data from. Next, according to specific screening conditions (such as project type, programming language, activity, etc.), the target project is screened out from the selected open source platform and its source code is downloaded. This can be achieved using the API or crawler technology provided by the platform. Finally, the downloaded source code can be preprocessed to a certain extent, such as removing unnecessary files (such as documents, test data, etc.), standardizing the code format, etc., for subsequent analysis.
[0040] As for data acquisition for internal company projects, the above implementation method adopts a method of obtaining data in real time from version control systems, build servers, and production environments. Specifically, internal company projects usually use version control systems such as Git for code management. By integrating the APIs or command line tools of these version control systems, the source code data of the project can be obtained in real time. Among them, by integrating the APIs or log collection tools of these build servers, the compilation logs and test result data of the project can be obtained in real time. The production environment is the environment where the project actually runs. Through monitoring and log collection tools (such as Prometheus, Grafana, ELK Stack, etc.), the performance indicator data of the project, such as response time, throughput, error rate, etc., can be obtained in real time.
[0041] Next, the source code data collected from the Internet open source platform and the data obtained from the version control system, build server and production environment of the company's internal projects are integrated to form the first data set containing source code, compilation logs, test results and performance indicators. This data set provides rich data support for subsequent code analysis, performance evaluation, problem diagnosis and other tasks. At the same time, because the data comes from multiple channels and is collected and processed in real time, it has high accuracy and timeliness.
[0042] Based on the aforementioned scheme, in some implementations of the present application, the use of the second data set to train the machine learning model includes: extracting key features including code complexity, code style and performance indicators from the second data set; using the key features to train the machine learning model, and optimizing and adjusting the machine learning model based on user feedback data and actual performance operation logs.
[0043] It should be noted that code complexity is a measure of how difficult the code is to understand and maintain. It can be quantified in many ways, such as the number of lines of code, function nesting depth, cyclic complexity, etc. Extracting these features helps the model understand the complexity of the code and predict potential problems. Code style refers to the norms and habits followed when writing code. A good code style can improve the readability and maintainability of the code. Extracting code style features may include code indentation, naming conventions, comment ratios, etc. Performance indicators are data that measure how the software performs in the actual operating environment. These indicators may include response time, throughput, resource occupancy, etc. Extracting these features helps the model understand the actual performance of the software and predict possible performance bottlenecks.
[0044] By extracting key features that have a significant impact on the training of the machine learning model from the second data set, these features can be better used to train the machine learning model. During the training process, the machine learning model can also be optimized and adjusted based on user feedback data and actual performance operation logs. This usually includes the following steps:
[0045] (1) Collect user feedback data: Collect user feedback data on model prediction results through user surveys, online reviews, etc.
[0046] (2) Analyze actual performance operation logs: Collect performance data of the software in the actual operating environment and compare and analyze it with the prediction results of the model.
[0047] (3) Adjust model parameters: Based on the analysis results of user feedback data and actual performance operation logs, adjust the model parameters (such as learning rate, regularization coefficient, etc.) to improve the model's prediction accuracy and generalization ability.
[0048] (4) Iterative training: Retrain the adjusted model and repeat the above steps until the model achieves satisfactory performance.
[0049] Through this process, a fully trained and optimized machine learning model will be obtained, which can predict potential problems and performance of the software based on key features such as code complexity, code style and performance indicators.
[0050] Based on the aforementioned scheme, in some implementations of the present application, the use of a trained machine learning model to analyze the code modules written by the user includes: using an API interface to receive the code written by the user, and using the trained machine learning model to analyze the code modules written by the user to identify the code areas that need to be optimized.
[0051] In the above implementation, an API interface is provided to enable users to conveniently submit their written code for analysis. This API interface allows users to upload their code modules through HTTP requests (such as POST requests), and then use the previously trained machine learning model to conduct in-depth analysis on them. During the analysis process, the code submitted by the user will first be preprocessed, such as removing comments, standardizing the code format, etc., so as to better keep consistent with the data used in model training. Next, key features in the code are extracted, which are related to code complexity, code style, potential performance bottlenecks, etc. These features will be passed as input information to the machine learning model. Then, the trained machine learning model will analyze the code based on the extracted features, and then output a series of prediction results, such as code areas that need to be optimized, potential performance issues, and suggestions for improvement in code style.
[0052] Based on the aforementioned scheme, in some implementations of the present application, generating corresponding code segments from the target code library according to the code analysis results includes: generating corresponding code segments from the target code library according to the code analysis results, and evaluating the code segments using automated testing and performance evaluation tools.
[0053] It should be noted that when generating code segments based on code analysis results, you can first use code analysis tools (such as static code analysis tools, dependency analysis tools, etc.) to conduct in-depth analysis of the target code library. Then, based on the analysis results, identify the relevant code segments, modules or functions in the target code library. These code segments are the basis for generating new code segments. Then, according to specific requirements or goals (such as functional expansion, performance optimization, etc.), extract and combine these code segments from the target code library to form new code segments that meet specific requirements.
[0054] After the code segment is generated, use automated testing tools (such as unit testing frameworks, integrated testing frameworks, etc.) to test the code segment. These tests are designed to verify whether the basic functions, boundary conditions, exception handling, etc. of the code segment meet expectations. Through automated testing, potential problems in the code segment can be discovered and fixed in a timely manner, improving the reliability and stability of the code segment. In addition to functional testing, the performance of the code segment also needs to be evaluated. Use performance evaluation tools (such as performance analyzers, stress testing tools, etc.) to perform performance tests on the code segment, including evaluation of response time, throughput, resource usage, etc. Through performance evaluation, you can understand the performance bottlenecks and potential optimization points of the code segment, providing a basis for subsequent performance optimization.
[0055] Based on the above scheme, in some implementations of the present application, while generating the corresponding code segment from the target code library according to the code analysis results, it also includes generating code reconstruction results, algorithm improvement suggestion descriptions and resource optimization suggestions. In this implementation, while generating the corresponding code segment, additional content such as code reconstruction results, algorithm improvement suggestion descriptions and resource optimization suggestions are also provided. These additional contents help developers better understand the code, optimize algorithms and improve resource utilization, thereby further improving the quality and performance of the code.
[0056] Based on the aforementioned scheme, in some implementations of the present application, the method further includes: optimizing and adjusting the machine learning model according to user feedback on the code segment and performance evaluation results.
[0057] In the above implementation, the big data-based software code optimization method is not limited to generating code snippets and providing relevant improvement suggestions, but also includes an important feedback loop: based on user feedback on the code snippets and the results of performance evaluation, the machine learning model is optimized and adjusted to ensure that the model continues to improve and adapt to new situations, so that accurate and comprehensive code optimization suggestions can be given.
[0058] Among them, users may have direct feedback on the generated code snippets, refactoring suggestions, algorithm improvement suggestions, or resource optimization suggestions. These feedbacks may include positive comments (such as code quality improvement, performance improvement, etc.) or negative comments (such as code is not easy to understand, suggestions are impractical, etc.). Users may also provide specific modification suggestions or new requirements to guide subsequent optimization work. Correspondingly, after the code snippets are evaluated using automated testing and performance evaluation tools, a series of performance indicators and test results will be generated. These results can reveal the advantages and disadvantages of the code snippets in terms of functionality, performance, resource utilization, etc. By analyzing these results, it is possible to identify problems and deviations that may exist in the model when predicting and generating code snippets. Therefore, based on user feedback and performance evaluation results, the selection and weighting of model input features can be adjusted. Some features may be found to have little impact on code quality or performance, and their weights can be reduced or removed. On the contrary, other features may be found to have a significant impact on the prediction results, and their weights can be increased or new related features can be introduced. At the same time, the internal parameters of the model (such as learning rate, regularization coefficient, etc.) can be adjusted based on the feedback results. The adjustment of these parameters can affect the training speed and generalization ability of the model.
[0059] Example 2
[0060] See also Figure 2 , the embodiment of the present application provides a software code optimization system based on big data, which includes:
[0061] The data acquisition module 101 is used to acquire the target code library and the corresponding operation log data to obtain a first data set; the data preprocessing module 102 is used to clean, transform and aggregate the first data set from the programming language dimension, framework dimension and project specification dimension to obtain a second data set; the model training module 103 is used to train the machine learning model using the second data set so that the machine learning model can identify code quality, performance bottlenecks and potential defects; the code analysis module 104 is used to use the trained machine learning model to analyze the code module written by the user to obtain the code analysis result; the result display module 105 is used to generate the corresponding code segment from the target code library according to the code analysis result, and display the code segment using a visual interface.
[0062] For the specific implementation process of the above system, please refer to the software code optimization method based on big data provided in Example 1, which will not be repeated here.
[0063] Example 3
[0064] See also Figure 3 , the embodiment of the present application provides an electronic device, which includes at least one processor 201 and at least one memory 202; wherein the processor 201 and the memory 202 are directly connected to each other, or communicate with each other through a communication interface 203, or are electrically connected through one or more communication buses or signal lines to achieve data transmission or interaction; the memory 202 stores program instructions that can be executed by the processor 201, and the processor 201 calls the program instructions to execute a software code optimization method based on big data. For example, the following is implemented:
[0065] Acquire the target code library and the corresponding operation log data to obtain a first data set; clean, transform and aggregate the first data set from the programming language dimension, framework dimension and project specification dimension to obtain a second data set; use the second data set to train the machine learning model so that the machine learning model can identify code quality, performance bottlenecks and potential defects; use the trained machine learning model to analyze the code modules written by the user to obtain code analysis results; based on the code analysis results, generate corresponding code segments from the target code library, and display the code segments using a visual interface.
[0066] Among them, the memory 202 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0067] The processor 201 may be an integrated circuit chip with signal processing capability. The processor 201 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0068] Understandably, Figure 3 The structure shown is for illustration only. The electronic device may also include Figure 3 More or fewer components as shown, or with Figure 3 Different configurations are shown. Figure 3 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0069] Example 4
[0070] The present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by the processor 201, implements a software code optimization method based on big data.
[0071] For example, to implement:
[0072] Acquire the target code library and the corresponding operation log data to obtain a first data set; clean, transform and aggregate the first data set from the programming language dimension, framework dimension and project specification dimension to obtain a second data set; use the second data set to train the machine learning model so that the machine learning model can identify code quality, performance bottlenecks and potential defects; use the trained machine learning model to analyze the code modules written by the user to obtain code analysis results; based on the code analysis results, generate corresponding code segments from the target code library, and display the code segments using a visual interface.
[0073] If the above functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0074] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A software code optimization method based on big data, characterized in that: The following steps are involved: Acquire a target code library and corresponding operation log data to obtain a first data set; Cleaning, transforming and aggregating the first data set from the programming language dimension, the framework dimension and the project specification dimension to obtain the second data set; Using the second data set to train the machine learning model, the machine learning model is able to identify code quality, performance bottlenecks, and potential defects; Use the trained machine learning model to analyze the code modules written by the user to obtain code analysis results; According to the code analysis results, a corresponding code segment is generated from the target code library, and the code segment is displayed using a visual interface.
2. The method according to claim 1, characterized in that The step of acquiring the target code library and the corresponding operation log data to obtain a first data set includes: The first data set is obtained by collecting source code data of projects from the Internet open source platform and obtaining data including source code, compilation logs, test results and performance indicators in real time from the version control system, build server and production environment for internal company projects.
3. The method according to claim 1, characterized in that The method of training the machine learning model using the second data set includes: extracting key features including code complexity, code style, and performance metrics from the second dataset; Use key features to train machine learning models, and optimize and tune machine learning models based on user feedback data and actual performance run logs.
4. The method according to claim 1, characterized in that: The method of analyzing the code module written by the user using the trained machine learning model includes: The API interface is used to receive the code written by the user, and the trained machine learning model is used to analyze the code modules written by the user to identify the code areas that need to be optimized.
5. The method according to claim 1, characterized in that The step of generating corresponding code segments from the target code library according to the code analysis results includes: According to the code analysis results, corresponding code segments are generated from the target code library, and the code segments are evaluated using automated testing and performance evaluation tools.
6. The method according to claim 5, characterized in that While generating corresponding code segments from the target code library based on the code analysis results, it also includes generating code refactoring results, algorithm improvement suggestion descriptions and resource optimization suggestions.
7. The method according to claim 1, characterized in that The method further comprises: Based on user feedback and performance evaluation results of the code snippets, the machine learning model is optimized and adjusted.
8. A software code optimization system based on big data, characterized in that: include: A data acquisition module, used to acquire a target code library and corresponding operation log data to obtain a first data set; A data preprocessing module, used for cleaning, converting and aggregating the first data set from the programming language dimension, the framework dimension and the project specification dimension to obtain a second data set; A model training module, used for training a machine learning model using a second data set, so that the machine learning model can identify code quality, performance bottlenecks, and potential defects; The code analysis module is used to analyze the code modules written by users using the trained machine learning model to obtain code analysis results; The result display module is used to generate corresponding code segments from the target code library according to the code analysis results, and display the code segments using a visual interface.
9. An electronic device, characterized in that: include: A memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Programming assistance method based on generative AI, computer equipment and storage medium
CN120010825A
Programming Assistance Method, Computer Device, and Storage Medium Based on Generative AI
CN120010825B
Data preparation method and device for use scheme recommendation of low-code GIS (Geographic Information System)
CN120407001A