CN114385764A - Reverse analysis method and device for relational database table structure - Google Patents

Reverse analysis method and device for relational database table structure Download PDF

Info

Publication number
CN114385764A
CN114385764A CN202110983245.0A CN202110983245A CN114385764A CN 114385764 A CN114385764 A CN 114385764A CN 202110983245 A CN202110983245 A CN 202110983245A CN 114385764 A CN114385764 A CN 114385764A
Authority
CN
China
Prior art keywords
data
table structure
file
search
table data
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
CN202110983245.0A
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.)
Guangdong Yuefei Finance Cloud Technology Co ltd
Original Assignee
Guangdong Yuefei Finance Cloud Technology Co ltd
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 Guangdong Yuefei Finance Cloud Technology Co ltd filed Critical Guangdong Yuefei Finance Cloud Technology Co ltd
Priority to CN202110983245.0A priority Critical patent/CN114385764A/en
Publication of CN114385764A publication Critical patent/CN114385764A/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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a reverse analysis method of a relational database table structure, which comprises the following steps: initializing a configuration target database, generating a table structure file from a plurality of table structures of the target database, and generating a table data file from table data corresponding to the table structures; acquiring searched keywords, searching in a table data file according to the keywords, and generating a search result; and constructing a table structure connection model diagram of the target database based on the search result, and outputting the search result and the table structure connection model diagram. The invention provides a reverse analysis method of a relational database table structure, which is used for a method for rapidly analyzing table association relations of a relational database. Compared with the existing universal global search tool, the method has the advantages of higher pertinence, more concentrated analysis scale, higher operation speed and more visual result display. The files are divided into two types of table structure files and table data files.

Description

