Database construction method and device and database-based data processing method and device

By combining dynamic scalable database templates and programming languages, a flexible instance database is built, which solves the high cost of database reconstruction design and system redevelopment in the existing technology, and realizes high flexibility of the database and system scalability.

CN119576894APending Publication Date: 2025-03-07CHINA NUCLEAR POWER ENGINEERING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411621603.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

When responding to changes in demand or business areas, existing technologies need to carry out database reconstruction design and system redevelopment, resulting in waste of manpower, material resources and financial resources, increasing the cost of system upgrades in the later stage.

Method used

Provide a database construction method, by obtaining dynamic extensible database templates, traversing the templates based on programming languages ​​and database languages, establishing an instance database structure, and building an instance database based on the structure. This method allows updates and modifications of dynamic scalable database templates as requirements change, thereby updating and modifying instance databases.

Benefits of technology

It improves the flexibility of the database, reduces the need for database reconstruction design and system redevelopment, saves manpower, material resources and financial resources, reduces the cost of later system upgrades, and maximizes the scalability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576894A_ABST
    Figure CN119576894A_ABST
Patent Text Reader

Abstract

The invention discloses a database construction method and device and a database-based data processing method and device, and relates to the technical field of data processing. The database construction method comprises the following steps: obtaining a dynamic extensible database template; traversing the dynamic extensible database template based on a programming language and a database language to establish an instance database structure; and constructing the instance database according to the instance database structure. According to the embodiment of the invention, the method can improve the flexibility of the database, can update and modify the instance database by updating and modifying the dynamic extensible database template when the demand change is subsequently coped with or when the business field is changed, does not need to carry out database reconstruction design and system redevelopment, and is high in practicability. Manpower, material resources and financial resources are saved, and the later upgrading cost of the system is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and specifically relates to a database construction method and device, and a database-based data processing method and device. Background Art

[0002] Each system and software needs to design the database when using a general database. In the prior art, in response to changes in demand or when changes in the business field occur, database reconstruction and system redevelopment are often required, which may even lead to a large amount of code modification or code rewriting, resulting in a large amount of unnecessary waste of manpower, material and financial resources, and thus high costs for later system upgrades. Summary of the invention

[0003] The technical problem to be solved by the present application is to provide a database construction method and device, and a database-based data processing method and device in response to the above-mentioned deficiencies in the prior art, thereby providing a new database construction method that can improve the flexibility of the database, and the instance database constructed using the database construction method can be updated and modified by updating and modifying the dynamically extensible database template when responding to changes in demand or when the business field changes in the future, thereby updating and modifying the instance database, without the need for database reconstruction design and system redevelopment, saving manpower, material and financial resources, and reducing the cost of subsequent system upgrades.

[0004] In a first aspect, an embodiment of the present application provides a database construction method, including: obtaining a dynamically extensible database template; traversing the dynamically extensible database template based on a programming language and a database language to establish an instance database structure; and constructing an instance database according to the instance database structure.

[0005] Based on the same inventive concept, in the second aspect, an embodiment of the present application also provides a database-based data processing method, including: obtaining the data to be processed, its corresponding data processing method and data type, the data processing method including at least one of adding a new data row, deleting a data row and modifying the data; determining the target instance database according to the data type, the target instance database is constructed using a database construction method such as any one of the first aspects; determining the target storage location of the data to be processed in the target instance database according to the data processing method and the target dynamically extensible database template corresponding to the target instance database; and processing the target storage location according to the data processing method based on the target dynamically extensible database template.

[0006] Based on the same inventive concept, in the third aspect, an embodiment of the present application also provides a database construction device, including: a first acquisition module, used to obtain a dynamic extensible database template; a first traversal module, connected to the first acquisition module, used to traverse the dynamic extensible database template based on a programming language and a database language to establish an instance database structure; a first construction module, connected to the first traversal module, used to construct an instance database according to the instance database structure.

[0007] Based on the same inventive concept, in the fourth aspect, the embodiment of the present application also provides a data processing device based on a database, including: a second acquisition module, used to acquire the data to be processed, its corresponding data processing method and data type, the data processing method including at least one of adding data rows, deleting data rows and modifying data; a first determination module, connected to the second acquisition module, used to determine the target instance database according to the data type, the target instance database is constructed using the database construction device of the third aspect; a second determination module, connected to the first determination module and the second acquisition module, used to determine the target storage location of the data to be processed in the target instance database according to the data processing method and the target dynamically extensible database template corresponding to the target instance database; a processing module, connected to the second determination module, based on the target dynamically extensible database template, processes the target storage location according to the data processing method.

[0008] According to the database construction method and device, and the database-based data processing method and device provided in the embodiments of the present application, the dynamically extensible database target is traversed through the programming language and the database language to establish the instance database structure, and then the instance database can be constructed according to the instance database structure. The database constructed in this way can improve the flexibility of the database because the dynamic extensible database template allows the instance database structure to be adjusted according to the needs; it can update and modify the instance database by updating and modifying the dynamic extensible database template in response to changes in demand or when the business field changes in the future, so that the instance database has higher variability and elasticity, can adapt to business development and changes in demand in a longer time period, and realize the maximization of system scalability, without the need for database reconstruction design and system redevelopment, saving manpower, material resources and financial resources, reducing the cost of later system upgrades, greatly reducing the rejection of scalability by system developers, improving comprehensive benefits, and transforming deep customized development into business customization development based on changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 A schematic diagram showing a flow chart of a database construction method provided in an embodiment of the present application;

[0010] Figure 2A schematic diagram showing a flow chart of a data processing method based on a database provided in an embodiment of the present application;

[0011] Figure 3 A schematic diagram showing a principle of a data processing method based on a database provided in an embodiment of the present application;

[0012] Figure 4 A schematic diagram of the structure of a database construction device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0013] In order to enable those skilled in the art to better understand the technical solution of the present application, the present application is further described in detail below with reference to the accompanying drawings and embodiments.

[0014] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0015] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

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

[0017] Example 1

[0018] The embodiment of the present application provides a database construction method, which can be executed by a database construction device and an electronic device. For example, the database construction method can be applied to the process of equipment and asset management in a nuclear power plant. The following is an example of the database construction method being executed by an electronic device.

[0019] like Figure 1 As shown, the database construction method provided in the embodiment of the present application may include steps S110 to S130.

[0020] S110. Obtain a dynamically extensible database template.

[0021] S120: Based on the programming language and the database language, the dynamically extensible database template is traversed to establish an instance database structure.

[0022] S130: construct an instance database according to the instance database structure.

[0023] According to the database construction method provided in the embodiment of the present application, the dynamic extensible database target is traversed through the programming language and the database language to establish the instance database structure, and then the instance database can be constructed according to the instance database structure. The database constructed in this way, because the dynamic extensible database template allows the instance database structure to be adjusted according to the needs, can improve the flexibility of the database, and can be updated and modified by updating and modifying the dynamic extensible database template to update and modify the instance database in the subsequent response to changes in demand or when the business field changes, so that the instance database has higher variability and elasticity, can adapt to business development and changes in demand in a longer time period, and realize the maximization of system scalability, without the need for database reconstruction design and system redevelopment, saving manpower, material and financial resources, reducing the cost of later system upgrades, greatly reducing the rejection of scalability by system developers, improving comprehensive benefits, and transforming deep customized development into business customization development based on changes.

[0024] The specific implementation methods of the above steps are introduced below.

[0025] In step S110 , the dynamically extensible database template may be a dynamic and extensible database template.

[0026] In some implementations, obtaining a dynamically extensible database template includes:

[0027] Obtain template basic table, template special table and template relationship table;

[0028] A dynamic and extensible database template is established based on the template basic table, template special table and template relationship table.

[0029] That is to say, the dynamically extensible database template includes template base tables, template dedicated tables and template relationship tables.

[0030] Exemplarily, the template basic table may be a basic table of a dynamically extensible database template, which is used to characterize basic information of the dynamically extensible database template, including database name, database sub-table name, database sub-table attributes, and the like.

[0031] Exemplarily, the template-specific table can be a dedicated table for a dynamically extensible database template, which can be used to centrally store information about data columns related to the instance database, facilitate addressing based on the template-specific table when writing data, uniquely encode all columns involved in the library table, and centrally display the information of each data column.

[0032] Exemplarily, the template relationship table can be a relationship table of a dynamically extensible database template. That is, an index table of each system object label in the system interface and the column where the corresponding instance database is located, which is used to determine the one-to-one correspondence between each column and each system object label in the system interface, so as to facilitate further dynamic determination of the location where the data to be processed is written to the target instance database in combination with the template-specific table. The template relationship table can be subdivided into several categories such as library level, multi-table level and single-table level according to the scale of business. The form varies but its purpose remains unchanged, and is not limited here. The library level and multi-table level should establish corresponding association relationships and be identifiable.

[0033] In some examples, obtaining a template base table includes:

[0034] Obtain at least one of a database identification table, a database name table, a database relationship table, a sub-table name table, and a sub-table attribute table; wherein the database identification table is used to indicate whether a distributed database is required and the number of distributed databases; the database name table is used to store the names and configuration information of different databases; the database relationship table is used to indicate the relationship between the sub-databases in the database; the sub-table name table is used to indicate the names, uses, and relationships of the sub-tables contained in the sub-databases in the database; and the sub-table attribute table is used to indicate the relationship between the sub-tables contained in the sub-databases in the database, as well as the attributes of the sub-tables;

[0035] A template basic table is established according to at least one item of a database identification table, a database name table, a database relationship table, a sub-table name table and a sub-table attribute table.

[0036] That is, the template base table may include at least one of a database discrimination table, a database name table, a database relationship table, a sub-table name table, and a sub-table attribute table. As an example, the template base table may include a database discrimination table; as another example, the template base table may include a database discrimination table and a database name table; as another example, the template base table may include a database discrimination table, a sub-table name table, and a sub-table attribute table; as yet another example, the template base table may include a database discrimination table, a database name table, a database relationship table, a sub-table name table, and a sub-table attribute table.

[0037] It should be noted that the distributed database in the embodiment of the present application is a broadly distributed database, which means that the structure itself can be replaced by a database structure, but due to the large size of the database, complex logical relationships, and low efficiency, the database needs to be split, reorganized (including relationships for organizing multiple databases), divided into sub-libraries, and divided into tables to form multiple databases. Multiple databases can be deployed in one operating system or in multiple operating systems. That is, a database with sub-libraries and a unified organizational relationship is a distributed database in the embodiment of the present application, regardless of whether it is distributed on different servers.

[0038] The database discrimination table may be a discrimination table for whether to adopt a distributed database, which is used to judge whether to adopt a distributed database and how many distributed databases are included, so as to facilitate subsequent distributed deployment and verification of the database.

[0039] For example, taking SQL database as an example, it can be managed hierarchically or only used for sub-libraries, and then a table is set up to manage different tables, and it is designed according to the complexity and data volume of the instance database. An example template of a database discrimination table provided in an embodiment of the present application is shown in Table 1.

[0040] Table 1

[0041]

[0042] It should be noted that the template of the above database discrimination table is only used for example and is not used to limit the present application.

[0043] For example, a more specific example of a database discrimination table provided in an embodiment of the present application is shown in Table 2.

[0044] Table 2

[0045] ID DataBases DataBasesNum DataBaseName …… XXXyu1 TURE 2 DataBase ……

[0046] It should be noted that the above database identification table is only used for example and is not used to limit the present application.

[0047] That is to say, the database with the identity identifier XXXyu1 is a sub-database structure (that is, a distributed database is adopted), which is divided into 2 libraries (that is, the number of distributed databases is 2), and the name of the next-level related form is DataBase.

[0048] The database name table may be a table of names of customized distributed databases, and is used to store customized different database names and configuration information. The configuration information includes at least one of the regions where different databases are located, the region codes where they are located, the computer administrator user names, the computer administrator passwords, the Internet Protocol (IP) addresses where the servers are located, the Media Access Control (MAC) addresses, the user names and passwords of the distributed location databases, etc.

[0049] It should be noted that when the database name table is not included in the template basic table, centralized deployment is used by default. If centralized deployment is used, the process can be redirected. If there is only one distributed server (that is, the actual effect is consistent with centralized deployment, only the logical relationship is different), only one database name can be set through the database name table. The specific implementation is closely related to the actual situation and future considerations, and is not limited here. The embodiment of this application is only explained and illustrated from the function and method.

[0050] Exemplarily, the database relationship table may be a custom database relationship table for storing the relationship between various databases. The granularity is generally from the database to the table. The database-table relationship may also be combined into one (i.e., a table with the name of the custom table is established).

[0051] It should be noted that, when the database relationship table is not included in the template basic table, there is only one database by default, and a table for directly managing the library-table relationship can also be set, including centralized deployment and distributed deployment, to determine the logical relationship between each sub-library and sub-table. Similar to the table of names of custom distributed databases (i.e., database name table), if centralized deployment is adopted, the database relationship table is used to characterize the library-table relationship. If there is only one distributed server (i.e., the actual effect is consistent with centralized deployment, only the logical relationship is different), it can be achieved by setting only one database name through the database relationship table. The specific implementation is closely related to the actual situation and future considerations, and is not limited here. The embodiments of this application are only explained and described from the functions and methods.

[0052] For example, a template example of a database relationship table provided in an embodiment of the present application is shown in Table 3.

[0053] Table 3

[0054]

[0055] It should be noted that the above database relationship table template is only used for example and is not used to limit this application.

[0056] For example, a more specific example of a database relationship table provided in an embodiment of the present application is shown in Table 4-1 to Table 4-3.

[0057] Table 4-1

[0058]

[0059]

[0060] Table 4-2

[0061] DataBasePathPassword DataBasePathIP DataBasePathMac PASSWORD XXX.XX.XXX.XX1 XX-XX-XX-XX-XX-X1 PASSWORD XXX.XX.XXX.XX2 XX-XX-XX-XX-XX-X2

[0062] Table 4-3

[0063] DataBasePathSqlUser DataBasePathSqlPassword DataBaseTablesName ADMINISTRTOR PasswordXXX1 LoaclADataBaseTables ADMINISTRTOR PasswordXXX2 LoaclBDataBaseTables

[0064] That is to say, for a database with an identity identifier of XXXX31, the database name or sub-database name is LocalA, the domain or group it belongs to is CNRC, the username for logging into the server is Administrator, the password for logging into the server is PASSWORD, the IP address of the server where the database is located is XXX.XX.XXX.XX1, the Mac address of the server where the database is located is XX-XX-XX-XX-XX-X1, the username for the database is ADMINISTRTOR, the password for the database is PasswordXXX1, and the table name for the information set of each table in each database is LoaclBDataBaseTables. The same is true for the database with an identity identifier of XXXX32, which will not be described here.

[0065] It should be noted that Table 4-1 to Table 4-3 together constitute a more specific database relationship table, and Table 4-1 to Table 4-3 are only used for examples and are not used to limit this application.

[0066] For example, the sub-table name table can be a table of custom table names, that is, a table of sub-table names contained in the current library (i.e., the sub-library) is established for each sub-library, as well as their uses and relationships. If it is a centralized deployment, it is considered that there is only one sub-library, and its purpose is to set how many tables are involved in this database, the purpose of each table, whether there is a relationship with other library tables, how many relationships there are, etc.

[0067] Illustratively, a template example of a sub-table name table provided in an embodiment of the present application is shown in Table 5.

[0068] Table 5

[0069]

[0070]

[0071] It should be noted that the above template of the sub-table name table is only used as an example and is not used to limit this application.

[0072] For example, a more specific example of a sub-table name table provided in an embodiment of the present application is shown in Table 6-1 and Table 6-2.

[0073] Table 6-1

[0074]

[0075] Table 6-2

[0076] DataTableConnect DataTableConnectNum …… TURE 1 …… FULSE 0 …… TURE 1 …… TURE 2 …… TURE 0 ……

[0077] That is, for the database with the identity identifier XXXX02, the table name is UserTable, the expression purpose is AS, the table purpose is described as the user and authority main table, there are related tables, and the number of related tables is 1; for the database with the identity identifier XXXX33, the table name is GroupTable, the expression purpose is AP, the table purpose is described as grouping, there are no related tables, and the number of related tables is 0. The same is true for the databases with identity identifiers XXXX34 to XXXX36, which will not be repeated here.

[0078] It should be noted that Table 6-1 and Table 6-2 together constitute a more specific sub-table name table, and Table 6-1 and Table 6-2 are only used for examples and are not used to limit this application.

[0079] Exemplarily, the sub-table attribute table can be a table of the relationship between custom tables and the attributes of each sub-table, and the attributes of each sub-table include at least one of the key value of each column in each table, the type of each column in each table, and the limit value. The purpose of the sub-table attribute table is to design each table of the example database, define whether each column is a key value and the limit value of each column.

[0080] Illustratively, an example of a template of a sub-table attribute table provided in an embodiment of the present application is shown in Table 7.

[0081] Table 7

[0082]

[0083] It should be noted that the above template of the sub-table attribute table is only used for example and is not used to limit the present application.

[0084] As an example, a more specific example of a sub-table attribute table provided in an embodiment of the present application is shown in Table 8-1 and Table 8-2.

[0085] Table 8-1

[0086]

[0087]

[0088] Table 8-2

[0089]

[0090]

[0091] That is to say, the database with the identity identifier XXXX38 has the attribute column named UserOID, which is the primary key and is related to other database table columns. The related database name is LocalB, the related table name is UserTable, the related column name is UserOID, the attribute column type is VARCHAR, and the attribute column cannot be empty. The same is true for the databases with identity identifiers XXXX39 to XXXX47, which will not be repeated here.

[0092] It should be noted that Table 8-1 and Table 8-2 together constitute a more specific sub-table attribute table, and Table 8-1 and Table 8-2 are only used for examples and are not used to limit this application.

[0093] As another example, another more specific example of a sub-table attribute table provided in an embodiment of the present application is shown in Table 9-1 and Table 9-2.

[0094] Table 9-1

[0095]

[0096] Table 9-2

[0097]

[0098] That is, for the database with the ID XXXX1, the name of the attribute column is ResourceImplementOID, which is the primary key and is related to other database table columns. The related database name is LocalA, the related table name is ResourceImplement, the related column name is ResourceImplementOID, the attribute column type is VARCHAR, and the attribute column cannot be empty. The same is true for the databases with IDs XXXX2 to XXXX9, which will not be described here.

[0099] It should be noted that Table 9-1 and Table 9-2 together constitute a more specific sub-table attribute table, and Table 9-1 and Table 9-2 are only used for examples and are not used to limit this application.

[0100] As another example, another more specific example of a sub-table attribute table provided in an embodiment of the present application is shown in Table 10-1 and Table 10-2.

[0101] Table 10-1

[0102]

[0103] Table 10-2

[0104]

[0105]

[0106] That is, for the database with the ID XXXX1, the name of the attribute column is ResourceImplementOID, which is the primary key and is related to other database table columns. The related database name is LocalA, the related table name is ResourceImplement, the related column name is ResourceImplementOID, the attribute column type is VARCHAR(255), and the attribute column cannot be empty. The same is true for the databases with IDs XXXX2 to XXXX10, which will not be described here.

[0107] It should be noted that Table 10-1 and Table 10-2 together constitute a more specific sub-table attribute table, and Table 10-1 and Table 10-2 are only used for examples and are not used to limit this application.

[0108] Exemplarily, at least one of a database identification table, a database name table, a database relationship table, a sub-table name table, and a sub-table attribute table may be pre-stored in the electronic device for subsequent direct call, or may be imported by a user based on an import operation of the electronic device when establishing a template base table. The import operation may be an operation of importing at least one of a database identification table, a database name table, a database relationship table, a sub-table name table, and a sub-table attribute table.

[0109] In some examples, obtaining a template-specific table includes:

[0110] Obtaining column information in a database table, including the table name, library name, database user name, database password, Internet protocol address of the server where the database is located, server user name and server password;

[0111] Create a template-specific table based on the column information.

[0112] That is, the template-specific table includes column information.

