Data model management method, device and equipment

By automatically managing changes between the logical model and the physical model of the data warehouse, the cumbersome problem of manually generating change statements when the logical model structure changes is solved, the efficiency and quality of physical model generation is improved, and the frequent model changes in application scenarios are adapted to need.

CN114490578BActive Publication Date: 2025-02-18ALIBABA CLOUD COMPUTING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210074335.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-21
Publication Date
2025-02-18
Estimated Expiration
2042-01-21

AI Technical Summary

Technical Problem

During the development of data models, the structure of the logical model changes frequently, resulting in the need to manually generate change statements to adjust the physical table structure. The process is cumbersome and repetitive. As the application scenarios and data increase, the workload also increases.

Method used

By obtaining the logical model corresponding to the data warehouse, when the logical model structure changes, a first physical model corresponding to the logical model before the change is determined, and the first physical model is managed based on the structural change operation to obtain and change The second physical model corresponding to the logical model.

Benefits of technology

It realizes that when the logical model structure is frequently changed, the physical table structure can be adjusted without manually generating change statements, which improves the quality and efficiency of physical model generation, reduces the development workload, and meets the frequent model changes requirements in application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114490578B_ABST
    Figure CN114490578B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a data model management method, device and equipment, the management method includes: obtaining a logical model corresponding to a data warehouse; when the structure of the logical model changes, determining a first physical model corresponding to the logical model before the change; managing the first physical model based on the structural change operation corresponding to the logical model to obtain a second physical model corresponding to the changed logical model. The technical solution provided by this embodiment effectively realizes that when the structure of the logical model changes, there is no need to manually generate change statements to adjust the physical table structure. The physical model can be automatically managed based on the structural change operation of the logical model to obtain a physical model corresponding to the changed logical model, that is, it can help users automatically implement the logical model to the physical model, which not only reduces the development workload of the physical model, but also can meet the frequent model change requirements in application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data warehouse, and in particular to a data model management method, device and equipment. Background Art

[0002] The data model uses structured language to comprehensively analyze the data requirements used in organizational scenario operations, management, and decision-making, and reorganizes the requirements according to the model design specifications. From the perspective of the content granularity covered by the model, data models can generally be divided into subject domain models, conceptual models, logical models, and physical models. Among them, the subject domain model is the highest-level model with subject concepts and their relationships as basic components. The subject is a highly abstract concept of the essence of things expressed by data; the conceptual model is a model with data entities and their relationships as basic components, and the entity names are generally named using standard terms; the logical model is a refinement based on the conceptual model, with data attributes as basic components; the physical model is the data structure of the logical model in the computer information system relying on specific implementation tools.

[0003] Model management mainly provides functions such as data model hierarchy (logical stratification, subject domain, concept classification, etc.), logical model, and physical model design. In the actual development process, the logical model is often connected to multiple physical storage systems. However, during the development stage of the data model, the structure of the logical model may change frequently, such as adding fields, modifying fields, deleting fields, and changing table names. Each change requires the user to manually generate change statements to adjust the physical table structure, which is not only cumbersome and repetitive, but also, with the continuous increase of application scenarios and application data, the workload will also increase synchronously. Summary of the invention

[0004] The embodiments of the present invention provide a data model management method, device and equipment. When the structure of a logical model changes frequently, there is no need to manually generate change statements to adjust the physical table structure each time, thereby improving the quality and efficiency of physical model generation.

[0005] In a first aspect, an embodiment of the present invention provides a data model management method, including:

[0006] Obtain the logical model corresponding to the data warehouse;

[0007] When the structure of the logical model changes, determining a first physical model corresponding to the logical model before the change;

[0008] The first physical model is managed based on the structural change operation corresponding to the logical model to obtain a second physical model corresponding to the changed logical model.

[0009] In a second aspect, an embodiment of the present invention provides a data model management device, including:

[0010] The first acquisition module is used to acquire the logical model corresponding to the data warehouse;

[0011] A first determination module, configured to determine, when the structure of the logical model changes, a first physical model corresponding to the logical model before the change;

[0012] The first processing module is used to manage the first physical model based on the structural change operation corresponding to the logical model to obtain a second physical model corresponding to the changed logical model.

[0013] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the data model management method in the above-mentioned first aspect.

[0014] In a fourth aspect, an embodiment of the present invention provides a computer storage medium for storing a computer program, wherein the computer program enables a computer to implement the data model management method in the first aspect when executed.

[0015] In a fifth aspect, an embodiment of the present invention provides a computer program product, comprising: a computer program, which, when executed by a processor of an electronic device, enables the processor to execute the steps in the data model management method in the above-mentioned first aspect.

[0016] The data model management method, device and equipment provided in the present embodiment obtains the logical model corresponding to the data warehouse, and when the structure of the logical model changes, determines the first physical model corresponding to the logical model before the change; then manages the first physical model based on the structural change operation corresponding to the logical model, so as to obtain the second physical model corresponding to the logical model after the change. This effectively realizes that when the structure of the logical model changes frequently, there is no need to manually generate change statements to adjust the physical table structure each time, but the physical model can be automatically managed based on the structural change operation of the logical model, thereby effectively helping users to automatically implement the logical model to the physical model, reducing the development workload of the physical model, and at the same time meeting the frequent model change requirements in the application scenario, further improving the practicality of the method, and facilitating market promotion and application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 A schematic diagram of a scenario of a data model management method provided by an embodiment of the present invention;

[0019] Figure 2 A flowchart of a data model management method provided by an embodiment of the present invention;

[0020] Figure 3 A flowchart of another data model management method provided by an embodiment of the present invention;

[0021] Figure 4 A schematic diagram of a process for managing the first physical model based on a structural change operation corresponding to the logical model provided in an embodiment of the present invention;

[0022] Figure 5 A flowchart of another data model management method provided by an embodiment of the present invention;

[0023] Figure 6 A structural block diagram of a data model management system provided by an application embodiment of the present invention;

[0024] Figure 7 A principle block diagram of a data model management method provided by an application embodiment of the present invention;

[0025] Figure 8 A schematic diagram of the structure of a data model management device provided by an embodiment of the present invention;

[0026] Fig. 9 for Figure 8 A schematic diagram of the structure of an electronic device corresponding to the management device of the data model shown. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0028] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two, but does not exclude the inclusion of at least one.

[0029] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0030] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0031] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a product or system. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the product or system including the elements.

[0032] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.

[0033] In the actual development process of the data model, the following problems exist: developers need to generate corresponding table creation statements for different storages and implement physicalization. At the same time, when the structure of the logical model changes frequently, each change requires manual generation of change statements to adjust the physical table structure. This is not only cumbersome and repetitive, but also, with the continuous increase of applications and application data, the workload will also increase synchronously. Therefore, in order to solve the above technical problems, this embodiment proposes a data model management method, device and equipment. The execution subject of the above data model management method can be a data model management device, and the data model management device can be connected to the request end (client) for communication. Figure 1 As shown:

[0034] Among them, the requester / client can be any computing device with a certain data transmission capability. In addition, the basic structure of the requester / client may include: at least one processor. The number of processors depends on the configuration and type of the client. The client may also include a memory, which may be volatile, such as RAM, or non-volatile, such as read-only memory (ROM), flash memory, etc., or may include both types at the same time. The memory usually stores an operating system (OS), one or more application programs, and may also store program data, etc. In addition to the processing unit and the memory, the client also includes some basic configurations, such as a network card chip, an IO bus, a display component, and some peripheral devices, etc. Optionally, some peripheral devices may include, for example, a keyboard, a mouse, an input pen, a printer, etc. Other peripheral devices are well known in the art and will not be described in detail here.

[0035] The data model management device refers to a device that can provide data model management services in a network virtual environment, and usually refers to a device that uses the network to perform information planning and data model management operations. In physical implementation, the data model management device can be any device that can provide computing services, respond to service requests, and perform processing, such as a cluster server, a conventional server, a cloud server, a cloud host, a virtual center, etc. The data model management device mainly includes a processor, a hard disk, a memory, a system bus, etc., which is similar to a general computer architecture.

[0036] In the above embodiment, the requesting end can establish a network connection with the management device of the data model, and the network connection can be a wireless or wired network connection. If the requesting end and the management device of the data model are connected by communication, the network standard of the mobile network can be any one of 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G+ (LTE+), WiMax, 5G, etc.

[0037] In an embodiment of the present application, the request end can generate or obtain a logical model corresponding to the data warehouse. Specifically, the request end can be provided with an interactive interface, and the user can input and execute operations on the interactive interface, and the logical model corresponding to the data warehouse can be generated by executing the operations; or, the request end can be provided with a data transmission interface, and the logical model corresponding to the data warehouse can also be obtained through the data transmission interface. After obtaining the logical model corresponding to the data warehouse, in order to implement the management operation of the data model, the logical model can be sent to the management device of the data model.

[0038] A data model management device is used to receive or obtain a logical model corresponding to a data warehouse sent by a requesting end. After obtaining the logical model, the structure of the logical model can be analyzed and processed to detect whether the structure of the logical model has changed. In some instances, "detecting whether the structure of the logical model has changed" can be achieved by "detecting whether the database schema definition language DDL statements included in the logical table corresponding to the logical model have changed". Specifically, when the DDL statements in the logical table have changed, it can be determined that the structure of the logical model has changed; when the DDL statements in the logical table have not changed, it can be determined that the results of the logical model have not changed.

[0039] When the structure of the logical model changes, the first physical model corresponding to the logical model before the change can be obtained. Since the structure of the logical model has changed, the first physical model may not correspond to the logical model after the change. In order to achieve normal physical operation of the data warehouse, the first physical model can be managed based on the structural change operation corresponding to the logical model. The management of the first physical model based on the structural change operation mainly includes: adjusting the first physical model based on the structural change operation to obtain the second physical model corresponding to the logical model after the change, thereby effectively achieving that the physical model can automatically change with the change of the logical model.

[0040] The technical solution provided in this embodiment obtains the logical model corresponding to the data warehouse, and when the structure of the logical model changes, determines the first physical model corresponding to the logical model before the change; manages the first physical model based on the structural change operation corresponding to the logical model, so as to obtain the second physical model corresponding to the changed logical model, and effectively realizes that when the logical model changes, the physical model can be changed automatically. This not only helps users to automatically implement the logical model to the physical model and reduce the development workload of the physical model, but also can meet the frequent change requirements in the application scenario, further improves the practicality of the method, and is conducive to market promotion and application.

[0041] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and the features in the embodiments can be combined with each other. In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.

[0042] Figure 2 A flow chart of a data model management method provided by an embodiment of the present invention; Figure 2As shown, this embodiment provides a data model management method. The execution subject of the method may be a data model management device. It can be understood that the data model management device may be implemented as software, or a combination of software and hardware. Specifically, the data model management method mainly implements the management operation of the physical model through the change operation of the logical model. Specifically, the method may include the following steps:

[0043] Step S201: Acquire the logical model corresponding to the data warehouse.

[0044] Step S202: when the structure of the logical model is changed, determining a first physical model corresponding to the logical model before the change.

[0045] Step S203: managing the first physical model based on the structural change operation corresponding to the logical model to obtain a second physical model corresponding to the changed logical model.

[0046] The following is a detailed description of each of the above steps:

[0047] Step S201: Acquire the logical model corresponding to the data warehouse.

[0048] The data warehouse may be a pre-established data model or a data model being established. A data warehouse may correspond to one or more logical models, that is, the number of acquired logical models may be one or more, and the logical model may be embodied by a logical table including multiple database schema definition language DDL statements. When the number of logical models corresponding to the data warehouse is multiple, the management operation of the data model may be implemented sequentially through multiple logical models.

[0049] Specifically, when the data warehouse is a pre-established data model, the data model corresponding to the data warehouse at this time may include a subject domain model, a conceptual model, a logical model and a physical model. In order to be able to implement management operations on the data model, the logical model corresponding to the data warehouse can be obtained. At this time, the logical model can be stored in a preset area, and the logical model corresponding to the data warehouse can be obtained by accessing the preset area.

[0050] When the data warehouse is a data model being established, the logical model corresponding to the data warehouse can be a model that has been established or a model that is being established. In order to implement management operations on the data model, the logical model corresponding to the data warehouse can be obtained. When the logical model corresponding to the data warehouse is a model that has been established, the logical model can be stored in a preset area, and the logical model corresponding to the data warehouse can be obtained by accessing the preset area. When the logical model corresponding to the data warehouse is a model being established, an interactive interface for establishing the logical model can be obtained, the execution operation input by the user in the interactive interface can be obtained, and the logical model corresponding to the data warehouse can be obtained based on the execution operation.

[0051] In some other instances, the data model management device is communicatively connected to a third device (for example, a requesting end or a client), and the third device stores a logical model corresponding to the data warehouse. In order to enable the third device to perform management operations on the data model, the third device can actively or passively send the logical model corresponding to the data warehouse to the data model management device, so that the data model management device can stably obtain the logical model to be analyzed and processed.

[0052] Step S202: when the structure of the logical model is changed, determining a first physical model corresponding to the logical model before the change.

[0053] After the logical model is obtained, the structure of the logical model may be analyzed and processed to detect whether the structure of the logical model has changed. In some instances, detecting whether the structure of the logical model has changed may include: obtaining a historical moment structure and a current moment structure corresponding to the logical model, and detecting whether the structure of the logical model has changed based on the historical moment structure and the current moment structure.

[0054] Specifically, the structure of the logical model can be reflected by the logical table corresponding to the logical model. Therefore, obtaining the historical moment structure of the logical model may include: obtaining the historical moment logical table of the logical model; similarly, obtaining the current moment structure of the logical model may include: obtaining the current moment logical table of the logical model, and then analyzing and comparing the current moment logical table with the historical moment logical table. When the current moment logical table is the same as the historical moment logical table, that is, the DDL statements included in the logical table have not changed, and the historical moment structure is the same as the current moment structure, it can be determined that the structure of the logical model has not changed; when the current moment logical table is different from the historical moment logical table, that is, the DDL statements included in the logical table have changed, the historical moment structure is different from the current moment structure, and the structure of the logical model has changed.

[0055] In some other examples, detecting whether the structure of the logical model has changed may include: detecting whether there is a change execution operation on the structure of the logical model; if there is a change execution operation, it can be determined that the structure of the logical model has changed; if there is no change execution operation, it can be determined that the structure of the logical model has not changed.

[0056] Specifically, the structure of the logical model can be reflected by the logical table corresponding to the logical model. Therefore, in order to detect whether there is an execution operation for changing the structure of the logical model, an interactive interface corresponding to the logical table can be obtained to detect whether there is an execution operation for changing the structure of the logical model in the interactive interface. The execution operation for changing can include: adding characters, modifying characters, deleting characters, modifying table names, etc. for DDL statements in the logical table. If it is detected that there is an execution operation for changing the structure of the logical model in the interactive interface, it can be determined that the structure of the logical model has changed; if it is not detected that there is an execution operation for changing the structure of the logical model in the interactive interface, it can be determined that the structure of the logical model has not changed.

