Code analysis method, system and equipment based on multi-programming language sandbox and medium

By identifying and executing programming languages ​​in a sub-sandbox, pre-installing dependency libraries, and integrating compiler feedback, it solves the problem of differences in dependency management and analysis tools in different language environments, achieves the security and accuracy of code analysis, supports custom prompt templates, and adapts to the needs of multi-language projects.

CN120893033APending Publication Date: 2025-11-04INSPUR ZHUOSHU BIG DATA IND DEV CO LTD

Patent Information

Application Number
CN202510883606.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-29
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

In existing technologies, the dependency management tools for different programming languages ​​vary greatly, which makes it easy for configuration dependencies to be missing or have version errors. The compiler feedback is difficult to understand the context, resulting in inaccurate generated results. Users cannot customize the input format, and it is difficult to optimize the prompt words for vulnerability repair.

Method used

By identifying the programming language of the code, it compiles and executes in an isolated sub-sandbox, pre-installs dependency libraries for common programming languages, integrates compiler feedback and analysis results, utilizes a large language model for code analysis, and supports custom prompt templates.

Benefits of technology

It ensures the security and stability of code analysis, improves the accuracy of code generation and repair, supports the customization of dependency management and analysis tools in multi-language environments, and adapts to different project needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120893033A_ABST
    Figure CN120893033A_ABST
Patent Text Reader

Abstract

The invention provides a code analysis method, system and equipment based on a multi-programming language sandbox and a medium, and belongs to the technical field of code analysis and detection.The method specifically comprises the steps that an input code and a corresponding unit test sample are obtained, and a programming language type specified by the code is determined; sending the code and the unit test sample to a sub sandbox environment of a corresponding language for execution; a compiler in the sub sandbox reports a missing library according to a code compiling result and prompts a user to install the missing library; calling an analysis tool of a code analysis module to analyze the code; compiler feedback of the sub sandboxes and various analysis results generated by the code analysis module are integrated into a large language model; inputting the integration result into a large language model through a preset template; and analyzing and evaluating the code case based on the user instruction. Through multi-language sandbox isolation, automatic analysis tool integration and large language model enhancement, the security, efficiency and quality of a code processing flow are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of code analysis and detection, and particularly relates to a code analysis method, system, device and medium based on a multi-programming language sandbox. BACKGROUND

[0002] The software development industry has increasingly high requirements for code quality, security and development efficiency. To meet the challenges, the development environment needs to isolate code execution, restrict resource usage and prevent malicious code from being destroyed. For example, financial software development involves sensitive information, and once the information is leaked or tampered with, the consequences are unpredictable. High-quality code is the key to software success, and analysis tools need to comprehensively and deeply detect code problems. Supporting multiple programming languages is a mainstream trend, and development tools need to be compatible with multiple languages to adapt to different project requirements.

[0003] In related technologies, the dependency management tools of different programming languages differ greatly, and the configuration of dependencies is prone to missing or version errors. For example, a C++ project needs to compile third-party libraries, and if a certain header file or link library is missing, the compiler will only prompt that the symbol cannot be found, and the developer needs to locate the missing dependency problem, increasing the difficulty of processing.

[0004] In related technologies, when the original compiler error or scattered analysis results are directly input into a large language model, the model has difficulty understanding the context, resulting in inaccurate code repair or generation results. For example, the compiler feeds back a syntax error on line 10, and if the code structure or AST node information is not combined, the model may generate an incorrect repair solution. Users cannot customize the input format, making it difficult to optimize the prompt words for vulnerability repair. SUMMARY

[0005] The application provides a code analysis method based on a multi-programming language sandbox. The method identifies the programming language of the code and compiles and executes in an isolated sub-sandbox, ensuring safety and stability.

[0006] The method comprises the following steps: Step S101: Obtain the input code and corresponding unit test samples, and determine the programming language type specified by the code; Step S102: According to the programming language type, send the code and unit test samples to the sub-sandbox environment of the corresponding language for execution; Step S103: The sub-sandbox environment preinstalls the dependency library of the commonly used programming language, and the compiler in the sub-sandbox reports the missing library according to the code compilation result and prompts the user to install; Step S104: Call the analysis tool of the code analysis module to analyze the code; Step S105: The information integration module integrates the compiler feedback of the sub-sandbox and various analysis results generated by the code analysis module into a large language model; and inputs the integrated results into the large language model through a preset template. Step S106: Deploy the user or large language model in an independent system or a distributed system, and based on user instructions, call MPLSandbox through an IP address and a port number to analyze and evaluate the code case.

[0007] Further, step S101 specifically includes: Receiving a user-input code file and an associated unit test sample file, and parsing the basic meta-information of the file through a standardized input interface; Verifying the validity of the correspondence between the unit test sample and the code, extracting the programming language features of the code file, and performing preset rule matching with the test framework identifier of the unit test sample to confirm that the test sample is suitable for the language type of the current code; Identifying the programming language type of the code file, quickly judging based on the file extension, and if the extension is missing or there are mixed language features, scanning the code content, extracting language-specific keywords, and combining the predefined language feature library to complete the final identification.

[0008] Further, step S102 specifically includes: Defining a sub-sandbox instance pool, each instance being marked with supported language types and idle / running / resource occupancy; when the code needs to be executed, filter instances of the same language and in an idle state with a resource occupancy rate below a safety threshold from the instance pool based on the programming language type of the code; If there is no instance that meets the conditions, the system calls the sub-sandbox creation interface, generates a new sub-sandbox instance based on the predefined base operating system, compiler, and dependent library, and adds it to the instance pool for scheduling; The code and test sample are converted to binary format by a serialization tool before transmission, and a unique hash value is generated as a check code.

[0009] Further, step S103 specifically includes: The dependent libraries of the sub-sandbox environment are pre-installed and stored by language type, and a standardized library index directory is established; The user specifies additional library information referenced in the code by writing a configuration file, and the sub-sandbox parses the configuration file to verify whether the library name contains illegal characters and whether the version number meets the semantic versioning specification, and checks the accessibility of the download source; The sub-sandbox triggers a dependency check process before executing the code, loads the pre-installed library index directory, and matches the dependencies required by the code; if there is a library in the pre-installed library that meets the version requirements, it is directly marked as satisfied; if the pre-installed library is missing or the version does not match, the user's configuration file declares additional libraries, verifies their download source effectiveness, and calls the package management tool to download and install them to the specified directory of the sub-sandbox.

