[go: up one dir, main page]

CN113886389A - Model document generation method, apparatus, device and storage medium - Google Patents

Model document generation method, apparatus, device and storage medium Download PDF

Info

Publication number
CN113886389A
CN113886389A CN202111155734.3A CN202111155734A CN113886389A CN 113886389 A CN113886389 A CN 113886389A CN 202111155734 A CN202111155734 A CN 202111155734A CN 113886389 A CN113886389 A CN 113886389A
Authority
CN
China
Prior art keywords
model
database
metadata
objects
document
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.)
Pending
Application number
CN202111155734.3A
Other languages
Chinese (zh)
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202111155734.3A priority Critical patent/CN113886389A/en
Publication of CN113886389A publication Critical patent/CN113886389A/en
Pending legal-status Critical Current

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/254Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses

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 present application relates to the field of object storage for data processing, and in particular, to a method and an apparatus for generating a model document, a computer device, and a storage medium. After a model document generation request is obtained, searching corresponding database model data according to the model document generation request; analyzing the database model data to obtain data table metadata, model metadata and index metadata; reconstructing list objects in the database through the data table metadata, reconstructing model objects in the database through the model metadata, and reconstructing index objects in the database through the index metadata; constructing a database project object; and compiling the database project object by adopting a preset document compiling grammar to generate a model document corresponding to the database model data. According to the method and the device, various objects in the database are reconstructed based on the metadata of the database, and then the reconstruction of the project objects of the database is completed based on the various objects, so that the model document is generated, and the output efficiency of the model document is improved.

Description

