CN112115125A - Database access object name resolution method and device and electronic equipment - Google Patents

Database access object name resolution method and device and electronic equipment Download PDF

Info

Publication number
CN112115125A
CN112115125A CN202011031036.8A CN202011031036A CN112115125A CN 112115125 A CN112115125 A CN 112115125A CN 202011031036 A CN202011031036 A CN 202011031036A CN 112115125 A CN112115125 A CN 112115125A
Authority
CN
China
Prior art keywords
name
matching
linked list
access object
names
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
CN202011031036.8A
Other languages
Chinese (zh)
Other versions
CN112115125B (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.)
China Electronics Technology Group Jincang Beijing Technology Co ltd
Original Assignee
Beijing Kingbase Information Technologies 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 Beijing Kingbase Information Technologies Co Ltd filed Critical Beijing Kingbase Information Technologies Co Ltd
Priority to CN202011031036.8A priority Critical patent/CN112115125B/en
Publication of CN112115125A publication Critical patent/CN112115125A/en
Application granted granted Critical
Publication of CN112115125B publication Critical patent/CN112115125B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Landscapes

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

Abstract

The disclosure relates to a method, a device and an electronic device for analyzing database access object names, wherein the method comprises the following steps: obtaining an access object name linked list, wherein the access object name linked list comprises at least one section of name, and if the access object name linked list comprises at least two sections of names, the at least two sections of names are arranged according to the sequence of the hierarchy from top to bottom; acquiring name corpus data corresponding to the database, wherein the name corpus data comprises names and types of known objects in the database; determining a matching priority order of the known objects based on the name corpus data; the lower the known object type level is, the higher the matching priority is; and matching each section of name in the access object name linked list based on the matching priority sequence of the known object to form a matching result. The technical scheme of the embodiment of the disclosure has the advantages of short analysis time, accurate analysis result, universality and expandability, and can support name identification processing of any layer of nested objects.

Description

Database access object name resolution method and device and electronic equipment
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a method and an apparatus for analyzing names of database access objects, and an electronic device.
Background
With the development of computer technology, databases are becoming an indispensable part of computer systems, and in addition to storing data, they are also providing increasingly powerful data processing functions, and data in the databases can be processed through SQL or PLSQL access.
Objects in a database are logically stored hierarchically. FIG. 1 is a hierarchical relationship diagram of a database object provided by the present disclosure. A database instance may manage multiple databases with multiple schemas under which multiple database objects, such as packages, blocks (functions), etc., may be located. The packet may in turn contain blocks (functions), complex variables, etc., which in turn may include a plurality of columns. In addition, blocks (functions) may be further nested within blocks (functions), and columns may be further nested within columns. Thus, when accessing an object, the object name may be composed of multiple segments, illustratively a.b.c.d. for the name of the accessed object. In this case, the name of the access object may be understood as a package. The name of the access object may alternatively be understood as a schema, package, variable; the name of the access object may alternatively be understood as a library, a schema, a package, a variable; or the name of the access object may be understood as a library, schema, package, variable. Since the name of the access object can be understood in various forms, in practice, how to resolve the name of the access object is a problem that must be solved by the database management system. But there is currently a lack of a better method for efficient resolution of names for database access objects.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present disclosure provides a database access object name resolution method, apparatus and electronic device.
In a first aspect, the present disclosure provides a database access object name resolution method, including:
obtaining an access object name linked list, wherein the access object name linked list comprises at least one section of name, and if the access object name linked list comprises at least two sections of names, the at least two sections of names are arranged according to the sequence of the hierarchy from top to bottom;
acquiring name corpus data corresponding to the database, wherein the name corpus data comprises names and types of known objects in the database;
determining a matching priority order of the known objects based on the name corpus data; the lower the known object type level is, the higher the matching priority is;
and matching each section of name in the access object name linked list based on the matching priority sequence of the known object to form a matching result.
In a second aspect, the present disclosure further provides a database access object name resolution apparatus, including:
a name linked list obtaining module, configured to obtain an access object name linked list, where the access object name linked list includes at least one segment of name, and if the access object name linked list includes at least two segments of names, the at least two segments of names are arranged in a sequence from top to bottom according to a hierarchy;
a corpus data obtaining module, configured to obtain name corpus data corresponding to the database, where the name corpus data includes names and types of known objects in the database;
the sequence determining module is used for determining the matching priority sequence of the known objects based on the name corpus data; the lower the known object type level is, the higher the matching priority is;
and the matching module is used for matching the names of all the sections in the access object name linked list based on the matching priority sequence of the known objects to form a matching result.
In a third aspect, the present disclosure also provides an electronic device, including: a processor and a memory;
the processor is configured to perform the steps of any of the methods described above by calling a program or instructions stored in the memory.
In a fourth aspect, the present disclosure also provides a computer-readable storage medium storing a program or instructions for causing a computer to perform the steps of any of the methods described above.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
first, the technical solution provided by the embodiments of the present disclosure determines the matching priority order of the known objects based on the name corpus data. Since the access objects are mostly variables, columns and the like in practice, the priority order is set, and the matching time can be shortened.
Secondly, the method for constructing the access object name linked list provided by the technical scheme provided by the embodiment of the disclosure can ensure that the formed access object name linked list includes all segment names forming the access object name, thereby ensuring the accuracy of subsequent analysis.
Thirdly, the parsing method provided by the technical scheme provided by the embodiment of the disclosure has universality and expandability. No matter how many section names exist in the names of the access objects needing to be analyzed, the technical scheme provided by the embodiment of the disclosure can be used for analyzing. Therefore, it can support name recognition processing of objects nested at arbitrary levels. In addition, due to the universality, different analysis methods do not need to be set for access objects with different segment number names, and the investment of manpower and material resources for program development can be reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a hierarchical relationship diagram of a database object provided by the present disclosure;
fig. 2 is a flowchart of a database access object name resolution method according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a method for implementing S110 according to an embodiment of the present disclosure;
FIG. 4 is a hierarchical relationship diagram of another database object provided by the present disclosure;
fig. 5 is a flowchart of a method for implementing S140 according to an embodiment of the present disclosure;
fig. 6 is a block diagram illustrating a structure of a database access object name resolution apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
Fig. 2 is a flowchart of a database access object name resolution method according to an embodiment of the present disclosure.
The execution timings of the database access object name resolution method provided by the embodiment of the present disclosure include, but are not limited to, the following two timings:
in the first place, in the process of parsing identification at compile time before grammar parsing after lexical parsing, such as creating a package or a function, some variables are needed, and the names of the variables need to be parsed when creating work is completed by using the variables.
In the second occasion, in the analysis recognition in the execution stage, for example, because some variables are involved in the partial statement or expression corresponding to the created package or function, in the process of calling the created package or function, the names of the involved variables need to be analyzed.
Referring to fig. 2, the database access object name resolution method includes:
s110, obtaining an access object name linked list, wherein the access object name linked list comprises at least one section of name; and if the access object name linked list comprises at least two sections of names, arranging the at least two sections of names according to the sequence from top to bottom of the hierarchy.
Alternatively, the access object, i.e. the access target, may specifically comprise a variable or a column.
With continued reference to FIG. 1, since in practice, database objects are stored hierarchically. This makes it possible that if the name of the access object includes at least two segment names, the different segment names often represent different hierarchies, and thus it is required that the at least two segment names are arranged in order from top to bottom of the hierarchy. Illustratively, if a certain access object is named as a.b.c.d, where a represents library, B represents schema, C represents package, and D represents variable. And the library is the last level of the schema, the schema is the last level of the package, and the package is the last level of the variable. A.b.c.d belongs to the case of being arranged in order from top to bottom in the hierarchy. By means of the multi-segment names, the access object can be accurately positioned in the database.
There are various ways to implement this step, which should not be limited in this application. Illustratively, the access object name linked list is obtained based on the segment name identifier. Since in practice the name length of the access object is uncertain. The name of the access object is identified as the access object name linked list through the segment name identifier, so that the formed access object name linked list can be ensured to comprise all segment names forming the access object name, and the accuracy of subsequent analysis can be further ensured.
It should be noted that, in practice, which kind of symbol is specifically used as the segment name identifier is not limited in the present application. Illustratively, if the access object name is a.b.c.d, "# may be used as the segment name identifier.
There are various specific methods for implementing "obtaining the access object name linked list based on the segment name identifier", and the present application does not limit this.
Fig. 3 is a flowchart of a method for implementing S110 according to an embodiment of the present disclosure. Referring to fig. 3, the method includes: first, the first tag in the access object name is obtained. Optionally, the statement is parsed by a flex lexical parser to obtain a first tag in the name of the access object. Secondly, the first label in the name of the access object is used as the first section name in the name linked list. And repeating the subsequent section name identification process until all the section names of the access object are identified. Wherein, the subsequent section name identification process comprises: acquiring a 2 nth label and a 2n +1 st label in the name of an access object; if the 2n label is a segment name identifier and the 2n +1 label is a word, taking the 2n +1 label in the access object name as the n +1 segment name in the name linked list; let n be n + 1; wherein n is a positive integer. The expression "n is equal to n + 1" means that the value of n is updated, and the sum of 1 and the original value of n is reassigned to n. For example, in the first execution, n is 1. After the value of n is updated, n is 2. After the value of n is updated again, n is 3.
Exemplarily, first, let n be 1, obtain the 2 nd tag and the 3 rd tag in the access object name; if the 2 nd label is a segment name identifier and the 2 nd label is a word, the 3 rd label in the access object name is used as the 2 nd segment name in the name linked list. Making n be 2, and acquiring a 4 th label and a 5 th label in the name of the access object; if the 4 th label is a segment name identifier and the 5 th label is a word, the 5 th label in the access object name is used as the 3 rd segment name in the name linked list. And repeating the steps to realize the cyclic acquisition of the names of the sections of the access object. If the 2n label is judged not to be the segment name identifier and/or the 2n +1 label is judged not to be the word in the process of a certain cycle, the 2n-1 label is indicated to be ended, and all the segment names of the access object are completely identified. The setting can ensure that the formed access object name linked list comprises all segment names forming the access object name, and further can ensure the accuracy of subsequent analysis. In addition, the method is set, all the segment names can be identified based on the method no matter how many segment names are contained in the access object name, and the segment name identification method does not need to be set according to the number of the segment names contained in the access object name.
Optionally, if the 2 nth tag is not a segment name identifier and/or the 2n +1 st tag is not a word, the 2 nth tag and the 2n +1 st tag may be equalized back to the cache stack, so as to facilitate subsequent adoption of other recognition methods. Illustratively, if a certain character string is a.b. 2, by using the above method, it may be determined that the access object name linked list includes two segments of names. The first segment is named as A and the second segment is named as B.
And S120, acquiring name corpus data corresponding to the database, wherein the name corpus data comprises names and types of known objects in the database.
A known object refers to an object that has been created in a database. Types of known objects include, but are not limited to, columns, variables, blocks, packets, schemas, and databases, among others. Illustratively, variables or blocks declared in a program block belong to known objects. Variables that are not declared in a chunk do not belong to a known object.
FIG. 4 is a hierarchical relationship diagram of another database object provided by the present disclosure. Objects in a database are logically stored hierarchically. With continued reference to FIG. 4, due to the nature of its hierarchical storage, there is an object at the upper level and/or an object at the lower level associated with any one of the objects. Illustratively, in fig. 4, the previous stage of the variable 5 is block 1, the previous stage of the block 2 is block 1, and the next stage of the block 2 is the variable 8 and the variable 3. Based on this, optionally, the name corpus data also includes dependencies between different known objects. An affiliation refers to a relationship that reflects a superior or inferior known object associated with a known object. By setting the name corpus data to further comprise the subordination relation between different known objects, the relation between the known objects can be clearer, and the subsequent use is convenient.
Illustratively, the memory structure of the backward pointer or the memory structure of the forward pointer can be used for storing variables or block tags and the like declared in the system, so as to form name corpus data of the variables or the block tags. If a back pointer storage structure is employed, the storage structure includes the type of the known object, the object name, and a pointer to a previous level known object associated with the known object. If a forward pointer storage structure is employed, the storage structure includes the type of known object, the object name, and a pointer to the next level of known objects associated with the known object.
S130, determining the matching priority order of the known objects based on the name corpus data; the lower the level of the known object type, the higher the matching priority.
Types of known objects include, but are not limited to, columns, variables, blocks, packets, schemas, and databases, among others. Since in practice a block may be the next level known object of a packet, but a packet cannot be the next level known object of a block. The level of the packet is higher than the level of the block. Similarly, the level of the block is higher than the level of the variable. And regarding the column as a special form of a variable, wherein the variable is an inlet of a query column, and finally, the obtained known object types are sorted according to priority, and the sorting result is variable name > block tag name > packet name > mode name > database name.
Further, for the case that multiple known objects in the database correspond to the same object type, the multiple objects may be arbitrarily ordered when determining the matching priority order of the known objects. In fig. 4, for example, the variables 3, 5, 6, 7, 8, and 9 correspond to the same object type, and the priorities of the variables 3, 5, 6, 7, 8, and 9 are the same, and may be arbitrarily ordered. In fig. 4, after the known objects are sorted, the matching priority order of the known objects may be variable 3> variable 5> variable 6> variable 7> variable 8> variable 9> block 1> block 2> block 4> packet 0.
It should be noted that, here, a "level of a known object" and a "level of a known object type" should be distinguished. In fig. 4, the known object at the upper level of block 2 is block 1, and the level of block 1 is higher than that of block 2 in view of the level of the known object. But since block 2 and block 1 correspond to the same object type, both are blocks. From the known object type level, block 2 and block 1 belong to the same level.
S140, matching each section of names in the name chain table of the access object based on the matching priority sequence of the known object to form a matching result.
The essence of this step is that the names of the known objects are sequentially extracted from the name corpus data according to the matching priority order of the known objects for comparison with the segment names in the access object name chain table.
There are various specific implementation methods of this step, and this application does not limit this. Illustratively, assume that the access object name linked list includes a segment names. The method can comprise the following steps: matching the mth section of name in the name linked list of the access object with the name of the known object in the database based on the matching priority sequence of the known object; if the m-th section of name is matched with the name of a known object, judging whether the name linked list of the accessed object comprises the m + 1-th section of name and whether the matched known object has a next-stage known object; if the access object name linked list comprises the m +1 th segment name and the matched known object has a next-stage known object, matching the m +1 th segment name with the name of the known object in the database; if the access object name linked list comprises the m +1 th section of name and the known object in the matching has no next-stage known object, outputting an error-reporting type matching result; if the access object name linked list does not include the m +1 th section of name and the known object in the matching has a next-stage known object, judging whether the known object in the matching is a variable or a column; if yes, outputting a known object in the matching, otherwise, outputting an error reporting type matching result; wherein m and a are positive integers, and m is more than or equal to 0 and less than or equal to m +1 and less than or equal to a.
Optionally, if the m-th section name is not matched with the name of any known object in the database, outputting an error-reporting class matching result.
The technical scheme has the following advantages:
first, the above technical solution determines the matching priority order of the known objects based on the name corpus data. Since the access objects are mostly variables, columns and the like in practice, the priority order is set, and the matching time can be shortened.
Secondly, the method for constructing the access object name linked list provided by the technical scheme can ensure that the formed access object name linked list comprises all the segment names forming the access object name, and further can ensure the accuracy of subsequent analysis.
Thirdly, the resolving method provided by the technical scheme has universality and expandability, and can resolve the name of the access object needing resolving no matter how many sections of names exist. Therefore, it can support name recognition processing of objects nested at arbitrary levels. In addition, due to the universality, different analysis methods do not need to be set for access objects with different segment number names, and the investment of manpower and material resources for program development can be reduced.
Fig. 5 is a flowchart of a method for implementing S140 according to an embodiment of the present disclosure. For ease of understanding, the method for implementing S140 is further described below with reference to fig. 5. Illustratively, referring to fig. 5, the method includes:
s201 denotes p to 1, and S202 is executed.
S202, acquiring the name of the p-th known object from the name corpus data based on the matching priority order of the known objects, and executing S203.
S203 sets m to 1, and S204 is executed.
S204, comparing the mth segment name in the access object name linked list with the pth known object name, and judging whether the mth segment name in the access object name linked list is consistent with the pth known object name. If yes, go to S205; if not, go to S206.
S205, judging whether the access object name linked list comprises the m +1 th section name. If yes, go to S211; if not, go to S209.
S206, judging whether the m-th section of name is matched with all known object names in the name corpus data or not. If yes, go to S208; if not, go to step S207.
S207, let p be p +1, and S202 is executed.
The essence of this step is that the matching operation for the mth segment name does not traverse all known objects in the name corpus data. The matching processing work for the m-th segment name is continuously completed.
And S208, outputting an error-reporting matching result.
The essence of this step is that the matching operation of the mth segment name has traversed all known objects in the name corpus data, indicating that the mth segment name is not matched with all known objects in the name corpus data, and outputting error-reporting type information, such as outputting "NULL".
S209, judging whether the known object in the matching is a variable or a column. If yes, go to S210; if not, go to step S208.
Since in practice, the access object is usually a variable or a column, if the known object in the matching is determined to be a variable or a column, the known object in the matching is determined to be the access object. If the known object in the match is not determined to be a variable or a column (e.g., the known object in the match is a block), it is determined that the known object in the match is not an accessed object, and error-reporting class information is output, e.g., "NULL" is output.
And S210, outputting the known object in the matching.
S211, judging whether the known objects in the database have the next-level known objects. If yes, go to step S212; if not, go to step S208.
Because the access object name linked list includes the m +1 th segment name, if there is no next-stage known object in the known object matched with the m-th segment name, the m +1 th segment name cannot be matched, which indicates that the current matching result is wrong, and error-reporting information is output, such as "NULL" output.
Because the access object name linked list comprises the m +1 th segment name, if the known object matched with the m-th segment name has the next-stage known object, the m +1 th segment name is continuously matched.
S212, let m be m +1, and S202 is executed.
"m + 1" means that the value of m is updated. The updating method is the same as the value updating method of n in the foregoing, and is not described herein again.
After making m equal to m +1, S202 is executed to match the m +1 th segment name of the access object with the names of the known objects in the database.
In practice, since if the access object name linked list includes at least two segments of names, the at least two segments of names are arranged in order from top to bottom in the hierarchy, S212 may alternatively be replaced with: determining a next-level known object of the known objects matched with the mth section of name; and matching the m +1 th section name with the name of the next-stage known object based on the matching priority order of the known objects, wherein the processing mode of the matching result is still processed according to the steps of S204-S212. The essence of this arrangement is that after the first segment name is accessed and matched with a known object, only whether the subsequent segment name is the next-stage known variable of the known variable is judged, instead of performing a backtracking search, and all known variables in the name corpus are traversed. The setting can shorten the time spent on matching the m +1 th section name of the access object, and improve the matching efficiency.
Illustratively, referring to fig. 4, assume that the known object matching the mth segment name is block 1, and the next-level known object of block 1 is block 2 and variable 5. Variable 5 has a higher priority than block 2 according to the matching priority order of the known objects. When the m +1 th section name of the access object is matched, the m +1 th section name of the access object is matched with the 5 th section name of the variable, and if the m +1 th section name of the access object is not consistent with the 5 th section name of the variable, the m +1 th section name of the access object is matched with the 2 nd section name of the block.
For convenience of understanding, the technical solution of the present disclosure is further explained below by taking name resolution of two, three, and four segments as an example.
The first and second sections of name solutions include:
1. column of composite type variables
2. Variable of block label
3. Variable of bag
When the compound variable, block tag, and package name are the same name, the following name resolution rules are followed:
the method comprises the steps of firstly analyzing a first section name according to the matching priority sequence of a known object, matching a composite variable name prior to a block label and a packet name, matching a second section name in a column of the composite variable once the matched composite variable name is found, and reporting an error if no column matched with the second section name exists in the composite variable.
If there is no matching complex variable name, then match the first segment name with the chunk tag name, if a matching chunk tag name is found, then match the second segment name with the known object in the tag chunk, if there is no known object in the tag chunk that matches the second segment name, then report an error.
And if no matched block tag name exists, matching the first section name with the packet name in the current visible mode in the database, if a matched packet is found, matching the known object in the packet with the second section name, and if no known object matched with the second section name exists in the packet, reporting an error.
The second and third sections of name resolution conditions comprise:
1. column of composite type variable
2. Block tag, composite type variable, column
3. Block tag, variable
4. Pack, composite type variable, column
5. Mode, packet, variable
When the compound variable, block tag, package name and schema name are synonymous, the following name resolution rules are followed:
the method comprises the steps of firstly analyzing a first section name according to the matching priority sequence of a known object, matching a composite variable name prior to a block label, a packet name and a pattern name, matching a second section name in a column of the composite variable once the matched composite variable name is found, and reporting an error if no column matched with the second section name exists in the composite variable. And when the second section name is matched with the column of the composite variable, continuing to match the third section name with the sub-column of the nested composite variable, and if no matching item exists, reporting an error.
If there is no matching complex variable name, then match the first segment name with the chunk tag name, if a matching chunk tag name is found, then match the second segment name with the known object in the tag chunk, if there is no known object in the tag chunk that matches the second segment name, then report an error. When the second segment name matches the variable in the tag block, the third segment name is used to match the sub-column of variables. If the second section of name is matched with the sub-block label name in the label block, the third section of name is matched with the variable in the sub-label block, and if no matching item exists, an error is reported.
And if no matched block tag name exists, matching the first section name with the packet name in the current visible mode in the database, if a matched packet is found, matching the known object in the packet with the second section name, and if no known object matched with the second section name exists in the packet, reporting an error. When the second section name is matched with the known object in the package, the third section name is used for matching with the next-stage known object of the known object in the package, and if no matching item exists or the known object matched with the second section name is of a non-combined type (if the known object does not include the column of the common variable), an error is reported.
If the first segment name does not match the variable, the tag, and the packet. Matching the second section name with the pattern in the current database, matching the second section name with the packet in the matching pattern if the corresponding pattern is matched, and reporting an error if no matched packet exists. Finding out the matched packet, matching the third section name with the known object in the packet, and reporting an error if the packet does not have the known object matched with the third section name.
The third and fourth segment name resolution conditions include:
1. composite type variable, column
2. Block label, composite type variable, column
3. Block tag, composite type variable, column
4. Block tag, block tag, variable
5. Pack, column, compound type variable
6. Mode, pack, composite type variable, column
7. Library, schema, package, variables
When the compound variable, block tag, package name, schema name are synonymous with library name, the following name resolution rules are followed:
the method comprises the steps of firstly analyzing a first section of name according to the matching priority sequence of a known object, matching a composite variable name prior to a block label, a packet name and a pattern name, matching subsequent names with column names of composite variables in sequence once the matched composite variable name is found, and reporting an error if no matched item exists.
If there is no matching complex variable name, then match the first segment name with the chunk tag name, if a matching chunk tag name is found, then match the second segment name with the known object in the tag chunk, if there is no known object in the tag chunk that matches the second segment name, then report an error. When the second segment name matches the variable in the tag block, the subsequent names are sequentially matched with the subcolumns of the variable. If the second section of name is matched with the sub-block label name in the label block, the third section of name and the fourth section of name are sequentially matched to judge whether the second section of name is a variable and a row thereof in the sub-label block or the sub-label block and the variable thereof, and if no matched item exists, an error is reported.
And if no matched block tag name exists, matching the first section name with the packet name in the current visible mode in the database, if a matched packet is found, matching the known object in the packet with the second section name, and if no known object matched with the second section name exists in the packet, reporting an error. When the second section name is matched with the known object in the packet, the subsequent names are sequentially matched with the sub-columns of the variables, and if no matching item exists or the known object matched with the second section name is a non-combined type known object (if the known object is a common variable without a column), an error is reported.
If the first segment name does not match the variable, the tag, and the packet. Matching the second section name with the pattern in the current database, matching the second section name with the packet in the matching pattern if the corresponding pattern is matched, and reporting an error if no matched packet exists. Finding out the matched packet, matching the third section name with the known object in the packet, and reporting an error if the packet does not have the known object matched with the third section name. And finding the known object in the packet which is matched with the third section name, and matching the fourth section with the sublist. If the known object without the matching item or matched with the third section name is the non-combined type known object, an error is reported.
And when the first section name is not matched with the pattern, matching the first section name with the current database name, and if not, directly reporting an error. If yes, matching the second section name, the third section name and the fourth section name with the mode, the packet and the variable in the packet in sequence.
Fig. 6 is a block diagram illustrating a structure of a database access object name resolution apparatus according to an embodiment of the present disclosure. Referring to fig. 6, the database access object name resolution apparatus includes:
a name linked list obtaining module 310, configured to obtain an access object name linked list, where the access object name linked list includes at least one segment of name, and if the access object name linked list includes at least two segments of names, the at least two segments of names are arranged in a sequence from top to bottom according to a hierarchy;
a corpus data obtaining module 320, configured to obtain name corpus data corresponding to the database, where the name corpus data includes names and types of known objects in the database;
an order determination module 330, configured to determine a matching priority order of the known objects based on the name corpus data; the lower the known object type level is, the higher the matching priority is;
and the matching module 340 is configured to perform matching processing on the names of the segments in the access object name linked list based on the matching priority order of the known objects, so as to form a matching result.
Optionally, the name linked list obtaining module 310 is specifically configured to:
based on the segment name identifier, an access object name linked list is obtained.
Optionally, the name linked list obtaining module 310 is specifically configured to:
acquiring a first label in the name of the access object;
taking a first label in the name of the access object as a first section name in a name linked list;
repeating the subsequent section name identification process until all the section names of the access object are identified;
the subsequent segment name identification process comprises:
acquiring the 2 nth label and the 2n +1 st label in the access object name;
if the 2n label is a segment name identifier and the 2n +1 label is a word, taking the 2n +1 label in the access object name as the n +1 segment name in a name linked list;
let n be n + 1;
wherein n is a positive integer.
Optionally, the name linked list obtaining module 310 is further configured to:
if the 2n label is not a segment name identifier and/or the 2n +1 label is a word, the 2n label and the 2n +1 label are pressed back to the cache stack.
Optionally, the access object name linked list includes a segment name;
the matching module 340 is specifically configured to:
matching the mth section of name in the access object name linked list with the name of the known object in the database based on the matching priority sequence of the known object;
if the m-th section of name is matched with the name of a known object, judging whether the access object name linked list comprises the m + 1-th section of name and whether the matched known object has a next-stage known object;
if the access object name linked list comprises the m +1 th segment name and the matched known object has a next-stage known object, matching the m +1 th segment name with the name of the known object in the database;
if the name linked list of the access object comprises the m +1 th section of name and the known object in the matching has no next-stage known object, outputting an error-reporting type matching result;
if the access object name linked list does not include the m +1 th section of name and the known object in the matching has a next-stage known object, judging whether the known object in the matching is a variable or a column; if yes, outputting the known object in the matching, otherwise, outputting an error-reporting type matching result;
wherein m and a are positive integers, and m is more than or equal to 0 and less than or equal to m +1 and less than or equal to a.
Optionally, the matching module 340 is further configured to output an error-reporting class matching result if the mth segment name is not matched with the name of any known object in the database.
Optionally, the name corpus data further comprises dependencies between different known objects; the matching module 340 is further configured to, when performing matching of the m +1 th segment name with names of known objects in the database, include:
determining a next-level known object of the known objects matched with the mth section of name;
and matching the m +1 th segment name with the name of the next-level known object based on the matching priority order of the known objects.
The device disclosed in the above embodiments can implement the processes of the methods disclosed in the above method embodiments, and has the same or corresponding beneficial effects. To avoid repetition, further description is omitted here.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure, as shown in fig. 7, the electronic device may include an intelligent terminal such as a mobile phone, a PAD, and a computer, and the electronic device includes:
one or more processors 301, one processor 301 being exemplified in fig. 7;
a memory 302;
the electronic device may further include: an input device 303 and an output device 304.
The processor 301, the memory 302, the input device 303 and the output device 304 in the electronic device may be connected by a bus or other means, and fig. 7 illustrates an example of connection by a bus.
The memory 302, which is a non-transitory computer-readable storage medium, may be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the database access object name resolution method of the application program in the embodiments of the present disclosure. The processor 301 executes various functional applications of the server and data processing, that is, a database access object name resolution method implementing the above-described method embodiments, by running software programs, instructions, and modules stored in the memory 302.
The memory 302 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 302 optionally includes memory located remotely from processor 301, which may be connected to a terminal device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 303 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus. The output means 304 may comprise a display device such as a display screen.
The disclosed embodiments also provide a computer-readable storage medium storing a program or instructions for executing a method for resolving a name of a database access object, the method including:
obtaining an access object name linked list, wherein the access object name linked list comprises at least one section of name, and if the access object name linked list comprises at least two sections of names, the at least two sections of names are arranged according to the sequence of the hierarchy from top to bottom;
acquiring name corpus data corresponding to the database, wherein the name corpus data comprises names and types of known objects in the database;
determining a matching priority order of the known objects based on the name corpus data; the lower the known object type level is, the higher the matching priority is;
and matching each section of name in the access object name linked list based on the matching priority sequence of the known object to form a matching result.
Optionally, the computer executable instructions, when executed by a computer processor, may be further configured to implement a technical solution of a database access object name resolution method provided in any embodiment of the present disclosure.
From the above description of the embodiments, it is obvious for a person skilled in the art that the present disclosure can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present disclosure may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present disclosure.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A database access object name resolution method is characterized by comprising the following steps:
obtaining an access object name linked list, wherein the access object name linked list comprises at least one section of name, and if the access object name linked list comprises at least two sections of names, the at least two sections of names are arranged according to the sequence of the hierarchy from top to bottom;
acquiring name corpus data corresponding to the database, wherein the name corpus data comprises names and types of known objects in the database;
determining a matching priority order of the known objects based on the name corpus data; the lower the known object type level is, the higher the matching priority is;
and matching each section of name in the access object name linked list based on the matching priority sequence of the known object to form a matching result.
2. The method for resolving names of objects accessed from a database according to claim 1, wherein the obtaining of the linked list of names of objects accessed comprises:
based on the segment name identifier, an access object name linked list is obtained.
3. The method for resolving names of objects accessed from database according to claim 2, wherein the obtaining of the name linked list of objects accessed based on the segment name identifier comprises:
acquiring a first label in the name of the access object;
taking a first label in the name of the access object as a first section name in a name linked list;
repeating the subsequent section name identification process until all the section names of the access object are identified;
the subsequent segment name identification process comprises:
acquiring the 2 nth label and the 2n +1 st label in the access object name;
if the 2n label is a segment name identifier and the 2n +1 label is a word, taking the 2n +1 label in the access object name as the n +1 segment name in a name linked list;
let n be n + 1;
wherein n is a positive integer.
4. The method according to claim 3, wherein if the 2 n-th tag is not a segment name identifier and/or the 2n + 1-th tag is a word, the 2 n-th tag and the 2n + 1-th tag are pushed back to the cache stack.
5. The database access object name resolution method according to claim 1, wherein the access object name linked list includes a-segment names;
the matching processing is performed on each segment of names in the access object name linked list based on the matching priority order of the known objects to form a matching result, and the matching result comprises the following steps:
matching the mth section of name in the access object name linked list with the name of the known object in the database based on the matching priority sequence of the known object;
if the m-th section of name is matched with the name of a known object, judging whether the access object name linked list comprises the m + 1-th section of name and whether the matched known object has a next-stage known object;
if the access object name linked list comprises the m +1 th segment name and the matched known object has a next-stage known object, matching the m +1 th segment name with the name of the known object in the database;
if the name linked list of the access object comprises the m +1 th section of name and the known object in the matching has no next-stage known object, outputting an error-reporting type matching result;
if the access object name linked list does not include the m +1 th section of name and the known object in the matching has a next-stage known object, judging whether the known object in the matching is a variable or a column; if yes, outputting the known object in the matching, otherwise, outputting an error-reporting type matching result;
wherein m and a are positive integers, and m is more than or equal to 0 and less than or equal to m +1 and less than or equal to a.
6. The method according to claim 5, wherein if the m-th segment name is not matched with any known object name in the database, outputting an error-reporting class matching result.
7. The database access object name resolution method of claim 5, wherein the name corpus data further comprises dependencies between different known objects;
the matching the m +1 th section name with the name of the known object in the database comprises:
determining a next-level known object of the known objects matched with the mth section of name;
and matching the m +1 th segment name with the name of the next-level known object based on the matching priority order of the known objects.
8. A database access object name resolution apparatus, comprising:
a name linked list obtaining module, configured to obtain an access object name linked list, where the access object name linked list includes at least one segment of name, and if the access object name linked list includes at least two segments of names, the at least two segments of names are arranged in a sequence from top to bottom according to a hierarchy;
a corpus data obtaining module, configured to obtain name corpus data corresponding to the database, where the name corpus data includes names and types of known objects in the database;
the sequence determining module is used for determining the matching priority sequence of the known objects based on the name corpus data; the lower the known object type level is, the higher the matching priority is;
and the matching module is used for matching the names of all the sections in the access object name linked list based on the matching priority sequence of the known objects to form a matching result.
9. An electronic device, comprising: a processor and a memory;
the processor is adapted to perform the steps of the method of any one of claims 1 to 7 by calling a program or instructions stored in the memory.
10. A computer-readable storage medium, characterized in that it stores a program or instructions for causing a computer to carry out the steps of the method according to any one of claims 1 to 7.
CN202011031036.8A 2020-09-27 2020-09-27 Database access object name resolution method and device and electronic equipment Active CN112115125B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011031036.8A CN112115125B (en) 2020-09-27 2020-09-27 Database access object name resolution method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011031036.8A CN112115125B (en) 2020-09-27 2020-09-27 Database access object name resolution method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112115125A true CN112115125A (en) 2020-12-22
CN112115125B CN112115125B (en) 2024-04-26

