A method and device for displaying topological relations of project files

By analyzing the project files and generating node definition tables and relationship definition tables, the problem of missing the division and display of project files in the existing technology is solved, and the rapid and intuitive display of project files and improvement of project control is achieved.

CN113626388BActive Publication Date: 2025-05-09INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110923558.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-12
Publication Date
2025-05-09
Estimated Expiration
2041-08-12

AI Technical Summary

Technical Problem

The lack of a method of quickly and intuitively displaying the relationship between the files involved in the project and the fields of each file is carried out in the prior art, which makes it difficult for project managers, developers and testers to quickly and accurately control the project.

Method used

By scanning the project files in the root directory of the project file, each type of project file is parsed, node objects and relational objects are generated, node definition tables and relationship definition tables are merged, and a visual topology diagram generation model is generated to generate a visual topology diagram display.

Benefits of technology

It realizes a rapid and intuitive display of topological relationships of project files, meets the cognitive needs of project managers, developers and testers for the project, and improves the efficiency and accuracy of project control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113626388B_ABST
    Figure CN113626388B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for displaying the topological relationship of a project file, and relates to the software field and the financial field. The method comprises: scanning the project files under the file root directory corresponding to the project; parsing each type of project file respectively, obtaining the node objects corresponding to each type of project file and / or the relationship objects representing the calling relationship between each node object; generating the node definition table corresponding to the project according to the node object, and generating the relationship definition table corresponding to the project according to the relationship object; generating and displaying a visual topological diagram according to the node definition table and the relationship definition table. The present application, by combining a program parsing tool written in java, splits the project into a topological structure of points and relationships, and visualizes it through a graph database, thereby meeting the cognitive needs of project managers, program developers, and application testers for the project.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of software and finance, and in particular to a method and device for displaying the topological relationship of a project file. Background Art

[0002] In the project development and testing process, different roles have different requirements for project control. For project managers and architects, they need to have a global grasp of the project, for example: whether the project structure is reasonable, whether the business division is correct, whether the business boundaries are clear, and whether the business modules are redundant. For program developers, when coding, they need to have a clear control over the program-related modes and service domain divisions. For testers, when performing modification tests on existing code, they need to clearly know the risk points that may be affected by the modified code, such as: which data storage layer's storage procedures are affected by the top-down analysis page changes, which tables and operations are involved at the bottom level, etc.

[0003] It can be seen that for project development of companies and enterprises, especially in the process of project development within the framework of self-development, it is indispensable to quickly and accurately control the project. However, the prior art lacks a method for quickly and intuitively displaying the relationship between the various files involved in the project and the field division of each file. Summary of the invention

[0004] This application provides a method for displaying the topological relationship of a project file, which relates to the software field and the financial field. The method includes:

[0005] Scan the project files under the file root directory corresponding to the project;

[0006] Parse each type of project file respectively to obtain the node objects corresponding to each type of project file and / or the relationship objects representing the calling relationship between each node object;

[0007] Generate a node definition table corresponding to the project according to the node object, and generate a relationship definition table corresponding to the project according to the relationship object;

[0008] A visual topology diagram is generated and displayed according to the node definition table and the relationship definition table.

[0009] In one embodiment, the parsing of each type of project file to obtain the node objects corresponding to each type of project file and / or the relationship objects indicating the calling relationship between the node objects includes:

[0010] Parse the jsp file to obtain the jsp file and the relationship object corresponding to the calling relationship between the jsp file and the opg file under the flowc file;

[0011] Parse the flowc file to get the jsp node object and the opg node object;

[0012] Parse the java class opg file to obtain the opg node object, stored procedure node object and table node object; and parse the non-java class opg file to obtain the opg node object and the relationship object corresponding to the mapping relationship between the opg file and the cql file;

[0013] Parse the cql file to obtain the cql node object and the stored procedure node object; and

[0014] Parse the stored procedure file to obtain the stored procedure node object and table node object.

[0015] In one embodiment, generating a node definition table corresponding to the project according to the node object, and generating a relationship definition table corresponding to the project according to the relationship object, includes:

[0016] Merge and remove duplicates of the generated node objects to obtain a node definition table corresponding to the project; the node definition table includes a node identifier, a node type, a node subtype, and a node name;

[0017] The generated relationship objects are merged and deduplicated to obtain a relationship definition table corresponding to the project; the relationship definition table includes a caller node identifier, a callee node identifier, a relationship type, and a relationship subtype.

[0018] In one embodiment, generating and displaying a visual topology map according to the node definition table and the relationship definition table includes:

[0019] Importing the node definition table and the relationship definition table into a preset visual topology graph generation model;

[0020] Generate a graph corresponding to each node according to the node definition table;

[0021] The connection lines between the graphics are generated according to the relationship definition table.

[0022] The present application also provides a device for displaying a topological relationship of a project file, the device comprising:

[0023] The file acquisition module is used to scan the project files in the file root directory corresponding to the project;

[0024] A file parsing module, used to parse each type of project file respectively, to obtain the node objects corresponding to each type of project file and / or the relationship objects representing the calling relationship between the node objects;

[0025] A definition table generating module, used to generate a node definition table corresponding to the project according to the node object, and to generate a relationship definition table corresponding to the project according to the relationship object;

[0026] A topology map generation module is used to generate and display a visual topology map based on the node definition table and the relationship definition table.

[0027] In one embodiment, the file parsing module includes:

[0028] A jsp file parsing unit, used for parsing a jsp file to obtain a jsp file and a relationship object corresponding to a calling relationship between the jsp file and an opg file under a flowc file;

[0029] The flowc file parsing unit is used to parse the flowc file to obtain the jsp node object and the opg node object;

[0030] The opg file parsing unit is used to parse the java class opg file to obtain the opg node object, the stored procedure node object and the table node object; and to parse the non-java class opg file to obtain the opg node object and the relationship object corresponding to the mapping relationship between the opg file and the cql file;

[0031] A cql file parsing unit, used to parse the cql file to obtain the cql node object and the stored procedure node object;

[0032] The stored procedure file parsing unit is used to parse the stored procedure file to obtain the stored procedure node object and the table node object.

[0033] In one embodiment, the definition table generation module includes:

[0034] A node definition table generating unit, used for merging and removing duplicates of the generated node objects to obtain a node definition table corresponding to the project; the node definition table includes a node identifier, a node type, a node subtype and a node name;

[0035] The relationship definition table generation unit is used to merge and remove duplicates of the generated relationship objects to obtain a relationship definition table corresponding to the project; the relationship definition table includes a caller node identifier, a callee node identifier, a relationship type, and a relationship subtype.

[0036] In one embodiment, the topology map generation module is specifically used to:

[0037] Importing the node definition table and the relationship definition table into a preset visual topology graph generation model;

[0038] Generate a graph corresponding to each node according to the node definition table;

[0039] The connection lines between the graphics are generated according to the relationship definition table.

[0040] The topological relationship display method and device of the project file of the present application, by combining with the program parsing tool written in Java, splits the project into a topological structure of points and relationships, and visualizes it through a graph database, divides the domain of the topological graph through the dbscan algorithm, and provides top-down and bottom-up query interfaces, which meets the cognitive needs of project managers, program developers and application testers for projects, and can be used in projects conducted within a self-developed framework, with high universality. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 A schematic diagram of a method for displaying topological relationships of project files of this application.

[0043] Figure 2 This is an example of a visual topology map.

[0044] Figure 3 This is a schematic diagram of the content that needs to be extracted and parsed in the jsp file.

[0045] Figure 4 This is a schematic diagram of the content that needs to be extracted and parsed in the flowc file.

[0046] Figure 5 This is a schematic diagram of the content that needs to be extracted and parsed in the opg file.

[0047] Figure 6 Another schematic diagram showing the topological relationship of project files.

[0048] Figure 7 A schematic diagram of a topological relationship display device for project files of this application.

[0049] Figure 8 Another schematic diagram of a device for displaying the topological relationship of project files.

[0050] Fig. 9 Another schematic diagram of a device for displaying the topological relationship of project files.

[0051] Fig.10 A schematic diagram of an electronic device. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] This application provides a method for displaying the topological relationship of a project file, such as Figure 1 As shown, the method comprises the following steps:

[0054] Step S101, scanning the project files in the file root directory corresponding to the project.

[0055] Specifically, when each project is created, a corresponding file directory will be generated. All files generated by the project are placed in this file directory, which is the file root directory corresponding to the project. By scanning the file root directory, all project files corresponding to the project can be obtained.

[0056] Among them, there are various types of project files, such as jsp files, flowc files, opg files, cql files, etc. Therefore, the scanned project files can be classified according to the type of project files, and then each type of file can be parsed separately. Since there is a certain calling order between different types of files, classifying and parsing project files is conducive to the orderly generation of more visual topology maps.

[0057] Step S102: parsing each type of project file respectively to obtain node objects corresponding to each type of project file and / or relationship objects indicating the calling relationship between each node object.

[0058] Specifically, a node object represents a project file, and a relationship object represents the calling relationship between two project files, that is, the connection relationship between two node objects. Since different types of project files contain different data, the results obtained after parsing each type of project file are also different. For example, for jsp files, after parsing, the node objects corresponding to each jsp file and the relationship objects representing the calling relationship between the jsp file and the backend program file can be obtained. After parsing the project file, whether the output is a node object, a relationship object, or a node object and a relationship object depends on the content of the project file.

[0059] Step S103: generating a node definition table corresponding to the project according to the node object, and generating a relationship definition table corresponding to the project according to the relationship object.

[0060] Specifically, the node objects obtained by parsing each project file are integrated into a table to generate a node definition table; the relationship objects obtained by parsing each project file are integrated into a table to generate a relationship definition table. The generated node definition table and relationship definition table can be stored in a database.

[0061] Step S104, generate and display a visual topology graph according to the node definition table and the relationship definition table.

[0062] Specifically, read the node definition table and relationship definition table corresponding to the project, and import the node definition table and the relationship definition table into a preset visual topology graph generation model; the visual topology graph generation model obtains corresponding graphics from the graph database according to the node objects in the node definition table; and obtains corresponding connection lines from the graph database according to the relationship objects in the relationship definition table. Use the connection lines to connect the graphics of the corresponding node objects to obtain a visual topology graph. The visual topology graph generation model outputs the visual topology graph to an image display interface for display. Figure 2 Is an example of a visual topology graph.

[0063] The topology relationship display method of the project file in this application combines a program parsing tool written in Java, splits the project into a topological structure of points and relationships, and visualizes it through a graph database, meeting the cognitive needs of project managers, program developers, and application testers for the project. It can be applied to projects carried out within a self-developed framework, especially suitable for project development on the Core Transaction Platform (CTP) of a bank.

[0064] In an embodiment, the type of the project file includes a jsp file. The jsp is a front-end program file. In the CTP project, the jsp file realizes service calls through the url. For example, its general call form or call rule is: <ctp:url href=flowc name, <=flowActionName=opg name. According to the call form in the jsp, a regular expression can be defined to scan all jsp files, extract and parse some content that defines service calls in the jsp files, and the call relationship of the jsp files can be obtained: the jsp calls the opg file under a certain flowc. The part that needs to be extracted and parsed in the jsp file is as Figure 3 shown.

[0065] Therefore, for jsp files, in step S102, each type of project file is parsed separately to obtain the node objects corresponding to each type of project file and / or the relationship objects representing the call relationships between the nodes, including:

[0066] Define a regular expression according to the calling rules of the jsp file;

[0067] Use the regular expression to scan the calling code in the jsp file to obtain the jsp file name and the calling relationship between the jsp file and the opg file under the flowc file;

[0068] Generate a corresponding jsp node object according to the jsp file name; and

[0069] Generate a corresponding relationship object according to the calling relationship between the jsp file and the opg file under the flowc file.

[0070] Among them, each jsp file corresponds to a jps node object; the parsed node objects and relationship objects can be saved in the database.

[0071] In one embodiment, the type of project file includes a flowc file, which is used to configure the business process and configure the relationship between the jsp file and the opg file through multiple tags. The flowc file mainly includes the following tags: Subop tag, type tag, view tag and jspFile tag. Among them, the Subop tag is used to identify the ID of the opg file; the type tag is used to identify the name of the opg file; the view tag is used to identify the output style of the result output after the opg file is executed; and the jspFile tag is used to identify the code entry of the jsp file.

[0072] By using regular expressions to capture the configuration information in the flowc file, you can get the jsp file names and opg file names corresponding to the above four tags. Based on the jsp file name, you can build a jsp node object, and based on the opg file name, you can build an opg node object. The parts of the flowc file that need to be extracted and parsed are as follows: Figure 4 shown.

