CN115686606A - Method, device, system and medium for displaying item dependency tree - Google Patents
Method, device, system and medium for displaying item dependency tree Download PDFInfo
- Publication number
- CN115686606A CN115686606A CN202211242469.7A CN202211242469A CN115686606A CN 115686606 A CN115686606 A CN 115686606A CN 202211242469 A CN202211242469 A CN 202211242469A CN 115686606 A CN115686606 A CN 115686606A
- Authority
- CN
- China
- Prior art keywords
- dependency tree
- file
- project
- json file
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000001419 dependent effect Effects 0.000 claims description 42
- 238000010276 construction Methods 0.000 claims description 10
- 230000004044 response Effects 0.000 claims description 8
- 238000006243 chemical reaction Methods 0.000 claims description 5
- 238000011161 development Methods 0.000 abstract description 14
- 230000000694 effects Effects 0.000 abstract description 5
- 230000008569 process Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000004590 computer program Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses a method, a device, a system and a medium for displaying a project dependency tree, wherein the method comprises the following steps: generating a dependency tree original file according to the acquired project source code; analyzing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing the dependency tree JSON file into a database; and responding to a dependency tree display request sent by the front end, calling a corresponding target JSON file from the database and returning the target JSON file to the front end, so that the front end analyzes and displays the corresponding target dependency tree according to the target JSON file. The dependency tree original file is generated in advance according to the project source code and converted into the JSON format for storage, so that a dependency tree display request can be initiated at the front end in an online mode of a browser, the corresponding JSON file is flexibly called and fed back to the front end based on the display request, the effect of rapidly displaying and visually browsing the project dependency tree on the front-end browser is achieved, a user does not need to additionally download a development tool and a plug-in, the browsing time of the project dependency tree is greatly saved, and the display and development efficiency is improved.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, a system and a medium for displaying a project dependency tree.
Background
At present, in the development process of java, different developers may refer to different versions to a third-party dependent package with the same function at different periods, so that a java item dependent version conflict is caused during compiling, a java item dependent tree is a very important tool for solving the java item dependent conflict and optimizing java item dependent management of java developers, and the root cause of the conflict can be analyzed through the dependent tree.
However, at present, the tool of the project dependency tree is integrated in a java development tool, and the function can be realized only by locally installing the development tool and a corresponding plug-in, so that the generation and display of the project dependency tree are inconvenient, and the development efficiency is influenced.
Disclosure of Invention
In view of the above-mentioned deficiencies of the prior art, an object of the present invention is to provide a method, an apparatus, a system and a medium for displaying a project dependency tree, which can be applied to financial technology or other related fields, and aims to improve the efficiency of generating and displaying the project dependency tree and provide convenience for developers.
The technical scheme of the invention is as follows:
a method for displaying a project dependency tree comprises the following steps:
generating a dependency tree original file according to the acquired project source code;
analyzing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing the dependency tree JSON file into a database;
and responding to a dependency tree display request sent by a front end, calling a corresponding target JSON file from the database and returning the target JSON file to the front end, so that the front end analyzes and displays the corresponding target dependency tree according to the target JSON file.
In an embodiment, the generating a dependency tree original file according to the acquired project source code includes:
acquiring a project source code in a source code warehouse according to the project address;
project construction is carried out on the project source codes to obtain a dependent file of each project module;
and traversing to obtain all the dependent files and file paths in the project and generating the original files of the dependent tree.
In one embodiment, the dependent file is a graph ml file.
In one embodiment, the parsing and converting the dependency tree raw file into a corresponding dependency tree JSON file and storing the dependency tree JSON file in a database includes:
analyzing the dependency tree original file according to a preset rule, acquiring 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 a preset attribute value of each element;
and generating a corresponding dependency tree JSON file according to the preset attribute value and storing the dependency tree JSON file in a database.
In one embodiment, the preset tags include a graph tag, a node tag, and an edge tag, and the preset attribute values include a source attribute, a target attribute, an id attribute, a label attribute, and a child attribute.
In one embodiment, the invoking, in response to a dependency tree display request sent by a front end, a corresponding target JSON file in the database and returning the target JSON file to the front end includes:
receiving a dependency tree display request sent by a front end, wherein the dependency tree display request carries a target item identifier;
acquiring a corresponding target JSON file in the database according to the target project identifier;
and sending the target JSON file to the front end.
In one embodiment, in response to a dependency tree display request sent by a front end, the method further includes, after calling a corresponding target JSON file from 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 method further includes:
responding to the clicking operation of the user on the target dependency tree, and acquiring a node identifier of a current clicked node;
acquiring corresponding node dependent data in the database according to the node identification;
and returning the node dependent data to a front end, so that the front end loads and displays the corresponding dependent tree node according to the node dependent data.
A presentation apparatus of a project dependency tree, comprising:
the generating module is used for generating a dependency tree original file according to the acquired project source code;
the conversion module is used for analyzing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing the dependency tree JSON file into a database;
and the display module is used for responding to a dependency tree display request sent by the front end, calling a corresponding target JSON file from the database and returning the target JSON file to the front end, so that the front end analyzes and displays the corresponding target dependency tree according to the target JSON file.
A presentation system of a dependency tree for an item, the system comprising at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method for presenting the item dependency tree.
A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the above-described method of exposing an item dependency tree.
Has the beneficial effects that: compared with the prior art, the embodiment of the invention generates the original dependency tree file according to the project source code in advance and converts the original dependency tree file into the JSON format for storage, so that the dependency tree display request can be initiated at the front end in an online mode of a browser, the corresponding JSON file can be flexibly called and fed back to the front end based on the display request, the effects of quickly displaying and visually browsing the dependency tree of the project on the front-end browser are realized, a user does not need to additionally download development tools and plug-ins, the browsing time of the dependency tree of the project is greatly saved, and the display and development efficiency is improved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flowchart of a method for displaying a project dependency tree according to an embodiment of the present invention;
fig. 2 is a flowchart of step S100 in the method for displaying the item dependency tree according to the embodiment of the present invention;
fig. 3 is a flowchart of step S200 in the method for displaying the item dependency tree according to the embodiment of the present invention;
fig. 4 is a flowchart of step S300 in the method for displaying the item dependency tree according to the embodiment of the present invention;
FIG. 5 is another flowchart of a method for displaying a project dependency tree according to an embodiment of the present invention;
FIG. 6 is a functional block diagram of a device for displaying a dependency tree according to an embodiment of the present invention;
fig. 7 is a schematic hardware structure diagram of a presentation system of a project dependency tree according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is described in further 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. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for displaying a project dependency tree according to an embodiment of the present invention. The method for displaying the project dependency tree provided by the embodiment is suitable for online convenient display of the project dependency tree in the development process, and is particularly applied to a system composed of terminal equipment, a network and a server, wherein the network is a medium for directly providing a communication link between the terminal equipment and the server and can include various connection types, such as wired, wireless communication links or optical fiber cables; the operating system on the terminal device may include an iPhone operating system (iOS system), an android system, or another operating system, and the terminal device is connected to the server through a network to perform an interaction, so as to perform operations such as receiving or sending data, and may specifically be various electronic devices having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a portable computer, a desktop server, and the like. As shown in fig. 1, the method specifically includes the following steps:
and S100, generating a dependency tree original file according to the acquired project source code.
In this embodiment, when it is detected that a developer submits a project source code, the project source code is acquired and a corresponding original dependency tree file is generated as a basis of a dependency relationship between the generation and display of the project dependency tree.
In an embodiment, please refer to fig. 2, which is a flowchart illustrating a step S100 of a method for displaying a project dependency tree according to an embodiment of the present invention, where as shown in fig. 2, the step S100 includes:
s101, acquiring a project source code in a source code warehouse according to a project address;
s102, project construction is carried out on the project source codes to obtain a dependent file of each project module;
and S103, traversing to obtain all the dependent files and file paths in the project, and generating the original dependent tree file.
In the embodiment, the project source code is managed by adopting the open-source distributed version control system Git, and a distributed version library mode is adopted, so that the source code is extremely convenient to release and exchange, and the cooperation among different developers is facilitated.
When an item source code is submitted to a source code warehouse, a corresponding item address is generated, therefore, when a dependency tree original file is generated, the item source code is accurately obtained based on the item address, then the obtained item source code is analyzed for item construction, the construction can be specifically realized through a maven construction tool, corresponding dependency file output parameters are added in a maven compiling command, after the maven construction command is executed, a corresponding dependency file is generated under a target folder of each item module, the dependency file comprises jar package dependency related information under each module, and in specific implementation, the dependency file is a graphlml file.
Generating a dependency tree original file of the whole project based on the dependency file of each project module, searching a file with a suffix of graph ml under the whole project in a traversal searching mode, recording related information such as file names, file paths and the like to obtain a dependency tree original file list, further generating an accurate and complete dependency tree original file, and providing a data basis for online project dependency tree display.
And S200, analyzing 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 this embodiment, in order to implement efficient online display requirements, the dependency tree original file is further parsed and converted into a corresponding dependency tree JSON file, where JSON (JSON Object Notation ) is a lightweight data exchange format, is easy for machine parsing and generation, effectively improves network transmission efficiency, and stores all dependency tree JSON files generated and converted each time in a database, thereby facilitating flexible calling and transmission.
In an embodiment, please refer to fig. 3, which is a flowchart illustrating a step S200 of a method for displaying a project dependency tree according to an embodiment of the present invention, where as shown in fig. 3, the step S200 includes:
s201, analyzing the dependency tree original file according to a preset rule, acquiring the content of a preset label in the dependency tree original file and adding the content into a preset list;
s202, traversing the elements in the preset list to obtain a preset attribute value of each element;
and S203, generating a corresponding dependency tree JSON file according to the preset attribute value and storing the dependency tree JSON file into a database.
In this embodiment, when the dependency tree original file is parsed into JSON files, the dependency tree original file is specifically traversed, each graph ml dependency file in the dependency tree original file is parsed according to an xml rule, the content of a preset tag in each graph ml file is recorded and added to a corresponding preset list, the content of a graph tag, a node tag, and an edge tag of each file is specifically recorded and added to a corresponding list, then, elements in each preset list are traversed to obtain a preset attribute value of each element, and a corresponding dependency tree JSON file is generated according to the preset attribute value of the element and stored in a database, so that lightweight efficient data transmission is realized.
In specific implementation, in an edge list, each element in the edge list is subjected to traversal cyclic analysis, and a source attribute and a target attribute of the element under the element are obtained; in a node list, each element in the node list is traversed and circulated, an id attribute, a label attribute and a child attribute under the element are obtained, the attribute values are combined into a corresponding JSON array, meanwhile, the child attribute is further recursively judged, whether the content is empty or not is judged, if the content is not empty, a child node exists, and therefore the id, the label and the child attribute values of the element under the child are further obtained and combined into a corresponding JSON array; finding out the corresponding relation between the source and the target in the edge list according to the id, and adding the corresponding relation into the synthesized JSON array; and when all elements in the node list are traversed and recurred, generating a final dependency tree JSON file, and storing the final dependency tree JSON file in a database so as to be convenient for flexible calling of data.
S300, responding to a dependency tree display request sent by the front end, calling a corresponding target JSON file from the database and returning the target JSON file to the front end, so that the front end analyzes and displays a corresponding target dependency tree according to the target JSON file.
In the embodiment, when a development tester needs to check the project dependency tree of a specified project version, a dependency tree display request, specifically an http request, is initiated to a back-end server through a front-end browser, the back-end responds to the dependency tree display request sent by the front-end, a corresponding target JSON file is called from a database and returned to the front-end, the front-end analyzes and loads the returned target JSON file after receiving the target JSON file, and then the responded target dependency tree is visually and efficiently displayed at the front-end, so that rapid and visual project dependency tree browsing is realized, project codes do not need to be downloaded to the local, development tools and plug-ins do not need to be downloaded and installed, a large amount of compiling and installing time is saved, and the display efficiency and convenience of the project dependency tree are improved.
In an embodiment, please refer to fig. 4, which is a flowchart of step S300 in the method for displaying the item dependency tree according to the embodiment of the present invention, as shown in fig. 4, step S300 includes:
s301, receiving a dependency tree display request sent by a front end, wherein the dependency tree display request carries a target project identifier;
s302, acquiring a corresponding target JSON file in the database according to the target project identifier;
and S303, sending the target JSON file to the front end.
In the embodiment, a dependency tree display request is sent to a rear end by a front end through receiving a target item identifier input by a development tester, the specific target item identifier is an item unique id, an http request is sent to the rear end by carrying the item unique id, the rear end correspondingly obtains a target JSON file in a database according to the item unique id and sends the target JSON file to the front end to analyze the target JSON file to obtain corresponding JSON data, and the front end loads an element tree component and binds JSON data returned by the request in a data attribute of the component, so that online rapid browsing display of the item dependency tree is realized.
In an embodiment, please refer to fig. 5, which is another flowchart of a method for displaying a project dependency tree according to an embodiment of the present invention, as shown in fig. 5, after step S300, the method further includes:
s400, responding to the clicking operation of the user on the target dependency tree, and acquiring a node identifier of a current clicked node;
s500, acquiring corresponding node dependence data in the database according to the node identification;
s600, returning the node dependent data to the front end, so that the front end loads and displays corresponding dependent tree nodes according to the node dependent data.
In this embodiment, a user such as a development tester may click on a target dependency tree displayed at a front end, click on each node on a tree diagram, respond to a click operation input by the user, obtain a node identifier of a currently clicked node, such as a node id, obtain corresponding node dependency data in data based on the node id, and return the node dependency data to the front end, so that the front end further follows the returned node to load and display the corresponding dependency tree node, that is, by binding a node click action, a back end is triggered to request child node data according to the node id after clicking the node by the user, a dynamic effect of unfolding and folding the dependency tree data is achieved, and meanwhile, by loading as needed, the child node data does not need to be loaded for the first time to reduce the first data loading amount, and the data loading speed and the display speed of the project dependency tree are improved.
Another embodiment of the present invention provides a device for displaying a project dependency tree, as shown in fig. 6, the device 1 includes:
the generating module 11 is configured to generate a dependency tree original file according to the acquired project source code;
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 a database;
and 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 from the database and return the target JSON file to the front end, so that the front end parses and displays the corresponding target dependency tree according to the target JSON file.
The modules referred to in the present invention refer to a series of computer program instruction segments capable of performing specific functions, and are more suitable for describing the execution process of the presentation of the item dependency tree than the program.
In one embodiment, the generating module 11 includes:
the code acquisition unit is used for acquiring project source codes in the source code warehouse according to the project addresses;
the project construction unit is used for carrying out project construction on the project source codes to obtain a dependent file of each project module;
and the file generating unit is used for traversing all the dependent files and file paths in the obtained project and generating the original files of the dependent trees.
In one embodiment, the dependent file is a graph ml file.
In one embodiment, the conversion module 12 includes:
the file analysis unit is used for analyzing the dependency tree original file according to a preset rule, acquiring the content of a preset label in the dependency tree original file and adding the content into a preset list;
the element traversing unit is used for traversing the elements in the preset list to obtain a preset attribute value of each element;
and the conversion storage unit is used for generating a corresponding dependency tree JSON file according to the preset attribute value and storing the dependency tree JSON file into a database.
In one embodiment, the preset tags include a graph tag, a node tag, and an edge tag, and the preset attribute values include a source attribute, a target attribute, an id attribute, a label attribute, and a child attribute.
In one embodiment, the display module 13 includes:
the system comprises a receiving unit, a display unit and a display unit, wherein the receiving unit is used for receiving a dependency tree display request sent by a front end, and the dependency tree display request carries a target item identifier;
the file acquisition unit is used for acquiring a corresponding target JSON file in the database according to the target project identifier;
and the return unit is used for sending the target JSON file to the front end.
In one embodiment, the apparatus 1 further comprises:
the click response module is used for responding to the click operation of the user on the target dependency tree and acquiring the node identification of the current click node;
the node acquisition module is used for acquiring corresponding node dependence data in the database according to the node identification;
and the node returning module is used for returning the node dependent data to the front end so that the front end loads and displays the corresponding dependent tree nodes according to the node dependent data.
Another embodiment of the present invention provides a system for displaying a project dependency tree, as shown in fig. 7, the system 10 includes:
one or more processors 110 and a memory 120, where fig. 7 illustrates one processor 110, the processor 110 and the memory 120 may be connected by a bus or other means, and fig. 7 illustrates a connection via a bus.
The memory 120 is a non-volatile computer-readable storage medium, and can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions corresponding to the method for displaying the item dependency tree in the embodiment of the present invention. The processor 110 executes the non-volatile software program, instructions and units stored in the memory 120, so as to execute various functional applications and data processing of the system 10, that is, implement the presentation method of the item dependency tree in the above method embodiment.
The memory 120 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the system 10, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 120 optionally includes memory located remotely from processor 110, which may be connected to system 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more units are stored in the memory 120, and when executed by the one or more processors 110, perform the steps of:
generating a dependency tree original file according to the acquired project source code;
analyzing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing the dependency tree JSON file into a database;
and responding to a dependency tree display request sent by a front end, calling a corresponding target JSON file from the database and returning the target JSON file to the front end, so that the front end analyzes and displays the corresponding target dependency tree according to the target JSON file.
In an embodiment, the generating a dependency tree original file according to the obtained project source code includes:
acquiring a project source code in a source code warehouse according to the project address;
project construction is carried out on the project source codes to obtain a dependent file of each project module;
and traversing to obtain all the dependent files and file paths in the project, and generating the original file of the dependent tree.
In one embodiment, the dependent file is a graph ml file.
In one embodiment, the parsing and converting the dependency tree raw file into a corresponding dependency tree JSON file and storing the dependency tree JSON file in a database includes:
analyzing the dependency tree original file according to a preset rule, acquiring the content of a preset label in the dependency tree original file and adding the content into a preset list;
traversing the elements in the preset list to obtain a preset attribute value of each element;
and generating a corresponding dependency tree JSON file according to the preset attribute value and storing the dependency tree JSON file in a database.
In one embodiment, the preset tags include a graph tag, a node tag, and an edge tag, and the preset attribute values include a source attribute, a target attribute, an id attribute, a label attribute, and a child attribute.
In one embodiment, the invoking, in response to a dependency tree display request sent by a front end, a corresponding target JSON file in the database and returning the target JSON file to the front end includes:
receiving a dependency tree display request sent by a front end, wherein the dependency tree display request carries a target item identifier;
acquiring a corresponding target JSON file in the database according to the target project identifier;
and sending the target JSON file to the front end.
In one embodiment, in response to a dependency tree display request sent by a front end, the method further includes, after calling a corresponding target JSON file from 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 method further includes:
responding to the clicking operation of the user on the target dependency tree, and acquiring a node identifier of a current clicked node;
acquiring corresponding node dependent data in the database according to the node identification;
and returning the node dependent data to a front end so that the front end loads and displays the corresponding dependent tree node according to the node dependent data.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, for example, to perform steps S100-S300 of the method of fig. 1 described above.
By way of example, non-volatile storage media 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), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The disclosed memory components or memory of the operating environment described herein are intended to comprise one or more of these and/or any other suitable types of memory.
In summary, in the method, the device, the system and the medium for displaying the project dependency tree disclosed by the invention, the original file of the dependency tree is generated according to the acquired project source code; analyzing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing the dependency tree JSON file into a database; and responding to a dependency tree display request sent by the front end, calling a corresponding target JSON file from the database and returning the target JSON file to the front end, so that the front end analyzes and displays the corresponding target dependency tree according to the target JSON file. By generating the dependency tree original file according to the project source code in advance and converting the dependency tree original file into the JSON format for storage, a dependency tree display request can be initiated at the front end in an online mode of a browser, the corresponding JSON file can be flexibly called and fed back to the front end based on the display request, the effects of quickly displaying and visually browsing the project dependency tree on the front-end browser are achieved, a user does not need to download a development tool and a plug-in additionally, the browsing time of the project dependency tree is greatly saved, and the displaying and developing efficiency is improved.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program, which may be stored in a non-volatile computer-readable storage medium, and the computer program may include the processes of the above method embodiments when executed. The storage medium may be a memory, a magnetic disk, a floppy disk, a flash memory, an optical memory, etc.
It will be understood that the invention is not limited to the examples described above, but that modifications and variations will occur to those skilled in the art in light of the above teachings, and that all such modifications and variations are considered to be within the scope of the invention as defined by the appended claims.
Claims (10)
1. A method for displaying a project dependency tree is characterized by comprising the following steps:
generating a dependency tree original file according to the acquired project source code;
analyzing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing the dependency tree JSON file into a database;
and responding to a dependency tree display request sent by a front end, calling a corresponding target JSON file from the database and returning the target JSON file to the front end, so that the front end analyzes and displays the corresponding target dependency tree according to the target JSON file.
2. The method for displaying the project dependency tree according to claim 1, wherein the generating of the original dependency tree file according to the obtained project source code includes:
acquiring a project source code in a source code warehouse according to the project address;
project construction is carried out on the project source codes to obtain a dependent file of each project module;
and traversing to obtain all the dependent files and file paths in the project, and generating the original file of the dependent tree.
3. The method for displaying the project dependency tree as claimed in claim 2, wherein the dependency file is a graph ml file.
4. The method for displaying the item dependency tree according to claim 1, wherein parsing and converting the original dependency tree file into a corresponding dependency tree JSON file and storing the dependency tree JSON file in a database comprises:
analyzing the dependency tree original file according to a preset rule, acquiring the content of a preset label in the dependency tree original file and adding the content into a preset list;
traversing the elements in the preset list to obtain a preset attribute value of each element;
and generating a corresponding dependency tree JSON file according to the preset attribute value and storing the dependency tree JSON file in a database.
5. The method for displaying the item dependency tree as claimed in claim 4, wherein the preset tags include a graph tag, a node tag and an edge tag, and the preset attribute values include a source attribute, a target attribute, an id attribute, a label attribute and a child attribute.
6. The method for displaying the item dependency tree according to claim 1, wherein the retrieving the corresponding target JSON file from the database and returning the target JSON file to the front end in response to the dependency tree display request sent by the front end comprises:
receiving a dependency tree display request sent by a front end, wherein the dependency tree display request carries a target item identifier;
acquiring a corresponding target JSON file in the database according to the target project identifier;
and sending the target JSON file to the front end.
7. The method for displaying the item dependency tree according to claim 1, wherein in response to a dependency tree display request sent by a front end, the corresponding target JSON file is called from 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:
responding to the clicking operation of the user on the target dependency tree, and acquiring the node identification of the current clicked node;
acquiring corresponding node dependent data in the database according to the node identification;
and returning the node dependent data to a front end, so that the front end loads and displays the corresponding dependent tree node according to the node dependent data.
8. An apparatus for presenting a dependency tree for an item, comprising:
the generating module is used for generating a dependency tree original file according to the acquired project source codes;
the conversion module is used for analyzing and converting the dependency tree original file into a corresponding dependency tree JSON file and storing the dependency tree JSON file into a database;
and the display module is used for responding to a dependency tree display request sent by the front end, calling the corresponding target JSON file from the database and returning the target JSON file to the front end, so that the front end analyzes and displays the corresponding target dependency tree according to the target JSON file.
9. A system for presentation of a dependency tree for an item, the system comprising at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of displaying a dependency tree of items as claimed in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having stored thereon computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the method of exposing an item dependency tree as recited in any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211242469.7A CN115686606A (en) | 2022-10-11 | 2022-10-11 | Method, device, system and medium for displaying item dependency tree |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211242469.7A CN115686606A (en) | 2022-10-11 | 2022-10-11 | Method, device, system and medium for displaying item dependency tree |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115686606A true CN115686606A (en) | 2023-02-03 |
Family
ID=85063991
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211242469.7A Pending CN115686606A (en) | 2022-10-11 | 2022-10-11 | Method, device, system and medium for displaying item dependency tree |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115686606A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116108235A (en) * | 2023-02-20 | 2023-05-12 | 上海安博通信息科技有限公司 | Path acquisition method and device for tree structure and processing equipment |
CN116541307A (en) * | 2023-06-29 | 2023-08-04 | 云筑信息科技(成都)有限公司 | Data processing method for comparing pom versions |
-
2022
- 2022-10-11 CN CN202211242469.7A patent/CN115686606A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116108235A (en) * | 2023-02-20 | 2023-05-12 | 上海安博通信息科技有限公司 | Path acquisition method and device for tree structure and processing equipment |
CN116108235B (en) * | 2023-02-20 | 2023-11-10 | 上海安博通信息科技有限公司 | Path acquisition method and device for tree structure and processing equipment |
CN116541307A (en) * | 2023-06-29 | 2023-08-04 | 云筑信息科技(成都)有限公司 | Data processing method for comparing pom versions |
CN116541307B (en) * | 2023-06-29 | 2023-10-20 | 云筑信息科技(成都)有限公司 | Data processing method for comparing pom versions |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109901834B (en) | Document page generation method, device, computer equipment and storage medium | |
CN112882700B (en) | IOS application program construction method and device, electronic equipment and storage medium | |
CN109766099B (en) | Front-end source code compiling method and device, storage medium and computer equipment | |
US11667033B2 (en) | Systems and methods for robotic process automation | |
CN115686606A (en) | Method, device, system and medium for displaying item dependency tree | |
US20150082298A1 (en) | Packaging and deploying hybrid applications | |
CN111680253B (en) | Page application data packet generation method and device, computer equipment and storage medium | |
CN110825619A (en) | Automatic generation method and device of interface test case and storage medium | |
CN109032631B (en) | Application program patch package obtaining method and device, computer equipment and storage medium | |
CN113778848A (en) | Test code generation method, device, computer system and medium | |
US11474796B1 (en) | Build system for distributed applications | |
CN110806873B (en) | Target control determining method and device, electronic equipment and storage medium | |
CN112328259A (en) | Compiling time length processing method and device | |
US9552239B2 (en) | Using sub-processes across business processes in different composites | |
CN113268245A (en) | Code analysis method, device and storage medium | |
CN116911588A (en) | Business process execution method, device, equipment and storage medium | |
CN115599386A (en) | Code generation method, device, equipment and storage medium | |
CN105094857A (en) | Method and system used for loading applications | |
CN112965721B (en) | Project compiling method and device based on Android, computer equipment and storage medium | |
CN116166907B (en) | Method and device for developing Web application by using WebAsssembly and service page compiling technology | |
CN110806891B (en) | Method and device for generating software version of embedded device | |
US10956138B1 (en) | Automatic configuration of an execution environment | |
CN111782239A (en) | Software packaging and source code version information acquisition method, device and storage medium | |
CN115794214A (en) | Application module metadata management method, device, storage medium and device | |
CN112287266A (en) | Processing method and device for webpage configuration, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |