CN111190880A - Database detection method and device and computer readable storage medium - Google Patents

Database detection method and device and computer readable storage medium Download PDF

Info

Publication number
CN111190880A
CN111190880A CN201910730861.8A CN201910730861A CN111190880A CN 111190880 A CN111190880 A CN 111190880A CN 201910730861 A CN201910730861 A CN 201910730861A CN 111190880 A CN111190880 A CN 111190880A
Authority
CN
China
Prior art keywords
information
database
relationship
design document
detected
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.)
Granted
Application number
CN201910730861.8A
Other languages
Chinese (zh)
Other versions
CN111190880B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910730861.8A priority Critical patent/CN111190880B/en
Publication of CN111190880A publication Critical patent/CN111190880A/en
Application granted granted Critical
Publication of CN111190880B publication Critical patent/CN111190880B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/21Design, administration or maintenance of databases

Abstract

The embodiment of the invention discloses a database detection method, a database detection device and a computer readable storage medium; according to the embodiment of the invention, after the design document of the to-be-detected database is obtained, the design document is analyzed to determine the structural relationship among the contents in the design document, the relationship tree is constructed based on the structural relationship, the attribute information of the nodes in the relationship tree is obtained, the structural information of the to-be-detected database is generated according to the relationship tree and the node attribute information, and the structural information of the to-be-detected database is detected to obtain the detection result.

Description

