CN112115125B - 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
CN112115125B
CN112115125B CN202011031036.8A CN202011031036A CN112115125B CN 112115125 B CN112115125 B CN 112115125B CN 202011031036 A CN202011031036 A CN 202011031036A CN 112115125 B CN112115125 B CN 112115125B
Authority
CN
China
Prior art keywords
name
matching
linked list
names
access object
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
CN202011031036.8A
Other languages
Chinese (zh)
Other versions
CN112115125A (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.)
Beijing Kingbase Information Technologies 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

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

Abstract

The disclosure relates to a method, a device and electronic equipment for resolving names of database access objects, wherein the method comprises the following steps: acquiring an access object name linked list, wherein the access object name linked list comprises at least one section of names, 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 from high to low of the hierarchy; 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, the higher the matching priority; and carrying out matching processing on each section of names in the access object name linked list based on the matching priority order of the known objects to form a matching result. According to the technical scheme, the method and the device have the advantages of short analysis time, accurate analysis result, universality and expandability, and can support name recognition processing of any-layer nested objects.

Description

Database access object name resolution method and device and electronic equipment
Technical Field
The disclosure relates to the technical field of databases, and in particular relates to a method and a device for resolving names of database access objects and electronic equipment.
Background
With the increasing development of computer technology, databases are an indispensable ring in computer systems, and in addition to storing data, they are providing increasingly powerful data processing functions, and data in the processing databases can be accessed through SQL or PLSQL.
Objects in the 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 the database, and multiple database objects, such as packages, blocks (functions), etc., under the schemas. The package may in turn contain blocks (functions), complex variables, etc., which in turn may include multiple columns. In addition, blocks (functions) may be further nested in blocks (functions), and columns may be further nested in columns. Thus, when an object is accessed, the object name may consist of multiple segments, such as the access object name a.b.c.d. In this case, the name of the access object can be understood as a package, compound variable, column; or the name of the access object may be understood as a schema, package, variable, column; or the name of the access object can 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 currently there is no better way to efficiently resolve the names of database access objects.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, an apparatus, and an electronic device for resolving a name of a database access object.
In a first aspect, the present disclosure provides a method for resolving a name of a database access object, including:
Acquiring an access object name linked list, wherein the access object name linked list comprises at least one section of names, 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 from high to low of the hierarchy;
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, the higher the matching priority;
And carrying out matching processing on each section of names in the access object name linked list based on the matching priority order of the known objects to form a matching result.
In a second aspect, the present disclosure further provides a database access object name resolution apparatus, including:
The name linked list acquisition module is used for acquiring an access object name linked list, wherein the access object name linked list comprises at least one section of names, 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 from high to low of the hierarchy;
the system comprises a corpus data acquisition module, a database and a database, wherein the corpus data acquisition module is used for acquiring name corpus data corresponding to the database, and the name corpus data comprises names and types of known objects in the database;
the order determining module is used for determining the matching priority order of the known objects based on the name corpus data; the lower the known object type level, the higher the matching priority;
And the matching module is used for carrying out matching processing on each section of names 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 operable to perform the steps of any of the methods described above by invoking a program or instruction stored in the memory.
In a fourth aspect, the present disclosure also provides a computer-readable storage medium storing a program or instructions that cause 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 in the embodiments of the present disclosure determines a matching priority order of known objects based on name corpus data. Since access objects are mostly variables, columns, and the like in practice, setting the priority order in this way can shorten the matching time.
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 comprises all segment names forming the access object name, so that the accuracy of subsequent analysis can be ensured.
The analysis method provided by the technical scheme provided by the embodiment of the disclosure has universality and expandability. No matter how many sections of names are required to be resolved, the technical scheme provided by the embodiment of the disclosure can be utilized for resolving. Thus, it can support name recognition processing of arbitrary layer nested objects. In addition, because the method has universality, different analysis methods are not required to be respectively set for access objects with different section numbers, and the manpower and material resource investment of 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 disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a hierarchical relationship diagram of a database object provided by the present disclosure;
FIG. 2 is a flowchart of a method for resolving a name of a database access object according to an embodiment of the disclosure;
FIG. 3 is a flowchart of a method for implementing S110 according to an embodiment of the 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 provided by an embodiment of the present disclosure;
fig. 6 is a block diagram of a database access object name resolution device according to an embodiment of the present disclosure;
fig. 7 is a schematic hardware structure of an electronic device according to an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
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 otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
Fig. 2 is a flowchart of a method for resolving a name of a database access object according to an embodiment of the present disclosure.
The execution time of the database access object name resolution method provided by the embodiment of the disclosure includes, but is not limited to, the following two times:
At the first time, analysis and identification at compiling time before grammar analysis after lexical analysis, such as the process of creating a package or a function, needs to use some variables, and when the variables are used for completing the creation work, the names of the variables need to be analyzed.
In the second occasion, in the analysis and recognition of the execution stage, for example, as some variables are related to partial sentences or expressions corresponding to the created package or function, in the process of calling the created package or function, the names of the related variables need to be analyzed.
Referring to fig. 2, the database access object name resolution method includes:
S110, acquiring an access object name linked list, wherein the access object name linked list comprises at least one section of name; 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 order from high to low 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 hierarchically stored. This makes it possible that if the name of the access object includes at least two pieces of names, different pieces of names often represent different hierarchies, and thus requires that at least two pieces of names be arranged in order of hierarchy from high to low. Illustratively, if a certain access object is named a.b.c.d, where a stands for library, B stands for schema, C stands for package, and D stands for 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 of the hierarchy from high to low. By means of the multi-segment names, the access object can be accurately located in the database.
There are various ways to implement this step, and the present application is not limited thereto. Illustratively, an 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. By identifying the name of the access object as the access object name linked list through the segment name identifier, the formed access object name linked list can be ensured to comprise all the segment names forming the access object name, and further the accuracy of subsequent analysis can be ensured.
In practice, which symbol is used as the segment name identifier is not limited to this aspect of the present application. For example, if the access object name is a.b.c.d., the "." may be taken as the segment name identifier.
The method for realizing the method for acquiring the access object name linked list based on the segment name identifier is various, and the application is not limited to the method.
Fig. 3 is a flowchart of a method for implementing S110 according to an embodiment of the disclosure. Referring to fig. 3, the method includes: first, a first tag in the access object name is acquired. Optionally, the sentence is parsed by a flex lexical parser to obtain a first tag in the access object name. Secondly, the first label in the name of the access object is used as the first segment name in the name linked list. And repeatedly executing the follow-up section name recognition flow again until the names of the sections of the access object are recognized. The follow-up section name identification flow comprises the following steps: acquiring the 2n-th label and 2n+1th label in the name of the access object; if the 2n label is a segment name identifier and the 2n+1st label is a word, using the 2n+1st label in the access object name as the n+1st segment name in the name chain table; let n=n+1; wherein n is a positive integer. Here, "let n=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, if n=1 at the time of the first execution. After updating the value of n, n=2. After updating the value of n again, n=3.
Illustratively, let n=1 first, 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, the 2 nd label is a word, and the 3 rd label in the name of the access object is used as the 2 nd segment name in the name linked list. Let n=2, obtain the 4 th label and 5th label in the name of the access object; if the 4 th label is a segment name identifier and the 5th label is a word, the 5th label in the name of the access object is used as the 3 rd segment name in the name chain table. And repeating the steps to circularly acquire the names of all the sections of the access object. If the 2n label is not the segment name identifier and/or the 2n+1st label is not a word in the process of a certain cycle, the condition that the access object is cut off to the 2n-1st label is indicated that all the segment names of the access object are completely identified. This arrangement ensures that the formed linked list of access object names includes all the segment names that make up the access object names, and thus ensures the accuracy of subsequent parsing. In addition, the setting is such that, no matter how many segment names are contained in the access object name, all segment names can be identified based on the method, and it is not necessary to set the segment name identification methods respectively according to the number of segment names contained in the access object name.
Optionally, if the 2n_th tag is not a segment name identifier and/or the 2n+1th tag is not a word, the 2n_th tag and the 2n+1th tag may be balanced back to the cache stack, so that other recognition methods can be conveniently adopted subsequently. For example, if a certain character string is a.b. 2, by using the method described above, it may be determined that two sections of names are included in the access object name linked list. The first segment is named a and the second segment is named B.
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. The types of known objects include, but are not limited to, columns, variables, blocks, packages, schemas, databases, and the like. Illustratively, the variables or blocks declared in a block belong to a known object. Variables that are not declared in a block 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 the database are logically stored hierarchically. With continued reference to FIG. 4, due to its hierarchically stored nature, any object has a previous level object and/or a next level object associated with it. Illustratively, in FIG. 4, the upper level of variable 5 is block 1, the upper level of block 2 is block 1, and the lower level of block 2 is variable 8 and variable 3. Based on this, optionally, the name corpus data also includes dependencies between different known objects. A dependency refers to a relationship that can reflect a top-and-bottom-level known object associated with a certain known object. By setting the name corpus data to also include the subordinate relations between different known objects, the relation between the known objects can be made clearer, and the subsequent use is convenient.
Illustratively, the set of name data for a variable or block tag may be formed by storing the variable or block tag declared in the system using a back pointer storage structure or a forward pointer storage structure. If a back pointer storage structure is employed, the storage structure includes the type of known object, the object name, and a pointer to the last level of 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 object associated with the known object.
S130, determining the matching priority order of the known objects based on the name corpus data; the lower the object type level is known, the higher the matching priority.
The types of known objects include, but are not limited to, columns, variables, blocks, packages, schemas, databases, and the like. Since in practice a block may be the next level known object of a packet, a packet cannot be the next level known object of a block. The packet level is higher than the block level. Similarly, the level of the block is higher than the level of the variable. And taking the column as a special form of a variable, wherein the variable is an entry of a query column, and finally, all known object types are sequenced according to priority, and the sequencing result is a variable name > block tag name > package name > mode name > database name.
Further, in the case that a plurality of known objects in the database correspond to the same object type, the plurality of objects may be arbitrarily ordered in determining the matching priority order of the known objects. Illustratively, in fig. 4, the variable 3, the variable 5, the variable 6, the variable 7, the variable 8 and the variable 9 correspond to the same object type, and the priorities of the variable 3, the variable 5, the variable 6, the variable 7, the variable 8 and the variable 9 are the same, and can be arbitrarily ordered. After sorting the known objects in fig. 4, the resulting 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, the "level of known object" and the "level of known object type" should be distinguished. In fig. 4, the previous-level known object of the block 2 is the block 1, and the level of the block 1 is higher than that of the block 2 in view of the level of the known object. But both are blocks since block 2 and block 1 correspond to the same object type. From the known object type level, block 2 and block 1 belong to the same level.
And S140, carrying out matching processing on each section of names in the access object name linked list based on the matching priority order of the known objects to form a matching result.
The essence of this step is that the names of the known objects are sequentially fetched from the name corpus data according to the matching priority order of the known objects for comparison with the names of the segments in the access object name link list.
There are various specific implementation methods of this step, and the present application is not limited thereto. Illustratively, assume that the access object name linked list includes an a-segment name. The method may include: matching the m-th section name in the access object name linked list with the name of the known object in the database based on the matching priority order of the known object; if the m-th segment name is matched with the name of a certain known object, judging whether the m+1st segment name is included in the access object name linked list, and judging whether the matched known object has the next-stage known object; if the accessed object name linked list comprises the m+1th section name and the known object in the matching has the next-stage known object, matching the m+1th section name with the name of the known object in the database; if the accessed object name linked list comprises the m+1st section name and the known object in the matching does not have the next-stage known object, outputting a fault class matching result; if the accessed object name linked list does not comprise the m+1st section name and the known object in the matching has the known object of the next stage, 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 a fault reporting type matching result; wherein m and a are both positive integers.
Optionally, if the m-th segment name is not matched with the name of any known object in the database, outputting a fault 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 access objects are mostly variables, columns, and the like in practice, setting the priority order in this way can shorten the matching time.
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 section names forming the access object names, and further ensure the accuracy of subsequent analysis.
Thirdly, the analysis method provided by the technical scheme has universality and expandability, and can analyze no matter how many sections of names are required to be analyzed for the names of the access objects. Thus, it can support name recognition processing of arbitrary layer nested objects. In addition, because the method has universality, different analysis methods are not required to be respectively set for access objects with different section numbers, and the manpower and material resource investment of program development can be reduced.
Fig. 5 is a flowchart of a method for implementing S140 according to an embodiment of the disclosure. For ease of understanding, the method of implementing S140 is further described below with reference to fig. 5. Illustratively, referring to FIG. 5, the method includes:
S201, let p=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, let m=1, and execute S204.
S204, comparing the m-th segment name in the access object name linked list with the p-th known object name, and judging whether the m-th segment name in the access object name linked list is consistent with the p-th known object name. If yes, executing S205; if not, S206 is performed.
S205, judging whether the access object name linked list comprises the m+1st section name. If yes, executing S211; if not, S209 is performed.
S206, judging whether the m-th segment name is matched with all known object names in the name corpus data. If yes, executing S208; if not, S207 is performed.
S207, let p=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 process work for the mth segment name is continued to be completed.
S208, outputting a fault reporting type 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 does not match all known objects in the name corpus data, and outputting error class information, such as "NULL".
S209, judging whether the known object in the matching is a variable or a column. If yes, executing S210; if not, S208 is performed.
Since in practice, the access object is typically a variable or column, if the known object in the match is determined to be a variable or column, then the known object in the match is determined to be the access object. If the known object in the match is not a variable or a column (e.g., the known object in the match is a block), then it is determined that the known object in the match is not an access object, and error class information is output, such as "NULL".
S210, outputting the known object in the matching.
S211, judging whether the known object in the matching in the database has the known object of the next stage. If yes, executing S212; if not, S208 is performed.
Because the access object name linked list comprises the m+1th section name, if the known object matched with the m section name has no next-stage known object, the m+1th section name cannot be matched, the current matching result is incorrect, and error reporting class information is output, such as NULL is output.
And if the known object matched with the m-th segment name has the next-stage known object, continuing to match the m-th segment name with the m-th segment name.
S212, let m=m+1, and S202 is executed.
"Let m=m+1" means that the value of let m is updated. The updating method is identical to the updating method of n in the previous description, and is not repeated here.
After letting m=m+1, the purpose of S202 is to match the access object m+1st piece name with the names of 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 of the hierarchy from high to low, S212 may be replaced with: determining a next-level known object of the known object matched with the mth segment name; and matching the m+1st segment 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 once the first segment name is accessed and matched with a certain known object, only whether the subsequent segment name is the next known variable of the known variable is judged, instead of performing backtracking search, and traversing all the known variables in the name corpus data. By the arrangement, the time for matching the m+1st section name of the access object can be shortened, and the matching efficiency is improved.
Illustratively, referring to FIG. 4, assume that the known object that matches the mth segment name is block 1, and that the next level of known object of block 1 is block 2 and variable 5. The priority of variable 5 is higher than the priority of block 2 according to the matching priority order of the known objects. When the m+1th section name of the access object is matched, the m+1th section name of the access object is matched with the variable 5 name, and if the m+1th section name of the access object is inconsistent with the variable 5 name, the m+1th section name of the access object is matched with the block 2 name.
In order to facilitate understanding, the technical solution of the present disclosure is further described below by taking name resolution of two, three and four segments as examples.
1. The case of a two-segment name solution includes:
1. Composite type variable column
2. Block tag, variable
3. Bag variable
When the compound variable, block tag and package name are named, the following name resolution rules are followed:
the first segment name is firstly analyzed according to the matching priority sequence of the known object, the compound variable name is matched with the packet name in advance of the block label, once the matched compound variable name is found, the second segment name is matched in the column of the compound variable, and if the column matched with the second segment name is not found in the compound variable, the error is reported.
If there is no matched complex variable name, the first segment name is matched with the block tag name, if a matched block tag name is found, the known object in the tag block is matched with the second segment name, and if there is no known object in the tag block matched with the second segment name, the error is reported.
If there is no matching block label, the first segment name is matched with the packet name in the current visible mode in the database, if a matching packet is found, the known object in the packet is matched with the second segment name, and if there is no known object in the packet that matches the second segment name, the error is reported.
2. The case of three-segment name resolution includes:
1. Composite type variable column
2. Block labels, composite type variables, columns
3. Block Label, variable
4. Package, composite type variable, column
5. Mode, package, variable
When the compound variable, block tag, package name and schema name are named, the following name resolution rules are followed:
The first segment name is firstly analyzed according to the matching priority sequence of the known object, the compound variable name is matched before the block label, the package name and the mode name, once the matched compound variable name is found, the second segment name is matched in the column of the compound variable, and if the column matched with the second segment name is not found in the compound variable, the error is reported. When the second section name is matched with the column of the compound variable, the third section name is continuously matched with the subcolumn of the nested compound variable, and if no matching item exists, the error is reported.
If there is no matched complex variable name, the first segment name is matched with the block tag name, if a matched block tag name is found, the known object in the tag block is matched with the second segment name, and if there is no known object in the tag block matched with the second segment name, the error is reported. When the second segment name matches a variable in the tag block, then a third segment name is used to match a child column of the variable. If the second section name is matched with the sub-block label name in the label block, the third section name is matched with the variable in the sub-label block, and if no matching item exists, the error is reported.
If there is no matching block label, the first segment name is matched with the packet name in the current visible mode in the database, if a matching packet is found, the known object in the packet is matched with the second segment name, and if there is no known object in the packet that matches the second segment name, the error is reported. When the second segment name matches the known object in the package, then the third segment name is used to match the next known object of the known object in the package, no match item is found or the known object matching the second segment name is of a non-combined type (e.g., is a common variable that does not include a column), and then an error is reported.
If the first segment name does not match the variable, tag and packet. Matching the second section name with the pattern in the current database to the corresponding pattern, continuously matching the second section name with the packet in the matching pattern, and reporting errors if no matched packet exists. And finding a matched package, matching the third section name with the known object in the package, and reporting an error if the package does not have the known object matched with the third section name.
3. The four-segment name resolution cases include:
1. Composite type variables, columns
2. Block labels, composite type variables, columns
3. Block tag, composite type variable, column
4. Block tag, variable
5. Package, composite type variable, column
6. Schema, package, composite type variable, column
7. Library, schema, package, variable
When the compound variable, block tag, package name, schema name and library name are the same name, the following name resolution rules are followed:
Firstly, resolving the first section of names according to the matching priority sequence of the known objects, matching the compound variable names with the block labels, the package names and the mode names, once the matched compound variable names are found, matching the subsequent names with the column names of the compound variables in sequence, and if no matching item exists, reporting errors.
If there is no matched complex variable name, the first segment name is matched with the block tag name, if a matched block tag name is found, the known object in the tag block is matched with the second segment name, and if there is no known object in the tag block matched with the second segment name, the error is reported. When the second segment name matches a variable in the tag block, then the subsequent names match the sub-columns of the variable in turn. If the second section name is matched with the sub-block label name in the label block, the third section name and the fourth section name are matched in sequence to judge whether the second section name is a variable in the sub-label block and a row thereof or the sub-label block and a variable thereof, and if no matching item exists, the error is reported.
If there is no matching block label, the first segment name is matched with the packet name in the current visible mode in the database, if a matching packet is found, the known object in the packet is matched with the second segment name, and if there is no known object in the packet that matches the second segment name, the error is reported. When the second segment name matches the known object in the packet, then the subsequent names are sequentially matched with the sub-columns of the variables, and errors are reported if no matching item exists or the known object matching the second segment name is a non-combination type known object (e.g., a common variable that does not include a column).
If the first segment name does not match the variable, tag and packet. Matching the second section name with the pattern in the current database to the corresponding pattern, continuously matching the second section name with the packet in the matching pattern, and reporting errors if no matched packet exists. And finding a matched package, matching the third section name with the known object in the package, and reporting an error if the package does not have the known object matched with the third section name. And finding a known object matched with the name of the third segment in the packet, and matching the fourth segment with the subcolumn of the fourth segment. If no matching item or a known object matching the third segment name is a non-combination type known object, an error is reported.
And when the first section name is not matched with the mode, matching the first section name with the current database name, and if not, directly reporting errors. If yes, the second, third and fourth section names are matched with the mode, the package and the variables in the package in sequence.
Fig. 6 is a block diagram of a database access object name resolution device 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 section of names, and if the access object name linked list includes at least two sections of names, the at least two sections of names are arranged according to a sequence from high to low in 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 determining 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, the higher the matching priority;
And the matching module 340 is configured to perform matching processing on each segment name 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, a linked list of access object names is obtained.
Optionally, the name linked list obtaining module 310 is specifically configured to:
Acquiring a first tag in the access object name;
taking the first label in the access object name as the first section name in a name linked list;
repeatedly executing the follow-up section name recognition flow until the names of all sections of the access object are recognized;
The follow-up section name identification flow comprises the following steps:
acquiring the 2n-th label and 2n+1th label in the access object name;
If the 2n+1th tag is a segment name identifier, the 2n+1th tag is a word, and the 2n+1th tag in the access object name is used as the n+1th segment name in a name chain table;
Let n=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 the segment name identifier and/or the 2n+1st label is a word, the 2n label and the 2n+1st label are pushed back to the cache stack.
Optionally, the access object name linked list includes an a-segment name;
the matching module 340 is specifically configured to:
Matching the m-th section name in the access object name linked list with the name of the known object in the database based on the matching priority order of the known object;
If the m-th section name is matched with the name of a certain known object, judging whether the m+1st section name is included in the access object name linked list, and judging whether the known object in the matching has a next-stage known object;
If the m+1st section of name is included in the access object name linked list and the known object in the matching has the next-stage known object, matching the m+1st section of name with the name of the known object in the database;
If the accessed object name linked list comprises the m+1st section name and the known object in the matching does not have the next-stage known object, outputting a fault reporting type matching result;
If the m+1st section name is not included in the access object name linked list and the known object in the matching has the 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 a fault reporting type matching result;
Wherein m and a are both positive integers.
Optionally, the matching module 340 is further configured to output a mismatching result if the mth segment name does not match 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 between the m+1st segment name and the name of the known object in the database, include:
determining a next-level known object of the known object matched with the mth segment name;
And matching the m+1st segment name with the name of the next-stage known object based on the matching priority order of the known objects.
The device disclosed in the above embodiment can implement the flow of the method disclosed in the above method embodiments, and has the same or corresponding beneficial effects. In order to avoid repetition, the description is omitted here.
Fig. 7 is a schematic hardware structure of an electronic device provided by an embodiment of the present disclosure, where, as shown in fig. 7, the electronic device may include an intelligent terminal such as a mobile phone, a PAD, a computer, and the electronic device includes:
one or more processors 301, one processor 301 being illustrated 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 means 303 and the output means 304 in the electronic device may be connected by a bus or by other means, in fig. 7 by way of example.
The memory 302 serves as a non-transitory computer readable storage medium, and may be used to store 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, implements the database access object name resolution method of the above-described method embodiment, by running software programs, instructions, and modules stored in the memory 302.
Memory 302 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the electronic device, etc. In addition, 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 may optionally include memory located remotely from processor 301, which may be connected to the 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 means 303 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the electronic device. The output device 304 may include a display device such as a display screen.
The disclosed embodiments also provide a computer-readable storage medium storing a program or instructions that when executed by a computer cause the computer to perform a database access object name resolution method, the method comprising:
Acquiring an access object name linked list, wherein the access object name linked list comprises at least one section of names, 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 from high to low of the hierarchy;
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, the higher the matching priority;
And carrying out matching processing on each section of names in the access object name linked list based on the matching priority order of the known objects to form a matching result.
Optionally, the computer executable instructions may also be used to perform the technical solution of the database access object name resolution method provided by any embodiment of the disclosure when executed by a computer processor.
From the above description of embodiments, it will be apparent to those skilled in the art that the present disclosure may be implemented by means of software and necessary general purpose hardware, but may of course also be implemented by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solutions of the present disclosure may be embodied essentially or in a part contributing to the prior art 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 (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk, or an optical disk of a computer, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments of the present disclosure.
It should be noted that in this document, relational terms such as "first" and "second" and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the 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 and described 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, comprising:
Acquiring an access object name linked list, wherein the access object name linked list comprises at least one section of names, 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 from high to low of the hierarchy;
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, the higher the matching priority;
Based on the matching priority order of the known objects, performing matching processing on each section of names in the access object name linked list to form a matching result;
The matching processing is performed on each segment name in the access object name linked list based on the matching priority order of the known objects to form a matching result, which comprises the following steps:
Matching the m-th section name in the access object name linked list with the name of the known object in the database based on the matching priority order of the known object;
If the m-th section name is matched with the name of a certain known object, judging whether the m+1st section name is included in the access object name linked list, and judging whether the known object in the matching has a next-stage known object;
If the m+1st section of name is included in the access object name linked list and the known object in the matching has the next-stage known object, matching the m+1st section of name with the name of the known object in the database; wherein m is a positive integer.
2. The method for resolving a name of a database access object according to claim 1, wherein the step of obtaining a linked list of names of the access object comprises:
Based on the segment name identifier, a linked list of access object names is obtained.
3. The method for resolving a name of a database access object according to claim 2, wherein the step of obtaining a linked list of access object names based on the segment name identifier comprises:
Acquiring a first tag in the access object name;
taking the first label in the access object name as the first section name in a name linked list;
repeatedly executing the follow-up section name recognition flow until the names of all sections of the access object are recognized;
The follow-up section name identification flow comprises the following steps:
acquiring the 2n-th label and 2n+1th label in the access object name;
If the 2n+1th tag is a segment name identifier, the 2n+1th tag is a word, and the 2n+1th tag in the access object name is used as the n+1th segment name in a name chain table;
Let n=n+1;
Wherein n is a positive integer.
4. A method of resolving a name of a database access object according to claim 3, wherein if the 2n_th tag is not a segment name identifier and/or the 2n+1th tag is a word, the 2n_th tag and the 2n+1th tag are pushed back to a cache stack.
5. The method for resolving a name of a database access object according to claim 1, wherein the linked list of access object names includes a-segment names;
after judging whether the m-th segment name is matched with the name of a certain known object, judging whether the m+1st segment name is included in the access object name linked list and whether the known object in the matching has a next-stage known object, the method further comprises:
If the accessed object name linked list comprises the m+1st section name and the known object in the matching does not have the next-stage known object, outputting a fault reporting type matching result;
If the m+1st section name is not included in the access object name linked list and the known object in the matching has the 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 a fault reporting type matching result;
Wherein m and a are both positive integers.
6. The method according to claim 5, wherein if the m-th segment name does not match the name of any known object in the database, a match result of the error reporting class is output.
7. The method of claim 5, wherein the name corpus data further comprises dependencies between different known objects;
the matching the m+1st segment name with the name of the known object in the database includes:
determining a next-level known object of the known object matched with the mth segment name;
And matching the m+1st segment name with the name of the next-stage known object based on the matching priority order of the known objects.
8. A database access object name resolution apparatus, comprising:
The name linked list acquisition module is used for acquiring an access object name linked list, wherein the access object name linked list comprises at least one section of names, 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 from high to low of the hierarchy;
the system comprises a corpus data acquisition module, a database and a database, wherein the corpus data acquisition module is used for acquiring name corpus data corresponding to the database, and the name corpus data comprises names and types of known objects in the database;
the order determining module is used for determining the matching priority order of the known objects based on the name corpus data; the lower the known object type level, the higher the matching priority;
the matching module is used for carrying out matching processing on each section of names in the access object name linked list based on the matching priority sequence of the known objects to form a matching result;
the matching module is specifically configured to:
Matching the m-th section name in the access object name linked list with the name of the known object in the database based on the matching priority order of the known object;
If the m-th section name is matched with the name of a certain known object, judging whether the m+1st section name is included in the access object name linked list, and judging whether the known object in the matching has a next-stage known object;
If the m+1st section of name is included in the access object name linked list and the known object in the matching has the next-stage known object, matching the m+1st section of name with the name of the known object in the database; wherein m is a positive integer.
9. An electronic device, comprising: a processor and a memory;
The processor is adapted to perform the steps of the method according to any of claims 1 to 7 by invoking a program or instruction stored in the memory.
10. A computer readable storage medium storing a program or instructions for causing a computer to perform 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 CN112115125A (en) 2020-12-22
CN112115125B true 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)