Model document generation method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating a model document.
Background
With the development of computer technology, database technology is continuously updated. Many databases now provide data analysis capabilities, such as Kylin. ApachekyrinTMIs an open-source and distributed analytical data warehouse provided on a Hadoop/SparkThe SQL query interface and multidimensional analysis capability to support very large scale data. It can look up huge tables in sub-seconds. Kylin provides integration capabilities with a variety of data visualization tools, such as Tableau, PowerBI, etc., that allow users to analyze Hadoop data using the BI (Business Intelligence) tool.
When using these databases, such as Kylin, as a data warehouse, hundreds or thousands of data cube models need to be built to serve data queries of front-end applications. In the databases, each model is composed of concepts such as aggregation groups, dimensions, measurement, computable columns and the like, a front-end application developer needs to correspondingly develop a model document of the database, however, the workload of manually writing the model document is very large, and the database model is often changed and optimized according to requirements and cannot be timely synchronized to the developer. The model document is generated with poor efficiency.
Disclosure of Invention
In view of the above, it is necessary to provide a model document generating method, apparatus, device and storage medium for efficiently generating a model document.
A database model document generation method, the method comprising:
acquiring a model document generation request, and searching corresponding database model data according to the model document generation request;
analyzing the database model data to obtain data table metadata, model metadata and index metadata;
reconstructing list objects in the database through the data table metadata, reconstructing model objects in the database through the model metadata, and reconstructing index objects in the database through the index metadata;
constructing a database item object according to the list object, the model object and the index object;
and compiling the document of the database project object by adopting a preset document compiling grammar to generate a model document corresponding to the database model data.
In one embodiment, the reconstructing the list object in the database through the data table metadata includes:
analyzing a json character string in the data table metadata to obtain list metadata in the json character string;
and instantiating the list object in the generation database according to the list metadata.
In one embodiment, the reconstructing of the model object in the database through the model metadata includes:
analyzing a json character string in the model metadata, and acquiring dimension metadata, measurement metadata and calculable column metadata in the json character string;
and instantiating the dimension metadata, the measurement metadata and the calculable column metadata respectively to generate a model object in a database, and associating the model object with the list object according to a preset identity.
In one embodiment, the reconstructing the index object in the database through the index metadata includes:
and reconstructing an index object in a database through index metadata, and associating the index object with the model object according to a preset identity.
In one embodiment, the constructing the database item object according to the list object, the model object, and the index object includes:
constructing a database data cube object according to the list object, the model object and the index object;
and constructing a database project object according to all database data cube objects corresponding to the database model data.
In one embodiment, the preset document writing grammar includes a Markdown grammar, the document writing of the database item object by using the preset document writing grammar, and the generating of the model document corresponding to the database model data includes:
compiling a document template for the database project object according to the Markdown grammar;
and calling metadata information corresponding to the database project object, and generating a model document corresponding to the database model data according to the document template.
In one embodiment, after the invoking of the metadata information corresponding to the database project object and the generating of the model document corresponding to the database model data according to the document template, the method further includes:
and constructing an object relation graph corresponding to the database model data according to the hierarchical relation corresponding to each object in the database project objects.
An apparatus for generating a database model document, the apparatus comprising:
the data acquisition module is used for acquiring a model document generation request and searching corresponding database model data according to the model document generation request;
the model analysis module is used for analyzing the database model data to obtain data table metadata, model metadata and index metadata;
the object reconstruction module is used for reconstructing list objects in the database through the data table metadata, reconstructing model objects in the database through the model metadata and reconstructing index objects in the database through the index metadata;
the project object construction module is used for constructing database project objects according to the list objects, the model objects and the index objects;
and the model document generation module is used for compiling the document of the database project object by adopting a preset document compiling grammar and generating a model document corresponding to the database model data.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a model document generation request, and searching corresponding database model data according to the model document generation request;
analyzing the database model data to obtain data table metadata, model metadata and index metadata;
reconstructing list objects in the database through the data table metadata, reconstructing model objects in the database through the model metadata, and reconstructing index objects in the database through the index metadata;
constructing a database item object according to the list object, the model object and the index object;
and compiling the document of the database project object by adopting a preset document compiling grammar to generate a model document corresponding to the database model data.
A computer storage medium having a computer program stored thereon, the computer program when executed by a processor implementing the steps of:
acquiring a model document generation request, and searching corresponding database model data according to the model document generation request;
analyzing the database model data to obtain data table metadata, model metadata and index metadata;
reconstructing list objects in the database through the data table metadata, reconstructing model objects in the database through the model metadata, and reconstructing index objects in the database through the index metadata;
constructing a database item object according to the list object, the model object and the index object;
and compiling the document of the database project object by adopting a preset document compiling grammar to generate a model document corresponding to the database model data.
The method comprises the steps of searching corresponding database model data according to a model document generation request after the model document generation request is obtained; analyzing the database model data to obtain data table metadata, model metadata and index metadata; reconstructing list objects in the database through the data table metadata, reconstructing model objects in the database through the model metadata, and reconstructing index objects in the database through the index metadata; constructing a database item object according to the list object, the model object and the index object; and compiling the database project object by adopting a preset document compiling grammar to generate a model document corresponding to the database model data. According to the method and the device, various objects in the database are reconstructed based on the metadata of the database, and then the reconstruction of the project objects of the database is completed based on the various objects, so that the model document is automatically generated, and the output efficiency of the model document is greatly improved.
Drawings
FIG. 1 is a diagram of an application scenario of a model document generation method in one embodiment;
FIG. 2 is a flowchart illustrating a method for generating a model document in one embodiment;
FIG. 3 is a schematic sub-flow chart of step 205 of FIG. 2 in one embodiment;
FIG. 4 is a schematic sub-flow chart of step 205 of FIG. 2 according to another embodiment;
FIG. 5 is a diagram of object relationships corresponding to Kylin model data in one embodiment;
FIG. 6 is a block diagram showing the configuration of a model document generating apparatus in one embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result. The artificial intelligence technology in the application is mainly used for compiling the model document.
The application specifically provides a model document generation method, which can be applied to the application environment shown in fig. 1. Wherein, the terminal 102 can communicate with the model document generation server 104 through the network, and the terminal 102 can send a model document generation request to the model document generation server 104. The model document generation server 104 receives the model document generation request, and searches corresponding database model data according to the model document generation request; analyzing the database model data to obtain data table metadata, model metadata and index metadata; reconstructing list objects in the database through the data table metadata, reconstructing model objects in the database through the model metadata, and reconstructing index objects in the database through the index metadata; constructing a database item object according to the list object, the model object and the index object; and compiling the database project object by adopting a preset document compiling grammar to generate a model document corresponding to the database model data. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the model document generation server 104 may be an independent server, or may be a cloud server that provides basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, web service, cloud communication, middleware service, domain name service, security service, Content Distribution Network (CDN), and a big data and artificial intelligence platform.
In one embodiment, as shown in fig. 2, a model document generation method is provided, which is illustrated by applying the method to the model document generation server 104 in fig. 1, and taking the database as Kylin as an example, and includes the following steps:
step 201, obtaining a model document generation request, and searching corresponding database model data according to the model document generation request.
The model document is used for describing the Kylin cube models, the model document specifically includes data in each Kylin cube model in Kylin, and the model document specifically includes: the Kylin model uses data such as a data source table, a Kylin dimension table, a Kylin metric table, a Kylin computable list, a Kylin aggregation group, a Kylin detail index and the like. The model document generation request is used for requesting the document generation server to automatically analyze the Kylin cube model, so that the model document corresponding to the Kylin cube model is efficiently and accurately generated. The database model data refers to the description objects of the model documents, and is related to the data model constructed based on Kylin.
Specifically, in the present application, a user may request, through a model document generation request, to generate a corresponding model document for a certain specified Kylin item. The document creation server 104 takes the Kylin item as a processing object. At the beginning, the document generation server 104 may export all the Kylin model data files in the currently specified Kylin project to the local according to the project from the Kylin model management interface according to the model document generation request, wherein a project usually contains data of a plurality of Kylin cube models.
Step 203, analyzing the database model data, and acquiring the data table metadata, the model metadata and the index metadata.
Metadata (Metadata), also called intermediate data and relay data, is data describing data, mainly information describing data property (property), and is used to support functions such as indicating storage location, history data, resource search, file record, and the like. Metadata is an electronic catalog, and in order to achieve the purpose of creating a catalog, the contents or features of data must be described and collected, so as to achieve the purpose of assisting data retrieval. While Kylin organizes all its metadata in a hierarchical file system, the metadata includes cube descriptions (cubes), cube instances (instances), projects (projects), inverted index descriptions (inverted descriptions) and instances (instances), jobs (jobs), tables (tables), and dictionaries (dictionary). Kylin does not use a conventional file system to store its metadata, but rather uses HBase for storage.
In particular, the obtained Kylin model data may specifically exist in the form of data compression packets. The document generation server can obtain model files of all the Kylin cube models by analyzing the Kylin model data, then traverses all the model files, analyzes the obtained Kylin model data into three metadata, namely data table metadata, model metadata and index metadata, and then reconstructs the Kylin project object through the three metadata.
Step 205, the list objects in the database are reconstructed by the data table metadata, the model objects in the database are reconstructed by the model metadata, and the index objects in the database are reconstructed by the index metadata.
Analyzing the Kylin model data, and acquiring data table metadata, model metadata and index metadata which are specifically used for reconstructing different types of objects in Kylin. The data Table metadata is used to reconstruct list objects in Kylin, including Table objects and Column objects. The model metadata is used to reconstruct the model objects in Kylin, including the Demension object, the Measure object, and the ComputeColumn object. The index metadata is then used to reconstruct the index objects in Kylin, including the AggGroupIndex object and the DetailIndex object. By reconstructing different objects in the Kylin cube model, a Kylin cube object of a higher level can be constructed based on the objects.
Step 207, construct database item objects according to the list objects, model objects, and index objects.
And 209, performing document writing on the database project object by adopting a preset document writing grammar, and generating a model document corresponding to the database model data.
The default document authoring grammar may specifically be a Markdown grammar, which is a lightweight markup language that allows people to author documents using a plain text format that is easy to read and write, and then convert to valid XHTML (or HTML) documents. Because of the lightweight, easy-to-read and easy-to-write characteristics of Markdown, and the support for pictures, charts and mathematical expressions, Markdown is widely used by many websites to write help documents or to publish messages in forums.
Specifically, by reconstructing different objects in the Kylin cube model, a Kylin cube object and a Kylin project object at a higher level can be constructed based on the objects. Thereby completing the preparation for reconstruction of the model document. And then, document writing can be carried out on the Kylin project object by adopting a preset document writing grammar to generate a model document corresponding to the Kylin model data. Specifically, a template of a document style can be written for the project object according to a preset document writing grammar, then the reconstructed metadata information of the project object is called, a model document of each Kylin cube model in the Kylin project object is generated by taking Kylin cubes as a unit, and the model documents of all Kylin cube models are combined into a model document corresponding to Kylin model data.
The method comprises the steps of searching corresponding database model data according to a model document generation request after the model document generation request is obtained; analyzing the database model data to obtain data table metadata, model metadata and index metadata; reconstructing list objects in the database through the data table metadata, reconstructing model objects in the database through the model metadata, and reconstructing index objects in the database through the index metadata; constructing a database item object according to the list object, the model object and the index object; and compiling the database project object by adopting a preset document compiling grammar to generate a model document corresponding to the database model data. According to the method and the device, various objects in the database are reconstructed based on the metadata of the database, and then the reconstruction of the project objects of the database is completed based on the various objects, so that the model document is automatically generated, and the output efficiency of the model document is greatly improved.
In one embodiment, as shown in FIG. 3, step 205 comprises:
step 302, analyzing a json character string in the metadata of the data table to obtain list metadata in the json character string.
Step 304, instantiating the list object in the production database according to the list metadata.
The list object specifically includes a Table object and a Column object. Specifically, in the process of reconstructing the list object, a json character string corresponding to the data Table metadata may be analyzed, list metadata in the json character string is obtained, and specifically, the list metadata includes metadata of types such as a Table name, a field type, a field comment and the like, and a Table object and a Column object are instantiated and generated according to the list metadata, where the instantiation generation specifically is to set a corresponding Table name for the Table object, set the field name, the field type, the field comment and the like as attributes of the Column object, and set the attributes of the Column object as attributes of the Column object. In this embodiment, the list object in Kylin is generated by instantiating the list metadata, so that the validity of the list object reconstruction process can be effectively ensured.
In one embodiment, as shown in FIG. 4, step 205 comprises:
step 401, analyzing the json character string in the model metadata, obtaining dimension metadata and measurement metadata in the json character string, and calculating column metadata.
Step 403, instantiating the dimension metadata, the measurement metadata and the computable column metadata to generate a model object in the database, and associating the model object with the list object according to the preset identity.
The list objects specifically comprise a maintenance object, a Measure object and a ComputeColumn object, the server can firstly analyze json character strings in model metadata, acquire dimension metadata, measurement metadata and computable Column metadata in the json character strings, respectively instantiate the metadata into the maintenance object, the Measure object and the ComputeColumn object, and associate the Column objects in the list objects through preset identity identifiers. In this embodiment, the model object in Kylin is generated by instantiating the model metadata, so that the validity of the model object reconstruction process can be effectively ensured.
In one embodiment, step 205 comprises: and reconstructing an index object in the Kylin through the index metadata, and associating the index object with the model object according to the preset identity.
The index objects specifically include AggGroupIndex objects and DetailIndex objects. Specifically, the document generation server 104 instantiates the corresponding metadata into an AggGroupIndex object and a DetailIndex object respectively by analyzing a json character string in the index metadata, and then refers to a dimension object, a Measure object, and a ComputeColumn object in the model object in the index object by using a preset identity. In this embodiment, the index object in the Kylin is generated by instantiating the index data, so that the validity of the index object reconstruction process can be effectively ensured.
In one embodiment, step 207 comprises: constructing a database data cube object according to the list object, the model object and the index object; and constructing a database project object according to all database data cube objects corresponding to the database model data.
Specifically, after the list object, the model object, and the index object, i.e., the default object, the Measure object, the ComputeColumn object, the aggggroupindex object, and the DetailIndex object, are generated by reconstruction, a Kylin cube object may be instantiated according to the objects, and the default attribute, the Measure attribute, the ComputeColumn attribute, the aggggroupindex attribute, and the DetailIndex attribute of the Kylin cube object are respectively set according to the list object, the model object, and the index object. These attributes correspond one-to-one to the above objects, respectively. The method is circulated for many times, all the Kylin cube objects in the project can be constructed, and then the Kylin project object can be constructed based on all the Kylin cube objects. In the implementation, the Kylin cube object is constructed firstly, and then the whole Kylin project object is created based on the Kylin cube object, so that the effectiveness of creating the project object can be ensured.
In one embodiment, the preset document writing grammar includes a Markdown grammar, document writing is performed on the Kylin project object by using the preset document writing grammar, and generating a model document corresponding to Kylin model data includes: compiling a document template for the Kylin project object according to the Markdown grammar; and calling metadata information corresponding to the Kylin project object, and generating a model document corresponding to the Kylin model data according to the document template.
Markdown, among other things, is a lightweight markup language that allows people to compose documents using a plain text format that is easy to read and write, and then convert to valid XHTML (or HTML) documents. Because of the lightweight, easy-to-read and easy-to-write characteristics of Markdown, and the support for pictures, charts and mathematical expressions, Markdown is widely used by many websites to write help documents or to publish messages in forums. According to the scheme, a template of a document style is compiled for each Kylin project object through a Markdown grammar, and then metadata information corresponding to the Kylin project object is called to generate a model document corresponding to the Kylin model. In this embodiment, the model document corresponding to the Kylin model data can be generated more efficiently by the Markdown grammar.
In one embodiment, after invoking metadata information corresponding to a database project object and generating a model document corresponding to database model data according to a document template, the method further includes: and constructing an object relation graph corresponding to database model data according to the hierarchical relation corresponding to each object in the database item objects.
Specifically, after the model document corresponding to the Kylin model data is generated, in order to more intuitively show the structural relationship of the Kylin project object, an object relationship diagram corresponding to the Kylin model data can be constructed according to the hierarchical relationship corresponding to each object in the Kylin project object. The schema of the object relationship graph may specifically refer to fig. 5, where the top layer is a Kylin item object, next, each Kylin cube object constituting the item object, and then, next, an object such as an index and the like at a lower level. Specifically, when constructing the object relationship diagram, first determining that the top level in the pair relationship diagram is a Kylin item object, where one Kylin item object includes several Kylin cube objects. Thus, after determining the Kylin item object, the next level Kylin cube object of the item object may be listed. For each Kylin cube object, the corresponding model construction data comprises dimension metadata, measurement metadata and calculable column metadata, and the data are associated with the Kylin cube object based on the aggregation group index. The aggregation group index and the detail index which can be regarded as the directory serve as the next level object of the Kylin cube object, and the dimension metadata, the measurement metadata and the computable column metadata serve as the next level object of the index, so that the construction of the object relation graph can be completed. In this embodiment, the structural hierarchical relationship of the objects in the Kylin model can be effectively shown by constructing the object relationship diagram.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 6, there is provided a model document generating apparatus including:
the data obtaining module 601 is configured to obtain a model document generation request, and search for corresponding database model data according to the model document generation request.
The model parsing module 603 is configured to parse the database model data to obtain the data table metadata, the model metadata, and the index metadata.
An object reconstruction module 605 for reconstructing the list objects in the database through the data table metadata, the model objects in the database through the model metadata, and the index objects in the database through the index metadata.
And a project object construction module 607 for constructing database project objects according to the list object, the model object and the index object.
And the model document generating module 609 is configured to perform document writing on the database project object by using a preset document writing syntax, and generate a model document corresponding to the database model data.
In one embodiment, the object reconstruction module 605 is specifically configured to: analyzing a json character string in the metadata of the data table to obtain list metadata in the json character string; the list objects in the production database are instantiated according to the list metadata.
In one embodiment, the object reconstruction module 605 is specifically configured to: analyzing a json character string in the model metadata, and acquiring dimension metadata, measurement metadata and calculable column metadata in the json character string; and respectively instantiating the dimension metadata, the measurement metadata and the computable column metadata to generate a model object in the database, and associating the model object with the list object according to the preset identity.
In one embodiment, the object reconstruction module 605 is specifically configured to: and reconstructing an index object in the database through the index metadata, and associating the index object with the model object according to the preset identity.
In one embodiment, the project object construction module 607 is specifically configured to: constructing a database data cube object according to the list object, the model object and the index object; and constructing a database project object according to all database data cube objects corresponding to the database model data.
In one embodiment, the model document generation module 609 is specifically configured to: compiling a document template for the database project object according to the Markdown grammar; and calling metadata information corresponding to the database project object, and generating a model document corresponding to the database model data according to the document template.
In one embodiment, the system further comprises a relationship graph building module, configured to: and constructing an object relation graph corresponding to database model data according to the hierarchical relation corresponding to each object in the database item objects.
For specific embodiments of the model document generation apparatus, reference may be made to the above embodiments of the model document generation method, which are not described herein again. The modules in the model document generation device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing model document generation data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a model document generation method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
acquiring a model document generation request, and searching corresponding database model data according to the model document generation request;
analyzing the database model data to obtain data table metadata, model metadata and index metadata;
reconstructing list objects in the database through the data table metadata, reconstructing model objects in the database through the model metadata, and reconstructing index objects in the database through the index metadata;
constructing a database item object according to the list object, the model object and the index object;
and compiling the database project object by adopting a preset document compiling grammar to generate a model document corresponding to the database model data.
In one embodiment, the processor, when executing the computer program, further performs the steps of: analyzing a json character string in the metadata of the data table to obtain list metadata in the json character string; the list objects in the production database are instantiated according to the list metadata.
In one embodiment, the processor, when executing the computer program, further performs the steps of: analyzing a json character string in the model metadata, and acquiring dimension metadata, measurement metadata and calculable column metadata in the json character string; and respectively instantiating the dimension metadata, the measurement metadata and the computable column metadata to generate a model object in the database, and associating the model object with the list object according to the preset identity.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and reconstructing an index object in the database through the index metadata, and associating the index object with the model object according to the preset identity.
In one embodiment, the processor, when executing the computer program, further performs the steps of: constructing a database data cube object according to the list object, the model object and the index object; and constructing a database project object according to all database data cube objects corresponding to the database model data.
In one embodiment, the processor, when executing the computer program, further performs the steps of: compiling a document template for the database project object according to the Markdown grammar; and calling metadata information corresponding to the database project object, and generating a model document corresponding to the database model data according to the document template.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and constructing an object relation graph corresponding to database model data according to the hierarchical relation corresponding to each object in the database item objects.
In one embodiment, a computer storage medium is provided, having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of:
acquiring a model document generation request, and searching corresponding database model data according to the model document generation request;
analyzing the database model data to obtain data table metadata, model metadata and index metadata;
reconstructing list objects in the database through the data table metadata, reconstructing model objects in the database through the model metadata, and reconstructing index objects in the database through the index metadata;
constructing a database item object according to the list object, the model object and the index object;
and compiling the database project object by adopting a preset document compiling grammar to generate a model document corresponding to the database model data.
In one embodiment, the computer program when executed by the processor further performs the steps of: analyzing a json character string in the metadata of the data table to obtain list metadata in the json character string; the list objects in the production database are instantiated according to the list metadata.
In one embodiment, the computer program when executed by the processor further performs the steps of: analyzing a json character string in the model metadata, and acquiring dimension metadata, measurement metadata and calculable column metadata in the json character string; and respectively instantiating the dimension metadata, the measurement metadata and the computable column metadata to generate a model object in the database, and associating the model object with the list object according to the preset identity.
In one embodiment, the computer program when executed by the processor further performs the steps of: and reconstructing an index object in the database through the index metadata, and associating the index object with the model object according to the preset identity.
In one embodiment, the computer program when executed by the processor further performs the steps of: constructing a database data cube object according to the list object, the model object and the index object; and constructing a database project object according to all database data cube objects corresponding to the database model data.
In one embodiment, the computer program when executed by the processor further performs the steps of: compiling a document template for the database project object according to the Markdown grammar; and calling metadata information corresponding to the database project object, and generating a model document corresponding to the database model data according to the document template.
In one embodiment, the computer program when executed by the processor further performs the steps of: and constructing an object relation graph corresponding to database model data according to the hierarchical relation corresponding to each object in the database item objects.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1.一种模型文档生成方法,所述方法包括:1. A method for generating a model document, the method comprising: 获取模型文档生成请求,根据模型文档生成请求查找对应的数据库模型数据;Obtain the model document generation request, and find the corresponding database model data according to the model document generation request; 解析数据库模型数据,获取数据表元数据、模型元数据以及索引元数据;Parse database model data to obtain data table metadata, model metadata and index metadata; 通过数据表元数据重建数据库中的列表对象、通过模型元数据重建数据库中的模型对象、并通过索引元数据重建数据库中的索引对象;Rebuild list objects in the database through data table metadata, rebuild model objects in the database through model metadata, and rebuild index objects in the database through index metadata; 根据列表对象、模型对象以及索引对象,构建数据库项目对象;Build database item objects based on list objects, model objects, and index objects; 采用预设文档编写语法对所述数据库项目对象进行文档编写,生成所述数据库模型数据对应的模型文档。Document writing is performed on the database item object using a preset document writing syntax, and a model document corresponding to the database model data is generated. 2.根据权利要求1所述的方法,其特征在于,所述通过数据表元数据重建数据库中的列表对象包括:2. The method according to claim 1, wherein the rebuilding the list objects in the database through data table metadata comprises: 解析所述数据表元数据中的json字符串,获取所述json字符串中的列表元数据;Parse the json string in the metadata of the data table, and obtain the list metadata in the json string; 根据所述列表元数据实例化生成数据库中的列表对象。The list object in the database is instantiated and generated according to the list metadata. 3.根据权利要求1所述的方法,其特征在于,所述通过模型元数据重建数据库中的模型对象包括:3. The method according to claim 1, wherein the reconstructing the model objects in the database through model metadata comprises: 解析所述模型元数据中的json字符串,获取所述json字符串中的维度元数据、度量元数据以及可计算列元数据;Parse the json string in the model metadata to obtain dimension metadata, metric metadata and computable column metadata in the json string; 分别将所述维度元数据、所述度量元数据以及所述可计算列元数据实例化,以生成数据库中的模型对象,根据预设身份标识关联所述模型对象与所述列表对象。The dimension metadata, the metric metadata and the computable column metadata are respectively instantiated to generate a model object in the database, and the model object and the list object are associated according to a preset identity. 4.根据权利要求1所述的方法,其特征在于,所述通过索引元数据重建数据库中的索引对象包括:4. The method according to claim 1, wherein the rebuilding the index objects in the database by index metadata comprises: 通过索引元数据重建数据库中的索引对象,根据预设身份标识关联所述索引对象与所述模型对象。The index objects in the database are reconstructed through the index metadata, and the index objects and the model objects are associated according to the preset identity identifiers. 5.根据权利要求1所述的方法,其特征在于,所述根据列表对象、模型对象以及索引对象,构建数据库项目对象包括:5. The method according to claim 1, wherein the building a database item object according to a list object, a model object and an index object comprises: 根据列表对象、模型对象以及索引对象构建数据库数据立方对象;Build database data cube objects from list objects, model objects and index objects; 根据所述数据库模型数据所对应的所有数据库数据立方对象构建数据库项目对象。A database item object is constructed according to all database data cube objects corresponding to the database model data. 6.根据权利要求1所述的方法,其特征在于,所述预设文档编写语法包括Markdown语法,所述采用预设文档编写语法对所述数据库项目对象进行文档编写,生成所述数据库模型数据对应的模型文档包括:6. The method according to claim 1, wherein the preset document writing syntax comprises Markdown syntax, and the database item object is written by using the preset document writing syntax to generate the database model data The corresponding model documentation includes: 根据Markdown语法,为所述数据库项目对象编写文档模板;Write a document template for the database item object according to the Markdown syntax; 调用所述数据库项目对象对应的元数据信息,根据所述文档模板生成所述数据库模型数据对应的模型文档。The metadata information corresponding to the database item object is called, and a model document corresponding to the database model data is generated according to the document template. 7.根据权利要求1所述的方法,其特征在于,所述调用所述数据库项目对象对应的元数据信息,根据所述文档模板生成所述数据库模型数据对应的模型文档之后,还包括:7. The method according to claim 1, wherein after invoking the metadata information corresponding to the database item object, after generating the model document corresponding to the database model data according to the document template, the method further comprises: 根据所述数据库项目对象中各个对象对应的层次关系,构建所述数据库模型数据对应的对象关系图。According to the hierarchical relationship corresponding to each object in the database item object, an object relationship diagram corresponding to the database model data is constructed. 8.一种模型文档生成装置,其特征在于,所述装置包括:8. An apparatus for generating a model document, wherein the apparatus comprises: 数据获取模块,用于获取模型文档生成请求,根据模型文档生成请求查找对应的数据库模型数据;The data acquisition module is used to acquire the model document generation request, and find the corresponding database model data according to the model document generation request; 模型解析模块,用于解析数据库模型数据,获取数据表元数据、模型元数据以及索引元数据;Model parsing module, used to parse database model data, obtain data table metadata, model metadata and index metadata; 对象重建模块,用于通过数据表元数据重建数据库中的列表对象、通过模型元数据重建数据库中的模型对象、并通过索引元数据重建数据库中的索引对象;The object reconstruction module is used to reconstruct the list objects in the database through the data table metadata, rebuild the model objects in the database through the model metadata, and rebuild the index objects in the database through the index metadata; 项目对象构建模块,用于根据列表对象、模型对象以及索引对象,构建数据库项目对象;The project object building module is used to construct database project objects according to list objects, model objects and index objects; 模型文档生成模块,用于采用预设文档编写语法对所述数据库项目对象进行文档编写,生成所述数据库模型数据对应的模型文档。The model document generation module is configured to use a preset document writing syntax to document the database item object, and generate a model document corresponding to the database model data. 9.一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至7中任一项所述方法的步骤。9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when the processor executes the computer program . 10.一种计算机存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的方法的步骤。10. A computer storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
CN202111155734.3A 2021-09-29 2021-09-29 Model document generation method, apparatus, device and storage medium Pending CN113886389A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111155734.3A CN113886389A (en) 2021-09-29 2021-09-29 Model document generation method, apparatus, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111155734.3A CN113886389A (en) 2021-09-29 2021-09-29 Model document generation method, apparatus, device and storage medium

Publications (1)

Publication Number Publication Date
CN113886389A true CN113886389A (en) 2022-01-04

Family

ID=79004421

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111155734.3A Pending CN113886389A (en) 2021-09-29 2021-09-29 Model document generation method, apparatus, device and storage medium

Country Status (1)

Country Link
CN (1) CN113886389A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614085A (en) * 2018-10-23 2019-04-12 深圳微迅信息科技有限公司 Function realizing method, device, computer equipment and storage medium
CN113227998A (en) * 2018-12-28 2021-08-06 甲骨文国际公司 Technology for comprehensively supporting autonomous JSON document object (AJD) cloud service

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614085A (en) * 2018-10-23 2019-04-12 深圳微迅信息科技有限公司 Function realizing method, device, computer equipment and storage medium
CN113227998A (en) * 2018-12-28 2021-08-06 甲骨文国际公司 Technology for comprehensively supporting autonomous JSON document object (AJD) cloud service

Similar Documents

Publication Publication Date Title
WO2024230117A1 (en) Question answering method and apparatus, and electronic device, computer-readable storage medium and computer program product
CN111414350B (en) Service generation method and device
CN108027818A (en) Inquiry based on figure
Hasani et al. Lambda architecture for real time big data analytic
Narkhede et al. HMR log analyzer: Analyze web application logs over Hadoop MapReduce
US10402486B2 (en) Document conversion, annotation, and data capturing system
US10397326B2 (en) IRC-Infoid data standardization for use in a plurality of mobile applications
US20180150530A1 (en) Method, Apparatus, Computing Device and Storage Medium for Analyzing and Processing Data
CN109213775B (en) Search method, search device, computer equipment and storage medium
US11232105B2 (en) Unified metrics computation platform
CN116226159A (en) Metadata blood-edge relationship analysis method, system, equipment and storage medium
James et al. Hybrid database system for big data storage and management
Pelekh et al. Design of a system for dynamic integration of weakly structured data based on mash-up technology
Meenachi et al. Web ontology language editors for semantic web-a survey
CN105930354A (en) Storage model conversion method and device
Antonov et al. Development and implementation of the Algo500 scalable digital platform architecture
Chen et al. An optimized data integration model based on reverse cleaning for heterogeneous multi-media data
CN113886389A (en) Model document generation method, apparatus, device and storage medium
CN111638926A (en) Method for realizing artificial intelligence in Django framework
CN113051403A (en) Database fault handling knowledge graph construction method and device and computer equipment
Paneva-Marinova et al. Intelligent Data Curation in Virtual Museum for Ancient History and Civilization
CN114356945A (en) Data processing method, data processing device, computer equipment and storage medium
Tarasiev et al. Developing Prototype of CASE-Tool to Create Automation Systems Based on Web Applications Using Code Generation
Galpin et al. Curating Covid-19 Data in Links
Stephan et al. A scientific data provenance harvester for distributed applications

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