Code performance risk analysis method and device, electronic equipment and storage medium

By generating code context, performance, requirement, and historical reference prompts, and utilizing a large language model to identify risks associated with code changes, the problem of low efficiency in code performance risk analysis is solved, achieving automated and efficient risk assessment.

CN121743162APending Publication Date: 2026-03-27INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies are inefficient in code performance risk analysis and cannot effectively assess the performance risks caused by code changes.

Method used

By acquiring modified code and code topology maps, we determine the correlation information of changes, query performance information and R&D knowledge base, generate code context, performance, requirement and historical reference prompts, and input them into a large language model for risk identification.

Benefits of technology

It has enabled automated code performance risk analysis, which has improved the efficiency of risk analysis, reduced labor costs, and enhanced the comprehensiveness and accuracy of risk identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121743162A_ABST
    Figure CN121743162A_ABST
Patent Text Reader

Abstract

The invention discloses a code performance risk analysis method and device, electronic equipment and a storage medium, and relates to the technical field of data processing.The code performance risk analysis method comprises the steps that when it is detected that a code changes, a change code is obtained, and change associated information is determined according to the change code and a code topological graph, determining a code context cue word according to the change associated information; querying performance information according to the change associated information, and determining a performance cue word according to the performance information; determining a demand cue word according to the change code and a research and development knowledge base; determining historical reference prompt words according to the historical performance related data; and inputting the code context cue word, the performance cue word, the demand cue word and the historical reference cue word into a large language model for risk identification, wherein the output of the large language model is a risk analysis result of code change. The performance risk caused by code change is automatically analyzed, and the performance risk analysis efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to methods, apparatus, electronic devices, and storage media for code performance risk analysis. Background Technology

[0002] The complexity of application software systems is increasing as business scenarios converge and compete. The stability of deployment architectures faces new challenges with the evolution of distributed architectures.

[0003] For each version of an application software system, architects and experts need to conduct performance risk assessments and analyses based on their experience. Improving the efficiency of code performance risk analysis has become an urgent problem to be solved. Summary of the Invention

[0004] This invention provides a method, apparatus, electronic device, and storage medium for code performance risk analysis to solve the problem of low efficiency in current code performance risk analysis.

[0005] According to one aspect of the present invention, a code performance risk analysis method is provided, comprising:

[0006] When a code change is detected, the changed code is obtained, the change association information is determined based on the changed code and the code topology map, and the code context prompt words are determined based on the change association words;

[0007] Query performance information based on the change-related information, and determine performance prompt words based on the performance information;

[0008] Determine the requirement prompt words based on the aforementioned change codes and the R&D knowledge base;

[0009] Historical reference keywords are determined based on historical performance data.

[0010] The code context hints, performance hints, requirement hints, and historical reference hints are input into a large language model for risk identification. The output of the large language model is the risk analysis result of code changes.

[0011] According to another aspect of the present invention, a code performance risk analysis apparatus is provided, comprising:

[0012] The context prompt word determination module is used to obtain the changed code when a code change is detected, determine the change association information based on the changed code and the code topology map, and determine the code context prompt word based on the change association.

[0013] The performance prompt word determination module is used to query performance information based on the change association information and determine performance prompt words based on the performance information.

[0014] The requirement prompt word determination module is used to determine requirement prompt words based on the modified code and the R&D knowledge base;

[0015] The historical reference keyword determination module is used to determine historical reference keywords based on historical performance data.

[0016] The risk identification module is used to input the code context hints, performance hints, requirement hints and historical reference hints into the large language model for risk identification. The output of the large language model is the risk analysis result of code changes.

[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0018] At least one processor; and

[0019] A memory communicatively connected to the at least one processor; wherein,

[0020] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the code performance risk analysis method according to any embodiment of the present invention.

[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the code performance risk analysis method according to any embodiment of the present invention.

[0022] The technical solution of this invention involves acquiring the changed code when a code change is detected, determining change-related information based on the changed code and a code topology map, and determining code context hints based on the change-related information. Performance information is then queried based on the change-related information, and performance hints are determined based on the performance information. Requirement hints are determined based on the changed code and a development knowledge base. Historical reference hints are determined based on historical performance-related data. The code context hints, performance hints, requirement hints, and historical reference hints are input into a large language model for risk identification, and the output of the large language model is the risk analysis result of the code change. Compared to the current method of manually analyzing performance risks caused by code changes, which is inefficient, the technical solution provided by this invention can generate code context hints, performance hints, requirement hints, and historical reference hints based on the changed code, and then input these hints into a large language model for risk identification, thereby automating the analysis of performance risks caused by code changes and improving the efficiency of performance risk analysis.

[0023] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a flowchart illustrating a code performance risk analysis method provided in an embodiment of the present invention;

[0026] Figure 2 This is a code performance risk identification architecture diagram provided by an embodiment of the present invention;

[0027] Figure 3 This is a flowchart illustrating another code performance risk analysis method provided in an embodiment of the present invention;

[0028] Figure 4 This is a schematic diagram of the structure of a code performance risk analysis device provided in an embodiment of the present invention;

[0029] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the code performance risk analysis method of this invention. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] The information collected in this invention embodiment is information and data authorized by the user or fully authorized by all parties. The collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, and necessary confidentiality measures have been taken. This does not violate public order and good morals, and corresponding operation entry points are provided for users to choose to authorize or refuse. Users are provided with corresponding operation entry points to choose to agree to or refuse the automated decision-making results; if the user chooses to refuse, the process enters the expert decision-making process to avoid relevant legal and public opinion risks.

[0033] The inventors discovered that the complexity of application software systems is increasing with the convergence and competition of multiple business scenarios. The stability of deployment architectures faces new challenges as distributed architectures evolve. For each version of an application software system, architects and experts need to conduct performance risk assessments and analyses based on their experience. Improving the efficiency of code performance risk analysis has become an urgent problem to be solved.

[0034] Figure 1 This is a flowchart illustrating a code performance risk analysis method provided in an embodiment of the present invention. Figure 2 This is a diagram illustrating the code performance risk identification architecture provided in this embodiment of the invention. This embodiment is applicable to situations involving the analysis of performance risks caused by code changes. This method can be executed by a code performance risk analysis device, which can be implemented in hardware and / or software and can be configured in electronic devices such as personal computers and servers. Figure 1 As shown, it includes:

[0035] S110. When a code change is detected, obtain the changed code, determine the change association information based on the changed code and the code topology map, and determine the code context prompt words based on the change association information.

[0036] Optionally, when a code change is detected, the changed code can be retrieved, which can be implemented as follows:

[0037] The code version control tool monitors for updates to code files; if an update is detected, the changed code is determined based on the type of the code file and its corresponding code location method.

[0038] Code version control tools can be distributed version control systems (Git). They can collect version changes within the version control tool, analyze all changed code and its versions, and then locate the code lineage node where the changes occurred. They can collect incremental Git code changes, analyzing the code before the change, the code after the change, the code removed after the change, and the code added after the change. They can analyze the branches of the changed code, and analyze the associated requirements and tasks managed in development project management software through commit information. Code file types include Java files, mapper files, pom files, or SQL files. If the code file is a Java file, it locates the method to which the changed code belongs. If the code file is a mapper file (SQL configuration in XML format for MyBatis), it locates the XML tags of the method to which the changed code belongs. If the code file is a pom file, it locates the dependency versions to which the change belongs. If the code file is a SQL file, it locates the table, database, and function where the change is defined.

[0039] The above implementation method can extract modified code in a targeted manner according to different code file types, thereby improving the accuracy of modified code extraction.

[0040] Optionally, before determining the change association information based on the change code and code topology map, the method further includes:

[0041] The static call relationships of the entire code are obtained using abstract syntax tree technology; the dynamic call relationships are determined based on the actual call relationships executed during runtime of the entire code; and the code topology graph is determined based on the static call relationships and the dynamic call relationships.