Family

ID=73798566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011031036.8A Active CN112115125B (en) 2020-09-27 2020-09-27 Database access object name resolution method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112115125B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113779030A (en) * 2021-09-13 2021-12-10 北京房江湖科技有限公司 Enumerated value query method, readable storage medium and computer program product

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585945A (en) * 2001-09-28 2005-02-23 甲骨文国际公司 Mechanism for mapping XML schemas to object-relational database systems
US20060230019A1 (en) * 2005-04-08 2006-10-12 International Business Machines Corporation System and method to optimize database access by synchronizing state based on data access patterns
US20080059486A1 (en) * 2006-08-24 2008-03-06 Derek Edwin Pappas Intelligent data search engine
US7720805B1 (en) * 1999-10-06 2010-05-18 Bmc Software, Inc. Sequential unload processing of IMS databases
US20100241637A1 (en) * 2009-03-23 2010-09-23 Sap Ag Systems and methods for managing foreign key constraints
GB201021433D0 (en) * 2008-07-02 2011-02-02 Lexisnexis Risk Solutions Fl Inc Database systems and methods
CN102375854A (en) * 2010-08-23 2012-03-14 杭州华三通信技术有限公司 Method and device for data processing for database
CN103778133A (en) * 2012-10-18 2014-05-07 阿里巴巴集团控股有限公司 Database object changing method and device
JP2014225113A (en) * 2013-05-16 2014-12-04 日本電信電話株式会社 Address solution system and method
US20150242531A1 (en) * 2014-02-25 2015-08-27 International Business Machines Corporation Database access control for multi-tier processing
US20160257074A1 (en) * 2015-03-02 2016-09-08 Xerox Corporation Embedding a database in a physical object
CN106599111A (en) * 2016-11-30 2017-04-26 上海斐讯数据通信技术有限公司 Data management method and storage system
US9659052B1 (en) * 2013-09-26 2017-05-23 Amazon Technologies, Inc. Data object resolver
US20180004783A1 (en) * 2016-06-29 2018-01-04 International Business Machines Corporation Database object management for a shared pool of configurable computing resources
CN109542453A (en) * 2018-11-20 2019-03-29 北京千丁互联科技有限公司 Database information recognition methods, device and terminal
US20200089905A1 (en) * 2018-02-12 2020-03-19 Equifax Inc. Facilitating entity resolution via secure entity resolution database
CN111125199A (en) * 2019-12-30 2020-05-08 中国农业银行股份有限公司 Database access method and device and electronic equipment
CN111666293A (en) * 2019-03-05 2020-09-15 北京京东尚科信息技术有限公司 Database access method and device

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7720805B1 (en) * 1999-10-06 2010-05-18 Bmc Software, Inc. Sequential unload processing of IMS databases
CN1585945A (en) * 2001-09-28 2005-02-23 甲骨文国际公司 Mechanism for mapping XML schemas to object-relational database systems
US20060230019A1 (en) * 2005-04-08 2006-10-12 International Business Machines Corporation System and method to optimize database access by synchronizing state based on data access patterns
US20080059486A1 (en) * 2006-08-24 2008-03-06 Derek Edwin Pappas Intelligent data search engine
GB201021433D0 (en) * 2008-07-02 2011-02-02 Lexisnexis Risk Solutions Fl Inc Database systems and methods
US20100241637A1 (en) * 2009-03-23 2010-09-23 Sap Ag Systems and methods for managing foreign key constraints
CN102375854A (en) * 2010-08-23 2012-03-14 杭州华三通信技术有限公司 Method and device for data processing for database
CN103778133A (en) * 2012-10-18 2014-05-07 阿里巴巴集团控股有限公司 Database object changing method and device
JP2014225113A (en) * 2013-05-16 2014-12-04 日本電信電話株式会社 Address solution system and method
US9659052B1 (en) * 2013-09-26 2017-05-23 Amazon Technologies, Inc. Data object resolver
US20150242531A1 (en) * 2014-02-25 2015-08-27 International Business Machines Corporation Database access control for multi-tier processing
US20160257074A1 (en) * 2015-03-02 2016-09-08 Xerox Corporation Embedding a database in a physical object
US20180004783A1 (en) * 2016-06-29 2018-01-04 International Business Machines Corporation Database object management for a shared pool of configurable computing resources
CN106599111A (en) * 2016-11-30 2017-04-26 上海斐讯数据通信技术有限公司 Data management method and storage system
US20200089905A1 (en) * 2018-02-12 2020-03-19 Equifax Inc. Facilitating entity resolution via secure entity resolution database
CN109542453A (en) * 2018-11-20 2019-03-29 北京千丁互联科技有限公司 Database information recognition methods, device and terminal
CN111666293A (en) * 2019-03-05 2020-09-15 北京京东尚科信息技术有限公司 Database access method and device
CN111125199A (en) * 2019-12-30 2020-05-08 中国农业银行股份有限公司 Database access method and device and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
陆耀伟: "分布式对象名称解析系统的研究与实现", 《信息科技》 *
陈志辉;吴敏敏;: "层次多级联对象名称解析系统的体系架构", 宜春学院学报, no. 08, 25 August 2012 (2012-08-25) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113779030A (en) * 2021-09-13 2021-12-10 北京房江湖科技有限公司 Enumerated value query method, readable storage medium and computer program product
CN113779030B (en) * 2021-09-13 2023-08-08 北京房江湖科技有限公司 Enumeration value query method, readable storage medium, and computer program product