[0010] Further need to explain, step S104 specifically includes: According to the programming language type of the code and the user task demand, the analysis tool of the corresponding category is matched from the pre-defined tool library; For the matched analysis tool, the execution parameters of the tool are adjusted according to the operating system version, compiler version and dependent library version of the sub-sandbox; The executability of the tool in the current environment is verified through the compatibility detection interface of the sub-sandbox; The adjusted analysis tool is submitted to the execution queue of the sub-sandbox in priority order; During execution, the resource monitoring thread collects the resource occupation data of the tool in real time, and if the resource occupation of a tool exceeds the preset threshold, the execution of the tool is suspended and the resource is released, and the execution is resumed after the resource is released; Collect the output results of each analysis tool, merge the repeated results, and generate a comprehensive report containing multi-dimensional analysis data.

[0011] Further need to explain, step S104 specifically includes: When the sub-sandbox environment cannot meet the running requirements of the analysis tool, create an adaptive virtual running environment, mount the corresponding version of the operating system image, compiler and dependent library, and simulate an environment that meets the tool running conditions; Use binary translation technology to convert the instruction set of the tool into a format executable in the current environment; Provide a visual adaptation rule editing interface that allows users to modify the basic template through drag-and-drop and configuration parameters.

[0012] Further need to explain, step S105 specifically includes: Data preprocessing is performed on the compiler feedback and code analysis results of the sub-sandbox; According to the code related task type, a basic template is matched from a preset template library; The preset template library is classified according to task type, and each template contains task target description and data placeholder; Support users to modify the basic template through a visual interface or a text configuration file; The user adds personalized prompt words, adjusts the order of the placeholders, and sets the data filtering conditions; The bound data is input into the large language model through a large language model input interface; After input is completed, the mapping relationship between the data and the template is recorded.

[0013] The application also provides a code analysis system based on a multi-programming language sandbox, which comprises: An acquisition determination module is configured to acquire an input code and a corresponding unit test sample, and determine a programming language type specified by the code; A test distribution module is configured to send code and unit test samples to a corresponding language sub-sandbox environment for execution according to a programming language type. A configuration compiling module is configured to preinstall a dependency library of a commonly used programming language in the sub-sandbox environment, and a compiler in the sub-sandbox reports a missing library according to a code compilation result and prompts a user to install. A code analysis module is configured to analyze code by calling an analysis tool of the code analysis module. An information integration module is configured to integrate compiler feedback of the sub-sandbox and various analysis results generated by the code analysis module into a large language model, and input the integrated results into the large language model through a preset template. An evaluation calling module is configured to deploy a user or the large language model in an independent system or a distributed system, call MPLSandbox to analyze and evaluate a code case based on a user instruction through an IP address and a port number.

[0014] According to another embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the code analysis method based on the multi-programming language sandbox when executing the program.

[0015] According to another embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the code analysis method based on the multi-programming language sandbox when executing the program.

[0016] From the above technical solutions, the present application has the following advantages: The code analysis method based on the multi-programming language sandbox provided by the present application preinstalls dependency libraries of commonly used languages such as Python and Java, and uses a sub-sandbox container isolation environment to ensure that different language codes can be independently executed and environmental conflicts are avoided. The sub-sandbox configures resource constraints such as memory and execution time, the driving node monitors the state in real time and automatically restarts the crashed sandbox, prevents system crashes caused by code abnormalities, and guarantees service stability. The information integration module inputs compiler feedback and analysis results into the large language model according to a preset template, supports custom prompt templates, and enables the model to optimize code generation, repair, and other tasks based on structured data.

[0017] The independent system deployment of the present application is suitable for small-scale scenarios, and the distributed deployment manages multiple sandbox nodes through the driving node, realizes load balancing and resource isolation, supports integration of compiler feedback as a supervision signal in large-scale training tasks, and improves system scalability and performance. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the present application, the drawings required to be used in the description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative effort on the basis of these drawings.

[0019] Figure 1 Flowchart of the code analysis method based on the multi-programming language sandbox; Figure 2 Flowchart of an embodiment of the code analysis method based on the multi-programming language sandbox; Figure 3 Schematic diagram of the code analysis system based on the multi-programming language sandbox; Figure 4 Schematic diagram of an electronic device. DETAILED DESCRIPTION

[0020] The code analysis method based on the multi-programming language sandbox provided by the present application provides unified and comprehensive compiler feedback for LLMs (Large Language Models), and integrates traditional and large language model-based code analysis tools to achieve comprehensive analysis of generated code. By automatically identifying the programming language of the code and compiling and executing it in an isolated sub-sandbox, safety and stability are ensured.

[0021] The code analysis method based on the multi-programming language sandbox related to the present application will be described in detail below. In order to illustrate but not to limit, specific details such as specific system structures, techniques, etc. are proposed to thoroughly understand the embodiments of the present application. However, those skilled in the art should understand that the present application can also be implemented in other embodiments without these specific details.

[0022] It should be understood that when used in the specification of the present application, the term "comprising" indicates the presence of the described features, whole, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, whole, steps, operations, elements, components and / or sets thereof. The terms "comprise", "include", "have" and their variants mean "including but not limited to", unless otherwise specifically emphasized.

[0023] The phrases "one embodiment" or "some embodiments" or similar phrases as used herein do not necessarily refer to the same embodiment, although they can. The context will make this identification apparent. The various examples and embodiments described can employ various techniques to achieve the desired results. The various examples and embodiments can employ the techniques in different combinations.

[0024] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0025] Please refer to Figure 1 The flowchart of the code analysis method based on the multi-programming language sandbox in some embodiments is shown in FIG. 1. The method comprises the following steps: Step S101: Obtain the input code and the corresponding unit test sample, and determine the programming language type specified by the code.

[0026] In some embodiments, the input code and the corresponding unit test sample are obtained, and the programming language type specified by the code is determined. Specifically, the code file and the unit test sample file input by the user are received. These files can be submitted in various ways, such as graphical interface upload, command line input, or API interface call.

