CN114385598A - Automatic conversion method and device from logic model to physical model - Google Patents
Automatic conversion method and device from logic model to physical model Download PDFInfo
- Publication number
- CN114385598A CN114385598A CN202210055950.9A CN202210055950A CN114385598A CN 114385598 A CN114385598 A CN 114385598A CN 202210055950 A CN202210055950 A CN 202210055950A CN 114385598 A CN114385598 A CN 114385598A
- Authority
- CN
- China
- Prior art keywords
- model
- user
- logic
- type
- conversion
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000006243 chemical reaction Methods 0.000 title claims abstract description 158
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000013507 mapping Methods 0.000 claims abstract description 162
- 238000013461 design Methods 0.000 claims abstract description 34
- 238000004590 computer program Methods 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 9
- 238000013523 data management Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/211—Schema design and management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/258—Data format conversion from or to a database
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
According to the method and the device for automatically converting the logic model into the physical model, the server obtains the logic model to be converted and the target database type, then whether the target database type exists in the model conversion table is searched, the model conversion table is generated according to the design requirements of a user, and the model conversion table comprises the mapping relation between the attribute data type of each logic model and the physical model data type corresponding to at least one database type. And when the target database type exists in the model conversion table, the server converts the logic model to be converted into the corresponding physical model according to the mapping relation recommended by the user. The user can realize the extension of the database type by configuring the model conversion table, and can also meet the individual requirements of the user on the data type mapping relation for converting the logical model into the physical model.
Description
Technical Field
The present application relates to the field of data management technologies, and in particular, to a method and an apparatus for automatically converting a logical model into a physical model.
Background
Data management technology refers to the classification, encoding, storage, retrieval, maintenance and the like of data, and is a central problem of data processing. The data management technology based on the development of computer hardware and software goes through 3 stages of manual management, file system and database system. In the database system stage, the design of the database can be roughly divided into four stages of conceptual model design, logical model design, physical model design and physical database deployment implementation.
The physical model design stage is to realize the conversion from the logic model to the physical model and to realize the design to a specific operation platform. Current database design tools, which typically provide automatic conversion of logical models to physical models, support conversion of logical models to multiple database types, depending on the type of database (e.g., Oracle, MySQL, SQLserver, etc.).
However, due to the limited database types supported by current database design tools, users cannot convert logical models to emerging database types during physical model design. Moreover, a one-to-many relationship exists between the mapping of the logical data type to the physical data type, for example, when the logical type is a char type and corresponds to an Oracle database type, the corresponding physical data type may be a char type or a varchar2 type, and the current logical model may be automatically converted into a default physical model type, which cannot be flexibly selected by a user.
Disclosure of Invention
The application provides an automatic conversion method and device from a logic model to a physical model, which are used for solving the problem that a mapping relation from a logic data type to a physical data type cannot be flexibly selected by a user when the logic model is converted to the physical model.
In a first aspect, the present application provides a method for automatically converting a logical model into a physical model, including:
acquiring a logic model to be converted and a target database type, wherein the logic model comprises at least one logic entity and at least one entity attribute corresponding to the logic entity, and the target database type is a database type used for converting the logic model to be converted into a physical model;
searching whether the target database type exists in a model conversion table, wherein the model conversion table comprises a mapping relation between the attribute data type of each logic model and the physical model data type corresponding to at least one database type, and each database type corresponds to one or more physical model data types;
and when the target database type exists in the model conversion table, converting the logic model to be converted into a corresponding physical model according to a mapping relation recommended by a user, wherein the physical model comprises a physical table corresponding to the logic entity and a table field corresponding to the entity attribute of the logic entity.
Optionally, the converting the logical model to be converted into the corresponding physical model according to the mapping relationship recommended by the user includes:
when the target database type contains one or more mapping relations, displaying a conversion indication option to a user, and receiving a conversion indication input by the user according to the conversion indication option, wherein the conversion indication is used for indicating whether conversion is carried out according to a preset mapping relation recommended by the user, and the mapping relation recommended by the user is one of the mapping relations between the attribute data type of the logic model to be converted and the physical model data type corresponding to the target database type;
and when the conversion indication is used for indicating conversion according to the mapping relationship recommended by the user, converting the logic model to be converted into a corresponding physical model according to the mapping relationship recommended by the user.
Optionally, the method further includes:
when the conversion indication is used for indicating that conversion is not performed according to the mapping relationship recommended by the user and the target database type comprises a plurality of mapping relationships, displaying other mapping relationships in the mapping relationships included in the target database type except the mapping relationship recommended by the user;
and acquiring a target mapping relation selected by a user from the other mapping relations, and converting the logic model to be converted into a corresponding physical model according to the target mapping relation selected by the user.
Optionally, the method further includes:
and when the conversion indication is used for indicating that the conversion is not carried out according to the mapping relation recommended by the user and only one mapping relation is contained in the target database type, displaying other database types except the target database type in the model conversion table, wherein the other database types are used for the user to select a new database type.
Optionally, before the obtaining of the logic model to be converted and the target database type, the method further includes:
generating the model conversion table according to the database design requirements of a user, wherein the design requirements comprise the attribute data type of the logic model to be converted, the required database type and the physical model data type under each database type corresponding to the logic model data type to be converted;
and according to the attribute data type of the logic model to be converted, setting a corresponding physical model data type under each database type as the mapping relation recommended by the user for the attribute data type of each logic model in the model conversion table, wherein the mapping relation recommended by the user is the physical model data type appointed by the user.
Optionally, the method further includes:
when the target database type does not exist in the model conversion table, adding the target database type in the model conversion table;
when the target database type contains a plurality of mapping relations, setting one of the mapping relations selected by the user as a mapping relation recommended by the user;
and when the target database type only contains one mapping relation, automatically setting the mapping relation contained in the target database type as the mapping relation recommended by the user.
In a second aspect, the present application provides an apparatus for automatically converting a logical model into a physical model, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a logic model to be converted and a target database type, the logic model comprises at least one logic entity and at least one entity attribute corresponding to the logic entity, and the target database type is a database type used for converting the logic model to be converted into a physical model;
the searching module is used for searching whether the target database type exists in a model conversion table, wherein the model conversion table comprises a mapping relation between the attribute data type of each logic model and the physical model data type corresponding to at least one database type, and each database type corresponds to one or more physical model data types;
and the conversion module is used for converting the logic model to be converted into a corresponding physical model according to a mapping relation recommended by a user when the target database type exists in the model conversion table, wherein the physical model comprises a physical table corresponding to the logic entity and a table field corresponding to the entity attribute of the logic entity.
In a third aspect, the present application provides an apparatus for automatically converting a logical model into a physical model, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the method of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the method for automatically converting a logical model into a physical model according to the first aspect is implemented.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the method of the first aspect.
According to the method and the device for automatically converting the logic model into the physical model, the server obtains the logic model to be converted and the target database type, then whether the target database type exists in the model conversion table is searched, the model conversion table is generated according to the design requirements of a user, and the model conversion table comprises the mapping relation between the attribute data type of each logic model and the physical model data type corresponding to at least one database type. And when the target database type exists in the model conversion table, the server converts the logic model to be converted into the corresponding physical model according to the mapping relation recommended by the user. The user can realize the extension of the database type by configuring the model conversion table, and can also meet the individual requirements of the user on the data type mapping relation for converting the logical model into the physical model.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
FIG. 1 is a schematic diagram illustrating the conversion of a logical model to a physical model according to the present application;
FIG. 2 is a schematic flowchart illustrating a method for automatically converting a logical model into a physical model according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an automatic conversion device from a logical model to a physical model according to a second embodiment of the present application;
fig. 4 is a schematic structural diagram of an automatic conversion device from a logical model to a physical model according to a third embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
Current database design tools, which typically provide automatic conversion of logical models to physical models, support the conversion of logical models to multiple database types, depending on the database type. However, due to the limited database types supported by current database design tools, users cannot convert logical models to emerging database types during physical model design. Moreover, when the mapping from the logical data type to the physical data type has a one-to-many relationship, for example, when the logical type is char type and corresponds to Oracle database type, the corresponding physical data type may be char type or varchar2 type, but the current logical model is automatically converted into the default physical model type, and the user cannot flexibly select the mapping relationship from the logical model data type to the physical model data type.
Therefore, the application provides an automatic conversion method and device from a logic model to a physical model, a model conversion table is provided, the model conversion table comprises a conversion mapping relation from a logic model data type set by a user to a physical model data type under each database type, when the logic model is converted to the physical model, the corresponding conversion mapping relation is searched according to the model conversion table, and the conversion of the model can be realized according to the conversion mapping relation, so that the expansion of the database type by the user is supported, the requirement of the user on an emerging database type is quickly responded, the recommended mapping relation can be flexibly set by the user according to the requirement, and the individual requirement of the user is met.
Before explaining terms such as logical models and physical models related to the present application, a first stage of database design, namely, conceptual model design, is explained, wherein the conceptual model is a description of things in a problem domain in the real world, for example, in a sales service, there are entities such as customers, orders, commodities and salesmen, and the relationship between the entities can be described as that "salesmen" and "customers" purchase "and then sign" orders ". A conceptual model generally uses an Entity-relationship diagram (E-R diagram for short), and the E-R diagram mainly comprises three elements of an Entity, an attribute and a relationship.
The following explains the terms referred to in the present application:
logic model: the logic model comprises a plurality of logic entities and a plurality of attributes corresponding to the logic entities. The logic model design stage is to embody the conceptual model, the information described by the conceptual model, which specific functions are needed and which specific information is processed. For example, entities in the conceptual model are specified, the "customer" information includes attributes such as unit name, contact telephone and address, the "commodity" information includes attributes such as name, type, specification and unit price, the "order" information includes attributes such as date and time, and it is explicitly required to establish several data sheet operator information tables, customer information tables, commodity information tables and order tables.
Physical model: the physical model comprises a physical table and table fields, and the physical model design stage is to reflect the contents described by the logic model on a specific physical medium to realize the conversion from the logic model to the physical model. That is, the logical model only indicates what the database system needs to be implemented, but what implementation and what tools need to be implemented are implemented in the physical model design phase. For example, the database uses a Structured Query Language (SQL) server, so that a specific SQL script can be written to build the database on the database server, wherein the specific SQL script includes an operator information table, a customer information table, a commodity information table, and a list table.
Fig. 1 is a schematic diagram illustrating conversion from a logical model to a physical model according to the present application, where the logical model 101 includes logical entities and entity attributes, and the physical model 102 includes physical tables and table fields. The logical model 101 is converted into the physical model 102 through the model conversion table 103, specifically, a logical entity in the logical model 101 is converted into a physical table in the physical model 102, and an entity attribute in the logical model 101 is converted into a table field in the physical model 102. The model conversion table 103 includes a mapping relationship between at least one attribute data type of at least one logical model, at least one database type, and at least one physical model data type corresponding to the database type, for example, the physical database types include Oracle, MySQL, and SQLserver, refer to table one:
watch 1
Taking a logical model data type char as an example, a mapping relationship exists in the table under three database types of Oracle, MySQL and SQLserver, that is, under an Oracle database, the logical model data type char may be converted into a char type, or may be converted into a Varchar2 type, and when the table is generated, one of the mapping relationships may be set as a recommended mapping relationship. Similarly, other logical model data types are set with a recommended mapping relationship under each database type, and when the logical model 101 is converted to the physical model 102 through the conversion tool, conversion can be performed according to the recommended mapping relationship, so that the conversion of the model meets the requirements of the user.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following embodiments may exist independently or in combination, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is a schematic flowchart of a method for automatically converting a logical model into a physical model according to an embodiment of the present application, where the method may be performed by an apparatus for automatically converting a logical model into a physical model, and the apparatus may be a server, and the method includes the following steps.
S201, obtaining a logic model to be converted and a target database type.
Before the server acquires the logic model to be converted and the target database type, a model conversion table can be generated according to the database design requirements of the user, namely, each database type in the design requirements and the physical model data type under the database type are added into the model conversion table, so that the expansion of the database type can be realized, and the requirements of the user on emerging database types are met. The model conversion table comprises at least one attribute data type of a logic model, at least one database type and a mapping relation of at least one physical model data type corresponding to the database type. The design requirements comprise the attribute data type of the logic model to be converted, the required database type and the physical model data type under each database type corresponding to the logic model data type to be converted. For example, the attribute data types of the logical model to be converted are Char, Int, and the like, the types of the required databases are Oracle, MySQL, and the like, the physical model data types under the Oracle database corresponding to the attribute data type Char of the logical model are Char and Varchar2, the physical model data types under the MySQL database corresponding to the attribute data type Char of the logical model are Char and Varchar, the attribute data types Int of the logical model are similar, and the specific mapping relationship may refer to table one.
It should be noted that the design requirements of the user also include application requirements of the user, that is, features of data to be stored or applications of the data, and the mapping relationship in the model conversion table may be determined according to these information. For example, in the mapping relationship set in the table, the attribute data type char of the logical model may be mapped and converted with the physical model data type Varchar2 in the Oracle database, or may be mapped and converted with char or Varchar 2. The present application does not restrict the fixed correspondence of attribute data types of a certain logical model to certain physical model data types.
After the model conversion table is determined, a user can set a physical model data type corresponding to each database type in the server for the attribute data type of each logic model in the model conversion table as a mapping relation recommended by the user, and the mapping relation recommended by the user is the physical model data type specified by the user in a configuration mapping relation interface, so that the user can use the recommended mapping relation set by the user during model conversion to realize the model conversion.
When a user completes concept model design and logic model design and further needs to perform physical model design, namely the logic model needs to be converted into the physical model, the server can acquire the logic model to be converted and a target database type selected by the user in the logic model designed in advance, the logic model comprises at least one logic entity and attributes corresponding to the at least one logic entity, and the target database type is the database type used for converting the logic model to be converted into the physical model.
Specifically, the user may select a target database type from a list of database types displayed by the server, or the user may input a name of the target database type, for example, MySQL.
S202, whether the target database type exists in the model conversion table is searched.
After the target database type is obtained, the server searches whether the target data type exists in the model conversion table or not so as to perform the next conversion.
And S203, when the target database type exists in the model conversion table, converting the logic model to be converted into the corresponding physical model according to the mapping relation recommended by the user.
When the target database type exists in the model conversion table, the server converts the logical model to be converted into the corresponding physical model according to the mapping relationship recommended by the user, specifically, the server converts the logical entity of the logical model to be converted into the physical table in the physical model, namely, the name of the entity corresponds to the name of the physical table, for example, if the entity is a student, the name of the physical table is a student table. The data types of the entity attributes corresponding to each logical entity of the logical model to be converted are converted into table fields in the physical table, for example, the student entity attributes are name, age, school number and the like, and the table fields in the student table are name, age, school number and the like.
The recommended mapping relationship is one of mapping relationships between the attribute data type of the logic model to be converted and the physical model data type corresponding to the target database type. The recommended mapping relation can be selected from a plurality of mapping relations included in the target database type by the user according to the requirement of the user, or can be automatically set by the server according to user information or other contents.
Optionally, when the target database type includes one or more mapping relationships, the server may display a conversion indication option to the user, that is, the server may display an indication option to the user whether to perform conversion according to the recommended mapping relationship, where the conversion indication is used to indicate whether to perform conversion according to the mapping relationship recommended by the user. Specifically, the conversion indication option may be a "yes" or "no" option. Optionally, the user may click on the mapping relationship to view a specific data type mapping. After the user selects the option, the server may obtain a conversion instruction input by the user according to the conversion instruction option, and when the conversion instruction is converted according to a preset mapping relationship recommended by the user, the server may convert the logical model to be converted into the corresponding physical model according to the mapping relationship recommended by the user according to the instruction.
Of course, when one or more mapping relationships are included in the target database type, the server may also perform model conversion by default using the mapping relationship recommended by the user without confirming to the user. In this scenario, the user may modify the mapping relationship recommended by the user through the configuration page, that is, after the mapping relationship recommended by the user is set for the first time, the mapping relationship recommended by the user may be modified again.
Optionally, when the conversion instruction of the user is used to instruct that the conversion is not performed according to the mapping relationship recommended by the user, and the target database type includes multiple mapping relationships, the server may display, to the user, other mapping relationships, except the mapping relationship recommended by the user, in the mapping relationships included in the target database type, and after the user selects a target mapping relationship from the mapping relationships, the server may obtain the target mapping relationship selected by the user from the other mapping relationships, so that the user may flexibly set the mapping relationship of the model conversion according to the user's needs, that is, the personalized needs of the user for the mapping relationship of the data type in which the logical model is converted into the physical model are satisfied. And the server converts the logic model to be converted into a corresponding physical model according to the target mapping relation selected by the user.
Optionally, when the conversion indication of the user is used to indicate that the conversion is not performed according to the recommended mapping relationship, and the target database type only includes one mapping relationship, the server may display, to the user, other database types in the model conversion table except for the target database type, where the other database types are used for the user to reselect the database type. The server may then continue to display a conversion indication option to the user asking the user whether to convert according to the user recommended mapping relationship in the reselected database type, and the server may perform the next processing according to the indication:
and when the conversion instruction of the user is used for indicating conversion according to the mapping relationship recommended by the user, the server converts the logic model to be converted into the corresponding physical model according to the mapping relationship recommended by the user.
Or, when the conversion instruction of the user is still used for indicating that the conversion is not performed according to the recommended mapping relationship and the new database type includes multiple mapping relationships, the server may convert the logical model to be converted into the physical model corresponding to the new database type according to the obtained mapping relationship corresponding to the new database type selected by the user.
Or, when the conversion indication of the user is still used for indicating that the conversion is not performed according to the recommended mapping relationship and only one mapping relationship is included in the new database type, the server may continue to display other database types, except for the target database type and the new database type selected by the user, in the model conversion table to the user, so that the user may reselect the new database type.
In the model conversion process, a user can also add a new database type into the target conversion table, namely when the target database type does not exist in the model conversion table, the user can add the target database type into the model conversion table through the server, so that the requirement of the user on the emerging database type can be quickly responded in the conversion process. Then the server judges whether the target database type contains various mapping relations, and when the target database type contains various mapping relations, the server can set one of the mapping relations selected by the user as the mapping relation recommended by the user.
When the target database type only contains one mapping relationship, the server can automatically set the mapping relationship contained in the target database type as the recommended mapping relationship.
The conversion process may be understood as a process of generating a corresponding physical table according to the logical entity and the entity attribute in the logical model, where the physical table includes table fields, and the conversion process from the logical model to the physical model may be understood as a design of a table structure, where data items corresponding to the entity are not stored in the table.
In this embodiment, the server obtains a logical model to be converted and a target database type, and then searches whether the target database type exists in a model conversion table, where the model conversion table is generated according to the design requirement of a user, and the model conversion table includes a mapping relationship between an attribute data type of each logical model and a physical model data type corresponding to at least one database type. And when the target database type exists in the model conversion table, the server converts the logic model to be converted into the corresponding physical model according to the mapping relation recommended by the user. The user can realize the extension of the database type by configuring the model conversion table, and can also meet the individual requirements of the user on the data type mapping relation for converting the logical model into the physical model.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an automatic conversion apparatus from a logical model to a physical model according to a second embodiment of the present application. As shown in fig. 3, the apparatus 30 includes: an acquisition module 301, a lookup module 302, and a conversion module 303.
An obtaining module 301, configured to obtain a logic model to be converted and a target database type, where the logic model includes at least one logic entity and an entity attribute corresponding to the at least one logic entity, and the target database type is a database type used for converting the logic model to be converted into a physical model.
The searching module 302 is configured to search whether a target database type exists in a model conversion table, where the model conversion table includes a mapping relationship between an attribute data type of each logic model and a physical model data type corresponding to at least one database type, where each database type corresponds to one or more physical model data types.
The conversion module 303 is configured to, when the target database type exists in the model conversion table, convert the logical model to be converted into a corresponding physical model according to a mapping relationship recommended by a user, where the physical model includes a physical table corresponding to the logical entity and a table field corresponding to an attribute of the logical entity.
Optionally, the conversion module 303 is specifically configured to:
when the target database type contains one or more mapping relations, displaying a conversion indication option to a user, receiving a conversion indication input by the user according to the conversion indication option, wherein the conversion indication is used for indicating whether conversion is carried out according to a preset user recommended mapping relation, and the user recommended mapping relation is one of the mapping relations between the attribute data type of the logic model to be converted and the physical model data type corresponding to the target database type.
And when the conversion indication is used for indicating conversion according to the mapping relationship recommended by the user, converting the logic model to be converted into the corresponding physical model according to the mapping relationship recommended by the user.
Optionally, when the conversion indication is used to indicate that conversion is not performed according to the mapping relationship recommended by the user, and the target database type includes multiple mapping relationships, displaying other mapping relationships, except the mapping relationship recommended by the user, in the mapping relationships included in the target database type.
And acquiring a target mapping relation selected by a user from other mapping relations, and converting the logic model to be converted into a corresponding physical model according to the target mapping relation selected by the user.
Optionally, when the conversion indication is used to indicate that the conversion is not performed according to the mapping relationship recommended by the user, and the target database type only includes one mapping relationship, the other database types except the target database type in the model conversion table are displayed, and the other database types are used for the user to select a new database type.
Optionally, before obtaining the logic model to be converted and the target database type, the method further includes:
and generating a model conversion table according to the database design requirements of a user, wherein the design requirements comprise the attribute data type of the logic model to be converted, the required database type and the physical model data type under each database type corresponding to the logic model data type to be converted.
And respectively setting a physical model data type corresponding to each database type as a mapping relation recommended by a user for the attribute data type of each logic model in the model conversion table according to the attribute data type of the logic model to be converted, wherein the mapping relation recommended by the user is the physical model data type appointed by the user.
Optionally, when the target database type does not exist in the model conversion table, the target database type is added in the model conversion table.
When the target database type contains a plurality of mapping relations, setting one of the mapping relations selected by the user as the mapping relation recommended by the user.
When the target database type only contains one mapping relation, the mapping relation contained in the target database type is automatically set as the mapping relation recommended by the user.
The apparatus of this embodiment may be configured to execute the method for automatically converting a logic model into a physical model in the first embodiment, and the specific implementation manner and the technical effect are similar and will not be described herein again.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an automatic conversion apparatus from a logical model to a physical model according to a third embodiment of the present application. The apparatus 40 comprises: the processor 401 executes a computer execution instruction stored in the memory 402, and controls a receiving action and a sending action of the transceiver 703, so that at least one processor executes steps of the method for automatically converting a logic model into a physical model according to the first embodiment.
A fourth embodiment of the present application provides a computer-readable storage medium, where a computer-executable instruction is stored in the computer-readable storage medium, and the computer-executable instruction is used by a processor to implement the steps of the method for automatically converting a logic model into a physical model according to the first embodiment, where a specific implementation manner and a technical effect are similar, and are not described herein again.
A fifth embodiment of the present invention provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for automatically converting a logic model into a physical model according to the first embodiment is implemented, and the specific implementation manner and the technical effect are similar, and are not described herein again.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (10)
1. A method for automatic conversion of a logical model to a physical model, comprising:
acquiring a logic model to be converted and a target database type, wherein the logic model comprises at least one logic entity and at least one entity attribute corresponding to the logic entity, and the target database type is a database type used for converting the logic model to be converted into a physical model;
searching whether the target database type exists in a model conversion table, wherein the model conversion table comprises a mapping relation between the attribute data type of each logic model and the physical model data type corresponding to at least one database type, and each database type corresponds to one or more physical model data types;
and when the target database type exists in the model conversion table, converting the logic model to be converted into a corresponding physical model according to a mapping relation recommended by a user, wherein the physical model comprises a physical table corresponding to the logic entity and a table field corresponding to the entity attribute of the logic entity.
2. The method according to claim 1, wherein the converting the logical model to be converted into the corresponding physical model according to the mapping recommended by the user comprises:
when the target database type contains one or more mapping relations, displaying a conversion indication option to a user, and receiving a conversion indication input by the user according to the conversion indication option, wherein the conversion indication is used for indicating whether conversion is carried out according to a preset mapping relation recommended by the user, and the mapping relation recommended by the user is one of the mapping relations between the attribute data type of the logic model to be converted and the physical model data type corresponding to the target database type;
and when the conversion indication is used for indicating conversion according to the mapping relationship recommended by the user, converting the logic model to be converted into a corresponding physical model according to the mapping relationship recommended by the user.
3. The method of claim 2, further comprising:
when the conversion indication is used for indicating that conversion is not performed according to the mapping relationship recommended by the user and the target database type comprises a plurality of mapping relationships, displaying other mapping relationships in the mapping relationships included in the target database type except the mapping relationship recommended by the user;
and acquiring a target mapping relation selected by a user from the other mapping relations, and converting the logic model to be converted into a corresponding physical model according to the target mapping relation selected by the user.
4. The method of claim 2, further comprising:
and when the conversion indication is used for indicating that the conversion is not carried out according to the mapping relation recommended by the user and only one mapping relation is contained in the target database type, displaying other database types except the target database type in the model conversion table, wherein the other database types are used for the user to select a new database type.
5. The method according to any one of claims 1-4, wherein before obtaining the logical model to be transformed and the target database type, further comprising:
generating the model conversion table according to the database design requirements of a user, wherein the design requirements comprise the attribute data type of the logic model to be converted, the required database type and the physical model data type under each database type corresponding to the logic model data type to be converted;
and according to the attribute data type of the logic model to be converted, setting a corresponding physical model data type under each database type as the mapping relation recommended by the user for the attribute data type of each logic model in the model conversion table, wherein the mapping relation recommended by the user is the physical model data type appointed by the user.
6. The method according to any one of claims 1-4, further comprising:
when the target database type does not exist in the model conversion table, adding the target database type in the model conversion table;
when the target database type contains a plurality of mapping relations, setting one of the mapping relations selected by the user as a mapping relation recommended by the user;
and when the target database type only contains one mapping relation, automatically setting the mapping relation contained in the target database type as the mapping relation recommended by the user.
7. An apparatus for automatically converting a logical model into a physical model, comprising:
the system comprises an acquisition module, a conversion module and a conversion module, wherein the acquisition module is used for acquiring a logic model to be converted and a target database type, the logic model comprises at least one logic entity and at least one entity attribute corresponding to the logic entity, and the target database type is a database type used for converting the logic model to be converted into a physical model;
the searching module is used for searching whether the target database type exists in a model conversion table, wherein the model conversion table comprises a mapping relation between the attribute data type of each logic model and the physical model data type corresponding to at least one database type, and each database type corresponds to one or more physical model data types;
and the conversion module is used for converting the logic model to be converted into a corresponding physical model according to a mapping relation recommended by a user when the target database type exists in the model conversion table, wherein the physical model comprises a physical table corresponding to the logic entity and a table field corresponding to the entity attribute of the logic entity.
8. An apparatus for automatically converting a logical model into a physical model, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the method of any of claims 1-5.
9. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor implement a method for automatic conversion of a logical model into a physical model according to any one of claims 1 to 5.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210055950.9A CN114385598A (en) | 2022-01-18 | 2022-01-18 | Automatic conversion method and device from logic model to physical model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210055950.9A CN114385598A (en) | 2022-01-18 | 2022-01-18 | Automatic conversion method and device from logic model to physical model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114385598A true CN114385598A (en) | 2022-04-22 |
Family
ID=81203631
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210055950.9A Pending CN114385598A (en) | 2022-01-18 | 2022-01-18 | Automatic conversion method and device from logic model to physical model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114385598A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111291025A (en) * | 2020-03-10 | 2020-06-16 | 北京东方金信科技有限公司 | Method for supporting multi-physical model conversion by logic model and storage device |
CN112000643A (en) * | 2020-08-07 | 2020-11-27 | 杭州数梦工场科技有限公司 | Method and device for processing data model |
CN112395370A (en) * | 2020-11-26 | 2021-02-23 | 北京中电普华信息技术有限公司 | Data processing method, device, equipment and storage medium |
-
2022
- 2022-01-18 CN CN202210055950.9A patent/CN114385598A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111291025A (en) * | 2020-03-10 | 2020-06-16 | 北京东方金信科技有限公司 | Method for supporting multi-physical model conversion by logic model and storage device |
CN112000643A (en) * | 2020-08-07 | 2020-11-27 | 杭州数梦工场科技有限公司 | Method and device for processing data model |
CN112395370A (en) * | 2020-11-26 | 2021-02-23 | 北京中电普华信息技术有限公司 | Data processing method, device, equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
乐丁惕;: "ERwin在数据库设计中的应用研究", 唐山学院学报, no. 06, 15 November 2008 (2008-11-15) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8019783B2 (en) | Search interface for finding data items of interest from a database system | |
US6496838B1 (en) | Database reconciliation method and system | |
CN108228817A (en) | Data processing method, device and system | |
CN100465953C (en) | Iterative data analysis process via query result augmentation and result data feedback | |
CN108319661A (en) | A kind of structured storage method and device of spare part information | |
US20220114158A1 (en) | Data processing methods, apparatuses and devices | |
WO2011081909A2 (en) | Distributed platform for network analysis | |
KR101475335B1 (en) | Enhancing an inquiry for a search of a database | |
CN106940721B (en) | Data processing method and system for user-defined selection box | |
CN111061733B (en) | Data processing method, device, electronic equipment and computer readable storage medium | |
US7373350B1 (en) | Virtual metadata analytics and management platform | |
US20070050332A1 (en) | Method and apparatus for providing a comparative product information of related products | |
JP6963062B1 (en) | Information processing device and information processing method | |
US20150161224A1 (en) | Optimized Network Analysis Rendering and User Interfaces | |
EP1515250A2 (en) | Method and apparatus for information search | |
CN117453980A (en) | Metadata management, configuration page generation method, server and storage medium | |
US20060069679A1 (en) | System for creating associative records | |
CN114385598A (en) | Automatic conversion method and device from logic model to physical model | |
CN112948441B (en) | Multi-dimensional data collection method and equipment for financial data | |
US20080183669A1 (en) | Method and system for displaying results of a dynamic search | |
US8170973B2 (en) | Satisfying rules through a configuration of list processing methods | |
US20240289339A1 (en) | Computer system and data providing method | |
JP2020091594A (en) | Design information retrieval device, design information retrieval method and program | |
CN109344249A (en) | Information processing method, device, electronic equipment and computer readable storage medium | |
CN115455010B (en) | Data processing method based on milvus database, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |