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

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

Info

Publication number
CN111190880B
CN111190880B CN201910730861.8A CN201910730861A CN111190880B CN 111190880 B CN111190880 B CN 111190880B CN 201910730861 A CN201910730861 A CN 201910730861A CN 111190880 B CN111190880 B CN 111190880B
Authority
CN
China
Prior art keywords
information
database
design document
relation
detection
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.)
Active
Application number
CN201910730861.8A
Other languages
Chinese (zh)
Other versions
CN111190880A (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

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; after the design document of the database to be detected is obtained, the design document is analyzed to determine the structural relation among the contents in the design document, the relation tree is constructed based on the structural relation, the attribute information of the nodes in the relation tree is obtained, the structural information of the database to be detected is generated according to the relation tree and the node attribute information, and the structural information of the database to be detected is detected to obtain a detection result.

Description

Database detection method, device and computer readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a database detection method, apparatus, and computer readable storage medium.
Background
With the advent of the big data age, data processing capacity has been increased, data management techniques have been developed rapidly, and database models, which are very important in data management techniques, have been finer 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, the payment link is relatively long, and the fields are the same, but the definition is inconsistent, the code is in and out, the system test is difficult to cover in general, and the manual visual inspection is complicated. The prior art mainly performs detection by embedding a script for rule checking in a database design tool, for example, in a data modeling tool (PowerDesigner), the detection rule is written by using a visual script language (Visual Basic Script Edition, VBS) embedded in the database design tool.
In the research and practice process of the prior art, the inventor of the present invention found that when a user detects through a database design tool, all codes of the database need to be detected, and in the detection process, the efficiency is low.
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 detection efficiency.
A database detection method, comprising:
acquiring a design document of a database to be detected;
analyzing the design document to determine the structural relationship between the 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 structural information of the database to be detected according to the relation tree and the node attribute information;
and detecting the structured information of the database to be detected to obtain a detection result.
Correspondingly, an embodiment of the present invention provides a database detection device, including:
the acquisition unit is used for acquiring the design document of the database to be detected;
the analysis unit is used for analyzing the design document to determine the structural relation among the contents in the design document;
The building unit is used for building a relation tree based on the structural relation and acquiring attribute information of nodes in the relation tree;
the generating unit is used for generating structural information of the database to be detected according to the relation tree and the node attribute information;
the detection unit is used for detecting the structured 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 a relationship tree based on the hierarchical relationship.
Optionally, in some embodiments, the building unit is specifically configured to screen contents of different levels in the design document according to the level relationship, obtain a data block having an association relationship in the contents of different levels, and add the data block in the level relationship to build a relationship tree.
Optionally, in some embodiments, the building unit is specifically configured to obtain at least one node in the relationship tree, and extract, according to the obtained node, attribute information of the node in the content of the design document.
Optionally, in some embodiments, the generating unit is specifically configured to extract node relationship information from the relationship tree, fuse the node relationship information with the node attribute information, and use the fused information as the structured information of the database to be detected.
Optionally, in some embodiments, the detecting unit is specifically configured to classify the structured information of the database to be detected, select, from among different types of structured information, the corresponding type of structured information according to the detection level, and compare the selected structured information with preset structured information to obtain the detection result.
Optionally, in some embodiments, the detection unit is specifically configured to generate a detection level list when detecting a detection level control operation of a user on a detection page, where the detection level list includes a plurality of detection levels, and select, when detecting a selection operation of the user on a detection level in the detection level list, 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 requirements of the design document when the selected structured information matches with the regular expression, and determine that the database to be detected does not meet the requirements of the design document when the selected structured information does not match with the regular expression.
Optionally, in some embodiments, the detection unit is specifically configured to generate hint information when the selected structured information does not match the regular expression, where the hint 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 a relationship 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 relationship between different contents.
In addition, the embodiment of the invention also provides electronic equipment, which comprises a processor and a memory, wherein the memory stores application programs, and the processor is used for running the application programs in the memory to realize the database detection method provided by the embodiment of the invention.
In addition, the embodiment of the invention also provides a computer readable storage medium, which stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor to execute the steps in the database detection method provided by the embodiment of the invention.
After the design document of the database to be detected is obtained, the design document is analyzed to determine the structural relation among the contents in the design document, the relation tree is constructed based on the structural relation, the attribute information of the nodes in the relation tree is obtained, the structural information of the database to be detected is generated according to the relation tree and the node attribute information, and the structural information of the database to be detected is detected to obtain a detection result.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view 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 schematic diagram of 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 according to an embodiment of the present invention;
FIG. 6 is another flowchart of a database detection method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a database detection device 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 construction unit of the database detection apparatus according to the embodiment of the present invention;
Fig. 10 is a schematic structural diagram of a detection unit of the database detection device according to the embodiment of the present invention;
FIG. 11 is another schematic structural diagram of a detection unit of the database detection device 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 following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the 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, which may be a server or a terminal.
For example, as shown in fig. 1, taking the example that the database detection device is integrated in an electronic device, after the electronic device obtains a design document of a database to be detected, the electronic device analyzes 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 will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
The present embodiment will be described in terms of a database detection apparatus, which may be specifically integrated in an electronic device, where the electronic device may be a server or a device such as a terminal; the terminal may include a tablet computer, a notebook computer, a personal computer (PC, personal Computer), and the like.
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 structural relations among contents in the design document, constructing a relation tree based on the structural relations, obtaining attribute information of nodes in the relation tree, generating structural information of the database to be detected according to the relation 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 obtaining a design document of the database to be detected.
Among them, the design documents of the database to be detected may include design documents such as conceptual data model design documents (Conceptual Data Model, CDM), logical data model design documents (Logical Data Model, LDM), and physical data model design documents (Physical Data Model, PDM).
So-called CDM documents, which can store information of conceptual data models, such as user demands for data storage, describe enterprise-level data demands in terms of data classes that represent several main categories of data that naturally aggregate in a business environment. CDM documents may also store important entities and relationships between entities. The entity may be an abstract object, for example, in the course selection system, students, teachers, classes, courses, and the like are all entities.
So-called LDM documents, can store logical data model information. For example, the system analysis designer's perspective on data storage is a further decomposition and refinement of the conceptual data model. Wherein the logical data model is determined according to business rules, a basic blueprint about business objects, data of business objects, and relationships between business objects. The content of the logical data model comprises all entities and relations, the attribute of each entity is determined, the main key of each entity is defined, the foreign key of the entity is designated, and the normalization processing is needed.
So-called PDM documents, can store physical data model information. For example, all tables and columns are determined, foreign keys are defined for determining relationships between tables, and normalization is possible based on the needs of the user. Wherein, the physical data model is how to realize the logical data model by using the database mode and really save the data.
For example, the database to be detected is determined, the design document is obtained from the database, and various manners of obtaining the design document can be adopted, for example, the design documents such as CDM, LDM, PDM and the like of the database to be detected can be derived by using database design software PowerDesigner, and the design documents such as CDM, LDM, PDM and the like can also be obtained from the original design document of the database. It should be noted that in the database design process, the design document may include at least one design file, where a 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.
The structural relationship may include a relationship between content and content that forms a structure of 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 a logical data model in the design document, such as how many entities the logical data model may include, B is entity attribute information of the logical data model, such as a specific attribute 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 the association relationship of the four parts forms the structural relationship of the design document.
For example, various ways of parsing the design document may be included, for example, corresponding parsing components may be developed for the design document such as CDM, LDM, and PDM, and the content of the design document such as CDM, LDM, and PDM may be read by using the parsing components, for example, the content of the code, the meaning of the code, and specific comments, the domain of the code, and the content of index information in the design document may be read. The read content is classified in various manners, and the classification can be performed according to the functions of codes in the content, for example, the design codes in one design document can comprise functions of generating entity information, acquiring entity attribute information, acquiring entity relation information, generating application scene information and the like, and the classification can be performed according to different functions, and the classification is divided into types of generating entity information part, acquiring entity attribute information part, acquiring entity relation information part, generating application scene information part and the like. The division may also be performed according to the location of the content code in the design document, for example, the code applied to the bottom layer is divided into a bottom layer portion, the code applied to the middle layer is divided into a middle portion, and the code applied to the interaction layer is divided into an interaction portion, where the bottom layer portion, the middle portion, and the interaction portion are related to each other to 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 relationship between different types of content is obtained, for example, the content of the design document is classified into the types of generating entity information part, obtaining entity attribute information part, obtaining entity relationship information part and/or generating application scene information part, and the relationship between the generating entity information part and the obtaining entity attribute information part can be obtained, for example, the type and the number of the entity generated by the generating entity information part, and according to the type and the number of the entity, attribute information of each type or each entity corresponding to the entity attribute information part, for example, the name of the entity, the identification of the entity, the position of the entity in the database and the like. The relationship between the generated entity information part and the obtained entity relationship information part, such as the type and number of the generated entity information part, can also be obtained, and the relationship between different types or different entities corresponding to the entity relationship information part can be obtained according to the type and number of the entity.
And generating structural relations among the contents in the design document according to the relations among different contents. For example, according to the relation 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, the relation between the different contents is associated with the frame structure of the design document to obtain the structural relation between the contents in the design document, for example, the design document comprises a content 1, a content 2 and a content 3, according to the relation between three contents, the contents are arranged according to the structure of the whole design document, for example, the content 1 is arranged at the head, the content 2 is arranged at the middle, the content 3 is arranged at the tail, according to the relation between the content 1, the content 2 and the content 3, and the structural relation of the design document is obtained by combining the content 1 of the head, the content 2 of the middle and the content 3 of the tail, namely, the structural relation of the content 1, the content 2 and the content 3 of the composition design document.
103. And constructing a relation tree based on the structural relation, and acquiring attribute information of nodes in the relation tree.
The relation tree is also called a tree structure, and a data structure with a tree relation of one-to-many exists among data elements, so that the relation tree is an important nonlinear data structure. In the tree structure, elements are connected through nodes to form a tree structure, wherein the tree structure is compared with a tree, the tree root node has no precursor node, and each other node has one precursor node. The leaf node has no subsequent nodes, and the number of the subsequent nodes of each other node can be one or a plurality of.
The node can be regarded as a data point in a database structure, or a mapping point of different content blocks in a database model in a database design document, wherein a relational tree or a tree structure comprises a plurality of nodes, and the relationship among the different nodes and the nodes forms a main structure of the relational tree. In the database design document, the nodes may include information such as entity information, entity attribute information, and/or entity application scenario information.
For example, a hierarchical relationship is extracted from a structural relationship between contents of a design document, where the hierarchical relationship may include a relationship corresponding to a hierarchy where different contents are located in the structural relationship, for example, different hierarchies of different contents in the structural relationship may be divided by a logical relationship, for example, different contents include a content 1, a content 2 and a content 3, in the structural relationship, the content 1 is located at a bottom layer of the structural relationship, the content 2 is located in the middle of the structural relationship, the content 3 is located at a top of the structural relationship, where the content 1 is a base of the content 2 and the content 3, the content 1 can generate or obtain the content 2 and the content 3, and the content 3 is an actual application of the content 2 in a service scene, so that the hierarchical relationship of the content 1, the content 2 and the content 3 in the structural relationship may be a content 1-content 2-content 3, or a content 3-content 2-content 1, and the hierarchical relationship is extracted.
Based on the hierarchical relationship, the design document is screened for different hierarchical contents, 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 with association relationships in the contents of different levels are obtained, for example, the data blocks with association relationships between the contents 1 and the contents 2 may be the data blocks 1 and the data blocks 2 with association relationships in the contents 1. And acquiring the two types of data blocks from the contents of different levels to obtain an association relationship data block set. Data blocks are added in the hierarchical relationship to build a relationship tree. For example, taking a hierarchical relationship in the structural relationship of the content of the design document as a content 1-content 2-content 3 as an example, the content 1 is located at the bottom of the structural relationship, the position corresponding to the relationship tree is a tree root position, a data block 1, a data block 2 and a data block 3 with an association relationship are obtained in the content 1, at this time, the data block 1 is at the bottommost layer of three data blocks, the data block 1 corresponds to the root node position of the tree root, the data block 2 and the data block 3 are sequentially arranged along the tree root, for example, the data block 3 and the data block 4 in the content 2 have an association relationship, the content 2 corresponds to the tree trunk in the relationship tree, the data block 4 can be the first node of the tree trunk, the data block with the association relationship is sequentially added into the tree trunk to form a trunk and a trunk, and finally the data block corresponding to the leaf node in the content 3 is obtained, so as to complete the construction of the relationship tree, and the common relationship tree is shown in fig. 3.
Acquiring nodes in a relation tree, wherein each branch point, root node and leaf node in the relation tree are nodes of the relation tree, extracting attribute information of a corresponding node from the content of a design document by at least one acquired node, for example, acquiring node A, node B and node C in the relation tree, and extracting attribute information of node A, attribute information of node B and attribute information of node C in the design document, wherein the attribute information can comprise information such as names, identifications and data types of the nodes.
104. And generating structural information of the database to be detected according to the relation tree and the node attribute information.
Wherein the structured information may be identifiable data organized in a row and column structure, such data typically being a record, or a file, or a field in correctly marked data, and being precisely located. The design document of the database can be divided into a plurality of mutually related components after the information is analyzed, and the components have a definite hierarchical structure.
For example, node relationship information is extracted from a relationship tree, for example, relationships between nodes may be obtained in the relationship tree, e.g., node a and node B may be different branches of the same type of node, node a and node C may be adjacent nodes before and after the same branch, and so on. And extracting the relation among the nodes in the relation tree in the form of node relation information. The extracted node relation information and the node attribute information are fused in various modes, for example, the node relation information and the node attribute information can be combined, and the combined information is used as the structural information of the database to be detected. The node information and the node attribute information can be associated, the associated information is used as the structural information of the database to be detected, for example, single node attribute information in the node attribute information and the corresponding node in the node relation information are associated, after the association relation is added, the corresponding node attribute information is added into the corresponding node relation information, and the structural information of the database to be detected is formed.
105. And detecting the structured information of the database to be detected to obtain a detection result.
(1) Classifying structured information of a database to be detected
For example, the structural information of the database to be detected may be classified before the detection, for example, the structural information may be classified into naming type information, annotation description type information, field type information, index type information, enumeration value type information, reserved field type information, and domain type information. The subdivision may also continue among these large categories, each of which is subdivided into multiple small categories.
(2) Among different types of structured information, corresponding types of structured information are selected according to the detection level
For example, when detecting that the user operates the detection level control for the detection page, a detection level list is generated, for example, when the user triggers the detection registration control on the detection page, the detection level list is generated, and the detection levels are three levels, which are taken as an example, and can be classified into three detection levels, namely, very important levels correspond to the forced detection of all the structured information, important levels correspond to the detection of the structured information of important categories in the structured information, and general levels correspond to the detection of part of the commonly used structured information. For example, the structured information of the database to be detected may be classified into three types A, B and C, if the selected detection level is very important, all of the three types A, B and C are detected, if the selected detection level is important, important structured information of the three types is detected, for example, if the important structured information is assumed to be the two types a and B structured information, only the two types a and B structured information is detected, and if the selected detection level is general, for example, if the common structured information is assumed to be the type C structured information, only the type C structured information is detected.
Wherein, before the user operates the detection level control for the detection page, the user can 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 a database detection device, and the database detection device receives the uploaded or imported documents and then displays that the uploading or importing is successful on a detection page.
(3) Comparing the selected structured information with preset structured information to obtain a detection result
For example, based on the selected structured information, a corresponding type of regular expression is created, and the regular expression is matched with the selected structured information. The regular expression is also called a regular expression (Regular Expression, RE), and is a logic formula for operating on character strings including common characters (for example, letters between a and z) and special characters (called meta characters), namely, a "regular character string" is formed by using specific characters defined in advance and combinations of the specific characters, and the "regular character string" is used for expressing a filtering logic on the character string. A regular expression is a text pattern that describes one or more strings to be matched when searching text. Regular expressions are typically used to retrieve, replace, text that meets a certain pattern (rule). For example, the structured information includes comment description information, a regular expression corresponding to the comment description information is created, a detection rule or specification is added to the regular expression, for example, a specification command such as "a table must have comment description" and "a field name must have comment description" is added to the regular expression, a filtering logic for comment description character strings is configured, the comment description character strings are detected in the structured information, if a table is found but the comment description is not present, a regular expression corresponding to the comment description information is not matched, a problem is detected, for example, a character string of a field name is detected, and if the comment description is found, the regular expression corresponding to the comment description information is specified, and the detection of the structured information is passed.
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, the structured information of the design document is matched by taking a regular expression of a naming specification as an example, and in the process of detecting that the Table in a certain row of codes in the structured information is named as 'Table-1', mismatching with the regular expression is found, which indicates that the database to be detected does not meet the requirement of the design document. And (3) assuming that the table names in the structured information are' table_, detecting, finding that the table names are matched with the regular expression, and indicating that the database to be detected meets the requirements of the design document. It should be emphasized here that, when the database to be detected meets the early stage of the requirement of the design document, each line of codes in the corresponding structured information is matched with the corresponding type of regular expression according to the selected detection level, and meets the design specification or rule in the regular expression, if there is structured information which does not meet the design specification or rule, the database to be detected also does not meet the requirement of the design document.
When the selected structured information does not match with 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 can be generated on the detection page, for example, the type of the structured information which is not passed by the detection, for example, the type of the naming specification is not passed, and the specific code position and the error cause can be displayed, as shown in fig. 5. When the prompt message is displayed, the prompt message of the correct code can be given to 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:
A modification control can be added after the prompt information, when the operation of a user for the modification control is detected, the user jumps to the structured information of the design document to edit, and the user can select to automatically modify according to the modification suggestion and manually edit according to the editing mode.
As can be seen from the foregoing, in this embodiment, after a design document of a database to be detected is obtained, the design document is parsed to determine a structural relationship between contents in the design document, a relationship tree is constructed based on the structural relationship, attribute information of nodes in the relationship tree is obtained, 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, so as to obtain a detection result. In the detection process of the database, the method only detects the structured information in the design document, but not detects the whole content of the design document, so that the detection efficiency is greatly improved.
The method described in the previous embodiment is described in further detail below by way of example.
In the embodiments, description will be given taking an example in which the database detecting apparatus is specifically integrated in an electronic device.
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 determines the database to be detected, obtains the design document from the database, and may obtain the design document in various manners, for example, the electronic device may use database design software PowerDesigner to derive the design documents such as CDM, LDM and PDM of the database to be detected, and may obtain the design documents such as CDM, LDM and PDM from the original design document of the database, and upload the design documents to the electronic device. It should be noted that in the database design process, the design document may include at least one design file, where a design file includes at least one database model structure.
202. The electronic device parses the design document to determine structural relationships between the 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 to read the content of the code, the meaning of the code, specific comments, the field of the code, and index information in the design document. The read content is classified in various manners, and the content can be classified according to the functions of codes in the content and classified according to different functions, and the classification is divided into types such as generating an entity information part, acquiring an entity attribute information part, acquiring an entity relation information part, and/or generating an application scene information part. The division may also be performed according to the location of the content code in the design document, for example, the code applied to the bottom layer is divided into a bottom layer portion, the code applied to the middle layer is divided into a middle portion, and the code applied to the interaction layer is divided into an interaction portion, where the bottom layer portion, the middle portion, and the interaction portion are related to each other to 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 types such as generating an entity information part, acquiring an entity attribute information part, acquiring an entity relation information part and/or generating an application scene information part, and the electronic equipment can acquire the relation between the generating entity information part and the acquiring entity attribute information part. For example, the types and the numbers of the entities generated by the entity information generating part acquire 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, the position of the entity in the database and the like, according to the types and the numbers of the entities. The relationship of the generated entity information portion and the acquired entity relationship information portion may also be acquired.
The electronic equipment arranges different contents according to the relation 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 relation among the different contents with the frame structure of the design document to obtain the structural relation among the contents in the design document.
203. The electronic equipment builds a relation tree based on the structural relation and acquires attribute information of nodes in the relation tree.
For example, in the structural relationship between the contents of the design document, the electronic device may divide different levels of different contents in the structural relationship through a logical relationship, for example, the different contents include a content 1, a content 2 and a content 3, in the structural relationship, the content 1 is located at the bottom layer of the structural relationship, the content 2 is located at the middle of the structural relationship, and the content 3 is located at the top of the structural relationship, where the content 1 is the basis of the content 2 and the content 3, the content 2 and the content can be generated or obtained only when the content 1 exists, and between the content 2 and the content 3, the content 3 is the actual application of the content 2 in the service scene, so that the level relationship among the content 1, the content 2 and the content 3 in the structural relationship may be a content 1-content 2-content 3, or a content 3-content 1, and the level relationship is extracted.
Based on the hierarchical relationship, the electronic device screens the design document for contents of different hierarchies, 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 electronic device obtains data blocks having association relationships in different levels of content, for example, the data blocks may be data blocks having association relationships between content 1 and content 2, or the data blocks 1 and 2 having association relationships in content 1. And acquiring the two types of data blocks from the contents of different levels to obtain an association relationship data block set. Data blocks are added in the hierarchical relationship to build a relationship tree. For example, taking a hierarchical relationship in a structural relationship of the content of the design document as a content 1-content 2-content 3 as an example, the content 1 is located at the bottom of the structural relationship, the position corresponding to the relationship tree is a tree root position, a data block 1, a data block 2 and a data block 3 with an association relationship are obtained in the content 1, at this time, the data block 1 is at the bottommost layer of three data blocks, the data block 1 corresponds to the root node position of the tree root, the data block 2 and the data block 3 are sequentially arranged along the tree root, for example, the data block 3 and the data block 4 in the content 2 have an association relationship, the content 2 corresponds to the tree trunk in the relationship tree, the data block 4 can be the first node of the tree trunk, the data block with the association relationship is sequentially added to the tree trunk to form a trunk and a trunk, and finally, the data block corresponding to the leaf node in the content 3 is obtained, so as to complete the construction of the relationship tree, and a common relationship tree is shown in fig. 3.
The electronic equipment acquires nodes in a relation tree, each branch point, each root node and each leaf node in the relation tree are 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 structural information of the database to be detected according to the relation tree and the node attribute information.
For example, the electronic device may derive the relationship between the nodes in the relationship tree, e.g., node a and node B may be different branches of the same type of node, node a and node C may be adjacent nodes before and after the same branch, and so on. The electronic device extracts the relation among the nodes in the relation tree in the form of node relation information. The extracted node relation information and the node attribute information are fused in various modes, for example, the node relation information and the node attribute information can be combined, and the combined information is used as the structural information of the database to be detected. The node information and the node attribute information can be associated, the associated information is used as the structural information of the database to be detected, for example, single node attribute information in the node attribute information and the corresponding node in the node relation information are associated, after the association relation is added, the corresponding node attribute information is added into the corresponding node relation information, and the structural information of the database to be detected is formed.
205. The electronic equipment classifies the structured information of the database to be detected.
For example, the electronic device classifies the structured information of the database to be detected, for example, the structured information may be classified into naming class information, annotation description class information, field type information, index class information, enumeration value class information, reserved field class information, and the like. The subdivision may also continue among these large categories, each of which is 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, taking three detection levels as an example, and the detection levels can be classified into three detection levels of very important, important and general, where the very important level corresponds to the forced detection of all structured information, the important level corresponds to the detection of the structured information of important class in the structured information, and the general level corresponds to the detection of part of the commonly used structured information. For example, the structured information of the database to be detected may be classified into three types A, B and C, if the selected detection level is very important, all of the three types A, B and C are detected, if the selected detection level is important, important structured information of the three types is detected, for example, if the important structured information is assumed to be the two types a and B structured information, only the two types a and B structured information is detected, and if the selected detection level is general, for example, if the common structured information is assumed to be the type C structured information, only the type C structured information is detected.
Wherein, before the user operates the detection level control for the detection page, the user can 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 a database detection device, and the database detection device receives the uploaded or imported documents and then displays that the uploading or importing is successful on a detection page.
207. And the electronic equipment compares the selected structured information with preset structured information to obtain a detection result.
For example, based on the selected structured information, the electronic device creates a regular expression of a corresponding type, and matches the regular expression with the selected structured information. For example, the structured information includes comment description information, a regular expression corresponding to the comment description information is created, a detection rule or specification is added to the regular expression, for example, a specification command such as "a table must have comment description" and "a field name must have comment description" is added to the regular expression, a filtering logic for comment description character strings is configured, the comment description character strings are detected in the structured information, if a table is found but the comment description is not present, a regular expression corresponding to the comment description information is not matched, a problem is detected, for example, a character string of a field name is detected, and if the comment description is found, the regular expression corresponding to the comment description information is specified, and the detection of the structured information is passed.
The specifications in a common structured information regular expression are shown in the following table.
/>
For 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 to be L0, the structured information with the corresponding detection level of L0 in the above table is detected, where 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 level of the detection levels. How to judge the unselected detection level of the detection page is mainly performed by the user in a preset time range without operating on the detection level control of the detection page, wherein the preset time is set according to the 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, and takes a regular expression of a common naming specification as an example, matches the structured information of the design document, and finds that the structured information is not matched with the regular expression in the process of detecting that the Table in a certain row of codes in the structured information is named as 'Table-1', which indicates that the database to be detected does not meet the requirement of the design document. And (3) assuming that the table names in the structured information are' table_, detecting, finding that the table names are matched with the regular expression, and indicating that the database to be detected meets the requirements of the design document. It should be emphasized here that, when the database to be detected meets the early stage of the requirement of the design document, each line of codes in the corresponding structured information is matched with the corresponding type of regular expression according to the selected detection level, and meets the design specification or rule in the regular expression, if there is structured information which does not meet the design specification or rule, the database to be detected also does not meet the requirement of the design document.
When the selected structured information does not match the regular expression, the electronic device determines that the database to be detected does not meet the design requirement, and may generate prompt information on the detection page, for example, may display the type of structured information that fails to be detected, for example, the naming specification type fails, and may also display the specific code position and error cause, as shown in fig. 5. When the prompt information is displayed, the electronic device can also give the prompt information of the correct code for the error code, so that the user can be helped to quickly modify the error code, for example, the prompt information can be generated as follows:
a modification control can be added after the prompt information, when the operation of a user for the modification control is detected, the user jumps to the structured information of the design document to edit, and the user can select to automatically modify according to the modification suggestion and manually edit according to the editing mode.
As can be seen from the foregoing, in this embodiment, after the electronic device obtains the design document of the database to be detected, the design document is parsed to determine the structural relationship between the contents in the design document, a 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, so as to obtain the detection result. In the detection process of the database, the method only detects the structured information in the design document, but not detects the whole content of the design document, so that the detection efficiency is greatly improved.
In order to better implement the method, the embodiment of the invention also provides a database detection device which can be integrated in electronic equipment, wherein the electronic equipment can comprise equipment such as a server, a terminal and the like.
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 database design software PowerDesigner, and may also obtain design documents such as CDM, LDM, and PDM from the original design documents of the database.
(2) A parsing unit 302;
a parsing unit 302, configured to parse 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, which are specifically as follows:
a reading subunit 3021 for reading the content of the design document;
A first classification subunit 3022 for classifying contents of the design document;
a first obtaining subunit 3023 configured to obtain a relationship between different types of content based on the classification structure;
a first generating subunit 3024, configured to generate a structural relationship between contents in the design document according to the relationship between different contents.
For example, the reading subunit 3021 reads the content of the design document, the first classification subunit 3022 classifies the content of the design document, the first obtaining subunit 3023 obtains the relationship between different types of content based on the classification structure, and the first generating subunit 3024 generates the structural relationship between the content in the design document according to the relationship between different contents.
(3) A construction unit 303;
a construction unit 303, configured to construct a relationship tree based on the structural relationship, and acquire attribute information of nodes in the relationship tree;
the construction unit 303 may include an extraction subunit 3031, a construction subunit 3032, and a second acquisition subunit 3033, as shown in fig. 9, specifically as follows:
an extraction subunit 3031, configured to extract a hierarchical relationship from the structural relationship;
a construction subunit 3032, configured to construct the relationship tree in the content of the design document based on the hierarchical relationship;
A second obtaining subunit 3033 is configured to obtain attribute information of the nodes in the relationship tree.
For example, the extraction subunit 3031 extracts a hierarchical relationship in the structural relationship, the construction subunit 3032 constructs the relationship tree in the content of the design document based on the hierarchical relationship, and the second acquisition subunit 3033 acquires attribute information of the nodes in the relationship tree.
(4) A generating unit 304;
a generating unit 304, configured to generate structural information of a 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 node attribute information, and use the combined information as the structured information of the database to be detected.
(5) A detection unit 305;
the detection unit 305 is configured to detect the structured information of the database to be detected, so as to obtain a detection result;
the detection unit 305 may include a second classification subunit 3051, a selection subunit 3052, and a comparison subunit 3053, as shown in fig. 10, specifically as follows:
the second classification subunit 3051 is configured to classify the structured information of the database to be detected;
a selecting subunit 3052, configured to select, from different types of structured information, a corresponding type of structured information according to a detection level;
A comparison subunit 3053, 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, and determine that the data to be detected meets the design document requirement when the selected structured information is matched with the regular expression; and when the selected structured information is not matched with the regular expression, determining that the database to be detected does not meet the requirement of the design document.
For example, the second classifying subunit 3051 classifies the structured information of the database to be detected, the selecting subunit 3052 selects the structured information of the corresponding type according to the detection level from the structured information of different types, the comparing subunit 3053 creates a regular expression of the corresponding type according to the selected structured information, matches the regular expression with the selected structured information, and determines that the data to be detected meets the design document requirement when the selected structured information matches the regular expression; and when the selected structured information is not matched with the regular expression, determining that the database to be detected does not meet the requirement of the design document.
In an embodiment, the detection unit 305 may further include a second generating subunit 3054, as shown in fig. 11, specifically as follows:
the second generating subunit 3054 is configured to generate hint information when the selected structured information does not match the regular expression, where the hint information includes unqualified code information.
For example, the second generating subunit 3054 is specifically configured to, when the selected structured information does not match the regular expression, determine that the database to be detected does not meet the design requirement, generate prompt information while detecting the page, for example, may display a type of structured information that fails to be detected, for example, a naming specification type fails, and may also display a specific code location and an error cause. When the prompt information is displayed, the prompt information 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 device of this embodiment, after the obtaining unit 301 obtains the design document of the database to be detected, the parsing unit 302 parses the design document to determine the structural relationship between the contents in the design document, the building unit 303 builds a relationship tree based on the structural relationship, obtains the attribute information of the nodes in the relationship tree, and the generating unit 304 generates the structured information of the database to be detected according to the relationship tree and the node attribute information, and the detecting unit 305 detects the structured information of the database to be detected to obtain the detection result. In the detection process of the database, the method only detects the structured information in the design document, but not detects the whole content of the design document, so that the detection efficiency is greatly improved.
The embodiment of the invention also 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 invention, specifically:
the electronic device may include one or more processing cores 'processors 401, one or more computer-readable storage media's memory 402, power supply 403, and input unit 404, among other components. Those skilled in the art will appreciate that the electronic device structure shown in fig. 12 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and 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 and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, etc., and the modem processor mainly processes wireless communication. 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 executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device, etc. In addition, 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 with access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, preferably the power supply 403 may be logically connected to the processor 401 by a power management system, so that functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 403 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The electronic device may further comprise an input unit 404, which input unit 404 may be used for receiving input digital or character information and generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the electronic device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 401 in the electronic device loads executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 executes the application programs stored in the memory 402, so as to implement 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 structural relations among contents in the design document, constructing a relation tree based on the structural relations, obtaining attribute information of nodes in the relation tree, generating structural information of the database to be detected according to the relation tree and the node attribute information, and detecting the structural information of the database to be detected to obtain a detection result.
For example, a database to be detected may be specifically determined, a design document is obtained from the database, the design documents such as CDM, LDM and PDM of the database to be detected may be derived by using database design software PowerDesigner, and the design documents such as CDM, LDM and PDM may be obtained from the original design document of the database. The corresponding parsing component may be developed for the design document such as CDM, LDM, and PDM, and the content of the design document such as CDM, LDM, and PDM may be read by the parsing component, for example, the content of the code, the meaning of the code, and the specific annotation, the field of the code, and the index information in the design document are read. The read contents are classified in various manners, the classification can be performed according to the code function in the contents, the relationships among different types of contents are obtained based on the classification result of the contents of the design document of the database to be detected, and the structural relationships among the contents in the design document are generated according to the relationships among the different contents. For example, according to the relation 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 relation between the different contents is associated with the frame structure of the design document to obtain the structural relation between the contents in the design document. Extracting a hierarchical relationship in a structural relationship between contents of a design document, wherein the hierarchical relationship can comprise a relationship corresponding to a hierarchy where different contents are located in the structural relationship, for example, different hierarchies of the different contents in the structural relationship can be divided through a logic relationship, the contents of different hierarchies are screened in the design document according to the hierarchical relationship on the basis of the hierarchical relationship, data blocks with association relationships in the contents of different hierarchies are obtained, and the data blocks are added 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 nodes of the relation tree, and extracting attribute information of the corresponding nodes from the content of the design document by at least one acquired node. The node relation information is extracted from the relation tree, for example, the relation among the nodes can be obtained from the relation tree, and the relation among the nodes in the relation tree is extracted in the form of the node relation information. And combining the extracted node relation information with the node attribute information, combining the node relation information with the node attribute information, and taking the combined information as the structural information of the database to be detected. The method comprises the steps of detecting structured information of a database to be detected, classifying the structured information of the database to be detected before detection, generating a detection grade list when detecting detection grade control operation of a user on a detection page, selecting structured information of a corresponding type according to the detection grade, creating a regular expression of the corresponding type according to the selected structured information, matching the regular expression with the selected structured information, determining that the data to be detected meets the requirements of the design document when the selected structured information is matched with the regular expression, and determining that the database to be detected does not meet the requirements of the design document when the selected structured information is not matched with the regular expression.
The specific implementation of each operation may be referred to the previous embodiments, and will not be described herein.
As can be seen from the foregoing, in this embodiment, after a design document of a database to be detected is obtained, the design document is parsed to determine a structural relationship between contents in the design document, a relationship tree is constructed based on the structural relationship, attribute information of nodes in the relationship tree is obtained, 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, so as to obtain a detection result. In the detection process of the database, the method only detects the structured information in the design document, but not detects the whole content of the design document, so that the detection efficiency is greatly improved.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions or by instructions controlling associated hardware, which 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 having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the database detection methods provided by 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 structural relations among contents in the design document, constructing a relation tree based on the structural relations, obtaining attribute information of nodes in the relation tree, generating structural information of the database to be detected according to the relation tree and the node attribute information, and detecting the structural information of the database to be detected to obtain a detection result.
For example, a database to be detected may be specifically determined, a design document is obtained from the database, the design documents such as CDM, LDM and PDM of the database to be detected may be derived by using database design software PowerDesigner, and the design documents such as CDM, LDM and PDM may be obtained from the original design document of the database. The corresponding parsing component may be developed for the design document such as CDM, LDM, and PDM, and the content of the design document such as CDM, LDM, and PDM may be read by the parsing component, for example, the content of the code, the meaning of the code, and the specific annotation, the field of the code, and the index information in the design document are read. The read contents are classified in various manners, the classification can be performed according to the code function in the contents, the relationships among different types of contents are obtained based on the classification result of the contents of the design document of the database to be detected, and the structural relationships among the contents in the design document are generated according to the relationships among the different contents. For example, according to the relation 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 relation between the different contents is associated with the frame structure of the design document to obtain the structural relation between the contents in the design document. Extracting a hierarchical relationship in a structural relationship between contents of a design document, wherein the hierarchical relationship can comprise a relationship corresponding to a hierarchy where different contents are located in the structural relationship, for example, different hierarchies of the different contents in the structural relationship can be divided through a logic relationship, the contents of different hierarchies are screened in the design document according to the hierarchical relationship on the basis of the hierarchical relationship, data blocks with association relationships in the contents of different hierarchies are obtained, and the data blocks are added 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 nodes of the relation tree, and extracting attribute information of the corresponding nodes from the content of the design document by at least one acquired node. The node relation information is extracted from the relation tree, for example, the relation among the nodes can be obtained from the relation tree, and the relation among the nodes in the relation tree is extracted in the form of the node relation information. And combining the extracted node relation information with the node attribute information, combining the node relation information with the node attribute information, and taking the combined information as the structural information of the database to be detected. The method comprises the steps of detecting structured information of a database to be detected, classifying the structured information of the database to be detected before detection, generating a detection grade list when detecting detection grade control operation of a user on a detection page, selecting structured information of a corresponding type according to the detection grade, creating a regular expression of the corresponding type according to the selected structured information, matching the regular expression with the selected structured information, determining that the data to be detected meets the requirements of the design document when the selected structured information is matched with the regular expression, and determining that the database to be detected does not meet the requirements of the design document when the selected structured information is not matched with the regular expression.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Because the instructions stored in the computer readable storage medium may execute the steps in any database detection method provided by the embodiments of the present invention, the beneficial effects that any database detection method provided by the embodiments of the present invention can achieve are detailed in the previous embodiments, and are not described herein.
The foregoing has described in detail the methods, apparatuses and computer readable storage medium for database detection provided by the embodiments of the present invention, and specific examples have been applied to illustrate the principles and embodiments of the present invention, and the above description of the embodiments is only for aiding in understanding the methods and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present invention, the present description should not be construed as limiting 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 the structural relation between the contents in the design document, wherein the structural relation is obtained by associating an integral frame structure with the relation between different contents, and the integral frame structure is obtained by arranging the different contents according to the relation between the different contents and the structure of the design document;
constructing a relation tree based on the structural relation, and acquiring attribute information of nodes in the relation tree;
generating structural information of the database to be detected according to the relation tree and the attribute information of the nodes;
classifying the structured information of the database to be detected, wherein the classified types comprise named class information, annotation description class information, field type information, index class information, enumeration value class information, reserved field class information and field class information;
selecting corresponding types of structured information from different types of structured information according to detection levels, wherein each detection level corresponds to one or more types of structured information;
And comparing the selected structured information with preset structured information to obtain a detection result.
2. The database detection method according to claim 1, wherein building a relationship tree based on the structural relationship comprises:
extracting hierarchical relations among contents in the design document from the structural relations;
based on the hierarchical relationships, a relationship tree is constructed.
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 association relations in the contents of different levels;
the data blocks are added in the hierarchical relationship to build a relationship tree.
4. The database detection method according to claim 1, wherein obtaining attribute information of nodes in the relational tree comprises:
acquiring at least one node in the relation tree;
and extracting attribute information of the node from the content of the design document according to the acquired node.
5. A database inspection method according to any one of claims 1 to 3, wherein generating structured information of the database to be inspected from the relationship tree and the node attribute information comprises:
Extracting node relation information from the relation tree;
fusing the node relation information with the node attribute information;
and taking the fused information as the structural information of the database to be detected.
6. The database inspection method of claim 1, wherein selecting the corresponding type of structured information according to the inspection level comprises:
when detecting that a user operates a detection level control for a detection page, generating a detection level list, wherein the detection level list comprises a plurality of detection levels;
when the selection operation of the user for the detection level in the detection level list is detected, the corresponding type of structured information is selected according to the selected detection level.
7. The method for detecting a database according to claim 1, wherein comparing the selected structured information with the preset structured information to obtain a detection result comprises:
creating a regular expression of a corresponding type according to the selected structured information;
matching the regular expression with the selected structured information;
when the selected structured information is matched with the regular expression, determining that the database to be detected meets the requirements of the design document;
And when the selected structured information is not matched with the regular expression, determining that the database to be detected does not meet the requirement of the design document.
8. The database inspection method of claim 7, further comprising, when the selected structured information does not match the regular expression, after determining that the database to be inspected does not meet the requirements of the design document:
and when the selected structured information is not matched with the regular expression, generating prompt information, wherein the prompt information comprises unqualified code information.
9. A database inspection method according to any one of claims 1 to 3, wherein parsing the design document to determine structural relationships between content in the design document comprises:
reading the content of the design document;
classifying the content of the design document;
based on the classification result, acquiring the relation between different types of contents;
and generating structural relations among the contents in the design document according to the relations among different contents.
10. A database detection apparatus, comprising:
the acquisition unit is used for acquiring the design document of the database to be detected;
The analysis unit is used for analyzing the design document to determine the structural relation between the contents in the design document, wherein the structural relation is obtained by associating the integral frame structure with the relation between different contents, and the integral frame structure is obtained by arranging the different contents according to the relation between the different contents and the structure of the design document;
the building unit is used for building a relation tree based on the structural relation and acquiring attribute information of nodes in the relation tree;
the generating unit is used for generating the structural information of the database to be detected according to the relation tree and the attribute information of the nodes;
the detection unit is used for detecting the structured information of the database to be detected to obtain a detection result;
the detection unit is used for:
classifying the structured information of the database to be detected, wherein the classified types comprise named class information, annotation description class information, field type information, index class information, enumeration value class information, reserved field class information and field class information;
selecting corresponding types of structured information from different types of structured information according to detection levels, wherein each detection level corresponds to one or more types of structured information;
And comparing the selected structured information with preset structured information to obtain a detection result.
11. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps in the database detection method according to any of claims 1 to 9.
12. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps in the database detection method according to any one of claims 1 to 9.
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 CN111190880A (en) 2020-05-22
CN111190880B true 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)

Families Citing this family (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
CN115543955A (en) * 2021-06-29 2022-12-30 华为云计算技术有限公司 Standard design method, device and related equipment

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

Also Published As

Publication number Publication date
CN111190880A (en) 2020-05-22

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
WO2020233330A1 (en) Batch testing method, apparatus, and computer-readable storage medium
CN107077463A (en) Remote supervisory relation extractor
CN110990274B (en) Data processing method, device and system for generating test cases
CN112328489B (en) Test case generation method and device, terminal equipment and storage medium
KR101554424B1 (en) Method and apparatus for auto generation of test case
CN111611284A (en) Material list generation method and electronic equipment
US7853595B2 (en) Method and apparatus for creating a tool for generating an index for a document
CN114385679A (en) Meter structure inspection method, meter structure inspection device and electronic equipment
CN114207598A (en) Electronic form conversion
CN115952298A (en) Supplier performance risk analysis method and related equipment
CN113420097B (en) Data analysis method, device, storage medium and server
CN115098061A (en) Software development document optimization method and device, computer equipment and storage medium
CN111160843B (en) Self-checking method for graph and document in product data management system
JP2006277282A (en) Model evaluation analysis system and model evaluation analysis program
CN113779248A (en) Data classification model training method, data processing method and storage medium
US20150185986A1 (en) Method for integrated provision of electronic books
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
Mamo et al. The myth of reproducibility: A review of event tracking evaluations on Twitter
CN109739835A (en) A kind of versions of data store method and device
CN115543836A (en) Script quality detection method and related equipment
CN116860227B (en) Data development system and method based on big data ETL script arrangement
JP6703698B1 (en) Information provision 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