CN-122019535-A - Metadata restoration method of database and computing device
Abstract
The embodiment of the application discloses a metadata restoration method and computing equipment of a database, and relates to the technical field of databases. The method comprises the steps of determining first identifiers in metadata, wherein the metadata are metadata of tables in a database, the first identifiers are identifiers expressed in abbreviated form in the metadata, determining service functions of the first identifiers based on a first knowledge base and a first target table in the database, wherein the first knowledge base is used for describing the service functions of the tables in the database and the service functions of fields included in the tables in the database, the identifiers of the objects corresponding to the first target table include the first identifiers, the objects are tables and/or the fields included in the tables, and restoring the first identifiers to second identifiers according to the service functions of the first identifiers and the metadata of the first target table, and the second identifiers are the complete form of the first identifiers. Therefore, the efficiency and the accuracy of metadata recovery are improved.
Inventors
- ZHANG BO
- HU BO
Assignees
- 河南秦尉数字技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260104
Claims (10)
- 1. A metadata restoration method for a database, comprising: determining a first identifier in metadata, wherein the metadata is metadata of a table in a database, and the first identifier is an identifier expressed in an abbreviated form in the metadata; Determining a business function of the first identifier based on a first knowledge base and a first target table in the database, wherein the first knowledge base is used for describing the business function of the table in the database and the business function of a field included in the table in the database, and the identifier of an object corresponding to the first target table includes the first identifier; And restoring the first identifier into a second identifier according to the service function of the first identifier and the metadata of the first target table, wherein the second identifier is in a complete form of the first identifier.
- 2. The method of claim 1, wherein the restoring the first identifier to the second identifier based on the business function of the first identifier and the metadata of the first target table comprises: Inputting the business function of the first identifier and the metadata of the first target table into a first model, and acquiring at least two candidate identifiers output by the first model, wherein the candidate identifiers are used for representing the complete form of the predicted first identifier; determining the second identifier from the at least two candidate identifiers based on an evaluation result of the at least two candidate identifiers, the evaluation result being used to indicate a degree of adaptation of the candidate identifier as a complete form of the first identifier; and restoring the first identifier to the second identifier.
- 3. The method of claim 2, wherein prior to the determining the second identifier from the at least two candidate identifiers based on the evaluation of the at least two candidate identifiers, the method further comprises: determining a first business function description of an object corresponding to the first identifier, wherein the first business function description is used for representing a predicted business function description of the object corresponding to a second target table when the candidate identifier is used as the identifier of the object corresponding to the second target table, the identifier of the object corresponding to the second target table comprises the first identifier, and the second target table is different from the first target table; determining the semantic similarity of the first service function description and a second service function description, wherein the second service function description is used for representing the actual service function description of an object corresponding to the second target table; and determining the evaluation results of the at least two candidate identifiers according to the semantic similarity.
- 4. The method of claim 3, wherein the step of, In the case that the object corresponding to the first identifier is a table, the service function description of the object corresponding to the second target table is the service function description of the second target table, the actual service function description of the object corresponding to the second target table is the actual service function description of the second target table, and the object corresponding to the second target table is the second target table; And when the object corresponding to the first identifier is a field, or the object corresponding to the first identifier is a table and a field, the service function description of the object corresponding to the second target table is the service function description of the second target table and the service function description of the field, the actual service function description of the object corresponding to the second target table is the actual service function description of the second target table and the actual service function description of the field, and the object corresponding to the second target table is the second target table and the field.
- 5. The method according to any of claims 1-4, wherein said determining the traffic function of the first identifier based on a first knowledge base and a first target table in the database comprises: Determining a third service function description from the first knowledge base, wherein the third service function description is used for representing the service function description of the object corresponding to the first target table; based on the third service function description, acquiring first basic knowledge of the domain related to the third service function description from a second knowledge base, wherein the second knowledge base is used for describing basic knowledge of the domain related to different service function descriptions; determining the traffic function of the first identifier based on the third traffic function description and the first underlying knowledge.
- 6. The method of claim 5, wherein said determining the traffic function of the first identifier based on the third traffic function description and the first underlying knowledge comprises: and inputting the third service function description and the first basic knowledge into a second model, and obtaining the service function of the first identifier output by the second model.
- 7. The method according to any of claims 1-6, wherein prior to said determining the traffic function of the first identifier based on a first knowledge base and a first target table in the database, the method further comprises: Obtaining target log data, wherein the target log data comprises first log data and second log data, the first log data is used for indicating an execution record of an application associated with the database in response to a target operation, and the second log data is used for indicating a change record of the database in response to the target operation; determining the business field related to the target operation based on the target log data; acquiring second basic knowledge of the service domain from a second knowledge base based on the service domain; Determining an object related to the target operation and a fourth business function description of the object related to the target operation based on the target log data and the second basic knowledge; and generating the first knowledge base according to the object related to the target operation and the fourth business function description of the object related to the target operation.
- 8. The method of claim 7, wherein the obtaining target log data comprises: acquiring a target time stamp when the target operation is executed; acquiring an application log of the application and a change data capture CDC log of the database; and based on the target timestamp, screening out log data corresponding to the target timestamp from the application log and the CDC log as the target log data.
- 9. The method according to claim 7 or 8, wherein said determining, based on said target log data, a traffic domain to which said target operation relates comprises: And inputting the target log data into a third model, and obtaining the service field output by the third model.
- 10. A computing device includes a processor and a memory, the processor coupled to the memory; The memory is used for storing instructions; The processor is configured to execute instructions stored in the memory to cause the computing device to perform the method of any one of claims 1-9.
Description
Metadata restoration method of database and computing device Technical Field The embodiment of the application relates to the technical field of databases, in particular to a metadata restoration method and computing equipment of a database. Background In database designs, identifiers of tables (e.g., table names) or identifiers of fields (e.g., field names) in metadata are often in abbreviated form to improve efficiency of storage and querying. However, this abbreviation increases the difficulty of database interpretation and maintenance, and may also cause data usage errors during database migration due to the inability of the abbreviation to recover. Especially in the absence of complete database documents or annotations, it is difficult for developers to accurately understand the true meaning of the abbreviation, thereby affecting the accuracy of subsequent development and data utilization. The traditional abbreviation completion process lacks automation support and is low in efficiency, particularly when the database is large in scale, and in addition, the abbreviation completion efficiency and accuracy are low under the condition that the database documents are imperfect or missing. Disclosure of Invention The embodiment of the application provides a metadata restoration method and computing equipment of a database, so that the efficiency and accuracy of metadata restoration are improved. In a first aspect, an embodiment of the present application provides a metadata restoration method for a database. The method comprises the steps of determining first identifiers in metadata, wherein the metadata are metadata of tables in a database, the first identifiers are identifiers expressed in abbreviated form in the metadata, determining service functions of the first identifiers based on a first knowledge base and a first target table in the database, wherein the first knowledge base is used for describing the service functions of the tables in the database and the service functions of fields included in the tables in the database, the identifiers of the objects corresponding to the first target table include the first identifiers, the objects are tables and/or the fields included in the tables, and restoring the first identifiers to second identifiers according to the service functions of the first identifiers and the metadata of the first target table, and the second identifiers are the complete form of the first identifiers. Thus, based on the first target table and the first knowledge base (describing the business functions of the table in the database and the business functions of the fields included in the table in the database), the business functions of the first identifier are constructed, the first identifier is given the relevant information of the actual business level, and the metadata of the first target table indicates the relevant information of the table and the fields included in the table at the database level. Based on the service function of the first identifier and the metadata of the first target table, the first identifier is restored to the second identifier in the complete form, so that the restoration result accords with the actual service and the structural design rule of the database, the problem of difficulty in abbreviation interpretation is solved, the data use errors caused by abbreviation misreading are reduced, and the efficiency and accuracy of data abbreviation completion are improved. In one possible implementation, the restoring of the first identifier to the second identifier based on the business function of the first identifier and the metadata of the first target table includes inputting the business function of the first identifier and the metadata of the first target table into a first model, obtaining at least two candidate identifiers output by the first model, the candidate identifiers being used to represent a complete form of the predicted first identifier. The second identifier is determined from the at least two candidate identifiers based on an evaluation result of the at least two candidate identifiers, the evaluation result being indicative of a degree of adaptation of the candidate identifier as a complete form of the first identifier, and the first identifier is restored to the second identifier. In this way, the business function of the first identifier and the metadata of the first target table are input into the first model, so that at least two candidate identifiers generated by the first model fit the actual design rules of the business logic and the metadata of the table. And determining a second identifier from the at least two candidate identifiers based on the evaluation results indicating the at least two candidate identifiers, so that the candidate identifiers which have higher matching degree with the first identifier and accord with the metadata double scene of the business logic and the table can be accurately screened, the candidate iden