A project dependency tree display method, device, system and medium

By generating and converting dependency tree files into JSON format for storage, the problem of requiring local installation of project dependency tree tools was solved, enabling online display and efficient browsing, thus improving development efficiency.

CN115686606BActive Publication Date: 2026-01-30PING AN BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211242469.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-11
Publication Date
2026-01-30
Estimated Expiration
2042-10-11

AI Technical Summary

Technical Problem

In existing technologies, project dependency tree tools require the local installation of development tools and plugins, which leads to inconvenience in generation and display, and affects development efficiency.

Method used

By generating the original dependency tree file and converting it to JSON format and storing it in the database, the dependency tree can be displayed online in response to frontend requests, avoiding the need to download local tools and plugins.

Benefits of technology

It enables a quick and intuitive display of the project dependency tree in the browser, saving browsing time and improving development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686606B_ABST
    Figure CN115686606B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, system, and medium for displaying a project dependency tree. The method includes: generating a dependency tree source file based on the obtained project source code; parsing the dependency tree source file and converting it into a corresponding dependency tree JSON file and storing it in a database; responding to a dependency tree display request sent by the front end, retrieving the corresponding target JSON file from the database and returning it to the front end, so that the front end can parse and display the corresponding target dependency tree based on the target JSON file. By pre-generating the dependency tree source file based on the project source code and converting it to JSON format for storage, a dependency tree display request can be initiated from the front end via an online browser. Based on the display request, the corresponding JSON file can be flexibly retrieved and returned to the front end, achieving the effect of quickly displaying and intuitively browsing the project dependency tree on the front-end browser. Users do not need to download additional development tools and plugins, greatly saving browsing time and improving display and development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a project dependency tree display method, device, system and medium. BACKGROUND

[0002] At present, in the development process of java, different developers may refer to different versions of third-party dependency packages of the same function at different times, which may cause java project dependency version conflicts during compilation. The dependency tree of the java project is a very important tool for java developers to solve java project dependency conflicts and optimize java project dependency management. The root cause of the conflict can be analyzed through the dependency tree.

[0003] However, the project dependency tree tool is integrated in the java development tool at present, and the function can be realized only by installing the development tool and the corresponding plug-in on the local computer, which makes the generation and display of the project dependency tree inconvenient and affects the development efficiency. SUMMARY

[0004] In view of the above deficiencies of the prior art, the purpose of the present application is to provide a project dependency tree display method, device, system and medium applicable to the field of financial technology or other related fields, so as to improve the generation and display efficiency of the project dependency tree and provide convenience for developers.

[0005] The technical scheme of the present application is as follows:

[0006] A project dependency tree display method comprises the following steps:

[0007] Generating a dependency tree original file according to the obtained project source code;

[0008] Parsing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing it in a database;

[0009] In response to a dependency tree display request sent by the front end, the corresponding target JSON file is retrieved from the database and returned to the front end, so that the front end can parse and display the corresponding target dependency tree according to the target JSON file.

[0010] In one embodiment, the dependency tree original file is generated according to the obtained project source code, comprising:

[0011] Obtaining the project source code from the source code repository according to the project address;

[0012] Project building is performed on the project source code to obtain the dependency file of each project module;

[0013] All dependency files and file paths in the project are obtained by traversal, and a dependency tree original file is generated.

[0014] In one embodiment, the dependency file is a graphml file.

[0015] In one embodiment, the parsing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing into the database comprises:

[0016] parsing the dependency tree original file according to a preset rule, obtaining the content of a preset label in the dependency tree original file and adding to a preset list;

[0017] traversing the elements in the preset list to obtain preset attribute values of each element;

[0018] generating a corresponding dependency tree JSON file according to the preset attribute values and saving to the database.

[0019] In one embodiment, the preset label includes a graph label, a node label and an edge label, and the preset attribute values include a source attribute, a target attribute, an id attribute, a label attribute and a children attribute.

[0020] In one embodiment, in response to the dependency tree display request sent by the front end, the corresponding target JSON file is called in the database and returned to the front end, comprising:

[0021] receiving the dependency tree display request sent by the front end, the dependency tree display request carrying a target project identifier;

[0022] obtaining the corresponding target JSON file in the database according to the target project identifier;

[0023] sending the target JSON file to the front end.

