CN112612794A - Auxiliary generation method and device of relational database, computer equipment and storage medium - Google Patents
Auxiliary generation method and device of relational database, computer equipment and storage medium Download PDFInfo
- Publication number
- CN112612794A CN112612794A CN202011589867.7A CN202011589867A CN112612794A CN 112612794 A CN112612794 A CN 112612794A CN 202011589867 A CN202011589867 A CN 202011589867A CN 112612794 A CN112612794 A CN 112612794A
- Authority
- CN
- China
- Prior art keywords
- field
- target
- configuration
- relational database
- type
- 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
- 238000000034 method Methods 0.000 title claims abstract description 37
- 238000012937 correction Methods 0.000 claims abstract description 26
- 238000012986 modification Methods 0.000 claims description 30
- 230000004048 modification Effects 0.000 claims description 30
- 238000012545 processing Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 9
- 230000003287 optical effect Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000000926 separation method Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000012552 review Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 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/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- 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
- G06F16/284—Relational databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/169—Annotation, e.g. comment data or footnotes
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses an auxiliary generation method and device of a relational database, computer equipment and a storage medium. Wherein the method comprises the following steps: when a generation request corresponding to a target relational database is detected, acquiring at least one data table included in the target relational database; acquiring the field configuration type of each field included in each data table, and performing configuration check on the field configuration type of each field according to a preset field type configuration table; identifying a first target field which does not pass the configuration check, and performing configuration correction on the field configuration type of the first target field; after configuration correction is completed, the target relational database is generated, so that standard management of the relational database can be realized, and the generation of the relational database is assisted.
Description
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to an auxiliary generation method and device of a relational database, computer equipment and a storage medium.
Background
The data of the database is the basis of all operations, and if the database is not well designed, the effect of improving the performance of the database by other methods is limited. The key of the database design is how to enable the database to reasonably and normatively store the data of the user, so that the user can conveniently process the data. The standardization aims to make the structure more reasonable, make the data redundancy as small as possible and facilitate the insertion, deletion and updating.
Disclosure of Invention
The embodiment of the invention provides an auxiliary generation method and device of a relational database, computer equipment and a storage medium, which can realize the standard management of the relational database and the auxiliary generation of the relational database.
In a first aspect, an embodiment of the present invention provides an auxiliary generation method for a relational database, where the method includes:
when a generation request corresponding to a target relational database is detected, acquiring at least one data table included in the target relational database;
acquiring the field configuration type of each field included in each data table, and performing configuration check on the field configuration type of each field according to a preset field type configuration table;
identifying a first target field which does not pass the configuration check, and performing configuration correction on the field configuration type of the first target field;
and after configuration correction is completed, generating the target relational database.
In a second aspect, an embodiment of the present invention further provides an auxiliary generation apparatus for a relational database, where the apparatus includes:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring at least one data table included in a target relational database when a generation request corresponding to the target relational database is detected;
the checking module is used for acquiring the field configuration types of the fields in the data tables and performing configuration checking on the field configuration types of the fields according to a preset field type configuration table;
the correction module is used for identifying a first target field which does not pass the configuration check and carrying out configuration correction on the field configuration type of the first target field;
and the generating module is used for generating the target relational database after the configuration correction is finished.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for assisting generation of a relational database according to the embodiment of the present invention when executing the computer program.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for assisting generation of a relational database according to the embodiment of the present invention.
According to the technical scheme provided by the embodiment of the invention, when the generation request corresponding to the target relational database is detected, at least one data table included in the target relational database is obtained, the field configuration type of each field included in each data table is obtained, the field configuration type of each field is subjected to configuration check according to a preset field type configuration table, the first target field which does not pass the configuration check is identified, the field configuration type of the first target field is subjected to configuration correction, and the target relational database is generated after the configuration correction is completed, so that the standard management of the relational database can be realized and the generation of the relational database is assisted.
Drawings
Fig. 1 is a flowchart of an auxiliary generation method for a relational database according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an auxiliary generation apparatus for a relational database according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a computer device provided in the 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 of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a flowchart of an auxiliary generation method for a relational database, which may be performed by an auxiliary generation apparatus for a relational database, where the apparatus may be implemented by software and/or hardware, and the apparatus may be configured in a computer device such as a server. Optionally, the method is applied in a scenario of assisting in generating a relational database. As shown in fig. 1, the technical solution provided by the embodiment of the present invention specifically includes:
s110, when a generation request corresponding to a target relational database is detected, at least one data table included in the target relational database is obtained.
Generally, after completing the construction of each data table in the target relational database, the user may trigger the generation of the generation request, so as to completely generate the target relational database.
In the embodiment of the present invention, optionally, the relational database is composed of a plurality of data tables, the data tables are two-dimensional tables, and the relationship between the things in the relational database is a relationship between the data tables and the data tables, and may be, for example, a one-to-one relationship, a one-to-many relationship, or a many-to-many relationship.
When a generation request corresponding to a target relational database is detected, at least one data table is obtained from the target relational database.
In an implementation manner of the embodiment of the present invention, optionally, after the obtaining at least one data table included in the target relational database, the method may further include: identifying an index field in each field of each of the data tables; detecting whether the index field is provided with a default value; if not, prompting a user to set a default value for the index field; and/or detecting whether a field with a default value set to NULL exists in each field with the field configuration type of varchar; and if so, prompting the user to set a new default value for the field with the default value set as NULL.
In the embodiment of the present invention, optionally, the data table field should display a default value as much as possible. The default value of the numerical type is 0, and the default value of the boolean type is 1 (normally, the numerical value 0 is "true" or "normal" and the numerical value 1 is "false" or "abnormal" in all logical types in the system).
In an embodiment of the present invention, the index is optionally a single, physical database structure, which is a collection of one or more columns of values in a data table and a corresponding list of logical pointers to data pages in the data table that physically identify the values, and the database index is used to look up a particular row in the data table.
Columns that may be NULL should be avoided in the data table and the display set default values, especially the indexed columns. The computer equipment identifies each field in the acquired data table, detects whether an index field exists, further detects whether a field with a default value set to be NULL exists in the index field if the index field is identified, and sends a prompt for setting the field with the default value set to be NULL in the index field to a user if the index field exists, the field with the default value set to be NULL can be highlighted, or the field with the default value set to be NULL can be prompted in the position of the data table, and the prompt can be in the form of an alarm box or in other forms.
The advantages of such an arrangement are: when the user forgets to record the configuration of the corresponding field value of the index field, the default value can be automatically used for filling, so that the error reporting of the null value is prevented, and the normal execution of the subsequent sorting instruction aiming at the index field can be ensured.
The method includes the steps that a varchar field in a data table is prevented from being a column which can be NULL, a default value is displayed, a computer device identifies the varchar field in the acquired data table, whether a field with the default value set to NULL exists or not is checked, if yes, a prompt that the field with the default value set to NULL is set to a new default value is sent to a user, the field with the default value set to NULL is highlighted, or the field with the default value set to NULL can be prompted in the position of the data table, and the data table can be in the form of an alarm box or other forms.
In an implementation manner of the embodiment of the present invention, optionally, after the obtaining at least one data table included in the target relational database, the method may further include: identifying annotation information in each of said data tables; verifying each piece of annotation information according to the annotation position of each piece of annotation information and annotation rules respectively corresponding to different annotation positions; and prompting the user for each piece of target annotation information which is not verified.
In the embodiment of the present invention, optionally, the comment information includes a comment on the data table, a comment on the primary key field, a comment on the foreign key field, a comment on the dictionary field, and a comment on the general field, and may further include a comment on other content. The annotation position of each piece of annotation information is different, and the corresponding annotation rule is also different.
Correspondingly, different annotation information can be verified respectively according to the annotation rules of different annotation positions, and when target annotation information which is not annotated according to the annotation rules is detected, the target annotation information is prompted by a user. For example, the target comment information may be highlighted, or a data table in which the target comment information is located and the position of the target comment information may be presented in the data table.
By way of example and not limitation, annotation rules for each piece of annotation information may be set in advance. The annotation rules for the data sheet are as follows: the Chinese names in the table are explained first, periods are separated, then the function explanation is carried out, and only the Chinese names are explained without special explanation. At the same time, the appearance of the "table" word in the description is not allowed for the readability of the code annotation ultimately generated. For example, order data table, it is sufficient to directly annotate "order", if the core business data table needs other specific detailed functional description, it should take into account the readability of the annotation of the entity class of the final generation program. In addition, if the database is designed collaboratively by multiple people, the creator and creation time information must be indicated in the data sheet annotation, examples of which are as follows:
the creator: xxx. Creation time: 2016-09-1013:30. Description of the drawings: and (5) system logging. For recording all the operations of the system by the user.
And when the design of the database is completed and the database enters a development stage, the newly added data tables for subsequent expansion are annotated according to the format, and the subsequently added data tables, the newly added reasons and the like are explained.
Comment rule for primary key field: the annotation content is the primary key.
The annotation rules for foreign key fields are as follows: the Chinese name of the field and the separation of the period are explained first, the special explanation is to be followed to be the foreign key, then which field of which data table is referred to is explained, and the separation is carried out by the period, if other explanations exist, the following is continued. Such as:
"application _ vector _ id 'char (32) DEFAULT NULL COMMENT' applicant. Foreign key, referring to the primary key (id) of the doctor table (vector). In theory, multiple can be filled, separated by "|".
In order to avoid multi-table connection inquiry, a place with a relation generally has one or more extension fields to store key information in a main table from a data table besides a foreign key field for referring to a main key of the main table, the extension fields are usually stored in parallel with corresponding foreign key fields, the Chinese name of the field is explained first during annotation, the period is separated, and the name (or others) is explained later particularly, then the field corresponding to which data table is explained, the period is separated again, and if other explanations exist, the following is continued. The format is as follows:
the physician is applied for "application _ vector _ name 'char (32) DEFAULT NULL COMMENT'. Name, corresponding to the doctor name field (name) of the doctor table (sector). In theory, multiple can be filled, separated by "|".
The annotation rules for dictionary fields are as follows: dictionary fields appear very frequently in database tables, requiring that dictionary field annotations in all tables also be of uniform format. The remarks firstly describe the Chinese names of the fields, the period separation, and then particularly describe the codes, which field corresponds to which dictionary table, and then the period separation, and then follow the detailed description. Such as:
"status _ code" varchar (5) DEFAULT NULL COMMENT' referral list status. And encoding, wherein the encoding corresponds to an encoding field (code) in a dictionary table (dictionary). Currently, 6 states are defined first: 01 submitted, 02 cancelled, 03 reviewed, 04 scheduled, 05 rejected, 06 finished. 03 is the review to the HIS system and 04 is the date the HIS system has scheduled the admission, the two fields are indistinguishable' at the time of the referral.
If there is a dictionary text extension field (similar to the extension information field of the foreign key), the format is similar to the above:
"status _ text" varchar (50) DEFAULT NULL COMMENT' referral list status. Text, corresponding to a dictionary entry name field (name) in a data dictionary table (dictionary). Currently, 6 states are defined first: 01 submitted, 02 cancelled, 03 reviewed, 04 scheduled, 05 rejected, 06 finished. 03 is the review to the HIS system and 04 is the date the HIS system has scheduled the admission, the two fields are indistinguishable' at the time of the referral.
The annotation rules for the common fields are as follows: in addition to the above several common types of fields, other fields may be annotated in a uniform manner. The Chinese name of the field and the separation of the period are explained first, and then the detailed explanation follows. Such as:
"bed _ id 'varchar (50) DEFAULT NULL COMMENT' Admission bed number. The HIS system arranges and feeds back the hospital admission number, which is manually filled in by the physician in the event of a follow-up visit.
If some fields need to be added to the existing data table after the project enters the development stage, or some fields of the existing data table need to be modified, the same as the new database data table needs to be added, and the special description is also needed.
The creator: xxx. Creation time: 2016-09-1015:38. Description of the drawings: and (5) member duty. And adding a field to the trading platform, wherein the field of the individual user is null.
In the embodiment of the present invention, optionally, annotation information in each data table is identified based on annotation rules corresponding to different annotation positions, each annotation information is verified, user prompt is performed on each target annotation information which is not verified, that is, does not match the annotation rules, so that database annotation can be specified, and accordingly, a database document, a program annotation, a program document and an external interface document can be specified, so that a relational database established on the basis can be specified.
And S120, acquiring the field configuration types of the fields included in the data tables, and performing configuration check on the field configuration types of the fields according to a preset field type configuration table.
In this embodiment of the present invention, optionally, the field configuration type of the relational database includes: character, number, date, binary. The field type configuration table stores configuration specifications of field types, and the computer device can perform field configuration type check on each acquired field in the data table according to a preset field type configuration table, wherein the field configuration type check includes check on a field with a NULL field configuration type, check on a field with a float field configuration type or a double field configuration type, check on a field with a date field configuration type, and check on fields with other field configuration types.
And S130, identifying a first target field which does not pass the configuration check, and performing configuration correction on the field configuration type of the first target field.
In the embodiment of the present invention, optionally, the first target field is a field that fails the configuration check in the data table, and the configuration table is configured according to a preset field type, and if the first target field is identified, the configuration correction may be performed on the field configuration type of the first target field according to the preset field type configuration table.
In an implementation manner of the embodiment of the present invention, optionally, the identifying a first target field that fails a configuration check, and performing configuration correction on a field configuration type of the first target field includes at least one of:
identifying a first target field with a field configuration type of NULL, and correcting the field configuration type of the first target field to be NOT NULL; identifying a first target field with a field configuration type of float type or double type, and correcting the field configuration type of the first target field into a decimal type; and identifying a first target field with a field configuration type of date in a date-time type field in each field, and correcting the field configuration type of the first target field into a date type.
In this embodiment of the present invention, optionally, if the first target field with the field configuration type of NULL is identified, the field configuration type of the first target field is modified to NOT NULL. Columns that may be NULL are avoided in the data table and default values, particularly indexed columns, are set for display. In some databases, if a column of a data table contains a NULL, the column is NOT included in the index, i.e., the index is invalid, and the field attribute is set to NOT NULL in consideration of the fields that may be used in the index in the future. For example, if a field is likely to be searched as a query key in the form of LIKE, the field is defined as an index to increase the query speed, and the field attribute is NOT NULL.
Therefore, the first target field with the field configuration type of NULL is set to be NOT NULL, and default values are set for the field, so that the query speed can be increased, and the table space can be saved.
In the embodiment of the present invention, optionally, if the first target field with the field configuration type of float or double is identified, the field configuration information of the first target field is modified to decmal type, the use of float and double in the data table is prohibited, and decmal is used instead. decimal (a, b), a specifies the maximum number of decimal digits that can be stored to the left and right of the decimal point, maximum precision 38. b specifies the maximum number of decimal digits that can be stored to the right of the decimal point. The decimal place must be a value from 0 to a. The default decimal number is 0, such as decimall (5, 2) specifies that the stored value will not exceed 5 digits, and the decimal point is followed by 2 digits.
Therefore, by configuring the first target field with the float type or the double type field configuration type and modifying the field configuration information of the first target field into the decimall type, the unification of the data format can be realized, and the standard management of the database is facilitated.
In this embodiment of the present invention, optionally, if a first target field with a date-time type field configuration type of date is identified, the field configuration information of the first target field is modified to a date-time type. A field of the time-of-day type, accurate to the hour of the hour, is required, with the datetime type. Even though such a field as birthday (birthday date) is generally stored only to the year, month and day, it is datetime rather than date when selecting the field type.
Therefore, by identifying the first target field of which the field configuration type is date type in the date-time type field in each field and modifying the field configuration information of the first target field into the date-time type, the date-time type field configuration type can be finely grained, data compatibility can be realized, and the standard management of the database is facilitated.
Therefore, by identifying the first target field which does not pass the configuration check and performing configuration correction on the field configuration type of the first target field, the unified field configuration type of the first target field can be realized, and the normalized management of data is facilitated.
And S140, after the configuration correction is finished, generating the target relational database.
In an implementation manner of the embodiment of the present invention, optionally, after the generating the target relational database, the method may further include: if a modification instruction for the target relational database is detected, requesting modification permission from an auditing platform; and if an allowable modification instruction fed back by the auditing platform is received, modifying the target relational database according to the modification instruction.
In the embodiment of the present invention, optionally, the authority setting is performed on the relational target database, and the control of the authority is roughly divided into the following several levels from top to bottom: the system level, the module level, the menu level, the page level, the control level and the data level, and different roles have different operation authorities for different data. If a modification instruction for the target relational database is received, applying for a permission for requesting to modify corresponding data to an auditing platform according to permission information carried in the modification instruction, judging whether the permission is available for modification operation or not by the auditing platform based on the received permission information and the permission information prestored on the auditing platform, if the permission is judged to be available for modification, feeding back an allowable modification instruction by the auditing platform, and if the allowable modification instruction fed back by the auditing platform is received, modifying the target relational database according to the modification instruction, wherein the operation can be addition, deletion, updating, searching operation, and other operations.
According to the technical scheme provided by the embodiment of the invention, when a generation request corresponding to a target relational database is detected, at least one data table included in the target relational database is obtained, the field configuration type of each field included in each data table is obtained, the field configuration type of each field is subjected to configuration check according to a preset field type configuration table, a first target field which does not pass the configuration check is identified, the field configuration type of the first target field is subjected to configuration correction, and the target relational database is generated after the configuration correction is completed, namely the relational database is generated by performing the configuration check and correction on each field in each data table in the relational database.
In an implementation manner of the embodiment of the present invention, optionally, after performing configuration check on the field configuration type of each field according to a preset field type configuration table, the method may further include: and if detecting that the remark field is not included in all the fields in each data table, adding the remark field into each data table.
In the embodiment of the present invention, optionally, a remark field is reserved in all data tables, and an extensible part is reserved for front-end information entry. Uniformly named remark, field type varchar (length 200), up to 100 chinese characters. If more than 100 Chinese characters are specified, the additional information is not suitable for being placed in the remark field, and the field storage is renewed. After the configuration check is performed on the configuration types of the fields in the data tables, whether the remark fields are included in all the fields in the data tables is detected, if not, the remark fields are automatically added to the data tables which do not include the remark fields, or a user can be prompted to add the remark fields to the data tables.
In an implementation manner of the embodiment of the present invention, optionally, after performing configuration modification on the field configuration type of the target field, the method may further include: identifying a second target field with a default value set in each target data table; and forming an entity class attribute auxiliary setting document according to the data table to which each second target field belongs and the default value set for each second target field.
In the embodiment of the present invention, optionally, if it is identified that the second target field in each target data table of the database has a default value, it is reasonable that the same initialization value should be set for the attribute of the corresponding entity class in the process of program development. Specifically, after the default value modification of the data table is completed, all second target fields with the default value are traversed, and the document formed based on the default value fields is provided for the database user and serves as a help document when the database user constructs a new data table.
Fig. 2 is a schematic structural diagram of an auxiliary generation apparatus for a relational database according to an embodiment of the present invention, where the apparatus is configured in a computer device such as a server, and the apparatus includes: an acquisition module 210, an inspection module 220, a modification module 230, and a generation module 240.
The obtaining module 210 is configured to obtain at least one data table included in a target relational database when a generation request corresponding to the target relational database is detected; the checking module 220 is configured to obtain a field configuration type of each field included in each data table, and perform configuration checking on the field configuration type of each field according to a preset field type configuration table; a modification module 230, configured to identify a first target field that fails a configuration check, and perform configuration modification on a field configuration type of the first target field; a generating module 240, configured to generate the target relational database after completing configuration modification.
In an exemplary embodiment, the identifying a first target field failing configuration checking and performing configuration modification on a field configuration type of the first target field includes at least one of: identifying a first target field with a field configuration type of NULL, and correcting the field configuration type of the first target field to be NOT NULL; identifying a first target field with a field configuration type of float type or double type, and correcting the field configuration type of the first target field into a decimal type; and identifying a first target field with a field configuration type of date in a date-time type field in each field, and correcting the field configuration type of the first target field into a date type.
In an exemplary embodiment, the apparatus further includes a field adding module, configured to, after performing configuration check on a field configuration type of each of the fields according to a preset field type configuration table, add a remark field to the target data table if it is detected that no remark field is included in all the fields in the target data table.
In an exemplary embodiment, the apparatus further includes an identifying module, configured to identify an index field in each field of each data table after obtaining at least one data table included in the target relational database; detecting whether the index field is provided with a default value; if not, prompting a user to set a default value for the index field; and/or detecting whether a field with a default value set to NULL exists in each field with the field configuration type of varchar; and if so, prompting the user to set a new default value for the field with the default value set as NULL.
In an exemplary embodiment, the apparatus further includes a document forming module, configured to identify a second target field in each of the target data tables, where a default value is set, after configuration modification is performed on a field configuration type of the target field; and forming an entity class attribute auxiliary setting document according to the data table to which each second target field belongs and the default value set for each second target field.
In an exemplary embodiment, the apparatus further includes a prompt module, configured to identify annotation information in each of the data tables included in the target relational database after obtaining the at least one data table; verifying each piece of annotation information according to the annotation position of each piece of annotation information and annotation rules respectively corresponding to different annotation positions; and prompting the user for each piece of target annotation information which is not verified.
In an exemplary embodiment, the apparatus further includes a modification module, configured to, after generating the target relational database, request modification permission from an auditing platform if a modification instruction for the target relational database is detected; and if an allowable modification instruction fed back by the auditing platform is received, modifying the target relational database according to the modification instruction.
The auxiliary generation device for the relational database provided by the embodiment of the invention can execute the auxiliary generation method for the relational database provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention. FIG. 3 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. 3 is only an example and should not impose any limitation on the scope of use or functionality of embodiments of the present invention.
As shown in FIG. 3, computer device 12 is 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 or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
The system 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. 3, and commonly referred to as a "hard drive"). Although not shown in FIG. 3, 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.
The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing the auxiliary generation method of the relational database provided by the embodiment of the present invention, that is: when a generation request corresponding to a target relational database is detected, acquiring at least one data table included in the target relational database;
acquiring the field configuration type of each field included in each data table, and performing configuration check on the field configuration type of each field according to a preset field type configuration table;
identifying a first target field which does not pass the configuration check, and performing configuration correction on the field configuration type of the first target field;
and after configuration correction is completed, generating the target relational database.
Embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for assisting in generating a relational database as provided in all embodiments of the present invention of the present application, that is:
when a generation request corresponding to a target relational database is detected, acquiring at least one data table included in the target relational database;
acquiring the field configuration type of each field included in each data table, and performing configuration check on the field configuration type of each field according to a preset field type configuration table;
identifying a first target field which does not pass the configuration check, and performing configuration correction on the field configuration type of the first target field;
and after configuration correction is completed, generating the target relational database.
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 server. 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. An auxiliary generation method for a relational database, comprising:
when a generation request corresponding to a target relational database is detected, acquiring at least one data table included in the target relational database;
acquiring the field configuration type of each field included in each data table, and performing configuration check on the field configuration type of each field according to a preset field type configuration table;
identifying a first target field which does not pass the configuration check, and performing configuration correction on the field configuration type of the first target field;
and after configuration correction is completed, generating the target relational database.
2. The method of claim 1, wherein the identifying a first target field failing a configuration check and making a configuration modification to a field configuration type of the first target field comprises at least one of:
identifying a first target field with a field configuration type of NULL, and correcting the field configuration type of the first target field to be NOT NULL;
identifying a first target field with a field configuration type of float type or double type, and correcting the field configuration type of the first target field into a decimal type; and the number of the first and second groups,
and identifying a first target field with a field configuration type of date in a date-time type field in each field, and correcting the field configuration type of the first target field into the date-time type.
3. The method of claim 1, wherein after checking the configuration of the field configuration type of each field according to a preset field type configuration table, the method further comprises:
and if detecting that the remark fields are not included in all the fields in the target data table, adding the remark fields into the target data table.
4. The method of claim 1, further comprising, after obtaining at least one data table included in the target relational database:
identifying an index field in each field of each of the data tables; detecting whether the index field is provided with a default value; if not, prompting a user to set a default value for the index field; and/or
Detecting whether a field with a default value set to NULL exists in each field with the field configuration type of varchar; and if so, prompting the user to set a new default value for the field with the default value set as NULL.
5. The method of claim 1, further comprising, after performing a configuration modification on the field configuration type of the target field:
identifying a second target field with a default value set in each target data table;
and forming an entity class attribute auxiliary setting document according to the data table to which each second target field belongs and the default value set for each second target field.
6. The method of claim 1, further comprising, after obtaining at least one data table included in the target relational database:
identifying annotation information in each of said data tables;
verifying each piece of annotation information according to the annotation position of each piece of annotation information and annotation rules respectively corresponding to different annotation positions;
and prompting the user for each piece of target annotation information which is not verified.
7. The method according to any one of claims 1-6, further comprising, after generating the target relational database:
if a modification instruction for the target relational database is detected, requesting modification permission from an auditing platform;
and if an allowable modification instruction fed back by the auditing platform is received, modifying the target relational database according to the modification instruction.
8. An auxiliary generation device for a relational database, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring at least one data table included in a target relational database when a generation request corresponding to the target relational database is detected;
the checking module is used for acquiring the field configuration types of the fields in the data tables and performing configuration checking on the field configuration types of the fields according to a preset field type configuration table;
the correction module is used for identifying a first target field which does not pass the configuration check and carrying out configuration correction on the field configuration type of the first target field;
and the generating module is used for generating the target relational database after the configuration correction is finished.
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 a method for assisted generation of a relational database according to any one of claims 1 to 7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for assisted generation of a relational database according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011589867.7A CN112612794A (en) | 2020-12-29 | 2020-12-29 | Auxiliary generation method and device of relational database, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011589867.7A CN112612794A (en) | 2020-12-29 | 2020-12-29 | Auxiliary generation method and device of relational database, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112612794A true CN112612794A (en) | 2021-04-06 |
Family
ID=75248797
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011589867.7A Pending CN112612794A (en) | 2020-12-29 | 2020-12-29 | Auxiliary generation method and device of relational database, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112612794A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113468158A (en) * | 2021-07-13 | 2021-10-01 | 广域铭岛数字科技有限公司 | Data repair method, system, electronic device and medium |
CN113468186A (en) * | 2021-09-02 | 2021-10-01 | 四川大学华西医院 | Data table primary key association method and device, computer equipment and readable storage medium |
CN115437966A (en) * | 2022-11-03 | 2022-12-06 | 平安银行股份有限公司 | Test data generation method, terminal device and computer readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110825431A (en) * | 2019-11-14 | 2020-02-21 | 京东数字科技控股有限公司 | Interface document processing method, device, system, storage medium and electronic equipment |
CN110909003A (en) * | 2019-11-25 | 2020-03-24 | 车智互联(北京)科技有限公司 | Method for creating data table and computing equipment |
CN111159191A (en) * | 2019-12-30 | 2020-05-15 | 深圳博沃智慧科技有限公司 | Data processing method, device and interface |
CN111753140A (en) * | 2020-06-23 | 2020-10-09 | 深圳壹账通智能科技有限公司 | XML file parsing method and related equipment |
-
2020
- 2020-12-29 CN CN202011589867.7A patent/CN112612794A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110825431A (en) * | 2019-11-14 | 2020-02-21 | 京东数字科技控股有限公司 | Interface document processing method, device, system, storage medium and electronic equipment |
CN110909003A (en) * | 2019-11-25 | 2020-03-24 | 车智互联(北京)科技有限公司 | Method for creating data table and computing equipment |
CN111159191A (en) * | 2019-12-30 | 2020-05-15 | 深圳博沃智慧科技有限公司 | Data processing method, device and interface |
CN111753140A (en) * | 2020-06-23 | 2020-10-09 | 深圳壹账通智能科技有限公司 | XML file parsing method and related equipment |
Non-Patent Citations (1)
Title |
---|
SNOWFLAKECLOUD: "数据库设计时的一些细节的东西如何处理", pages 1 - 40, Retrieved from the Internet <URL:https://www.zhihu.com/question/39967106> * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113468158A (en) * | 2021-07-13 | 2021-10-01 | 广域铭岛数字科技有限公司 | Data repair method, system, electronic device and medium |
CN113468158B (en) * | 2021-07-13 | 2023-10-31 | 广域铭岛数字科技有限公司 | Data restoration method, system, electronic equipment and medium |
CN113468186A (en) * | 2021-09-02 | 2021-10-01 | 四川大学华西医院 | Data table primary key association method and device, computer equipment and readable storage medium |
CN113468186B (en) * | 2021-09-02 | 2021-12-21 | 四川大学华西医院 | Data table primary key association method and device, computer equipment and readable storage medium |
CN115437966A (en) * | 2022-11-03 | 2022-12-06 | 平安银行股份有限公司 | Test data generation method, terminal device and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112612794A (en) | Auxiliary generation method and device of relational database, computer equipment and storage medium | |
US10552439B2 (en) | Grid format data viewing and editing environment | |
US20040267744A1 (en) | Changing the data structure which an application program in a computer system uses to access database systems | |
US7500221B2 (en) | Filter-based comments in source code | |
US8768689B2 (en) | Method and system for translation management of source language text phrases | |
CN112115152B (en) | Data increment updating and inquiring method and device, electronic equipment and storage medium | |
US11544669B2 (en) | Computing framework for compliance report generation | |
CN111078205A (en) | Modular programming method and device, storage medium and electronic equipment | |
US20060282470A1 (en) | Determining compliance of a database architecture to an enterprise data standard | |
US20120158742A1 (en) | Managing documents using weighted prevalence data for statements | |
CN110489401B (en) | Method and device for deploying database objects | |
US20230091845A1 (en) | Centralized metadata repository with relevancy identifiers | |
US20230289331A1 (en) | Model generation service for data retrieval | |
CN115391322A (en) | Data checking method, device, equipment, storage medium and program product | |
CN113111065A (en) | Database creation method and device, computer equipment and storage medium | |
CN111858645A (en) | Database object processing method, device, equipment and storage medium | |
CN115357590A (en) | Recording method and device for data change, electronic device and storage medium | |
US20030033137A1 (en) | Method and system for translation management of source language text phrases | |
US11182375B2 (en) | Metadata validation tool | |
US5778240A (en) | Referential edit checking tabular form data | |
US10838947B2 (en) | Consistency check for foreign key definition | |
CN112131851A (en) | Target electronic medical record template generation method and device | |
CN115759040A (en) | Electronic medical record analysis method, device, equipment and storage medium | |
CN114116907A (en) | Database synchronization method and device, electronic equipment and storage medium | |
CN114817990A (en) | Sensitive data management method and device, 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 |