[0057] Since when it is determined that the structure of the logical model has changed, the physical model corresponding to the logical model may not have changed, and thus the physical model may not correspond to the logical model, therefore, in order to achieve effective management operations on the data model and ensure the normal operation of the data model, when the structure of the logical model has changed, the first physical model corresponding to the logical model before the change can be determined, and the first physical model can be expressed as a physical library table obtained after the logical model is first physicalized. Specifically, there is an association relationship between the logical model before the change and the first physical model, and the first physical model can be stored in a preset area. When the structure of the logical model has changed, the preset area can be accessed based on the association relationship between the logical model and the first physical model, and the first physical model corresponding to the logical model before the change can be determined.

[0058] In some other examples, when it is determined that the structure of the logical model has not changed, it means that the corresponding relationship between the logical model and the physical model has not changed, and thus no model management operation is required.

[0059] Step S203: managing the first physical model based on the structural change operation corresponding to the logical model to obtain a second physical model corresponding to the changed logical model.

[0060] When the structure of the logical model has changed, the first physical model may not correspond to the structure of the changed logical model. Therefore, in order to ensure the normal operation of the data model, the structural change operation corresponding to the logical model can be determined first, and then the first physical model can be managed based on the structural change operation corresponding to the logical model to obtain a second physical model corresponding to the changed logical model.

[0061] Specifically, determining the structural change operation corresponding to the logical model may include: obtaining the logical model before the change and the logical model after the change, and determining the structural change operation based on the logical model before the change and the logical model after the change, wherein the structural change operation may include at least one of the following: a structural addition operation, a structural modification operation, a structural deletion operation, and the like.

[0062] After obtaining the structure change operation, the first physical model can be managed based on the structure change operation corresponding to the logical model. It should be noted that different structure change operations may correspond to different management strategies. For example, when the structure change operation is a structure addition operation, the first physical model can be managed based on the first management strategy to obtain a second physical model corresponding to the changed logical model. The second physical model has an increase in the DDL statements in the corresponding physical library table relative to the first physical model. When the structure change operation is a structure modification operation, the first physical model can be managed based on the second management strategy to obtain a second physical model corresponding to the changed logical model. The second physical model has at least some different DDL statements in the corresponding physical library table relative to the first physical model. When the structure change operation is a structure deletion operation, the first physical model can be managed based on the third management strategy to obtain a second physical model corresponding to the changed logical model. The second physical model has some deletions in the corresponding physical library table relative to the first physical model.

[0063] The data model management method provided in this embodiment obtains the logical model corresponding to the data warehouse, and when the structure of the logical model changes, determines the first physical model corresponding to the logical model before the change; then manages the first physical model based on the structural change operation corresponding to the logical model, so as to obtain the second physical model corresponding to the logical model after the change. In this way, when the structure of the logical model changes frequently, there is no need to manually generate change statements to adjust the physical table structure each time, but the physical model can be automatically managed based on the structural change operation of the logical model, thereby effectively helping users to automatically implement the logical model to the physical model, reducing the workload of physical model development, while meeting the frequent model change requirements in application scenarios, further improving the practicality of the method, and facilitating market promotion and application.

[0064] Figure 3 A flow chart of another data model management method provided by an embodiment of the present invention; Figure 3 As shown, this embodiment provides an implementation process of automatically building a corresponding physical model based on a logical model. Specifically, after obtaining the logical model corresponding to the data warehouse, the method in this embodiment may also include:

[0065] Step S301: Acquire a logic table corresponding to a logic model, wherein the logic table includes a plurality of defined database schema definition language DDL statements.

[0066] When establishing the data model corresponding to the data warehouse, the warehouse hierarchical relationship corresponding to the data warehouse can be established first. The warehouse hierarchical relationship can include a detail layer, a summary layer, an application layer, etc., wherein the detail layer can be used to record the detailed information of each data operation, and the summary layer can be used to record the detailed records generated within a preset time period, for example, the summary layer can be used to summarize the transaction information generated within a day, etc.; the application layer can be used to record the data processing operations generated by the preset user within the preset time period, for example, the application layer can be used to record the transaction operations generated by user A within a month, etc.

[0067] After establishing the warehouse hierarchy relationship corresponding to the data warehouse, the visual model design of the logical model can be implemented based on the warehouse hierarchy relationship. In some instances, the visual model design can establish the logical model through a visual folder method. At this time, the folder corresponding to the logical model can store the logical table; in other instances, the visual model design can establish the logical model through a visual canvas method. The logical model in the canvas is associated with the corresponding logical table. It should be noted that the relationship between different logical models can be established, identified or reflected in the canvas.

[0068] After establishing the logical model corresponding to the data warehouse, the logical table corresponding to the logical model can be obtained, and the logical table can include multiple defined database model definition language DDL statements, such as: `zzhm` string COMMENT 'certificate number', `khmc` string COMMENT 'customer name', etc. In addition, the logical table corresponding to the logical model can be stored in a preset area, and the logical table corresponding to the logical model can be obtained by accessing the preset area.

[0069] Step S302: Perform physicalization based on the logical table to generate a first physical model corresponding to the logical model.

[0070] After the logical table is acquired, a physicalization operation may be performed based on the logical table, thereby generating a first physical model corresponding to the logical model. The first physical model is a physical library table corresponding to a physicalization operation performed based on the logical model.

[0071] In some instances, the first physical model may be generated by automatically performing physical operations based on the logical model. In this case, after obtaining the logical table, the physical model used to perform physical operations on the logical table may be directly called, and then the logical table may be automatically input into the physical model, thereby automatically generating a first physical model corresponding to the logical model.

[0072] In some other instances, the first physical model may be generated by manually performing physical operations based on the logical model. In this case, after obtaining the logical table, the operation control for performing physical operations on the logical table may be manually called, and then the user manually inputs click and slide operations on the operation control, thereby generating a first physical model corresponding to the logical model.

[0073] In some other instances, when performing the physicalization operation, since different types of data sources correspond to different physicalization implementation methods, in order to ensure the quality and efficiency of the generation of the first physical model, the physicalization is performed based on the logical table in this embodiment, and the generation of the first physical model corresponding to the logical model may include: determining the data source for performing the physicalization; generating a physical table creation statement based on the logical table; and generating the first physical model based on the data source and the physical table creation statement.

[0074] Specifically, multiple data sources that can support physicalization operations are pre-configured, and the data sources may include: an open data processing service ODPS database, a relational database management system MySQL database, a data warehouse infrastructure Hi ve database on Hadoop, an open source object-relational database system PG database, an analytical database ADB database, etc. When performing physicalization, since different data sources correspond to different physicalization operations, in order to ensure the quality and efficiency of the generation of the first physical model, the data source used to perform physicalization can be determined first, and the data source can be any of the databases provided above. Specifically, the data source used to perform physicalization can be determined based on the data source selection operation input by the user or a data source pre-specified by the user.

[0075] In addition, after obtaining the logical table, the logical table can be analyzed and processed to generate a physical table creation statement, wherein the present embodiment does not limit the specific generation method of the physical table creation statement, and those skilled in the art can set it according to specific application requirements or design requirements. For example, a network model for generating physical table creation statements is pre-trained, and after obtaining the logical table, the logical table can be input into the network model, so that a physical table creation statement corresponding to the logical table can be generated. Alternatively, a physical table creation framework corresponding to different logical tables is pre-trained, and after obtaining the logical table, the physical table creation framework corresponding to the logical table can be determined, and then the physical table creation framework is keyword-filled based on the logical table, so that the physical table creation statement corresponding to the logical table can be obtained.