Families Citing this family (1)

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

Citations (11)

* 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
US7720805B1 (en) * 1999-10-06 2010-05-18 Bmc Software, Inc. Sequential unload processing of IMS databases
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
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
CN109542453A (en) * 2018-11-20 2019-03-29 北京千丁互联科技有限公司 Database information recognition methods, device and terminal
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

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
US8010521B2 (en) * 2009-03-23 2011-08-30 Sap Ag Systems and methods for managing foreign key constraints
US20150242531A1 (en) * 2014-02-25 2015-08-27 International Business Machines Corporation Database access control for multi-tier processing
US9919477B2 (en) * 2015-03-02 2018-03-20 Xerox Corporation Embedding a database in a physical object
US10255307B2 (en) * 2016-06-29 2019-04-09 International Business Machines Corporation Database object management for a shared pool of configurable computing resources
EP3752949A4 (en) * 2018-02-12 2021-11-10 Equifax, Inc. Facilitating entity resolution via secure entity resolution database

Patent Citations (11)

* 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
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
US9659052B1 (en) * 2013-09-26 2017-05-23 Amazon Technologies, Inc. Data object resolver
CN106599111A (en) * 2016-11-30 2017-04-26 上海斐讯数据通信技术有限公司 Data management method and storage system
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
分布式对象名称解析系统的研究与实现;陆耀伟;《信息科技》;全文 *
层次多级联对象名称解析系统的体系架构;陈志辉;吴敏敏;;宜春学院学报;20120825(08);全文 *