[0073] Therefore, for the flowc file, step S102 parses each type of project file respectively to obtain node objects corresponding to each type of project file and / or relationship objects representing the calling relationship between nodes, including:

[0074] Parse the Subop tag, type tag, view tag, and jspFile tag defined in the flowc file to obtain the jsp file name and / or opg file name corresponding to each tag;

[0075] Generate a corresponding jsp node object according to the jsp file name; and

[0076] Generate a corresponding opg node object according to the opg file name. The parsed node object can be saved in the database.

[0077] In one embodiment, the type of project file includes Java file, which is actually a type of opg file. By scanning the code in the java file, the database call logic defined in the java file can be obtained, wherein the call logic includes information such as logical relationship, table in the called database, and result returned after the call is completed. According to the call logic, the stored procedure node object and / or table node object corresponding to the java file can be obtained. At the same time, each java file corresponds to an opg node object.

[0078] Therefore, for a java file or a java class opg file, step S102 parses each type of project file to obtain node objects corresponding to each type of project file and / or relationship objects representing the calling relationship between nodes, including:

[0079] Scan the calling code in the Java class opg file to obtain the name of the Java class opg file, the database calling logic relationship in the Java class opg file, and the called database table name;

[0080] Generate a corresponding opg node object according to the name of the Java class opg file;

[0081] Generate a corresponding stored procedure node object according to the database call logical relationship; and

[0082] Generate a corresponding table node object according to the database table name.

[0083] In one embodiment, the file type includes a non-Java class opg file; unlike a java class opg file, a non-Java class opg file is used to configure a sub-process (such as an information query process) of a specific business module, and defines the type of the business module through a tag, such as a stored procedure tag, a java program tag, etc. Specifically, the non-Java class opg file mainly includes the following tags: an opstep id tag, a Type tag, and a Src tag. Among them, the opstep id tag is used to identify the id of each process step in the opg file; the Type tag is used to identify the type of each process step in the opg file, and the type of the process step is, for example, a stored procedure, a sql statement, or input and output; the Src tag is used to identify the key value of the process step of the stored procedure class in the opg file, and the key value corresponds to the ID of the cql file. The parts that need to be extracted and parsed in the non-Java class opg file are as follows: Figure 5 shown.

[0084] Therefore, for non-java opg files, step S102 parses each type of project file to obtain node objects corresponding to each type of project file and / or relationship objects representing the calling relationship between nodes, including:

[0085] Parse the opstep id tag, Type tag, and Src tag defined in the non-Java opg file to obtain the opg file name corresponding to each tag and / or the key value that defines the mapping relationship between the opg file and the cql file;

[0086] Generate a corresponding opg node object according to the opg file name; and

[0087] Generate a relationship object between the opg file and the cql file according to the key value.

[0088] In one embodiment, the type of project file includes a cql file, which is a data storage layer mapping file used to configure the mapping relationship between the stored procedure label and the actual stored procedure or sql statement, and defines the input and output format of the stored procedure by mapping the key and the sql statement or stored procedure name in the actual database. The cql file contains the stored procedure label procedure id and the label procedureName of the corresponding actual stored procedure name. The relationship between the stored procedure key (i.e., the key value in the Src label of the process step of the stored procedure class in the non-java class opg file) and the actual stored procedure name can be obtained by using regular parsing of the label procedure id and the label procedureName.

[0089] Therefore, for the cql file, step S102 parses each type of project file respectively to obtain the node objects corresponding to each type of project file and / or the relationship objects representing the calling relationship between the nodes, including:

[0090] Parse the procedure id tag and procedureName tag defined in the cql file to obtain the mapping relationship between the key value of the corresponding opg file and the stored procedure in the database;

[0091] Generate corresponding cql node objects and stored procedure node objects according to the mapping relationship.

[0092] In one embodiment, the file type includes a stored procedure file, which is stored in a database and used to configure information such as logical call relationships, call tables, and returned results. Extract all stored procedures and tables in the project user from the specified Oracle database; then, the package and stored procedure name information of all stored procedures can be obtained according to the following instructions:

[0093] select OWNER,OBJECT_NAME,PROCEDURE_NAME from DBA_PROCEDURES whereOWNER not in('SYS','SYSTEM');

[0094] You can get all table information by following the following command:

[0095] select OWNER,TABLE_NAME from dba_tables where OWNER not in('SYS','SYSTEM');

[0096] Stored procedure node objects and table node objects can be generated based on the stored procedure name information and table information.

[0097] Therefore, for the stored procedure file, in step S102, each type of project file is parsed respectively to obtain the node objects corresponding to each type of project file and / or the relationship objects representing the calling relationship between the nodes, including:

[0098] Get all stored procedure information and table information in the database;

[0099] Generate a stored procedure node object according to the stored procedure name in the stored procedure information;

[0100] And generate a table node object according to the table name in the table information.

[0101] In one embodiment, if Figure 6 As shown, step S103, generating a node definition table corresponding to the project according to the node object, and generating a relationship definition table corresponding to the project according to the relationship object, includes:

[0102] Step S1031, merge and deduplicate the generated node objects to obtain a node definition table corresponding to the project; for example, first parse the flowc file to obtain a group of opg node objects and store them in the database; then parse the opg file again to obtain another group of opg node objects and store them in the database; then deduplicate the two groups of opg node objects to ensure that the opg node objects will not be repeated.

[0103] The node definition table includes node identification, node type, node subtype and node name. Table 1 is an example of a node definition table:

[0104] Table 1: Node definition table

[0105]

[0106] Step S1032: merge and remove duplicates of the generated relationship objects to obtain a relationship definition table corresponding to the project; the relationship definition table includes a caller node identifier, a callee node identifier, a relationship type, and a relationship subtype. Table 2 is an example of a relationship definition table:

[0107] Table 2: Relationship definition table

[0108]

[0109] In one embodiment, the topological relationship display method further includes:

[0110] After generating the node objects and table objects corresponding to the project files, use Python to call the dbscan algorithm to perform cluster analysis on each node object, realize the unsupervised division of each node object, and then obtain the clustering results of each node object, providing guiding suggestions for domain division.

[0111] Based on the same inventive concept, the embodiments of the present application also provide a topological relationship display device for a project file, which can be used to implement the method described in the above embodiments, as described in the following embodiments. Since the principle of solving the problem by the topological relationship display device for a project file is similar to that of the topological relationship display method for a project file, the implementation of the topological relationship display device for a project file can refer to the implementation of the topological relationship display method for a project file, and the repeated parts will not be repeated. As used below, the terms "unit" or "module" can be a combination of software and / or hardware that implements predetermined functions. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0112] The present application also provides a topological relationship display device for a project file, such as Figure 7 As shown, the device comprises:

[0113] The file acquisition module 701 is used to scan the project files in the file root directory corresponding to the project;

[0114] The file parsing module 702 is used to parse each type of project file respectively to obtain the node objects corresponding to each type of project file and / or the relationship objects indicating the calling relationship between each node object;

[0115] A definition table generating module 703, configured to generate a node definition table corresponding to the project according to the node object, and to generate a relationship definition table corresponding to the project according to the relationship object;

[0116] The topology map generation module 704 is used to generate and display a visual topology map according to the node definition table and the relationship definition table.

[0117] In one embodiment, if Figure 8 As shown, the file parsing module 702 includes:

[0118] A jsp file parsing unit 7021 is used to parse the jsp file to obtain the jsp file and a relationship object corresponding to the calling relationship between the jsp file and the opg file under the flowc file;

[0119] The flowc file parsing unit 7022 is used to parse the flowc file to obtain the jsp node object and the opg node object;

[0120] The opg file parsing unit 7023 is used to parse the java class opg file to obtain the opg node object, the stored procedure node object and the table node object; and to parse the non-java class opg file to obtain the opg node object and the relationship object corresponding to the mapping relationship between the opg file and the cql file;

[0121] A cql file parsing unit 7024 is used to parse the cql file to obtain a cql node object and a stored procedure node object;

[0122] The stored procedure file parsing unit 7025 is used to parse the stored procedure file to obtain the stored procedure node object and the table node object.

[0123] In one embodiment, if Fig. 9 As shown, the definition table generation module 703 includes:

[0124] The node definition table generating unit 7031 is used to merge and remove duplicates of the generated node objects to obtain a node definition table corresponding to the project; the node definition table includes a node identifier, a node type, a node subtype and a node name;

[0125] The relationship definition table generation unit 7032 is used to merge and remove duplicates of the generated relationship objects to obtain a relationship definition table corresponding to the project; the relationship definition table includes a caller node identifier, a callee node identifier, a relationship type, and a relationship subtype.

[0126] In one embodiment, the topology map generation module is specifically used to:

[0127] Importing the node definition table and the relationship definition table into a preset visual topology graph generation model;

[0128] Generate a graph corresponding to each node according to the node definition table;

[0129] The connection lines between the graphics are generated according to the relationship definition table.

[0130] The present invention also provides an electronic device, see Fig.10 , the electronic device 100 specifically includes:

[0131] A central processing unit (processor) 110 , a memory (memory) 120 , a communication module (Communications) 130 , an input unit 140 , an output unit 150 and a power supply 160 .

[0132] The memory 120, the communication module 130, the input unit 140, the output unit 150 and the power supply 160 are respectively connected to the central processing unit 110. The memory 120 stores a computer program, and the central processing unit 110 can call the computer program. When the central processing unit 110 executes the computer program, all steps of the topological relationship display method of the project file in the above embodiment are implemented.

[0133] The embodiment of the present application further provides a computer storage medium for storing a computer program, wherein the computer program can be executed by a processor. When the computer program is executed by the processor, the topological relationship display method of any project file provided by the present invention is implemented.

[0134] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for hardware + program embodiments and system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiments. Although the embodiments of this specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiment is only one way of executing the order of many steps, and does not represent the only order of execution.

[0135] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiments of this specification. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory. The above description is only an embodiment of the embodiments of this specification and is not intended to limit the embodiments of this specification. For those skilled in the art, the embodiments of this specification may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of this specification shall be included within the scope of the claims of the embodiments of this specification.

Claims

1. A method for displaying the topological relationship of a project file, characterized in that: include: Scan the project files under the file root directory corresponding to the project; Parse each type of project file respectively to obtain the node objects corresponding to each type of project file and / or the relationship objects representing the calling relationship between each node object; Generate a node definition table corresponding to the project according to the node object, and generate a relationship definition table corresponding to the project according to the relationship object; Generate and display a visual topology diagram based on the node definition table and the relationship definition table, Wherein, the types include jsp files; The step of parsing each type of project file to obtain node objects corresponding to each type of project file and / or relationship objects representing the calling relationship between each node object includes: Define a regular expression according to the calling rules of the jsp file; Use the regular expression to scan the calling code in the jsp file to obtain the jsp file name and the calling relationship between the jsp file and the opg file under the flowc file; Generate a corresponding jsp node object according to the jsp file name; and Generate a corresponding relationship object according to the calling relationship between the jsp file and the opg file under the flowc file.

2. The topological relationship display method according to claim 1, characterized in that: The types include flowc files; The step of parsing each type of project file to obtain node objects corresponding to each type of project file and / or relationship objects representing the calling relationship between the node objects further includes: Parse the Subop tag, type tag, view tag, and jspFile tag defined in the flowc file to obtain the jsp file name and / or opg file name corresponding to each tag; Generate a corresponding jsp node object according to the jsp file name; and Generate a corresponding opg node object according to the opg file name.

3. The topological relationship display method according to claim 2, characterized in that: The types include Java class opg files; The step of parsing each type of project file to obtain node objects corresponding to each type of project file and / or relationship objects representing the calling relationship between the node objects further includes: Scan the calling code in the Java class opg file to obtain the name of the Java class opg file, the database calling logic relationship in the Java class opg file, and the called database table name; Generate a corresponding opg node object according to the name of the Java class opg file; Generate a corresponding stored procedure node object according to the database call logical relationship; and Generate a corresponding table node object according to the database table name.

4. The topological relationship display method according to claim 3, characterized in that: The types include non-Java class opg files; The step of parsing each type of project file to obtain node objects corresponding to each type of project file and / or relationship objects representing the calling relationship between the node objects further includes: Parse the opstep id tag, Type tag, and Src tag defined in the non-Java opg file to obtain the opg file name corresponding to each tag and / or the key value that defines the mapping relationship between the opg file and the cql file; Generate a corresponding opg node object according to the opg file name; and Generate a corresponding relationship object according to the key value.

5. The topological relationship display method according to claim 4, characterized in that: The types include cql files; The step of parsing each type of project file to obtain node objects corresponding to each type of project file and / or relationship objects representing the calling relationship between the node objects further includes: Parse the procedure id tag and procedureName tag defined in the cql file to obtain the mapping relationship between the key value of the corresponding opg file and the stored procedure in the database; Generate corresponding cql node objects and stored procedure node objects according to the mapping relationship.

6. The topological relationship display method according to claim 5, characterized in that: The types include stored procedure files; The step of parsing each type of project file to obtain node objects corresponding to each type of project file and / or relationship objects representing the calling relationship between the node objects further includes: Get all stored procedure information and table information in the database; Generate a stored procedure node object according to the stored procedure name in the stored procedure information; And generate a table node object according to the table name in the table information.

7. The topological relationship display method according to any one of claims 2 to 6, characterized in that: The generating a node definition table corresponding to the project according to the node object, and generating a relationship definition table corresponding to the project according to the relationship object, comprises: Merge and remove duplicates of the generated node objects to obtain a node definition table corresponding to the project; the node definition table includes a node identifier, a node type, a node subtype, and a node name; The generated relationship objects are merged and deduplicated to obtain a relationship definition table corresponding to the project; the relationship definition table includes a caller node identifier, a callee node identifier, a relationship type, and a relationship subtype.

8. The topological relationship display method according to claim 7, characterized in that: The generating and displaying a visual topology map according to the node definition table and the relationship definition table includes: Importing the node definition table and the relationship definition table into a preset visual topology graph generation model; Generate a graph corresponding to each node according to the node definition table; The connection lines between the graphics are generated according to the relationship definition table.

9. The topological relationship display method according to claim 7, characterized in that: Also includes: Use python to call the dbscan algorithm to perform cluster analysis on each node object and obtain the clustering results of each node object.

10. A device for displaying topological relations of project files, characterized in that: include: The file acquisition module is used to scan the project files in the file root directory corresponding to the project; A file parsing module, used to parse each type of project file respectively, to obtain the node objects corresponding to each type of project file and / or the relationship objects representing the calling relationship between the node objects; A definition table generating module, used to generate a node definition table corresponding to the project according to the node object, and to generate a relationship definition table corresponding to the project according to the relationship object; A topology map generation module is used to generate and display a visual topology map based on the node definition table and the relationship definition table. Wherein, the file parsing module includes: A jsp file parsing unit, used for parsing a jsp file to obtain a jsp file and a relationship object corresponding to a calling relationship between the jsp file and an opg file under a flowc file; The flowc file parsing unit is used to parse the flowc file to obtain the jsp node object and the opg node object; The opg file parsing unit is used to parse the java class opg file to obtain the opg node object, the stored procedure node object and the table node object; and to parse the non-java class opg file to obtain the opg node object and the relationship object corresponding to the mapping relationship between the opg file and the cql file; A cql file parsing unit, used to parse the cql file to obtain the cql node object and the stored procedure node object; The stored procedure file parsing unit is used to parse the stored procedure file to obtain the stored procedure node object and the table node object.

11. The topological relationship display device of project files according to claim 10, characterized in that: The definition table generation module includes: A node definition table generating unit, used for merging and removing duplicates of the generated node objects to obtain a node definition table corresponding to the project; the node definition table includes a node identifier, a node type, a node subtype and a node name; The relationship definition table generation unit is used to merge and remove duplicates of the generated relationship objects to obtain a relationship definition table corresponding to the project; the relationship definition table includes a caller node identifier, a callee node identifier, a relationship type, and a relationship subtype.

12. The topological relationship display device according to claim 11, characterized in that: The topology map generation module is specifically used for: Importing the node definition table and the relationship definition table into a preset visual topology graph generation model; Generate a graph corresponding to each node according to the node definition table; The connection lines between the graphics are generated according to the relationship definition table.

13. An electronic device, characterized in that: include: A central processing unit, a memory, and a communication module, wherein the memory stores a computer program, the central processing unit can call the computer program, and when the central processing unit executes the computer program, the topological relationship display method of the project file as described in any one of claims 1 to 9 is implemented.

14. A computer storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, the method for displaying the topological relationship of a project file according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Power grid system branch search method and system and electronic equipment

    CN107611962A