[0024] In one embodiment, in response to the dependency tree display request sent by the front end, the corresponding target JSON file is called in the database and returned to the front end, so that after the front end parses and displays the corresponding target dependency tree according to the target JSON file, the method further comprises:

[0025] in response to the click operation of the user on the target dependency tree, obtaining the node identifier of the current clicked node;

[0026] obtaining the corresponding node dependency data in the database according to the node identifier;

[0027] returning the node dependency data to the front end, so that the front end loads and displays the corresponding dependency tree node according to the node dependency data.

[0028] A project dependency tree display device comprises:

[0029] A generation module is configured to generate a dependency tree original file according to the acquired project source code;

[0030] A conversion module is configured to parse and convert the dependency tree original file into a corresponding dependency tree JSON file and store the dependency tree JSON file into a database;

[0031] A display module is configured to, in response to a dependency tree display request sent by a front end, call a corresponding target JSON file from the database and return the target JSON file to the front end, so that the front end parses and displays a corresponding target dependency tree according to the target JSON file.

[0032] A project dependency tree display system comprises at least one processor; and,

[0033] A memory in communication connection with the at least one processor; wherein,

[0034] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the project dependency tree display method.

[0035] A non-volatile computer readable storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors to enable the one or more processors to execute the project dependency tree display method.

[0036] Advantages: The project dependency tree display method, device, system and medium disclosed by the present application can generate a dependency tree original file according to project source code in advance and convert the dependency tree original file into a JSON format for storage, so that a dependency tree display request can be initiated at a front end in an online manner through a browser, a corresponding JSON file can be flexibly called and fed back to the front end based on the display request, and the project dependency tree can be quickly displayed and intuitively browsed on the front end browser, without the need for a user to additionally download a development tool and a plug-in, thereby greatly saving the browsing time of the project dependency tree and improving the display and development efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0037] The present application will be further described below with reference to the accompanying drawings and embodiments, wherein:

[0038] Figure 1 A flowchart of the project dependency tree display method provided by the embodiments of the present application is shown in the figure;

[0039] Figure 2A flowchart of step S100 in the project dependency tree display method provided in an embodiment of the present invention;

[0040] Figure 3 A flowchart of step S200 in the project dependency tree display method provided in an embodiment of the present invention;

[0041] Figure 4 A flowchart of step S300 in the project dependency tree display method provided in an embodiment of the present invention;

[0042] Figure 5 Another flowchart of the method for displaying the project dependency tree provided in an embodiment of the present invention;

[0043] Figure 6 A schematic diagram of the functional modules of the project dependency tree display device provided in an embodiment of the present invention;

[0044] Figure 7 A schematic diagram of the hardware structure of the project dependency tree display system provided in an embodiment of the present invention. Detailed Implementation

[0045] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention is further described in detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The embodiments of the invention are described below in conjunction with the accompanying drawings.

[0046] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the project dependency tree display method provided by the present invention. The project dependency tree display method provided in this embodiment is suitable for convenient online display of the project dependency tree during the development process. Specifically, it is applied to a system comprising terminal devices, a network, and a server. The network serves as the medium for providing a direct communication link between the terminal device and the server, and can include various connection types, such as wired, wireless communication links, or fiber optic cables. The operating system on the terminal device can include a handheld device operating system (iPhone operating system, iOS system), Android system, or other operating systems. The terminal device connects to the server via the network to achieve interaction, thereby performing operations such as receiving or sending data. Specifically, it can be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, portable computers, and desktop servers. Figure 1 As shown, the method specifically includes the following steps:

[0047] S100. Generate the dependency tree original file based on the obtained project source code.

[0048] In the embodiment, when it is detected that the project source code is submitted by the developer, the project source code is acquired and the corresponding dependency tree original file is generated, which is used as the basis of the dependency relationship for generating and displaying the project dependency tree.

[0049] In one embodiment, referring to Figure 2 , the flowchart of step S100 in the method for displaying the project dependency tree provided by the embodiment is shown in Figure 2 , and step S100 includes:

[0050] S101, acquiring the project source code in the source code repository according to the project address;

[0051] S102, performing project construction on the project source code to obtain the dependency file of each project module;

[0052] S103, traversing all the dependency files and file paths in the project to generate the dependency tree original file.

[0053] In the embodiment, the open-source distributed version control system Git is used to manage the project source code, which uses the distributed version library to make the release and exchange of the source code extremely convenient and facilitate the cooperation between different developers.