[0076] After determining the data source for performing physicalization and generating a physical table creation statement, the physicalization operation can be performed based on the data source and the physical table creation statement, so as to generate the first physical model. It should be noted that when performing the physicalization operation, in order to ensure that the generated first physical model can meet the design requirements of the user, a personalized configuration operation can be configured, that is, before generating the first physical model, a personalized configuration page can be displayed, and the personalized configuration page can display different personalized configuration options based on different data sources. For example, for the first physical model to be generated by certain data sources, the table type, data segmentation format, row separator, column separator, file storage format and storage location can be configured. For example, the table type can be an internal table or an external table, the data segmentation format can be a row and column separator or serialization and deserialization, when the data segmentation format is a row and column separator, the row separator can be "\n" or "\n\n", the column separator can be "\001", etc. Through the personalized configuration page displayed above, the first physical model that meets the user's needs can be obtained, thereby ensuring the flexibility and reliability of the generation of the first physical model.

[0077] In addition, in this embodiment, the execution order between the step of "determining the data source for performing physicalization" and the step of "generating a physical table creation statement based on the logical table" is not limited to the order described above. Technical personnel in this field can adjust the execution order of the above two steps according to specific application scenarios or application requirements. For example: the step of "determining the data source for performing physicalization" can be executed after the step of "generating a physical table creation statement based on the logical table", or the step of "determining the data source for performing physicalization" can be executed simultaneously with the step of "generating a physical table creation statement based on the logical table".

[0078] In this embodiment, by obtaining a logical table corresponding to the logical model and then performing physicalization based on the logical table to generate a first physical model corresponding to the logical model, it is effectively possible to automatically generate corresponding physical models for different data sources and logical models. Developers do not need to generate corresponding table creation statements and perform physicalization for different storages, which further reduces the workload of physical model development. At the same time, the quality and efficiency of the generation of the first physical model corresponding to the logical model are guaranteed, further improving the practicality of the method.

[0079] In some other examples, after obtaining the logic table corresponding to the logic model, the method in this embodiment may further include: judging whether the structure of the logic model is changed through the logic table.

[0080] After the logical table is obtained, the logical table can be analyzed and processed to determine whether the structure of the logical model has changed. Specifically, judging whether the structure of the logical model has changed through the logical table may include: when the DDL statement included in the logical table has changed, it is determined that the structure of the logical model has changed; when the DDL statement included in the logical table has not changed, it is determined that the structure of the logical model has not changed, thereby effectively realizing that whether the structure of the logical model has changed can be accurately judged based on the logical table, thereby ensuring the normal operation of the data model management method.

[0081] Figure 4 A schematic diagram of a flow chart of managing a first physical model based on a structural change operation corresponding to a logical model provided in an embodiment of the present invention; based on the above embodiment, refer to the attached Figure 4 As shown, this embodiment provides an implementation method for managing the first physical model. Specifically, the management of the first physical model based on the structural change operation corresponding to the logical model in this embodiment may include:

[0082] Step S401: Based on the structural change operation corresponding to the logical model, detecting whether the first physical model corresponds to the changed logical model.

[0083] When the structure of the logical model changes, since the first physical model at this time may not correspond to the logical model after the change, in order to ensure the normal operation of the data model, it is possible to detect whether the first physical model corresponds to the changed logical model based on the structural change operation corresponding to the logical model. In some instances, detecting whether the first physical model corresponds to the changed logical model may include: obtaining a network model for analyzing and processing the first physical model and the logical model, after obtaining the first physical model and the logical model after the change operation, the first physical model and the changed logical model may be input into the network model, so as to determine whether the first physical model corresponds to the changed logical model, for example: when the first physical model does not correspond to the changed logical model, the network model may output a detection result "0" for indicating that "the first physical model does not correspond to the changed logical model"; when the first physical model corresponds to the changed logical model, the network model may output a detection result "1" for indicating that "the first physical model corresponds to the changed logical model".

[0084] In other instances, detecting whether the first physical model corresponds to the changed logical model may include: obtaining a theoretical table creation statement corresponding to the changed logical model; determining a current table creation statement corresponding to the first physical model; and detecting whether the first physical model corresponds to the changed logical model based on the theoretical table creation statement and the current table creation statement.

[0085] After obtaining the changed logical model, the changed logical model can be analyzed and processed to obtain a theoretical table creation statement corresponding to the changed logical model, and the theoretical table creation statement corresponds to the physical model corresponding to the changed logical model; after obtaining the first physical model, the first physical model can be analyzed and processed to determine the current table creation statement corresponding to the first physical model. After obtaining the theoretical table creation statement and the current table creation statement, the theoretical table creation statement and the current table creation statement can be analyzed and compared to detect whether the first physical model corresponds to the changed logical model.

[0086] Specifically, based on the theoretical table creation statement and the current table creation statement, detecting whether the first physical model corresponds to the changed logical model may include: analyzing and comparing the theoretical table creation statement with the current table creation statement, and when the theoretical table creation statement is consistent with the current table creation statement, it can be determined that the first physical model corresponds to the changed logical model; or, when the theoretical table creation statement is inconsistent with the current table creation statement, it can be determined that the first physical model does not correspond to the changed logical model, thereby effectively realizing the identification operation of whether the first physical model corresponds to the changed logical model.

[0087] In other instances, detecting whether the first physical model corresponds to the changed logical model may include: obtaining a theoretical physical table structure corresponding to the changed logical model; determining a current physical table structure corresponding to the first physical model; and detecting whether the first physical model corresponds to the changed logical model based on the theoretical physical table structure and the current physical table structure.

[0088] After obtaining the changed logical model, the changed logical model can be analyzed and processed to obtain the theoretical physical table structure corresponding to the changed logical model. Similarly, after obtaining the first physical model, the first physical model can be analyzed and processed to obtain the current physical table structure corresponding to the first physical model; after obtaining the theoretical physical table structure and the current physical table structure, the theoretical physical table structure and the current physical table structure can be analyzed and processed to detect whether the first physical model corresponds to the changed logical model.

[0089] Specifically, based on the theoretical physical table structure and the current physical table structure, detecting whether the first physical model corresponds to the changed logical model may include: analyzing and comparing the theoretical physical table structure with the current physical table structure; when the theoretical physical table structure is consistent with the current physical table structure, it can be determined that the first physical model corresponds to the changed logical model; or, when the theoretical physical table structure is inconsistent with the current physical table structure, it can be determined that the first physical model does not correspond to the changed logical model, thereby effectively realizing the identification operation of whether the first physical model corresponds to the changed logical model.

[0090] Step S402: when the first physical model corresponds to the changed logical model, the first physical model is determined as the second physical model.

[0091] When the detection result of whether the first physical model corresponds to the changed logical model is that the first physical model corresponds to the changed logical model, it means that although the logical model has been changed, the first physical model still corresponds to the changed logical model. For example, punctuation marks are modified or space marks are added to some fields in the logical model. At this time, the first physical model still corresponds to the changed logical model, that is, normal data processing operations can be performed based on the logical model and the first physical model, and then there is no need to perform any processing operations on the first physical model. The first physical model can be directly determined as the second physical model, and the second physical model corresponds to the changed logical model.

[0092] Step S403: when the first physical model does not correspond to the changed logical model, an operation type corresponding to the structure change operation is obtained, and the first physical model is managed based on the operation type.

[0093] When the detection result of whether the first physical model corresponds to the changed logical model is that the first physical model does not correspond to the changed logical model, in order to ensure the normal operation of the data model, the operation type corresponding to the structure change operation can be obtained, wherein different structure change operations can correspond to different operation types, for example: the structure addition operation can correspond to the addition operation type, the structure deletion operation can correspond to the deletion operation type, and the structure adjustment operation can correspond to the modification operation type. Since different operation types can correspond to different management strategies, the management operation of the first physical model can be performed based on the operation type.

[0094] In some instances, managing the first physical model based on the operation type may include: when the operation type is the first type and the first type is a legal type allowed by the data warehouse, automatically adjusting the first physical model based on the first type to obtain the second physical model; when the operation type is the second type, outputting interactive prompt information to interact with the user through the interactive prompt information to obtain the second physical model; when the operation type is an unknown type, generating first prompt information, the prompt information is used to identify that the first physical model cannot be automatically adjusted; when the operation type is the first type and the first type is an illegal type not allowed by the data warehouse, generating second prompt information, the second prompt information is used to identify that the first physical model cannot be automatically adjusted; wherein the first type includes at least one of the following: adding an operation type, modifying an operation type; the second type includes: deleting an operation type.

[0095] Example 1: At time t1, the logical table corresponding to the logical model includes the following DDL statements:

[0096] CREATE TABLE IF NOT EXISTS`ods_base_yhkh_demo_di`(

[0097] `id` bigint COMMENT 'primary key',

[0098] `zzhm` string COMMENT 'ID number',

[0099] `khmc` string COMMENT 'customer name',

[0100] `nl` bigint COMMENT 'date of birth', ;

[0102] At time t2, the logical table corresponding to the logical model includes the following DDL statements:

[0103] CREATE TABLE IF NOT EXISTS`ods_base_yhkh_demo_di`(

[0104] `id` bigint COMMENT 'primary key',

[0105] `zzhm` string COMMENT 'ID number',

[0106] `khmc` string COMMENT 'customer name',

[0107] `nl` bigint COMMENT 'date of birth',

[0108] `xb` string COMMENT 'male / female',

[0109] `sjhm` string COMMENT 'mobile phone number', ;

[0111] At time t3, the logical table corresponding to the logical model includes the following DDL statements:

[0112] CREATE TABLE IF NOT EXISTS`ods_base_yhkh_demo_di`(

[0113] `id` bigint COMMENT 'primary key',

[0114] `zzhm` string COMMENT 'ID number',

[0115] `khmc` string COMMENT 'customer name',

[0116] `sjhm` string COMMENT 'mobile phone number', ;

[0118] By comparison, we can see that the logical table corresponding to t2 has the following DDL statement added to the logical table corresponding to t1: "`xb` string COMMENT'male / female',`sjhm` string COMMENT'mobile phone number'", so we can determine that the operation type is an addition operation type. The logical table corresponding to t3 has the DDL statement "`nl` bigint COMMENT'date of birth'" in the logical table adjusted to "`sjhm` string COMMENT'mobile phone number'", so we can determine that the operation type is a modification operation type.

[0119] Specifically, when the operation type is an add operation type and / or a modify operation type, and the add operation type and / or the modify operation type are legal types allowed by the data warehouse (that is, the data warehouse can support the functions that can be achieved by the above-mentioned add operation or modify operation), the first physical model can be automatically adjusted based on the structural change operation of the logical model, thereby effectively realizing the automatic acquisition of the second physical model corresponding to the changed logical model.

[0120] Example 2: At time t4, the logical table corresponding to the logical model includes the following DDL statements:

[0121] CREATE TABLE IF NOT EXISTS`ods_base_yhkh_demo_di`(

[0122] `id` bigint COMMENT 'primary key',

[0123] `khmc` string COMMENT 'customer name',

[0124] `nl` bigint COMMENT 'date of birth', ;

[0126] By comparison, it can be seen that the logical table corresponding to t4 deletes the DDL statement "`zzhm` string COMMENT 'certificate number'" in the logical table compared to the logical table corresponding to t1, so it can be determined that the operation type is a deletion operation type.

[0127] When the operation type is a delete operation type, since the delete operation type is used to delete some DDL statements in the logical table corresponding to the logical model, in general, the delete operation type adjusts the DDL statements in the logical table corresponding to the logical model to a large extent. Therefore, in order to ensure the accuracy of generating the first physical model, when the operation type is a delete operation type, interactive prompt information can be output, and the interactive prompt information can include at least one of the following: text prompt information, voice prompt information, etc. It should be noted that different formats of interactive prompt information can correspond to different output devices, for example: when the interactive prompt information is text prompt information, the output device can be a display device, at this time, the text prompt information can include pop-up prompt information, floating window prompt information, dialog prompt information, etc. displayed by the display device; when the interactive prompt information is voice prompt information, the output device can be a voice output device. Since the interactive prompt information is used to interact with the user, after the interactive prompt information is output, the interactive operation (voice interactive operation, interactive action of the display device) can be performed with the user, and after the interactive operation input by the user for the interactive prompt information is obtained, the second physical model can be obtained based on the interactive operation.

[0128] When the operation type is neither the first type nor the second type, it can be determined that the operation type is an unknown type. Since the structural change operation corresponding to the unknown type cannot be determined, the automatic management and adjustment operation of the first physical model cannot be achieved. At this time, in order to enable the user to timely understand the management status of the first physical model, a first prompt message can be generated. The first prompt message is used to indicate that the automatic adjustment operation cannot be performed on the first physical model.

[0129] When the operation type is the first type, and the first type is an illegal type not allowed by the data warehouse, for example: when the operation type is to modify the "DDL statement for implementing floating point numbers" to "DDL statement for implementing integer numbers", because the data warehouse does not support adjusting the parameters of floating point numbers to integer parameters, therefore, although the above operation type is a modification operation type, the above modification operation type is an illegal type not allowed by the data warehouse, that is, the data warehouse does not support the above modification operation. In order to enable the user to understand the management status of the first physical model in a timely manner, a second prompt information can be generated, and the second prompt information is used to indicate that the first physical model cannot be automatically adjusted. It should be noted that the first prompt information can be different from the second prompt information, so that the user can quickly and accurately know the different management states of the first physical model.

[0130] In this embodiment, based on the structural change operation corresponding to the logical model, it is detected whether the first physical model corresponds to the changed logical model. When the first physical model corresponds to the changed logical model, the first physical model is determined to be the second physical model. When the first physical model does not correspond to the changed logical model, the operation type corresponding to the structural change operation is obtained, and the first physical model is managed based on the operation type, thereby effectively achieving different management operations on the first physical model based on different structural change operations, further improving the accuracy and reliability of data model management.

[0131] Figure 5 A flowchart of another data model management method provided by an embodiment of the present invention; based on any of the above embodiments, refer to the attached Figure 5 As shown, this embodiment provides an implementation method for reversely constructing a logical model based on a physical library table. Specifically, the method in this embodiment may also include:

[0132] Step S501: Acquire the physical model to be managed.

[0133] Among them, the physical model can be embodied by a physical library table, which can include multiple DDL statements. In order to realize the operation of reversely building a logical model, the physical model to be managed can be obtained. In some instances, the physical model can be stored in a preset area, and the physical model to be managed can be obtained by accessing the preset area. In other instances, obtaining the physical model to be managed can include: obtaining an interactive interface for establishing a physical model, obtaining an execution operation input by a user in the interactive interface, and obtaining the physical model to be managed based on the execution operation. In some other instances, the management device of the data model is communicatively connected to a third device, and the physical model to be managed is stored in the third device. In order to enable the third device to realize the operation of reversely building a logical model, the third device can actively or passively send the physical model to the management device of the data model, so that the management device of the data model can obtain the physical model to be managed.

[0134] In some other examples, acquiring the physical model to be managed may include: acquiring the original physical model; determining the hierarchical features corresponding to the physical model to be managed; and determining the original physical model corresponding to the hierarchical features as the physical model to be managed.

[0135] Specifically, multiple original physical models are pre-configured, and then the hierarchical features corresponding to the physical model to be managed are determined. The hierarchical features may include at least one of the following: detail layer features, summary layer features, application layer features, etc. In some instances, the hierarchical features may be implemented as hierarchical table names, hierarchical table formats, etc. corresponding to each level. After obtaining the hierarchical features corresponding to the original physical model and the physical model to be managed, the original physical model and the hierarchical features may be analyzed and processed. Specifically, the hierarchical features (e.g., table names) may be matched by regular expressions, so that the original physical model corresponding to the hierarchical features may be determined as the physical model to be managed, which effectively implements the method of matching table names by regular expressions to determine one or more (two or more) physical models to be scanned as logical models.

[0136] Step S502: Determine the physical table structure corresponding to the physical model.

[0137] After obtaining the physical model to be managed, the physical model can be analyzed and processed to determine the physical table structure corresponding to the physical model. Specifically, there is an association relationship between the physical model and the physical table structure, and the physical table structure corresponding to the physical model can be determined based on the association relationship.

[0138] Step S503: extracting metadata information corresponding to the physical table structure.

[0139] After the physical table structure is obtained, a metadata extraction operation may be performed on the physical table structure, thereby obtaining metadata information corresponding to the physical table structure.

[0140] Step S504: Generate a logical model corresponding to the physical model based on the metadata information.

[0141] After the metadata information is acquired, analysis and processing may be performed based on the metadata information to generate a logical model corresponding to the physical model, thereby effectively realizing reverse scanning of the physical model into a corresponding logical model.

[0142] For example, when there is a management device that can perform management operations on a data model, User A has already developed and designed a physical model. In order to be able to perform management operations on the physical model through the management device, it is necessary to generate a logical model corresponding to the physical model in the management device. At this time, the physical model needs to be reversely scanned into a logical model so as to implement corresponding management operations on the physical model through the logical model, thereby effectively realizing that the management device can perform management operations through the physical model that has been developed or designed, further improving the practicality and extensibility of the method.

[0143] In this embodiment, by acquiring the physical model to be managed, determining the physical table structure corresponding to the physical model, extracting the metadata information corresponding to the physical table structure, and then generating the logical model corresponding to the physical model based on the metadata information, it is effectively possible to reversely scan the physical model into a logical model, and then manage the physical model based on the generated logical model, further improving the flexibility and reliability of the method.

[0144] In specific applications, this application embodiment provides a data warehouse modeling system, which can implement a data model management method. Specifically, it can automatically generate corresponding physical table creation statements according to the definition of the logical model, and implement them in the actual data resources configured by the user to realize physical operations; at the same time, when the structure of the logical model changes, it can trigger the synchronization of the physical table creation statements, and automatically perform a comparison operation between the logical model and the physical table structure, and save the difference results. When physicalizing again, it will refer to the consistency comparison results for specific physicalization pre-analysis operations, that is, to determine whether the table structure change can be automatically completed and generate corresponding change statements, to help users automatically implement the logical model to the physical model, reduce development workload, and meet frequent change requirements in the scenario.

[0145] For details, please refer to the attached Figure 6 As shown, the data warehouse modeling system in this embodiment may include the following functional modules: a subject domain level management module, a model and data source management module, a database schema definition language (Data Definition Language, referred to as DDL) automatic generation and comparison module, and a physical implementation module;

[0146] 1) The subject domain hierarchical management module is used to establish the hierarchical relationship of the data warehouse, where each data warehouse level includes: detail layer, summary layer, application layer, etc.

[0147] Among them, the detail layer (Data Warehouse Detail, abbreviated as DWD) is used to record the detailed information of each data operation, the summary layer is used to summarize the detailed information within a preset time period, for example, the summary layer is used to summarize the detailed records of one day; the application layer is used to summarize the detailed information of users within a preset time, for example: the application layer is used to summarize the detailed information of user A within one day, or the application layer is used to summarize the detailed information of all links in a certain application scenario.

[0148] It should be noted that the data warehouse level can include not only the above-mentioned detail layer, summary layer and application layer, but those skilled in the art can configure it according to specific application requirements and design requirements. For example, the data warehouse level can also include the middle layer and service layer, etc., which will not be repeated here.

[0149] 2) The data source configuration module is used to implement the configuration of the specified data source.

[0150] For example, through the data source configuration module, you can pre-configure the physical open data processing service ODPS database, the relational database management system MySQL database, the data warehouse infrastructure Hive database on Hadoop, the open source object-relational database system PG database, the analytical database ADB database, and so on.

[0151] 3) The logical model management module is used to implement visual model design based on the pre-configured data warehouse hierarchical relationship, and can also reversely build the logical model based on the physical library table.

[0152] In the logical model management module, visual model design is implemented according to the pre-configured data warehouse hierarchical relationship. The visual logical model can be established by creating a folder or a canvas. When the visual logical model is established by using the canvas, the association relationship between multiple different logical models can be identified in the canvas.

[0153] When the logical model management module reversely constructs the logical model according to the physical library table, the logical model management module can automatically extract the metadata information corresponding to the physical library table from the source database, and then perform field parsing operations on the physical library table based on the metadata information, so as to automatically generate the logical model corresponding to the physical library table, and then perform management operations on the physical library table based on the logical model. In addition, when reversely constructing the logical model, the method in this embodiment also supports manual adjustment to meet the personalized needs of users, further improving the flexibility and reliability of the method.

[0154] Among them, for the physical library tables that need to reversely build a logical model, the present application embodiment provides an implementation method for determining the physical library tables. Specifically, multiple physical library tables are stored in the cloud computing resources, and different physical library tables may correspond to different physical library table names. After obtaining multiple physical library tables, one or more target physical library tables that need to reverse build a logical model can be selected based on preset physical library table names and regular expressions. The target physical library table can be at least a part of the multiple physical library tables. After obtaining one or more target physical library tables, the obtained one or more target physical library tables can be batch scanned into a logical model, which effectively improves the quality and efficiency of reverse construction of the logical model.

[0155] 4) The DDL automatic generation / comparison module is used to automatically generate database execution script DDL statements.

[0156] Specifically, the DDL automatic generation / comparison module can automatically generate database execution script DDL statements by using the logical model generated by the logical model management module, and provide customized configurations. Specifically, customized configuration operations such as indexes, life cycles, and other storage options can be set, making the entire physical library table generation process more flexible and usable.

[0157] Among them, technical personnel in this field can set different life cycles according to design requirements and application requirements. The life cycle is used to identify the storage time of data. In order to ensure the quality and efficiency of data processing, data that has exceeded the life cycle can be cleared.

[0158] 5) The physical implementation module is used to create the actual physical library table.

[0159] Specifically, the physical implementation module can connect to the specified data source to execute the database script and create the actual physical library table; after executing the DDL statement, a physical library table can be generated. At the same time, the physical table creation statement can be automatically changed as the logical model structure changes. Specifically, when the DDL statement of the logical table definition changes, it will automatically trigger the consistency comparison operation between the logical model and the physical model, and generate the comparison result; when the physicalization is implemented again, it will perform a preliminary analysis based on the consistency comparison result to determine whether the change of the physical table structure can be automatically completed. When the change operation of the physical table structure can be automatically completed, the change statement can be directly provided.

[0160] Among them, the structure of the logical model can be mainly reflected through the DDL statements in the logical table corresponding to the logical model. When the DDL statement changes, it can be determined that the structure of the logical model has changed; when the DDL statement has not changed, it can be determined that the structure of the logical model has not changed. The change of the DDL statement can include at least one of the following: adding operations of DDL statements, modifying operations of DDL statements, deleting operations of DDL, etc.

[0161] When the structure of the logical model changes, it can trigger whether the logical model corresponds to the physical model. Specifically, the theoretical physics library table corresponding to the logical model can be determined first, and the theoretical table creation statements in the theoretical physics library table are analyzed and compared with the table creation statements in the physical library table corresponding to the physical model. When the theoretical table creation statements match the table creation statements, it can be determined that the logical model corresponds to the physical model; when the theoretical table creation statements do not match the table creation statements, it can be determined that the logical model does not correspond to the physical model.

[0162] It should be noted that the present application embodiment can support automatic generation of corresponding physical library table DDL statements according to different storage types. Specifically, when the physicalization operation is performed for the first time, the DDL statements can be sent to the target cloud computing resources according to the set data source to complete the physicalization. After the physicalization is completed, when the DDL statements corresponding to the logical model are modified again, the DDL statements corresponding to the logical model can be automatically triggered to compare the consistency with the DDL statements corresponding to the physical model, that is, the DDL after the logical model is modified is compared with the DDL statements corresponding to the physical library table of the last materialization, and the difference results are saved. When materializing again, the consistency comparison results will be referred to for physicalization pre-analysis to determine whether the table structure change can be automatically completed and the corresponding change statements can be generated. When materialization is implemented again, the table structure change operation can be realized.

[0163] For details, please refer to the attached Figure 7 As shown, when the change in the DDL statement is to add a field and / or change the field type, the automatic change operation of the DDL statement in the physical library table can be automatically completed, and then the physical library table (corresponding to the first physical model mentioned above) can be updated to the adjusted physical library table (corresponding to the second physical model mentioned above) corresponding to the changed logical model, thereby realizing that the physical model can be automatically changed as the logical model changes.

[0164] When the change in the DDL statement is to delete a field, since this type of modification DDL statement has certain risks, manual intervention is required, that is, manual modification operations are performed on the physical library table to adjust the physical library table to correspond to the logical model.

[0165] When the change caused by the DDL statement is of an unrecognizable change type, it can be determined that the change statement cannot be automatically provided; or when the change caused by the DDL statement can be identified but the above-mentioned change operation is an operation that the database cannot support or does not allow, it can be determined that the change statement cannot be provided. At this time, a prompt message can be generated to prompt the user of the automatic change status of the physical model at this time, so that the user can make manual adjustments or manually confirm the operation based on the prompt message, or re-establish the physical library table to improve the quality and efficiency of data model management.

[0166] The technical solution provided by this application embodiment can achieve the following functions:

[0167] (1) It can automatically generate the corresponding physical table creation statements based on the definition of the logical model, and can also provide customized configuration operations, such as setting indexes, life cycles, and other storage options, so that users can adjust the table creation statements more flexibly.

[0168] (2) When the logical model structure changes, the logical model and physical table structure can be automatically compared and the difference results can be saved. When materialized again, it is determined that the table structure change can be automatically completed and the corresponding change statement is generated to help users quickly implement the table change from the logical model to the physical table structure.

[0169] (3) It can reversely build a logical model based on the physical library table, automatically extract database table metadata information from the source database, and automatically generate a logical model of the database table. It also supports manual adjustment without the need to manually create a database model.

[0170] (4) The data source configuration module implements the configuration of the specified data source. By connecting to the specified data source, the database script can be executed to create the actual physical table. The user does not need to go to various storage system consoles to perform table creation operations, thereby effectively helping the user to automatically implement the logical model into the physical model, reducing the workload of physical model development. At the same time, it meets the frequent model change requirements in application scenarios, further improving the practicality of the method and facilitating market promotion and application.

[0171] Figure 8 A schematic diagram of a data model management device provided by an embodiment of the present invention; Figure 8 As shown, this embodiment provides a data model management device, which is used to perform the above Figure 2 The data model management method shown, specifically, the data model management device may include: a first acquisition module 11, a first determination module 12 and a first processing module 13;

[0172] The first acquisition module 11 is used to acquire the logical model corresponding to the data warehouse;

[0173] A first determination module 12, configured to determine a first physical model corresponding to the logical model before the change when the structure of the logical model changes;

[0174] The first processing module 13 is used to manage the first physical model based on the structural change operation corresponding to the logical model to obtain a second physical model corresponding to the changed logical model.

[0175] In some examples, after obtaining the logical model corresponding to the data warehouse, the first obtaining module 11 and the first processing module 13 in this embodiment:

[0176] A first acquisition module 11 is used to acquire a logical table corresponding to the logical model, wherein the logical table includes a plurality of defined database schema definition language DDL statements;

[0177] The first processing module 13 is used to perform physicalization based on the logical table to generate a first physical model corresponding to the logical model.

[0178] In some instances, when the first processing module 13 performs physicalization based on the logical table to generate a first physical model corresponding to the logical model, the first processing module 13 is used to execute: determining a data source for performing physicalization; generating a physical table creation statement based on the logical table; and generating a first physical model based on the data source and the physical table creation statement.

[0179] In some examples, after obtaining the logic table corresponding to the logic model, the first processing module 13 in this embodiment is used to determine whether the structure of the logic model is changed through the logic table.

[0180] In some instances, when the first processing module 13 determines whether the structure of the logical model has changed through the logical table, the first processing module 13 is used to execute: when the DDL statement included in the logical table has changed, it is determined that the structure of the logical model has changed; when the DDL statement included in the logical table has not changed, it is determined that the structure of the logical model has not changed.

[0181] In some instances, when the first processing module 13 manages the first physical model based on the structural change operation corresponding to the logical model, the first processing module 13 is used to execute: based on the structural change operation corresponding to the logical model, detecting whether the first physical model corresponds to the changed logical model; when the first physical model corresponds to the changed logical model, determining the first physical model as the second physical model; when the first physical model does not correspond to the changed logical model, obtaining the operation type corresponding to the structural change operation, and managing the first physical model based on the operation type.

[0182] In some instances, when the first processing module 13 detects whether the first physical model corresponds to the changed logical model, the first processing module 13 is used to execute: obtaining a theoretical table creation statement corresponding to the changed logical model; determining a current table creation statement corresponding to the first physical model; and detecting whether the first physical model corresponds to the changed logical model based on the theoretical table creation statement and the current table creation statement.

[0183] In some instances, when the first processing module 13 detects whether the first physical model corresponds to the changed logical model based on the theoretical table creation statement and the current table creation statement, the first processing module 13 is used to execute: when the theoretical table creation statement is consistent with the current table creation statement, it is determined that the first physical model corresponds to the changed logical model; or, when the theoretical table creation statement is inconsistent with the current table creation statement, it is determined that the first physical model does not correspond to the changed logical model.

[0184] In some instances, when the first processing module 13 detects whether the first physical model corresponds to the changed logical model, the first processing module 13 is used to execute: obtaining a theoretical physical table structure corresponding to the changed logical model; determining a current physical table structure corresponding to the first physical model; and detecting whether the first physical model corresponds to the changed logical model based on the theoretical physical table structure and the current physical table structure.

[0185] In some instances, when the first processing module 13 detects whether the first physical model corresponds to the changed logical model based on the theoretical physical table structure and the current physical table structure, the first processing module 13 is used to execute: when the theoretical physical table structure is consistent with the current physical table structure, it is determined that the first physical model corresponds to the changed logical model; or when the theoretical physical table structure is inconsistent with the current physical table structure, it is determined that the first physical model does not correspond to the changed logical model.

[0186] In some instances, when the first processing module 13 manages the first physical model based on the operation type, the first processing module 13 is used to execute: when the operation type is the first type and the first type is a legal type allowed by the data warehouse, the first physical model is automatically adjusted based on the first type to obtain the second physical model; when the operation type is the second type, interactive prompt information is output to interact with the user through the interactive prompt information to obtain the second physical model; when the operation type is an unknown type, a first prompt information is generated, and the first prompt information is used to indicate that the first physical model cannot be automatically adjusted; when the operation type is the first type and the first type is an illegal type not allowed by the data warehouse, a second prompt information is generated, and the second prompt information is used to indicate that the first physical model cannot be automatically adjusted; wherein the first type includes at least one of the following: adding an operation type, modifying an operation type; the second type includes: deleting an operation type.