Also Published As

Publication number Publication date
CN112115125A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
US10545999B2 (en) Building features and indexing for knowledge-based matching
CN101739335A (en) Recommended application evaluation system
US9229691B2 (en) Method and apparatus for programming assistance
CN110765773A (en) Address data acquisition method and device
Wang et al. Code search via topic-enriched dependence graph matching
JP2020126641A (en) Api mash-up exploration and recommendation
CN113672628A (en) Data blood margin analysis method, terminal device and medium
JP5844824B2 (en) SPARQL query optimization method
CN112115125B (en) Database access object name resolution method and device and electronic equipment
CN113761285A (en) Metadata generation system based on multi-source data
CN111984673A (en) Fuzzy retrieval method and device for tree structure of power grid electric energy metering system
CN113821496B (en) Database migration method, system, device and computer readable storage medium
CN116401145A (en) Source code static analysis processing method and device
US11074401B2 (en) Merging delta object notation documents
CN113434472A (en) File generation method and device, server and storage medium
CN112130860A (en) JSON object analysis method and device, electronic device and storage medium
US20210124799A1 (en) Generation and application of object notation deltas
CN112486499A (en) Method, device, equipment and storage medium for searching target node in TS code
Carme et al. The lixto project: Exploring new frontiers of web data extraction
CN111078671A (en) Method, device, equipment and medium for modifying data table field
CN107818100B (en) SQL statement execution method and device
CN110765100B (en) Label generation method and device, computer readable storage medium and server
CN113947349A (en) Material data processing method and system
CN117725058A (en) Data blood-margin management system and data blood-margin management method
CN117389518A (en) Fine-grained software supply chain construction method for Python open source ecology

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