[0054] When the project source code is submitted to the source code repository, the corresponding project address is generated. Therefore, when the dependency tree original file is generated, the project source code is accurately obtained based on the project address, and then the project construction is performed on the acquired project source code. Specifically, the maven construction tool can be used to achieve this. The corresponding dependency file output parameter is added in the maven compilation command, so that after the maven construction command is executed, the corresponding dependency file will be generated in the target folder of each project module, which contains the jar package dependency related information under each module. In the specific implementation, the dependency file is a graphml file.

[0055] The dependency tree original file of the entire project is generated based on the dependency file of each project module. Through the traversal and searching method, the file with the graphml suffix under the entire project is searched, and the related information such as the file name and file path is recorded to obtain the dependency tree original file list, and then the accurate and complete dependency tree original file is generated, which provides the data basis for the online project dependency tree display.

[0056] S200, the dependency tree original file is parsed and converted into the corresponding dependency tree JSON file and stored in the database.

[0057] In the embodiment, to realize efficient online display requirement, the dependency tree original file is further converted into a corresponding dependency tree JSON file. The JSON (JavaScript Object Notation, JS object notation) is a lightweight data exchange format, easy to machine parsing and generation, and effectively improves the network transmission efficiency. The dependency tree JSON file obtained each time is stored in the database, facilitating flexible calling and transmission.

[0058] In one embodiment, referring to Figure 3 , which is a flowchart of step S200 in the project dependency tree display method provided by the embodiment, as shown in Figure 3 , step S200 includes:

[0059] S201, parsing the dependency tree original file according to a preset rule, obtaining the content of a preset label in the dependency tree original file and adding it to a preset list;

[0060] S202, traversing the elements in the preset list to obtain preset attribute values of each element;

[0061] S203, generating a corresponding dependency tree JSON file according to the preset attribute values and saving it to the database.

[0062] In the embodiment, when the dependency tree original file is parsed into a JSON file, the dependency tree original file is specifically traversed, each graphml dependency file in the dependency tree original file is parsed according to the xml rule, the content of a preset label in each graphml file is recorded and added to a corresponding preset list, the graph label, node label and edge label content of each file are specifically recorded and added to a corresponding list, then the elements in each preset list are traversed to obtain preset attribute values of each element, a corresponding dependency tree JSON file is generated according to the preset attribute values of the elements and saved to the database, to realize lightweight and efficient data transmission.

[0063] In the edge list, a loop is traversed to analyze each element, and the source attribute under the element and the target attribute of the element are obtained. In the node list, a loop is traversed to analyze each element, and the id attribute, the label attribute, and the children attribute under the element are obtained, and these attribute values are combined into a corresponding JSON array. The children attribute is further recursively judged to determine whether the content is empty. If not, it is determined that there is a child node, and therefore the id, label, and children attribute values of the element under the children are further obtained and combined into a corresponding JSON array. The corresponding source-target relationship is found in the edge list according to the id, and the corresponding relationship is added to the synthesized JSON array. When the loop and recursion of all elements in the node list are completed, the final dependency tree JSON file is generated, which is saved to the database for flexible calling of data.

[0064] S300, in response to the dependency tree display request sent by the front end, the corresponding target JSON file is retrieved from the database and returned to the front end, so that the front end parses and displays the corresponding target dependency tree according to the target JSON file.

[0065] In the embodiment, when the development tester needs to view the project dependency tree of the specified project version, the dependency tree display request can be initiated by the front-end browser to the back-end server, specifically an HTTP request. The back-end server responds to the dependency tree display request sent by the front end, retrieves the corresponding target JSON file from the database and returns it to the front end. After receiving the returned target JSON file, the front end parses and loads it, and then intuitively and efficiently displays the response target dependency tree on the front end, realizing quick and intuitive project dependency tree browsing without downloading project code to the local and without downloading and installing development tools and plug-ins, saving a lot of compilation and installation time and improving the display efficiency and convenience of the project dependency tree.

[0066] In one embodiment, please refer to Figure 4 , which is a flowchart of step S300 in the project dependency tree display method provided by the embodiment of the application, as shown in Figure 4 , step S300 includes:

[0067] S301, receiving the dependency tree display request sent by the front end, the dependency tree display request carrying a target project identifier;

[0068] S302, obtaining the corresponding target JSON file from the database according to the target project identifier;

[0069] S303, sending the target JSON file to the front end.

[0070] In the embodiment, the front end sends a dependency tree display request to the back end by receiving a target project identifier input by a development tester, and the specific target project identifier is a project unique id. An HTTP request is sent to the back end by carrying the project unique id. The back end obtains a target JSON file from the database based on the project unique id, and sends the target JSON file to the front end for parsing to obtain corresponding JSON data. The front end loads an element tree component, and binds the JSON data returned by the request in the data attribute of the component, so as to realize online and rapid browsing and display of the project dependency tree.

[0071] In one embodiment, please refer to Figure 5 which is another flowchart of the project dependency tree display method provided by the embodiment of the application, as shown in Figure 5 After step S300, the method further includes:

[0072] S400, in response to a click operation of a user on the target dependency tree, obtaining a node identifier of a current clicked node;

[0073] S500, obtaining corresponding node dependency data in the database according to the node identifier;

[0074] S600, returning the node dependency data to the front end, so that the front end loads and displays corresponding dependency tree nodes according to the node dependency data.

[0075] In the embodiment, a user such as a development tester can perform a click operation on the target dependency tree displayed on the front end, and click each node on the tree diagram. In response to the click operation input by the user, a node identifier such as a node id of a current clicked node is obtained. Based on the node id, corresponding node dependency data is obtained from the data and returned to the front end. The front end further loads and displays corresponding dependency tree nodes based on the returned node data. That is, by binding the click operation, the back end requests child node data based on the node id triggered by the user after clicking the node, so as to achieve a dynamic effect of expanding and folding the dependency tree data. At the same time, by using the on-demand loading mode, the child node data does not need to be loaded at first, so as to reduce the amount of data loaded at first and improve the data loading speed and the display speed of the project dependency tree.

[0076] Another embodiment of the application provides a project dependency tree display device, as shown in Figure 6 The device 1 includes:

[0077] The generation module 11 is configured to generate a dependency tree original file based on the obtained project source code.

[0078] The conversion module 12 is configured to parse and convert the dependency tree original file into a corresponding dependency tree JSON file and store the dependency tree JSON file in the database.

[0079] The display module 13 is configured to, in response to a dependency tree display request sent by the front end, call a corresponding target JSON file in the database and return the target JSON file to the front end, so that the front end parses and displays a corresponding target dependency tree according to the target JSON file.

[0080] The module in the present application refers to a series of computer program instruction segments capable of completing a specific function, and is more suitable for describing the execution process of the display of the project dependency tree. The specific implementation of each module can be referred to the corresponding method embodiments described above, and will not be described here.

[0081] In one embodiment, the generation module 11 comprises:

[0082] The code acquisition unit is configured to acquire project source code in the source code warehouse according to the project address;

[0083] The project construction unit is configured to perform project construction on the project source code to obtain dependency files of each project module;

[0084] The file generation unit is configured to traverse all dependency files and file paths in the project to generate a dependency tree original file.

[0085] In one embodiment, the dependency file is a graphml file.

[0086] In one embodiment, the conversion module 12 comprises:

[0087] The file parsing unit is configured to parse the dependency tree original file according to a preset rule, acquire content of a preset label in the dependency tree original file, and add the content to a preset list;

[0088] The element traversal unit is configured to traverse elements in the preset list to obtain preset attribute values of each element;

[0089] The conversion storage unit is configured to generate a corresponding dependency tree JSON file according to the preset attribute values and save the dependency tree JSON file in the database.

[0090] In one embodiment, the preset label comprises a graph label, a node label and an edge label, and the preset attribute value comprises a source attribute, a target attribute, an id attribute, a label attribute and a children attribute.

[0091] In one embodiment, the display module 13 comprises:

[0092] The receiving unit is configured to receive a dependency tree display request sent by the front end, and the dependency tree display request carries a target project identifier;

[0093] a file acquisition unit, configured to acquire a target JSON file corresponding to the target project according to the target project identifier in the database;

[0094] a returning unit, configured to send the target JSON file to the front end.

[0095] In one embodiment, the apparatus 1 further comprises:

[0096] a click response module, configured to acquire a node identifier of a current clicked node in response to a click operation of a user on the target dependency tree;