[0042] By using Abstract Syntax Tree (AST) technology to perform static analysis of the entire version control repository, the method call relationships in the static code are obtained. The data volume of the production table can be queried using data volume queries. Index queries reveal the indexes and primary key constraints of the production table. Field queries reveal the field types of the production table. This generates static call relationships. Through cross-version control repository fusion, the method call relationships across the entire application are formed and stored in a graph database. Bytecode technology is used to intercept and collect the interface-method, method-prevention, method-SQL, SQL-table, and method-interface relationships during actual application runtime, forming dynamic call relationships, which are also stored in the graph database. Using edge relationship traversal in the graph database, with a strategy of primarily dynamic links and secondarily static links, dynamic and static relationships are mixed and associated to obtain a code topology graph.

[0043] The above implementation can generate static and dynamic call relationships based on the full code of the application software system. Combining static and dynamic call relationships to generate a code topology graph improves the reliability of the code topology graph.

[0044] S120. Query performance information based on the change association information, and determine performance prompt words based on the performance information.

[0045] Optionally, querying performance information based on the change-related information and determining performance suggestion words based on the performance information can be implemented as follows:

[0046] The interface information associated with the modified code is determined based on the modified association information; performance information is queried based on the interface information; and performance tips are generated based on the performance information and the interface information.

[0047] It can collect performance information such as production TPS, concurrency, and average response time for RPC and HTTP interfaces of application services. Performance information can be queried through interface information.

[0048] The above implementation method can obtain the performance tips that the changed code wants to see through querying, thereby improving the accuracy of the performance tips.

[0049] S130. Determine the requirement prompt words based on the change code and the R&D knowledge base.

[0050] Optionally, the requirement prompt words can be determined based on the change code and the R&D knowledge base, which can be implemented as follows:

[0051] The R&D knowledge base includes requirement files corresponding to the code files, submission information specifications, development tasks, code testing association information, and interface documentation. By matching the modified code with the R&D knowledge base, the requirement information, code submission specification information, development task information, code testing association information, and interface information associated with the modified code are determined. Requirement prompts are then determined based on the requirement information, code submission specification information, development task information, code testing association information, and interface information.

[0052] The requirements document is used to link the design of the requirements document containing the development tasks. The commit message specification records that a development task identifier or a bug fix number is attached when development code is committed. Development tasks include maintaining a development task description, used to bridge commit messages and requirements. Code testing-related information includes: if a tester reports a functional issue, developers typically need to attach a bug fix number to the commit message to fix the issue, used to bridge commit messages and requirements. Interface documentation is used to provide a query function for existing interface documentation.

[0053] The above implementation method can determine the requirement information, code submission specification information, development task information, code testing association information, and interface information associated with the modified code by matching the modified code with a research and development knowledge base containing various data, thereby generating requirement prompt words and improving the accuracy of requirement prompt words.

[0054] S140. Determine historical reference prompts based on historical performance data.

[0055] Optionally, historical reference keywords can be determined based on historical performance data, including:

[0056] The historical performance-related data includes historical performance issue codes, historical performance issue requirements, and industry performance issue codes; historical reference prompts are determined based on the historical performance-related data and expert annotation information, and these historical reference prompts are used to indicate the causes of historical performance issues and their corresponding codes.

[0057] By integrating data, we can obtain historical performance issues and their corresponding code before and after the fixes. Through model screening, manual secondary annotation, and other methods, we can generate expert warning words for performance risks.

[0058] The above implementation method can improve the accuracy of historical reference prompts by generating them based on expert-annotated historical reference prompts.

[0059] S150. Input the code context hints, performance hints, requirement hints and historical reference hints into the large language model for risk identification. The output of the large language model is the risk analysis result of code changes.

[0060] Optionally, the code context hints, performance hints, requirement hints, and historical reference hints are input into a large language model for risk identification. The output of the large language model is the risk analysis result of code changes, which can be implemented as follows:

[0061] The input data is determined based on the code context prompts, performance prompts, requirement prompts, historical reference prompts, and problem description prompts, and then input into the large language model.

[0062] The risk analysis results output by the large language model include: risk propagation chain, database risk, code risk, configuration risk, or scale risk analysis results.

[0063] When a risk change is detected in the development code, the relevant requirement design is identified, and the lineage is traced. Through the lineage, data such as production interface call volume, production table metadata, and existing interface documentation are further obtained to obtain code context hints, performance hints, requirement hints, and historical reference hints.

[0064] Optionally, when the same change method has been changed multiple times in the current version and risks have already been detected, when scanning for new changes, it is necessary to use the new changed code to backtrack whether the existing risks have been fixed, thereby improving the accuracy of problem detection.

[0065] The input data for the large language model is obtained by combining code context hints, performance hints, requirement hints, and historical reference hints with problem description hints. After the input data is input into the large language model, the model analyzes the context hints, performance hints, requirement hints, and historical reference hints based on the problem description hints, generating risk propagation chain, database risk, code risk, configuration risk, or scale risk analysis results.

[0066] The above implementation method can obtain analysis results of risk propagation chain, database risk, code risk, configuration risk or scale risk through large language models, thereby conducting a more comprehensive analysis of code performance risks and improving the reliability of risk analysis.

[0067] The code performance risk analysis method provided in this invention involves: acquiring the changed code when a code change is detected; determining change-related information based on the changed code and a code topology map; determining code context hints based on the change-related information; querying performance information based on the change-related information; determining performance hints based on the performance information; determining requirement hints based on the changed code and a development knowledge base; determining historical reference hints based on historical performance-related data; and inputting the code context hints, performance hints, requirement hints, and historical reference hints into a large language model for risk identification. The output of the large language model is the risk analysis result of the code change. Compared to the current method of manually analyzing performance risks caused by code changes, which is inefficient, the code performance risk analysis method provided in this invention can generate code context hints, performance hints, requirement hints, and historical reference hints based on the changed code, and then input these hints into a large language model for risk identification, thereby automating the analysis of performance risks caused by code changes and improving the efficiency of performance risk analysis.

[0068] Figure 3 The flowchart illustrates the code performance risk analysis method provided in this embodiment of the invention. As a further explanation of the above implementation, the method includes:

[0069] S201. Obtain the static call relationships of the entire code using abstract syntax tree technology; determine the dynamic call relationships based on the actual call relationships executed during runtime of the entire code; and determine the code topology graph based on the static call relationships and the dynamic call relationships.

[0070] S202. Monitor code file updates using code version control tools; if a code file update is detected, determine the changed code based on the type of the code file and its corresponding code location method.

[0071] S203. Determine the change association information based on the change code and code topology map, and determine the code context prompt words based on the change association information.

[0072] S204. Determine the interface information associated with the changed code based on the change association information; query the performance information based on the interface information; generate performance prompt words based on the performance information and the interface information.

[0073] S205. Match the modified code with the R&D knowledge base to determine the requirement information, code submission specification information, development task information, code testing association information, and interface information associated with the modified code; determine the requirement prompt words based on the requirement information, code submission specification information, development task information, code testing association information, and interface information.

[0074] The R&D knowledge base includes requirement documents corresponding to code files, submission information specifications, development tasks, code testing information, and interface documentation.

[0075] S206. Determine historical reference prompts based on historical performance data and expert annotation information. The historical reference prompts are used to indicate the causes of historical performance problems and the corresponding codes.

[0076] Among them, historical performance-related data includes historical performance issue codes, historical performance issue requirements, and industry performance issue codes;

[0077] S207. Determine the input data based on the code context prompts, performance prompts, requirement prompts, historical reference prompts, and problem description prompts, and input the input data into the large language model.

[0078] The risk analysis results output by the large language model include: analysis results of risk propagation chain, database risk, code risk, configuration risk, or scale risk.

