Code interpretation method and device, equipment, medium and product
By generating a call relationship network and combining code interpretation large models, the problem that existing tools cannot understand the code structure globally is solved, comprehensive code understanding and business insights are achieved, and developers' code reading and maintenance efficiency is improved.
Patent Information
- Application Number
- CN202510654849.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-08-26
AI Technical Summary
Existing code interpretation tools lack global awareness of the entire project structure, which makes it difficult for developers to understand the overall logic of the business and the call relationship between modules when reading large or complex code projects, increasing the cognitive cost of system maintenance and iteration.
By generating a call relationship network with methods as nodes, and combining code explanations, it provides code semantic explanations, helping users to grasp the dependence and call relationships between various business modules from a global perspective and understand the specific implementation logic of each business module.
It realizes comprehensive code understanding and business insights from macro structure to micro details, greatly improving users' understanding of code, and supports programmers, testers, architects and product personnel's ability to read, understand and maintain complex system code.
Smart Images

Figure CN120540702A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of program development technology, and in particular to a code interpretation method, device, equipment, medium and product. Background Art
[0002] Code interpretation tools are software or services that help developers understand code logic, structure, and implementation details (such as Alitong Yiling Code). These tools can greatly improve development efficiency, especially when developers are dealing with complex or unfamiliar code.
[0003] Current mainstream code interpretation tools are limited by their capabilities, typically only providing shallow interpretations based on local code snippets and lacking a holistic understanding of the entire project structure. This limitation makes it difficult for developers to quickly understand the overall business logic and inter-module call relationships when working with large or complex code projects, increasing the cognitive overhead of system maintenance and iteration. This has become a technical pain point that urgently needs to be addressed in real-world development scenarios, particularly for multi-person collaboration, large legacy systems, and new employee code integration. Summary of the Invention
[0004] The present invention provides a code interpretation method, apparatus, device, medium and product to improve the user's understanding of the code.
[0005] According to one aspect of the present invention, a code interpretation method is provided, comprising:
[0006] Based on the calling relationships between methods in the code, a calling relationship network with methods as nodes is generated;
[0007] Displaying the call relationship network to the user;
[0008] In response to a user's selection operation on a method in the call relationship network, a code semantic interpretation of the selected method is generated through a code interpretation model.
[0009] According to another aspect of the present invention, there is provided a code interpretation device, comprising:
[0010] A generation module is used to generate a call relationship network with methods as nodes based on the call relationship between methods in the code;
[0011] A display module, used to display the call relationship network to the user;
[0012] The interpretation module is used to generate a code semantic interpretation of the selected method through a code interpretation model in response to a user's selection operation on a method in the call relationship network.
[0013] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the code interpretation method according to any embodiment of the present invention.
[0014] According to another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable 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 interpretation method described in any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the code interpretation method described in any embodiment of the present invention when executed.
[0016] The embodiments of this invention combine a call relationship network with a large code interpretation model, allowing users to not only understand the dependencies and call relationships between business modules from a global perspective, but also understand the specific implementation logic behind each business module. This enables comprehensive code understanding and business insights from macroscopic structure to microscopic details, significantly improving users' understanding of the code. This capability is of great support value to programmers, testers, architects, and product personnel in reading, understanding, and maintaining complex system code.
[0017] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1A is a flowchart of a code interpretation method provided according to an embodiment of the present invention;
[0020] Figure 1B is a schematic diagram of a call relationship network provided according to an embodiment of the present invention;
[0021] Figure 2A is a flowchart of a code interpretation method provided according to another embodiment of the present invention;
[0022] Figure 2B is a schematic diagram of a call relationship analysis logic provided according to another embodiment of the present invention;
[0023] Figure 3 is a structural diagram of a code interpretation device provided according to another embodiment of the present invention;
[0024] Figure 4 It is a schematic structural diagram of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first," "second," and the like in the present invention are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatuses.
[0027] Figure 1A This is a flowchart of a code interpretation method provided by an embodiment of the present invention. This embodiment is applicable to the case where a user installs a code interpretation plug-in in a software development tool and uses the call relationship analysis function and code interpretation function provided by the code interpretation plug-in to understand the code. The method can be executed by a code interpretation device, which can be implemented in the form of hardware and / or software. The device can be configured in an electronic device with corresponding data processing capabilities, such as a personal computer used by the user. Figure 1A As shown, the method includes:
[0028] S110 : Generate a call relationship network with methods as nodes based on the call relationship between methods in the code.
[0029] S120: Display the call relationship network to the user.
[0030] S130 : In response to a user selecting a method in the call relationship network, a code semantic interpretation of the selected method is generated by a code interpretation model.
[0031] The code interpretation model can be integrated into a code interpretation plug-in to perform semantic analysis of code, generate a popular and structured interpretation of the code's semantics, and achieve natural language translation of the code's intent. A code interpretation plug-in is developed in a specific programming language (such as Java) and integrated into the code writing software. The code to be interpreted is the code in a project developed in that specific programming language (such as Java). The code interpretation model is derived by fine-tuning an open-source basic model using specific training data. Classes and methods are closely related in object-oriented programming. Simply put, a class is a blueprint or template for creating an object, while a method is a function defined within a class that describes the object's behavior or functionality. Depending on the object they act on, methods can be divided into the following types: instance methods, class methods, and static methods. Instance methods can call other instance methods, class methods, and static methods. Class methods can call other class methods and static methods. Static methods can only call other static methods. In object-oriented programming, the design of classes and methods is usually closely related to business needs. By encapsulating business logic in class methods, the modularity, maintainability, and scalability of the code can be achieved. That is, each method in the code and each node in the call relationship network can correspond to an actual business module.
[0032] Specifically, the user activates the plug-in, which combs through the code for the business being analyzed, identifying the methods (and classes) within the code and the call relationships between these methods. Based on these call relationships, the plug-in draws a call relationship network with methods as nodes. In this network, each node represents a method, and the call relationships between methods are indicated by directed arrows between the corresponding nodes.
[0033] The plug-in displays the drawn call relationship network to the user. Through the call relationship network, the user can quickly and accurately grasp the dependencies and call relationships between various business modules from a global perspective.
[0034] The user can select a method in the call relationship network. In response to the user's selection, the plug-in calls the code interpretation model to analyze the source code of the method, obtains the code semantic interpretation of the selected method, and displays it to the user so that the user can understand the specific implementation logic of the method.
[0035] The embodiments of this invention combine a call relationship network with a large code interpretation model, allowing users to not only understand the dependencies and call relationships between business modules from a global perspective, but also understand the specific implementation logic behind each business module. This enables comprehensive code understanding and business insights from macroscopic structure to microscopic details, significantly improving users' understanding of the code. This capability is of great support value to programmers, testers, architects, and product personnel in reading, understanding, and maintaining complex system code.
[0036] Based on the above embodiment, optionally, the call relationship network further includes business meanings of methods annotated on the call relationship network in the form of node metadata, and the business meanings are obtained by extracting reserved annotations of the methods.
[0037] Specifically, we leverage reflection to retrieve annotations reserved by code authors on methods. These annotations typically express the business meaning of the method. When constructing method nodes, we attach these annotations as metadata to enhance the semantic expression and visualization value of the call relationship network.
[0038] For example, Figure 1B As shown in the figure, each node in the call relationship network can be associated with a predefined custom annotation, thereby extracting and presenting the business meaning of the method. Furthermore, combined with the plug-in's integrated code interpretation model, it supports source code parsing of any method node, automatically generating a semantic interpretation of the method's implementation.
[0039] Figure 2A This is a flowchart of a code interpretation method provided by another embodiment of the present invention. This embodiment is optimized and improved on the basis of the above embodiment. Figure 2A As shown, the method includes:
[0040] S210. Determine the calling relationship between classes according to the dependency injection annotations in the code.
[0041] S220: Determine the calling relationship between methods according to the segmentation symbols and instance method calling statements in the code.
[0042] S230 : Generate a call relationship network with methods as nodes according to the call relationships between classes and the call relationships between methods.
[0043] Specifically, after the project starts, a business postprocessor is built to obtain all beans in the Spring container at project startup. All beans are traversed and, through reflection, all called classes in the code and their corresponding dependency injection annotations (such as the @Autowired annotation and the @Resource annotation). These dependency injection annotations are analyzed to determine the calling relationships between classes. For each class, the calling relationships between methods in the class are determined based on the code segmentation symbols and instance method call statements. Based on the calling relationships between methods and between classes, a calling relationship network is drawn with methods as nodes.
[0044] It should be noted that when drawing a call relationship network, you can either draw it all at once after determining all call relationships, or you can draw it while determining the call relationships. For example, after completing the drawing of the call relationship network for methods in a single class, you can then draw the call relationship network for methods in other classes. Perform method-level parsing and call relationship identification on all target classes in the project. First, recursively parse each target class to form a tree-like call relationship network. During the method parsing process, if you encounter a parsed call relationship network, you can directly add it to the current call relationship network. By recursively constructing call nodes between methods, the call relationships between each class are unified into a complete, directed call relationship network.
[0045] Based on the above embodiment, optionally, determining the calling relationship between methods according to the segmentation symbols and instance method calling statements in the code includes:
[0046] Searching for segmentation symbols in the code, and segmenting the code according to the segmentation symbols to obtain method source code of the method;
[0047] Search for instance method call statements in the method source code, and determine the calling relationship between methods based on the found instance method call statements.
[0048] Specifically, methods within a class are typically structured within curly braces ({}), with statements separated by semicolons (;). Based on this syntax, the curly braces are used as delimiters, and the code within the delimiters is segmented into the complete code for a method, thus obtaining the source code for each method in the class. The method source code is segmented by semicolons to extract the complete sequence of execution statements for the method.
[0049] Method calls are typically expressed as "object instance.method name()." Based on this characteristic, the method source code is further parsed to identify instance method call statements within the method source code. Based on these instance method call statements, the other methods called by each method are determined. By summarizing the other methods called by each method, the calling relationships between all methods in the class can be obtained.
[0050] For example, Figure 2B As shown, there is an instance method call statement "called class.method2()" in the method source code of method 1. By analyzing the instance method call statement, it can be determined that method 1 of class 1 calls method 2 of class 2. Figure 1B As shown, when drawing the call relationship network, method 1 and method 2 are both taken as a node, and directed arrows are used to indicate that method 1 calls method 2.
[0051] S240: Display the call relationship network to the user; in response to the user selecting a method in the call relationship network, extract the method source code corresponding to the selected method.
[0052] S250. Input the method source code into a code interpretation macromodel to obtain a code semantic interpretation generated by the code interpretation macromodel.
[0053] Specifically, an open source basic large model is selected as the underlying model architecture, and high-quality "code snippet-semantic explanation" paired samples are constructed as training data. The sources of training data include: manually annotated samples: writing standard annotations to ensure semantic accuracy; machine-assisted samples: using existing language models to generate preliminary annotation content, which is then manually reviewed and optimized to form high-quality samples.
[0054] Based on the constructed training data, the Low-Rank Adaptation (LoRA) algorithm from the Parameter-Efficient Fine-Tuning (PEFT) method is used to perform targeted fine-tuning on the base model. This targeted fine-tuning process adjusts only the insertion layer parameters of the base model to reduce training costs and improve business adaptability. The fine-tuned base model is then designated as the code interpretation model.
[0055] When the code interpretation model is needed to work, the plug-in extracts the method source code of the selected method and inputs it and the prompt template into the code interpretation model to obtain the code semantic interpretation output by the code interpretation model.
[0056] Based on the above embodiment, optionally, the content input into the code interpretation model further includes a preset prompt template, and the preset prompt template includes a functional description and key behaviors of the method.
[0057] Specifically, a prompt generally refers to a mechanism designed to guide a large model (such as a language model) to generate output of a specific type or that meets specific requirements when using it. This mechanism is primarily implemented by inputting a "prompt" into the model. This prompt can be a question, an instruction, or a partial input required to complete a task. In practical applications, effective prompt design is crucial. A good prompt not only improves the quality of the model's output but also increases the relevance and accuracy of the results. For example, when generating text, specific prompts can help the model understand the style and topic of the content the user wishes to generate; in question-answering systems, clear and accurate prompts help obtain more precise answers. In this invention, to prevent the code interpretation large model from over-association and outputting meaningless semantic explanations, a structured prompt template is designed to guide the code interpretation large model to generate output that is business-readable. The template structure includes a method's functional description (a summary of the method's overall responsibilities) and key behaviors (the core logic and processing flow of the method's execution). This requires that the code semantic explanation output by the code interpretation large model must include the functional description and key behaviors of the selected method to improve the readability of the code semantic explanation.
[0058] The embodiment of the present invention analyzes the corresponding calling relationship through specific information in the code, thereby improving the credibility of the analyzed calling relationship.
[0059] Figure 3 A schematic diagram of the structure of a code interpretation device provided by another embodiment of the present invention. Figure 3 As shown, the device includes:
[0060] A generating module 310 is used to generate a calling relationship network with methods as nodes according to the calling relationship between methods in the code;
[0061] A display module 320 is used to display the call relationship network to the user;
[0062] The interpretation module 330 is configured to generate a code semantic interpretation of the selected method through a code interpretation model in response to a user selecting a method in the call relationship network.
[0063] The code interpretation device provided in the embodiment of the present invention can execute the code interpretation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0064] Optionally, the generating module 310 includes:
[0065] A first determining unit is used to determine the calling relationship between classes according to the dependency injection annotation in the code;
[0066] A second determining unit is used to determine the calling relationship between methods according to the segmentation symbols and instance method calling statements in the code;
[0067] The third determining unit is configured to generate a calling relationship network with methods as nodes according to the calling relationships between classes and the calling relationships between methods.
[0068] Optionally, the second determining unit is specifically configured to: search for segmentation symbols in the code, and segment the code according to the segmentation symbols to obtain a method source code of the method;
[0069] Search for instance method call statements in the method source code, and determine the calling relationship between methods based on the found instance method call statements.
[0070] Optionally, the call relationship network further includes business meanings of methods annotated on the call relationship network in the form of node metadata, and the business meanings are obtained by extracting reserved annotations of the methods.
[0071] Optionally, the interpretation module 330 includes:
[0072] an extraction unit, configured to extract a method source code corresponding to the selected method in response to a user selecting a method in the call relationship network;
[0073] An input unit is used to input the method source code into a code interpretation model to obtain a code semantic interpretation generated by the code interpretation model.
[0074] Optionally, the content input into the code interpretation model also includes a preset prompt template, and the preset prompt template includes a functional description and key behaviors of the method.
[0075] The code interpretation device further described can also execute the code interpretation method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0076] Figure 4 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device 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 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, 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 examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0077] like Figure 4 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., which is communicatively connected to the at least one processor 41. The memory stores a computer program that can be executed by the at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 into the random access memory (RAM) 43. Various programs and data required for the operation of the electronic device 40 can also be stored in the RAM 43. The processor 41, ROM 42, and RAM 43 are connected to each other via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0078] Multiple components in the electronic device 40 are connected to the I / O interface 45, including an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a magnetic disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0079] Processor 41 may be any general-purpose and / or specialized processing component with processing and computing capabilities. Examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors for running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 executes the various methods and processes described above, such as the code interpretation method.
[0080] In some embodiments, the code interpretation method can be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the code interpretation method described above can be performed. Alternatively, in other embodiments, the processor 41 can be configured to perform the code interpretation method in any other appropriate manner (e.g., by means of firmware).
[0081] Various embodiments of the systems and techniques described 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), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0082] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0083] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0084] 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 can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the 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 acoustic input, voice input, or tactile input).
[0085] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by 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), a blockchain network, and the Internet.
[0086] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0087] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0088] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A code interpretation method, characterized in that: The method comprises: Based on the calling relationships between methods in the code, a calling relationship network with methods as nodes is generated; Displaying the call relationship network to the user; In response to a user's selection operation on a method in the call relationship network, a code semantic interpretation of the selected method is generated through a code interpretation model.
2. The method according to claim 1, characterized in that Generating a call relationship network with methods as nodes according to the call relationship between methods in the code includes: Determine the calling relationship between classes based on dependency injection annotations in the code; Determine the calling relationship between methods based on the segmentation symbols and instance method call statements in the code; A calling relationship network with methods as nodes is generated based on the calling relationships between classes and the calling relationships between methods.
3. The method according to claim 2, characterized in that Determining the calling relationship between methods based on the segmentation symbols and instance method calling statements in the code includes: Searching for segmentation symbols in the code, and segmenting the code according to the segmentation symbols to obtain method source code of the method; Search for instance method call statements in the method source code, and determine the calling relationship between methods based on the instance method call statements found.
4. The method according to any one of claims 1 to 3, characterized in that: The call relationship network also includes business meanings of methods annotated on the call relationship network in the form of node metadata, and the business meanings are obtained by extracting reserved annotations of the methods.
5. The method according to claim 1, characterized in that In response to the user selecting a method in the call relationship network, generating a code semantic interpretation of the selected method by using the code interpretation model includes: In response to a user selecting a method in the call relationship network, extracting a method source code corresponding to the selected method; The method source code is input into the code interpretation macro model to obtain the code semantic interpretation generated by the code interpretation macro model.
6. The method according to claim 5, wherein the content input into the code interpretation model further comprises a preset prompt template, wherein the preset prompt template comprises a functional description and key behaviors of the method.
7. A code interpretation device, characterized in that: The device comprises: A generation module is used to generate a call relationship network with methods as nodes based on the call relationship between methods in the code; A display module, used to display the call relationship network to the user; The interpretation module is used to generate a code semantic interpretation of the selected method through a code interpretation model in response to a user's selection operation on a method in the call relationship network.
8. An electronic device, characterized in that: The electronic device comprises: 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 is executed by the at least one processor to enable the at least one processor to perform the code interpretation method according to any one of claims 1 to 6.
9. 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 interpretation method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the code interpretation method according to any one of claims 1 to 6 when executed by a processor.