CN113111065A - Database creation method and device, computer equipment and storage medium - Google Patents

Database creation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113111065A
CN113111065A CN202110395646.4A CN202110395646A CN113111065A CN 113111065 A CN113111065 A CN 113111065A CN 202110395646 A CN202110395646 A CN 202110395646A CN 113111065 A CN113111065 A CN 113111065A
Authority
CN
China
Prior art keywords
database
information
database object
object identification
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110395646.4A
Other languages
Chinese (zh)
Inventor
姜双
孟宪志
谢永恒
程强
冯宇波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ruian Technology Co Ltd
Original Assignee
Beijing Ruian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ruian Technology Co Ltd filed Critical Beijing Ruian Technology Co Ltd
Priority to CN202110395646.4A priority Critical patent/CN113111065A/en
Publication of CN113111065A publication Critical patent/CN113111065A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • G06F16/24573Query processing with adaptation to user needs using data annotations, e.g. user-defined metadata
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a database creating method, a database creating device, database creating equipment and a storage medium. The method comprises the following steps: determining target database type information and database object identification associated information matched with the target database type information; generating a target data structure model according to the database object identification correlation information; and creating a target database instance according to the database creating instruction, and importing the target data structure model into the target database instance. The embodiment of the invention can ensure the integrity and the uniformity of the structured data elements of the database and improve the stability of the associated items of the database.

Description

Database creation method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a database creation method, a database creation device, computer equipment and a storage medium.
Background
The database stores a large amount of data in the project and data relationships determined by business logic, resulting in a significant amount of effort in creating the database. In the prior art, in order to ensure reasonable distribution of project schedule and workload, database creation work in the same project often needs to be divided according to business modules and then submitted to a plurality of developers for responsibility. However, due to the personal mind difference of different developers, no uniform specification exists in the database creation process, and the complete structure of the combined databases of different business modules is relatively disordered, so that the integrity and the uniformity of the structured data elements of the databases are damaged, and the stability of the project is seriously influenced.
Disclosure of Invention
The embodiment of the invention provides a database creating method and device, computer equipment and a storage medium, which are used for ensuring the integrity and the uniformity of structured data elements of a database and improving the stability of database associated projects.
In a first aspect, an embodiment of the present invention provides a database creation method, including:
determining target database type information and database object identification associated information matched with the target database type information;
generating a target data structure model according to the database object identification correlation information;
and creating a target database instance according to the database creating instruction, and importing the target data structure model into the target database instance.
In a second aspect, an embodiment of the present invention further provides a database creating apparatus, including:
the information determining module is used for determining target database type information and database object identification associated information matched with the target database type information;
the model generation module is used for generating a target data structure model according to the database object identification correlation information;
and the instance creating module is used for creating a target database instance according to the database creating instruction and importing the target data structure model into the target database instance.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the database creation method provided by any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the database creation method provided in any embodiment of the present invention.
According to the embodiment of the invention, the target data structure model is generated by determining the type information of the target database and the database object identification association information matched with the type information of the target database, so that the target data structure model is imported into a newly created database instance to realize database creation, a database can be created according to the type matching information aiming at different database types, the integrity and the uniformity of the structured data elements of the database are ensured, and the stability of database association items is improved.
Drawings
Fig. 1 is a flowchart of a database creation method according to an embodiment of the present invention.
Fig. 2 is a flowchart of a database creating method according to a second embodiment of the present invention.
Fig. 3 is a schematic interface diagram for configuring a MySQL database object according to a second embodiment of the present invention.
Fig. 4 is a schematic interface diagram for configuring a MySQL database object according to a second embodiment of the present invention.
Fig. 5 is a schematic interface diagram for configuring a MySQL database object according to a second embodiment of the present invention.
Fig. 6 is a schematic interface diagram for configuring a MySQL database object according to a second embodiment of the present invention.
Fig. 7 is a schematic interface diagram for configuring an SQLServer database object according to the second embodiment of the present invention.
Fig. 8 is a schematic interface diagram for configuring an SQLServer database object according to the second embodiment of the present invention.
Fig. 9 is a schematic interface diagram for configuring an SQLServer database object according to the second embodiment of the present invention.
Fig. 10 is a schematic structural diagram of a database creating apparatus according to a third embodiment of the present invention.
Fig. 11 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a database creating method according to an embodiment of the present invention, where the present embodiment is applicable to a case where a database is created according to information matched according to types for different database types, and the method may be executed by a database creating apparatus according to an embodiment of the present invention, and the apparatus may be implemented by software and/or hardware, and may be generally integrated in a computer device. Accordingly, as shown in fig. 1, the method comprises the following operations:
s110, determining target database type information and database object identification associated information matched with the target database type information.
The target database type information may be information for describing the type of the database that needs to be created. The database object identification related information may be information for identifying a database to be created and any data element in the database, and may be any information that can play a role of unique identification, such as a unique name or a unique code.
Accordingly, after the database creation process is triggered, the target database type information may be determined. The database type information may be determined and input by a database developer as needed, or may be automatically determined by the database creation device according to default settings, which is not limited in this embodiment. The target database type information may be information describing any known database type. Optionally, the target database type information may be a MySQL database type, SQLServer database type, or Oracle database type. The database creating means may create a database of a corresponding type based on the determined target database type information.
Further, according to the determined type information of the target database, the database object identification association information matched with the type information of the target database can be determined. The database object identifier associated information matched with the target database type may be determined and input by a database developer as needed, or may be automatically determined by the database creation device according to a pre-stored identifier generation template matched with each target database type information, which is not limited in this embodiment. The created database and the identifier of the data element required to be created in the database can be further configured according to the database object identifier association information.
And S120, generating a target data structure model according to the database object identification correlation information.
The target data structure model may be a model for describing an association mapping relationship between data elements determined by business logic in a database to be created.
Correspondingly, the database to be created and the identifier of the data element to be created in the database can be determined according to the database object identifier association information, and then a target data structure model representing the relationship among the data elements can be generated according to the determined identifier. The generation process of the target data structure model can be triggered according to the corresponding instruction input by the database developer, and the target data structure model is constructed according to the information which is input by the database developer and describes the incidence mapping relation between the data elements. Illustratively, modeling software, such as Power Designer software, may be invoked according to the received instruction, and information describing the association mapping relationship between the Data elements is received through the modeling software, so as to generate a PDM (Physical Data Model) of the database according to the information, and obtain a target Data structure Model.
S130, creating a target database instance according to the database creating instruction, and importing the target data structure model into the target database instance.
The database creating instruction may be an instruction for triggering a database creating operation. The target database instance may be the memory structure and associated process structure of the database that needs to be created.
Accordingly, the database creation instructions may be input by a database developer. When a database creating instruction is received, a target database instance can be correspondingly created, and the generated target data structure model is imported into the newly created target database instance to realize corresponding database creation.
The embodiment of the invention provides a database creating method, which is characterized in that a target data structure model is generated by determining target database type information and database object identification correlation information matched with the target database type information, so that the target data structure model is led into a newly created database instance to achieve database creation, a database can be created according to the information matched with the type aiming at different database types, the integrity and the uniformity of structured data elements of the database are ensured, and the stability of database correlation items is improved.
Example two
Fig. 2 is a flowchart of a database creating method according to a second embodiment of the present invention. In the embodiment of the present invention, a specific optional implementation manner is provided for configuring a target database instance after creating the target database instance according to the database creation instruction and importing the target data structure model into the target database instance.
As shown in fig. 2, the method of the embodiment of the present invention specifically includes:
s210, determining target database type information and database object identification associated information matched with the target database type information.
Optionally, determining the type information of the target database and the database object identifier association information matched with the type information of the target database may include: determining type information of a target database; and determining database object identification associated information matched with the target database type information. Determining the database object identifier association information matched with the target database type information may include: determining a database object of the target database type information, and configuring database object identification correlation information of the database object. In particular, a database object may be a database and data elements in the database, such as tables and fields.
In an optional embodiment of the present invention, determining the database object identification association information matching with the target database type information may include: determining a first database object of a first database type under the condition that the target database type information is determined to be the first database type; configuring first database object identification association information of the first database object.
Wherein the first database object identification association information includes a first database object identification and a first database object identification spacer.
In particular, the first database type may be any known database type, the identification of which database and corresponding data elements comprises a particular form of text and a particular form of text spacer. The first database object may be a database of a first database type that needs to be created and data elements that need to be created in the database. The first database object identification association information may be information for identifying the first database object. The first database object identification may be a particular form of text in the identification of the first database object. The first database object identification spacer may be a text spacer in a particular form in the identification of the first database object.
Correspondingly, according to the determined target database type information as the first database type, the first database object may be determined, the database of the first database type that needs to be created may be included, and the data elements that need to be created in the database may be determined, for example, tables and fields may be included. Further, the first database object identification association information of the first database object may be configured to identify the first database object. The first database object identifier and the first database object identifier spacer may be preset and stored in the database creation device, or may be received and input by a database developer, which is not limited in this embodiment. Alternatively, the first database object identification spacer may be empty, i.e. the identification of the first database object may not include any delimiter symbols.
Optionally, the first database type may be an Oracle database type, and the first database object may include an Oracle database, a table, and a field, so that the corresponding database object identification association information may be configured to identify the Oracle database, the table, and the field. In one specific example, configuring the database object identification association information of the Oracle database, tables and fields may include configuring names of the Oracle database, tables and fields to include english word text in the form of capital letters and underlined separators between the english word text.
In an optional embodiment of the present invention, determining the database object identification association information matching with the target database type information may include: determining a second database object of a second database type under the condition that the target database type information is determined to be the second database type; determining first configuration information, and configuring second database object identification association information of the second database object according to the first configuration information; and determining second configuration information, and configuring third database object identification association information of the second database object according to the second configuration information.
The second database object identification association information comprises a second database object identification and a second database object identification spacer, and the third database object identification association information comprises a second database object identification and a second database object identification spacer.
Specifically, the second database type may be any known database type, and the database of the type and the identifier of the corresponding data element may be configured according to the first configuration information or the second configuration information. The second database object may be a database of a second database type that needs to be created and data elements that need to be created in the database. The second database object identification association information may be information for identifying at least one item in the second database object, and correspondingly, the third database object identification association information may be information for identifying other items in the second database object. The first configuration information may be information for configuring second database object identification association information, and the second configuration information may be information for configuring third database object identification association information. The second database object identification may be a particular form of text in the identification of the second database object. The second database object identification spacer may be a text spacer of a particular form in the identification of the second database object.
Correspondingly, the second database object may be determined according to the determined target database type information being the second database type. Further, the first configuration information and the second configuration information may be predetermined, and the second database object identification association information may be configured according to the first configuration information, so as to mark a corresponding part of the second database objects according to the second database object identification association information; third database object identification association information may be configured according to the second configuration information to mark a corresponding portion of the second database object according to the third database object identification association information. The second database object identifier and the second database object identifier spacer may be preset and stored in the database creation device, or may be received and input by a database developer, which is not limited in this embodiment. Alternatively, the second database object identification spacer may be empty, i.e. the identification of the second database object may not include any delimiter symbols.
Optionally, the second database type may be a SQLServer database type, and the second database object may be a SQLServer database, tables, and fields. Accordingly, in a specific example, the first configuration information may be Pascal name configuration information, and the names of the SQLServer database and the table may be configured according to the Pascal name configuration information; the second configuration information may be Camel name configuration information, and the name of the SQLServer field may be configured according to the Camel name configuration information.
In an optional embodiment of the present invention, determining the database object identification association information matching with the target database type information may include: determining a third database object of a third database type under the condition that the target database type information is determined to be the third database type; and configuring fourth database object identification correlation information of the third database object.
And the fourth database object identification correlation information comprises a third database object identification and a third database object identification spacer.
In particular, the third database type may be any known database type, the type of database and the identification of the corresponding data elements comprising a particular form of text and a particular form of text spacer. The third database object may be a database of a third database type that needs to be created and data elements that need to be created in the database. The fourth database object identification association information may be information for identifying the third database object. The third database object identification may be a particular form of text in the identification of the third database object. The third database object identification spacer may be a text spacer of a particular form in the identification of the third database object.
Correspondingly, a third database object may be determined according to the determined target database type information being the third database type. Further, fourth database object identification association information of the third database object may be configured, so as to identify the third database object. The third database object identifier and the third database object identifier spacer may be preset and stored in the database creation device, or may be received and input by a database developer, which is not limited in this embodiment. Alternatively, the third database object identification spacer may be empty, i.e. the identification of the third database object may not include any delimiter symbols.
Optionally, the third database type may be a MySQL database type, and the third database object may include a MySQL database, a table, and a field, so that the corresponding database object identification association information may be configured to identify the MySQL database, the table, and the field. In one particular example, configuring the database object identification association information for the MySQL database, tables, and fields may include configuring the names of the MySQL database, tables, and fields to include english word text in lower case and underlined separators between the english word text.
In an optional embodiment of the present invention, configuring the database object identification association information of the database object may include: determining a database object identifier and a database object identifier spacer in the database object identifier association information; and under the condition that the database object identification and the database object identification interval symbol are determined to simultaneously meet the set character information and the set length information, configuring the database object identification correlation information of the database object.
The database object identifier may be a text in a specific form in the identifier of any database object. The database object identification spacer may be a text spacer in the form of a particular one of the identifications of any database object. The set character information may be information for defining that characters may be included in the database object identification and the database object identification spacer. The set length information may be information for defining a total character length of the database object identification and the database object identification spacer.
Accordingly, the set character information and the set length information may be default values preset and stored in the database creation device as needed, or may be set by a developer for each database creation, which is not limited in this embodiment. After determining the database object identifier and the database object identifier spacer, checking whether the database object identifier and the database object identifier spacer are allowed characters according to the set character information, if so, meeting the set character information, otherwise, indicating that the database object identifier comprises the unallowable characters, and then, the database object identifier cannot be configured. Meanwhile, whether the total character length of the database object identifier and the database object identifier spacer is within an allowable length range or not can be checked according to the set length information, if so, the set character information is met, otherwise, the length of the database object identifier and the database object identifier spacer cannot be configured if the length of the database object identifier and the database object identifier spacer is too long or too short. Therefore, when the database object id association information satisfies both the set character information and the set length information, the database object id association information may be configured.
Alternatively, the setting of the character information may include information that may limit the inclusible characters of the database object id of the database, table to the range of the singular english word, the singular english phrase, or the corresponding abbreviation composed of a-Z and a-Z, may limit the inclusible characters of the database object id of the field to the range of the singular english word, the singular english phrase, or the corresponding abbreviation composed of a-Z and a-Z, and the numerals 0 to 9, and limit the database object id spacer of the database, table, and field to the lower "_" symbol in the latin text.
Specifically, the characters that can be included in the database object identifiers of the database and the table are limited to the range of singular english words, singular english phrases or corresponding abbreviations, for example, the names of the table storing guest information may be configured as "customers" instead of "customers" to realize that the identifiers are clear and can accurately express the meaning of things, and the principle of knowing the names is followed.
Furthermore, the character information is set to only allow the database object identifier of the field to contain numbers, for example, in the multi-picture uploading function, if only one field is created to store the picture name, the field value will contain the names of a plurality of pictures, and the names need to be separated by symbols; if the database object id of a field contains a number, multiple fields, such as image _ name1, image _ name2, and image _ name3, may be created, and the multiple picture names are stored separately, and the number of pictures that can be uploaded is limited, which is the case where the database object id of a field contains a number.
Alternatively, the set length information may include information that limits the database object identification and the database object identification spacer of the database, the table, and the field to 30 characters.
Accordingly, table 1 is a name length limitation of the original pair of tables and fields in the database management system provided in this embodiment. In addition to table 1, the name length of the database, table, and field can be limited to 30 characters based on the set length information.
TABLE 1
Figure BDA0003018504740000081
Further optionally, when the table name exceeds 15 characters or the field name exceeds 20 characters, the database object identifier association information may be redetermined, and the single english word or single english phrase in the database object identifier may be updated to the corresponding abbreviation. Specifically, the corresponding abbreviation may be a pre-stored known word abbreviation, or an abbreviation generated by deleting vowels and repeated letters except for the first letter in a word.
Further optionally, before updating the singular english word or the singular english phrase in the database object identifier to the corresponding abbreviation, the method may further include: for table names, if the main table name needs not to be updated to an abbreviation and the slave table name needs to be updated to an abbreviation, the slave table name is updated to the abbreviation from the second word, the first word remains unchanged, and the table name and the main table are consistent. For example, if the enterprise basic information table name is "enterprise", the enterprise litigation table "enterprise _ verification" may be abbreviated as "enterprise _ ltg", and the enterprise certificate table "enterprise _ certificate" may be abbreviated as "enterprise _ crt", which may implement that the final database table and the program generated by the database table are arranged by name in an IDE (Integrated Development Environment), and then the tables and class files with similar functions may be arranged together, which is convenient for the operation of the developer.
In an alternative embodiment of the present invention, if the database object includes a dictionary field, the identification of the configured dictionary field may include configuring a "Code" suffix for the encoded field and a "Text" suffix for the Text field.
In an alternative embodiment of the present invention, if the database object includes a Date and Time field, configuring the identification of the Date and Time field may include configuring the Date field to be day-accurate with a "Date" suffix and configuring the Time field to be Time, minute, or second accurate with a "Time" suffix.
In an alternative embodiment of the present invention, if the database object includes a Boolean type field, the identification of the configured Boolean type field may include configuring it with an "is" prefix. For example, the name of the success field may be configured as "is _ success", the name of the logout field may be configured as "is _ active", and the name of the display field may be configured as "is _ display".
In an optional embodiment of the present invention, after determining the database object, the method may further include: determining a primary key object of a database object; and configuring the primary key associated information of the primary key object.
Wherein the primary key associated information includes a primary key object identifier and a primary key object type.
In particular, the primary key object may be a column or combination of columns in a table of a database, the value of which may uniquely identify a row in the table. The primary key associated information may be information configuring a primary key object. The primary key object identification may be information identifying the primary key object. The primary key object type may be information describing a data type of the primary key object.
Accordingly, after the database object is determined, the primary key object needs to be determined. The mode of determining the primary key object may be to determine the primary key object according to a corresponding instruction of a developer, or to determine the primary key object according to a preset policy. The primary key related information may be determined based on information set in advance and stored in the database creating apparatus, or may be determined based on a corresponding instruction of a developer.
Optionally, determining the primary key object of the database object may include: determining that the primary key object is a UUID (universal Unique Identifier), and correspondingly, configuring the primary key object Identifier of the primary key object may be configuring the name of the primary key object as "id", and configuring the primary key object type of the primary key object may be configuring the data type of the primary key object as char (32) type.
Optionally, the identifier and type may also be configured for the out-of-table key, for example, the name of the out-of-table key may be configured as "primary table name _ field name" and the type may be configured as a field type in the primary table. Further optionally, if multiple foreign keys (fields) in a table refer to the same field of a table at the same time, the preceding and the following suffixes can be configured for distinguishing. Further, the foreign key constraint may configure "fk" as a prefix followed by the slave table name and the master table name, i.e., as "fk _ slave table name _ master table name".
And S220, generating a target data structure model according to the database object identification correlation information.
S230, creating a target database instance according to the database creating instruction, and importing the target data structure model into the target database instance.
And S240, determining example configuration information.
Wherein the instance configuration information comprises character encoding configuration information.
In particular, the instance configuration information may be information for further configuring data elements created under the target database instance. The character encoding configuration information may be information for configuring character encoding.
Correspondingly, the character encoding configuration information may be input by a developer as required, so that the character encoding configuration information may be determined from the received input information, or default character encoding configuration information may be determined from preset and stored information. Optionally, the example configuration information may also include any other configuration information, for example, information for configuring the character sequence may be included.
S250, configuring the target database instance according to the instance configuration information.
Correspondingly, after the instance configuration information is determined, the target database instance may be configured according to the instance configuration information, which may include configuring character codes according to the character code configuration information. After the character codes are configured, the same character code configuration can correspond to a certain number of character sequence configurations, including the default corresponding character sequence configuration of the character code configuration. For example, in the MySQL database, the character encoding may be configured as gbk, gb2312, utf8, lantin, etc., while if the character encoding is configured as gbk, the endianness may be configured as gbk _ chip _ ci by default; if the word encoding is configured as gb2312, the endianness may be configured as gb2312_ chip _ ci by default; if the character encoding configuration is utf8, the endianness may be configured as utf8_ general _ ci by default; if the character encoding of the table is configured as lantin1 and the field type is nvarchar, the endianness of the field may be automatically configured as utf 8.
Further optionally, the character order may be configured according to the character order configuration information, and the configuring may include performing character order configuration on a table, and may also include performing character order configuration on a field.
Accordingly, the endian configuration may specify how the data sets are ordered and how the strings are aligned. The different character sequence configurations of the same character encoding configuration are different in the accuracy of the ordering, character set comparison and performance, wherein the accuracy may refer to that the ordering rules of the same two characters in different national languages may be different, and the performance may refer to the ordering and comparison speed. For example, the endian configuration utf8_ general _ ci is inferior to the endian configuration utf8_ unicode _ ci in the accuracy of sorting, and of course, there should be no difference for english users, but the performance is slightly better than the endian configuration utf8_ unicode _ ci, for example, the former has no support for german β ═ ss, while the endian configuration utf8_ danish _ ci has increased support for special sorting of denmark than the configuration utf8_ unicode _ ci.
Further, the configuration priority of the character sequence can be divided into four types from top to bottom: the real decisive factor is in the field layer, if the real decisive factor is not specified, the real decisive factor is inherited from the previous layer, namely the field layer inherits the surface layer, the table inherits the database layer, the database layer inherits the server layer, the server layer needs to be set, and if the table is not set, the real decisive factor is default to be the latin1_ general _ ci.
For example, fig. 3 to 6 are schematic interface diagrams for configuring the MySQL database object provided in this embodiment. As shown in fig. 3 to 6, optionally, in the MySQL database, the character encoding configuration information may be information for configuring a character encoding into a UTF-8, and then the character encoding may be uniformly configured to the data elements in the database into the UTF-8 according to the character encoding configuration information. Further optionally, the data elements in the database may be uniformly configured with character order UTF-8_ Bin, where Bin may represent storing data in binary, comparing with coded values, and case-distinguishing. The method can configure the character order of the database, the table and the field, and if the character code and the character order of the database are directly configured, for example, the SLQ statement "ALTER SCHEMA 'bscatelmed' DEFAULT CHARACTER SET utf8 can be read in MySQL Workbench; ALTER SCHEMA 'bscatemed' DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_ bin; "and configured according to it, and may configure lower _ case _ table _ names as 1 in the database configuration file.
Fig. 7 to 9 are schematic diagrams of interfaces for configuring the SQLServer database object provided in this embodiment. AS shown in fig. 7 to 9, optionally, in the SQLServer DATABASE, the DATABASE and the field may be configured with the character order, for example, by reading the SQL statement "ALTER DATABASE health management column _ fine _ PRC _ CI _ AS" and configuring the character order according to the read SQL statement. Specifically, the character sequence may be configured AS Chinese _ PRC _ CS _ AS.
Specifically, optionally, in the Oracle database, the configuration may be made by calling a function Lower () or a function Upper () without case differentiation, and the configuration of the character order may also be implemented by calling a function NLSSORT ().
The embodiment of the invention provides a database creating method, which is characterized in that a target data structure model is generated by determining target database type information and database object identification correlation information matched with the target database type information, so that the target data structure model is led into a newly created database instance to realize database creation, a database can be created according to the information matched with the type aiming at different database types, the integrity and the uniformity of structured data elements of the database are ensured, and the stability of database correlation items is improved; furthermore, the integrity and the uniformity of the data elements are further improved by configuring the character codes, and the normalization and the rationality of the database in the using and maintaining processes are optimized.
EXAMPLE III
Fig. 10 is a schematic structural diagram of an apparatus according to a third embodiment of the present invention, and as shown in fig. 10, the apparatus includes: an information determination module 310, a model generation module 320, and an instance creation module 330.
The information determining module 310 is configured to determine target database type information and database object identifier association information matched with the target database type information.
And the model generating module 320 is configured to generate a target data structure model according to the database object identification association information.
The instance creating module 330 is configured to create a target database instance according to the database creating instruction, and import the target data structure model into the target database instance.
In an optional implementation manner of the embodiment of the present invention, the information determining module 310 may include: the first database object configuration submodule is used for determining a first database object of a first database type under the condition that the target database type information is determined to be the first database type; configuring first database object identification association information of the first database object; wherein the first database object identification association information includes a first database object identification and a first database object identification spacer.
In an optional implementation manner of the embodiment of the present invention, the information determining module 310 may include: the second database object configuration submodule is used for determining a second database object of a second database type under the condition that the target database type information is determined to be the second database type; determining first configuration information, and configuring second database object identification association information of the second database object according to the first configuration information; wherein the second database object identification association information comprises a second database object identification and a second database object identification spacer; determining second configuration information, and configuring third database object identification association information of the second database object according to the second configuration information; wherein the third database object identification association information includes a second database object identification and a second database object identification spacer.
In an optional implementation manner of the embodiment of the present invention, the information determining module 310 may include: a third database object configuration sub-module, configured to determine, when it is determined that the target database type information is a third database type, a third database object of the third database type; configuring fourth database object identification association information of the third database object; and the fourth database object identification correlation information comprises a third database object identification and a third database object identification spacer.
In an optional implementation manner of the embodiment of the present invention, the first database object configuration submodule, the second database object configuration submodule, and the third database object configuration submodule may be specifically configured to: determining a database object identifier and a database object identifier spacer in the database object identifier association information; and under the condition that the database object identification and the database object identification interval symbol are determined to simultaneously meet the set character information and the set length information, configuring the database object identification correlation information of the database object.
In an optional implementation manner of the embodiment of the present invention, the first database object configuration submodule, the second database object configuration submodule, and the third database object configuration submodule may further be configured to: after determining the database object, determining a primary key object of the database object; configuring primary key associated information of the primary key object; wherein the primary key associated information includes a primary key object identifier and a primary key object type.
In an optional implementation manner of the embodiment of the present invention, the apparatus may further include: an instance configuration module to determine instance configuration information; configuring the target database instance according to the instance configuration information; wherein the instance configuration information comprises character encoding configuration information.
The device can execute the database creation method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects for executing the database creation method.
The embodiment of the invention provides a database creating device, which is used for generating a target data structure model by determining target database type information and database object identification association information matched with the target database type information, so that the target data structure model is led into a newly created database instance to achieve database creation, a database can be created according to the information matched with the type aiming at different database types, the integrity and the uniformity of structured data elements of the database are ensured, and the stability of database association items is improved.
Example four
Fig. 11 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 11 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in fig. 11 is only an example and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in FIG. 11, computer device 12 is embodied in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors 16, a memory 28, and a bus 18 that connects the various system components (including the memory 28 and the processors 16).
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 11, and commonly referred to as a "hard drive"). Although not shown in FIG. 11, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, computer device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be appreciated that although not shown in FIG. 11, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 16 executes various functional applications and data processing by executing programs stored in the memory 28, thereby implementing the database creation method provided by the embodiment of the present invention: determining target database type information and database object identification associated information matched with the target database type information; generating a target data structure model according to the database object identification correlation information; and creating a target database instance according to the database creating instruction, and importing the target data structure model into the target database instance.
EXAMPLE five
Fifth, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for creating a database according to the fifth embodiment of the present invention is implemented: determining target database type information and database object identification associated information matched with the target database type information; generating a target data structure model according to the database object identification correlation information; and creating a target database instance according to the database creating instruction, and importing the target data structure model into the target database instance.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or computer device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A database creation method, comprising:
determining target database type information and database object identification associated information matched with the target database type information;
generating a target data structure model according to the database object identification correlation information;
and creating a target database instance according to the database creating instruction, and importing the target data structure model into the target database instance.
2. The method of claim 1, wherein determining database object identification association information that matches the target database type information comprises:
determining a first database object of a first database type under the condition that the target database type information is determined to be the first database type;
configuring first database object identification association information of the first database object; wherein the first database object identification association information includes a first database object identification and a first database object identification spacer.
3. The method of claim 1, wherein determining database object identification association information that matches the target database type information comprises:
determining a second database object of a second database type under the condition that the target database type information is determined to be the second database type;
determining first configuration information, and configuring second database object identification association information of the second database object according to the first configuration information; wherein the second database object identification association information comprises a second database object identification and a second database object identification spacer;
determining second configuration information, and configuring third database object identification association information of the second database object according to the second configuration information; wherein the third database object identification association information includes a second database object identification and a second database object identification spacer.
4. The method of claim 1, wherein determining database object identification association information that matches the target database type information comprises:
determining a third database object of a third database type under the condition that the target database type information is determined to be the third database type;
configuring fourth database object identification association information of the third database object; and the fourth database object identification correlation information comprises a third database object identification and a third database object identification spacer.
5. The method according to any one of claims 2-4, wherein configuring the database object identification association information of the database object comprises:
determining a database object identifier and a database object identifier spacer in the database object identifier association information;
and under the condition that the database object identification and the database object identification interval symbol are determined to simultaneously meet the set character information and the set length information, configuring the database object identification correlation information of the database object.
6. The method of any of claims 2-4, after determining the database object, further comprising:
determining a primary key object of a database object;
configuring primary key associated information of the primary key object; wherein the primary key associated information includes a primary key object identifier and a primary key object type.
7. The method of claim 1, after creating a target database instance according to the database creation instruction and importing the target data structure model into the target database instance, further comprising:
determining instance configuration information;
configuring the target database instance according to the instance configuration information;
wherein the instance configuration information comprises character encoding configuration information.
8. A database creation apparatus, comprising:
the information determining module is used for determining target database type information and database object identification associated information matched with the target database type information;
the model generation module is used for generating a target data structure model according to the database object identification correlation information;
and the instance creating module is used for creating a target database instance according to the database creating instruction and importing the target data structure model into the target database instance.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the database creation method according to any of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the database creation method according to any one of claims 1 to 7.
CN202110395646.4A 2021-04-13 2021-04-13 Database creation method and device, computer equipment and storage medium Pending CN113111065A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110395646.4A CN113111065A (en) 2021-04-13 2021-04-13 Database creation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110395646.4A CN113111065A (en) 2021-04-13 2021-04-13 Database creation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113111065A true CN113111065A (en) 2021-07-13

Family

ID=76716419

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110395646.4A Pending CN113111065A (en) 2021-04-13 2021-04-13 Database creation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113111065A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114275831A (en) * 2021-12-07 2022-04-05 佛山市美的清湖净水设备有限公司 Water purifier and control method thereof

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346720A (en) * 2020-10-22 2021-02-09 杭州安恒信息技术股份有限公司 Method, equipment and electronic device for generating custom code based on sql

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346720A (en) * 2020-10-22 2021-02-09 杭州安恒信息技术股份有限公司 Method, equipment and electronic device for generating custom code based on sql

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SNOWFLAKECLOUD: "数据库设计中的命名规范", pages 1 - 22, Retrieved from the Internet <URL:https://zoyi14.smartapps.cn/pages/note/index?slug=7e60dbd59138&origin=share&_swebfr=1&_swebFromHost=heytapbrowser> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114275831A (en) * 2021-12-07 2022-04-05 佛山市美的清湖净水设备有限公司 Water purifier and control method thereof

Similar Documents

Publication Publication Date Title
US10810472B2 (en) Techniques for sentiment analysis of data using a convolutional neural network and a co-occurrence network
US10891272B2 (en) Declarative language and visualization system for recommended data transformations and repairs
US10169437B2 (en) Triplestore replicator
US8108367B2 (en) Constraints with hidden rows in a database
US11120086B2 (en) Toponym disambiguation
CN111258966A (en) Data deduplication method, device, equipment and storage medium
US20120158742A1 (en) Managing documents using weighted prevalence data for statements
US11392697B2 (en) Detection of malware in documents
CN111125064B (en) Method and device for generating database schema definition statement
CN114328574A (en) Data query method and device, electronic equipment and computer-readable storage medium
US10248668B2 (en) Mapping database structure to software
CN116226166A (en) Data query method and system based on data source
CN113760947A (en) Data center, data processing method, device, equipment and storage medium
US20200218741A1 (en) Inferring location attributes from data entries
CN113111065A (en) Database creation method and device, computer equipment and storage medium
US10699069B2 (en) Populating spreadsheets using relational information from documents
EP3425531A1 (en) System, method, electronic device, and storage medium for identifying risk event based on social information
US20200394263A1 (en) Representation learning for tax rule bootstrapping
AU2022203744B2 (en) Converting from compressed language to natural language
US8818955B2 (en) Reducing storage costs associated with backing up a database
US20170277749A1 (en) Customize column sequence in projection list of select queries
JP7293544B2 (en) Q&amp;A system update processing method and device
US20230004989A1 (en) Customer recognition system
US11604801B2 (en) Techniques for accessing on-premise data sources from public cloud for designing data processing pipelines
CN114556326B (en) Method and system for generating natural language expression variants

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