[0027] The system needs to perform preliminary inspection on the input files to ensure that the file format is correct, the content is complete, and it meets the input requirements of the system. Determining the programming language type can be achieved by analyzing the file extension, file header mark, or by syntax analysis to identify the language characteristics of the code.

[0028] For example, Python files usually end with.py, Java files end with.java, and so on. In addition, the system may also support the processing of multi-file and multi-language projects, and needs to be able to parse the project structure and identify different language components therein.

[0029] Step S102: According to the programming language type, send the code and the unit test sample to the sub-sandbox environment of the corresponding language for execution.

[0030] In some embodiments, the code and unit test samples are sent to a sub-sandbox environment corresponding to the programming language type for execution. The sub-sandbox environment is a container isolated from the main sandbox, and each sub-sandbox is configured for a specific programming language, including the corresponding runtime environment, compiler, and interpreter, etc.

[0031] The resource constraint settings of the present embodiment can prevent a certain sub-sandbox from excessively consuming system resources by limiting the maximum memory, execution time, and process number, thereby ensuring the stability and multitasking processing capability of the entire system. The monitoring function of the driver node ensures the stability of the sub-sandbox, and once a sub-sandbox crashes, it can be quickly restarted to reduce the service interruption time. In this way, the real-time monitoring and automatic restart mechanism improves the reliability and availability of the system, ensuring the continuity of the code analysis service.

[0032] Step S103: The sub-sandbox environment preinstalls the dependent libraries of commonly used programming languages, and the compiler in the sub-sandbox reports the missing libraries according to the code compilation result and prompts the user to install.

[0033] In some embodiments, the sub-sandbox environment preinstalls the dependent libraries of the programming languages, and the dependent libraries are the basic components necessary for code execution and testing of the corresponding language. Users can specify additional libraries to be installed by writing configuration files, and the system will automatically install the required dependencies according to these configuration files, greatly improving the flexibility of the system and the autonomy of the user.

[0034] The compiler in the sub-sandbox can detect libraries referenced but not installed in the code during compilation and report to the user to guide the user to install.

[0035] The preinstalled dependent libraries of the present embodiment ensure that the basic development environment is ready, and the use of configuration files allows users to customize their own development needs. The compiler checks the import statements or library references in the code during compilation, compares them with the installed libraries, and generates a corresponding report when missing libraries are found, ensuring that the code executed by different users or at different times runs in the same dependent environment.

[0036] Step S104: The analysis tools of the code analysis module are called to analyze the code.

[0037] In some embodiments, for step S104, the traditional analysis tools of the code analysis module are called to analyze the code. The analysis tools are divided into five categories according to their functions, and each category conducts in-depth analysis on different aspects of the code.

[0038] Among them, the basic information analysis tool helps to understand the structure and logical flow of the code; The code smell analysis tool focuses on the quality and maintainability of the code; Code vulnerability analysis tools look for potential security risks; Unit test analysis tools evaluate the effectiveness and coverage of tests; Code efficiency evaluation tools focus on performance issues.

[0039] Step S104 supports user-defined analysis tools, further expanding the system's functionality, allowing users to add personalized analysis dimensions based on specific needs. This improves the quality and security of the code. Through multi-dimensional analysis, users can gain in-depth insights into the code and promptly identify and fix problems.

[0040] Step S105: The information integration module integrates the compiler feedback from the sub-sandboxes and the various analysis results generated by the code analysis module into the large language model. The integrated results are input into the large language model through a pre-set template. The template contains [specific fields] for structured input data, enhancing the implementability of the technical solution.

[0041] For step S105, the information integration module is used to integrate the compiler feedback from the sub-sandboxes and the results from the code analysis module into the large language model. Step S105 includes data collection, conversion, and fusion. The collected compilation errors, missing dependencies, and other information, as well as the structured information and code problems generated by the analysis tools, need to be converted into a format that the large language model can understand and process. The pre-set prompt learning template guides how to effectively input this information into the model, while the user-defined prompt template allows users to adjust the presentation of information according to specific tasks.

[0042] It should be noted that the compiler feedback and analysis results are first structured and converted into formats such as JSON, XML, etc., and then input into the large language model through prompt learning. By integrating compilation and analysis information, the model can obtain contextual information, thereby generating more accurate and useful code suggestions, repair solutions, and optimizations.

[0043] Step S106: Deploy the user or large language model as an independent system or a distributed system, and based on user instructions, call MPLSandbox through IP address and port number to analyze and evaluate code cases.

[0044] MPLSandbox of the present embodiment supports two deployment modes to adapt to different usage scenarios and scale requirements. Independent system deployment is suitable for small teams or individual users, and can use the sandbox environment for code analysis through simple network configuration.

[0045] Among them, the distributed system deployment is aimed at large-scale machine learning training and deployment scenarios, through the deployment of multiple sandbox node servers and the centralized management of the driving node, the efficient use of resources and the distributed processing of tasks are realized. Among them, the sub-sandbox refers to the language isolation environment, and the sandbox node refers to the physical node in the distributed deployment.

[0046] In distributed training, integrating compiler feedback as external supervision signals into the training process can improve the learning effect of the model and the quality of the generated code.

[0047] As can be seen, in the independent deployment mode, the system provides services through local or small network environments, which is easy to configure and use. In the distributed deployment mode, the master-slave architecture is adopted, the driving node is responsible for task allocation and resource coordination, and the sandbox node is responsible for specific code execution and analysis tasks. The system allows resource allocation to be adjusted according to task load, improving overall processing capacity and efficiency.

[0048] In machine learning training, the integration of external supervision signals is achieved by adjusting the loss function or reward mechanism of the model, thereby guiding the model to learn more useful features and patterns.

[0049] This embodiment meets the needs of different users. The independent deployment mode reduces the use threshold, enabling small teams and individual users to quickly utilize the sandbox environment. The distributed deployment mode is suitable for large-scale development and training scenarios, and through reasonable allocation of resources and parallel processing of tasks, the scalability and processing capacity of the system are improved.

[0050] In an embodiment of the present application, based on step S101, a possible embodiment will be given below to illustrate the specific implementation of the embodiment. As shown in Figure 2 S101, step S101 specifically includes: Step S1011: receiving the code file and the associated unit test sample file input by the user, parsing the basic meta information of the file through the standardized input interface, the meta information including the file name, file extension, creation timestamp and user identification field, used for subsequent association and tracing.

[0051] Step S1012: verifying the validity of the correspondence between the unit test sample and the code, extracting the programming language features of the code file such as the file extension, the shebang instruction or explicit language declaration comment in the first line of the code, and performing preset rule matching with the test framework identifier of the unit test sample to confirm that the test sample is applicable to the language type of the current code.

[0052] Step S1013: Programming language type identification is performed on the code file, quick pre-judgment is performed based on the file extension, if the extension is missing or there is a mixed language feature, then the code content is scanned, language-specific keywords are extracted, and the final identification is completed in combination with the predefined language feature library.

[0053] Step S1014: Legality verification is performed on the identified programming language type, whether it belongs to the predefined supported language list of the sandbox environment is checked; if it is an unsupported language, an extension prompt mechanism is triggered, the unsupported language information is fed back to the user, and the creation of a custom sub-sandbox is guided to extend the sandbox capability.

[0054] In this embodiment, the code and unit test file are received through the interface and the basic information is parsed, the language type is quickly pre-judged by using the file extension, etc. Then the matching of the unit test sample and the code language is verified to ensure the effectiveness of the test. The language features are extracted by scanning the code content in depth, and the programming language is accurately identified in combination with the feature library. Finally, it is checked whether the language is in the sandbox support list, if not supported, it is fed back to the user and guided to extend the sandbox capability. The whole process is closely linked, based on file parsing, feature matching and language recognition technology, to ensure the accuracy of code analysis and the applicability of the sandbox environment.

[0055] In an embodiment of the present application, based on step S102, a possible embodiment will be given below to non-limitingly describe the specific implementation scheme. Step S102 specifically includes: By matching the sub-sandbox, securely transmitting data, initializing the execution environment and monitoring the exception, it is ensured that the code can be reliably executed in the isolated sub-sandbox, and the system stability is ensured by the resource constraint and automatic restart mechanism.

[0056] The system of this embodiment defines a sub-sandbox instance pool, each instance is marked with the supported language type and the idle / running / resource occupancy rate. When the code needs to be executed, the instances with the same language and the state of idle and the resource occupancy rate below the safety threshold are screened from the instance pool according to the programming language type of the code.

[0057] If there is no instance meeting the condition, the system calls the sub-sandbox creation interface, generates a new sub-sandbox instance based on the predefined basic operating system, compiler and dependent library, and adds it to the instance pool for scheduling.

[0058] The code and test sample of this embodiment are converted into binary format by a serialization tool before transmission, and a unique hash value is generated as a check code.

[0059] An encrypted channel is used in the transmission process, the receiving end recalculates the hash value after receiving, compares it with the check code of the sending end, and if they are inconsistent, discards the data packet and requests retransmission, to ensure that the data is not tampered with or damaged in the transmission process.

[0060] After receiving the data, the sub-sandbox of the embodiment parses the path of the code file and the test sample, and then calls a predefined environment configuration script according to the programming language type of the code.

[0061] The script sets resource constraint parameters, for example, limits the upper limit of memory usage through the cgroups mechanism of Linux (such as max_memory = basic memory requirement x 1.2), limits the maximum number of processes through the ulimit command (such as max_pids = system core number x 2), and sets the maximum execution time through the timeout command (such as max_time = historical average time length x 1.5).

[0062] The script of the embodiment checks whether the dependent library required by the code has been installed in the sub-sandbox, and automatically installs it if it is missing, to ensure that the execution environment is ready.

[0063] It should be noted that after the sub-sandbox starts the code execution process, the monitoring thread collects indicators such as memory usage, CPU occupancy, and active process ID number in real time through system calls, and updates the data every second.

[0064] The monitoring thread compares the current indicators with the preset threshold. If the memory usage exceeds the threshold and does not decrease for 30 seconds, the monitoring thread marks the sub-sandbox as a resource overload state and issues a warning.

[0065] If the memory is still not released after the warning, and the main process of the sub-sandbox does not respond, the driving node calls the management interface of the sub-sandbox to terminate the main process and release the resources, and then restarts the sub-sandbox instance to restore its initial state for next use.

[0066] As can be seen, the instances in the instance pool of the sub-sandbox are stored according to language type, and when matching, the instance with the same language, which is idle and has the lowest resource occupancy, is preferentially selected; if there is no instance that meets the conditions, the rule of creating a new instance is triggered.

[0067] The resource constraint calculation rule of the embodiment is: maximum memory limit = code estimated memory requirement x 1.2 (the estimated memory requirement is obtained by statistical data of memory usage of the same type of code in history); Maximum execution time = historical average execution time of the same type of task x 1.5 (the average time is obtained by statistical data of historical task execution time); Maximum process ID number = system core number x 2 (the core number is obtained through a system command such as nproc).

[0068] When any of the following occurs in the child sandbox, a restart is triggered: memory usage exceeds the warning threshold and is not alleviated for 30 seconds, the number of processes exceeds the warning threshold and is not alleviated for 20 seconds, execution time exceeds the warning threshold and the main process is unresponsive, and 3 consecutive heartbeat detection failures.

[0069] The embodiment filters idle child sandboxes with matching language types and resource occupancy below a threshold from the instance pool according to the programming language type of the code, and creates a new instance if no available instance is available. The code and test samples are serialized and hashed to ensure data integrity before transmission, and an encrypted channel is used in the transmission process to prevent tampering. After the child sandbox receives the data, it sets resource constraint parameters such as memory, execution time, and process number based on historical statistical data and system resource conditions through an environment configuration script, and automatically installs missing dependent libraries. During execution, the monitoring thread collects resource indicators in real time, and when the memory and process number exceed the threshold or the heartbeat detection fails, the driver node triggers the child sandbox to restart, releases resources, and restores the initial state. The entire process is implemented through instance pool scheduling, data verification, resource constraints, and exception monitoring to ensure reliable execution of the code in an isolated environment and system stability.

