CN113626388A - Method and device for displaying topological relation of project file - Google Patents

Method and device for displaying topological relation of project file Download PDF

Info

Publication number
CN113626388A
CN113626388A CN202110923558.7A CN202110923558A CN113626388A CN 113626388 A CN113626388 A CN 113626388A CN 202110923558 A CN202110923558 A CN 202110923558A CN 113626388 A CN113626388 A CN 113626388A
Authority
CN
China
Prior art keywords
file
node
project
relation
definition table
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
Application number
CN202110923558.7A
Other languages
Chinese (zh)
Inventor
李杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110923558.7A priority Critical patent/CN113626388A/en
Publication of CN113626388A publication Critical patent/CN113626388A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Probability & Statistics with Applications (AREA)
  • Library & Information Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method and a device for displaying a topological relation of a project file, which relate to the field of software and the field of finance, and comprise the following steps: scanning an item file under a file root directory corresponding to the item; analyzing the project files of each type respectively to obtain node objects corresponding to the project files of each type and/or relationship objects representing the call relationship among the node objects; generating a node definition table corresponding to the project according to the node object, and generating a relation definition table corresponding to the project according to the relation object; and generating and displaying a visual topological graph according to the node definition table and the relation definition table. According to the method and the system, the project is divided into the topological structures of points and relations by combining with a program analysis tool compiled by java, and visualization is performed through the graph database, so that the cognitive requirements of project managers, program developers and application testers on the project are met.

Description

Method and device for displaying topological relation of project file
Technical Field
The present disclosure relates to the field of software and the field of finance, and in particular, to a method and an apparatus for displaying a topological relation of a project file.
Background
In the project research and development test process, different roles have different requirements on the handling and control of the project. There is a need for project managers and architects to have a global overall sense of the project, such as: whether the structure of the project is reasonable, whether the service division is correct, whether the service boundary is clear, and whether the service module is redundant. For a program developer, clear control is needed for the mode related to the program and the division of the service field when the code is coded. For a tester, when performing change test on the stock code, it is necessary to explicitly know the risk points that the change code may affect, for example: the top-down analysis of page changes affects the storage process of which data storage layers, which operations of which tables are involved at the bottom, and so on.
Therefore, it is indispensable for the project research and development of companies and enterprises, especially in the project research and development process in the self-development framework, to quickly and accurately realize the control of the project. However, a method for rapidly and intuitively displaying the relationship among the files related to the project and the field division of the files is lacked in the prior art.
Disclosure of Invention
The application provides a method for displaying a topological relation of a project file, and relates to the field of software and the field of finance. The method comprises the following steps:
scanning an item file under a file root directory corresponding to the item;
analyzing the project files of each type respectively to obtain node objects corresponding to the project files of each type and/or relationship objects representing the call relationship among the node objects;
generating a node definition table corresponding to the project according to the node object, and generating a relation definition table corresponding to the project according to the relation object;
and generating and displaying a visual topological graph according to the node definition table and the relation definition table.
In an embodiment, the analyzing the item files of each type respectively to obtain node objects corresponding to the item files of each type and/or relationship objects representing call relationships between the node objects includes:
analyzing the jsp file to obtain a jsp file and a relation object corresponding to the jsp file and the calling relation of the opg file under the flowc file;
analyzing the flowc file to obtain a jsp node object and an opg node object;
analyzing the java opg file to obtain opg node objects, stored process node objects and table node objects; analyzing the non-java opg file to obtain a relation object corresponding to the mapping relation between the opg node object and the opg file and the cql file;
analyzing cql files to obtain cql node objects and storage process node objects; and
and analyzing the storage process file to obtain a storage process node object and a table node object.
In an embodiment, the generating a node definition table corresponding to the item according to the node object and generating a relationship definition table corresponding to the item according to the relationship object include:
merging and removing duplication of each generated node object to obtain a node definition table corresponding to the project; the node definition table comprises a node identifier, a node type, a node subtype and a node name;
merging and removing duplication of the generated relation objects to obtain a relation definition table corresponding to the project; the relationship definition table comprises a caller node identification, a callee node identification, a relationship type and a relationship subtype.
In an embodiment, the generating and displaying a visual topological graph according to the node definition table and the relationship definition table includes:
importing the node definition table and the relation definition table into a preset visual topological graph generation model;
generating graphs corresponding to the nodes according to the node definition table;
and generating connecting lines among the graphs according to the relation definition table.
The present application further provides a device for displaying a topological relation of a project file, the device including:
the file acquisition module is used for scanning the project files under the file root directory corresponding to the project;
the file analysis module is used for analyzing each type of project file respectively to obtain node objects corresponding to each type of project file and/or relationship objects representing call relations among the node objects;
a definition table generating module, configured to 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;
and the topological graph generating module is used for generating and displaying a visual topological graph according to the node definition table and the relation definition table.
In one embodiment, the file parsing module includes:
the jsp file analysis unit is used for analyzing the jsp file to obtain a jsp file and a relation object corresponding to the jsp file and the calling relation of the opg file under the flowc file;
the flowc file analyzing unit is used for analyzing the flowc file to obtain a jsp node object and an opg node object;
opg file analyzing unit, for analyzing java class opg file to obtain opg node object, storage process node object and table node object; analyzing the non-java opg file to obtain a relation object corresponding to the mapping relation between the opg node object and the opg file and the cql file;
cql file analysis unit for analyzing cql file to obtain cql node object and storage process node object;
and the storage process file analysis unit is used for analyzing the storage process file to obtain a storage process node object and a table node object.
In one embodiment, the definition table generating module includes:
a node definition table generating unit, configured to merge and deduplicate the generated node objects to obtain a node definition table corresponding to the project; the node definition table comprises a node identifier, a node type, a node subtype and a node name;
the relation definition table generating unit is used for merging and removing the duplication of each generated relation object to obtain a relation definition table corresponding to the project; the relationship definition table comprises a caller node identification, a callee node identification, a relationship type and a relationship subtype.
In an embodiment, the topology map generation module is specifically configured to:
importing the node definition table and the relation definition table into a preset visual topological graph generation model;
generating graphs corresponding to the nodes according to the node definition table;
and generating connecting lines among the graphs according to the relation definition table.
According to the method and the device for displaying the topological relation of the project file, the project is divided into the topological structures of points and relations by combining a program analysis tool compiled by java, the visualization is carried out through a graph database, the field division is carried out on the topological graph through a dbscan algorithm, and query interfaces from top to bottom and from bottom to top are provided, so that the cognitive requirements of project managers, program developers and application testers on the project are met, the method and the device can be generally used for the project in a self-development framework, and the universality is high.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a method for displaying a topological relation of a project file according to the present application.
Fig. 2 is an example of a visualization topology.
Fig. 3 is a schematic diagram of the content to be extracted and parsed in the jsp file.
FIG. 4 is a diagram illustrating contents to be extracted and parsed in a flowc file.
Fig. 5 is a schematic diagram of content to be extracted and parsed in the opg file.
Fig. 6 is another schematic diagram of a method for displaying a topological relation of a project file.
Fig. 7 is a schematic diagram of a topology relation display apparatus of the project file of the present application.
Fig. 8 is another schematic diagram of the topology relation displaying apparatus for project files.
Fig. 9 is another schematic diagram of the topology relation displaying apparatus for project files.
Fig. 10 is a schematic diagram of an electronic device.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The application provides a method for displaying a topological relation of a project file, as shown in fig. 1, the method comprises the following steps:
step S101, scanning item files in a file root directory corresponding to the items.
Specifically, when each item is created, a corresponding file directory is generated, all files generated by the item are placed in the file directory, and the file directory is a file root directory corresponding to the item. And scanning the file root directory to obtain all the project files corresponding to the project.
Among them, the types of project files are various, such as jsp files, flowc files, opg files, cql files, and the like. Therefore, the scanned project files can be classified according to the types of the project files, and then each type of file is analyzed. Due to the fact that a certain calling sequence exists among the files of different types, the classified analysis project files are beneficial to orderly generation of more visual topological graphs.
Step S102, each type of project file is analyzed to obtain node objects corresponding to each type of project file and/or relationship objects representing call relations among the node objects.
Specifically, one node object represents one project file, and one relationship object represents a call relationship between two project files, that is, a connection relationship between two node objects. Since the data contained in different types of project files are different, the result obtained by analyzing each type of project file is also different. For example, for a jsp file, after analysis, a node object corresponding to each jsp file and a relationship object indicating a call relationship of the jsp file to a backend program file can be obtained. Whether the node object, the relationship object, or the node object and the relationship object are output after the project file is analyzed depends on the content of the project file.
Step S103, generating a node definition table corresponding to the project according to the node object, and generating a relation definition table corresponding to the project according to the relation object.
Specifically, the node objects obtained after analyzing the project files are integrated into a table to generate a node definition table; and integrating the relation objects obtained after analyzing the project files into a table to generate a relation definition table. The generated node definition table and the relationship definition table may be stored in a database.
And step S104, generating a visual topological graph according to the node definition table and the relation definition table and displaying the visual topological graph.
Specifically, reading a node definition table and a relation definition table corresponding to a project, and importing the node definition table and the relation definition table into a preset visual topological graph generation model; the visual topological graph generation model acquires a corresponding graph from a graph database according to a node object in a node definition table; and acquiring the corresponding connecting line from the graph database according to the relation object in the relation definition table. And connecting the graphs of the corresponding node objects by using connecting lines to obtain the visual topological graph. The visual topological graph generation model outputs the visual topological graph to an image display interface for displaying. Fig. 2 is an example of a visualization topology.
According to the method for displaying the topological relation of the project file, the project is divided into the topological structures of points and relations by combining with a program analysis tool compiled by java, and visualization is performed through a graph database, so that the cognitive requirements of project managers, program developers and application testers on the project are met, the method can be generally applied to the project performed in a self-development framework, and is particularly suitable for project development on a Core Transaction Platform (CTP for short) of a bank.
In one embodiment, the type of project file includes a jsp file, which is a front-end program file, and in the CTP project, the jsp file implements service invocation through url, for example, the general invocation form or invocation rule is: url href is the name flowc and flowActionName is the name opg. According to the calling form in the jsp, a regular expression can be defined, all the jsp files are scanned, partial content defining service calling in the jsp files is extracted and analyzed, and the calling relation of the jsp files can be obtained: jsp calls the opg file under a certain flowc. The part of the jsp file that needs to be extracted and parsed is shown in fig. 3.
Therefore, for the jsp file, in step S102, each type of project file is analyzed to obtain node objects corresponding to each type of project file and/or relationship objects representing call relationships between nodes, including:
defining a regular expression according to the calling rule of the jsp file;
scanning calling codes in the jsp file by using the regular expression to obtain the name of the jsp file and the calling relation between the jsp file and the opg file under the flowc file;
generating a corresponding jsp node object according to the jsp file name; and
and generating a corresponding relation object according to the calling relation between the jsp file and the opg file in the flowc file.
Wherein each jsp file corresponds to an jps node object; the node object and the relation object obtained by analysis can be stored in a database.
In one embodiment, the type of project file includes a flowc file, which is used to configure the business process, and the relationship between the jsp file and the opg file is configured through a plurality of tags. The flowc file contains mainly the following tags: a Subop tag, a type tag, a view tag, and a jspFile tag. Wherein, the Subop label is used for identifying the ID of the opg file; the type tag is used to identify the name of the opg file; the view label is used for identifying opg output patterns of the result output after the file is executed; the jspFile tag is used to identify the code entry of the jsp file.
The JSP file names and the opg file names corresponding to the four labels can be obtained by regularly capturing the configuration information in the flowc file, a JSP node object can be constructed based on the JSP file names, and a opg node object can be constructed based on the opg file names. The part of the flowc file that needs to be extracted and parsed is shown in fig. 4.
Therefore, for the flowc file, in step S102, each type of project file is analyzed to obtain node objects corresponding to each type of project file and/or relationship objects representing call relationships between nodes, including:
analyzing a Subop label, a type label, a view label and a jspFile label defined in the flowc file to obtain a jsp file name and/or an opg file name corresponding to each label;
generating a corresponding jsp node object according to the jsp file name; and
and generating a corresponding opg node object according to the opg file name. The node object obtained by analysis can be stored in a database.
In one embodiment, the type of project file comprises a Java file, and in fact the Java file belongs to one of the opg files. And scanning the codes in the java file to obtain database calling logic defined in the java file, wherein the calling logic comprises information such as a logic relation, a table in the called database, a return result after the calling is finished and the like. And obtaining the storage process node object and/or the table node object corresponding to the java file according to the calling logic. Meanwhile, each java file corresponds to an opg node object.
Therefore, for java files or java class opg files, step S102, respectively parsing each class of project file to obtain node objects corresponding to each class of project file and/or relationship objects representing call relationships between nodes, including:
scanning calling codes in the Java class opg file to obtain the name of a Java class opg file, the database calling logic relation in the Java class opg file and the name of a called database table;
generating a corresponding opg node object according to the name of the Java class opg file;
generating a corresponding storage process node object according to the database calling logic relation; and
and generating a corresponding table node object according to the database table name.
In one embodiment, the file types include non-Java class opg files; unlike the java class opg file, the non-java class opg file is used to configure the sub-processes (e.g., information query process) of a specific business module, and the type of the business module is defined by a tag, for example: storing a procedure tag, a java program tag, and the like. Specifically, the non-Java class opg file mainly contains the following tags: an opstep id tag, a Type tag, and a Src tag. Wherein, the opstep id tag is used to identify the id of each flow step in the opg file; the Type tag is used to identify opg the Type of each flow step in the file, for example, a stored procedure, an sql statement, or an input output; the Src tag is used to identify the key value of the flow step of the stored procedure class in the opg file, which corresponds to the ID of the cql file. The parts of the non-Java class opg file that need to be extracted and parsed are shown in fig. 5.
Therefore, for the non-java type opg file, in step S102, each type of item file is analyzed to obtain node objects corresponding to each type of item file and/or relationship objects representing call relationships between nodes, including:
analyzing an opcode id tag, a Type tag and a Src tag defined in a non-Java opg file to obtain opg file names corresponding to the tags and/or key values defining the mapping relationship between a opg file and a cql file;
generating a corresponding opg node object according to the opg file name; and
and generating opg file and cql file relation objects according to the key values.
In one embodiment, the type of the project file includes cql file, and cql file is a data storage layer mapping file, which is used to configure the mapping relationship between the stored procedure tag and the actual stored procedure or sql statement, and the mapping relationship is mapped by key and sql statement or stored procedure name in the actual database, and at the same time, defines the input and output format of the stored procedure. The Cql file contains the stored procedure tag procedure id and the corresponding actual stored procedure name tag procedure name. The relation between the storage process key (i.e., the key value in the Src label of the flow step of the storage process class in the non-java class opg file) and the actual storage process name can be obtained by using the regular analysis label procedure id and the label procedureName.
Therefore, for the cql file, in step S102, each type of project file is analyzed to obtain node objects corresponding to each type of project file and/or relationship objects representing call relationships between nodes, which includes:
analyzing a procedure id tag and a procedure name tag defined in the cql file to obtain a mapping relation between a key value of the corresponding opg file and a storage process in a database;
and generating corresponding cql node objects and stored process node objects according to the mapping relation.
In an embodiment, the file type includes a stored procedure file, and the stored procedure file is stored in a database and used for configuring information such as a logic call relation, a call table, a return result, and the like. Extracting all stored procedures and tables in the project user from a specified oracle database; then, the package and the name information of the stored process can be obtained according to the following instructions:
select OWNER,OBJECT_NAME,PROCEDURE_NAME from DBA_PROCEDURES where OWNER not in('SYS','SYSTEM');
all table information can be obtained according to the following instructions:
select OWNER,TABLE_NAME from dba_tables where OWNER not in('SYS','SYSTEM');
and generating a stored process node object and a table node object according to the stored process name information and the table information.
Therefore, for the stored process file, in step S102, each type of project file is analyzed to obtain node objects corresponding to each type of project file and/or relationship objects representing call relationships between nodes, including:
acquiring all storage process information and table information in a database;
generating a storage process node object according to the storage process name in the storage process information;
and generating a table node object according to the table name in the table information.
In an embodiment, as shown in fig. 6, step S103, generating a node definition table corresponding to the item according to the node object, and generating a relationship definition table corresponding to the item according to the relationship object includes:
step S1031, merging and removing duplicate of each generated node object to obtain a node definition table corresponding to the project; for example, the flowc file is firstly analyzed to obtain a group of opg node objects, and the node objects are stored in a database; then, the opg file is analyzed to obtain another group of opg node objects and the objects are stored in a value database; then, the two groups of opg node objects are subjected to deduplication processing, and opg node objects are guaranteed not to be duplicated.
The node definition table includes a node identification, a node type, a node subtype and a node name. Table 1 defines an example of a table for a node:
table 1: node definition table
Figure BDA0003208343140000091
Step S1032, merging and removing duplication of the generated relation objects to obtain a relation definition table corresponding to the project; the relationship definition table comprises a caller node identification, a callee node identification, a relationship type and a relationship subtype. Table 2 is an example of a relationship definition table:
table 2: relation definition table
Figure BDA0003208343140000092
In an embodiment, the method for displaying the topological relation further includes:
after the node objects and the table objects corresponding to the project files are generated, clustering analysis is carried out on the node objects by using a python calling dbscan algorithm, unsupervised division of the node objects is achieved, then the clustering results of the node objects are obtained, and guiding suggestions are provided for field division.
Based on the same inventive concept, the embodiment of the present application further provides a device for showing a topological relation of a project file, which can be used for implementing the method described in the above embodiment, as described in the following embodiment. The principle of the project file topological relation display device for solving the problems is similar to the project file topological relation display method, so the project file topological relation display device can be implemented by the project file topological relation display method, and repeated parts are not repeated. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. While the system described in the embodiments below is preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
The present application further provides a device for displaying a topological relation of a project file, as shown in fig. 7, the device includes:
a file obtaining module 701, configured to scan an item file in a file root directory corresponding to an item;
a file analysis module 702, configured to analyze each type of project file to obtain node objects corresponding to each type of project file and/or relationship objects representing call relationships between each node object;
a definition table generating module 703, configured to generate a node definition table corresponding to the item according to the node object, and generate a relationship definition table corresponding to the item according to the relationship object;
and a topology map generating module 704, configured to generate and display a visual topology map according to the node definition table and the relationship definition table.
In one embodiment, as shown in fig. 8, the file parsing module 702 includes:
a jsp file analyzing unit 7021, configured to analyze the jsp file to obtain a jsp file and a relationship object corresponding to a call relationship between the jsp file and the opg file in the flowc file;
the flowc file analyzing unit 7022 is configured to analyze the flowc file to obtain a jsp node object and an opg node object;
opg file analyzing unit 7023 for analyzing java class opg file to obtain opg node object, storage process node object and table node object; analyzing the non-java opg file to obtain a relation object corresponding to the mapping relation between the opg node object and the opg file and the cql file;
cql file parsing unit 7024 for parsing cql file to obtain cql node object and storage process node object;
and the stored process file analyzing unit 7025 is configured to analyze the stored process file to obtain a stored process node object and a table node object.
In an embodiment, as shown in fig. 9, the definition table generating module 703 includes:
a node definition table generating unit 7031, configured to merge and deduplicate the generated node objects to obtain a node definition table corresponding to the project; the node definition table comprises a node identifier, a node type, a node subtype and a node name;
a relation definition table generating unit 7032, configured to merge and deduplicate the generated relation objects to obtain a relation definition table corresponding to the item; the relationship definition table comprises a caller node identification, a callee node identification, a relationship type and a relationship subtype.
In an embodiment, the topology map generation module is specifically configured to:
importing the node definition table and the relation definition table into a preset visual topological graph generation model;
generating graphs corresponding to the nodes according to the node definition table;
and generating connecting lines among the graphs according to the relation definition table.
The present invention further provides an electronic device, referring to fig. 10, where the electronic device 100 specifically includes:
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.
The memory (memory)120, the communication module (Communications)130, the input unit 140, the output unit 150 and the power supply 160 are respectively connected to the central processing unit (processor) 110. The memory 120 stores a computer program, the central processing unit 110 can call the computer program, and the central processing unit 110 implements all the steps of the method for displaying the topological relation of the project file in the above embodiments when executing the computer program.
Embodiments of the present application also provide a computer storage medium for storing a computer program executable by a processor. When being executed by a processor, the computer program realizes the topological relation display method of any project file provided by the invention.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein. The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the hardware + program class embodiment and the system embodiment, since they are basically similar to the method embodiment, the description is simple, and the relevant points can be referred to the partial description of the method embodiment. Although embodiments of the present description provide method steps as described in embodiments or flowcharts, more or fewer steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of an embodiment of the specification. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction. The above description is only an example of the embodiments of the present disclosure, and is not intended to limit the embodiments of the present disclosure. Various modifications and variations to the embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present specification should be included in the scope of the claims of the embodiments of the present specification.

Claims (16)

1. A method for displaying the topological relation of a project file is characterized by comprising the following steps:
scanning an item file under a file root directory corresponding to the item;
analyzing the project files of each type respectively to obtain node objects corresponding to the project files of each type and/or relationship objects representing the call relationship among the node objects;
generating a node definition table corresponding to the project according to the node object, and generating a relation definition table corresponding to the project according to the relation object;
and generating and displaying a visual topological graph according to the node definition table and the relation definition table.
2. The topological relation display method of claim 1, wherein said type comprises a jsp file;
the analyzing each type of project file respectively to obtain node objects corresponding to each type of project file and/or relationship objects representing call relations among the nodes includes:
defining a regular expression according to the calling rule of the jsp file;
scanning calling codes in the jsp file by using the regular expression to obtain the name of the jsp file and the calling relation between the jsp file and the opg file under the flowc file;
generating a corresponding jsp node object according to the jsp file name; and
and generating a corresponding relation object according to the calling relation between the jsp file and the opg file in the flowc file.
3. The topological relation display method of claim 2, wherein said type comprises a flowc file;
the analyzing each type of project file respectively to obtain node objects corresponding to each type of project file and/or relationship objects representing call relations among the nodes includes:
analyzing a Subop label, a type label, a view label and a jspFile label defined in the flowc file to obtain a jsp file name and/or an opg file name corresponding to each label;
generating a corresponding jsp node object according to the jsp file name; and
and generating a corresponding opg node object according to the opg file name.
4. The topological relation showing method according to claim 3, wherein said types include Java class opg files;
the analyzing each type of project file respectively to obtain node objects corresponding to each type of project file and/or relationship objects representing call relations among the nodes includes:
scanning calling codes in the Java class opg file to obtain the name of a Java class opg file, the database calling logic relation in the Java class opg file and the name of a called database table;
generating a corresponding opg node object according to the name of the Java class opg file;
generating a corresponding storage process node object according to the database calling logic relation; and
and generating a corresponding table node object according to the database table name.
5. The topological relation showing method according to claim 4, wherein said types include non-Java class opg files;
the analyzing each type of project file respectively to obtain node objects corresponding to each type of project file and/or relationship objects representing call relations among the nodes includes:
analyzing an opcode id tag, a Type tag and a Src tag defined in a non-Java opg file to obtain opg file names corresponding to the tags and/or key values defining the mapping relationship between a opg file and a cql file;
generating a corresponding opg node object according to the opg file name; and
and generating a corresponding relation object according to the key value.
6. The topological relation display method of claim 5, wherein said types include cql files;
the analyzing each type of project file respectively to obtain node objects corresponding to each type of project file and/or relationship objects representing call relations among the nodes includes:
analyzing a procedure id tag and a procedure name tag defined in the cql file to obtain a mapping relation between a key value of the corresponding opg file and a storage process in a database;
and generating corresponding cql node objects and stored process node objects according to the mapping relation.
7. The topological relation display method of claim 6, wherein said type comprises storing a process file;
the analyzing each type of project file respectively to obtain node objects corresponding to each type of project file and/or relationship objects representing call relations among the nodes includes:
acquiring all storage process information and table information in a database;
generating a storage process node object according to the storage process name in the storage process information;
and generating a table node object according to the table name in the table information.
8. The method according to any one of claims 2 to 7, wherein the generating a node definition table corresponding to the item according to the node object and generating a relationship definition table corresponding to the item according to the relationship object includes:
merging and removing duplication of each generated node object to obtain a node definition table corresponding to the project; the node definition table comprises a node identifier, a node type, a node subtype and a node name;
merging and removing duplication of the generated relation objects to obtain a relation definition table corresponding to the project; the relationship definition table comprises a caller node identification, a callee node identification, a relationship type and a relationship subtype.
9. The topological relation display method of claim 8, wherein the generating and displaying a visual topological graph according to the node definition table and the relation definition table comprises:
importing the node definition table and the relation definition table into a preset visual topological graph generation model;
generating graphs corresponding to the nodes according to the node definition table;
and generating connecting lines among the graphs according to the relation definition table.
10. The topological relation display method of claim 8, further comprising:
and (5) using python to call a dbscan algorithm to perform clustering analysis on each node object to obtain a clustering result of each node object.
11. A topological relation display device of project files is characterized by comprising:
the file acquisition module is used for scanning the project files under the file root directory corresponding to the project;
the file analysis module is used for analyzing each type of project file respectively to obtain node objects corresponding to each type of project file and/or relationship objects representing call relations among the node objects;
a definition table generating module, configured to 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;
and the topological graph generating module is used for generating and displaying a visual topological graph according to the node definition table and the relation definition table.
12. The apparatus for showing the topological relation of project files according to claim 11, wherein said file parsing module comprises:
the jsp file analysis unit is used for analyzing the jsp file to obtain a jsp file and a relation object corresponding to the jsp file and the calling relation of the opg file under the flowc file;
the flowc file analyzing unit is used for analyzing the flowc file to obtain a jsp node object and an opg node object;
opg file analyzing unit, for analyzing java class opg file to obtain opg node object, storage process node object and table node object; analyzing the non-java opg file to obtain a relation object corresponding to the mapping relation between the opg node object and the opg file and the cql file;
cql file analysis unit for analyzing cql file to obtain cql node object and storage process node object;
and the storage process file analysis unit is used for analyzing the storage process file to obtain a storage process node object and a table node object.
13. The apparatus for showing the topological relation of project files according to claim 12, wherein said definition table generating module comprises:
a node definition table generating unit, configured to merge and deduplicate the generated node objects to obtain a node definition table corresponding to the project; the node definition table comprises a node identifier, a node type, a node subtype and a node name;
the relation definition table generating unit is used for merging and removing the duplication of each generated relation object to obtain a relation definition table corresponding to the project; the relationship definition table comprises a caller node identification, a callee node identification, a relationship type and a relationship subtype.
14. The topological relation display device of claim 13, wherein the topological graph generation module is specifically configured to:
importing the node definition table and the relation definition table into a preset visual topological graph generation model;
generating graphs corresponding to the nodes according to the node definition table;
and generating connecting lines among the graphs according to the relation definition table.
15. An electronic device, comprising:
the system comprises a central processing unit, a storage and a communication module, wherein a computer program is stored in the storage, the central processing unit can call the computer program, and when the central processing unit executes the computer program, the method for displaying the topological relation of the project file according to any one of claims 1 to 10 is realized.
16. A computer storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method for presenting the topological relation of a project file according to any one of claims 1 to 10.
CN202110923558.7A 2021-08-12 2021-08-12 Method and device for displaying topological relation of project file Pending CN113626388A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110923558.7A CN113626388A (en) 2021-08-12 2021-08-12 Method and device for displaying topological relation of project file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110923558.7A CN113626388A (en) 2021-08-12 2021-08-12 Method and device for displaying topological relation of project file

Publications (1)

Publication Number Publication Date
CN113626388A true CN113626388A (en) 2021-11-09

Family

ID=78384923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110923558.7A Pending CN113626388A (en) 2021-08-12 2021-08-12 Method and device for displaying topological relation of project file

Country Status (1)

Country Link
CN (1) CN113626388A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183370A (en) * 2007-12-13 2008-05-21 浪潮通信信息系统有限公司 Topological modelling approach based on class definition and relationship definition
CN103631578A (en) * 2013-10-12 2014-03-12 国家电网公司 Data display method in power distribution network automated system
CN107611962A (en) * 2017-08-24 2018-01-19 中国科学院深圳先进技术研究院 Network system branch road searching method, system and electronic equipment
CN112507499A (en) * 2020-12-02 2021-03-16 广东电网有限责任公司 GIS-based power distribution network line loss data acquisition method and related device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183370A (en) * 2007-12-13 2008-05-21 浪潮通信信息系统有限公司 Topological modelling approach based on class definition and relationship definition
CN103631578A (en) * 2013-10-12 2014-03-12 国家电网公司 Data display method in power distribution network automated system
CN107611962A (en) * 2017-08-24 2018-01-19 中国科学院深圳先进技术研究院 Network system branch road searching method, system and electronic equipment
CN112507499A (en) * 2020-12-02 2021-03-16 广东电网有限责任公司 GIS-based power distribution network line loss data acquisition method and related device

Similar Documents

Publication Publication Date Title
CN107665171B (en) Automatic regression testing method and device
CN106970819B (en) C program code specification checking device based on PRD L rule description language
US20060218160A1 (en) Change control management of XML documents
US20060235899A1 (en) Method of migrating legacy database systems
CN110347598B (en) Test script generation method and device, server and storage medium
JP2000148461A (en) Software model and existing source code synchronizing method and device
CN110765750B (en) Report data input method and terminal equipment
CN108345658A (en) Algorithm calculates decomposing process, server and the storage medium of track
CN105843605B (en) A kind of data mapping method and device
Petermann et al. Graph mining for complex data analytics
Dakrory et al. Automated ETL testing on the data quality of a data warehouse
De Alwis et al. Remodularization analysis for microservice discovery using syntactic and semantic clustering
US8892951B2 (en) Fault localization for data-centric programs
CN113626388A (en) Method and device for displaying topological relation of project file
CN115495508A (en) Generating method and device of SQL (structured query language) statement for report and electronic equipment
US20040193561A1 (en) Knowledge processing system
CN114020852A (en) Knowledge graph display method and device
Marotta et al. Managing source schema evolution in web warehouses
Rozsnyai et al. Automated correlation discovery for semi-structured business processes
CN117909392B (en) Intelligent data asset inventory method and system
CN113495753B (en) Method and device for acquiring label of item, electronic equipment and storage medium
CN112925856B (en) Entity relationship analysis method, entity relationship analysis device, entity relationship analysis equipment and computer storage medium
CN113419739B (en) Node map difference detection method and device, electronic equipment and storage medium
Andritsos et al. Reverse engineering meets data analysis
EP4170481A1 (en) Development assistance device, program, and development assistance method

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