[0079] The code performance risk analysis method provided in this invention automatically monitors and collects changes to code in each version, locates the method containing the changed lines, parses the static code syntax tree, and collects the dynamic code call chain to perceive the upstream and downstream impact of the changed method. It traces the production status and requirement design of upstream and downstream relationship nodes to provide the model with a full-dimensional knowledge topology view of the changed method. Expert prompts are designed, and a large model is used to detect risks, reducing the manpower cost of performance risk identification and test design, improving the comprehensiveness and accuracy of performance risk identification, enabling intelligent generation and dynamic adaptation of performance test cases, and building a reusable and scalable performance risk identification and testing system. It analyzes and solves the actual pain points of performance test risk identification and load testing design, and independently implements a solution addressing the current problems of high manpower costs, incomplete coverage, coarse impact assessment, inaccurate risk location, lack of automation, and lack of engineering feasibility. The code performance risk analysis method provided in this invention can automatically cover all changed code and configuration changes, systematically construct a multi-dimensional data association topology network, recall all nodes and backgrounds that are related to the changes, integrate actual production and existing assets, summarize historical performance issues into expert tips, and use the model to comprehensively interpret the code, thereby reducing the workload of architects and stress testing experts and reducing the risk of risk leakage.

[0080] Figure 4 This invention provides a schematic diagram of a code performance risk analysis device. This embodiment is applicable to situations where performance risks caused by code changes are analyzed, such as... Figure 4As shown, the device includes: a contextual prompt word determination module 31, a performance prompt word determination module 32, a demand prompt word determination module 33, a historical reference prompt word determination module 34, and a risk identification module 35.

[0081] The context prompt word determination module 31 is used to obtain the changed code when a code change is detected, determine the change association information based on the changed code and the code topology map, and determine the code context prompt word based on the change association information;

[0082] The performance prompt word determination module 32 is used to query performance information based on the change association information and determine performance prompt words based on the performance information.

[0083] The requirement prompt word determination module 33 is used to determine requirement prompt words based on the change code and the R&D knowledge base;

[0084] The historical reference prompt word determination module 34 is used to determine historical reference prompt words based on historical performance-related data.

[0085] The risk identification module 35 is used to input the code context prompts, performance prompts, requirement prompts and historical reference prompts into the large language model for risk identification. The output of the large language model is the risk analysis result of code changes.

[0086] Based on the above embodiments, optionally, a code topology graph construction module is also included, which is used to obtain the static call relationship of the entire code according to the abstract syntax tree technology before determining the change association information based on the changed code and the code topology graph;

[0087] The dynamic call relationship is determined based on the call relationship executed in the actual runtime of the full code.

[0088] The code topology graph is determined based on the static call relationships and the dynamic call relationships.

[0089] Based on the above embodiments, optionally, the context prompt word determination module 31 is used to obtain the changed code when a code change is detected, including:

[0090] Monitor code file updates using code version control tools;

[0091] If an update to a code file is detected, the changed code is determined based on the type of the code file and its corresponding code location method.

[0092] Based on the above embodiments, optionally, the performance prompt word determination module 32 is used for:

[0093] The interface information associated with the modified code is determined based on the modified association information;

[0094] Query performance information based on the interface information;

[0095] Performance tips are generated based on the performance information and the interface information.

[0096] Based on the above embodiments, optionally, the demand prompt word determination module 33 is used for:

[0097] The R&D knowledge base includes requirement documents corresponding to code files, submission information specifications, development tasks, code testing information, and interface documentation.

[0098] Based on the matching of the modified code with the R&D knowledge base, the required information, code submission specification information, development task information, code testing association information, and interface information associated with the modified code are determined;

[0099] Determine the requirement prompts based on the requirements information, code submission guidelines, development task information, code testing association information, and interface information.

[0100] Based on the above embodiments, optionally, the historical reference prompt word determination module 34 is used for:

[0101] The historical performance-related data includes historical performance issue codes, historical performance issue requirements, and industry performance issue codes.

[0102] Historical reference prompts are determined based on the historical performance data and expert annotation information. These historical reference prompts are used to indicate the causes of historical performance problems and the corresponding codes.

[0103] Based on the above embodiments, optionally, the risk identification module 35 is used for:

[0104] The input data is determined based on the code context prompts, performance prompts, requirement prompts, historical reference prompts, and problem description prompts, and then input into the large language model.

