Code processing method and device based on large language model, electronic equipment, storage medium and program product

By obtaining the code content and performance test data of the code to be processed, generating performance data information, and using a large language model for performance analysis, the problem of insufficient accuracy and practicality of code optimization suggestions generated by large language models is solved, and the effect of code optimization is improved.

CN120631425APending Publication Date: 2025-09-12BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510728619.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

The code optimization suggestions generated by existing large language models have poor accuracy and practicality and cannot effectively improve the running performance of the code.

Method used

By obtaining the code content and performance detection data of the code to be processed, performance data information is generated, and performance analysis is performed using a large language model to generate code optimization suggestions.

Benefits of technology

The accuracy and practicality of code optimization suggestions generated by large language models have been improved, thereby improving the operational performance of optimized code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120631425A_ABST
    Figure CN120631425A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the field of computer technologies, large model technologies, large language model technologies, intelligent agent technologies and artificial intelligence technologies, and discloses a code processing method and device based on a large language model, electronic equipment, a storage medium and a program product. The method comprises the steps of obtaining first code content associated with a to-be-processed code, and obtaining first performance detection data of the to-be-processed code; generating performance data information of the to-be-processed code according to the first code content and the first performance detection data; performance analysis is conducted on the to-be-processed code on the basis of the first code content and the performance data information through a large language model, a code optimization suggestion of the to-be-processed code is generated, and the code optimization suggestion is used for conducting optimization processing on the to-be-processed code. By means of the technical scheme, the accuracy and practicability of the code optimization suggestions generated by the large language model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the fields of computer technology, large model technology, large language model technology, intelligent agent technology, and artificial intelligence technology, and in particular to a code processing method, device, electronic device, storage medium, and program product based on a large language model. Background Art

[0002] After writing code, coders can access and view optimization suggestions. For example, they can input their code into a large language model and receive and view the optimization suggestions it generates. They can then rewrite the code based on these suggestions to improve its performance. However, in related technologies, the accuracy and practicality of code optimization suggestions generated by large language models are poor, and they are unable to effectively improve code performance. Summary of the Invention

[0003] The embodiments of the present disclosure provide a code processing method, apparatus, electronic device, storage medium, and program product based on a large language model to improve the accuracy and practicality of code optimization suggestions generated by the large language model, thereby improving the operational performance of the optimized code.

[0004] In a first aspect, an embodiment of the present disclosure provides a code processing method based on a large language model, comprising:

[0005] Acquire first code content associated with the code to be processed, and acquire first performance detection data of the code to be processed;

[0006] generating performance data information of the code to be processed based on the first code content and the first performance detection data, wherein the performance data information is associated with and records the line content of at least some code lines in the first code content and the performance data of the at least some code lines;

[0007] A large language model is used to perform performance analysis on the code to be processed based on the first code content and the performance data information, and code optimization suggestions for the code to be processed are generated. The code optimization suggestions are used to optimize the code to be processed.

[0008] In a second aspect, the present disclosure further provides a code processing device based on a large language model, comprising:

[0009] A data acquisition module, configured to acquire first code content associated with the code to be processed, and acquire first performance detection data of the code to be processed;

[0010] an information generation module, configured to generate performance data information of the code to be processed based on the first code content and the first performance detection data, wherein the performance data information associates and records the line content of at least some code lines in the first code content and the performance data of the at least some code lines;

[0011] A suggestion generation module is used to use a large language model to perform performance analysis on the code to be processed based on the first code content and the performance data information, and generate code optimization suggestions for the code to be processed, wherein the code optimization suggestions are used to optimize the code to be processed.

[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:

[0013] one or more processors;

[0014] a memory for storing one or more programs,

[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the code processing method based on the large language model as described in the embodiment of the present disclosure.

[0016] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the code processing method based on the large language model as described in the embodiment of the present disclosure is implemented.

[0017] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product. When the computer program product is executed by a computer, the computer implements the code processing method based on the large language model as described in the embodiment of the present disclosure.

[0018] The code processing method, device, electronic device, storage medium and program product based on the large language model provided by the embodiments of the present disclosure associate the code content of the code to be processed with the performance data of the code to be processed, and use the large language model to perform performance analysis on the code to be processed based on the performance data information obtained based on the association. This can improve the accuracy and practicality of the code optimization suggestions generated by the large language model, thereby improving the operating effect of the optimized code to be processed. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0020] Figure 1A flowchart of a code processing method based on a large language model provided in an embodiment of the present disclosure;

[0021] Figure 2 A flowchart of another code processing method based on a large language model provided in an embodiment of the present disclosure;

[0022] Figure 3 A schematic diagram of a code processing process provided by an embodiment of the present disclosure;

[0023] Figure 4 A structural block diagram of a code processing device based on a large language model provided in an embodiment of the present disclosure;

[0024] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0026] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0027] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0028] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0029] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0030] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0031] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.

[0032] Figure 1 A flowchart of a code processing method based on a large language model provided in an embodiment of the present disclosure. The method can be executed by a code processing device based on a large language model, wherein the device can be implemented by software and / or hardware and can be configured in an electronic device, typically, a computer, a mobile phone or a tablet computer. The code processing method based on a large language model provided in an embodiment of the present disclosure is suitable for generating code optimization suggestions based on the code content of the code to be processed and the performance data of the code to be processed. Figure 1 As shown, the code processing method based on the large language model provided in this embodiment may include:

[0033] S101: Acquire first code content associated with a code to be processed, and acquire first performance detection data of the code to be processed.

[0034] The code to be processed can be understood as code elements and / or code snippets to be optimized. Code elements can be understood as elements that constitute the structure and content of a program, such as variables, functions, classes, objects, properties, and / or strings. Code snippets can be understood as sections of program code to be optimized, such as certain statements and / or paragraphs within the program code. The following description uses the code elements to be processed as an example.

[0035] The first code content may be code content associated with the code to be processed. The first code content may include the code content to be processed associated with the code to be processed in the code file where the code to be processed is located; it may also further include code content not included in the code file where the code to be processed is located. Taking the optimization of a code element (i.e., the code to be processed) in a certain functional module as an example, the first code content may include the code content to be processed that calls this code element in the code file of this functional module, as well as the code content that this code to be processed depends on in the dependent files of this code file.

[0036] The first performance detection data may be performance detection data associated with the code to be processed. Exemplarily, the first performance detection data may include one or more performance detection data entries, and different performance detection data entries correspond to different code lines and / or different performance attributes of the code to be processed. This performance detection data entry may be used to indicate the performance data of the corresponding code line obtained by detection. This performance data may be understood as data used to describe the performance of the corresponding code, such as the call frequency of the corresponding code, the CPU usage rate and / or memory usage, etc.

[0037] Specifically, when optimizing the code to be processed, the first code content and first performance data of the code to be processed can be obtained. For example, code content associated with the code to be processed can be obtained from a code file, and context code completion can be performed on the code content, with the completed code content being used as the first code content of the code to be processed. Furthermore, performance testing can be performed on the functional module corresponding to the code to be processed, and performance test data associated with the code to be processed can be obtained from the obtained performance test results as the first performance test data of the code to be processed, and so on.

[0038] S102. Generate performance data information of the code to be processed based on the first code content and the first performance detection data, wherein the performance data information is associated with records of the line content of at least some code lines in the first code content and the performance data of the at least some code lines.

[0039] The performance data information of the code to be processed may be information recording performance data corresponding to the code content of each portion of the code to be processed. For example, the performance data information to be processed may be associated with the line content of one or more code lines in the first code content and the performance data corresponding to the line content.

[0040] For example, after obtaining the first code content associated with the code to be processed and the first performance data of the code to be processed, the first performance data of the code to be processed can be associated with its first code content. In other words, an association relationship between the first performance data of the code to be processed and the first code content of the code to be processed is established.

[0041] In this embodiment, the manner of associating the first performance data of the code to be processed with the first code of the code to be processed can be set as needed, and this embodiment does not limit this.

[0042] In some examples, an association relationship between the first performance data of the code to be processed and the first code content of the code to be processed can be established based on the code line identifier. For example, the performance data information may include two sub-information modules, code sub-information and performance sub-information. The code line identifier of each code line in the first code content and the line content of each code line may be recorded in this code content sub-information, and the code line identifier of each code line in the first code content and the performance data of each code line may be recorded in this performance sub-information. Among them, the code line identifier may include, for example, the line number of the code line, etc. This line number may be the line number of the corresponding code line in the first code content or the line number in the code file of the functional module corresponding to the code to be processed, and may be set according to needs.

[0043] In some examples, an association relationship between the first performance data of the code to be processed and the first code content of the code to be processed can be established based on the storage location. For example, the line content of each code line in the first code content and the performance data of each code line can be recorded accordingly in the performance data information.

[0044] In this embodiment, the first performance detection data may include performance data for at least some code lines in the first code content. For code lines in the first code content whose performance data is not included in the first performance detection data, the line content and performance data of the code line may not be recorded in the performance data information of the code to be processed; only the line content of the code line may be recorded in the performance data information of the code to be processed without recording the performance data of the code line; or the line content of the code line may be recorded in the performance data information of the code line to be processed, and the absence of performance data for the code line may be marked, such as by recording the field value of the performance data field of the code line as a null value or a default value, etc. This embodiment is not limited to this.

[0045] S103: Using a large language model to perform performance analysis on the code to be processed based on the first code content and the performance data information, and generating code optimization suggestions for the code to be processed, wherein the code optimization suggestions are used to optimize the code to be processed.

[0046] Among them, a large language model (LLM) refers to a deep learning model trained with a large amount of text data, which can provide in-depth knowledge about various topics by training on a huge data set. The specific training method of the large language model is not limited. The code optimization suggestions for the code to be processed can be understood as improvement suggestions or improvement methods proposed for the code to be processed. This code optimization suggestion can be used to improve the performance of the code to be processed, and then improve the running effect of the code to be processed. Exemplarily, the optimization suggestions for the code to be processed may include but are not limited to at least one information on an item to be optimized, at least one optimization point information, at least one code content fragment before and after optimization, at least one expected effect after optimization, at least one precaution during optimization and / or at least one optimization verification method for the code to be processed, etc.

[0047] Specifically, a large language model can be used to perform performance analysis on the code to be processed based on the first code content and performance data information of the code to be processed. For example, the first code content and performance data information are input into the large language model, and the large language model is used to perform performance analysis on the code to be processed based on the first code content and performance data information, and generate code optimization suggestions for the code to be processed, so as to facilitate subsequent optimization of the code to be processed based on the code optimization suggestions.

[0048] In some embodiments, after the code optimization suggestion is generated, the generated code optimization suggestion can be displayed to the user (such as a programmer) for the user to view. In this case, optionally, after the code optimization suggestion for the code to be processed is generated, at least one of the following is also included: displaying the code optimization suggestion. For example, after the code optimization suggestion for the code to be processed is generated, the generated code optimization suggestion can be automatically displayed, such as automatically displaying the code optimization suggestion in the suggestion display area; or the generated code optimization suggestion may not be automatically displayed, but the generated code optimization suggestion may be displayed after receiving a display operation for the generated code optimization suggestion.

[0049] In some embodiments, after the code optimization suggestion is generated, an optimization suggestion report for the code to be processed can be generated based on the code optimization suggestion, so that the user can store and view it later. In this case, optionally, after the code optimization suggestion for the code to be processed is generated, it also includes: generating an optimization suggestion report for the code to be processed based on the code optimization suggestion. Exemplarily, each part of the code optimization suggestion can be added to each position of the preset report template to obtain the optimization suggestion report for the code to be processed; or, each part of the optimization suggestion report can be generated according to each part of the code optimization suggestion through a large language model, and the generated parts can be spliced ​​to obtain the optimization suggestion report for the code to be processed, and so on. Among them, the timing of generating the optimization suggestion report is not limited. For example, the optimization suggestion report for the code to be processed can be automatically generated after the code optimization suggestion for the code to be processed is obtained; or the optimization suggestion report for the code to be processed can be generated after receiving the generation operation for the optimization suggestion report, and so on.

[0050] In some implementations, the user can optimize the pending code based on the generated code optimization suggestions so that the optimized code content better meets the user's actual optimization needs. For example, after generating code optimization suggestions for the pending code, the current application can display the generated code optimization suggestions to the user, allowing the user to review the code optimization suggestions and / or adjust the code content of the pending code based on the code optimization suggestions.

[0051] In some embodiments, the current application can also optimize the code to be processed based on the generated code optimization suggestions to reduce the operations that the user needs to perform and improve the efficiency of code optimization processing. Optionally, after the code optimization suggestions for the code to be processed are generated, it also includes: optimizing the code to be processed based on the code optimization suggestions. For example, in the case where the code optimization suggestions include optimized code content fragments, at least part of the optimized code content fragments can be used to replace the corresponding code content fragments before the optimization of the code to be processed; and / or, in the case where the code optimization suggestions do not include optimized code content fragments, optimized code content fragments can be generated based on the code optimization suggestions and the code content before optimization, such as generating optimized code content fragments based on the code optimization suggestions and the code content before optimization through a large language model, and using at least part of the optimized code content fragments to replace the corresponding code content fragments before the optimization of the code to be processed, thereby achieving optimization processing of the code to be processed.

[0052] In the above embodiments, the timing of optimizing the code to be processed and the optimized code content segments are not limited. For example, the code to be processed can be optimized automatically or in response to a user's optimization operation based on the generated code optimization suggestions. The optimized code content segments can be determined based on preset rules, such as selecting some or all code content segments to be optimized in the code to be optimized based on the preset rules and optimizing them; or obtaining and optimizing the code content segments of the code to be processed selected by the user, etc.

[0053] The code processing method based on the large language model provided in this embodiment obtains the first code content related to the code to be processed and the first performance detection data of the code to be processed; generates performance data information of the code to be processed based on this first code content and this first performance detection data, wherein the performance data information is associated with the line content of at least part of the code lines in the first code content and the performance data of this at least part of the code lines; uses the large language model to perform performance analysis on the code to be processed based on the first code content and performance data information of the code to be processed, generates code optimization suggestions for the code to be processed, and optimizes the code to be processed based on this code optimization suggestion. This embodiment utilizes the above-mentioned technical solution to associate the code content of the code to be processed with the performance data of the code to be processed, and uses the large language model to perform performance analysis on the code to be processed based on the performance data information obtained by the association, which can improve the accuracy and practicality of the code optimization suggestions generated by the large language model, thereby improving the running effect of the optimized code to be processed.

[0054] In some embodiments, the use of a large language model to perform performance analysis on the code to be processed based on the first code content and the performance data information to generate code optimization suggestions for the code to be processed includes: generating prompt information corresponding to the code to be processed based on the first code content and the performance data information; inputting the prompt information into a pre-trained large language model, and performing performance analysis on the code to be processed based on the prompt information through the large language model to generate code optimization suggestions for the code to be processed.

[0055] The prompt information can be understood as a user prompt of the large language model, which can be text or instructions used to prompt the large language model to evoke specific capabilities to solve practical problems (such as performance analysis).