[0070] In an embodiment of the present application, based on step S103, a possible embodiment will be given below to illustrate the specific implementation thereof. Step S103 specifically includes: Step S1031: The dependent libraries of the child sandbox environment pre-installed for commonly used programming languages are stored in classified language types, and a standardized library index directory is established; the classification includes language standard libraries such as the Spring framework of Java and the Gin framework of Go, and the index directory records the library name, version number, installation path, and dependency relationship.

[0071] Step S1032: The user specifies the additional library information referenced in the code by writing a configuration file, and the configuration content includes the library name, version number, and download source; the child sandbox parses the configuration file, verifies whether the library name contains illegal characters and whether the version number conforms to the semantic version specification, and checks the accessibility of the download source.

[0072] Step S1033: The child sandbox triggers a dependency check process before executing the code, first loads the pre-installed library index directory, and matches the required dependencies of the code; if there is a library in the pre-installed library that meets the version requirements, it is directly marked as satisfied; if the pre-installed library is missing or the version does not match, the additional library declared in the user configuration file is checked for validity, and a package management tool is called to download and install it to the specified directory of the child sandbox.

[0073] Step S1034: When the compiler in the sub-sandbox compiles the code, it detects the loading state of the dependent library in real time; if it is found that there is a missing in the pre-installed library or the user-installed library, a compilation feedback log containing the missing library name, required version and download source information is generated; the feedback log is output through the interactive interface of the sub-sandbox, prompting the user that the library is missing, please check the configuration file or installation source.

[0074] As can be seen, when the sub-sandbox is initialized, the standard library of the corresponding language and Django of Python are downloaded from the official repository according to the supported programming language type, and are stored in the / usr / local / lib directory of the sub-sandbox in the language type / library name / version number directory, and an index file is generated to record the dependency relationship of each library.

[0075] When the user writes the configuration file, only the additional library used in the code needs to be declared, without specifying the download source. The sub-sandbox reads the file content through the configuration parser, checks whether the library name meets the naming specification, and then tests the connectivity of the download source. If it is timed out, it is marked that the download source is unavailable and prompts the user to change it.

[0076] After the code is submitted to the sub-sandbox in this embodiment, the execution engine first calls the dependency checking script to compare the pre-installed library index and the user configuration file to generate a dependency gap list. For the case of missing pre-installed library, if the user has not declared in the configuration file, a compilation error is directly triggered; if the user has declared, the corresponding package management tool is called to download and install from the verified download source to the lib directory of the sub-sandbox, and the index file is updated after the installation is completed.

[0077] When the compiler of this embodiment loads the dependent library, if it is found that the library file does not exist or the version does not match, an exception is thrown and a feedback log containing the error code, missing library name and required version is generated. The sub-sandbox visualizes the log through the front-end interface.

[0078] In an embodiment of the present application, based on step S104, a possible embodiment will be given below to non-restrictively describe the specific implementation scheme. Step S104 specifically includes: Step S1041: According to the programming language type of the code and the user task requirement, the analysis tool of the corresponding category is matched from the pre-defined tool library.

[0079] The pre-defined tool library is divided into five categories according to the function: The basic information analysis tool includes the AST generation tool, the control flow diagram drawing tool, the code smell analysis tool, the code vulnerability analysis tool, the unit test analysis tool and the code efficiency evaluation tool suitable for the language.

[0080] Step S1042: For the matched analysis tool, adjust the execution parameters of the tool according to the operating system version, compiler version, and dependent library version of the sub-sandbox; verify the executability of the tool in the current environment through the compatibility detection interface of the sub-sandbox; if incompatibility is detected, trigger the tool adaptation mechanism: preferentially call the compatible version of the tool pre-installed in the sub-sandbox, and if there is no compatible version, prompt the user to install the specified dependency or downgrade the tool version.

[0081] Step S1043: Submit the adjusted analysis tool to the execution queue of the sub-sandbox in priority order; during execution, real-time resource occupation data of the tool is collected by the resource monitoring thread, and if the resource occupation of a tool exceeds the preset threshold, the execution of the tool is suspended and the resources are released, and after the resources are released, the execution is resumed; the user can customize the tool execution order and resource threshold by writing a tool template.

[0082] The priority order can be basic information analysis, code smell analysis, vulnerability analysis, unit test analysis, and efficiency evaluation analysis.

[0083] Step S1044: Collect the output results of each analysis tool, including tool name, analysis type, AST node list, vulnerability level, and coverage percentage; merge the conflicting or repeated results to generate a comprehensive report containing multi-dimensional analysis data; and store the comprehensive report to a temporary database.

[0084] Step S104 realizes systematic analysis of the code. According to the programming language type of the code and user demand, analysis tools of corresponding functional categories are matched from the predefined tool library. After matching, the execution parameters of the tools are adjusted according to the actual environment of the sub-sandbox, and compatibility detection is performed to ensure that the tools can normally run. If there is a compatibility problem, automatic adaptation or user intervention is prompted. The analysis tools enter the execution queue in the preset priority, and the resource occupation is monitored in real time during the execution process. When the resource is over limit, the tool is suspended to avoid system overload and ensure the stability of the analysis process. Finally, the system collects the output results of all tools, merges the conflicting data to generate a comprehensive report containing multi-dimensional information such as code structure, vulnerability level, and test coverage, and stores it to a temporary database for subsequent processing.

[0085] Through the cooperative work of the five types of tools, the full-dimensional requirements of code from structural analysis to vulnerability detection can be covered, the analysis blind area of single tool is avoided, and the accuracy of problem identification is improved. The user can customize the tool template and execution order to meet the individual analysis requirements.

[0086] Step S1042 of the embodiment specifically includes: Step S10421: When the sub-sandbox environment cannot meet the running requirements of the analysis tool, an adapted virtual running environment is automatically created, and by mounting the corresponding version of the operating system image, compiler and dependent library, an environment that meets the tool running conditions is simulated.

[0087] Step S10422: For the analysis tool that is incompatible due to the version difference of the dependent library, the binary translation technology is used to convert the instruction set of the tool into a format executable in the current environment, or the calling interface of the tool is converted through an intermediate adaptation layer.