[0187] In some examples, the first acquisition module 11, the first determination module 12 and the first processing module 13 in this embodiment are further used to perform the following steps:

[0188] A first acquisition module 11 is used to acquire a physical model to be managed;

[0189] A first determination module 12, used to determine a physical table structure corresponding to the physical model;

[0190] The first processing module 13 is used to extract metadata information corresponding to the physical table structure; based on the metadata information, generate a logical model corresponding to the physical model.

[0191] In some instances, when the first acquisition module 11 acquires the physical model to be managed, the first acquisition module 11 is used to execute: acquiring the original physical model; determining the hierarchical features corresponding to the physical model to be managed; and determining the original physical model corresponding to the hierarchical features as the physical model to be managed.

[0192] Figure 8 The device shown can perform Figure 1-Figure 7 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 1-Figure 7 The implementation process and technical effects of this technical solution refer to Figure 1-Figure 7 The description in the illustrated embodiment will not be repeated here.

[0193] In one possible design, Figure 8 The structure of the management device of the data model shown can be implemented as an electronic device, which can be a mobile phone, a tablet computer, a server, etc. Fig. 9 As shown, the electronic device may include: a first processor 21 and a first memory 22. The first memory 22 is used to store the corresponding electronic device to execute the above Figure 1-Figure 7 In the illustrated embodiment, the first processor 21 is configured to execute the program stored in the first memory 22 .

[0194] The program includes one or more computer instructions, wherein when the one or more computer instructions are executed by the first processor 21, the following steps can be implemented:

[0195] Get the logical model corresponding to the data warehouse;

[0196] When the structure of the logical model changes, determining a first physical model corresponding to the logical model before the change;

[0197] The first physical model is managed based on the structural change operation corresponding to the logical model to obtain a second physical model corresponding to the changed logical model.

[0198] Furthermore, the first processor 21 is also used to execute the aforementioned Figure 1-Figure 7 All or part of the steps in the illustrated embodiments.

[0199] The structure of the electronic device may further include a first communication interface 23 for the electronic device to communicate with other devices or a communication network.

[0200] In addition, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by electronic devices, which includes instructions for executing the above Figure 1-Figure 7 The procedures involved in the data model management method in the method embodiment shown.

[0201] In addition, an embodiment of the present invention provides a computer program product, including: a computer program, when the computer program is executed by a processor of an electronic device, the processor executes the above Figure 1-Figure 7 The steps in the method for managing a data model in the method embodiment are shown.

[0202] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0203] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0204] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to produce a machine, so that the instructions executed by the processor of the computer or other programmable device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0205] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0206] These computer program instructions may also be loaded onto a computer or other programmable device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0207] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0208] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0209] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0210] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data model management method, characterized in that: include: Obtain the logical model corresponding to the data warehouse; When the structure of the logical model changes, determining a first physical model corresponding to the logical model before the change; Managing the first physical model based on the structural change operation corresponding to the logical model to obtain a second physical model corresponding to the changed logical model; The managing the first physical model based on the structural change operation corresponding to the logical model also includes: Obtain the theoretical table creation statement corresponding to the changed logical model; Determine a current table creation statement corresponding to the first physical model; Based on the theoretical table creation statement and the current table creation statement, detecting whether the first physical model corresponds to the changed logical model; The first physical model is managed based on the detection result.

2. The method according to claim 1, characterized in that After obtaining the logical model corresponding to the data warehouse, the method further includes: Acquire a logical table corresponding to the logical model, wherein the logical table includes a plurality of defined database schema definition language DDL statements; Physicalization is performed based on the logical table to generate a first physical model corresponding to the logical model.

3. The method according to claim 2, characterized in that Performing physicalization based on the logical table to generate a first physical model corresponding to the logical model includes: Identify the data sources used to perform the physicalization; Based on the logical table, generate a physical table creation statement; The first physical model is generated based on the data source and the physical table creation statement.

4. The method according to claim 2, characterized in that: After acquiring the logic table corresponding to the logic model, the method further includes: Through the logic table, it is determined whether the structure of the logic model has been changed.

5. The method according to claim 4, characterized in that Judging whether the structure of the logic model has changed by the logic table includes: When the DDL statement included in the logic table is changed, it is determined that the structure of the logic model has been changed; When the DDL statements included in the logic table have not changed, it is determined that the structure of the logic model has not changed.

6. The method according to claim 1, characterized in that Managing the first physical model based on the detection result includes: Based on the structural change operation corresponding to the logical model, detecting whether the first physical model corresponds to the changed logical model; When the first physical model corresponds to the changed logical model, the first physical model is determined as the second physical model; When the first physical model does not correspond to the changed logical model, an operation type corresponding to the structure change operation is acquired, and the first physical model is managed based on the operation type.

7. The method according to claim 1, characterized in that Based on the theoretical table creation statement and the current table creation statement, detecting whether the first physical model corresponds to the changed logical model includes: When the theoretical table creation statement is consistent with the current table creation statement, it is determined that the first physical model corresponds to the changed logical model; or, When the theoretical table creation statement is inconsistent with the current table creation statement, it is determined that the first physical model does not correspond to the changed logical model.

8. The method according to claim 6, characterized in that Detecting whether the first physical model corresponds to the changed logical model includes: Obtain the theoretical physical table structure corresponding to the changed logical model; Determining a current physical table structure corresponding to the first physical model; Based on the theoretical physical table structure and the current physical table structure, it is detected whether the first physical model corresponds to the changed logical model.

9. The method according to claim 8, characterized in that Based on the theoretical physical table structure and the current physical table structure, detecting whether the first physical model corresponds to the changed logical model includes: When the theoretical physical table structure is consistent with the current physical table structure, it is determined that the first physical model corresponds to the changed logical model; or, When the theoretical physical table structure is inconsistent with the current physical table structure, it is determined that the first physical model does not correspond to the changed logical model.

10. The method according to claim 6, characterized in that Managing the first physical model based on the operation type includes: When the operation type is a first type, and the first type is a legal type allowed by the data warehouse, the first physical model is automatically adjusted based on the first type to obtain a second physical model; When the operation type is the second type, outputting interactive prompt information, so as to interact with the user through the interactive prompt information to obtain a second physical model; When the operation type is an unknown type, generating first prompt information, wherein the first prompt information is used to indicate that the automatic adjustment operation cannot be performed on the first physical model; When the operation type is a first type, and the first type is an illegal type not allowed by the data warehouse, second prompt information is generated, and the second prompt information is used to indicate that the automatic adjustment operation cannot be performed on the first physical model; The first type includes at least one of the following: an add operation type and a modify operation type; the second type includes: a delete operation type.

11. The method according to any one of claims 1 to 10, characterized in that: The method further comprises: Get the physical model to be managed; Determining a physical table structure corresponding to the physical model; Extracting metadata information corresponding to the physical table structure; Based on the metadata information, a logical model corresponding to the physical model is generated.

12. The method according to claim 11, characterized in that Get the physical model to be managed, including: Get the original physical model; Determine the hierarchical characteristics corresponding to the physical model to be managed; An original physical model corresponding to the hierarchical feature is determined as a physical model to be managed.

13. An electronic device, characterized in that: include: A memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the data model management method as described in any one of claims 1-12.

Citation Information

Patent Citations

  • Data model management and control method and device and server

    CN109656912A