Code navigation method, device, equipment, medium and program product
By using large-scale model analysis and multi-dimensional code correlation analysis, combined with visualization technology, the problem of low efficiency of traditional code navigation methods in complex front-end projects has been solved, achieving rapid location and intelligent code navigation, thus improving development efficiency.
Patent Information
- Application Number
- CN202511309991.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2026-01-13
AI Technical Summary
Traditional code navigation methods are inefficient when dealing with complex front-end projects. They struggle to locate business logic across multiple modules and fail to identify implicit relationships, leading to low development and maintenance efficiency.
The system uses a large model to parse user queries, generates navigation element information, generates related files and dynamic call chains through multi-dimensional code association analysis, and performs visualization, supporting interactive user location of code positions.
It has enabled intelligent upgrades to project development, allowing for rapid location of code modules, reducing manual retrieval time, and improving development efficiency.
Smart Images

Figure CN121327201A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, specifically to the application of large models in code navigation, and more specifically to a code navigation method, apparatus, device, medium, and program product. Background Technology
[0002] In the fintech sector, the complexity and innovation of business operations drive exponential growth in code size. Core businesses such as high-frequency trading systems, intelligent risk control platforms, and mobile payment applications involve massive amounts of code modules and complex logic. Traditional code navigation and location methods are extremely inefficient when faced with multi-layered nested function calls, intricate data flows, and frequent code iterations. Developers often have to spend a lot of time locating critical code, severely hindering project progress, increasing operational costs, and raising potential risks. Therefore, efficient code navigation and location technology has become an industry necessity.
[0003] In complex front-end projects, existing code navigation methods rely on static retrieval or simple text matching, which makes it difficult to locate business logic in multiple modules. Furthermore, static analysis struggles to identify implicit relationships and lacks sufficient analysis of relationships such as cross-file calls and state transitions. This results in insufficient intelligence, leading to time-consuming and inefficient code module location, which hinders development and maintenance efficiency. Summary of the Invention
[0004] In view of the above problems, this application provides intelligent code navigation methods, apparatus, devices, media and program products.
[0005] According to a first aspect of this application, a code navigation method is provided, comprising: responding to a user inputting a target query statement, parsing the target query statement based on a large model to generate navigation element information; wherein the target query statement includes a target item; based on the target item, performing multi-dimensional code association analysis on the navigation element information to generate associated files and dynamic call chains; visualizing the associated files and the dynamic call chains to generate an interaction diagram and outputting the interaction diagram; and responding to the user clicking on a graphical node of the interaction diagram, locating the source code location corresponding to the graphical node based on the graphical node.
[0006] According to an embodiment of this application, the navigation element information includes key semantic elements and functional association data. The step of performing multi-dimensional code association analysis on the navigation element information based on the target project to generate an association file and a dynamic call chain includes: performing static analysis on the key semantic elements and the functional association data based on the target project to generate the association file; and monitoring the status of the target project in real time, and, when the target project is in a running state, dynamically tracking the call chain of the target project based on the key semantic elements to generate the dynamic call chain.
[0007] According to an embodiment of this application, the step of dynamically tracking the call chain of the target project based on the key semantic element and generating the dynamic call chain includes: obtaining the application programming interface (API) request corresponding to the key semantic element based on the front-end runtime environment of the target project; injecting listening logic into the data flow node position of the target project through instrumentation based on the key semantic element to dynamically track the data flow direction; and marking the call chain of the target project with cross-module dependencies based on the API request and the data flow direction to generate the dynamic call chain.
[0008] According to an embodiment of this application, the step of statically analyzing the key semantic elements and the functional association data based on the target project to generate the associated file includes: parsing the target project using an abstract syntax tree to extract data dependencies, and constructing a cross-file dependency graph based on the data dependencies; matching the key semantic elements with nodes in the cross-file dependency graph; filtering the matching results using cross-validation based on the functional association data and the data dependencies; and sorting the filtered results by relevance to generate the associated file.
[0009] According to an embodiment of this application, the step of performing multi-dimensional code association analysis on the navigation element information further includes: determining code entities based on the key semantic elements; obtaining the code semantics corresponding to the code entities through a natural language processing model; and performing semantic similarity detection on the code semantics corresponding to the code entities to obtain potential associated module data.
[0010] According to an embodiment of this application, the method further includes: responding to the user's editing operation, performing context analysis on the identifier corresponding to the editing operation based on the associated file and the dynamic call chain; matching similar modules corresponding to the identifier based on the potential associated module data; and displaying the context analysis results and the similar modules to the user.
[0011] According to an embodiment of this application, the method further includes: responding to the user's modification operation on a public component, retrieving the file path of the public component based on the cross-file dependency graph, and obtaining component semantic data based on the file path; performing similarity analysis on the modification content corresponding to the modification operation based on the component semantic data to obtain an associated modification set; and displaying the associated modification set to the user.
[0012] According to an embodiment of this application, the step of visualizing and drawing the associated file and the dynamic call chain to generate an interactive graph includes: serializing the dynamic call chain based on the link structure and the associated file to generate link data; mapping the link data into link nodes and link edges; and processing the link data through a graph drawing engine based on the link nodes and the link edges to generate the interactive graph.
[0013] According to an embodiment of this application, the step of parsing the target query statement based on a large model to generate navigation element information includes: inputting the target query statement into the large model for parsing to obtain intent parsing results; converting the intent parsing results into multidimensional retrieval elements; and retrieving the multidimensional retrieval elements based on a semantic index database to generate the navigation element information.
[0014] A second aspect of this application provides a code navigation device, comprising: a large model parsing module, configured to parse the target query statement based on a large model in response to a user inputting a target query statement, and generate navigation element information; wherein the target query statement includes a target item; a multi-dimensional analysis module, configured to perform multi-dimensional code association analysis on the navigation element information based on the target item, and generate associated files and dynamic call chains; a visualization drawing module, configured to visualize the associated files and the dynamic call chains, generate an interactive diagram, and output the interactive diagram; and a code positioning module, configured to locate the source code position corresponding to the graphic node based on the graphic node in response to the user clicking on a graphic node of the interactive diagram.
[0015] A third aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0016] A fourth aspect of this application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0017] The fifth aspect of this application also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.
[0018] In the embodiments of this application, target query statements are parsed based on a large model to enhance user intent recognition and accurately extract navigation elements. Navigation element information is analyzed through multi-dimensional code association to identify the relationships between codes from multiple dimensions, effectively recognizing implicit associations and dynamic call relationships. Interactive diagrams are generated through visualization, facilitating user interaction and enabling rapid location responses. Combining large model parsing, multi-dimensional code association analysis, and interactive visualization achieves an intelligent upgrade in project development, quickly locating code modules, improving code navigation speed, reducing manual retrieval time, and enhancing development efficiency. Attached Figure Description
[0019] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0020] Figure 1 The illustrations depict application scenarios of code navigation methods, apparatus, devices, media, and program products according to embodiments of this application.
[0021] Figure 2 A flowchart illustrating a code navigation method according to an embodiment of this application is shown schematically;
[0022] Figure 3 A schematic diagram illustrating the system architecture of a code navigation method according to an embodiment of this application is shown.
[0023] Figure 4 This illustration schematically shows a context-aware navigation flowchart of a code navigation method according to an embodiment of this application;
[0024] Figure 5 This illustration schematically shows an associated modification navigation flowchart of the code navigation method according to an embodiment of this application;
[0025] Figure 6 A flowchart illustrating the multi-dimensional code association analysis process of the code navigation method according to an embodiment of this application is shown.
[0026] Figure 7 A schematic diagram illustrating the structure of a code navigation device according to an embodiment of this application is shown; and
[0027] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing a code navigation method according to an embodiment of this application. Detailed Implementation
[0028] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0029] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0030] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0031] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0032] In software engineering practice, when maintaining a front-end system with high code coupling and lack of effective documentation support, developers generally face the problem of low code location efficiency. Specifically, the retrieval mechanism based on visual interface text features (such as document object model element content) and Uniform Resource Locator (URL) path parameters has become the main code location method. Although traditional text matching tools with global search can complete the initial location of basic functional modules, they have significant limitations when dealing with the following scenarios: (1) Cross-dimensional code association analysis: When it is necessary to trace the Cascading Style Sheets (CSS) style definitions, Application Programming Interface (API) calls and data flow of specific functions, developers need to conduct multiple rounds of keyword iterative search and manually verify the logical association between each code fragment. (2) Semantic equivalent component identification: There are often component instances with the same function but inconsistent names in the system (such as the "Batch Processing" and "Batch Authorization" modules). Due to the lack of semantic understanding ability of traditional retrieval tools, the coverage of modification operations is insufficient, and in the end, it is necessary to rely on the testing team to conduct full regression testing, resulting in a waste of resources.
[0033] As front-end projects become more complex, module decomposition becomes more refined, and dependency nesting deepens. Module location during development requires extensive searching, and code correlation analysis is time-consuming. Cross-file modifications are prone to oversights due to insufficient dependency awareness, leading to inconsistencies. These issues reduce development efficiency and increase maintenance costs. Therefore, addressing these problems during the code analysis and generation phase is crucial for ensuring code quality and iteration efficiency. However, existing code generation technologies have drawbacks:
[0034] (1) Traditional search tools (such as global search in visual code editors): only support text matching, cannot understand business semantics such as query review function, and cannot understand natural language queries from developers;
[0035] (2) Static analysis tools: lack runtime data flow tracing capabilities, cannot associate CSS styles, API interfaces and cross-file relationships of data flow;
[0036] (3) Intelligent R&D Assistant: It focuses on code generation, lacks in-depth correlation analysis of existing code libraries, and does not support customized needs such as field consistency detection.
[0037] Therefore, embodiments of this application provide a code navigation method, including: responding to a user inputting a target query statement, parsing the target query statement based on a large model to generate navigation element information; wherein the target query statement includes a target item; based on the target item, performing multi-dimensional code association analysis on the navigation element information to generate associated files and dynamic call chains; visually drawing the associated files and dynamic call chains to generate an interactive diagram and outputting the interactive diagram; and responding to a user clicking on a graphical node in the interactive diagram, locating the source code location corresponding to the graphical node based on the graphical node. In embodiments of this application, parsing the target query statement based on a large model enhances user intent recognition and accurately extracts navigation elements. By analyzing navigation element information through multi-dimensional code association, the correlation between codes is identified in multiple dimensions, effectively identifying implicit associations and dynamic call relationships. Visualizing and generating an interactive diagram facilitates user interaction and allows for rapid location responses. Combining large model parsing, multi-dimensional code association analysis, and interactive visualization achieves intelligent upgrades in project development, quickly locating code modules, improving code navigation speed, reducing manual retrieval time, and enhancing development efficiency.
[0038] Figure 1 The illustrations depict application scenarios of code navigation methods, apparatus, devices, media, and program products according to embodiments of this application.
[0039] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0040] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0041] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0042] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0043] It should be noted that the code navigation method provided in this application embodiment can generally be executed by server 105. Correspondingly, the code navigation device provided in this application embodiment can generally be located in server 105. The code navigation method provided in this application embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the code navigation device provided in this application embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0044] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0045] The following will be based on Figure 1 The described scene, through Figures 2-6 The code navigation method according to the embodiments of this application will be described in detail.
[0046] Figure 2 A flowchart illustrating a code navigation method according to an embodiment of this application is shown schematically.
[0047] like Figure 2 As shown, the code navigation method of this embodiment includes operations S210 to S240. This code navigation method is not limited to a specific execution subject. The execution subject can be any electronic device, such as a terminal device or a server device, etc. The execution subject can also be any software application or client.
[0048] In operation S210, in response to the user's input of a target query statement, the target query statement is parsed based on the large model to generate navigation element information; wherein, the target query statement includes the target item.
[0049] It supports users to use natural language queries (such as "modify search date restrictions") and returns related components, interfaces, and CSS files to the user.
[0050] After a user enters their target query, the system analyzes the intent based on that query using a large model to generate navigation element information. This navigation element information includes key semantic elements and functional association data. The large model is an artificial intelligence (AI) model capable of handling code-related tasks. It can use natural language models to understand the true purpose behind the user's natural language, AI models that understand the meaning of code text to perform text semantic matching, and AI models that understand code structure to perform component structure similarity analysis.
[0051] Target query statements belong to natural language instructions, including natural query statements related to code navigation such as target items, target identifiers, feature descriptions, scope limits, and related clues.
[0052] Target Project: The specific code project (project) that the user wants to navigate / locate, that is, the entire software project currently under development or analysis, which includes all its source code files, directory structure, dependencies, etc.
[0053] Target identifier: Clearly identify the code entity to be located, such as "find the form validation function for user registration" or "find the exception handling code module for the transfer interface".
[0054] Feature description: Supplement the key features of the target, such as "finding permission verification methods that return boolean values" and "locating risk control rule codes containing cross-border transaction keywords".
[0055] Scope limitation: Specify the file, module, or level to search, such as "find refund logic in the service layer of the payment module" or "locate only the click event handler function of the submit button in the current page component".
[0056] Related clues: Locate by dependency or call relationships, such as "find the storage utility function referenced by the login component" or "locate the order submission interface that calls the encryption algorithm".
[0057] The navigation element information generated after processing through the large model includes at least key semantic elements and functional association data, including functional intent labels and a list of associated code units.
[0058] Functional intent label: The business function category and operation type involved in the instruction.
[0059] List of associated code units: source code files, classes, functions, interface endpoints, etc. that match the functional intent, along with their corresponding confidence scores.
[0060] Key semantic elements: variable names, method names, CSS class names, API paths, data structure definitions, and other key semantic elements.
[0061] When operating S220, based on the target project, the navigation element information is analyzed in multiple dimensions to generate associated files and dynamic call chains.
[0062] Multi-dimensional code correlation analysis includes, but is not limited to, static analysis, dynamic tracing of call chains, and analysis of potentially related modules.
[0063] Based on the target project, the navigation element information is statically analyzed to generate associated files.
[0064] The navigation element information is dynamically tracked and the call chain is generated.
[0065] The navigation element information is analyzed for potential related modules to obtain potential related module data.
[0066] When operating S230, visualize the associated files and dynamic call chains, generate an interaction diagram, and output the interaction diagram.
[0067] When running the target project, dynamic call chains can be recorded. Based on associated files, the dynamic call chains can be visualized and drawn, and interactive diagrams can be automatically generated to achieve dynamic tracking and drawing.
[0068] According to embodiments of this application, the associated files and dynamic call chains are visualized and drawn to generate an interactive graph, including: serializing the dynamic call chain based on the link structure and associated files to generate link data; mapping the link data into link nodes and link edges; and processing the link data through a graph drawing engine based on the link nodes and link edges to generate an interactive graph.
[0069] The results of system call dynamic call chain tracing and static analysis, namely the dynamic call chain and associated files, serialize the call events captured in the dynamic call chain into data based on the link structure to obtain link data. The link structure includes the call source location, target location, parameter values, return values, and timestamps, etc. The link data includes the method call order, data transmission relationships, and module interaction information, etc.
[0070] Mapping link data to directed graph nodes and edges can be achieved using a flowchart drawing engine. This transforms the link data call chain into a node-edge structure, where link nodes represent methods, components, or interface endpoints, and link edges represent call or data transfer relationships. Key parameters can be labeled on the edges, and different colors can distinguish between synchronous and asynchronous calls. For example, bold red edges indicate high-frequency paths (call counts exceeding a specified number, which can be pre-defined by the user), dashed edges represent cross-process calls (e.g., frontend → backend), and orange highlights indicate circular dependency detection (e.g., using the Tayan algorithm to identify circular structures, such as A→B→C→A).
[0071] The visualization generation engine renders the link data call chain into an interactive chart in scalable vector graphics format, generating an interactive diagram that supports zooming, expanding / collapsed sub-call chains by clicking nodes, and displaying parameter details by hovering.
[0072] In the embodiments of this application, dynamic call chain diagrams can intuitively display data flow, shortening the location time. Complex code call relationships and file dependencies are transformed into intuitive, interactive visual diagrams. These diagrams help users quickly understand the system architecture and data flow, facilitating visual debugging, improving code reading and debugging efficiency, and enhancing the user experience.
[0073] In operation S240, in response to the user clicking on a graphical node of the interactive graph, the source code location corresponding to the graphical node is located based on the graphical node.
[0074] It supports interactive debugging. After generating the above interactive diagram, users can click on nodes in the diagram to jump to the corresponding source code location. When a user clicks on any graphical node in the diagram, the system locates the source code location through the file path and line number, and automatically highlights the assignment and transmission paths of key parameters. It also highlights the transmission trajectory of key parameters along the call path, achieving source code-level traceable debugging.
[0075] To achieve closed-loop optimization, user feedback (such as accepting, rejecting, or ignoring a suggestion) is used to train relevant models, improving the accuracy of subsequent recommendations. Corresponding log data can be used to: fine-tune large model parameters to better align with the project's code style and business semantics; update retrieval ranking weights to optimize the recommendation order of subsequent related files; and dynamically adjust similarity thresholds to reduce invalid suggestions and improve recommendation accuracy.
[0076] In the embodiments of this application, target query statements are parsed based on a large model to enhance user intent recognition and accurately extract navigation elements. Navigation element information is analyzed through multi-dimensional code association to identify the relationships between codes from multiple dimensions, effectively recognizing implicit associations and dynamic call relationships. Interactive diagrams are generated through visualization, facilitating user interaction and enabling rapid location responses. Combining large model parsing, multi-dimensional code association analysis, and interactive visualization achieves an intelligent upgrade in project development, quickly locating code modules, improving code navigation speed, reducing manual retrieval time, and enhancing development efficiency.
[0077] Figure 3 A schematic diagram illustrating the system architecture of a code navigation method according to an embodiment of this application is provided.
[0078] like Figure 3As shown, a front-end plugin layer and a multimodal AI model layer are used to realize requirement input and semantic parsing. Users input natural language commands, and in the front-end plugin layer, development tools are used to extend the plugin to transmit the commands to the multimodal AI model layer for semantic parsing. The multimodal AI model layer outputs navigation element information (such as function intent labels, key semantic elements, and a preliminary list of associated code units).
[0079] The analysis service layer performs static analysis and related file identification. It performs Abstract Syntax Tree (AST) parsing and dependency graph construction on the target project. Combined with the context awareness of the code, it matches the semantic elements output by the model with the nodes of the dependency graph, retains the valid verification results, and returns them to the development tool extension plugin after sorting them by relevance.
[0080] Dynamic call chain tracing and visualization are achieved using an analytics service layer and a visualization generation engine layer. During project runtime, the analytics service layer captures API requests and call chain data, serializes it, and then passes it to the visualization generation engine layer to render it into an interactive directed graph. Users can click on graph nodes to jump to the source code and view the parameter passing path.
[0081] The system utilizes an analytics service layer and a front-end plugin layer to detect modifications to common components and provide similarity alerts. When a modification to a common component is detected, the system retrieves the files that reference the component through a dependency graph and identifies the pages that need to be modified synchronously based on semantic similarity. A modification impact alert box then pops up in the developer tool extension plugin.
[0082] By implementing closed-loop optimization through a multimodal AI model layer, the system collects feedback from developers on the prompts, updates model parameters and retrieval weights, achieves adaptive optimization, and continuously improves the accuracy of association analysis and recommendation.
[0083] Figure 4 A context-aware navigation flowchart of a code navigation method according to an embodiment of this application is illustrated schematically.
[0084] like Figure 4 As shown, the code navigation method in this embodiment also includes a context-aware navigation process, which includes operations S410 to S430.
[0085] Context-aware navigation enables intelligent navigation and automatically recommends relevant files while the user is editing code (e.g., when the search button is clicked, the corresponding API interface and data model are suggested).
[0086] When operating S410, in response to the user's editing operation, context analysis is performed on the identifier corresponding to the editing operation based on the associated file and dynamic call chain.
[0087] When a user clicks or selects an identifier (function, variable, component name, etc.), the context information of the current editing position is analyzed in real time. The context information includes the calling relationship and dependency information of the file in which it is located.
[0088] Based on the static analysis results (associated files) and dynamic call chain records, and by performing correlation analysis based on call relationships and dependency information, we can locate the module to which the identifier belongs and its upstream and downstream nodes in the call chain.
[0089] In operation S420, based on the potential associated module data, similar modules corresponding to the identifier are matched.
[0090] During the analysis of potential related modules, potential related module data is generated through semantic similarity detection. The module to which the identifier belongs is matched with the potential related module data to retrieve other files with similar functions or related structures, thereby determining the similar modules corresponding to the identifier.
[0091] When operating the S430, the context analysis results and similar modules are displayed to the user.
[0092] The context analysis results include the module to which the identifier belongs and the upstream and downstream nodes of the call chain. The module to which the identifier belongs, the upstream and downstream nodes of the call chain, and similar modules can be displayed in the form of a floating tooltip or a sidebar list, allowing users to jump to them with one click.
[0093] In the embodiments of this application, based on intelligent context analysis and semantic matching, developers are provided with accurate code editing suggestions and similar module recommendations, which significantly reduces cross-file lookup and repetitive coding time, improves code reuse rate and development efficiency, and reduces the risk of introducing errors due to ignoring implicit dependencies.
[0094] Figure 5 The diagram illustrates the associated modification navigation flowchart of the code navigation method according to an embodiment of this application.
[0095] like Figure 5 As shown, the code navigation method in this embodiment also includes an associated modification navigation process, which includes operations S510 to S530.
[0096] When operating S510, in response to user modification operations on common components, the file paths of common components are retrieved based on cross-file dependency graphs, and component semantic data is obtained based on the file paths.
[0097] When a user modifies a common component, the system scans the project structure, prompts similar functional pages, and marks the fields that need to be modified synchronously.
[0098] Public components include, but are not limited to, multi-level referenced components, global components, and multi-module components. Multi-level referenced components mean that the component is directly or indirectly referenced by multiple pages; global components mean that the component has a record in the global registry; and multi-module components mean that the API exported by the component is called in multiple independent modules.
[0099] Retrieve all file paths that reference the public component from the project's cross-file dependency graph, and obtain the component semantic data for these files based on all file paths, including component structure and semantic features.
[0100] In operation S520, based on component semantic data, similarity analysis is performed to modify the content corresponding to the modification operation and obtain the associated modification set.
[0101] The semantic data of these components is embedded and encoded, and the semantic similarity with the modified content of the current component is calculated. Pages with similarity exceeding a set threshold are marked, and a set of related modifications is listed. The set of related modifications includes fields, methods, style lists, etc., that need to be modified synchronously.
[0102] When operating the S530, the associated modification set is displayed to the user.
[0103] A pop-up dialog box in the editor plugin interface displays the impact of modifications, showing the associated set of modifications. Users can make batch modifications or ignore operations, forming a controllable code consistency maintenance process.
[0104] In the embodiments of this application, when a common component field is modified, a set of related modifications is listed by searching the file path and analyzing the modified content. Modification suggestions are intelligently provided, and the impact of the modification is effectively warned. All components and interfaces that depend on the field can be listed to avoid omissions, ensure the consistency of modifications, realize automatic association prompts for similar functions, and reduce the rate of missing modifications for similar components.
[0105] According to an embodiment of this application, the process of parsing a target query statement based on a large model to generate navigation element information includes: inputting the target query statement into the large model for parsing to obtain intent parsing results; converting the intent parsing results into multi-dimensional retrieval elements; and retrieving the multi-dimensional retrieval elements based on a semantic index database to generate navigation element information.
[0106] The process of parsing the target query statement using a large model is as follows:
[0107] First, the target query statement is input into the large model for parsing, and the intent parsing results are extracted, including the operation intent (such as modification), the target entity (such as the search module), and the constraints (such as date restrictions).
[0108] Secondly, the intent parsing results are converted into multi-dimensional search elements, including module name, API path, CSS class name, data model fields, etc.
[0109] Finally, a search is performed in the semantic index database (which stores AST features, semantic vectors, and call chain information), returning navigation elements such as lists of files, components, interfaces, and style files that match the intent above a threshold. The results can also be displayed in grouped form on the interface, allowing for one-click navigation to the corresponding code location. By understanding code comments and variable names through a large model, semantic comparisons are performed between user input and non-exactly matching identifiers to locate potentially related functional logic, enabling correct retrieval even when names are not perfectly identical.
[0110] In the embodiments of this application, a large model is used to deeply understand the semantic intent of natural language queries, which is then transformed into accurate multi-dimensional retrieval elements. Combined with a semantic index database, intelligent search is achieved, which significantly improves the accuracy and intelligence of code navigation, reduces the limitations of traditional keyword matching, and lowers the cost of semantic understanding.
[0111] Figure 6 A flowchart illustrating the multi-dimensional code association analysis process of the code navigation method according to an embodiment of this application is shown.
[0112] like Figure 6 As shown, operation S220, based on the target project, performs multi-dimensional code association analysis on navigation element information to generate associated files and dynamic call chains, including operations S610 to S620.
[0113] When operating S610, based on the target project, key semantic elements and functional related data are statically analyzed to generate related files.
[0114] Under the target project, key semantic elements and functional association data are extracted using a large model, and then analyzed using a static analysis engine to obtain associated files.
[0115] According to an embodiment of this application, based on the target project, static analysis is performed on key semantic elements and functional association data to generate an association file, including: parsing the target project using an abstract syntax tree, extracting data dependencies, and constructing a cross-file dependency graph based on the data dependencies; matching key semantic elements with nodes in the cross-file dependency graph; filtering the matching results using cross-validation based on the functional association data and data dependencies; and sorting the filtered results by relevance to generate the association file.
[0116] An AST (Abstract Syntax Tree) analysis is performed on the target project to extract data dependencies. Based on these dependencies, a cross-file dependency graph is constructed. Data dependencies include inter-module call relationships, component reference relationships, style reference relationships, and data flow. The cross-file dependency graph represents the relationship between components, APIs, CSS class names, and data flows.
[0117] The process of abstract syntax tree (AST) parsing is as follows: First, the source code file of the target project is read, and lexical analysis is performed according to the syntax rules of the corresponding programming language, breaking the code down into the smallest syntactic units (lexical units) such as identifiers, keywords, and operators. Next, syntax analysis is performed, verifying the legality of the arrangement of lexical units according to the syntax rules. If legal, a tree structure, i.e., the abstract syntax tree, is generated. Each node in the tree represents a syntactic component of the code (such as function definitions, variable declarations, expressions, etc.), ignoring unnecessary information such as spaces and comments, retaining only the core syntactic structure of the code, providing structured data support for subsequent code analysis, location, and optimization operations.
[0118] Based on the constructed cross-file dependency graph, key semantic elements extracted from the large model are matched with nodes in the dependency graph. The cross-file dependency graph records the call relationships and reference associations between different files in the project. Each node represents a specific code unit (such as a class, method, module, etc.). By matching, potential file nodes related to key semantics can be initially identified.
[0119] Cross-validation is used to eliminate false matches, retaining only files deemed relevant by the large model and static analysis. Specifically, by combining the generated functional association data with the data dependencies in the target project, the initial matching results are cross-validated and filtered, checking whether the matched nodes are functionally logically consistent with the query intent. Figure 1 At the same time, it verifies whether the data dependencies conform to the data transfer rules in the business process, and eliminates those results that only match semantically on the surface but are not closely related in function or data.
[0120] For the filtered valid results, they are ranked according to multiple dimensions such as semantic relevance to the query intent, coreness in the functional chain, and directness of data dependence. Finally, a list of related files arranged by priority is generated. The related files can be returned to the user in descending order so that the user can quickly locate the most relevant code file.
[0121] In the embodiments of this application, dependencies are extracted through abstract syntax tree parsing, transforming scattered code logic into a structured knowledge graph, enabling intelligent association analysis and facilitating accurate location of dependent files. Furthermore, it provides standardized tools for team collaboration and large-scale project maintenance, and can be widely applied to the front-end engineering management of complex business systems such as finance and e-commerce.
[0122] When operating the S620, the status of the target project is monitored in real time, and when the target project is running, the call chain of the target project is dynamically tracked based on key semantic elements to generate a dynamic call chain.
[0123] By detecting the liveness status of local development server processes, port listening status, and long connection heartbeats, the startup and running status of the target project is monitored in real time. Once the target project is confirmed to be running, dynamic tracing logic is initiated.
[0124] During target project runtime, dynamic call chain tracing is achieved by capturing API requests, the final data flow, and marking cross-module dependencies (such as calls from method A to interface A). This dynamic call chain tracing feature automatically attaches monitoring probes during project runtime, captures real API requests and data flow, and marks cross-module call relationships in the cross-file dependency graph.
[0125] Dynamic call chains can be visualized, clearly showing users the call path between code modules. Furthermore, dynamic call chains can be used for performance analysis, tracking the time spent at each call chain node to pinpoint latency bottlenecks. They can also be used for change impact assessment, automatically listing affected downstream modules and APIs when files are modified. Finally, dynamic call chains can be used for security detection, checking whether sensitive data is flowing to unauthorized modules or external interfaces.
[0126] In the embodiments of this application, key semantic elements and functional association data based on large model semantic understanding are combined with static code analysis and dynamic call chain tracing technology to quickly associate related code files. During project runtime, the call chain is dynamically traced in real time to achieve intelligent code navigation, significantly improving development efficiency and code quality.
[0127] According to an embodiment of this application, dynamically tracking the call chain of a target project based on key semantic elements and generating a dynamic call chain includes: obtaining application interface requests corresponding to key semantic elements based on the front-end runtime environment of the target project; injecting listening logic into the data flow node positions of the target project through instrumentation based on key semantic elements to dynamically track the data flow direction; and marking the call chain of the target project with cross-module dependencies based on application interface requests and data flow direction to generate a dynamic call chain.
[0128] API Request Acquisition: Inject a proxy layer into the front-end runtime environment. This proxy layer dynamically modifies the native API at browser runtime, inserts custom logic, intercepts and replaces the original methods, ensuring that all network requests pass through the proxy code before being forwarded to the real target. It captures complete details of the API request (such as URL, request parameters, and response data) and the code triggering location (such as call stack information).
[0129] Dynamically tracing data flow: Instrumentation is performed using a transpiler to inject listening code at data flow nodes such as variable assignments, function parameter passing, and event callbacks. This marks the source and destination of data and records timestamps, calling threads, and context information to capture data flow. A transpiler (which converts one high-level language into another with a similar level of abstraction) modifies the code structure, inserting additional tracing, monitoring, or testing code at specific locations. This process does not change the original execution logic of the code. The instrumented code is only used for data flow analysis and is automatically removed when user-submitted code is submitted.
[0130] Cross-module dependency tagging: This binds each node in the call chain to its source file path, component name, and API endpoint, and records cross-file, cross-directory, and cross-level call relationships in the dependency graph. For example, it can be tagged as "User Interface Component → Service Module → Backend API".
[0131] In the embodiments of this application, dynamic call chain tracing is achieved by obtaining interface requests, instrumentation methods, injecting listeners, and cross-module dependency markers. Correlation analysis is performed on cross-file calls and data state transitions to efficiently identify dynamic call relationships and facilitate quick location of related code.
[0132] According to embodiments of this application, multi-dimensional code association analysis further includes potential association module analysis, which includes determining code entities based on key semantic elements; obtaining code semantics corresponding to the code entities through a natural language processing model; and performing semantic similarity detection on the code semantics corresponding to the code entities to obtain potential association module data.
[0133] Extract the code entities corresponding to key semantic elements. These code entities include function-level entities, class / component entities, API definition entities, data model entities, and style and selector entities. Function-level entities include independent functions and class methods, suitable for comparing the similarity of specific business logic implementations; class / component entities include functional block components and JavaScript classes, used for comparing interface logic or module functionality; API definition entities include API call methods declared on the front end and their request / response structures; data model entities include type script interfaces, type definitions, and data transfer objects; and style and selector entities include class names, identifier selectors, and their binding relationships with components in CSS.
[0134] For example, the process of obtaining code semantics includes: (1) AST feature extraction: parsing the source code to generate AST, extracting structural features such as node type, function signature, variable scope, and call chain path; (2) Symbol table and type analysis: using type script to compile API, obtaining the definition and reference position of variables, functions, and classes, and parsing type information to establish a semantic mapping across files; (3) Code vectorization (semantic embedding generation): inputting the code text and its structural features into a pre-trained code language model to generate high-dimensional semantic vectors; (4) Context enhancement: introducing call context information (such as caller, callee, number of calls, call order, etc.) in the process of semantic vector generation to improve the accuracy of similarity calculation; (5) Semantic index construction: storing the generated semantic vectors in a vector database to support fast similarity retrieval and comparison.
[0135] In the semantic vector generation process, multi-dimensional calling context information is introduced to enhance the semantic features of code entities. Based on this, the generated context-aware semantic vectors can be used for fine-grained semantic similarity detection using cosine similarity or clustering algorithms. This not only identifies modules with superficially similar semantics but also discovers potentially related modules with similar calling patterns or collaborative relationships. Finally, through efficient nearest neighbor search of the vector database, a set of potentially related modules that may have complementary functions, logical coupling, or reusable functions is recommended to the user, and their association strength and contextual basis are labeled.
[0136] In the embodiments of this application, natural language processing (NLP) models are used to parse the semantics of code, such as comments and naming, to quickly understand the complex logic of the code. By combining NLP models with semantic similarity detection, potential correlation analysis is achieved, enhancing semantic understanding capabilities, overcoming the limitations of pure text matching, accurately identifying potentially logically related modules, and improving the intelligence and recall rate of code navigation.
[0137] Based on the above code navigation method, this application also provides a code navigation device. The following will be combined with... Figure 7 The device is described in detail.
[0138] Figure 7 A schematic block diagram of a code navigation device according to an embodiment of this application is shown.
[0139] like Figure 7 As shown, the code navigation device 700 of this embodiment includes a large model parsing module 710, a multidimensional analysis module 720, a visualization drawing module 730, and a code positioning module 740.
[0140] The large model parsing module 710 is used to respond to the user's input of a target query statement, parse the target query statement based on the large model, and generate navigation element information; wherein the target query statement includes target items. In one embodiment, the large model parsing module 710 can be used to perform the operation S210 described above, which will not be repeated here.
[0141] The multidimensional analysis module 720 is used to perform multidimensional code association analysis on the navigation element information based on the aforementioned target project, generating associated files and dynamic call chains. In one embodiment, the multidimensional analysis module 720 can be used to perform the operation S220 described above, which will not be repeated here.
[0142] The visualization drawing module 730 is used to visualize the aforementioned associated files and the aforementioned dynamic call chain, generate an interactive diagram, and output the interactive diagram. In one embodiment, the visualization drawing module 730 can be used to perform the operation S230 described above, which will not be repeated here.
[0143] The code location module 740 is used to respond to the user clicking on the graphical node of the interactive graph, and to locate the source code corresponding to the graphical node. In one embodiment, the code location module 740 can be used to perform the operation S240 described above, which will not be repeated here.
[0144] According to an embodiment of this application, the navigation element information includes key semantic elements and functional association data. The multidimensional analysis module 720 includes: a static analysis unit, used to perform static analysis on the key semantic elements and functional association data based on the target project to generate the association file; and a dynamic tracking unit, used to monitor the status of the target project in real time, and when the target project is in a running state, dynamically track the call chain of the target project based on the key semantic elements to generate the dynamic call chain.
[0145] According to an embodiment of this application, the dynamic tracking unit includes: a request acquisition subunit, used to acquire the application interface request corresponding to the key semantic element based on the front-end runtime environment of the target project; a listening subunit, used to inject listening logic into the data flow node position of the target project through instrumentation based on the key semantic element, and dynamically track the data flow direction; and a marking subunit, used to mark the call chain of the target project across modules based on the application interface request and the data flow direction, and generate the dynamic call chain.
[0146] According to an embodiment of this application, the aforementioned static analysis unit includes: a graph construction subunit, used to perform abstract syntax tree parsing on the aforementioned target project, extract data dependencies, and construct a cross-file dependency graph based on the aforementioned data dependencies; a node matching subunit, used to match the aforementioned key semantic elements with the nodes of the aforementioned cross-file dependency graph; a filtering subunit, used to filter the matching results through cross-validation based on the aforementioned functional association data and the aforementioned data dependencies; and a file generation subunit, used to sort the filtering results by relevance and generate the aforementioned associated files.
[0147] According to an embodiment of this application, the multidimensional analysis module 720 further includes: a similarity detection unit, used to determine code entities based on the key semantic elements; obtain the code semantics corresponding to the code entities through a natural language processing model; and perform semantic similarity detection on the code semantics corresponding to the code entities to obtain potential associated module data.
[0148] According to an embodiment of this application, the above-mentioned device 700 further includes: a context-aware navigation module, configured to respond to the user's editing operation by performing context analysis on the identifier corresponding to the editing operation based on the associated file and the dynamic call chain; matching similar modules corresponding to the identifier based on the potential associated module data; and displaying the context analysis results and the similar modules to the user.
[0149] According to an embodiment of this application, the above-mentioned device 700 further includes: an associated modification navigation module, configured to respond to the user's modification operation on the public component, retrieve the file path of the public component based on the cross-file dependency graph, and obtain component semantic data based on the file path; analyze the modification content corresponding to the modification operation based on the component semantic data to obtain an associated modification set; and display the associated modification set to the user.
[0150] According to an embodiment of this application, the visualization drawing module 730 includes: a serialization unit, used to serialize the dynamic call chain based on the link structure and the associated file to generate link data; a mapping unit, used to map the link data into link nodes and link edges; and a graph drawing unit, used to process the link data through a graph drawing engine based on the link nodes and link edges to generate the interactive graph.
[0151] According to an embodiment of this application, the large model parsing module 710 includes: a parsing unit, used to input the target query statement into the large model for parsing to obtain intent parsing results; a conversion unit, used to convert the intent parsing results into multi-dimensional retrieval elements; and a retrieval unit, used to retrieve the multi-dimensional retrieval elements based on a semantic index database to generate the navigation element information.
[0152] According to embodiments of this application, any multiple modules among the large model parsing module 710, multidimensional analysis module 720, visualization drawing module 730, code location module 740, context-aware navigation module, and association modification navigation module can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the large model parsing module 710, multidimensional analysis module 720, visualization drawing module 730, code location module 740, context-aware navigation module, and association modification navigation module can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the large model parsing module 710, multidimensional analysis module 720, visualization drawing module 730, code location module 740, context-aware navigation module, and associated modification navigation module can be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.
[0153] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing a code navigation method according to an embodiment of this application.
[0154] like Figure 8 As shown, an electronic device 900 according to an embodiment of this application includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage portion 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.
[0155] RAM 903 stores various programs and data required for the operation of electronic device 900. Processor 901, ROM 902, and RAM 903 are interconnected via bus 904. Processor 901 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 902 and / or RAM 903. It should be noted that the programs may also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0156] According to embodiments of this application, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to a bus 904. The electronic device 900 may also include one or more of the following components connected to the input / output (I / O) interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.
[0157] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0158] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 902 and / or RAM 903 and / or one or more memories other than ROM 902 and RAM 903 described above.
[0159] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the code navigation method provided in the embodiments of this application.
[0160] When the computer program is executed by the processor 901, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0161] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 909, and / or installed from a removable medium 911. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0162] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, it performs the functions defined in the system of this application embodiment. According to the embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0163] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0165] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A code navigation method characterized by, The method comprises: in response to a user inputting a target query statement, analyzing the target query statement based on a large model to generate navigation element information, wherein the target query statement comprises a target item; based on the target item, performing multi-dimensional code correlation analysis on the navigation element information to generate an association file and a dynamic call chain; visually drawing the association file and the dynamic call chain to generate an interaction graph, and outputting the interaction graph; and in response to the user clicking a graphical node of the interaction graph, positioning to a source code location corresponding to the graphical node based on the graphical node.
2. The method of claim 1, wherein, The navigation element information comprises key semantic elements and functional correlation data, and the multi-dimensional code correlation analysis on the navigation element information based on the target item to generate an association file and a dynamic call chain comprises: performing static analysis on the key semantic elements and the functional correlation data according to the target item to generate the association file; and monitoring the state of the target item in real time, and in the case that the target item is in a running state, dynamically tracking the call chain of the target item according to the key semantic elements to generate the dynamic call chain.
3. The method of claim 2, wherein, The dynamic tracking of the call chain of the target item according to the key semantic elements to generate the dynamic call chain comprises: based on the front-end running environment of the target item, obtaining an application program interface request corresponding to the key semantic elements; according to the key semantic elements, injecting a monitoring logic into a data flow node position of the target item by a method of inserting a stake, and dynamically tracking a data flow direction; and based on the application program interface request and the data flow direction, marking the call chain of the target item with cross-module dependencies to generate the dynamic call chain.
4. The method of claim 2, wherein, The static analysis on the key semantic elements and the functional correlation data according to the target item to generate the association file comprises: performing abstract syntax tree analysis on the target item to extract a data dependency relationship, and constructing a cross-file dependency graph based on the data dependency relationship; matching the key semantic elements with nodes of the cross-file dependency graph; cross-verification of the matching results according to the functional correlation data and the data dependency relationship; and relevance sorting of the screening results to generate the association file.
5. The method of claim 2, wherein, The multi-dimensional code correlation analysis on the navigation element information further comprises: determining a code entity based on the key semantic elements; obtaining a code semantic corresponding to the code entity through a natural language processing model; and performing semantic similarity detection on the code semantic corresponding to the code entity to obtain potential associated module data.
6. The method of claim 5, wherein, The method further comprises: in response to an editing operation of the user, performing context analysis on an identifier corresponding to the editing operation according to the association file and the dynamic call chain; based on the potential associated module data, matching a similar module corresponding to the identifier; and showing the user the context analysis result and the similar module.
7. The method of claim 4, wherein, The method further comprises: In response to the modification operation of the user on the public component, a file path of the public component is retrieved based on the cross-file dependency graph, and component semantic data is obtained based on the file path; Based on the component semantic data, the modification content corresponding to the modification operation is analyzed for similarity, and an associated modification set is obtained; and The associated modification set is displayed to the user.
8. The method of any one of claims 1-7, wherein, The associated file and the dynamic call chain are visually drawn to generate an interaction graph, including: Based on the link structure and the associated file, the dynamic call chain is serialized to generate link data; The link data is mapped into link nodes and link edges; and Based on the link nodes and the link edges, the link data is processed by a graph drawing engine to generate the interaction graph.
9. The method of any one of claims 1-7, wherein, The target query statement is parsed based on a large model to generate navigation element information, including: The target query statement is input into the large model for parsing to obtain an intent parsing result; The intent parsing result is converted into multi-dimensional retrieval elements; and Based on a semantic index database, the multi-dimensional retrieval elements are retrieved to generate the navigation element information.
10. A code navigation apparatus characterized by comprising: The device includes: A large model parsing module for parsing a target query statement based on a large model in response to a user input, to generate navigation element information; wherein the target query statement includes a target project; A multi-dimensional analysis module for performing multi-dimensional code correlation analysis on the navigation element information based on the target project, to generate an associated file and a dynamic call chain; A visual drawing module for visually drawing the associated file and the dynamic call chain to generate an interaction graph, and outputting the interaction graph; and A code positioning module for positioning to a source code location corresponding to a graphical node of the interaction graph based on the graphical node in response to the user clicking the graphical node.
11. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1-9.
12. A computer readable storage medium having stored thereon a computer program or instructions, characterized in that, The computer program or instructions are executed by the processor to implement the steps of the method according to any one of claims 1-9.
13. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions are executed by the processor to implement the steps of the method according to any one of claims 1-9. The computer program or instructions are executed by the processor to implement the steps of the method according to any one of claims 1-9.