[0088] Step S10423: A historical compatibility record library is constructed to record the matching relationship between the environment configuration and the tool version in each tool adaptation process. In subsequent use, the historical record is preferentially referred to for the same type of tool or the same version of tool to quickly configure the running environment.

[0089] Step S10424: A visual adaptation rule editing interface is provided to allow users to flexibly define the adaptation logic and priority order between the analysis tool and the sub-sandbox environment through drag-and-drop, configuration parameters and other methods.

[0090] As S1042, before the analysis tool is executed, the system first performs environment compatibility detection. If it is found that the current sub-sandbox environment cannot meet the tool running requirements, the environment simulation mechanism will retrieve the corresponding operating system image from the image warehouse according to the environment parameters required by the tool, create a virtual running environment through container technology, and deploy the tool therein. The cross-version compatibility adaptation function detects the differences in instructions or interfaces between the tool and the environment, converts the tool instructions into a format suitable for the current environment using binary translation technology, or adds an intermediate adaptation layer between the tool and the environment to realize the conversion of the calling interface. The historical compatibility record library stores the environment configuration and tool version combination of past successful adaptation, and when the same type of tool is detected in the future, the historical configuration is preferentially reused to improve the adaptation efficiency. The adaptation strategy is customized through a visual interface to define the adaptation priority and processing rules of different types of tools.

[0091] In this embodiment, according to the environment parameter set E={e1, e2,..., en} required by the tool, the matching image set M is retrieved from the image warehouse, and the image with the highest matching degree is selected to create a virtual environment. The matching degree calculation uses a weighted matching formula: Match=∑(wi×δi), where wi is the weight of each parameter, and δi is the parameter matching degree, with a complete match being 1, a partial match being 0.5, and a mismatch being 0.

[0092] For the historical compatibility matching model, an inverted index technology can be used to build a history record library, taking the tool name and version number as the index key, and storing the corresponding environment configuration information. When querying, the name and version number of the new tool are located according to the history record, and if there are multiple matching records, the configuration with the most usage frequency is selected as the recommended configuration.

[0093] The adaptation strategy implementation of the embodiment can parse the user-defined adaptation rules by using Drools rules, convert the visual configuration into an executable rule expression, and in the tool execution parameter adjustment process, generate the final execution parameters and adaptation scheme according to the rule priority and condition judgment.

[0094] In an embodiment of the present application, based on step S105, a possible embodiment will be given below to illustrate the specific implementation thereof. Step S105 specifically includes: Step S1051: data preprocessing is performed on the compiler feedback and code analysis results of the sub-sandbox; the preprocessing includes: extracting error types, line numbers, column numbers, error levels in the compiler feedback; extracting AST node types, control flow paths, code problems, vulnerability details, test coverage data, execution times, memory peaks in the analysis results; and storing the above information as an intermediate data set.

[0095] Step S1052: according to the code related task type, a basic template is matched from a preset template library; the preset template library is classified according to the task type, each template includes a task target description and a data placeholder; the template supports parameter filling, allowing specific content in the intermediate data set to be injected into the template through variable substitution.

[0096] Step S1053: the system provides a user-defined template editing function, supporting the user to modify the basic template through a visual interface or a text configuration file; the user can add personalized prompt words, adjust the order of placeholders, and set data filtering conditions; the customized template is stored in a user template library for subsequent task reuse.

[0097] Step S1054: the structured intermediate data set is bound to the target template, and the bound data is input into the large language model through a large language model input interface; before input, the data is checked for compliance to ensure that it meets the input requirements of the large language model; after input is completed, the mapping relationship between the data and the template is recorded for subsequent task result tracing.

[0098] The present embodiment converts the compiler feedback and code analysis results into an input format understandable by the large language model through data preprocessing, template matching, user-defined extension and compliance verification. The system extracts information such as error type, AST node and vulnerability details from the compiler feedback and analysis results, and constructs a structured intermediate data set to provide a standardized data basis for subsequent processing. Then, according to the code repair and optimization suggestions, the corresponding basic templates are selected from the preset template library. The template contains task description and data placeholder, and supports parameter filling.

[0099] The system allows users to customize templates through a visual interface or configuration file, add personalized prompt words or adjust data display methods, and the customized templates are stored in the user template library for reuse. Finally, the system binds the intermediate data set with the target template, inputs the large language model after compliance verification, and records the mapping relationship for result tracing, forming a complete analysis, prompt and feedback link.

[0100] By uniformly storing analysis results in the intermediate data set, the system not only realizes standardized processing of multi-source data, but also supports flexible prompt word design through the template mechanism to adapt to different task requirements. The preset template converts professional code analysis results into natural language prompts, improving the understanding accuracy of the large language model for code problems.

[0101] In an embodiment of the present application, based on step S106, a possible embodiment will be given below to illustrate the specific implementation scheme. Step S106 specifically includes: In the independent system deployment mode, the system configures the basic environment parameters of the main sandbox during initialization, including IP address, port number and default resource limit threshold; the user submits the code and unit test samples through the client tool, and the client establishes a connection with the main sandbox through the communication protocol, sends the task request and synchronously receives the compilation analysis results; the main sandbox independently completes the code execution, analysis and result return.

[0102] In the distributed system deployment mode, the system automatically creates a driver node and multiple sandbox nodes when started; the driver node serves as the management center, maintains the global node registration table, and records the state, resource usage data and supported language types of each sandbox node; After the sandbox node is started, it registers with the driver node and reports its configuration information, and the driver node assigns a unique identifier to the sandbox node based on the registration information.

[0103] After receiving the task request, the driver node matches the sandbox node based on the node registration table: it filters the nodes that support the target programming language; then it selects the nodes with resource occupancy rate lower than the safety threshold; finally it performs load balancing according to the task queue length; after successful matching, the driver node packages the code, test samples and resource constraint parameters and sends them to the target sandbox node for execution.

[0104] In the distributed training scenario, the compiler feedback and code analysis results of the driver node integrated sub-sandbox are used as external supervision signals; the supervision signals are associated with the quality indicators of the model generated code through the PPO algorithm to adjust the generation strategy of the large language model; and the Best-of-N strategy is supported, that is, N sandbox nodes are called to generate N groups of candidate codes in parallel, and the most optimal group is selected as the final output through the preset evaluation coverage and the number of vulnerabilities to improve the training efficiency and code quality.

[0105] Step S106 realizes the efficient use of resources and the flexible expansion of code analysis capabilities through independent deployment to flexibly adapt to small scenes and distributed deployment to support large-scale task architecture, combined with intelligent scheduling of driver nodes and integration of supervision signals.

[0106] Independent system deployment is to configure the basic environment parameters of the main sandbox as a single execution unit, and users directly call it through the client. When the task is executed, the main sandbox exclusively occupies the resources to complete code compilation, analysis and result return, which is suitable for scenarios with high delay requirements and small task quantity.

[0107] Distributed system deployment is to use the driver node as a management center for multiple sandbox nodes, and each sandbox node runs independently on different servers through containerization technology to realize resource isolation. The driver node maintains a node registration table and updates the status of each node in real time. When a task arrives, the optimal node is matched based on language compatibility, resource sufficiency and load balancing to ensure efficient task distribution.

[0108] In the independent mode, the system initializes the basic environment parameters of the main sandbox, the user submits the code and unit test samples through the client tool, the client establishes a connection with the main sandbox through the communication protocol, sends a task request and synchronously receives the compilation and analysis results, and the main sandbox completes the code execution, analysis and result return independently. In the distributed mode, the system automatically creates a driver node and multiple sandbox nodes when it starts. The driver node serves as a management center and maintains a global node registration table, recording the status, resource usage data and supported language types of each sandbox node. After the sandbox node starts, it registers with the driver node and reports its own configuration information, and the driver node assigns it a unique identifier. After receiving the task request, the driver node matches the sandbox node according to the node registration table, first filters the nodes that support the target programming language, then selects the nodes with resource occupancy rate below the safety threshold, and finally completes load balancing according to the task queue length. After successful matching, the relevant content is packaged and sent to the target sandbox node for execution.

[0109] Step S106 realizes the rational allocation of resources and load balancing, can handle larger-scale tasks, improves the scalability and processing capacity of the system, can meet the demand of high concurrency and multi-task, and at the same time ensures the stability and reliability of the system.

[0110] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0111] The following are embodiments of a code analysis system based on a multi-programming language sandbox provided in this disclosure. This system and the code analysis methods based on multi-programming language sandboxes described above belong to the same inventive concept. Details not fully described in the embodiments of the code analysis system based on multi-programming language sandboxes can be found in the embodiments of the code analysis methods based on multi-programming language sandboxes described above. Figure 3 As shown, the system includes: The acquisition and determination module 201 is used to acquire the input code and the corresponding unit test sample, and determine the programming language type specified by the code.

[0112] The test distribution module 202 is used to send code and unit test samples to the corresponding language sub-sandbox environment for execution, based on the programming language type.

[0113] Configure compilation module 203 to pre-install dependency libraries for common programming languages ​​in the sub-sandbox environment. The compiler in the sub-sandbox reports the missing libraries based on the code compilation results and prompts the user to install them.

[0114] Code analysis module 204 is used to call the analysis tools of the code analysis module to analyze the code.

[0115] The information integration module 205 is used to integrate the compiler feedback from the sub-sandbox and various analysis results generated by the code analysis module into the large language model; and to input the integration results into the large language model through a preset template.

[0116] The evaluation call module 206 is used to deploy user or large language models in standalone or distributed systems, and to call MPLSandbox to analyze and evaluate code cases based on user commands, via IP address and port number.

[0117] like Figure 4 As shown, this application also provides an electronic device, including a display module 103, a memory 102, a processor 101, and a computer program stored in the memory and executable on the processor 101. When the processor 101 executes the program, it implements the steps of a code analysis method based on a multi-programming language sandbox.

[0118] In embodiments of the application, electronic devices include, but are not limited to, laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components, their connections, and relationships, and their functions, as described herein, are meant to be examples only, and are not intended to limit implementations of the present application described and / or claimed herein.

[0119] In embodiments of the present application, the processor 101 can be implemented by using at least one of application specific integrated circuits, programmable logic devices, field programmable gate arrays, processors, controllers, micro-controllers, microprocessors, electronic units designed to perform the functions described herein, and in some cases such an implementation can be implemented in a controller. For software implementation, embodiments of the processes or functions can be implemented with separate software modules, which allow at least one function or operation to be performed, by a software application (or program) written in any suitable programming language to be executed by a controller. Software code can be implemented by the software application (or program) written in any suitable programming language to be executed by a controller, and can be stored in the memory.

[0120] The display module 103 is configured to display information input by a user or information provided to the user. The display module 103 can include a display panel, which can be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.

[0121] The memory 102 can be used to store software programs as well as various data. The memory 102 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.

[0122] The present application also provides a storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the code analysis method based on a multi-programming language sandbox.

[0123] The storage medium can take any combination of one or more of a readable medium. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any suitable combination of the above. More specific examples (non-exhaustive list) of readable storage media include an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0124] In the storage media, readable signal media can include data signals on baseband or as part of a carrier wave propagating through program code embodied in the machine usable or computer readable storage medium. Such program code, when executed by the machine, causes the machine to perform the tasks or actions described above. The readable signal media can also be any medium that can be read by the machine and causes the machine to function in accordance with the described embodiments. The readable signal medium can include transmission media which include any medium that facilitates transfer of a computer program from one place to another. Also, the readable signal medium can include a medium that spans a program from one place to another. For example, such medium can include an optical carrier, optical fiber, both of which can be in the form of a wire or cable, or wireless medium such as those that use radio or infrared frequency.

[0125] The foregoing description of the disclosed embodiments enables a person skilled in the art to make or use the application. Numerous modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without the use of the inventive faculty. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A code analysis method based on a multi-programming language sandbox, characterized in that, The methods include: Step S101: Obtain the input code and the corresponding unit test sample, and determine the programming language type specified by the code; Step S102: Based on the programming language type, send the code and unit test samples to the corresponding language sub-sandbox environment for execution; Step S103: The sub-sandbox environment pre-installs the dependency libraries of commonly used programming languages. The compiler in the sub-sandbox reports the missing libraries based on the code compilation results and prompts the user to install them. Step S104: Use the analysis tools in the code analysis module to analyze the code; Step S105: The information integration module integrates the compiler feedback from the sub-sandbox and various analysis results generated by the code analysis module into the large language model; and inputs the integration results into the large language model through a preset template; Step S106: Deploy the user or large language model as an independent system or a distributed system, and use MPLSandbox to analyze and evaluate the code case based on user commands, using IP address and port number.

2. The code analysis method based on a multi-programming language sandbox according to claim 1, characterized in that, Step S101 specifically includes: It receives code files and associated unit test sample files input by the user, and parses the basic metadata of the files through a standardized input interface; Verify the validity of the correspondence between unit test samples and code, extract the programming language features of the code file, and match them with the test framework identifier of the unit test sample according to preset rules to confirm that the test sample is suitable for the language type of the current code; The program identifies the programming language type of code files, quickly predicting based on file extensions. If the extension is missing or there are multiple language features, the program scans the code content, extracts language-specific keywords, and combines them with a predefined language feature library to complete the final identification.

3. The code analysis method based on a multi-programming language sandbox according to claim 1, characterized in that, Step S102 specifically includes: Define a sub-sandbox instance pool, and mark each instance with its supported language type and idle / running / resource utilization rate; when code needs to be executed, select instances from the instance pool that are of the same language and are in an idle state with a resource utilization rate below the safety threshold, based on the programming language type of the code; If no matching instance is found, the system calls the sub-sandbox creation interface to generate a new sub-sandbox instance based on the predefined base operating system, compiler, and dependency libraries, and adds it to the instance pool to await scheduling. Before transmission, the code and test samples are converted into binary format using a serialization tool to generate a unique hash value as a checksum.

4. The code analysis method based on a multi-programming language sandbox according to claim 1, characterized in that, Step S103 specifically includes: The sub-sandbox environment pre-installs dependency libraries for commonly used programming languages, which are categorized and stored by language type, and a standardized library index directory is established. Users specify additional library information referenced in their code by writing configuration files. The sub-sandbox parses the configuration files, verifies whether the library names contain illegal characters, whether the version numbers conform to the semantic versioning specification, and checks the accessibility of the download source. Before executing code, the sub-sandbox triggers a dependency check process, loads the pre-installed library index directory, and matches the dependencies required by the code. If a library with the required version exists in the pre-installed library, it is marked as satisfied. If the pre-installed library is missing or the version does not match, the sub-sandbox checks the additional libraries declared in the user configuration file, verifies the validity of their download source, and then calls the package management tool to download and install them to the specified directory of the sub-sandbox.

5. The code analysis method based on a multi-programming language sandbox according to claim 1, characterized in that, Step S104 specifically includes: Based on the programming language type of the code and the user's task requirements, match the corresponding category of analysis tools from a predefined tool library; For the matched analysis tools, adjust the tool's execution parameters according to the sub-sandbox's operating system version, compiler version, and dependency library version; verify the tool's executability in the current environment through the sub-sandbox's compatibility testing interface; The adjusted analysis tools are submitted to the execution queue of the sub-sandbox in priority order. During execution, the resource monitoring thread collects the resource usage data of the tools in real time. If the resource usage of a tool exceeds the preset threshold, the execution of the tool is paused and the resources are released. Execution is resumed after the resources are released. Collect the output results from various analysis tools, merge duplicate results, and generate a comprehensive report containing multi-dimensional analysis data.

6. The code analysis method based on a multi-programming language sandbox according to claim 5, characterized in that, The steps for verifying the tool's executability in the current environment through the sub-sandbox compatibility testing interface specifically include: When the sub-sandbox environment cannot meet the running requirements of the analysis tool, an adapted virtual runtime environment is created. By mounting the corresponding version of the operating system image, compiler and dependency library, an environment that meets the running conditions of the tool is simulated. Use binary translation technology to convert the tool's instruction set into a format executable by the current environment; It provides a visual interface for editing adaptation rules, allowing users to configure parameters by dragging and dropping.

7. The code analysis method based on a multi-programming language sandbox according to claim 1, characterized in that, Step S105 specifically includes: Data preprocessing is performed on compiler feedback and code analysis results from the sub-sandbox; Based on the task type related to the code, a basic template is matched from a preset template library; the preset template library is classified according to task type, and each template contains a task target description and data placeholders; Users can modify the basic template through a visual interface or text configuration file; users can add personalized prompts, adjust the order of placeholders, and set data filtering conditions. The bound data is input into the large language model through the large language model input interface; after the input is completed, the mapping relationship between the data and the template is recorded.

8. A code analysis system based on a multi-programming language sandbox, characterized in that, The system is used to implement the code analysis method based on a multi-programming language sandbox as described in any one of claims 1 to 7; The system includes: The acquisition and judgment module is used to acquire the input code and the corresponding unit test sample, and determine the programming language type specified by the code; The test distribution module is used to send code and unit test samples to the corresponding language sub-sandbox environment for execution, based on the programming language type. Configure the compilation module to pre-install dependency libraries for common programming languages ​​in the sub-sandbox environment. The compiler in the sub-sandbox reports the missing libraries based on the code compilation results and prompts the user to install them. The code analysis module is used to call the analysis tools of the code analysis module to analyze the code; The information integration module integrates compiler feedback from the sub-sandbox and various analysis results generated by the code analysis module into the large language model; and inputs the integration results into the large language model through preset templates. The evaluation call module is used to deploy user or large language models in standalone or distributed systems. Based on user commands, it calls MPLSandbox via IP address and port number to analyze and evaluate code examples.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the code analysis method based on a multi-programming language sandbox as described in any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the code analysis method based on a multi-programming language sandbox as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Code analyzing method and system

    CN103425572A

  • Application software cross-version compatible operation method, system and device and storage medium

    CN114780950A

  • Container resource scheduling method and device, electronic equipment and storage medium

    CN119829221A

Cited By

  • Assembly line flow adaptive configuration method and system

    CN121143859A

  • A pipeline process adaptive configuration method and system

    CN121143859B