[0097] a node acquisition module, configured to acquire node dependency data corresponding to the node identifier in the database according to the node identifier;

[0098] a node returning module, configured to return the node dependency data to the front end, so that the front end loads and displays a corresponding dependency tree node according to the node dependency data.

[0099] Another embodiment of the present application provides a project dependency tree display system, as shown in Figure 7 The system 10 comprises:

[0100] one or more processors 110 and memories 120, Figure 7 In an embodiment, the processor 110 is taken as an example for description, and the processor 110 and the memory 120 can be connected through a bus or other means, Figure 7 In an embodiment, the processor 110 and the memory 120 are connected through a bus.

[0101] The processor 110 is configured to complete various control logics of the system 10, and can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components or any combination of these components. In addition, the processor 110 can also be any conventional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in combination with a DSP and / or any other such configuration.

[0102] The memory 120, as a non-volatile computer readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the project dependency tree display method in the embodiment of the present application. The processor 110 executes the non-volatile software programs, instructions and units stored in the memory 120, thereby performing various functional applications and data processing of the system 10, that is, implementing the project dependency tree display method in the above-mentioned method embodiment.

[0103] The memory 120 can include a program storage area and a data storage area, wherein the program storage area can store an operating system and application programs required by at least one function; the data storage area can store data created according to the use of the system 10, etc. In addition, the memory 120 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 can optionally include a memory remotely arranged with respect to the processor 110, and these remote memories can be connected to the system 10 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0104] One or more units are stored in the memory 120, and when executed by the one or more processors 110, the following steps are implemented:

[0105] Generating a dependency tree original file according to the obtained project source code;

[0106] Parsing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing it into a database;

[0107] In response to a dependency tree display request sent by a front end, the corresponding target JSON file is retrieved from the database and returned to the front end, so that the front end parses and displays the corresponding target dependency tree according to the target JSON file.

[0108] In one embodiment, the generating of the dependency tree original file according to the obtained project source code comprises:

[0109] Obtaining project source code in a source code repository according to a project address;

[0110] Project building is performed on the project source code to obtain dependency files of each project module;

[0111] All dependency files and file paths in the project are traversed to generate a dependency tree original file.

[0112] In one embodiment, the dependency file is a graphml file.

[0113] In one embodiment, the parsing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing into the database comprises:

[0114] parsing the dependency tree original file according to a preset rule, obtaining content of a preset label in the dependency tree original file and adding to a preset list;

[0115] traversing elements in the preset list to obtain preset attribute values of each element;

[0116] generating a corresponding dependency tree JSON file according to the preset attribute values and saving into the database.

[0117] In one embodiment, the preset label comprises a graph label, a node label and an edge label, and the preset attribute values comprise a source attribute, a target attribute, an id attribute, a label attribute and a children attribute.

[0118] In one embodiment, the method comprises:

[0119] receiving a dependency tree display request sent by the front end, the dependency tree display request carrying a target project identifier;

[0120] obtaining a corresponding target JSON file in the database according to the target project identifier;

[0121] sending the target JSON file to the front end.

[0122] In one embodiment, the method comprises:

[0123] obtaining a node identifier of a current clicked node in response to a click operation of a user on the target dependency tree;

[0124] obtaining corresponding node dependency data in the database according to the node identifier;

[0125] returning the node dependency data to the front end, so that the front end loads and displays a corresponding dependency tree node according to the node dependency data.

[0126] The embodiment of the present application provides a kind of nonvolatile computer readable storage medium, computer readable storage medium stores computer executable instruction, the computer executable instruction is executed by one or more processors, for example, the method steps S100 to S300 in the above description Figure 1 Are executed.

[0127] As an example, nonvolatile storage medium can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By illustration but not limitation, RAM can be in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM) and direct Rambus (Rambus) RAM (DRRAM). The disclosed memory components or memory of the operating environment described herein are intended to include one or more of these and / or any other suitable type of memory.