Also Published As

Publication number Publication date
CN112115125B (en) 2024-04-26

Similar Documents

Publication Publication Date Title
AU2013329525C1 (en) System and method for recursively traversing the internet and other sources to identify, gather, curate, adjudicate, and qualify business identity and related data
WO2012030411A1 (en) Method for classification of objects in a graph data stream
CN110941655B (en) Data format conversion method and device
CN110765773A (en) Address data acquisition method and device
CN111258990B (en) Index database data migration method, device, equipment and storage medium
CN113672628A (en) Data blood margin analysis method, terminal device and medium
CN110263104B (en) JSON character string processing method and device
US20240256613A1 (en) Data processing method and apparatus, readable storage medium, and electronic device
US11573987B2 (en) System for detecting data relationships based on sample data
CN110909523A (en) Data processing method and device
CN116560984A (en) Test case clustering grouping method based on call dependency graph
CN113761285A (en) Metadata generation system based on multi-source data
CN111858607A (en) Data processing method and device, electronic equipment and computer readable medium
CN111813744A (en) File searching method, device, equipment and storage medium
CN108897678B (en) Static code detection method, static code detection system and storage device
JP2022105474A (en) Method for verifying vulnerabilities of network devices using cve entries
CN112115125A (en) Database access object name resolution method and device and electronic equipment
CN110765100B (en) Label generation method and device, computer readable storage medium and server
CN113344023A (en) Code recommendation method, device and system
CN115455006A (en) Data processing method, data processing device, electronic device, and storage medium
WO2010095004A1 (en) Priority search trees
CN114968350A (en) Searching method, device and equipment for code method call chain
CN113448965A (en) Method, device and equipment for determining full-table-scanning structured query statement
CN109992687B (en) Face data searching method and device, electronic equipment and readable storage medium
CN112130860A (en) JSON object analysis method and device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 100102 201, 2 / F, 101, No. 5 building, No. 7 Rongda Road, Chaoyang District, Beijing

Patentee after: China Electronics Technology Group Jincang (Beijing) Technology Co.,Ltd.

Country or region after: China

Address before: 100102 201, 2 / F, 101, No. 5 building, No. 7 Rongda Road, Chaoyang District, Beijing

Patentee before: BEIJING KINGBASE INFORMATION TECHNOLOGIES Inc.

Country or region before: China

CP03 Change of name, title or address