Database detection method and device and computer readable storage medium
Technical Field
The invention relates to the technical field of communication, in particular to a database detection method, a database detection device and a computer readable storage medium.
Background
With the advent of the big data era and the increasing data processing amount, the data management technology is rapidly developed, and the database model which is very important in the data management technology is more and more refined and complex. After the database design is completed, the detection of the database model becomes a troublesome problem, for example, for the detection of the database model in the payment field, because the payment link is long, some fields are the same, but the definitions are inconsistent, the codes are accessed, the general system test is difficult to cover, and the manual visual inspection is complicated and troublesome. The prior art mainly detects by embedding a rule checking Script in a database design tool, for example, in a data modeling tool (PowerDesigner), a detection rule is written by using a Visual Basic Script (VBS) embedded therein.
In the research and practice process of the prior art, the inventor of the invention finds that when a user detects through a database design tool, all codes of a database need to be detected, and the efficiency is low in the detection process.
Disclosure of Invention
The embodiment of the invention provides a database detection method, a database detection device and a computer readable storage medium, which can improve the detection efficiency.
A database detection method, comprising:
acquiring a design document of a database to be detected;
analyzing the design document to determine a structural relationship between contents in the design document;
constructing a relation tree based on the structural relation, and acquiring attribute information of nodes in the relation tree;
generating the structural information of the database to be detected according to the relationship tree and the node attribute information;
and detecting the structural information of the database to be detected to obtain a detection result.
Correspondingly, an embodiment of the present invention provides a database detection apparatus, including:
the acquisition unit is used for acquiring a design document of the database to be detected;
the analysis unit is used for analyzing the design document to determine the structural relationship among the contents in the design document;
the construction unit is used for constructing a relation tree based on the structural relation and acquiring the attribute information of the nodes in the relation tree;
the generating unit is used for generating the structural information of the database to be detected according to the relationship tree and the node attribute information;
and the detection unit is used for detecting the structural information of the database to be detected to obtain a detection result.
Optionally, in some embodiments, the building unit is specifically configured to extract a hierarchical relationship between contents in the design document in the structural relationship, and build the relationship tree based on the hierarchical relationship.
Optionally, in some embodiments, the building unit is specifically configured to screen contents of different hierarchies in the design document according to the hierarchical relationship, obtain a data block having an association relationship among the contents of different hierarchies, and add the data block in the hierarchical relationship to build the relationship tree.
Optionally, in some embodiments, the building unit is specifically configured to obtain at least one node in the relationship tree, and extract attribute information of the node from the content of the design document according to the obtained node.
Optionally, in some embodiments, the generating unit is specifically configured to extract node relationship information from the relationship tree, fuse the node relationship information and the node attribute information, and use the fused information as the structural information of the to-be-detected database.
Optionally, in some embodiments, the detection unit is specifically configured to classify the structured information of the database to be detected, select a corresponding type of structured information according to a detection level among different types of structured information, and compare the selected structured information with preset structured information to obtain a detection result.
Optionally, in some embodiments, the detection unit is specifically configured to generate a detection level list when detecting that a user operates a detection level control for detecting a page, where the detection level list includes multiple detection levels, and when detecting that the user performs a selection operation for a detection level in the detection level list, select a corresponding type of structured information according to the selected detection level.
Optionally, in some embodiments, the detecting unit is specifically configured to create a regular expression of a corresponding type according to the selected structured information, match the regular expression with the selected structured information, determine that the data to be detected meets the requirement of the design document when the selected structured information is matched with the regular expression, and determine that the database to be detected does not meet the requirement of the design document when the selected structured information is not matched with the regular expression.
Optionally, in some embodiments, the detecting unit is specifically configured to generate prompt information when the selected structured information is not matched with the regular expression, where the prompt information includes unqualified code information.
Optionally, in some embodiments, the parsing unit is specifically configured to read the content of the design document, classify the content of the design document, obtain relationships between different types of content according to a classification result, and generate a structural relationship between the content in the design document according to the relationships between different types of content.
In addition, an embodiment of the present invention further provides an electronic device, which includes a processor and a memory, where the memory stores an application program, and the processor is configured to run the application program in the memory to implement the database detection method provided in the embodiment of the present invention.
In addition, the embodiment of the present invention further provides a computer-readable storage medium, where a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to perform the steps in the database detection method provided in the embodiment of the present invention.
According to the embodiment of the invention, after the design document of the to-be-detected database is obtained, the design document is analyzed to determine the structural relationship among the contents in the design document, the relationship tree is constructed based on the structural relationship, the attribute information of the nodes in the relationship tree is obtained, the structural information of the to-be-detected database is generated according to the relationship tree and the node attribute information, and the structural information of the to-be-detected database is detected to obtain the detection result.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of a scenario of a database detection method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a database detection method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a relationship tree structure provided by an embodiment of the present invention;
FIG. 4 is a schematic diagram of a detection page provided by an embodiment of the present invention;
FIG. 5 is a schematic diagram of a detection result of a detection page provided in an embodiment of the present invention;
FIG. 6 is another flow chart of a database detection method according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a database detection apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an analysis unit of the database detection apparatus according to the embodiment of the present invention;
fig. 9 is a schematic structural diagram of a building unit of a database detection apparatus according to an embodiment of the present invention;
FIG. 10 is a schematic structural diagram of a detection unit of the database detection apparatus according to the embodiment of the present invention;
FIG. 11 is a schematic diagram of another structure of a detection unit of the database detection apparatus according to the embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
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 embodiment of the invention provides a database detection method, a database detection device and a computer readable storage medium. The database detection device may be integrated in an electronic device, and the electronic device may be a server or a terminal.
For example, as shown in fig. 1, taking as an example that the database detection apparatus is integrated in an electronic device, after the electronic device obtains a design document of a database to be detected, the electronic device parses the design document to determine a structural relationship between contents in the design document, constructs a relationship tree based on the structural relationship, obtains attribute information of nodes in the relationship tree, generates structural information of the database to be detected according to the relationship tree and the node attribute information, and detects the structural information of the database to be detected to obtain a detection result.
The following are detailed below. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
In this embodiment, a description will be given from the perspective of a database detection apparatus, where the database detection apparatus may be specifically integrated in an electronic device, and the electronic device may be a server or a terminal; the terminal may include a tablet Computer, a notebook Computer, a Personal Computer (PC), and other devices.
A database detection method, comprising: the method comprises the steps of obtaining a design document of a database to be detected, analyzing the design document to determine a structural relationship among contents in the design document, constructing a relationship tree based on the structural relationship, obtaining attribute information of nodes in the relationship tree, generating structural information of the database to be detected according to the relationship tree and the node attribute information, and detecting the structural information of the database to be detected to obtain a detection result.
As shown in fig. 2, the specific flow of the database detection method is as follows:
101. and acquiring a design document of the database to be detected.
The design documents of the database to be detected may include Conceptual Data Model (CDM), Logical Data Model (LDM), Physical Data Model (PDM), and other design documents.
So-called CDM documents may store information of a conceptual data model, such as user demand for data storage, describing data demand at the enterprise level in dataclasses, which represent several major categories of data that naturally aggregate in a business environment. The CDM document may also store important entities and relationships between entities. The entities may be abstract objects, for example, in a course selection system, students, teachers, classes, courses, and the like are all entities.
So-called LDM documents, logical data model information may be stored. For example, the system analysis designer's view of the data store is a further decomposition and refinement of the conceptual data model. Wherein the logical data model is a basic blueprint of the business objects, data of the business objects and relationships between the business objects determined according to the business rules. The contents of the logical data model include all entities and relationships, determine the attributes of each entity, define the primary key of each entity, specify the foreign key of the entity, and require normalization processing.
So-called PDM documents, may store physical data model information. For example, all tables and columns are determined, foreign keys are defined for determining relationships between tables, and normalization may be performed based on user requirements. The physical data model permanently specifies how to realize the logical data model by using a database mode and really stores data.
For example, the database to be detected is determined, and the design document is obtained from the database, and there are various ways of obtaining the design document, for example, the CDM, LDM, PDM, and other design documents of the database to be detected can be derived by using the database design software PowerDesigner, and the design documents such as CDM, LDM, PDM, and other design documents can be obtained from the original design documents of the database. It should be noted that in the database design process, a design document may contain at least one design file, and one design file includes at least one database model structure.
102. The design document is parsed to determine structural relationships between content in the design document.
For example, the content of the design document may include 4 parts, such as A, B, C and D, a is entity information of the logical data model in the design document, such as how many entities the logical data model may contain, B is entity attribute information of the logical data model, such as specific attributes of each entity, C is a relationship between entities of the logical data model, such as a relationship between each entity, D is entity application scenario information of the logical data model, such as application scenario information of each entity, and an association relationship of the four parts constitutes the structural relationship of the design document.
For example, the manner of parsing the design document may include multiple manners, for example, corresponding parsing components may be developed for the design documents such as CDM, LDM, and PDM, and the parsing components are utilized to read the content of the design documents such as CDM, LDM, and PDM, for example, the content of codes in the design documents, the meaning and specific comments of the codes, the domain of the codes, and the index information are read. The read content is classified in various ways, and the classification can be performed according to the function of the code in the content, for example, the design code in one design document can include functions of generating entity information, obtaining entity attribute information, obtaining entity relationship information and/or generating application scenario information, and the classification is performed according to different functions, and is divided into types of generating an entity information part, obtaining entity attribute information part, obtaining entity relationship information part and/or generating application scenario information part. The method can also be divided according to the position of the content code in the design document, for example, dividing the code applied to the bottom layer into a bottom layer part, dividing the code applied to the middle layer into a middle part, and dividing the code applied to the interactive layer into an interactive part, wherein the bottom layer part, the middle part and the interactive part are associated with each other to jointly form a data model structure of the database design document.
The method includes the steps of obtaining relations among different types of contents based on classification results of the contents of design documents of a database to be detected, for example, dividing the contents of the design documents into a generation entity information part, an acquisition entity attribute information part, an acquisition entity relation information part and/or a generation application scene information part and the like, obtaining the relations between the generation entity information part and the acquisition entity attribute information part, for example, types and numbers of entities generated by the generation entity information part, and obtaining attribute information of each type or each entity corresponding to the entity attribute information part according to the types and numbers of the entities, such as name of the entity, identification of the entity, position of the entity in the database and the like. The relationship between the entity information generating part and the entity relationship information acquiring part can also be acquired, for example, the type and the number of the entities generated by the entity information generating part, and the relationship between different types or different entities corresponding to the entity relationship information part can be acquired according to the type and the number of the entities.
And generating a structural relationship among the contents in the design document according to the relationship among the different contents. For example, different contents are arranged according to the structure of the whole design document according to the relationship between the different contents to obtain the whole frame structure of the whole design document, the relationship between the different contents is associated with the frame structure of the design document to obtain the structural relationship between the contents in the design document, for example, the design document comprises the contents 1, 2 and 3, the contents are arranged according to the structure of the whole design document according to the relationship between the three contents, for example, the contents 1 are arranged at the head, the contents 2 are arranged at the middle, the contents 3 are arranged at the tail, and the structural relationship of the design document, that is, the structural relationship of the contents 1, 2 and 3 which constitute the design document, is obtained by combining the contents 1 at the head, the contents 2 at the middle and the contents 3 at the tail according to the relationship between the contents 1, 2 and 3.
103. And constructing a relation tree based on the structural relation, and acquiring attribute information of nodes in the relation tree.
The relational tree is also called a tree structure, can be a data structure with one-to-many tree relations among data elements, and is an important nonlinear data structure. In the tree structure, elements are connected with one another through nodes to form the tree structure, wherein the tree structure is compared as a tree, a tree root node has no precursor node, and each of the other nodes has one precursor node. The leaf node has no subsequent node, and the number of the subsequent nodes of each of the rest nodes can be one or more.
The nodes may be regarded as data points in a database structure, or may be mapping points of different content blocks in a database model in a database design document, wherein a relational tree or a tree structure includes a plurality of nodes, and different nodes and relationships between nodes constitute a main structure of the relational tree. In the database design document, the node may include entity information, entity attribute information, and/or entity application scenario information.
For example, a hierarchical relationship is extracted from a structural relationship among contents of a design document, where the hierarchical relationship may include a relationship corresponding to a hierarchy in the structural relationship of different contents, for example, different contents may be divided by a logical relationship, such as different contents include content 1, content 2, and content 3, in the structural relationship, content 1 is located at the bottom of the structural relationship, content 2 is located in the middle of the structural relationship, and content 3 is located at the top of the structural relationship, where content 1 is the basis of content 2 and content 3, content 1 exists to generate or obtain content 2 and content 3, and content 3 is a practical application of content 2 in a business scenario, and thus, the hierarchical relationship among contents of content 1, content 2, and content 3 in the structural relationship may be content 1-content 2-content 3, the hierarchical relationship can also be extracted for content 3-content 2-content 1.
On the basis of the hierarchical relationship, the design document is screened for contents of different levels, for example, the hierarchical relationship in the structural relationship of the contents of the design document can be content 1-content 2-content 3. The data blocks having an association relationship in the contents of different hierarchies are obtained, for example, the data blocks may have an association relationship between the content 1 and the content 2, or the data blocks 1 and 2 having an association relationship in the content 1. And acquiring the two types of data blocks in contents of different levels to obtain an association relation data block set. Adding data blocks in the hierarchical relationship to build a relationship tree. For example, taking the hierarchical relationship in the structural relationship of the content of the design document as content 1-content 2-content 3 as an example, content 1 is located at the bottom of the structural relationship, the position corresponding to the relationship tree is a tree root position, data block 1, data block 2 and data block 3 with an association relationship are obtained in content 1, at this time, data block 1 is at the bottommost layer of three data blocks, then data block 1 corresponds to the root node position of the tree root, data block 2 and data block 3 are sequentially arranged along the tree root upwards, for example, data block 3 has an association relationship with data block 4 in content 2, content 2 corresponds to the relationship tree as a trunk, data block 4 can be the first node of the trunk, and then data blocks with an association relationship are sequentially added to the trunk of the relationship tree to form a trunk and a road, and finally data blocks corresponding to leaf nodes in content 3 are obtained, to complete the construction of the relationship tree, a common relationship tree is shown in fig. 3.
The method includes the steps of obtaining nodes in a relation tree, wherein each branch point, root node and leaf node in the relation tree are all nodes of the relation tree, extracting attribute information of corresponding nodes from the content of a design document of at least one obtained node, for example, obtaining a node A, a node B and a node C in the relation tree, and extracting attribute information of the node A, attribute information of the node B and attribute information of the node C in the design document, wherein the attribute information can include information such as names, identifications and data types of the nodes.
104. And generating the structural information of the database to be detected according to the relationship tree and the node attribute information.
The structured information may be data that is recognizable, organized in a row-column structure, and such data is usually a record, or a file, or a field of data that is correctly labeled, and can be precisely located. The design document in the database can be analyzed and then decomposed into a plurality of interrelated components, and each component has a definite hierarchical structure.
For example, the node relationship information is extracted from the relationship tree, for example, the relationship between nodes can be obtained from the relationship tree, for example, node a and node B can be different branches of the same type of node, node a and node C can be adjacent nodes before and after the same branch, and so on. And extracting the relationship among the nodes in the relationship tree in the form of node relationship information. The extracted node relation information and the node attribute information are fused, and there are various fusion modes, for example, the node relation information and the node attribute information can be merged, and the merged information is used as the structural information of the database to be detected. The node information may also be associated with the node attribute information, and the associated information is used as the structured information of the to-be-detected database, for example, a single node attribute information in the node attribute information is associated with a corresponding node in the node relationship information, and after the association relationship is added, the corresponding node attribute information is added to the corresponding node relationship information to form the structured information of the to-be-detected database.
105. And detecting the structural information of the database to be detected to obtain a detection result.
(1) Classifying structural information of database to be detected
For example, the structured information of the database to be detected may be detected, and before the detection, the structured information of the database to be detected may be classified, for example, the structured information may be classified into information such as naming information, comment specification information, field type information, index information, enumeration value information, reserved field information, and field information. The subdivision may also continue among these large categories, with each large category being subdivided into multiple small categories.
(2) Selecting corresponding type of structured information according to detection level from different types of structured information
For example, when detecting that a user operates a detection level control for detecting a page, a detection level list is generated, for example, when the user triggers a detection registration control on the detection page, the detection level list is generated, taking the detection level as three levels as an example, the detection level list can be divided into three detection levels, namely, an important level and a general level, wherein the important level corresponds to the forced detection of all structured information, the important level corresponds to the detection of structured information of an important category in the structured information, and the general level corresponds to the detection of part of general structured information. For example, the structured information of the database to be detected can be classified into A, B and C types of structured information, if the selected detection level is very important, all the A, B and C types of structured information are detected, if the selected detection level is important, the important structured information of the three types is detected, for example, if the important structured information is two types of structured information, i.e., a and B, only the two types of structured information, i.e., a and B, are detected, and if the selected detection level is general, for example, if the common structured information is C type structured information, only the C type of structured information is detected.
Before the user operates the detection level control for the detection page, the user may upload or import the design document of the database to be detected to the detection page, as shown in fig. 4. For example, CDM, LDM, and PDM documents are uploaded to the database detection apparatus, and the database detection apparatus receives the uploaded or imported documents and displays the uploaded or imported documents on the detection page.
(3) Comparing the selected structural information with preset structural information to obtain a detection result
For example, according to the selected structural information, a regular expression of a corresponding type is created, and the regular expression is matched with the selected structural information. Regular expressions, also known as Regular Expressions (REs), are logical formulas that operate on strings of characters (including common characters (e.g., letters between a and z) and special characters (called meta characters), i.e., a "Regular string" that is formed by combining specific characters defined in advance and specific characters, and is used to express a filtering logic for the string of characters, Regular expressions are text patterns that describe one or more strings to be matched when searching for text, Regular expressions are generally used to retrieve and replace text that conforms to a certain pattern (rule), for example, structured information includes comment specification information, a Regular Expression corresponding to the comment specification information is created, a detection rule or specification is added to the Regular Expression, for example, a regular command such as "the table needs to have comment explanation" and "the field name needs to have comment" is added to the regular expression to form a filtering logic for comment explanation character strings, the character strings of the comment explanation are detected in the structured information, if the table is found to exist but no comment explanation is found, the regular expression corresponding to the comment explanation information is not matched, and the problem is detected, for example, the character strings of the field name are detected, and the character strings of the field name in the structured information are found to have comment explanation, the regular expression corresponding to the comment explanation information is matched, and the type structured information is detected.
For example, the detection level selected by the user on the detection page is L0, one or more types of structured information corresponding to the L0 level in the structured information of the design document are detected, a regular expression with a naming specification is taken as an example to match the structured information of the design document, and in the process of detecting the Table named 'Table-1' in a certain row of codes in the structured information, the mismatch with the regular expression is found, which indicates that the database to be detected does not meet the requirements of the design document. And (4) supposing that the names of the tables in the structured information are all 'table _', detecting, finding that the tables are matched with the regular expression, and indicating that the database to be detected meets the requirements of the design document. It is emphasized here that, when it is determined that the database to be detected meets the requirements of the design document, each line of codes in the corresponding structured information is matched with the corresponding type regular expression according to the selected detection level, and both the line of codes meet the design specification or rule in the regular expression, and if there is a piece of structured information of the design specification or rule that does not meet the design specification or rule, the database to be detected does not meet the requirements of the design document.
When the selected structural information does not match the regular expression, it is determined that the database to be detected does not meet the design requirement, and at the same time, prompt information may be generated on the detection page, for example, a type of structural information that fails to be detected may be displayed, for example, a type of naming specification fails, and a specific code position and a cause of error may also be displayed, as shown in fig. 5. When the prompt message is displayed, the prompt message of the correct code can be given for the error code, so that the user can be helped to quickly modify the error code, for example, the prompt message can be generated as follows:
Figure BDA0002160537180000111
and a modification control can be added after the prompt message, when the operation of the user for the modification control is detected, the user jumps to the structured information of the design document to edit, and according to the editing mode, the user can select to automatically modify according to the modification suggestion or manually edit.
As can be seen from the above, in the embodiment, after the design document of the database to be detected is obtained, the design document is analyzed to determine the structural relationship between the contents in the design document, the relationship tree is constructed based on the structural relationship, the attribute information of the nodes in the relationship tree is obtained, the structured information of the database to be detected is generated according to the relationship tree and the node attribute information, and the structured information of the database to be detected is detected to obtain the detection result. In the detection process of the database, the scheme only detects the structural information in the design document, but not detects all the contents of the design document, so that the detection efficiency is greatly improved.
The method described in the previous embodiment is further detailed by way of example.
In the embodiment, the database detection apparatus is specifically integrated in an electronic device as an example for explanation.
As shown in fig. 6, a database detection method specifically includes the following steps:
201. the electronic equipment acquires a design document of the database to be detected.
For example, the electronic device may derive the design documents such as CDM, LDM, and PDM of the database to be detected by using the database design software PowerDesigner, and may also obtain the design documents such as CDM, LDM, and PDM from the original design documents of the database to upload to the electronic device. It should be noted that in the database design process, a design document may contain at least one design file, and one design file includes at least one database model structure.
202. The electronic device parses the design document to determine structural relationships between content in the design document.
For example, the electronic device may include an analysis component for a design document such as CDM, LDM, and PDM, and the analysis component may read the content of the design document such as CDM, LDM, and PDM, and read the content of the code in the design document, the meaning of the code, specific comments, the field of the code, and index information. The read contents are classified in various ways, and the classification can be performed according to the functions of codes in the contents, and can be classified according to different functions, such as an entity information generating part, an entity attribute information acquiring part, an entity relationship information acquiring part and/or an application scene information generating part. The method can also be divided according to the position of the content code in the design document, for example, dividing the code applied to the bottom layer into a bottom layer part, dividing the code applied to the middle layer into a middle part, and dividing the code applied to the interactive layer into an interactive part, wherein the bottom layer part, the middle part and the interactive part are associated with each other to jointly form a data model structure of the database design document.
Based on the classification result of the content of the design document of the database to be detected, the content of the design document can be classified into a generation entity information part, an acquisition entity attribute information part, an acquisition entity relationship information part and/or a generation application scene information part, and the like, and the electronic equipment can acquire the relationship between the generation entity information part and the acquisition entity attribute information part. For example, the entity type and number generated by the entity information part are generated, and according to the type and number of the entity, the attribute information of each type or each entity corresponding to the entity attribute information part, such as the name of the entity, the identity of the entity, and the location of the entity in the database, is obtained. The relationship between the generated entity information part and the obtained entity relationship information part can also be obtained.
The electronic equipment arranges the different contents according to the relationship among the different contents and the structure of the whole design document to obtain the whole frame structure of the whole design document, and associates the relationship among the different contents with the frame structure of the design document to obtain the structural relationship among the contents in the design document.
203. The electronic equipment builds a relation tree based on the structural relation and obtains attribute information of nodes in the relation tree.
For example, the electronic device may divide different levels of different contents in the structural relationship by logical relationships in the structural relationship between the contents of the design document, such as, for example, different contents including content 1, content 2 and content 3, in the structural relationship, content 1 is at the bottom of the structural relationship, content 2 is in the middle of the structural relationship, content 3 is at the top of the structural relationship, wherein, the content 1 is the basis of the content 2 and the content 3, the content 1 exists to generate or obtain the content 2 and the content, between the content 2 and the content 3, the content 3 is the actual application of the content 2 in the business scene, so that it can be obtained that the hierarchical relationship among the content 1, the content 2 and the content 3 in the structural relationship can be the content 1-the content 2-the content 3, or the content 3-the content 2-the content 1, and the hierarchical relationship is extracted.
On the basis of the hierarchical relationship, the electronic device screens the design document for different levels of content, for example, the hierarchical relationship in the structural relationship of the content of the design document may be content 1-content 2-content 3. The electronic device obtains data blocks having an association relationship in contents of different hierarchies, for example, the data blocks may have an association relationship between the content 1 and the content 2, or the data blocks 1 and 2 having an association relationship in the content 1. And acquiring the two types of data blocks in contents of different levels to obtain an association relation data block set. Adding data blocks in the hierarchical relationship to build a relationship tree. For example, taking the hierarchical relationship in the structural relationship of the content of the design document as content 1-content 2-content 3 as an example, content 1 is located at the bottom of the structural relationship, the position corresponding to the relationship tree is the tree root position, data block 1, data block 2 and data block 3 with an association relationship are obtained in content 1, at this time, data block 1 is at the bottommost layer of three data blocks, then data block 1 corresponds to the root node position of the tree root, data block 2 and data block 3 are sequentially arranged along the tree root upwards, for example, data block 3 has an association relationship with data block 4 in content 2, content 2 corresponds to the relationship tree as a trunk, data block 4 can be the first node of the trunk, then data blocks with an association relationship are sequentially added to the trunk of the relationship tree to form a trunk and a route, and finally data blocks corresponding to leaf nodes in content 3 are obtained, to complete the construction of the relationship tree, a common relationship tree is shown in fig. 3.
The electronic equipment acquires nodes in a relation tree, each branch point, root node and leaf node in the relation tree are all nodes of the relation tree, and the acquired at least one node extracts attribute information of the corresponding node from the content of the design document.
204. And the electronic equipment generates the structural information of the database to be detected according to the relationship tree and the node attribute information.
For example, the electronic device may obtain the relationship between nodes in the relationship tree, for example, node a and node B may be different branches of the same type of node, node a and node C are adjacent nodes before and after the same branch, and so on. The electronic equipment extracts the relationship between the nodes in the relationship tree in the form of node relationship information. The extracted node relation information and the node attribute information are fused, and there are various fusion modes, for example, the node relation information and the node attribute information can be merged, and the merged information is used as the structural information of the database to be detected. The node information may also be associated with the node attribute information, and the associated information is used as the structured information of the to-be-detected database, for example, a single node attribute information in the node attribute information is associated with a corresponding node in the node relationship information, and after the association relationship is added, the corresponding node attribute information is added to the corresponding node relationship information to form the structured information of the to-be-detected database.
205. And the electronic equipment classifies the structural information of the database to be detected.
For example, the electronic device classifies the structural information of the database to be detected, and for example, the structural information may be classified into information such as naming information, comment specification information, field type information, index information, enumeration value information, reserved field information, and field information. The subdivision may also continue among these large categories, with each large category being subdivided into multiple small categories.
206. Among the different types of structured information, the electronic device selects the corresponding type of structured information according to the detection level.
For example, when it is detected that the user triggers the detection registration control on the detection page, the electronic device generates a detection level list, which can be divided into three detection levels, namely, a very important level, an important level and a general level, where the very important level corresponds to forcible detection on all structured information, the important level corresponds to detection on important structured information in the structured information, and the general level corresponds to detection on part of common structured information. For example, the structured information of the database to be detected can be classified into A, B and C types of structured information, if the selected detection level is very important, all the A, B and C types of structured information are detected, if the selected detection level is important, the important structured information of the three types is detected, for example, if the important structured information is two types of structured information, i.e., a and B, only the two types of structured information, i.e., a and B, are detected, and if the selected detection level is general, for example, if the common structured information is C type structured information, only the C type of structured information is detected.
Before the user operates the detection level control for the detection page, the user may upload or import the design document of the database to be detected to the detection page, as shown in fig. 4. For example, CDM, LDM, and PDM documents are uploaded to the database detection apparatus, and the database detection apparatus receives the uploaded or imported documents and displays the uploaded or imported documents on the detection page.
207. And the electronic equipment compares the selected structural information with preset structural information to obtain a detection result.
For example, according to the selected structural information, the electronic device creates a regular expression of a corresponding type, and matches the regular expression with the selected structural information. For example, the structured information includes comment explanation information, a regular expression corresponding to the comment explanation information is created, a detection rule or specification is added to the regular expression, for example, a standard command such as "table must have comment explanation" and "field name needs comment" is added to the regular expression to form a filtering logic for comment explanation character strings, the character strings of comment explanation are detected in the structured information, if a table is found but no comment explanation is found, the regular expression corresponding to the comment explanation information is not matched, and a problem is detected, for example, the character strings of field name are detected, the character strings of field name in the structured information are all found to have comment explanation, the expression corresponding to the comment explanation information is regularly matched, and the type structured information is detected. The specifications in a common structured information regular expression are shown in the following table.
Figure BDA0002160537180000151
Figure BDA0002160537180000161
Taking the above table as an example, for different types of structured information, different detection levels may be set, for example, detection levels such as L0, L1, and L2 may be set, and when the detection level is selected as L0, the structured information corresponding to the detection level of L0 in the above table is detected, and the above detection level may be set according to practical applications. When it is detected that the user does not select the detection level on the detection page, the default detection level may be set to L0 or any of the detection levels. How to judge whether the detection level of the user is not selected on the detection page is mainly determined by the fact that the user does not operate on the detection level control of the detection page within the preset time range, and the preset time is set according to actual application.
For example, the detection level selected by the user on the detection page is L0, the electronic device detects one or more types of structured information corresponding to the L0 level in the structured information of the design document, takes a regular expression of a common naming specification as an example, matches the structured information of the design document, and in the process of detecting the Table named 'Table-1' in a certain row of codes in the structured information, finds that the Table is not matched with the regular expression, which indicates that the database to be detected does not meet the requirements of the design document. And (4) supposing that the names of the tables in the structured information are all 'table _', detecting, finding that the tables are matched with the regular expression, and indicating that the database to be detected meets the requirements of the design document. It is emphasized here that, when it is determined that the database to be detected meets the requirements of the design document, each line of codes in the corresponding structured information is matched with the corresponding type regular expression according to the selected detection level, and both the line of codes meet the design specification or rule in the regular expression, and if there is a piece of structured information of the design specification or rule that does not meet the design specification or rule, the database to be detected does not meet the requirements of the design document.
When the selected structural information does not match the regular expression, the electronic device determines that the database to be detected does not meet the design requirement, and at the same time, may generate a prompt message on the detection page, for example, may display the type of the structural information that fails to be detected, such as the type of the naming specification that fails, and may also display the specific code location and the error reason, as shown in fig. 5. When the prompt message is displayed, the electronic device may also give a prompt message of a correct code for the error code, which may help the user to quickly modify the error code, for example, the prompt message may be generated as follows:
Figure BDA0002160537180000171
and a modification control can be added after the prompt message, when the operation of the user for the modification control is detected, the user jumps to the structured information of the design document to edit, and according to the editing mode, the user can select to automatically modify according to the modification suggestion or manually edit.
As can be seen from the above, in this embodiment, after the electronic device acquires the design document of the database to be detected, the design document is analyzed to determine the structural relationship between the contents in the design document, construct a relationship tree based on the structural relationship, acquire the attribute information of the nodes in the relationship tree, generate the structured information of the database to be detected according to the relationship tree and the node attribute information, and detect the structured information of the database to be detected to obtain the detection result. In the detection process of the database, the scheme only detects the structural information in the design document, but not detects all the contents of the design document, so that the detection efficiency is greatly improved.
In order to better implement the above method, an embodiment of the present invention further provides a database detection apparatus, where the database detection apparatus may be integrated in an electronic device, and the electronic device may include a server, a terminal, and other devices.
For example, referring to fig. 7, the database detection apparatus may include an acquisition unit 301, an analysis unit 302, a construction unit 303, a generation unit 304, and a detection unit 305, as follows:
(1) an acquisition unit 301;
an obtaining unit 301, configured to obtain a design document of a database to be detected;
for example, the obtaining unit 301 may be specifically configured to derive design documents such as CDM, LDM, and PDM of the database to be detected by using the database design software PowerDesigner, and may also obtain the design documents such as CDM, LDM, and PDM from the original design documents of the database.
(2) An analysis unit 302;
an analyzing unit 302, configured to analyze the design document to determine a structural relationship between contents in the design document;
the parsing unit 302 may include a reading subunit 3021, a first classifying subunit 3022, a first obtaining subunit 3023, and a first generating subunit 3024, as shown in fig. 8, specifically as follows:
a reading sub-unit 3021 for reading the content of the design document;
a first classification subunit 3022 configured to classify the content of the design document;
a first acquiring subunit 3023, configured to acquire relationships between different types of content based on the classification structure;
a first generating subunit 3024, configured to generate a structural relationship between the contents in the design document according to the relationship between the different contents.
For example, the reading sub-unit 3021 reads the content of the design document, the first classification sub-unit 3022 classifies the content of the design document, the acquisition sub-unit 3023 acquires the relationship between different types of content based on the classification structure, and the generation sub-unit 3024 generates the structural relationship between the content in the design document according to the relationship between different types of content.
(3) A building unit 303;
a constructing unit 303, configured to construct a relationship tree based on the structural relationship, and obtain attribute information of nodes in the relationship tree;
the constructing unit 303 may include an extracting sub-unit 3031, a constructing sub-unit 3032, and a second obtaining sub-unit 3033, as shown in fig. 9, specifically as follows:
an extraction subunit 3031, configured to extract a hierarchical relationship in the structural relationship;
a constructing subunit 3032, configured to construct the relationship tree in the content of the design document based on the hierarchical relationship;
and a second obtaining subunit 3033, configured to obtain attribute information of a node in the relationship tree.
For example, the extracting sub-unit 3031 extracts a hierarchical relationship in the structural relationship, the constructing sub-unit 3032 constructs the relationship tree in the content of the design document based on the hierarchical relationship, and the second acquiring sub-unit 3033 acquires the attribute information of the node in the relationship tree.
(4) A generation unit 304;
a generating unit 304, configured to generate structured information of the database to be detected according to the relationship tree and the node attribute information;
for example, the generating unit 304 is specifically configured to extract node relationship information from the relationship tree, combine the node relationship information with the node attribute information, and use the combined information as the structural information of the to-be-detected database.
(5) A detection unit 305;
the detecting unit 305 is configured to detect the structural information of the database to be detected, and obtain a detection result;
the detecting unit 305 may include a second sorting subunit 3051, a selecting subunit 3052, and a comparing subunit 3053, as shown in fig. 10, which are specifically as follows:
the second classification subunit 3051, configured to classify the structural information of the database to be detected;
a selecting subunit 3052, configured to select, from among different types of structured information, a corresponding type of structured information according to the detection level;
the comparison subunit 3053 is configured to create a regular expression of a corresponding type according to the selected structural information, match the regular expression with the selected structural information, and determine that the data to be detected meets the requirement of the design document when the selected structural information is matched with the regular expression; and when the selected structural information is not matched with the regular expression, determining that the database to be detected does not meet the requirements of the design document.
For example, the second classification subunit 3051 classifies the structural information of the database to be detected, the selection subunit 3052 selects a corresponding type of structural information from different types of structural information according to the detection level, the comparison subunit 3053 creates a regular expression of the corresponding type according to the selected structural information, matches the regular expression with the selected structural information, and determines that the data to be detected meets the requirement of the design document when the selected structural information is matched with the regular expression; and when the selected structural information is not matched with the regular expression, determining that the database to be detected does not meet the requirements of the design document.
In an embodiment, the detecting unit 305 may further include a second generating subunit 3054, as shown in fig. 11, specifically as follows:
a second generating subunit 3054, configured to generate, when the selected structural information does not match the regular expression, prompt information, where the prompt information includes the unqualified code information.
For example, the second generating subunit 3054 is specifically configured to, when the selected structural information does not match the regular expression, determine that the database to be detected does not meet the design requirement, and at the same time, generate the prompt information on the detection page, for example, may display a type of structural information that is not detected, such as a name specification type, and may also display a specific code location and a cause of the error. When the prompt message is displayed, the prompt message of the correct code can be given for the error code, and the user can be helped to quickly modify the error code.
As can be seen from the above, in the database detection apparatus of this embodiment, after the obtaining unit 301 obtains the design document of the database to be detected, the analyzing unit 302 analyzes the design document to determine the structural relationship between the contents in the design document, the building unit 303 builds the relationship tree based on the structural relationship and obtains the attribute information of the nodes in the relationship tree, the generating unit 304 generates the structural information of the database to be detected according to the relationship tree and the node attribute information, and the detecting unit 305 detects the structural information of the database to be detected to obtain the detection result. In the detection process of the database, the scheme only detects the structural information in the design document, but not detects all the contents of the design document, so that the detection efficiency is greatly improved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 12, which shows a schematic structural diagram of the electronic device according to the embodiment of the present invention, specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 12 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the whole electronic device by various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing various functions as follows:
the method comprises the steps of obtaining a design document of a database to be detected, analyzing the design document to determine a structural relationship among contents in the design document, constructing a relationship tree based on the structural relationship, obtaining attribute information of nodes in the relationship tree, generating structural information of the database to be detected according to the relationship tree and the node attribute information, and detecting the structural information of the database to be detected to obtain a detection result.
For example, the database to be detected may be determined specifically, the design document may be obtained from the database, the CDM, LDM, PDM, and other design documents of the database to be detected may be derived by using the database design software PowerDesigner, and the CDM, LDM, PDM, and other design documents may be obtained from the original design documents of the database. Corresponding analysis components can be developed for design documents such as CDM, LDM and PDM, and the analysis components can be used for reading the contents of the design documents such as CDM, LDM and PDM, for example, the contents of codes in the design documents, the meanings and specific comments of the codes, the fields of the codes, index information and the like. The read contents are classified in various ways, classification can be performed according to the functions of codes in the contents, relationships among different types of contents are obtained based on classification results of the contents of the design documents of the database to be detected, and structural relationships among the contents in the design documents are generated according to the relationships among the different contents. For example, according to the relationship between different contents, the different contents are arranged according to the structure of the whole design document to obtain the whole frame structure of the whole design document, and the relationship between the different contents is associated with the frame structure of the design document to obtain the structural relationship between the contents in the design document. Extracting a hierarchical relationship in a structural relationship among contents of a design document, wherein the hierarchical relationship may include a relationship corresponding to a hierarchy in which different contents are located in the structural relationship, for example, different hierarchies of the different contents in the structural relationship may be divided by a logical relationship, on the basis of the hierarchical relationship, screening the contents of different hierarchies in the design document according to the hierarchical relationship, obtaining data blocks having an association relationship among the contents of different hierarchies, and adding the data blocks in the hierarchical relationship to construct a relationship tree. And acquiring nodes in the relation tree, wherein each branch point, root node and leaf node in the relation tree are all nodes of the relation tree, and extracting attribute information of the corresponding node from the content of the design document by using at least one acquired node. The node relationship information is extracted from the relationship tree, for example, the relationship between the nodes can be obtained from the relationship tree, and the relationship between the nodes in the relationship tree is extracted in the form of the node relationship information. And combining the extracted node relation information and the node attribute information, merging the node relation information and the node attribute information, and taking the merged information as the structural information of the database to be detected. The method comprises the steps of detecting structural information of a database to be detected, classifying the structural information of the database to be detected before detection, generating a detection level list when detecting that a user operates aiming at a detection level control of a detection page, selecting the structural information of a corresponding type according to the detection level, creating a regular expression of the corresponding type according to the selected structural information, matching the regular expression with the selected structural information, determining that the data to be detected meets the requirement of a design document when the selected structural information is matched with the regular expression, and determining that the database to be detected does not meet the requirement of the design document when the selected structural information is not matched with the regular expression.
The above operations can be implemented in the foregoing embodiments, and are not described herein.
As can be seen from the above, in the embodiment, after the design document of the database to be detected is obtained, the design document is analyzed to determine the structural relationship between the contents in the design document, the relationship tree is constructed based on the structural relationship, the attribute information of the nodes in the relationship tree is obtained, the structured information of the database to be detected is generated according to the relationship tree and the node attribute information, and the structured information of the database to be detected is detected to obtain the detection result. In the detection process of the database, the scheme only detects the structural information in the design document, but not detects all the contents of the design document, so that the detection efficiency is greatly improved.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by instructions controlling associated hardware, and the instructions may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps of any one of the database detection methods provided in the embodiments of the present application. For example, the instructions may perform the steps of:
the method comprises the steps of obtaining a design document of a database to be detected, analyzing the design document to determine a structural relationship among contents in the design document, constructing a relationship tree based on the structural relationship, obtaining attribute information of nodes in the relationship tree, generating structural information of the database to be detected according to the relationship tree and the node attribute information, and detecting the structural information of the database to be detected to obtain a detection result.
For example, the database to be detected may be determined specifically, the design document may be obtained from the database, the CDM, LDM, PDM, and other design documents of the database to be detected may be derived by using the database design software PowerDesigner, and the CDM, LDM, PDM, and other design documents may be obtained from the original design documents of the database. Corresponding analysis components can be developed for design documents such as CDM, LDM and PDM, and the analysis components can be used for reading the contents of the design documents such as CDM, LDM and PDM, for example, the contents of codes in the design documents, the meanings and specific comments of the codes, the fields of the codes, index information and the like. The read contents are classified in various ways, classification can be performed according to the functions of codes in the contents, relationships among different types of contents are obtained based on classification results of the contents of the design documents of the database to be detected, and structural relationships among the contents in the design documents are generated according to the relationships among the different contents. For example, according to the relationship between different contents, the different contents are arranged according to the structure of the whole design document to obtain the whole frame structure of the whole design document, and the relationship between the different contents is associated with the frame structure of the design document to obtain the structural relationship between the contents in the design document. Extracting a hierarchical relationship in a structural relationship among contents of a design document, wherein the hierarchical relationship may include a relationship corresponding to a hierarchy in which different contents are located in the structural relationship, for example, different hierarchies of the different contents in the structural relationship may be divided by a logical relationship, on the basis of the hierarchical relationship, screening the contents of different hierarchies in the design document according to the hierarchical relationship, obtaining data blocks having an association relationship among the contents of different hierarchies, and adding the data blocks in the hierarchical relationship to construct a relationship tree. And acquiring nodes in the relation tree, wherein each branch point, root node and leaf node in the relation tree are all nodes of the relation tree, and extracting attribute information of the corresponding node from the content of the design document by using at least one acquired node. The node relationship information is extracted from the relationship tree, for example, the relationship between the nodes can be obtained from the relationship tree, and the relationship between the nodes in the relationship tree is extracted in the form of the node relationship information. And combining the extracted node relation information and the node attribute information, merging the node relation information and the node attribute information, and taking the merged information as the structural information of the database to be detected. The method comprises the steps of detecting structural information of a database to be detected, classifying the structural information of the database to be detected before detection, generating a detection level list when detecting that a user operates aiming at a detection level control of a detection page, selecting the structural information of a corresponding type according to the detection level, creating a regular expression of the corresponding type according to the selected structural information, matching the regular expression with the selected structural information, determining that the data to be detected meets the requirement of a design document when the selected structural information is matched with the regular expression, and determining that the database to be detected does not meet the requirement of the design document when the selected structural information is not matched with the regular expression.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer-readable storage medium can execute the steps in any database detection method provided by the embodiment of the present invention, the beneficial effects that can be achieved by any database detection method provided by the embodiment of the present invention can be achieved, for details, see the foregoing embodiments, and are not described herein again.
The above detailed description is provided for a database detection method, apparatus and computer-readable storage medium according to the embodiments of the present invention, and the specific examples are applied herein to explain the principles and implementations of the present invention, and the descriptions of the above embodiments are only used to help understanding the method and its core ideas of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. A database detection method, comprising:
acquiring a design document of a database to be detected;
analyzing the design document to determine a structural relationship between contents in the design document;
constructing a relation tree based on the structural relation, and acquiring attribute information of nodes in the relation tree;
generating the structural information of the database to be detected according to the relationship tree and the node attribute information;
and detecting the structural information of the database to be detected to obtain a detection result.
2. The database detection method according to claim 1, wherein constructing a relationship tree based on the structural relationship comprises:
extracting a hierarchical relationship among contents in the design document in the structural relationship;
and constructing a relation tree based on the hierarchical relation.
3. The database detection method according to claim 2, wherein constructing a relationship tree based on the hierarchical relationship comprises:
screening contents of different levels in the design document according to the level relation;
acquiring data blocks with incidence relations in the contents of different levels;
and adding the data blocks in the hierarchical relationship to construct a relationship tree.
4. The database detection method according to claim 1, wherein obtaining attribute information of the nodes in the relationship tree comprises:
acquiring at least one node in the relation tree;
and extracting the attribute information of the node from the content of the design document according to the acquired node.
5. The database detection method according to any one of claims 1 to 3, wherein generating the structured information of the database to be detected according to the relationship tree and the node attribute information comprises:
extracting node relation information from the relation tree;
fusing the node relationship information and the node attribute information;
and taking the fused information as the structural information of the database to be detected.
6. The database detection method according to any one of claims 1 to 3, wherein detecting the structured information of the database to be detected to obtain a detection result comprises:
classifying the structural information of the database to be detected;
selecting the corresponding type of structured information according to the detection level from the different types of structured information;
and comparing the selected structural information with preset structural information to obtain a detection result.
7. The database detection method according to claim 6, wherein selecting the corresponding type of structured information according to the detection level comprises:
when detecting that a user operates a detection level control of a detection page, generating a detection level list, wherein the detection level list comprises a plurality of detection levels;
and when the selection operation of the user for the detection levels in the detection level list is detected, selecting the corresponding type of structured information according to the selected detection levels.
8. The database detection method according to claim 6, wherein comparing the selected structural information with the preset structural information to obtain a detection result comprises:
creating regular expressions of corresponding types according to the selected structural information;
matching the regular expression with the selected structured information;
when the selected structural information is matched with the regular expression, determining that the to-be-detected database meets the requirements of the design document;
and when the selected structural information is not matched with the regular expression, determining that the database to be detected does not meet the requirements of the design document.
9. The database detection method according to claim 8, wherein when the selected structured information does not match the regular expression, after determining that the database to be detected does not meet the requirements of the design document, further comprising:
when the selected structured information does not match the regular expression, prompt information is generated, wherein the prompt information comprises unqualified code information.
10. The database inspection method according to any one of claims 1 to 3, wherein parsing the design document to determine structural relationships between contents in the design document comprises:
reading the content of the design document;
classifying the content of the design document;
obtaining the relation between different types of contents based on the classification result;
and generating a structural relationship among the contents in the design document according to the relationship among different contents.
11. A database inspection apparatus, comprising:
the acquisition unit is used for acquiring a design document of the database to be detected;
the analysis unit is used for analyzing the design document to determine the structural relationship among the contents in the design document;
the construction unit is used for constructing a relation tree based on the structural relation and acquiring the attribute information of the nodes in the relation tree;
the generating unit is used for generating the structural information of the database to be detected according to the relationship tree and the node attribute information;
and the detection unit is used for detecting the structural information of the database to be detected to obtain a detection result.
12. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the database detection method according to claims 1 to 10.
CN201910730861.8A 2019-08-08 2019-08-08 Database detection method, device and computer readable storage medium Active CN111190880B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910730861.8A CN111190880B (en) 2019-08-08 2019-08-08 Database detection method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910730861.8A CN111190880B (en) 2019-08-08 2019-08-08 Database detection method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111190880A true CN111190880A (en) 2020-05-22
CN111190880B CN111190880B (en) 2024-03-12

Family

ID=70705684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910730861.8A Active CN111190880B (en) 2019-08-08 2019-08-08 Database detection method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111190880B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752923A (en) * 2020-06-28 2020-10-09 中国银行股份有限公司 Script monitoring method and device
CN112100316A (en) * 2020-09-16 2020-12-18 北京天空卫士网络安全技术有限公司 Data management method and device
WO2023273410A1 (en) * 2021-06-29 2023-01-05 华为云计算技术有限公司 Specification design method and apparatus, and related device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050050059A1 (en) * 2003-08-25 2005-03-03 Van Der Linden Robbert C. Method and system for storing structured documents in their native format in a database
CN108132957A (en) * 2016-12-01 2018-06-08 中国移动通信有限公司研究院 A kind of data base processing method and device
CN109165143A (en) * 2018-08-17 2019-01-08 张家港康得新光电材料有限公司 Database detection method, system, server and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050050059A1 (en) * 2003-08-25 2005-03-03 Van Der Linden Robbert C. Method and system for storing structured documents in their native format in a database
CN108132957A (en) * 2016-12-01 2018-06-08 中国移动通信有限公司研究院 A kind of data base processing method and device
CN109165143A (en) * 2018-08-17 2019-01-08 张家港康得新光电材料有限公司 Database detection method, system, server and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752923A (en) * 2020-06-28 2020-10-09 中国银行股份有限公司 Script monitoring method and device
CN112100316A (en) * 2020-09-16 2020-12-18 北京天空卫士网络安全技术有限公司 Data management method and device
WO2023273410A1 (en) * 2021-06-29 2023-01-05 华为云计算技术有限公司 Specification design method and apparatus, and related device

Also Published As

Publication number Publication date
CN111190880B (en) 2024-03-12

Similar Documents

Publication Publication Date Title
CN104866426B (en) Software test integrated control method and system
CN111190880B (en) Database detection method, device and computer readable storage medium
CN110457302A (en) A kind of structural data intelligence cleaning method
US20220035847A1 (en) Information retrieval
CN112328489B (en) Test case generation method and device, terminal equipment and storage medium
CN115422371A (en) Software test knowledge graph-based retrieval method
CN114385679A (en) Meter structure inspection method, meter structure inspection device and electronic equipment
CN114547077A (en) Intelligent processing system and method for basic government affair form data
CN112363996A (en) Method, system, and medium for building a physical model of a power grid knowledge graph
Yang et al. User story clustering in agile development: a framework and an empirical study
CN112632223A (en) Case and event knowledge graph construction method and related equipment
CN109800147B (en) Test case generation method and terminal equipment
CN116595191A (en) Construction method and device of interactive low-code knowledge graph
Nurdiansyah et al. Implementation of winnowing algorithm based K-gram to identify plagiarism on file text-based document
CN115952298A (en) Supplier performance risk analysis method and related equipment
CN113407678B (en) Knowledge graph construction method, device and equipment
CN113779248A (en) Data classification model training method, data processing method and storage medium
CN108197183A (en) A kind of control layout based on Android application recommends method and its system
CN113221528A (en) Automatic generation and execution method of clinical data quality evaluation rule based on openEHR model
Uhrig et al. Tool support for the evaluation of matching algorithms in the eclipse modeling framework
CN112487160B (en) Technical document tracing method and device, computer equipment and computer storage medium
CN109739835A (en) A kind of versions of data store method and device
Mamo et al. The myth of reproducibility: A review of event tracking evaluations on Twitter
KR102632771B1 (en) System and method for extracting data of catalog image
CN111143337B (en) Method for improving data quality in product data management system

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
GR01 Patent grant
GR01 Patent grant