Reverse analysis method and device for relational database table structure
Technical Field
The invention belongs to the technical field of database information processing, and particularly relates to a reverse analysis method and device for a relational database table structure.
Background
The database table structure description is a document used for describing detailed design of a program database, is a description of the relationship between the data table and the data table, is a basis for understanding software behaviors and functions, and is not separated from the database table structure description no matter development assistance, later-stage iterative maintenance or software reconstruction.
However, the applicant researches and discovers that in an actual scene, due to various reasons, the database table structure description is frequently lost, so that a software system is not understandable, the work based on the software such as use, maintenance, modification, reconstruction and the like is difficult, and even project failure can be caused directly.
The database table structure description has significance to software systems, similar to instructions for the use of complex machines, and would be difficult to use and difficult to maintain without the instruction for use. For this reason, the development of technologies for retrieving database table structure descriptions in the state of only running software is needed.
Disclosure of Invention
The present invention is directed to solve the above technical problems, and provides a method and an apparatus for reverse analysis of a relational database table structure.
In order to solve the problems, the invention is realized according to the following technical scheme:
in a first aspect, the present invention provides a reverse analysis method for a relational database table structure, including the following steps:
initializing a configuration target database, generating a table structure file from a plurality of table structures of the target database, and generating a table data file from table data corresponding to the table structures;
acquiring searched keywords, searching in a table data file according to the keywords, and generating a search result;
and constructing a table structure connection model diagram of the target database based on the search result, and outputting the search result and the table structure connection model diagram.
With reference to the first aspect, the present invention further provides a 1 st preferred implementation manner of the first aspect, and specifically, searching in a table data file according to the keyword specifically includes the following steps:
traversing and searching in the table data file according to the keywords;
when hit, extracting first information from the table data file;
identifying a table structure corresponding to the first information from the table structure file, and extracting second information from the table structure;
adding the first information and the second information to a result cache;
and repeating the steps until the traversal search of the table data file is completed, and generating a search result based on the result cache.
With reference to the first aspect, the present invention further provides a 2 nd preferred implementation manner of the first aspect, specifically, initializing the configuration target database, specifically including:
exporting the whole database data of the target database to a storage path according to a preset storage path;
generating a table structure file from all table structures of a target database according to a first preset configuration condition, wherein the table structure file comprises multiple rows of table structure information, a single table structure occupies one row of table structure information, and the first element of each row of table structure information is a table name;
and generating a table data file from the table data corresponding to the table structure according to a second preset configuration condition, wherein the table data file comprises a plurality of lines of data information, one line of data of the table data occupies one line of data information, and the first element of each line of data information is a table name.
With reference to the first aspect, the present invention further provides a 3 rd preferred implementation manner of the first aspect, specifically, generating a table data file from table data corresponding to a table structure according to a second preset configuration condition, specifically including:
data of different table data can be integrated into the same table data file until the data volume reaches the maximum line number threshold value of the table data file;
or when the data quantity of single table data exceeds the maximum line number threshold value of the table data file, the table data is divided into a plurality of table data files to be stored.
With reference to the first aspect, the present invention further provides a 4 th preferred implementation manner of the first aspect, specifically, performing traversal search on a table data file according to a keyword includes:
traversing and searching the row data, specifically, reading a table data file in a row reading mode, searching keywords for the read character string, if the character string is hit, extracting a table name pointed by the row data, extracting a table header from a corresponding table structure file, adding the table name, the table header and the hit row data into a result cache, and if the character string is not hit, skipping to the next row or the next file until traversing is completed;
or alternatively;
file traversal search, specifically, reading a table data file in a text mode, searching keywords in the read text, and if the name is found, adding the table name of the table data file to a result cache; and traversing the hit table data files in the result cache after traversing all the table data files, and determining hit row data.
With reference to the first aspect, the present invention further provides a 5 th preferred implementation manner of the first aspect, specifically, before constructing a table structure connection model map of a target database based on search results, the method further includes the following steps:
displaying the search result;
judging whether to perform recursive search;
if the recursive search is carried out, the characteristic data value of any table structure corresponding to the search result is used as a recursive key word, the search steps are repeated, and a recursive search result is generated;
if the recursive search is not carried out, the next step is directly carried out.
With reference to the first aspect, the present invention further provides a 6 th preferred embodiment of the first aspect, specifically, the constructing a table structure connection model map of the target database based on the search result includes:
the search result is used for indicating that virtual foreign keys exist between data tables; the table structures of the several hits are associated based on the search structure, and a table structure association model graph is depicted.
In a second aspect, the present invention provides an apparatus for reverse analysis of a relational database table structure, including:
the configuration module is used for initializing a configuration target database, generating a table structure file from a plurality of table structures of the target database, and generating a table data file from table data corresponding to the table structures;
the searching module is used for acquiring searched keywords, searching in the table data file according to the keywords and generating a searching result;
and the construction module is used for constructing a table structure connection model diagram of the target database based on the search result and outputting the search result and the table structure connection model diagram.
In a third aspect, the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute the steps of the method for reverse analysis of a relational database table structure according to the first aspect.
In a fourth aspect, the present invention provides a computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for inverse analysis of a relational database table structure according to the first aspect.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a reverse analysis method of a relational database table structure, which is used for a method for rapidly analyzing table association relations of a relational database. Compared with the existing universal global search tool, the method has the advantages of higher pertinence, more concentrated analysis scale, higher operation speed and more visual result display. The files are divided into two types of table structure files and table data files. Generating a table structure text file by the data table structure information; the database table data generates a plurality of data files according to the system performance, and the keywords are searched for the data files line by line. The search results are displayed through texts and diagrams, and are focused on the table structure and the association relation between the tables.
Drawings
Embodiments of the invention are described in further detail below with reference to the attached drawing figures, wherein:
FIG. 1 is a flow chart of a method for reverse analysis of a relational database table structure according to the present invention;
FIG. 2 is a schematic diagram of a reverse analysis device for relational database table structure according to the present invention;
FIG. 3 is a schematic illustration of a search result presentation of the present invention;
FIG. 4 is a relational model diagram of a constructed database table structure of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Software is a collection of computer data and algorithm instructions organized in a specific order. Under two mainstream architecture branches of C-S (client-server) and B-S (browser-server), data is mainly stored in a relational database, such as Mysql, Oracle and the like. The applicant researches and discovers that as the data scale of a software system is gradually huge, the method for displaying the database table relationship by using the physical foreign key is more and more cumbersome and is gradually abandoned. Instead, virtual foreign keys, in this way the following table structure illustrates that the following forms often exist: the database model graph is used for describing the database table structure description document and the software source code.
The database table structure description is a description of the data table itself and the relation between the data tables, is the basis for understanding software behaviors and functions, and is not independent of the database table structure description whether development assistance, later-stage iterative maintenance or software reconstruction. The database table structure description has significance to software systems, similar to instructions for the use of complex machines, and would be difficult to use and difficult to maintain without the instruction for use. However, in an actual scenario, the important description is often lost due to various reasons, so that the software system is not understandable, and further, the work based on the use, maintenance, modification, reconstruction and the like of the software is difficult and serious, and even the project can be directly failed.
Therefore, the invention provides a reverse analysis method of a relational database table structure, which is used for realizing global search according to one or more keywords and further analyzing and obtaining the incidence relation between the business tables to which the keywords belong.
Specifically, the reverse analysis method of the relational database table structure of the invention configures the target database by initialization; generating a table structure file from a plurality of table structures of a target database, and generating a table data file from table data corresponding to the table structures; acquiring searched keywords, searching in a table data file according to the keywords, and generating a search result; and constructing a table structure connection model diagram of the target database based on the search result, and outputting the search result and the table structure connection model diagram.
The method can be realized by using Python language, and has the advantages of more pertinence, more centralized analysis scale, higher operation speed and more visual result display compared with a general global search tool through focusing on the analysis of the database table structure. In order to avoid interference caused by using a system of an analyzed database, the data cleaning difficulty is reduced, and the space and time complexity of an analysis target is greatly reduced.
The following describes in detail a reverse analysis method of a relational database table structure provided in an embodiment of the present application with reference to fig. 1.
Referring to fig. 1, fig. 1 is a schematic flow chart of a reverse analysis method for a relational database table structure according to an embodiment of the present application, where the reverse analysis method for a relational database table structure includes the following steps:
s100: initializing and configuring a target database, generating a table structure file from a plurality of table structures of the target database, and generating a table data file from table data corresponding to the table structures.
Aiming at the defects of complicated arrangement, weak pertinence, interference on normal operation of software and the like of the conventional global search tool, the invention provides a brand-new solution: a specific text file with a uniform specification is used as a data intermediate carrier, all data are loaded by the intermediate carrier as few as possible, and the time complexity and the space complexity of reverse analysis can be reduced; multiple keywords may be used for a search to improve the accuracy of the results.
In the present invention, the table structure file and the table data file are both in line units, each line may have several elements, the elements are enclosed with a prime (') and the elements are separated by spaces ('). The target database is configured by initialization, a text file format of a line structure is adopted as a data carrier, and the files are divided into two types: table structure file, table data file. Generating a table structure text file by the data table structure information; the database table data generates a plurality of table data files according to the system performance, and the table data files traverse the search keywords line by line.
Specifically, the initializing the configuration target database specifically includes:
s110: and exporting the full database data of the target database to the storage path according to the preset storage path.
For example, initial configuration is required to be performed when a database is analyzed for the first time, the initial configuration includes configuring a file path large enough for storing a text file data carrier, configuring database connection information for generating a text file, and automatically exporting full-library information to a configured storage path by the system after configuration is completed.
S120: generating a table structure file from all table structures of the target database according to a first preset configuration condition, wherein the table structure file comprises multiple rows of table structure information, a single table structure occupies one row of table structure information, and the first element of each row of table structure information is a table name.
In one implementation, a table structure file is generated from all table structures of the target database, single table structure information occupies one row, and the first element of each row is a table name. An example of a table structure file format is as follows:
′table_name′′file_name1′′file_name2′′file_name3′′file_name4′……′file_nameN′
s130: and generating a table data file from the table data corresponding to the table structure according to a second preset configuration condition, wherein the table data file comprises a plurality of lines of data information, one line of data of the table data occupies one line of data information, and the first element of each line of data information is a table name.
Illustratively, the table data generates a table data file with a single row of data comprising a row, the first element of each row being a table name. When configuring the table data file, the maximum line number threshold value can be determined according to the performance of the current operating environment. An example data file format is as follows:
′table_name′′file_value1′′file_value2′′file_value3′′file_value4′……′file_valueN′
in a preferred implementation, data of different table data can be integrated into the same table data file until the data amount reaches the maximum line number threshold of the table data file; or when the data quantity of single table data exceeds the maximum line number threshold value of the table data file, the table data is divided into a plurality of table data files to be stored.
S200: and acquiring searched keywords, and searching in the table data file according to the keywords to generate a search result.
In one implementation, the setting requirements of the keywords for searching are derived from actual service scenes, and the stronger the characteristics of the keywords, the higher the searching efficiency; conversely, if the characteristic is weak, the keyword is present in a plurality of scenes, and the more interference is present.
For example, taking a database of a workflow system as an example, the process name of the workflow, the ID attached to the URL when the workflow is viewed, and other characteristic information are all good keywords. By carrying out global search through the keywords, the database tables involved in the creation and circulation of a flow can be quickly outlined.
It should be noted that the relationship between the keywords and the field value of the database table may be a complete match or a partial match. The number of the keywords may be one or more. If multiple keywords are selected, each keyword is required to appear in a different field to be hit. For example: keys key1, key2, a hit if field 1 of a row in Table a matches key1 and field 2 matches key 2.
According to the invention, preferably, during searching, the searching range and the filtering range can be customized; based on empirical or pre-determined search results, only one or more data tables may be designated for searching, and one or more data tables may be designated for not participating in the search.
Illustratively, in the process of initial configuration, a search range and a filter range are customized in a selected target database, specifically, one or more target data tables are designated for searching, one or more data tables are designated not to participate in searching, and a screened table structure file and a screened table data file are generated. By this arrangement, many known ineffective interferences can be excluded, increasing the analysis speed.
In one specific implementation, searching in the table data file according to the keyword specifically includes the following steps:
s210: and performing traversal search on the table data file according to the keywords.
Illustratively, the present invention performs the traversal based on the table data file produced when the target database is initially configured. The traversal unit can be used for traversing the file according to rows and files (after hit, the file is traversed and positioned to the row data), and a row-by-row traversal algorithm is used by default. Therefore, the invention provides two search modes, including row data traversal search and file traversal search.
Wherein, the row data traversal search comprises: reading the table data file in a line reading mode, searching keywords for the read character string, if the character string is hit, extracting the table name pointed by the line of data, extracting the table header from the corresponding table structure file, adding the table name, the table header and the hit line of data into a result cache, and if the character string is not hit, skipping to the next line or the next file until traversal is completed.
It can be directly understood that the line traversal is taken as the name to read the table data file in a line reading mode, the read character string is searched for keywords, if the character string is hit, the table name (the first element) pointed by the line of data is extracted, the table header is extracted from the table structure file, the table name, the table header and the hit line of data are added to the result, and if the character string is not hit, the next line or the next file is skipped until the traversal is completed.
Wherein the file traversal searching comprises: reading the table data file in a text mode, searching keywords in the read text, and if the name of the table data file is found, adding the table name of the table data file to a result cache; and traversing the hit table data files in the result cache after traversing all the table data files, and determining hit row data.
It can be directly understood that the file traversal is completed in two steps: determining a hit file; the hit line data is determined at the hit file. The whole data file is read into the system in a text mode, keywords are searched in the text, and if the keywords are hit, the table name is added into a result cache. And after the file traversal in the first step is completed, performing row-by-row traversal on the hit in the result cache.
S220: when hit, extracting first information from the table data file;
s230: identifying a table structure corresponding to the first information from the table structure file, and extracting second information from the table structure;
s240: adding the first information and the second information to a result cache;
s250: and repeating the steps S210-S240 until the traversal search of the table data file is completed, and generating a search result based on the result cache.
Wherein the search result comprises three elements: table name, table header (table field), hit row data, and highlight setting of hit keywords. The result cache is shown in fig. 3.
After the search structure is output, the search result is displayed, and the hit keywords are highlighted, so that the search result is convenient for the staff to check. And displaying the search result to provide the search condition of the search result for the worker so as to judge whether the recursive search is needed.
Specifically, the step S200 further includes:
s260: and displaying the search result.
S270: it is determined whether to perform a recursive search.
S271: if the recursive search is carried out, the characteristic data value of any table structure corresponding to the search result is used as a recursive key word, the search steps are repeated, and a recursive search result is generated;
s272: if the recursive search is not carried out, the next step is directly carried out.
For example, the worker may select whether to perform the recursive search, which may be triggered by entering commands, clicking on options, and the like. If not, directly jumping to the step S300. If the recursive search is performed, the worker is required to select the characteristic data value of any data table in the search result as a key word, and then the steps S210 to S250 are repeated. If the search is already recursive, the step is skipped directly.
S300: and constructing a table structure connection model diagram of the target database based on the search result, and outputting the search result and the table structure connection model diagram.
Illustratively, the search results are used to indicate the presence of virtual foreign keys between data tables; the table structures of the several hits are associated based on the search structure, and a table structure association model graph is depicted.
Based on the virtual foreign key associating database table relationships, it can be appreciated that a virtual foreign key exists between two tables as if a key appeared in both tables (field values). Example (c): the key is key, the value of the A field of the data table A is key, the value of the B field of the data table B is key, and the data table A and the data table B can be provisionally determined to have the virtual external key A-B. Accordingly, a database table structure contact model diagram can be automatically drawn according to the search result, as shown in FIG. 4.
The embodiment of the present application further provides a reverse analysis device for a relational database table structure, including:
the configuration module is used for initializing a configuration target database, generating a table structure file from a plurality of table structures of the target database, and generating a table data file from table data corresponding to the table structures;
the searching module is used for acquiring searched keywords, searching in the table data file according to the keywords and generating a searching result;
and the construction module is used for constructing a table structure connection model diagram of the target database based on the search result and outputting the search result and the table structure connection model diagram.
The configuration module, the search module and the construction module are further used for executing part or all of the steps of the reverse analysis method of the relational database table structure.
An embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the processor executes part or all of the steps of the reverse analysis method for the relational database table structure described in the foregoing embodiment.
The embodiment of the application discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the computer readable storage medium realizes part or all of the steps of the reverse analysis method of the relational database table structure in the previous embodiment.
The present application provides a computer program product, which includes a computer readable storage medium storing a computer program, where the computer program makes a computer execute part or all of the steps of the inverse analysis method for a relational database table structure described in the foregoing embodiment.
The explanations and expressions of the technical features and the extensions of various implementation forms in the above specific method embodiments and embodiments are also applicable to the method execution in the apparatus, and are not repeated in the apparatus embodiments.
It should be understood that the division of the modules in the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. For example, each of the above modules may be a processing element separately set up, or may be implemented by being integrated in a certain chip of the terminal, or may be stored in a storage element of the controller in the form of program code, and a certain processing element of the processor calls and executes the functions of each of the above modules. In addition, the modules can be integrated together or can be independently realized. The processing element described herein may be an integrated circuit chip having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software. The processing element may be a general-purpose processor, such as a Central Processing Unit (CPU), or may be one or more integrated circuits configured to implement the above methods, such as: one or more application-specific integrated circuits (ASICs), or one or more microprocessors (DSPs), or one or more field-programmable gate arrays (FPGAs), among others.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention in any way, so that any modification, equivalent change and modification made to the above embodiment according to the technical spirit of the present invention are within the scope of the technical solution of the present invention.

Claims (10)

1. A reverse analysis method for a relational database table structure is characterized by comprising the following steps:
initializing a configuration target database, generating a table structure file from a plurality of table structures of the target database, and generating a table data file from table data corresponding to the table structures;
acquiring searched keywords, searching in a table data file according to the keywords, and generating a search result;
and constructing a table structure connection model diagram of the target database based on the search result, and outputting the search result and the table structure connection model diagram.
2. The method for reverse analysis of a relational database table structure according to claim 1, wherein searching in a table data file according to the keyword specifically comprises the following steps:
traversing and searching in the table data file according to the keywords;
when hit, extracting first information from the table data file;
identifying a table structure corresponding to the first information from the table structure file, and extracting second information from the table structure;
adding the first information and the second information to a result cache;
and repeating the steps until the traversal search of the table data file is completed, and generating a search result based on the result cache.
3. The method of claim 2, wherein initializing the configuration target database specifically comprises:
exporting the whole database data of the target database to a storage path according to a preset storage path;
generating a table structure file from all table structures of a target database according to a first preset configuration condition, wherein the table structure file comprises multiple rows of table structure information, a single table structure occupies one row of table structure information, and the first element of each row of table structure information is a table name;
and generating a table data file from the table data corresponding to the table structure according to a second preset configuration condition, wherein the table data file comprises a plurality of lines of data information, one line of data of the table data occupies one line of data information, and the first element of each line of data information is a table name.
4. The reverse analysis method for the relational database table structure according to claim 3, wherein generating a table data file from the table data corresponding to the table structure according to a second preset configuration condition specifically includes:
data of different table data can be integrated into the same table data file until the data volume reaches the maximum line number threshold value of the table data file;
or when the data quantity of single table data exceeds the maximum line number threshold value of the table data file, the table data is divided into a plurality of table data files to be stored.
5. The method of claim 3, wherein the performing a traversal search on the table data file according to the keyword specifically comprises:
traversing and searching the row data, specifically, reading a table data file in a row reading mode, searching keywords for the read character string, if the character string is hit, extracting a table name pointed by the row data, extracting a table header from a corresponding table structure file, adding the table name, the table header and the hit row data into a result cache, and if the character string is not hit, skipping to the next row or the next file until traversing is completed;
or alternatively;
file traversal search, specifically, reading a table data file in a text mode, searching keywords in the read text, and if the name is found, adding the table name of the table data file to a result cache; and traversing the hit table data files in the result cache after traversing all the table data files, and determining hit row data.
6. The method for reverse analysis of relational database table structure according to claim 1, wherein before building the table structure linkage model map of the target database based on the search result, the method further comprises the following steps:
displaying the search result;
judging whether to perform recursive search;
if the recursive search is carried out, the characteristic data value of any table structure corresponding to the search result is used as a recursive key word, the search steps are repeated, and a recursive search result is generated;
if the recursive search is not carried out, the next step is directly carried out.
7. The method for reverse analysis of a relational database table structure according to claim 1, wherein constructing a table structure relational model graph of a target database based on search results specifically comprises:
the search result is used for indicating that virtual foreign keys exist between data tables; the table structures of the several hits are associated based on the search structure, and a table structure association model graph is depicted.
8. An apparatus for reverse analysis of a relational database table structure, comprising:
the configuration module is used for initializing a configuration target database, generating a table structure file from a plurality of table structures of the target database, and generating a table data file from table data corresponding to the table structures;
the searching module is used for acquiring searched keywords, searching in the table data file according to the keywords and generating a searching result;
and the construction module is used for constructing a table structure connection model diagram of the target database based on the search result and outputting the search result and the table structure connection model diagram.
9. An electronic device, comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the method for reverse analysis of a relational database table structure of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for inverse analysis of a relational database table structure according to any one of claims 1 to 7.
CN202110983245.0A 2021-08-25 2021-08-25 Reverse analysis method and device for relational database table structure Pending CN114385764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110983245.0A CN114385764A (en) 2021-08-25 2021-08-25 Reverse analysis method and device for relational database table structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110983245.0A CN114385764A (en) 2021-08-25 2021-08-25 Reverse analysis method and device for relational database table structure