[0056] Specifically, prompt information corresponding to the code to be processed can be generated based on the first code content and performance data information of the code to be processed. For example, the code to be processed (such as the code element to be optimized), the first code content of the code to be processed, and the performance data information of the code to be processed are added to a pre-set prompt information template that indicates performance analysis to obtain prompt information corresponding to the code to be processed.

[0057] After obtaining the prompt information corresponding to the code to be processed, the performance analysis of the code to be processed can be performed based on this prompt information through the pre-trained large language model. For example, this prompt information is input into the pre-trained large language model, and code optimization suggestions for the code to be processed output by this large language model are obtained.

[0058] In this embodiment, prompt information is generated based on the first code content and performance data information, and a large language model obtained through pre-training is used to perform performance analysis on the code to be processed based on this prompt information. This can achieve targeted generation of code optimization suggestions for the code to be processed, improve the analysis depth of the generated code optimization suggestions, and further improve the accuracy and practicality of the generated code optimization suggestions.

[0059] In some embodiments, obtaining the first code content associated with the code to be processed includes: determining the code to be processed in a preset functional module, and obtaining the code content to be processed associated with the code to be processed from the code file of the preset functional module; performing dependency analysis on the code content to be processed to generate a dependency tree of the code to be processed; performing dependency code completion on the code content to be processed according to the dependency tree to obtain the first code content of the code to be processed.

[0060] Among them, the preset functional module can be understood as the functional module to which the code to be processed belongs, such as the functional algorithm to which the code to be processed belongs. In other words, the preset functional module can be a functional module that the user wants to optimize the code to be processed contained therein. The code file of the preset functional module can be a file for recording the source code of the preset functional module to implement its own function. The type of the preset functional model is not limited. For example, the preset functional module can be an audio processing module, a video processing module or other types of functional modules. The content of the code to be processed can be the code content obtained from the code file of the preset functional module and associated with the code to be processed. Taking the code to be processed as the code element to be processed as an example, the content of the code to be processed can include the element content of the code element to be processed itself and the code content referenced by the code element to be processed, etc. The dependency tree can be a grammatical tree including grammatical elements on which the content of the code to be processed depends.

[0061] For example, based on a user's instruction, the code to be processed in a preset functional module that requires optimization can be determined, such as the code elements to be optimized in the preset functional module. Subsequently, code content associated with the code to be processed is obtained from the code file of the preset functional module as the code content to be processed for the code to be processed.

[0062] After obtaining the content of the code to be processed, a dependency analysis can be performed on the content of the code to be processed to determine the syntax elements that the content of the code to be processed needs to depend on and are not located in the code file of the preset functional module, and a syntax tree containing the preset elements contained in the code to be processed and the syntax elements that the code to be processed needs to depend on is generated as the dependency tree of the code to be processed.

[0063] Furthermore, the dependency code of the code to be processed is completed according to the dependency tree of the code to be processed, such as obtaining the code content of the grammatical elements on which the code to be processed depends according to the dependency tree of the code to be processed, and adding it to the code content to be processed of the code to be processed, thereby obtaining the first code content of the code to be processed.

[0064] In this embodiment, the method for generating the dependency tree of the dependency tree of the code to be processed is not limited. Optionally, the dependency analysis of the content of the code to be processed and the generation of the dependency tree of the code to be processed include: constructing a syntax tree of the code to be processed according to the content of the code to be processed; obtaining the syntax elements on which the code to be processed depends from the dependency file of the code file, and adding the syntax elements to the syntax tree to obtain the dependency tree of the code to be processed. For example, the code to be processed can be parsed to generate an abstract syntax tree (AST) of the content of the code to be processed; identifying the content (such as header files, library functions, etc.) on which the syntax elements in the abstract syntax tree in the dependency file depend, adding the corresponding syntax elements to the abstract syntax tree of the code to be processed, and using the syntax tree obtained after adding this syntax element as the dependency tree of the code to be processed.

[0065] In this embodiment, the code content to be processed and the code content on which it depends can be automatically collected and organized without manual operation. Thus, while ensuring the comprehensiveness of the first code content used for performance analysis of the code to be processed, the operations required for the user to obtain the first code content can be reduced, thereby improving the efficiency of obtaining the first code content.

[0066] Figure 2A flow chart of another code processing method based on a large language model provided for an embodiment of the present disclosure. The solution in this embodiment can be combined with one or more optional solutions in the above embodiments. Optionally, the obtaining of the first performance detection data of the code to be processed includes: performing a performance test on a preset functional module to obtain second performance detection data of the preset functional module, wherein the preset functional module corresponds to the code to be processed, and the second performance detection data includes a plurality of performance detection data entries, and the performance detection data entries include a code line identifier and performance data corresponding to the code line identifier; obtaining a performance detection data entry associated with the code to be processed from the second performance detection data as the first performance detection data of the code to be processed.

[0067] Optionally, the generation of performance data information of the code to be processed based on the first code content and the first performance detection data includes: for each performance detection data entry in the first performance detection data, obtaining, from the first code content, the row content corresponding to the code row identifier in the performance detection data entry; associating the performance data corresponding to the code row identifier with the row content corresponding to the code row identifier and recording them in the performance data information of the code to be processed.