[0128] In summary, the disclosed project dependency tree display method, device, system and medium rely on the method, which generates a dependency tree original file according to the obtained project source code; the dependency tree original file is parsed and converted into a corresponding dependency tree JSON file and stored in the database; in response to the dependency tree display request sent by the front end, the corresponding target JSON file is retrieved from the database and returned to the front end, so that the front end parses and displays the corresponding target dependency tree according to the target JSON file. By pre-generating a dependency tree original file according to the project source code and converting it into a JSON format for storage, the dependency tree display request can be initiated on the front end through the online mode of the browser, the corresponding JSON file can be flexibly retrieved and fed back to the front end based on the display request, and the effect of quickly displaying and intuitively browsing the project dependency tree on the front end browser can be realized. Without additional downloading of development tools and plug-ins, the browsing time of project dependency tree is greatly saved, and the display and development efficiency is improved.

[0129] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware (such as a processor, a controller, etc.), and the computer program can be stored in a non-volatile computer readable storage medium. The computer program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, a floppy disk, a flash memory, an optical storage, etc.

[0130] It is to be understood that the application is not limited to the examples described above, which can be modified or adapted in several ways by those skilled in the art without departing from the scope of the present application, as defined by the appended claims.

Claims

1. A method of presenting a project dependency tree, characterized by, The method comprises the following steps: generating a dependency tree original file according to the obtained project source code; parsing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing the dependency tree JSON file into a database; in response to a dependency tree display request sent by a front end, calling a corresponding target JSON file in the database and returning the target JSON file to the front end, so that the front end parses and displays a corresponding target dependency tree according to the target JSON file; the parsing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing the dependency tree JSON file into a database comprises: parsing the dependency tree original file according to a preset rule, obtaining the content of a preset label in the dependency tree original file and adding the content to a preset list; traversing the elements in the preset list to obtain preset attribute values of each element; generating a corresponding dependency tree JSON file according to the preset attribute values and saving the dependency tree JSON file into the database; the preset label comprises a graph label, a node label and an edge label, and the preset attribute values comprise a source attribute, a target attribute, an id attribute, a label attribute and a children attribute.

2. The method of claim 1, wherein, The method comprises the following steps: obtaining project source code in a source code repository according to a project address; performing project construction on the project source code to obtain dependency files of each project module; traversing all dependency files and file paths in the project to generate a dependency tree original file.

3. The method of claim 2, wherein, The dependency file is a graphml file.

4. The method of claim 1, wherein, The method comprises the following steps: receiving a dependency tree display request sent by a front end, the dependency tree display request carrying a target project identifier; obtaining a corresponding target JSON file in the database according to the target project identifier; sending the target JSON file to the front end.

5. The method of claim 1, wherein, After the front end parses and displays a corresponding target dependency tree according to the target JSON file in response to a dependency tree display request sent by the front end, the method further comprises the following steps: in response to a click operation of a user on the target dependency tree, obtaining a node identifier of a currently clicked node; obtaining corresponding node dependency data in the database according to the node identifier; returning the node dependency data to the front end, so that the front end loads and displays a corresponding dependency tree node according to the node dependency data.

6. A device for displaying a project dependency tree, characterized in that, The method comprises the following steps: a generation module is configured to generate a dependency tree original file according to obtained project source code; a conversion module is configured to parse and convert the dependency tree original file into a corresponding dependency tree JSON file and store the dependency tree JSON file into a database; a display module is configured to, in response to a dependency tree display request sent by a front end, call a corresponding target JSON file in the database and return the target JSON file to the front end, so that the front end parses and displays a corresponding target dependency tree according to the target JSON file; the conversion module comprises: The file analysis unit is configured to analyze the dependency tree original file according to a preset rule, obtain content of a preset label in the dependency tree original file, and add the content to a preset list; The element traversal unit is configured to traverse elements in the preset list to obtain preset attribute values of each element; The conversion storage unit is configured to generate a corresponding dependency tree JSON file according to the preset attribute values and save the dependency tree JSON file in a database. The preset label includes a graph label, a node label, and an edge label, and the preset attribute value includes a source attribute, a target attribute, an id attribute, a label attribute, and a children attribute.

7. A system for displaying a project dependency tree, the system comprising: The system includes at least one processor; and The memory is in communication connection with the at least one processor; wherein The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the project dependency tree display method of any one of claims 1-5.

8. A non-transitory computer readable storage medium, comprising: The non-volatile computer readable storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors to enable the one or more processors to perform the project dependency tree display method of any one of claims 1-5.

Citation Information

Patent Citations

  • Method for checking software package dependency relationship based on dependency

    CN102073583A

  • Task dependency graph display method suitable for Azkaban and related equipment

    CN112925997A