Code node display method and device, equipment and medium
By constructing a code call relationship diagram and automatically determining the calling popularity of the code nodes, the problem of low efficiency and low accuracy of the code heat determination in the prior art is solved, and efficient and accurate display of the code nodes is achieved.
Patent Information
- Application Number
- CN202411790836.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, the determination of the enthusiasm for calling code is low and the accuracy is not high, and the reliance on artificial statistics leads to inefficiency.
By constructing a code call relationship diagram, in response to the calling operation of the code node, the code node with the calling relationship is automatically determined and called, and the code node is displayed in the code call relationship diagram according to the display parameters matching the current call heat value.
The automated display of code nodes is realized, which improves the efficiency and comprehensiveness of code node display, and improves the determination efficiency and accuracy of code popularity.
Smart Images

Figure CN119597340A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer application technology, and in particular to a method, device, equipment and medium for displaying a code node. Background Art
[0002] With the advancement of computer technology, various computer projects have become more and more diversified, and the amount of code has also increased dramatically. Therefore, effective management of code has become a need. Among them, analyzing the call popularity of code is a major technical means for effective code management.
[0003] In the related art, the called code in each code call event is analyzed, and the number of times the code is called is manually counted, and the call heat of the code is determined based on the number of calls. This method of manually determining the call heat of the code may lead to low efficiency in determining the code heat and low accuracy in determining the code heat. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, device, equipment and medium for displaying code nodes to solve the problem of low code optimization efficiency in the prior art.
[0005] An embodiment of the present disclosure provides a method for displaying code nodes, the method comprising the following steps: in response to obtaining a call operation on a first code node in a pre-built code call relationship graph, determining and calling a second code node having a call relationship with the first code node according to the code call relationship graph, wherein the code call relationship graph includes multiple code nodes in a target code library, and the code nodes having a call relationship are connected by connecting edges; in response to calling the second code node, determining a current call heat value of the second code node; determining a display parameter matching the current call heat value, and displaying the second code node in the code call relationship graph according to the display parameter.
[0006] The embodiment of the present disclosure also provides a device for displaying a code node, the device comprising: a calling module, for determining and calling a second code node having a calling relationship with the first code node according to the code calling relationship graph in response to obtaining a calling operation on a first code node in a pre-built code calling relationship graph, wherein the code calling relationship graph includes a plurality of code nodes in a target code library, and the code nodes having a calling relationship are connected by connecting edges; a determining module, for determining a current calling heat value of the second code node in response to calling the second code node; and a display processing module, for determining a display parameter matching the current calling heat value, and displaying the second code node in the code calling relationship graph according to the display parameter.
[0007] An embodiment of the present disclosure also provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the code node display method provided by the embodiment of the present disclosure.
[0008] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the code node display method provided by the embodiment of the present disclosure.
[0009] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0010] The code node display scheme provided by the embodiment of the present disclosure, in response to obtaining a call operation of a first code node in a pre-built code call relationship graph, determines and calls a second code node having a call relationship with the first code node according to the code call relationship graph, wherein the code call relationship graph includes multiple code nodes in the target code library, and the code nodes having a call relationship are connected by connecting edges, and in response to calling the second code node, determines the current call heat value of the second code node, and then determines the display parameters matching the current call heat value, and displays the second code node in the code call relationship graph according to the display parameters. In this technical solution, the automation of the display of code nodes is realized, and the efficiency and comprehensiveness of the display of code nodes are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0012] Figure 1 A flowchart of a method for displaying code nodes provided by an embodiment of the present disclosure;
[0013] Figure 2 A schematic diagram of a code call relationship diagram provided by an embodiment of the present disclosure;
[0014] Figure 3 A schematic diagram of another code call relationship diagram provided by an embodiment of the present disclosure;
[0015] Figure 4 A schematic diagram of a code optimization and processing framework provided by an embodiment of the present disclosure;
[0016] Figure 5A schematic diagram of the structure of a code node display device provided by an embodiment of the present disclosure;
[0017] Figure 6 A schematic diagram of the structure of another code node display device provided by an embodiment of the present disclosure;
[0018] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0020] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0021] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0022] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0023] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0024] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0025] In order to solve the above problems, an embodiment of the present disclosure provides a method for displaying code nodes, which is introduced below in conjunction with a specific embodiment.
[0026] Figure 1 The present invention provides a flowchart of a method for displaying a code node according to an embodiment of the present invention. The method can be executed by a display device for a code node, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method includes:
[0027] Step 101, in response to obtaining a call operation on a first code node in a pre-built code call relationship graph, determining and calling a second code node having a call relationship with the first code node according to the code call relationship graph, wherein the code call relationship graph includes multiple code nodes in a target code library, and the code nodes having the call relationship are connected by connecting edges.
[0028] In one embodiment of the present disclosure, a code call relationship graph is pre-constructed, wherein the code call relationship graph includes multiple code nodes, and the code nodes are connected according to the call relationship to generate a corresponding code call relationship graph. In this embodiment, multiple code nodes included in the target code library can be called, and the code nodes can include code segments, functions, classes, methods (including: method signatures, method modifiers, method annotations, input parameter types, return types), etc., and the call relationship between the multiple code nodes is determined. The call relationship may include dependency relationships, inclusion relationships, reference relationships, and other types of relationships that may trigger calls, which may specifically include alias, call, extends, has, interface, etc. The identification of multiple code nodes and their call relationships can be identified by a pre-constructed deep learning model, etc., wherein, in the actual execution process, multiple code nodes and the call relationships between the multiple code nodes can be extracted by parsing the target code library, and then, the extracted code node types and call relationship type information can be generated into seven CSV files, and these seven CSV files can be imported into a preset tool to establish a code call relationship graph.
[0029] That is, in this embodiment, a connection edge pointing from a calling code node to a called code node may be constructed according to the calling relationship to obtain a code calling relationship graph.
[0030] For example, Figure 2 As shown, if the code nodes include nodes 1-14, and the calling relationships between the code nodes are all call relationships, then the edges with directions can be connected according to the relationship between the calling code node and the called code node. For example, when code node 1 calls code node 2 during runtime, a connection edge pointing from code node 1 to code node 2 is generated.
[0031] In one embodiment of the present disclosure, when a first code node is called in a pre-built code call relationship graph, a second code node having a call relationship with the first code node is determined and called according to the code call relationship graph. The call of the first code node can occur in any called scenario, including but not limited to test scenarios and actual application scenarios, the second code node can be one or more, and the call relationship between the second code node and the first code node can be a direct call relationship or an indirect call relationship. That is, referring to the above Figure 2 , when the first code node is code node 1, the second code node may include code node 2 and code node 3, wherein code node 2 and code node 1 are in a direct calling relationship, code node 2 and code node 3 are in a direct calling relationship, and code node 3 and code node 1 are in an indirect reference relationship.
[0032] In different application scenarios, the manner of determining and calling the second code node having a calling relationship with the first code node according to the code calling relationship graph is different, and examples are as follows:
[0033] In some possible embodiments, a call path starting from the first code node is queried according to the code call relationship graph, and the edge in the call path points from the first code node to other code nodes (second code nodes), and the above Figure 2 For example, if the first code node is 10, the call path includes call path A, call path B, call path C, call path D and call path E.
[0034] In this embodiment, other code nodes except the first code node in the calling path are determined to be second code nodes, and the second code nodes are called.
[0035] In one embodiment of the present disclosure, at least one candidate node adjacent to a first code node may be identified according to a code call relationship graph, and a second code node may be determined and called according to the direction of a connection edge between the first code node and each candidate node, and then other code nodes referenced by the second code node may be determined as second code nodes, until all second code nodes having a call relationship are determined.
[0036] Step 102: In response to calling the second code node, determine the current call heat value of the second code node.
[0037] In an embodiment of the present disclosure, after the second code node is called, in response to the call to the second code node, the current call heat value of the second code node is determined, wherein the higher the number of calls, the higher the current call heat value.
[0038] It should be noted that in different application scenarios, the methods for determining the current call heat value of the second code node are different, and examples are as follows:
[0039] In some possible embodiments, an initial call heat value of the second code node is obtained, wherein when the second code node is called for the first time, the initial call heat value is 0, and when the second code node is not called for the first time, the initial call heat value may be the total heat of historical calls.
[0040] In this embodiment, the initial call heat value of the second code node is obtained, and the target heat increase value when being called by the first code node is obtained, wherein a preset preset heat unit increase value can be used as the target heat increase value, or, the preset code priority corresponding to the first code node can be determined, and the preset correspondence relationship is queried according to the preset code priority to obtain the target heat increase value, wherein the preset correspondence relationship stores a proportional correspondence between the code priority and the heat increase value.
[0041] Then, the sum of the initial call heat value and the target heat increase value is calculated to obtain the current call heat value.
[0042] Among them, the preset heat unit increase value can be marked according to the scene, and can also be determined according to the total number of calls. That is, in this embodiment, in order to further highlight the code nodes with relatively high call heat, different total call number ranges and corresponding preset heat unit increase values can be pre-set. The higher the total number corresponding to the total call number range, the higher the corresponding preset heat unit increase value. For example, if the total call number range is 0-200, the preset heat unit increase value is 3, and the total call number range is 201-300, then the preset heat unit increase value is 4, etc. In this embodiment, the total number of calls of each code node can be recorded, and the above correspondence can be queried based on the current total number of calls to obtain the preset heat unit increase value.
[0043] In some possible embodiments, the total number of current calls may be directly used as the corresponding current call heat value.
[0044] Among them, the current call heat value can be collected and counted according to a period, that is, the statistics are collected once in each period, and the call heat value is cleared in the next period to better adapt to the dynamic change process of the code node. Among them, each period can be set according to the scenario, for example, the period can be 30 days, etc.
[0045] In one embodiment of the present disclosure, the call heat values obtained by statistics of multiple consecutive cycles may be counted, and the call heat values of multiple cycles may be averaged to obtain the current call heat value of the corresponding second code node, etc.
[0046] In one embodiment of the present disclosure, the second code node can be optimized according to the current call heat value, so that the entire optimization process does not require the user to actively report. Even if the code node changes dynamically, it will be updated in real time in the corresponding code call relationship diagram, such as adding or deleting code nodes, thereby ensuring the comprehensiveness of the optimization.
[0047] It should be noted that the above optimization processing is different in different application scenarios. For example, it can be determined whether the current call heat value is greater than the preset call heat upper limit value. When it is greater than the preset call heat upper limit value, the preset code performance optimization processing is performed on the second code node. The performance optimization processing can be any method that can optimize the code performance of the second code node, such as code streamlining processing, code algorithm optimization, and memory allocation to the second code node. That is, the difference between the current call heat value of the second code node and the preset standard heat value is calculated, and the memory increase value is determined according to the product value of the difference and the preset unit memory increase value, and the initial allocated memory of the second code node and the sum of the memory increase value are calculated. When it is detected that the second code node that needs to be optimized is called, memory is allocated to the second code node according to the summed memory value. Among them, the initial allocated memory is the memory pre-allocated to the second code node to run.
[0048] For another example, when the current call heat value of the second code node is not greater than the preset call heat upper limit value, it is determined whether the current call heat value of the second code node is less than the preset heat threshold value. When it is less than the preset heat threshold value, a deletion reminder message of the second code node is displayed. In response to obtaining a confirmation operation on the deletion reminder message, the second code node is deleted. After the second code node is deleted, the code call relationship diagram is also updated and reconstructed in real time.
[0049] Step 103: determine a display parameter that matches the current call heat value, and display the second code node in the code call relationship graph according to the display parameter.
[0050] In some possible embodiments, the code nodes in the code call relationship graph can also be displayed visually to facilitate users to view the heat of related code nodes. In order to more intuitively display the current call heat value of each code node, the display parameters corresponding to the current call heat value can also be determined, and the second code node is displayed in the code call relationship graph according to the display parameters, wherein the display parameters include at least one of display shape, display color, display size, display frequency, and display animation. In this way, different call heat values can be intuitively distinguished, and generally, the code node with a higher current call heat value is displayed more prominently.
[0051] For example, Figure 3As shown, when the current call heat value of the code node 10 is greater than the preset high heat threshold, the code node 10 can be enlarged and highlighted.
[0052] In the actual execution process, in order to further enhance the user's interactive experience, when the user triggers the third code node of the code call relationship diagram, the total number of current calls of the third code node by all first code nodes and the total number of calls of the code nodes called by each first code node by the third code node can be displayed in a pop-up window. When the user triggers the total number of calls of a certain first code node, the display parameters of other call paths can also be different from the display parameters of other call paths, and the call path between the third code node and the corresponding first code node can be displayed. Of course, in this embodiment, the node type and node attributes of the third code can also be displayed.
[0053] Of course, in the embodiment of the present disclosure, when the first code node is called, the current call heat value of the first code node may also be updated according to the above method.
[0054] In the actual implementation process, the display method of the above code nodes can also be integrated into a tool, which includes five modules. Figure 4 The five modules may include a data input module, a data storage module, a code node parsing module, a call relationship parsing module, and an optimization processing module, wherein the data input module is used to obtain the input target code library to be processed, the data storage module is used to store the target code library, the code node parsing module is used to parse various code nodes contained in the target code library, the call relationship parsing module is used to parse the call relationship between various code nodes, the optimization processing module is used to analyze the call edges between various code nodes based on the call relationship, and generate a code call relationship graph by connecting multiple code nodes based on the call edges. In the optimization processing module, the current call heat value can also be calculated through the above-mentioned code node display method. The optimization processing module can also intuitively display the code call relationship graph and the current call heat value of the corresponding code node, and can provide visual interaction based on user operations, such as viewing the current call heat value.
[0055] Therefore, in the embodiments of the present disclosure, the called second code node is determined based on the code call relationship graph, which ensures the comprehensiveness and accuracy of the second code node determination, and the call heat value of the second code node is displayed in a visual manner based on the display parameters, which ensures the efficiency of determining the second code node with high call heat.
[0056] In summary, the code node display method of the embodiment of the present disclosure, in response to obtaining a call operation on a first code node in a pre-built code call relationship graph, determines and calls a second code node having a call relationship with the first code node according to the code call relationship graph, wherein the code call relationship graph includes multiple code nodes in the target code library, and the code nodes having a call relationship are connected by connecting edges, and in response to calling the second code node, determines the current call heat value of the second code node, and then determines the display parameters matching the current call heat value, and displays the second code node in the code call relationship graph according to the display parameters. In this technical solution, a visual display of the called heat of the code node is realized, which helps to improve the efficiency and accuracy of determining the code heat.
[0057] In order to implement the above embodiment, the present disclosure also proposes a device for displaying code nodes. Figure 5 This is a schematic diagram of the structure of a code node display device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated in an electronic device to display code nodes. Figure 5 As shown, the device includes: a calling module 510, a determining module 520, and a display processing module 530, wherein:
[0058] A calling module 510 is configured to, in response to obtaining a calling operation on a first code node in a pre-built code calling relationship graph, determine and call a second code node having a calling relationship with the first code node according to the code calling relationship graph, wherein the code calling relationship graph includes a plurality of code nodes in a target code library, and the code nodes having the calling relationship are connected by connecting edges;
[0059] A determination module 520, configured to determine a current call heat value of the second code node in response to calling the second code node;
[0060] The display processing module 530 is used to determine a display parameter that matches the current call heat value, and display the second code node in the code call relationship graph according to the display parameter.
[0061] In one embodiment of the present disclosure, Figure 6 As shown, the device further includes: a building module 540, which is used to:
[0062] Identify multiple code nodes contained in the target code library, and determine the calling relationship between the multiple code nodes;
[0063] According to the calling relationship, a connection edge is constructed from the calling code node to the called code node to obtain a code calling relationship graph.
[0064] In one embodiment of the present disclosure, the calling module 510 is used to:
[0065] Determine a call path with the first code node as a starting node according to the code call relationship graph;
[0066] Determine that other code nodes in the calling path except the first code node are second code nodes, and call the second code nodes.
[0067] In one embodiment of the present disclosure, the display parameters include at least one of the following:
[0068] Display shape, display color, display size, display frequency, display animation.
[0069] In one embodiment of the present disclosure, the determination module 520 is specifically configured to:
[0070] Obtaining the initial call heat value of the second code node;
[0071] Get the target heat increase value when called by the first code node;
[0072] The sum of the initial call heat value and the target heat increase value is calculated to obtain the current call heat value.
[0073] In one embodiment of the present disclosure, obtaining a target heat increase value when being called by a first code node includes:
[0074] Get the preset heat unit increase value as the target heat increase value; or,
[0075] Determine the preset code priority corresponding to the first code node,
[0076] According to the preset code priority, a preset corresponding relationship is queried to obtain a target heat increase value, wherein the preset corresponding relationship stores a proportional corresponding relationship between the code priority and the heat increase value. In one embodiment of the present disclosure, the optimization processing module is used to:
[0077] Determine whether the current call heat value of the second code node is less than a preset heat threshold;
[0078] When the temperature is less than a preset heat threshold, a deletion reminder message of the second code node is displayed;
[0079] In response to obtaining a confirmation operation on the deletion reminder message, the second code node is deleted.
[0080] The code node display device provided in the embodiments of the present disclosure can execute the code node display method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0081] In order to implement the above embodiments, the present disclosure further proposes a computer program product, including a computer program / instruction, which implements the method for displaying code nodes in the above embodiments when the computer program / instruction is executed by a processor.
[0082] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.
[0083] The following specific reference Figure 7 , which shows a schematic diagram of the structure of an electronic device 700 suitable for implementing the embodiment of the present disclosure. The electronic device 700 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0084] like Figure 7 As shown, the electronic device 700 may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a memory 708 to a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0085] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a memory 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0086] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device 709, or installed from a memory 708, or installed from a ROM 702. When the computer program is executed by the processor 701, the above-mentioned functions defined in the display method of the code node of the embodiment of the present disclosure are executed.
[0087] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0088] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0089] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0090] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0091] In response to obtaining a call operation on a first code node in a pre-built code call relationship graph, a second code node having a call relationship with the first code node is determined and called according to the code call relationship graph, wherein the code call relationship graph includes multiple code nodes in a target code library, and the code nodes having a call relationship are connected by connecting edges, and then, in response to the call to the second code node, the current call heat value of the second code node is determined, display parameters matching the current call heat value are determined, and the second code node is displayed in the code call relationship graph according to the display parameters. In this technical solution, a visual display of the called heat of the code node is realized, which helps to improve the efficiency and accuracy of determining the code heat.
[0092] The electronic device may be written in one or more programming languages or a combination thereof to write computer program code for performing the operations of the present disclosure, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0093] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0094] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0095] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0096] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0097] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0098] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0099] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for displaying a code node, characterized in that: The following steps are involved: In response to obtaining a call operation on a first code node in a pre-built code call relationship graph, determining and calling a second code node having a call relationship with the first code node according to the code call relationship graph, wherein the code call relationship graph includes a plurality of code nodes in a target code library, and the code nodes having the call relationship are connected by connecting edges; In response to calling the second code node, determining a current call heat value of the second code node; Determine a display parameter that matches the current call heat value, and display the second code node in the code call relationship graph according to the display parameter.
2. The method according to claim 1, characterized in that The steps of constructing the pre-built code call relationship graph include: Identifying a plurality of code nodes contained in the target code library, and determining a calling relationship between the plurality of code nodes; According to the calling relationship, a connection edge is constructed from the calling code node to the called code node to obtain the code calling relationship graph.
3. The method according to claim 2, characterized in that The determining and calling a second code node having a calling relationship with the first code node according to the code calling relationship graph includes: Determine a call path with the first code node as a starting node according to the code call relationship graph; Determine that other code nodes in the calling path except the first code node are the second code nodes, and call the second code nodes.
4. The method according to claim 1, characterized in that The display parameters include at least one of the following: Display shape, display color, display size, display frequency, display animation.
5. The method according to claim 1, characterized in that The determining the current call heat value of the second code node includes: Obtaining an initial call heat value of the second code node; Obtaining a target heat increase value when called by the first code node; The sum of the initial call heat value and the target heat increase value is calculated to obtain the current call heat value.
6. The method according to claim 5, characterized in that The obtaining of the target heat increase value when being called by the first code node includes: Obtaining a preset heat unit increase value as the target heat increase value; or, determining a preset code priority corresponding to the first code node, A preset corresponding relationship is queried according to the preset code priority to obtain the target heat increase value, wherein the preset corresponding relationship stores a proportional corresponding relationship between the code priority and the heat increase value.
7. The method according to claim 1, characterized in that Also includes: Determine whether the current call heat value of the second code node is less than a preset heat threshold; When the temperature is less than the preset heat threshold, displaying a deletion reminder message of the second code node; In response to obtaining a confirmation operation on the deletion reminder message, the second code node is deleted.
8. A code node display device, characterized in that: include: a calling module, configured to, in response to obtaining a calling operation on a first code node in a pre-built code calling relationship graph, determine and call a second code node having a calling relationship with the first code node according to the code calling relationship graph, wherein the code calling relationship graph includes a plurality of code nodes in a target code library, and the code nodes having a calling relationship are connected by connecting edges; a determination module, configured to determine a current call heat value of the second code node in response to calling the second code node; A display processing module is used to determine a display parameter that matches the current call heat value, and display the second code node in the code call relationship diagram according to the display parameter.
9. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the code node display method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to execute the code node display method described in any one of claims 1 to 7.