[0068] Correspondingly, such as Figure 2 As shown, the code processing method based on the large language model provided in this embodiment may include:

[0069] S201. Obtain first code content associated with the code to be processed, and execute S204.

[0070] S202. Perform a performance test on a preset functional module to obtain second performance test data of the preset functional module, wherein the preset functional module corresponds to the code to be processed, and the second performance test data includes multiple performance test data entries, and the performance test data entries include a code line identifier and performance data corresponding to the code line identifier.

[0071] Among them, the second performance detection data can be understood as the performance detection data of the preset functional module. The second performance detection data can correspond to the code line identifier of at least part of the code lines in the code file of the preset functional module and the detected performance data. For example, the second performance detection data may include one or more performance detection data entries. Different performance detection data entries correspond to different code lines and / or different performance attributes in the code file. Each performance detection data entry may include the code line identifier of the code line corresponding to this performance detection data entry and the performance data detected for this code line.

[0072] Specifically, the preset functional module can be performance tested. For example, the preset functional module can be tested based on a test case pre-set for the preset functional module, and during the testing process of the preset functional module, the preset functional module can be performance tested using one or more performance testing tools to obtain second performance test data of the preset functional module.

[0073] S203: Acquire a performance detection data entry associated with the code to be processed from the second performance detection data as first performance detection data of the code to be processed.

[0074] In this step, one or more performance detection data entries associated with the code to be processed may be obtained from the second performance detection data as the first performance detection data of the code to be processed.

[0075] Exemplarily, based on the first code content of the code to be processed or the code line identifier of each code line in the code content to be processed in the code file of the preset function module, a performance test data entry containing the determined code line identifier can be obtained from the second performance test data of the preset function module as the first performance test data of the code to be processed.

[0076] S204: For each performance testing data entry in the first performance testing data, obtain, from the first code content, a line content corresponding to the code line identifier in the performance testing data entry.

[0077] In this embodiment, after obtaining the first performance detection data of the code to be processed, for each performance detection data entry in the first performance detection data, the line content of the code line corresponding to the code line identifier contained in this performance detection data entry can be obtained from the first code content of the code to be processed.

[0078] S205: Associate the performance data corresponding to the code line identifier with the line content corresponding to the code line identifier and record them in the performance data information of the code to be processed.

[0079] In this embodiment, after obtaining the line content of the code line based on the code line identifier contained in the performance detection data entry, this line content can be associated with the performance data contained in this performance detection data entry, such as recording this line content and this performance data correspondingly in the performance data information of the code to be processed.

[0080] Therefore, after the performance data and corresponding row contents in each performance detection data entry in the first performance detection data are added, the performance data information of the code to be processed is generated. In other words, the performance data information of the code to be processed is generated.

[0081] S206: Using a large language model to perform performance analysis on the code to be processed based on the first code content and the performance data information, and generating code optimization suggestions for the code to be processed, wherein the code optimization suggestions are used to optimize the code to be processed.

[0082] The code processing method based on a large language model provided in this embodiment associates the line content of the code line to be processed with the detected performance data of the code to be processed, and uses the large language model to perform performance analysis on the code to be processed based on the associated performance data information. This can further improve the comprehensiveness of the information used for performance analysis, thereby further improving the accuracy of the generated code optimization suggestions.

[0083] Figure 3 A schematic diagram of a code processing process provided by an embodiment of the present disclosure. In an optional embodiment, the preset functional module is an audio processing module, and the code to be processed is a code element to be optimized in the audio processing algorithm adopted by the audio processing module, as an example. Figure 3 As shown, the performance optimization system may include a code analysis module, a performance data integration module, an artificial intelligence (AI) optimization module and a report generation module, wherein the code analysis module can be used to parse the target code (i.e., the code content to be processed) and its dependencies, extract AST and build context; the performance data integration module can be used to obtain performance data associated with the target code; the AI ​​optimization module can be used to associate performance data with code logic (i.e., code content), and use a large language model to analyze the code and performance data to generate optimization suggestions; the report generation module can be used to organize the optimization suggestions and generate and store optimization suggestion reports. Among them, the optimization suggestions may include specific code modification suggestions (such as "replace the for loop with an OpenMP parallel loop"), code snippets before and after optimization, and expected performance improvements after optimization (such as "delay reduced by XX%").

[0084] Please continue to refer to Figure 3 In this embodiment, the process of optimizing a code element in the audio processing algorithm can be described as follows:

[0085] A1. Code context completion.

[0086] Specifically, clang can be used to parse the target code, extract the abstract syntax tree AST of the target code, identify the dependent files of the target code (such as header files, library functions), and build a dependency tree of the target code; perform static analysis based on the dependency tree, reconstruct the code call chain and dependency relationship of the target code, and form a comprehensive code context (that is, perform dependent code completion to obtain the first code content).

[0087] A2. Performance data collection.

[0088] Specifically, the audio processing algorithm can be performance tested based on a pre-set original algorithm use case to generate a performance data report of the audio processing algorithm (i.e., the second performance detection data). The code logic and performance performance are associated through call stack backtracing and other technologies, and the performance detection data associated with the target code (i.e., the first performance detection data) is extracted from the performance data report.