[0113] For example, template-specific tables may include, but are not limited to, table names, database names, database user names, database passwords, IP addresses of servers where the databases are located, server user names, server passwords, and other information. Template-specific tables can be subdivided into several categories, such as database-level, multi-table-level, single-table-level, and view-level, according to the business scale. The forms vary but their uses remain the same. The database-level, multi-table-level, and view-level should establish corresponding associations and be identifiable.

[0114] Illustratively, a template example of a template-specific table provided in an embodiment of the present application is shown in Table 11.

[0115] Table 11

[0116]

[0117] It should be noted that the template of the above-mentioned template-specific table is only used for example and is not used to limit this application.

[0118] For example, a more specific example of a template-specific table provided in an embodiment of the present application is shown in Table 12.

[0119] Table 12-1

[0120]

[0121]

[0122] Table 12-2

[0123]

[0124] That is, for the database with the identity identifier XXXX38, the name of the attribute column is UserOID, the database name is LocalA, the domain is CNRC, the server user name is Administrator, the server user name password is PASSWORD, the server IP is xxx.xx.xxx.259, the server MAC is xx-xx-xx-xx-02-FD, the database user name is ADMINIST-RTOR, the database user name password is Password@120, and the name of the table where the column is located is UserTable. The other databases in Table 12-1 and Table 12-2 are similar to the database with the identity identifier XXXX38, and will not be repeated here.

[0125] It should be noted that Table 12-1 and Table 12-2 are combined to form a complete template-specific table, and the data in Table 12-1 and Table 12-2 are only used for examples and are not used to limit this application.

[0126] Exemplarily, the column information in the database table may be pre-stored in the electronic device for subsequent direct call.

[0127] In some examples, obtaining a template relationship table includes:

[0128] A relationship table between each column in the database table and the system object label is established to obtain a template relationship table.

[0129] Exemplarily, the template relationship table can be a relationship table between each column and the system object label, that is, an index table of each system object label in the system interface and the column where the corresponding instance database is located, which is used to determine the one-to-one correspondence between each column and the system object label, so as to facilitate further dynamic determination of the location where the system data is written to the database in combination with the template-specific table. The template relationship table can be subdivided into several categories such as library level, multi-table level and single table level according to the business scale. The form varies but its purpose remains the same. The library level and multi-table level should establish corresponding associations and be identifiable.

[0130] For example, an example of a template relationship table provided in an embodiment of the present application is shown in Table 13.

[0131] Table 13

[0132] Column Name Data Types Allow Null Values Interpretation ID CHARACTER(32) N Identifiers Attribute VARCHAR N The name of the attribute column SystemID BOOLEAN N System object tag unique ID SystemAttribute BOOLEAN N The name of the system object tag …… …… …… ……

[0133] It should be noted that the template of the above template relationship table is only used for example and is not used to limit this application.

[0134] For example, a more specific example of a template relationship table provided in an embodiment of the present application is shown in Table 14.

[0135] Table 14

[0136]

[0137]

[0138] That is, for the database with the identity identifier XXXX40, the name of the attribute column is UserName, the system object tag unique ID is SXXXXX22, and the name of the system object tag is UserName. The databases with other identity identifiers in Table 14 are similar to the database with the identity identifier XXXX40, and will not be repeated here.

[0139] It should be noted that the data in Table 14 are only used for illustration and are not intended to limit this application.

[0140] It can be understood that, for a database with an identity identifier of XXXX40, the name of the table where the column is located can be determined from Table 12-1 and Table 12-2 through the identity identifier XXXX40 as UserTable; for a database with an identity identifier of XXXX48, the name of the table where the column is located can be determined from Table 12-1 and Table 12-2 through the identity identifier XXXX48 as ResourceImpItem; for a database with an identity identifier of XXXX52, the name of the table where the column is located can be determined from Table 12-1 and Table 12-2 through the identity identifier XXXX52 as ResourceImpItem; for a database with an identity identifier of XXXX58, the name of the table where the column is located can be determined from Table 12-1 and Table 12-2 as ResourceImplement through the identity identifier XXXX58.

[0141] Exemplarily, the relationship between each column in the database table and the system object tag may be pre-stored in the electronic device for subsequent direct call.

[0142] In some examples, before obtaining the template base table, the template specific table, and the template relationship table, the method may further include:

[0143] Design dynamically extensible database templates.

[0144] Specifically, further abstraction is performed in combination with business needs and basic requirements of scalability to obtain an instance database structure that is highly flexible and scalable. On this basis, further expansion and abstraction are performed in combination with business that may change (considering certain cost costs, and eliminating factors that cause insufficient expansion and abstraction due to cost as much as possible, in order to obtain changes to efficient data models). An extensible database template is constructed that can modify the instance database structure by modifying the custom database template. According to changes in business needs in the later stage of the deduction, the extensible database template is adjusted in real time to establish an instance database that meets the deduction and the corresponding extensible database template, that is, the design of a dynamic extensible database template is abstracted.

[0145] Exemplarily, business requirements may include the need for user authority management, recording user operation time, creation of capital request forms, which items are included in each capital request form, the types and specifications of each item, the person who prepares the capital request form, the proofreader, etc.; extensibility includes structural changes and data. For example, the increase of item types and the increase of specifications of a certain type of items only requires adding a row of data to the type or specification database. If a special new type needs to be added, a new table will be needed after the item type is added to store the various specifications of this special type (originally only length, width and height may be required, and special types require radius height and inner ring radius, etc.); the specific process of further abstraction is the process of building a dynamic and extensible database template before storing data according to business needs and extensibility requirements.

[0146] It should be noted that the dynamically extensible database template in the embodiment of the present application includes but is not limited to a template base table, a template-specific table, and a template relationship table.

[0147] In step S120, after acquiring the dynamic extensible database template, the electronic device may further traverse the dynamic extensible database template based on the programming language and the database language to establish an instance database structure.

[0148] Exemplarily, the programming language may include at least one of Python, Java, JavaScript, etc.

[0149] Exemplarily, the database language may include at least one of structured query language SQL, data definition language DDL, data manipulation language DML, and the like.

[0150] In step S130, after the electronic device traverses the dynamically extensible database template based on the programming language and the database language to establish the instance database structure, it can also construct an instance database according to the instance database structure.

[0151] For example, an instance database refers to a specific database instance running in a database management system. The instance database is dynamic, including the current data and status, and may change with the addition, deletion, and modification of data. A general database is static, referring to the definition and structure of the database, and does not necessarily reflect the current data status.

[0152] In order to better understand the database construction method provided in the embodiments of the present application, three more specific implementation methods are described below.

[0153] Implementation method 1:

[0154] First, based on business requirements and functional abstraction, the structural design of the instance database is completed first, and then the instance database structure is abstracted into a dynamic extensible database template (i.e., step S110 obtains a dynamic extensible database template). The template basic tables included in the dynamic extensible database template are shown in Table 2, Table 4-1, Table 4-2, Table 4-3, Table 6-1, Table 6-2, Table 8-1 and Table 8-2 above, the template-specific tables included in the dynamic extensible database template are shown in Table 12-1 and Table 12-2, and the template relationship tables included in the dynamic extensible database template are shown in Table 14-1 and Table 14-2. Then, based on the programming language and database language, the above-mentioned dynamic extensible database template is traversed to establish the instance database structure. Next, according to the instance database structure, an instance database is constructed. The constructed instance database template is shown in Table 15, and the constructed more specific instance database is shown in Table 16-1 and Table 16-2.

[0155] Table 15

[0156] Column Name Data Types Allow Null Values UserOID VARCHAR FALSE UserID VARCHAR(50) FALSE UserName VARCHAR(50) FALSE UserPassword VARCHAR(50) FALSE IsUsing BIT FALSE CreatedTime TIMESTAMP FALSE SpecialtyCode VARCHAR TURE SpecialtyStr VARCHAR(255) TURE RoleStr VARCHAR(255) TURE Mdb VARCHAR(50) TURE

[0157] It should be noted that Table 15 is only used for example and is not intended to limit this application.

[0158] Table 16-1

[0159] ID UserID UserName UserPassword IsUsi-ng XXXX51 ID1 NameA 1 XXXXCC ID2 NameB 1 XXXXB3 ID3 NameC 1 XXXXB5 ID4 NameD 1 …… …… …… …… ……

[0160] Table 16-2

[0161] Created-Time Specialty Code SpecialtyStr RoleStr Mdb XXXXX XX XXX XXX XXXXX XXXXXX XX XXX XXXXX XXX XX XXX XXXXX XXXXXXX XX XXX …… ……

[0162] It should be noted that Table 16-1 and Table 16-2 constitute a complete instance database and are only used for illustration and are not used to limit this application.

[0163] Implementation method 2:

[0164] First, based on business requirements and functional abstraction, the structural design of the instance database is completed first, and then the instance database structure is abstracted into a dynamic extensible database template (i.e., step S110 obtains the dynamic extensible database template). The template basic tables included in the dynamic extensible database template are shown in Table 2, Table 4-1, Table 4-2, Table 4-3, Table 6-1, Table 6-2, Table 9-1 and Table 9-2 above, the template-specific tables included in the dynamic extensible database template are shown in Table 12-1 and Table 12-2, and the template relationship tables included in the dynamic extensible database template are shown in Table 14-1 and Table 14-2. Then, based on the programming language and database language, the above-mentioned dynamic extensible database template is traversed to establish the instance database structure. Next, according to the instance database structure, the instance database is constructed. The constructed instance database template is shown in Table 17, and the constructed more specific instance database is shown in Table 18-1 and Table 18-2.

[0165] Table 17

[0166] Column Name Data Types Allow Null Values ResourceImplementOID VARCHAR NOT Code VARCHAR NOT ReMark VARCHAR NOT IsRejected VARCHAR NOT Approver VARCHAR NOT ApproveTime VARCHAR NOT RejectedType TIMESTAMP NOT IsRealFinish VARCHAR NULL ID VARCHAR NULL

[0167] It should be noted that Table 17 is only used for example and is not intended to limit this application.

[0168] Table 18-1

[0169]

[0170] Table 18-2

[0171]

[0172]

[0173] It should be noted that Table 18-1 and Table 18-2 constitute a complete instance database and are only used for illustration and are not used to limit this application.

[0174] Implementation method three:

[0175] First, based on business requirements and functional abstraction, the structural design of the instance database is completed first, and then the instance database structure is abstracted into a dynamic extensible database template (i.e., step S110 obtains a dynamic extensible database template). The template basic tables included in the dynamic extensible database template are shown in Table 2, Table 4-1, Table 4-2, Table 4-3, Table 6-1, Table 6-2, Table 10-1 and Table 10-2 above, the template-specific tables included in the dynamic extensible database template are shown in Table 12-1 and Table 12-2, and the template relationship tables included in the dynamic extensible database template are shown in Table 14-1 and Table 14-2. Then, based on the programming language and database language, the above-mentioned dynamic extensible database template is traversed to establish the instance database structure. Next, according to the instance database structure, an instance database is constructed. The constructed instance database template is shown in Table 19, and the constructed more specific instance database is shown in Table 20-1 and Table 20-2.

[0176] Table 19

[0177]

[0178]

[0179] It should be noted that Table 19 is only used for example and is not intended to limit this application.

[0180] Table 20-1

[0181]

[0182] Table 20-2

[0183] CreateTime Auditer1 Auditer2 CIVIAuditer CIVIDesigner …… XXXXX XXXYUE XXXBO XXDAN XXXJTA …… XXXXX XXXYUE XXXBO …… XXXXX XXXYUE XXXBO XXDAN XXXJTA …… XXXXX XXXYUAN XXXZHENG XXDAN XXXJTA …… …… …… ……

[0184] It should be noted that Table 20-1 and Table 20-2 constitute a complete instance database and are only used for illustration and are not used to limit this application.

[0185] It should be noted that in the embodiment of the present application, a template relationship table is formed, that is, a core logical relationship table between the system and the database is established, and the fixed relationship between the system and the database (conventional practice) written in the program code is changed to a dynamically variable logical relationship, which deeply decouples system development and database structure design, and provides a highly scalable database template to adapt to changes in various requirements. For example, a more powerful joint system will be established when combined with a dynamically scalable system.

[0186] Example 2

[0187] The embodiment of the present application also provides a data processing method based on a database, which can be executed by a data processing device and an electronic device based on a database. For example, the data processing method based on a database can be applied to the process of entering and updating the operating data (such as temperature and pressure, etc.) of a nuclear power plant, and can also be used in the process of entering and updating the basic information of the staff in the nuclear power plant. The following is an example of the data processing method based on a database being executed by an electronic device.

[0188] like Figure 2 As shown, the database-based data processing method provided in the embodiment of the present application may include steps S210 to S240.

[0189] S210, obtaining data to be processed, its corresponding data processing method and data type, wherein the data processing method includes at least one of adding a data row, deleting a data row and modifying data.

[0190] S220. Determine a target instance database according to the data type. The target instance database is constructed using the database construction method of any one of the first embodiments.

[0191] S230: Determine a target storage location of the data to be processed in the target instance database according to the data processing method and the target dynamically extensible database template corresponding to the target instance database.

[0192] S240. Based on the target dynamically extensible database template, the target storage location is processed according to the data processing method.

[0193] According to the database-based data processing method provided by the embodiment of the present application, first determine the target storage location of the data to be processed in the target instance database according to the data processing method; then, determine the target storage location of the data to be processed in the target instance database according to the data processing method and the target dynamic extensible database template corresponding to the target instance database; and then process the target storage location according to the data processing method based on the target dynamic extensible database template. In this way, in order to respond to changes in demand or when changes in the business field occur in the future, the dynamic extensible database template is updated and modified to obtain a modified dynamic extensible database template, and then the instance database is updated and modified to obtain a modified instance database, so that the instance database has higher variability and elasticity, can adapt to business development and changes in demand in a longer time period, and realize the maximization of system scalability, without the need for database reconstruction design and system redevelopment, saving manpower, material and financial resources, reducing the cost of later system upgrades, greatly reducing the rejection of scalability by system developers, improving comprehensive benefits, and transforming deep customized development into business customized development based on changes.

[0194] The specific implementation methods of the above steps are introduced below.

[0195] In step S210 , the data to be processed may be data that needs to be processed but has not been processed.

[0196] Exemplarily, adding a new data row means adding a data row that is not in the instance database column; deleting a data row may mean deleting an existing data row in the instance database column; modifying data may include writing data values ​​(that is, when there are existing data rows, the data value of the data column changes from empty to assigned values) and deleting data row values ​​(that is, when there are existing data rows, the data value of the data column changes from assigned values ​​to cleared values).

[0197] As an example, the data processing method includes adding a new data row; as another example, the data processing method includes deleting a data row and modifying data; as yet another example, the data processing method includes adding a new data row, deleting a data row, and modifying data.

[0198] Exemplarily, the data type corresponds to the data to be processed, and the data type includes a first type and a second type. The first type can be used to characterize the data to be processed when the dynamically extensible database template is not modified. The second type can be used to characterize the data to be processed when the dynamically extensible database template is modified.

[0199] Exemplarily, the electronic device pre-stores the data to be processed, the data processing method and data type corresponding to the data to be processed; or the data to be processed, the data processing method and data type corresponding thereto can be obtained through the user's input operation based on the input box of the electronic device display interface. The input operation can be an operation of inputting the data to be processed, the data processing method and data type corresponding thereto.

[0200] In step S220, after obtaining the data to be processed, its corresponding data processing method and data type, the electronic device can also determine the target instance database according to the data type. The target instance database is constructed using the database construction method of any one of Embodiment 1.

[0201] In some embodiments, the data type includes a first type or a second type, and the target instance database includes at least one of an instance database and a modified instance database;

[0202] Determine the target instance database based on the data type, including:

[0203] In a case where the data type includes the first type, determining the target instance database to be the instance database;

[0204] Alternatively, when the data type includes the second type, the target instance database is determined to be the modified instance database, or the target instance database is determined to be the modified instance database and the instance database.

[0205] In this way, the target instance database can be determined accurately and quickly, providing a basis for subsequently determining the target storage location of the to-be-processed data in the target instance database.

[0206] In some implementations, before determining the target instance database according to the data type, the method further includes:

[0207] Based on business needs, modify the backup dynamic extensible database template to obtain a modified dynamic extensible database template, where the backup dynamic extensible database template is a dynamic extensible database template in the backup database of the instance database;

[0208] Based on the programming language and the database language, the modified dynamically extensible database template is traversed to establish a modified instance database structure;

[0209] According to the modified instance database structure, determine the unavailable range under dynamic switching;

[0210] When the unavailable range related functions are closed, a modified instance database is constructed according to the modified instance database structure, and the modified template relationship table in the modified instance database corresponds to the template relationship table in the instance database.

[0211] For example, after system optimization and instance database structure optimization, a dynamically extensible database template is designed, the instance database and the dynamically extensible database template are backed up, and a backup database of the instance database and a dynamically extensible database template in the backup database are obtained. For example, the original system is centrally deployed, and due to the huge amount of data, the system needs to be transformed into a distributed deployment, then the original database needs to be analyzed and disassembled, and the library table structure also needs to be optimized to a certain extent; for another example, the original system did not consider the user's authority control over data, and now it is necessary to consider the user's deep authority control over data based on the role (need to reach the granularity of objects and object attributes), and the library table structure also needs to be optimized and adjusted accordingly.

[0212] The business requirements are described in step S110 in Example 1 and will not be repeated here.

[0213] Exemplarily, in combination with business needs, the backup dynamic extensible database template is modified, the business system function is modified based on the business needs, a new template-specific table (i.e., the modified template-specific table), a new template relationship table (i.e., the modified template relationship table) and a new instance database structure (i.e., the modified instance database structure) are established based on the modified dynamic extensible database template, a minimization impact analysis is performed on the system and database structure (i.e., the modified instance database structure), and the unavailable range in the case of dynamic switching is determined (compatible with the scenario of suspending all systems for optimization), the unavailable range-related functions are closed, and a correspondence between the new and old relationship tables is established (i.e., the modified template relationship table in the modified instance database, and the relationship table corresponding to the template relationship table in the instance database), a new instance database (i.e., the modified instance database) is created based on the new dynamic extensible database template (i.e., the modified dynamic extensible database template), and it is analyzed and determined whether the template modification involves the deletion, disassembly and reorganization of the existing instance database structure (simply adding libraries, tables, columns, modifying names, etc. does not belong to structural deletion, disassembly and reorganization; those that affect changes in existing data are all involved, such as whether changes to empty data are allowed).

[0214] Specifically, a minimization impact analysis is performed on the system and database structure, and the unavailability range in the case of dynamic switching is determined, which is used to determine the minimum downtime when dynamically switching between two template libraries (i.e., the instance database and the modified instance database). The system refers to the uninterrupted business of the front-end business system, and the database structure refers to the changes in the database template (i.e., the dynamically extensible database template). Changes in the database structure will affect the system's writing (including additions, modifications, and deletions) and queries. Therefore, minimization analysis refers to simulating the places where the business is affected by changes in the database structure (i.e., the instance database structure and the modified instance database structure) during the switching process, and identifying that such business must be suspended when the database structure changes in the future until the database structure transformation and data transformation are completed.

[0215] Specifically, the unavailable range can be the minimum downtime when dynamically switching between two template libraries (ie, the instance database and the modified instance database). The specific process of closing the unavailable range is to trigger the system shutdown or partial module locking by starting the "database structure change" event.

[0216] Specifically, the disappearance of each row of the template library (i.e., dynamically extensible data template) (and no longer appearing in other template library tables) indicates the deletion of the data column of the instance database. The deletion of rows at different levels will reflect different changes in the instance database structure. The more rows in the front table disappear, the greater the change in the instance database structure. The disappearance of each row of the template library (all appearing in other template library tables) indicates the disassembly and reorganization of the instance database table structure, and the impact of rows at different levels is also different. The above principle can be used to analyze and determine whether template modification involves the deletion, disassembly and reorganization of the existing instance database structure.

[0217] In step S230, the electronic device determines the target instance database based on the data type. After the target instance database is constructed using the database construction method of any one of Embodiment 1, it can also determine the target storage location of the data to be processed in the target instance database based on the data processing method and the target dynamically extensible database template corresponding to the target instance database.

[0218] Exemplarily, the target storage location may be the location of the data to be processed in the target instance database. The target storage location may include a target row and a target column, wherein the target row is the row corresponding to the data to be processed, and the target column is the column of the data to be processed in the target instance database.

[0219] In some implementations, determining a target storage location of the data to be processed in the target instance database according to the data processing mode and the target dynamically extensible database template corresponding to the target instance database includes:

[0220] When the data processing method includes at least one of adding a data row and deleting a data row, obtaining a first system object tag corresponding to the data to be processed,

[0221] Determine a first column name corresponding to the first system object tag from a target template relationship table in a target dynamically extensible database template corresponding to the target instance database;

[0222] A storage location corresponding to the first column name in a target template-specific table in a target dynamically extensible database template is determined as a target storage location.

[0223] It should be noted that the first system object tag and the data to be processed can constitute a related object group in the locking system. The first system object tag and the second system object tag mentioned below are used to determine the corresponding storage location of the target instance database (i.e., the target storage location) through the target template relationship table and the target template dedicated table. The data value of the storage system object tag (i.e., the storage location corresponding to the first column name) corresponds to the specific path of the table and column of the instance database (i.e., the target instance database). The data to be processed can be used to lock and modify a specific row or to operate a row or a column when a row is locked. The data value of the storage system object tag corresponds to the specific path of the table and column of the target instance database, which generally includes the computer name / IP address of the server, the login computer username and password, the database name, the database username and password, the data table name, etc.

[0224] In other embodiments, when the data processing method includes modifying data, obtaining a second system object tag corresponding to target data, the target data being a data value adjacent to the data to be processed;

[0225] Determine a second column name corresponding to the second system object tag from a target template relationship table in a target dynamically extensible database template corresponding to the target instance database;

[0226] A storage location corresponding to the second column name in a target template dedicated table in a target dynamically extensible database template is determined as a target storage location.

[0227] Exemplarily, the target template relationship table locking object (i.e., the first system object tag) is read in a loop, the target template dedicated table is read, the data row (i.e., the first column name) is locked in conjunction with the locking object, the target instance database related library table is indexed based on the data value of the relevant column of the data row, and based on the system object tags corresponding to other data except the data to be processed, the relevant rows and columns that need to be modified are locked in the target instance database (i.e., the target storage location), and the data to be processed is written.

[0228] In step S240, after the electronic device determines the target storage location of the data to be processed in the target instance database according to the data processing method, it can also process the target storage location according to the data processing method based on the target dynamically extensible database template.

[0229] For example, if the data processing method is to add a data row, the target storage location is processed according to the data processing method to add a data row at the target storage location. For another example, if the data processing method is to delete a data row, the target storage location is processed according to the data processing method to delete the data row at the target storage location. For another example, if the data processing method is to write a data value, the target storage location is processed according to the data processing method to write a data value to be processed at the target storage location. For another example, if the data processing method is to delete a data value, the target storage location is processed according to the data processing method to delete the data value to be processed at the target storage location.

[0230] That is to say, when the target storage location of the target instance database needs to be processed according to the data processing method, the target dynamically extensible database template is traversed based on the programming language and the database language to determine the location and method that needs to be modified, and the target instance database is modified in combination with the data adjustment situation. In other words, it is equivalent to backing up the template library before updating, and then modifying it, and comparing the differences between the two template libraries (i.e., the dynamically extensible database template and the modified dynamically extensible database template) to find the location and method that needs to be modified. The methods are divided into general modifications (i.e., the situation that does not involve the deletion, disassembly and reorganization of the instance database structure) and special modifications (the situation that involves at least one of the deletion, disassembly and reorganization of the instance database structure), which will be introduced below.

[0231] In some implementations, when the target instance database includes the modified instance database, the target dynamic extensible database template corresponding to the target instance data includes the modified dynamic extensible database template;

[0232] Based on the target dynamically extensible database template, the target storage location is processed according to the data processing method, including:

[0233] When the modified dynamic extensible database template does not involve deletion, disassembly and reorganization of the instance database structure, the modified dynamic extensible database template is enabled and the dynamic extensible database template of the instance database is disabled;

[0234] Based on the modified dynamically extensible database template, the target storage location is processed according to the data processing method.

[0235] Exemplarily, when the modified dynamic extensible database template does not involve the deletion, disassembly and reorganization of the instance database structure, the state values ​​of the new and old dynamic extensible database templates are modified, the new one (i.e. the modified dynamic extensible database template) is enabled, the old one (i.e. the dynamic extensible database template) (including relational tables and special tables) is disabled, and the new data (i.e. the data to be processed) is written into the modified instance database. More specifically, the state value of the modified dynamic extensible database template is set to true to enable the modified dynamic extensible database template, and the state value of the dynamic extensible database template is set to false to disable the dynamic extensible database template.

[0236] That is to say, when making general modifications to the target instance database, the relevant object group in the system is locked, the relevant object group includes the first system object tag and the data to be processed (multiple data types), the modified dynamic extensible database template relationship table is traversed based on the programming language and the database language, the modified template relationship table locking object is read cyclically, the modified template dedicated table is read, the data row is locked in combination with the locking object, and the modified instance database related library table is indexed based on the data value of the relevant column of the data row.

[0237] In some examples, after processing the target storage location according to the data processing method based on the modified dynamically extensible database template, the method further includes:

[0238] When the available range related function is enabled, verify the data values ​​contained in both the instance database and the modified instance database to obtain a first verification result;

[0239] If the first verification result is passed, switch to the modified instance database.

[0240] Exemplarily, new data (i.e., data to be processed) is written into the modified instance database, unavailable range-related functions are turned on, and the newly written data (i.e., data to be processed) and the original data in the instance database and the system are verified multiple times. If there is an inconsistency in the multiple-frequency verification, the first verification result is failed, and the step of "modifying the backup dynamic extensible database template based on business needs to obtain the modified dynamic extensible database template" is returned, and other steps after this step are executed for optimization, that is, the backup is modified and verified again. If the multiple-frequency verifications are consistent, the first verification result is passed, and the modified instance database is officially switched. It is understandable that the multiple frequencies can be 3 times, 5 times, etc., which are not limited here. The modified instance database includes a modified dynamic extensible database template, a modified template relationship table, and a modified template-specific table.

[0241] The verification process here and below is: verify by querying the query results of the same existing data in the modified dynamic extensible database template and the dynamic extensible database template, and verify the existing data according to whether the query results of the same data are consistent (i.e., the same) (both the newly written data and the original data are regarded as existing data, so it is necessary to first query the original data by multiple frequencies to verify the validity, and query the existing data by multiple frequencies in large quantities to verify the integrity). Generally, the same type of newly written data is queried correctly for multiple times (which can be set, the default is 3 times) (provided that the existing data has been completely queried and correct) (the premise is that the existing data has been completely queried and correct) and is considered to be verified successfully, that is, the verification result is passed. Modification again means that the modified dynamic extensible database template is modified again and the re-verification process is started, because at this time, the new and old modifications have caused data inconsistency, indicating that there is a problem with the modification of the modified dynamic extensible database template, and it is necessary to analyze and solve it before starting the verification again.

[0242] The relevant situation of special modification is another core logic of the embodiment of the present application in addition to the overall method. It should be noted that the first identification involves the modification of the instance database structure, and the second analysis and judgment involves the difference and connection between the deletion, disassembly and reorganization of the existing instance database structure. The first identification involves the modification of the instance database structure is used to determine whether the instance database structure needs to be adjusted, and the second analysis and judgment involves the deletion, disassembly and reorganization of the existing instance database structure is used to determine how to modify the instance database structure. The first identification is the premise and basis of the second analysis, and the second analysis is a further refinement of the first identification. When the modified instance database is specially modified (i.e., the case of modifying the dynamic extensible database template), the modified dynamic extensible database template is first modified, and then the instance database structure (modified instance database structure) or data is automatically updated and modified based on the modified dynamic extensible database template and the previous version template (i.e., the dynamic extensible database template) in combination with the programming language and the database language.

[0243] In other embodiments, when the target instance database includes an instance database and a modified instance database, the target dynamically extensible database template corresponding to the target instance data includes a dynamically extensible database template and a modified dynamically extensible database template, and the target storage location includes a first storage location in the instance database and a second storage location in the modified instance database;

[0244] Based on the target dynamically extensible database template, the target storage location is processed according to the data processing method, including:

[0245] In the case where the modified dynamically extensible database template involves any one of deletion, disassembly and reorganization of the instance database structure, enabling the modified dynamically extensible database template and the dynamically extensible database template of the instance database;

[0246] Based on the modified dynamic and extensible database template, the first storage location is processed according to the data processing method, and based on the dynamic and extensible database template, the second storage location is processed according to the data processing method.

[0247] That is to say, the status values ​​of the new and old dynamically extensible database templates (i.e., the modified dynamically extensible database template and the dynamically extensible database template) are modified, data synchronization is enabled, and newly generated data is written to the new instance database (i.e., the modified instance database) and the old instance database (i.e., the instance database) at the same time.

[0248] In some other examples, after processing the target storage location according to the data processing method based on the modified dynamically extensible database template, the method further includes:

[0249] When the available range related function is enabled, verifying the data values ​​included in both the instance database and the modified instance database to obtain a second verification result;

[0250] If the second verification result is passed, the data of the backup database corresponding to the instance database is converted to the modified instance database according to the first corresponding relationship to obtain the converted instance database, and the first corresponding relationship is the corresponding relationship between the modified template relationship table in the modified instance database and the template relationship table in the instance database;

[0251] Verifying the data values ​​contained in both the instance database and the converted instance database to obtain a third verification result;

[0252] If the third verification result is passed, the modified dynamic extensible database template is enabled, the dynamic extensible database template is closed, and the modified instance database is switched to.

[0253] That is to say, turn on the unavailable range related functions, perform data verification on the new and old instance databases (i.e., the modified instance database and the instance database) multiple times, focusing on the newly written data (including system verification). If there is one inconsistency in the multiple frequency verifications, the second verification result is failed, and return to the step of "modify the backup dynamic extensible database template based on business needs to obtain the modified dynamic extensible database template", and perform other steps after this step for optimization, that is, modify and verify again after the backup. If the multiple frequency verifications are consistent, the second verification result is passed, and combined with the correspondence between the new and old relationship tables (i.e., the first correspondence), the backup data is The data in the old and new instance databases are converted to the new instance database (i.e. the modified instance database), and the data of the new and old instance databases are verified multiple times, with a focus on the data conversion part (including system verification). If there is an inconsistency in the multiple-frequency verification, the third verification result is failed, and the system returns to the step of "modifying the backup dynamic extensible database template based on business needs to obtain the modified dynamic extensible database template", and executes other steps after this step for optimization, that is, modifying and verifying again after the backup. If the multiple-frequency verifications are consistent, the third verification result is passed, and the status values ​​of the new and old dynamic extensible database templates are modified, and the system officially switches to the modified instance database.

[0254] In still other embodiments, when the target instance database includes an instance database and a modified instance database, the target dynamically extensible database template corresponding to the target instance data includes a dynamically extensible database template and a modified dynamically extensible database template, and the target storage location includes a first storage location in the instance database and a second storage location in the modified instance database;

[0255] Based on the target dynamically extensible database template, the target storage location is processed according to the data processing method, including:

[0256] In the case where the modified dynamically extensible database template involves any one of deletion, disassembly and reorganization of the instance database structure, enabling the modified dynamically extensible database template and the dynamically extensible database template of the instance database;

[0257] According to the first corresponding relationship, the data of the backup database corresponding to the instance database is converted into the modified instance database to obtain the converted instance database, and the first corresponding relationship is the corresponding relationship between the modified template relationship table in the modified instance database and the template relationship table in the instance database;

[0258] Verifying the data values ​​contained in both the instance database and the converted instance database to obtain a third verification result;

[0259] If the third verification result is passed, the modified dynamic extensible database template is enabled, and the dynamic extensible database template of the instance database is disabled;

[0260] Based on the modified dynamic and extensible database template, the first storage location is processed according to the data processing method, and based on the dynamic and extensible database template, the second storage location is processed according to the data processing method.

[0261] That is to say, the status values ​​of the new and old dynamic scalable database templates (i.e., the modified dynamic scalable database template and the dynamic scalable database template) are modified, and the data of the backup database is converted to the new instance database (i.e., the modified instance database) in combination with the correspondence between the new and old relationship tables. The data of the new and old instance databases are verified multiple times, with a focus on the data conversion part (including system verification). If there is an inconsistency in the multiple-frequency verification, the third verification result is failed, and the step of "modifying the backup dynamic scalable database template based on business needs to obtain the modified dynamic scalable database template" is returned, and other steps after this step are executed for optimization, that is, modifying and verifying again after the backup. If the multiple-frequency verifications are consistent, the third verification result is passed, and the status values ​​of the new and old dynamic scalable database templates are modified, data synchronization is enabled, and the newly generated data is written to the new instance database (i.e., the modified instance database) and the old instance database (i.e., the instance database) at the same time.

[0262] In some other examples, after processing the second storage location in accordance with the data processing manner based on the dynamically extensible database template, the method further includes:

[0263] When the available range related function is enabled, verifying the data values ​​included in both the instance database and the modified instance database to obtain a second verification result;

[0264] If the second verification result is passed, the modified dynamic scalable database template is enabled, the dynamic scalable database template is closed, and the modified instance database is switched to.

[0265] That is to say, turn on the unavailable range related functions, perform data verification on the new and old instance databases multiple times, focus on the newly written data (including system verification), if there is an inconsistency in the multiple frequency verification, the second verification result is failed, and return to the step of "modify the backup dynamic extensible database template based on business needs to obtain the modified dynamic extensible database template", and execute other steps after this step for optimization, that is, modify and verify again after backup. If the multiple frequency verifications are consistent, the second verification result is passed, modify the new and old dynamic extensible database template status values, and officially switch to the new instance database (that is, the modified instance database).

[0266] It should be noted that the difference between this implementation and the other implementations above is that whether to enable data writing into the new instance database (i.e. the modified instance database) first or to complete the conversion of the existing data in the original instance database (i.e. the instance database) first, the timeliness and the affected scope have certain differences. If the probability of one-time pass is high (involving the amount of modification, complexity, the ability of the design template personnel, the degree of design standardization, accidental factors, etc.), generally choose the other implementations above, which have high timeliness (the business system starts earlier); if the one-time pass rate is low, generally choose this implementation, the affected business is in a suspended state, no data will be generated, and focus on dealing with consistency issues.

[0267] In some further implementations, when the target instance database includes an instance database, the target dynamically extensible data template corresponding to the target instance database includes a dynamically extensible database template, and based on the target dynamically extensible database template, the target storage location is processed according to the data processing method, including:

[0268] Based on the dynamically extensible database template, the target storage location is processed according to the data processing method.

[0269] Exemplarily, the data to be processed is written to a target storage location of the instance database based on a dynamically extensible database template, rather than being directly written into the instance database as in conventional practice.

[0270] The following is a further explanation of the conversion of existing data. The deletion, disassembly, and reorganization of data structures and data involve the following detailed changes, mainly including changes in data format, changes in whether the data is empty, changes in data cancellation, changes in data addition, changes in data storage structure, etc. The embodiments of this application are only explained from a logical method perspective, and actual system development can be flexibly handled in combination with programming languages ​​and database characteristics.

[0271] Data format changes generally refer to changes of the same type, and do not involve changes such as changing from a numeric type to a time type. If so, they can be softened, that is, creating a new type, abandoning the original type, and converting the original data into the new type according to the corresponding rules. When the same type changes, upgrades are generally considered, such as changing a fixed-length string to an indefinite-length string, changing an indefinite-length string with a maximum number of restrictions to an indefinite-length string type with an unlimited number of restrictions. For downgrades, softening is generally used.

[0272] The changes of whether to allow null mainly include changing from allowed to not allowed and from not allowed to allowed. In the case of changing from allowed to not allowed, the corresponding type of specific value is generally used to fill the position, such as NULL / 00000 / XXXX / 9999-12-31 / FALSE, etc.; changing from not allowed to allowed generally does not require any processing.

[0273] Generally, structural changes that simply cancel data are not performed, unless there is no need for compatibility with existing data. New logical relationships can be established to soften the data, such as data disassembly, shelving, and status value changes.

[0274] New changes in data are generally not processed specially, and structural adjustments and data writing are completed according to the dynamically extensible database template.

[0275] The change of data storage structure is the difficulty of data conversion. The situation is relatively complex and changeable. When it comes to database structure change, it is generally completed in the form of mapping relationship, that is, the correspondence table between the new and old relationship tables (that is, the first correspondence table). In addition, the above data structure processing may be involved in the middle, which can be handled according to the corresponding method.

[0276] In actual application, log and backup records of the entire process should also be considered.

[0277] In order to better understand the database-based data processing method provided in the embodiment of the present application, a more specific implementation method is described below.

[0278] For example, Figure 3As shown, in one cycle (i.e., the first cycle), the data to be processed is AAAB-001P, the item number is the first system object label, the design pressure is the second system object label, and 0.4MPa is the target data; when the target instance database is the instance database, the target template relationship table is the template relationship table, the target template special table is the template special table, and the target dynamic extensible database template is the dynamic extensible database template, the one-cycle data processing process includes: ① determining that the uniqueness representation of the first system object label is sd02f0trs…, the data to be processed is AAAB-001P, the data processing method includes modifying the newly added data value in the data, and the data type is the first type (i.e., step S210 obtains the data to be processed, its corresponding data processing method and data type); ② determining that the target instance database is the instance database, determining the target dynamically extensible data The library template is a dynamic extensible database template (i.e., step S220 determines the target instance database according to the data type); from the template relationship table in the dynamic extensible database template in the instance database, determine that the first column name corresponding to sd02f0trs... is RefNumber; ③ the specific path corresponding to RefNumber in the template dedicated table in the dynamic extensible database template in the instance database is determined as the target storage location; ④ the target storage location is found in the instance database (i.e., step S230 determines the target storage location of the data to be processed in the target instance database according to the data processing method and the target dynamic extensible database template corresponding to the target instance database); ⑤ AAAB-001P is written to the target storage location (i.e., step S240 processes the target storage location according to the data processing method based on the target dynamic extensible database template). Similarly, the secondary cycle data processing process includes steps ⑥ to ⑩ which are similar to the above steps ① to ⑤, and will not be repeated here.

[0279] As an example, the modified instance database template corresponding to Table 19 is shown in Table 21.

[0280] Table 21

[0281] Column Name Data Type Allow Null Value ResourceImplementOID VARCHAR(255) NOT ImplementCode VARCHAR(255) NOT FormName VARCHAR(255) NOT FormDes VARCHAR(255) NOT State INTEGER NOT CreateBy VARCHAR(255) NOT Explain VARCHAR NULL CreateTime TIMESTAMP NOT …… …… ……

[0282] That is to say, compared with Table 19, Table 21 adds the Explain data row between CreateBy and CreateTime.

[0283] It should be noted that Table 21 is only used for example and is not intended to limit this application.

[0284] More specifically, the modified instance database template corresponding to Table 20-1 is shown in Table 22.

[0285] Table 22

[0286]

[0287] That is to say, compared with Table 20-1, Table 22 adds the Explain data row to the right of CreateBy.

[0288] It should be noted that Table 22 is only used for illustration and is not intended to limit this application.

[0289] As another example, the modified instance database template corresponding to Table 23 is shown in Table 23.

[0290] Table 23

[0291] Column Name Data Type Allow Null Value ResourceImplementOID VARCHAR(255) NOT ImplementCode VARCHAR(255) NOT FormName VARCHAR(255) NOT FormDes VARCHAR(255) NOT State INTEGER NOT UserName VARCHAR(255) NOT Explain VARCHAR NOT CreateTime TIMESTAMP NOT …… …… ……

[0292] That is to say, compared with Table 19, Table 23 changes CreateBy to UserName, and adds a new Explain data row between UserName and CreateTime. Compared with Table 21, Table 23 changes CreateBy to UserName, and the Explain data row does not allow Null values.

[0293] It should be noted that Table 23 is only used for example and is not intended to limit this application.

[0294] More specifically, the modified instance database template corresponding to Table 20-1 is shown in Table 24.

[0295] Table 24

[0296]

[0297]

[0298] That is to say, compared with Table 20-1, Table 24 changes CreateBy to UserName, adds the Explain data row to the right of UserName, changes the specific value in State, and adds specific values ​​in UserName and Explain; compared with Table 22, Table 24 changes CreateBy to UserName, changes the specific value in State, and adds specific values ​​in UserName and Explain.

[0299] It should be noted that Table 24 is only used for example and is not intended to limit this application.

[0300] The embodiments of the present application are different from various systems with so-called dynamically extensible functions on the market. There is an essential difference in their core logic. All dynamically extensible systems on the market are composed of databases and system buttons with fixed correspondences. The essence of this is to modify the system without modifying the database structure or to modify it within a certain range. The method of the embodiments of the present application is to adjust the structure of the instance database after the database template structure changes, and complete the conversion of existing data stored under the new structure.

[0301] The first writing of the instance database is to use the template relationship table and the template-specific table, and through the specified system object tag (i.e., the first system object tag), the template relationship table and the template-specific table to lock which server, which database, and which table the data is written to, add a new row to the table specified by the locked instance database to complete the single row addition; and combine other system object tags except the first system object tag and their corresponding data values ​​(i.e., target data), the template relationship table and the template-specific table to assign values ​​to the columns of the newly added row of the table specified by the locked instance database to complete the data assignment of a single row and a single column or a single row and multiple columns; then use a similar method to complete the first writing of data for the relevant system tags (i.e., other system object tags except the first system object tag) and their corresponding data values, that is, complete the data writing of multiple tables, multiple rows and multiple columns, and finally complete the first data writing.

[0302] When the data (i.e., the data to be processed) is written or modified again without modifying the instance database structure, the method is similar, using multiple or multiple groups of system object tags and their corresponding data values, template relationship tables, and template-specific tables to lock and write and modify data.

[0303] When it is necessary to modify the instance database structure, the instance database and the dynamic extensible database template need to be backed up, and a new dynamic extensible database template (i.e., the modified dynamic extensible database template) is established as needed. The dynamic extensible database template (i.e., the modified dynamic extensible database template) includes a template-specific table (i.e., the modified template-specific table) and a template relationship table (i.e., the modified template relationship table); the modified dynamic extensible database template is traversed based on the programming language and the database language to determine the location (i.e., the target storage location) and method (i.e., the data processing method) that need to be modified (i.e., the data processing method corresponding to the data to be processed in the above step S210 and the target dynamic extensible database template corresponding to the target instance database in the above step S230), and the instance database (i.e., the modified instance database) is modified in combination with the data adjustment situation (i.e., the target storage location is processed according to the data processing method based on the target dynamic extensible database template in the above step S240).

[0304] The database-based data processing method provided in the embodiment of the present application has at least the following beneficial effects:

[0305] The instance database has higher variability and elasticity, can adapt to business development and changes in demand in a longer period of time, and maximize the scalability of the system. Combined with the current modular system development logic, a highly self-use database can be realized; the system developed based on the dynamic scalable database template will have higher variability and elasticity, and will pre-encapsulate the expected but uncertain content (deep abstraction of basic business needs), reduce the cost of later system upgrades, greatly reduce the system developers' rejection of scalability, improve comprehensive benefits, and transform deep customized development into business customization development based on changes. In addition, different users can customize templates according to their own needs, or optimize existing templates, thereby greatly improving the entire dynamic scalable database template library, with significant benefits. In addition, it can also solve the problems of poor dynamic scalability and insufficient flexibility in existing database structure design technology.

[0306] Example 3

[0307] like Figure 4 As shown, the embodiment of the present application provides a database construction device, including:

[0308] A first acquisition module 310 is used to acquire a dynamically extensible database template;

[0309] A first traversal module 320, connected to the first acquisition module 310, is used to traverse the dynamic extensible database template based on the programming language and the database language to establish an instance database structure;

[0310] The first construction module 330 is connected to the first traversal module 320 and is used to construct an instance database according to the instance database structure.

[0311] In some implementations, the first acquisition module 310 is specifically configured to:

[0312] Obtain template basic table, template special table and template relationship table;

[0313] A dynamic and extensible database template is established based on the template basic table, template special table and template relationship table.

[0314] In some implementations, the first acquisition module 310 is specifically configured to:

[0315] Obtain at least one of a database identification table, a database name table, a database relationship table, a sub-table name table, and a sub-table attribute table; wherein the database identification table is used to indicate whether a distributed database is required and the number of distributed databases; the database name table is used to store the names and configuration information of different databases; the database relationship table is used to indicate the relationship between the sub-databases in the database; the sub-table name table is used to indicate the names, uses, and relationships of the sub-tables contained in the sub-databases in the database; and the sub-table attribute table is used to indicate the relationship between the sub-tables contained in the sub-databases in the database, as well as the attributes of the sub-tables;

[0316] A template basic table is established according to at least one item of a database identification table, a database name table, a database relationship table, a sub-table name table and a sub-table attribute table.

[0317] In some implementations, the first acquisition module 310 is specifically configured to:

[0318] Obtaining column information in a database table, including the table name, library name, database user name, database password, Internet protocol address of the server where the database is located, server user name and server password;

[0319] Create a template-specific table based on the column information.

[0320] In some implementations, the first acquisition module 310 is specifically configured to:

[0321] A relationship table between each column in the database table and the system object label is established to obtain a template relationship table.

[0322] The database construction device provided in the embodiment of the present application can be used to execute the database construction method, that is, it has the beneficial effects and implementation methods of the database construction method provided in Example 1 of the present application. For details, please refer to the specific description of the database construction method in the above Example 1, which will not be repeated in this embodiment.

[0323] Example 4

[0324] The embodiment of the present application also provides a data processing device based on a database, comprising:

[0325] A second acquisition module is used to acquire the data to be processed, its corresponding data processing method and data type, the data processing method including at least one of writing data, adding data rows, deleting data rows and modifying data;

[0326] A first determination module, connected to the second acquisition module, for determining a target instance database according to the data type, the target instance database being constructed by using the database construction device according to claim 17 or 18;

[0327] A second determination module, connected to the first determination module and the second acquisition module, is used to determine a target storage location of the data to be processed in the target instance database according to the data processing mode and the target dynamically extensible database template corresponding to the target instance database;

[0328] The processing module is connected to the second determining module and processes the target storage location according to the data processing method based on the target dynamically extensible database template.

[0329] In some embodiments, the device further comprises:

[0330] A modification module, used to modify the backup dynamic extensible database template based on business needs to obtain a modified dynamic extensible database template, where the backup dynamic extensible database template is a dynamic extensible database template in a backup database of the instance database;

[0331] A second traversal module, connected to the modification module, is used to traverse the modified dynamic extensible database template based on the programming language and the database language to establish a modified instance database structure;

[0332] A third determination module, connected to the second traversal module, is used to determine the unavailable range under dynamic switching according to the modified instance database structure;

[0333] The second construction module is connected to the third determination module and is used to construct a modified instance database according to the modified instance database structure when the unavailable range related functions are turned off. The modified template relationship table in the modified instance database corresponds to the template relationship table in the instance database.

[0334] In some implementations, the second determining module is specifically configured to:

[0335] When the data processing method includes at least one of adding a data row and deleting a data row, obtaining a first system object tag corresponding to the data to be processed,

[0336] Determine a first column name corresponding to the first system object tag from a target template relationship table in a target dynamically extensible database template corresponding to the target instance database;

[0337] A storage location corresponding to the first column name in a target template-specific table in a target dynamically extensible database template is determined as a target storage location.

[0338] In some implementations, the second determining module is specifically configured to:

[0339] In the case where the data processing method includes modifying data, obtaining a second system object tag corresponding to target data, the target data being a data value adjacent to the data to be processed;

[0340] Determine a second column name corresponding to the second system object tag from a target template relationship table in a target dynamically extensible database template corresponding to the target instance database;

[0341] A storage location corresponding to the second column name in a target template dedicated table in a target dynamically extensible database template is determined as a target storage location.

[0342] The database-based data processing device provided in the embodiment of the present application can be used to execute the database-based data processing method, that is, it has the beneficial effects and implementation methods of the database-based data processing method provided in Example 2 of the present application. For details, please refer to the specific description of the database-based data processing method in the above Example 2, which will not be repeated in this embodiment.

[0343] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present application, but the present application is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and substance of the present application, and these modifications and improvements are also considered to be within the scope of protection of the present application.

Claims

1. A database construction method, characterized in that: include: Get a dynamically extensible database template; Based on the programming language and the database language, the dynamically extensible database template is traversed to establish an instance database structure; According to the instance database structure, an instance database is constructed.

2. The method according to claim 1, characterized in that Get a dynamically extensible database template, including: Obtain template basic table, template special table and template relationship table; A dynamic and extensible database template is established based on the template basic table, template special table and template relationship table.

3. The method according to claim 2, characterized in that Get the template base table, including: Obtain at least one of a database identification table, a database name table, a database relationship table, a sub-table name table, and a sub-table attribute table; wherein the database identification table is used to indicate whether a distributed database is required and the number of distributed databases; the database name table is used to store the names and configuration information of different databases; the database relationship table is used to indicate the relationship between the sub-databases in the database; the sub-table name table is used to indicate the names, uses, and relationships of the sub-tables contained in the sub-databases in the database; and the sub-table attribute table is used to indicate the relationship between the sub-tables contained in the sub-databases in the database, as well as the attributes of the sub-tables; A template basic table is established according to at least one item of a database identification table, a database name table, a database relationship table, a sub-table name table and a sub-table attribute table.

4. The method according to claim 2, characterized in that: Get template-specific tables, including: Obtaining column information in a database table, the column information including the table name, library name, database user name, database password, Internet Protocol address of the server where the database is located, server user name and server password; Create a template-specific table based on the column information.

5. The method according to claim 2, characterized in that: Get the template relationship table, including: A relationship table between each column in the database table and the system object label is established to obtain a template relationship table.

6. A data processing method based on a database, characterized in that: include: Obtaining data to be processed, its corresponding data processing method and data type, wherein the data processing method includes at least one of adding a data row, deleting a data row and modifying data; Determine a target instance database according to the data type, wherein the target instance database is constructed by using a database construction method according to any one of claims 1 to 5; Determine a target storage location of the data to be processed in the target instance database according to the data processing method and the target dynamically extensible database template corresponding to the target instance database; Based on the target dynamically extensible database template, the target storage location is processed according to the data processing method.

7. The method according to claim 6, characterized in that Before determining the target instance database according to the data type, the method further includes: Based on business needs, modify the backup dynamic extensible database template to obtain a modified dynamic extensible database template, where the backup dynamic extensible database template is a dynamic extensible database template in the backup database of the instance database; Based on the programming language and the database language, the modified dynamically extensible database template is traversed to establish a modified instance database structure; According to the modified instance database structure, determine the unavailable range under dynamic switching; When the unavailable range related functions are closed, a modified instance database is constructed according to the modified instance database structure, and the modified template relationship table in the modified instance database corresponds to the template relationship table in the instance database.

8. The method according to claim 6, characterized in that The data type includes a first type or a second type, and the target instance database includes at least one item in an instance database and a modified instance database; Determine the target instance database based on the data type, including: In a case where the data type includes the first type, determining the target instance database to be the instance database; or, In a case where the data type includes the second type, the target instance database is determined to be the modified instance database, or the target instance database is determined to be the modified instance database and the instance database.

9. The method according to claim 6, characterized in that Determining a target storage location of the data to be processed in the target instance database according to the data processing method and the target dynamically extensible database template corresponding to the target instance database includes: In a case where the data processing method includes at least one of adding a data row and deleting a data row, obtaining a first system object tag corresponding to the data to be processed, Determine a first column name corresponding to the first system object tag from a target template relationship table in a target dynamically extensible database template corresponding to the target instance database; Determine the storage location corresponding to the first column name in the target template dedicated table in the target dynamically extensible database template as the target storage location; or, In the case where the data processing method includes modifying data, obtaining a second system object tag corresponding to target data, the target data being a data value adjacent to the data to be processed; Determine a second column name corresponding to the second system object tag from a target template relationship table in a target dynamically extensible database template corresponding to the target instance database; A storage location corresponding to the second column name in a target template dedicated table in a target dynamically extensible database template is determined as a target storage location.

10. The method according to claim 6, characterized in that In the case where the target instance database includes the modified instance database, the target dynamic extensible database template corresponding to the target instance data includes the modified dynamic extensible database template; Based on the target dynamically extensible database template, the target storage location is processed according to the data processing method, including: When the modified dynamic extensible database template does not involve deletion, disassembly and reorganization of the instance database structure, the modified dynamic extensible database template is enabled and the dynamic extensible database template of the instance database is disabled; Based on the modified dynamically extensible database template, the target storage location is processed according to the data processing method.

11. The method according to claim 10, characterized in that After processing the target storage location according to the data processing method based on the modified dynamically extensible database template, the method further includes: When the available range related function is enabled, verify the data values ​​contained in both the instance database and the modified instance database to obtain a first verification result; If the first verification result is passed, switch to the modified instance database.

12. The method according to claim 6, characterized in that In the case where the target instance database includes the instance database and the modified instance database, the target dynamically extensible database template corresponding to the target instance data includes the dynamically extensible database template and the modified dynamically extensible database template, and the target storage location includes the first storage location in the instance database and the second storage location in the modified instance database; Based on the target dynamically extensible database template, the target storage location is processed according to the data processing method, including: In the case where the modified dynamically extensible database template involves any one of deletion, disassembly and reorganization of the instance database structure, enabling the modified dynamically extensible database template and the dynamically extensible database template of the instance database; Based on the modified dynamic and extensible database template, the first storage location is processed according to the data processing method, and based on the dynamic and extensible database template, the second storage location is processed according to the data processing method.

13. The method according to claim 12, characterized in that After processing the second storage location according to the data processing method based on the dynamically extensible database template, the method further includes: When the available range related function is enabled, verifying the data values ​​included in both the instance database and the modified instance database to obtain a second verification result; If the second verification result is passed, the data of the backup database corresponding to the instance database is converted to the modified instance database according to the first corresponding relationship to obtain the converted instance database, and the first corresponding relationship is the corresponding relationship between the modified template relationship table in the modified instance database and the template relationship table in the instance database; Verifying the data values ​​contained in both the instance database and the converted instance database to obtain a third verification result; If the third verification result is passed, the modified dynamic extensible database template is enabled, the dynamic extensible database template is closed, and the modified instance database is switched to.

14. The method according to claim 6, characterized in that In the case where the target instance database includes the instance database and the modified instance database, the target dynamically extensible database template corresponding to the target instance data includes the dynamically extensible database template and the modified dynamically extensible database template, and the target storage location includes the first storage location in the instance database and the second storage location in the modified instance database; Based on the target dynamically extensible database template, the target storage location is processed according to the data processing method, including: In the case where the modified dynamically extensible database template involves any one of deletion, disassembly and reorganization of the instance database structure, enabling the modified dynamically extensible database template and the dynamically extensible database template of the instance database; According to the first corresponding relationship, the data of the backup database corresponding to the instance database is converted into the modified instance database to obtain the converted instance database, and the first corresponding relationship is the corresponding relationship between the modified template relationship table in the modified instance database and the template relationship table in the instance database; Verifying the data values ​​contained in both the instance database and the converted instance database to obtain a third verification result; If the third verification result is passed, the modified dynamic extensible database template is enabled, and the dynamic extensible database template of the instance database is disabled; Based on the modified dynamic and extensible database template, the first storage location is processed according to the data processing method, and based on the dynamic and extensible database template, the second storage location is processed according to the data processing method.

15. The method according to claim 14, characterized in that After processing the second storage location according to the data processing method based on the dynamically extensible database template, the method further includes: When the available range related function is enabled, verifying the data values ​​included in both the instance database and the modified instance database to obtain a second verification result; If the second verification result is passed, the modified dynamic scalable database template is enabled, the dynamic scalable database template is closed, and the modified instance database is switched to.

16. A database construction device, characterized in that: include: A first acquisition module is used to acquire a dynamically extensible database template; A first traversal module, connected to the first acquisition module, is used to traverse the dynamic extensible database template based on a programming language and a database language to establish an instance database structure; The first construction module is connected to the first traversal module and is used to construct an instance database according to the instance database structure.

17. The device according to claim 16, characterized in that The first acquisition module is specifically used for: Obtain template basic table, template special table and template relationship table; A dynamic and extensible database template is established based on the template basic table, template special table and template relationship table.

18. The device according to claim 17, characterized in that The first acquisition module is specifically used for: Obtain at least one of a database identification table, a database name table, a database relationship table, a sub-table name table, and a sub-table attribute table; wherein the database identification table is used to indicate whether a distributed database is required and the number of distributed databases; the database name table is used to store the names and configuration information of different databases; the database relationship table is used to indicate the relationship between the sub-databases in the database; the sub-table name table is used to indicate the names, uses, and relationships of the sub-tables contained in the sub-databases in the database; and the sub-table attribute table is used to indicate the relationship between the sub-tables contained in the sub-databases in the database, as well as the attributes of the sub-tables; A template basic table is established according to at least one item of a database identification table, a database name table, a database relationship table, a sub-table name table, and a sub-table attribute table; and / or, The first acquisition module is specifically used for: Obtaining column information in a database table, the column information including the table name, library name, database user name, database password, Internet Protocol address of the server where the database is located, server user name and server password; Create a template-specific table based on the column information; and / or, The first acquisition module is specifically used for: A relationship table between each column in the database table and the system object label is established to obtain a template relationship table.

19. A data processing device based on a database, characterized in that: include: A second acquisition module is used to acquire the data to be processed, its corresponding data processing method and data type, wherein the data processing method includes at least one of adding a data row, deleting a data row and modifying data; A first determination module, connected to the second acquisition module, for determining a target instance database according to the data type, the target instance database being constructed by using the database construction device according to claim 17 or 18; A second determination module, connected to the first determination module and the second acquisition module, is used to determine a target storage location of the data to be processed in the target instance database according to the data processing mode and the target dynamically extensible database template corresponding to the target instance database; The processing module is connected to the second determining module, and processes the target storage location according to the data processing method based on the target dynamically extensible database template.

20. The device according to claim 19, characterized in that The device also includes: A modification module, used to modify the backup dynamic extensible database template based on business needs to obtain a modified dynamic extensible database template, where the backup dynamic extensible database template is a dynamic extensible database template in a backup database of the instance database; A second traversal module, connected to the modification module, is used to traverse the modified dynamic extensible database template based on the programming language and the database language to establish a modified instance database structure; A third determination module, connected to the second traversal module, is used to determine the unavailable range under dynamic switching according to the modified instance database structure; A second construction module, connected to the third determination module, is used to construct a modified instance database according to the modified instance database structure when the unavailable range related functions are turned off, and the modified template relationship table in the modified instance database corresponds to the template relationship table in the instance database; and / or, The second determination module is specifically used for: In a case where the data processing method includes at least one of adding a data row and deleting a data row, obtaining a first system object tag corresponding to the data to be processed, Determine a first column name corresponding to the first system object tag from a target template relationship table in a target dynamically extensible database template corresponding to the target instance database; Determine the storage location corresponding to the first column name in the target template dedicated table in the target dynamically extensible database template as the target storage location; and / or, The second determination module is specifically used for: In the case where the data processing method includes modifying data, obtaining a second system object tag corresponding to target data, the target data being a data value adjacent to the data to be processed; Determine a second column name corresponding to the second system object tag from a target template relationship table in a target dynamically extensible database template corresponding to the target instance database; A storage location corresponding to the second column name in a target template dedicated table in a target dynamically extensible database template is determined as a target storage location.