[0105] The risk analysis results output by the large language model include: risk propagation chain, database risk, code risk, configuration risk, or scale risk analysis results.

[0106] The code performance risk analysis device provided in this embodiment of the invention includes a context prompt word determination module 31, used to obtain the changed code when a code change is detected, determine change association information based on the changed code and a code topology map, and determine code context prompt words based on the change association information; a performance prompt word determination module 32, used to query performance information based on the change association information, and determine performance prompt words based on the performance information; a requirement prompt word determination module 33, used to determine requirement prompt words based on the changed code and a development knowledge base; a historical reference prompt word determination module 34, used to determine historical reference prompt words based on historical performance-related data; and a risk identification module 35, used to input the code context prompt words, the performance prompt words, the requirement prompt words, and the historical reference prompt words into a large language model for risk identification, wherein the output of the large language model is the risk analysis result of the code change. Compared to the current practice of manually analyzing performance risks caused by code changes, which is inefficient, the code performance risk analysis device provided in this embodiment of the invention can generate code context prompts, performance prompts, requirement prompts, and historical reference prompts based on the changed code. These prompts are then input into a large language model for risk identification, thereby automating the analysis of performance risks caused by code changes and improving the efficiency of performance risk analysis.

[0107] The code performance risk analysis device provided in this embodiment of the invention can execute the code performance risk analysis method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0108] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0109] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0110] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0111] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as code performance risk analysis methods.

[0112] In some embodiments, the code performance risk analysis method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the code performance risk analysis method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the code performance risk analysis method by any other suitable means (e.g., by means of firmware).

[0113] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0114] Computer programs used to implement the code performance risk analysis method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0115] The invention also provides a computer-readable storage medium storing computer instructions for causing a processor to execute a code performance risk analysis method, including:

[0116] When a code change is detected, the changed code is obtained, the change association information is determined based on the changed code and the code topology map, and the code context prompt words are determined based on the change association words;

[0117] Query performance information based on the change-related information, and determine performance prompt words based on the performance information;

[0118] Determine the requirement prompt words based on the aforementioned change codes and the R&D knowledge base;

[0119] Historical reference keywords are determined based on historical performance data.

[0120] The code context hints, performance hints, requirement hints, and historical reference hints are input into a large language model for risk identification. The output of the large language model is the risk analysis result of code changes.

[0121] Based on the above embodiments, optionally, before determining the change association information according to the changed code and code topology map, the method further includes:

[0122] Obtain the static call relationships of the entire code using abstract syntax tree technology;

[0123] The dynamic call relationship is determined based on the call relationship executed in the actual runtime of the full code.

[0124] The code topology graph is determined based on the static call relationships and the dynamic call relationships.

[0125] Based on the above embodiments, optionally, when a code change is detected, obtaining the changed code includes:

[0126] Monitor code file updates using code version control tools;

[0127] If an update to a code file is detected, the changed code is determined based on the type of the code file and its corresponding code location method.

[0128] Based on the above embodiments, optionally, performance information is queried according to the change association information, and performance prompt words are determined according to the performance information, including:

[0129] The interface information associated with the modified code is determined based on the modified association information;

[0130] Query performance information based on the interface information;

[0131] Performance tips are generated based on the performance information and the interface information.

[0132] Based on the above embodiments, optionally, the requirement prompt words are determined according to the modified code and the R&D knowledge base, including:

[0133] The R&D knowledge base includes requirement documents corresponding to code files, submission information specifications, development tasks, code testing information, and interface documentation.

[0134] Based on the matching of the modified code with the R&D knowledge base, the required information, code submission specification information, development task information, code testing association information, and interface information associated with the modified code are determined;

[0135] Determine the requirement prompts based on the requirements information, code submission guidelines, development task information, code testing association information, and interface information.

[0136] Based on the above embodiments, optionally, historical reference prompts can be determined according to historical performance-related data, including:

[0137] The historical performance-related data includes historical performance issue codes, historical performance issue requirements, and industry performance issue codes.

[0138] Historical reference prompts are determined based on the historical performance data and expert annotation information. These historical reference prompts are used to indicate the causes of historical performance problems and the corresponding codes.

[0139] Based on the above embodiments, optionally, the code context hints, performance hints, requirement hints, and historical reference hints are input into a large language model for risk identification. The output of the large language model is the risk analysis result of code changes, including:

[0140] The input data is determined based on the code context prompts, performance prompts, requirement prompts, historical reference prompts, and problem description prompts, and then input into the large language model.

[0141] The risk analysis results output by the large language model include: risk propagation chain, database risk, code risk, configuration risk, or scale risk analysis results.

[0142] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0143] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0144] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0145] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0146] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0147] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A code performance risk analysis method, characterized in that, include: When a code change is detected, the changed code is obtained, the change association information is determined based on the changed code and the code topology map, and the code context prompt words are determined based on the change association words; Query performance information based on the change-related information, and determine performance prompt words based on the performance information; Determine the requirement prompt words based on the aforementioned change codes and the R&D knowledge base; Historical reference keywords are determined based on historical performance data. The code context hints, performance hints, requirement hints, and historical reference hints are input into a large language model for risk identification. The output of the large language model is the risk analysis result of code changes.

2. The method according to claim 1, characterized in that, Before determining the change association information based on the changed code and code topology map, the process also includes: Obtain the static call relationships of the entire code using abstract syntax tree technology; The dynamic call relationship is determined based on the call relationship executed in the actual runtime of the full code. The code topology graph is determined based on the static call relationships and the dynamic call relationships.

3. The method according to claim 1, characterized in that, When code changes are detected, retrieve the changed code, including: Monitor code file updates using code version control tools; If an update to a code file is detected, the changed code is determined based on the type of the code file and its corresponding code location method.

4. The method according to claim 1, characterized in that, Query performance information based on the aforementioned change-related information, and determine performance tip words based on the performance information, including: The interface information associated with the modified code is determined based on the modified association information; Query performance information based on the interface information; Performance tips are generated based on the performance information and the interface information.

5. The method according to claim 1, characterized in that, Based on the aforementioned change codes and the R&D knowledge base, requirement prompts are determined, including: The R&D knowledge base includes requirement documents corresponding to code files, submission information specifications, development tasks, code testing information, and interface documentation. Based on the matching of the modified code with the R&D knowledge base, the required information, code submission specification information, development task information, code testing association information, and interface information associated with the modified code are determined; Determine the requirement prompts based on the requirements information, code submission guidelines, development task information, code testing association information, and interface information.

6. The method according to claim 1, characterized in that, Historical reference keywords are determined based on historical performance data, including: The historical performance-related data includes historical performance issue codes, historical performance issue requirements, and industry performance issue codes. Historical reference prompts are determined based on the historical performance data and expert annotation information. These historical reference prompts are used to indicate the causes of historical performance problems and the corresponding codes.

7. The method according to claim 1, characterized in that, The code context hints, performance hints, requirement hints, and historical reference hints are input into a large language model for risk identification. The output of the large language model is the risk analysis result of code changes, including: The input data is determined based on the code context prompts, performance prompts, requirement prompts, historical reference prompts, and problem description prompts, and then input into the large language model. The risk analysis results output by the large language model include: risk propagation chain, database risk, code risk, configuration risk, or scale risk analysis results.

8. A code performance risk analysis device, characterized in that, include: The context prompt word determination module is used to obtain the changed code when a code change is detected, determine the change association information based on the changed code and the code topology map, and determine the code context prompt word based on the change association. The performance prompt word determination module is used to query performance information based on the change association information and determine performance prompt words based on the performance information. The requirement prompt word determination module is used to determine requirement prompt words based on the modified code and the R&D knowledge base; The historical reference keyword determination module is used to determine historical reference keywords based on historical performance data. The risk identification module is used to input the code context hints, performance hints, requirement hints and historical reference hints into the large language model for risk identification. The output of the large language model is the risk analysis result of code changes.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and 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, the computer program being executed by the at least one processor to enable the at least one processor to perform the code performance risk analysis method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the code performance risk analysis method according to any one of claims 1-7.