[0089] A3. In-depth analysis of large language models.

[0090] Specifically, performance data can be associated with the code content of AST nodes (i.e., generating performance data information for the code to be processed) to ensure that the large language model accurately understands the runtime performance of the code. A user prompt (i.e., user prompt information) for the large language model is generated based on the first code content and the associated performance data information. The user prompt is input into the large language model, and the large language model is further combined with a pre-set performance optimization system prompt (i.e., system prompt information) to analyze code logic and bottlenecks and generate code optimization suggestions. For example, parallel processing can be recommended for nested loops, and the use of memory pools can be recommended for memory allocation, etc.

[0091] A3. Generate optimization suggestion report.

[0092] Specifically, the generated code optimization suggestions may be displayed, an optimization suggestion report may be generated based on the generated code optimization suggestions, and the optimization suggestion report may be saved.

[0093] Therefore, this embodiment can automatically collect and organize target code and its dependencies, providing a complete analysis basis for the large language model without manual intervention; combined with performance data (such as real-time processing overhead, etc.), it ensures that the optimization suggestions generated by the large language model are highly targeted, improving the accuracy and practicality of the optimization suggestions made by the large language model; through the large language model, in-depth analysis of the code is performed to generate performance optimization suggestions, which can significantly improve the optimization efficiency of the code without the need for developers to delve into the underlying details.

[0094] In addition, taking the audio processing algorithm as an example, this embodiment configures the performance optimization system prompt of the large language model to focus on the real-time and signal quality requirements of the audio processing algorithm in scenarios such as live broadcast or on-demand, and focuses on solving the real-time and signal quality requirements of the audio processing algorithm. It also provides multi-dimensional optimization solutions for the needs of multi-threaded optimization, memory management improvement, and algorithm complexity reduction of the audio processing algorithm, thereby improving the performance and development efficiency of the audio processing algorithm.

[0095] Figure 4This is a block diagram of a code processing device based on a large language model provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can be configured in an electronic device, typically a computer, a mobile phone, or a tablet computer. It can generate code optimization suggestions based on the code content and performance data of the code to be processed by executing a code processing method based on a large language model. Figure 4 As shown, the code processing device based on the large language model provided in this embodiment may include: a data acquisition module 401, an information generation module 402 and a suggestion generation module 403, wherein:

[0096] The data acquisition module 401 is configured to acquire first code content associated with the code to be processed and acquire first performance detection data of the code to be processed;

[0097] An information generation module 402 is configured to generate performance data information of the code to be processed based on the first code content and the first performance detection data, wherein the performance data information associates and records the line content of at least some code lines in the first code content with the performance data of the at least some code lines;

[0098] The suggestion generation module 403 is used to use a large language model to perform performance analysis on the code to be processed based on the first code content and the performance data information, and generate code optimization suggestions for the code to be processed, and the code optimization suggestions are used to optimize the code to be processed.

[0099] The code processing device based on the large language model provided in this embodiment obtains the first code content related to the code to be processed and the first performance detection data of the code to be processed through the data acquisition module; generates the performance data information of the code to be processed based on the first code content and the first performance detection data through the information generation module, wherein the line content of at least part of the code lines in the first code content and the performance data of at least part of the code lines are recorded in the performance data information; and uses the large language model to perform performance analysis on the code to be processed based on the first code content and performance data information of the code to be processed through the suggestion generation module, and generates code optimization suggestions for the code to be processed, so as to optimize the code to be processed based on the code optimization suggestions. This embodiment utilizes the above-mentioned technical solution to associate the code content of the code to be processed with the performance data of the code to be processed, and uses the large language model to perform performance analysis on the code to be processed based on the performance data information obtained by association, which can improve the accuracy and practicality of the code optimization suggestions generated by the large language model, and thereby improve the running effect of the optimized code to be processed.

[0100] Optionally, the suggestion generation module 403 can be specifically used to: generate prompt information corresponding to the code to be processed based on the first code content and the performance data information; input the prompt information into a pre-trained large language model, and perform performance analysis on the code to be processed based on the prompt information through the large language model to generate code optimization suggestions for the code to be processed.

[0101] Optionally, the data acquisition module 401 may include: a code acquisition unit, used to determine the code to be processed in the preset functional module, and obtain the code content to be processed associated with the code to be processed from the code file of the preset functional module; a dependency analysis unit, used to perform dependency analysis on the code content to be processed and generate a dependency tree of the code to be processed; and a code completion code, used to perform dependency code completion on the code content to be processed according to the dependency tree to obtain the first code content of the code to be processed.

[0102] Optionally, the dependency analysis unit can be specifically used to: construct a syntax tree of the code to be processed based on the content of the code to be processed; obtain the syntax elements on which the code to be processed depends from the dependency files of the code file, and add the syntax elements to the syntax tree to obtain the dependency tree of the code to be processed.

[0103] Optionally, the data acquisition module 401 may include: a performance detection unit, used to perform performance detection on a preset functional module to obtain second performance detection data of the preset functional module, wherein the preset functional module corresponds to the code to be processed, and the second performance detection data includes multiple performance detection data entries, and the performance detection data entries include a code line identifier and performance data corresponding to the code line identifier; a data acquisition unit, used to obtain the performance detection data entry associated with the code to be processed from the second performance detection data as the first performance detection data of the code to be processed.

[0104] Optionally, the information generation module 402 can be specifically used to: for each performance detection data entry in the first performance detection data, obtain the line content corresponding to the code line identifier in the performance detection data entry from the first code content; and associate the performance data corresponding to the code line identifier with the line content corresponding to the code line identifier and record them in the performance data information of the code to be processed.

[0105] Furthermore, the code processing device based on the large language model may also include at least one of the following: a suggestion display module, used to display the code optimization suggestion after the code optimization suggestion for the code to be processed is generated; a report generation module, used to generate an optimization suggestion report for the code to be processed based on the code optimization suggestion after the code optimization suggestion for the code to be processed is generated; a code optimization module, used to optimize the code to be processed based on the code optimization suggestion after the code optimization suggestion for the code to be processed is generated.

[0106] The large language model-based code processing apparatus provided in the embodiments of the present disclosure can execute the large language model-based code processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of executing the large language model-based code processing method. For technical details not fully described in this embodiment, please refer to the large language model-based code processing method provided in any embodiment of the present disclosure.

[0107] Reference below Figure 5 , which shows a schematic structural diagram of an electronic device (e.g., terminal device) 500 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0108] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0109] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0110] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0111] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0112] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0113] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0114] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains a first code content associated with the code to be processed, and obtains first performance detection data of the code to be processed; generates performance data information of the code to be processed based on the first code content and the first performance detection data, wherein the performance data information is associated with the line content of at least part of the code lines in the first code content and the performance data of the at least part of the code lines; uses a large language model to perform performance analysis on the code to be processed based on the first code content and the performance data information, and generates code optimization suggestions for the code to be processed, and the code optimization suggestions are used to optimize the code to be processed.

[0115] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0117] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a module does not, in some cases, limit the unit itself.

[0118] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0119] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer 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 foregoing.

[0120] According to one or more embodiments of the present disclosure, Example 1 provides a code processing method based on a large language model, including:

[0121] Acquire first code content associated with the code to be processed, and acquire first performance detection data of the code to be processed;

[0122] generating performance data information of the code to be processed based on the first code content and the first performance detection data, wherein the performance data information is associated with and records the line content of at least some code lines in the first code content and the performance data of the at least some code lines;

[0123] A large language model is used to perform performance analysis on the code to be processed based on the first code content and the performance data information, and code optimization suggestions for the code to be processed are generated. The code optimization suggestions are used to optimize the code to be processed.

[0124] According to one or more embodiments of the present disclosure, Example 2, according to the method of Example 1, wherein the step of using a large language model to perform performance analysis on the code to be processed based on the first code content and the performance data information and generating code optimization suggestions for the code to be processed includes:

[0125] generating prompt information corresponding to the code to be processed based on the first code content and the performance data information;

[0126] The prompt information is input into a pre-trained large language model, and the large language model is used to perform performance analysis on the code to be processed based on the prompt information to generate code optimization suggestions for the code to be processed.

[0127] According to one or more embodiments of the present disclosure, Example 3, according to the method of Example 1, obtaining the first code content associated with the code to be processed includes:

[0128] Determine the code to be processed in the preset function module, and obtain the code content to be processed associated with the code to be processed from the code file of the preset function module;

[0129] Performing dependency analysis on the content of the code to be processed to generate a dependency tree of the code to be processed;

[0130] Dependency code completion is performed on the code content to be processed according to the dependency tree to obtain first code content of the code to be processed.

[0131] According to one or more embodiments of the present disclosure, Example 4 is the method according to Example 3, wherein performing dependency analysis on the content of the code to be processed to generate a dependency tree of the code to be processed includes:

[0132] Constructing a syntax tree of the code to be processed according to the content of the code to be processed;

[0133] The syntax elements on which the code to be processed depends are obtained from the dependency files of the code file, and the syntax elements are added to the syntax tree to obtain the dependency tree of the code to be processed.

[0134] According to one or more embodiments of the present disclosure, Example 5, according to the method of Example 1, obtaining first performance detection data of the code to be processed includes:

[0135] Performing a performance test on a preset functional module to obtain second performance test data of the preset functional module, wherein the preset functional module corresponds to the code to be processed, and the second performance test data includes a plurality of performance test data entries, each of the performance test data entries including a code line identifier and performance data corresponding to the code line identifier;

[0136] A performance detection data entry associated with the code to be processed is obtained from the second performance detection data as first performance detection data of the code to be processed.

[0137] According to one or more embodiments of the present disclosure, Example 6, according to the method of Example 5, generating the performance data information of the code to be processed based on the first code content and the first performance detection data, includes:

[0138] For each performance test data entry in the first performance test data, obtaining, from the first code content, a line content corresponding to a code line identifier in the performance test data entry;

[0139] The performance data corresponding to the code line identifier and the line content corresponding to the code line identifier are associated and recorded in the performance data information of the code to be processed.

[0140] According to one or more embodiments of the present disclosure, Example 7, according to the method of any one of Examples 1-6, further includes, after generating the code optimization suggestion for the code to be processed, at least one of the following:

[0141] Display the code optimization suggestions;

[0142] Generating an optimization suggestion report for the code to be processed based on the code optimization suggestion;

[0143] The code to be processed is optimized based on the code optimization suggestion.

[0144] According to one or more embodiments of the present disclosure, Example 8 provides a code processing device based on a large language model, including:

[0145] A data acquisition module, configured to acquire first code content associated with the code to be processed, and acquire first performance detection data of the code to be processed;

[0146] an information generation module, configured to generate performance data information of the code to be processed based on the first code content and the first performance detection data, wherein the performance data information associates and records the line content of at least some code lines in the first code content and the performance data of the at least some code lines;

[0147] A suggestion generation module is used to use a large language model to perform performance analysis on the code to be processed based on the first code content and the performance data information, and generate code optimization suggestions for the code to be processed, wherein the code optimization suggestions are used to optimize the code to be processed.

[0148] According to one or more embodiments of the present disclosure, Example 9 provides an electronic device, including:

[0149] one or more processors;

[0150] a memory for storing one or more programs,

[0151] When the one or more programs are executed by the one or more processors, the one or more processors implement the code processing method based on the large language model as described in any one of Examples 1-7.

[0152] According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the code processing method based on a large language model as described in any one of Examples 1-7.

[0153] According to one or more embodiments of the present disclosure, Example 11 provides a computer program product. When the computer program product is executed by a computer, the computer implements the code processing method based on the large language model as described in any one of Examples 1-7.

[0154] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0155] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0156] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A code processing method based on a large language model, characterized in that: include: Acquire first code content associated with the code to be processed, and acquire first performance detection data of the code to be processed; generating performance data information of the code to be processed based on the first code content and the first performance detection data, wherein the performance data information is associated with and records the line content of at least some code lines in the first code content and the performance data of the at least some code lines; A large language model is used to perform performance analysis on the code to be processed based on the first code content and the performance data information, and code optimization suggestions for the code to be processed are generated. The code optimization suggestions are used to optimize the code to be processed.

2. The method according to claim 1, characterized in that The using of the large language model to perform performance analysis on the code to be processed based on the first code content and the performance data information to generate code optimization suggestions for the code to be processed includes: generating prompt information corresponding to the code to be processed based on the first code content and the performance data information; The prompt information is input into a pre-trained large language model, and the large language model is used to perform performance analysis on the code to be processed based on the prompt information to generate code optimization suggestions for the code to be processed.

3. The method according to claim 1, characterized in that The obtaining of the first code content associated with the code to be processed includes: Determine the code to be processed in the preset function module, and obtain the code content to be processed associated with the code to be processed from the code file of the preset function module; Performing dependency analysis on the content of the code to be processed to generate a dependency tree of the code to be processed; Dependency code completion is performed on the code content to be processed according to the dependency tree to obtain first code content of the code to be processed.

4. The method according to claim 3, characterized in that The performing dependency analysis on the content of the code to be processed to generate a dependency tree of the code to be processed includes: Constructing a syntax tree of the code to be processed according to the content of the code to be processed; The syntax elements on which the code to be processed depends are obtained from the dependency files of the code file, and the syntax elements are added to the syntax tree to obtain the dependency tree of the code to be processed.

5. The method according to claim 1, wherein The obtaining of first performance detection data of the code to be processed includes: Performing a performance test on a preset functional module to obtain second performance test data of the preset functional module, wherein the preset functional module corresponds to the code to be processed, and the second performance test data includes a plurality of performance test data entries, each of the performance test data entries including a code line identifier and performance data corresponding to the code line identifier; A performance detection data entry associated with the code to be processed is obtained from the second performance detection data as first performance detection data of the code to be processed.

6. The method according to claim 5, characterized in that The generating the performance data information of the code to be processed according to the first code content and the first performance detection data includes: For each performance test data entry in the first performance test data, obtaining, from the first code content, a line content corresponding to a code line identifier in the performance test data entry; The performance data corresponding to the code line identifier and the line content corresponding to the code line identifier are associated and recorded in the performance data information of the code to be processed.

7. The method according to any one of claims 1 to 6, characterized in that: After generating the code optimization suggestion for the code to be processed, the method further includes at least one of the following: Display the code optimization suggestions; Generating an optimization suggestion report for the code to be processed based on the code optimization suggestion; The code to be processed is optimized based on the code optimization suggestion.

8. A code processing device based on a large language model, characterized in that: include: A data acquisition module, configured to acquire first code content associated with the code to be processed, and acquire first performance detection data of the code to be processed; an information generation module, configured to generate performance data information of the code to be processed based on the first code content and the first performance detection data, wherein the performance data information associates and records the line content of at least some code lines in the first code content and the performance data of the at least some code lines; A suggestion generation module is used to use a large language model to perform performance analysis on the code to be processed based on the first code content and the performance data information, and generate code optimization suggestions for the code to be processed, wherein the code optimization suggestions are used to optimize the code to be processed.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the code processing method based on a large language model according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the code processing method based on a large language model according to any one of claims 1 to 7 when executed.

11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the code processing method based on a large language model according to any one of claims 1 to 7.