Publications (1)

Publication Number Publication Date
CN114385764A true CN114385764A (en) 2022-04-22

Family

ID=81194923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110983245.0A Pending CN114385764A (en) 2021-08-25 2021-08-25 Reverse analysis method and device for relational database table structure

Country Status (1)

Country Link
CN (1) CN114385764A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115328883A (en) * 2022-06-29 2022-11-11 江苏昆山农村商业银行股份有限公司 Data warehouse modeling method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115328883A (en) * 2022-06-29 2022-11-11 江苏昆山农村商业银行股份有限公司 Data warehouse modeling method and system

Similar Documents

Publication Publication Date Title
US9990362B2 (en) Profiling data with location information
US10769147B2 (en) Batch data query method and apparatus
US8332389B2 (en) Join order for a database query
de Leoni et al. Discovering branching conditions from business process execution logs
US20120179726A1 (en) Flow analysis instrumentation
CN106293891B (en) Multidimensional investment index monitoring method
CN111382347A (en) Object feature processing and information pushing method, device and equipment
CN114490375B (en) Performance test method, device, equipment and storage medium of application program
CN115512823A (en) Equipment exception handling method and device, exception handling system and equipment
US9195730B2 (en) Verifying correctness of a database system via extended access paths
CN114385764A (en) Reverse analysis method and device for relational database table structure
CN107330031B (en) Data storage method and device and electronic equipment
CN113760891A (en) Data table generation method, device, equipment and storage medium
US8478575B1 (en) Automatic anomaly detection for HW debug
CN106991116A (en) The optimization method and device of database executive plan
CN116560984A (en) Test case clustering grouping method based on call dependency graph
CN110580170A (en) software performance risk identification method and device
Ocaña et al. Data analytics in bioinformatics: data science in practice for genomics analysis workflows
CN115185998A (en) Target field searching method and device, server and computer readable storage medium
US11556460B2 (en) Test case generation for software development using machine learning
CN110414813B (en) Index curve construction method, device and equipment
CN111291056B (en) Method for associating data table bottom layers of BI tool
CN114661503A (en) Software associated configuration error diagnosis method and device based on program slice
WO2021104027A1 (en) Code performance testing method, apparatus and device, and storage medium
CN112328630A (en) Data query method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination