Database supporting multiple storage engine operation methods and apparatus

By performing double verification of operation commands through the DDL execution engine, the inconvenience and inefficiency caused by frequent database switching are resolved, and unified management and efficient data processing of multiple storage engines are achieved.

CN116303351BActive Publication Date: 2026-08-25BUSINESS-INTELLIGENCE OF ORIENTAL NATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310181551.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-20
Publication Date
2026-08-25
Estimated Expiration
2043-02-20

AI Technical Summary

Technical Problem

In existing technologies, maintenance personnel need to frequently switch databases to process data on different storage engines, which is inconvenient and inefficient.

Method used

This paper provides a method for supporting multiple storage engines in a database. By using a DDL execution engine to perform dual verification on operation commands, the operation is performed only after the operation permissions and capabilities are supported, thereby achieving unified management of the target database.

Benefits of technology

Without switching databases, it simplifies data operations on different storage engines and improves operational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303351B_ABST
    Figure CN116303351B_ABST
Patent Text Reader

Abstract

The application provides a database supporting multiple storage engine operation method and device, and belongs to the technical field of data processing, and comprises the following steps: receiving any operation instruction of a target database; performing first verification on the operation instruction based on the operation permission of a DDL execution engine of the target database; performing second verification on the operation instruction based on the supported capability of the DDL execution engine in the case that the first verification is passed; and operating the target database according to the operation instruction by calling the DDL execution engine in the case that the second verification is passed. The database supporting multiple storage engine operation method and device can verify the operation instruction by using the database and the DDL execution engine, so that the operation of the DDL execution engine on the data can be successfully completed, the data stored in different storage engines can be processed without switching the database, the operation is simplified, and the operation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a database operation method, server, device, storage medium and product that supports multiple storage engines. Background Technology

[0002] A Database Management System (DBMS) is used to store, manage, and query data. Online Transaction Processing (OLTP) and Online Analytical Processing (OLAP) are examples of DBMSs used to manage loaded data generated during operations and to extract values ​​from that loaded data. Each system may include a database and an execution engine that accesses that database.

[0003] In general, users may use multiple databases to perform operational functions.

[0004] Because different databases are needed to meet usage requirements, maintenance personnel need to frequently switch between databases to process data, which is very inconvenient and inefficient. Summary of the Invention

[0005] The present invention provides a database operation method, server, device, storage medium and product that supports multiple storage engines, which solves the problem that maintenance personnel need to frequently switch databases to process data in the prior art, which is very inconvenient and inefficient. It enables the processing of data stored on different storage engines without switching databases, which simplifies the operation and improves the efficiency of operation.

[0006] This invention provides a method for a database to support multiple storage engine operations, including:

[0007] Receive any operation command on the target database; the target database supports multiple storage engines;

[0008] The operation instructions are first verified based on the operation permissions of the DDL execution engine of the target database; the DDL execution engine is determined based on the multiple storage engines.

[0009] If the first verification passes, the operation instruction is then subjected to a second verification based on the capabilities supported by the DDL execution engine.

[0010] If the second verification passes, the DDL execution engine is invoked to operate on the target database according to the operation instructions.

[0011] According to a method for supporting multiple storage engine operations in a database provided by the present invention, before performing a first verification on the operation instruction based on the operation permissions of the DDL execution engine of the target database, the method further includes:

[0012] Obtain the capability attributes of multiple storage engines supported by the target database, as well as the modification operations of the data directories of the multiple storage engines;

[0013] Based on all capability attributes, construct the engine capability set, and based on all modification operations, construct the operation set;

[0014] Based on the engine capability set and the operation set, construct the DDL execution engine for the target database;

[0015] The engine capability set represents the functions supported by the DDL execution engine.

[0016] According to a method for supporting multiple storage engines in a database provided by the present invention, the step of obtaining the capability attributes of the multiple storage engines supported by the target database includes:

[0017] Based on the storage engine support functions of the multiple storage engines in the target database, extract the capability attributes of the multiple storage engines.

[0018] According to a method for supporting multiple storage engine operations in a database provided by the present invention, the first verification of the operation instruction based on the operation permissions of the DDL execution engine of the target database includes:

[0019] The operation instruction is parsed to determine the operation type and operation action of the operation instruction;

[0020] The operation instruction is first verified according to the operation type;

[0021] If the operation type belongs to any operation permission of the DDL execution engine, the first verification is determined to be successful;

[0022] If the operation type does not fall within the operation permissions of the DDL execution engine, the first verification is determined to fail.

[0023] According to a method for supporting multiple storage engine operations in a database provided by the present invention, the second verification of the operation instructions based on the capabilities supported by the DDL execution engine includes:

[0024] Based on the operation action, the operation instruction is subjected to a second verification;

[0025] If any capability attribute in the engine capability set of the DDL execution engine supports the operation action, the second verification is determined to be successful;

[0026] If none of the capability attributes in the engine capability set of the DDL execution engine support the operation action, the second verification is determined to fail.

[0027] According to the present invention, a method for supporting multiple storage engine operations in a database includes, wherein invoking the DDL execution engine to operate on the target database according to the operation instructions, the method comprises:

[0028] According to the operation instructions, the target operation is determined in the operation set of the DDL execution engine;

[0029] Perform the target operation on the target database.

[0030] The present invention also provides a database server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the database support multiple storage engine operation method as described above.

[0031] The present invention also provides a database operation device supporting multiple storage engines, comprising:

[0032] A receiving module is used to receive any operation command on the target database; the target database supports multiple storage engines.

[0033] The first verification module is used to perform a first verification on the operation instruction based on the operation permissions of the DDL execution engine of the target database; the DDL execution engine is determined based on the multiple storage engines.

[0034] The second verification module is used to perform a second verification on the operation instruction based on the capabilities supported by the DDL execution engine if the first verification passes.

[0035] The calling module is used to invoke the DDL execution engine to operate on the target database according to the operation instructions if the second verification passes.

[0036] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the database support multiple storage engine operation method as described above.

[0037] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the database support for multiple storage engines operation method as described above.

[0038] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the database support multiple storage engine operation method as described above.

[0039] The database provided by this invention supports multiple storage engine operation methods, servers, devices, storage media, and products. By using the database and DDL execution engine to verify operation instructions, the DDL execution engine can successfully complete data operations. It can process data stored on different storage engines without switching databases, simplifying operations and thus improving operational efficiency. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0041] Figure 1 This is one of the flowcharts illustrating the database operation method supporting multiple storage engines provided by the present invention;

[0042] Figure 2 This is a flowchart illustrating the method for constructing the DDL engine capability module provided by the present invention;

[0043] Figure 3 This is the second flowchart illustrating the database operation method supporting multiple storage engines provided by the present invention.

[0044] Figure 4 This is a schematic diagram of the structure of the database operation device supporting multiple storage engines provided by the present invention;

[0045] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0047] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0048] The following is combined with Figures 1 to 5 The embodiments of the present invention describe database operation methods, servers, devices, storage media, and products that support multiple storage engines.

[0049] The database provided in this embodiment supports multiple storage engine operation methods. The execution entity can be an electronic device or software, functional module, or functional entity within an electronic device capable of implementing the database's support for multiple storage engine operation methods. In this embodiment, the electronic device includes, but is not limited to, a database server. It should be noted that the aforementioned execution entity does not constitute a limitation on this invention.

[0050] Figure 1 This is one of the flowcharts illustrating the database operation method supporting multiple storage engines provided by the present invention, such as... Figure 1 As shown, including but not limited to the following steps:

[0051] First, in step S1, any operation command for the target database is received; the target database supports multiple storage engines.

[0052] Operation commands can be used to perform operations such as adding, deleting, and modifying data on the target database.

[0053] Furthermore, in step S2, the operation instruction is first verified based on the operation permissions of the DDL execution engine of the target database; the DDL execution engine is determined based on the multiple storage engines.

[0054] The operation command is validated to determine whether the target database has the necessary permissions to perform the operation.

[0055] Optionally, the first verification of the operation instruction based on the operation permissions of the DDL execution engine of the target database includes:

[0056] The operation instruction is parsed to determine the operation type and operation action of the operation instruction;

[0057] The operation instruction is first verified according to the operation type;

[0058] If the operation type belongs to any operation permission of the DDL execution engine, the first verification is determined to be successful;

[0059] If the operation type does not fall within the operation permissions of the DDL execution engine, the first verification is determined to fail.

[0060] Specifically, parsing the operation instructions can reveal the operation type and action of the instruction.

[0061] For example, if the operation type is to delete column 'a' in table A of the target database stored in the DDL execution engine, firstly, table A in the DDL execution engine needs to be validated to determine whether column 'a' exists in table A. If column 'a' exists, then the operation type belongs to the operation permissions of the DDL execution engine, and the first validation passes; if column 'a' does not exist, then the operation type does not belong to the operation permissions of the DDL execution engine, and the first validation fails.

[0062] The database provided by the present invention supports multiple storage engine operation methods. It uses the object being operated on stored in the DDL operation engine to perform preliminary verification of the operation type of the operation instruction, thereby ensuring that the operation instruction is valid.

[0063] Optionally, before performing the first verification on the operation instruction based on the operation permissions of the DDL execution engine of the target database, the method further includes:

[0064] Obtain the capability attributes of multiple storage engines supported by the target database, as well as the modification operations of the data directories of the multiple storage engines;

[0065] Based on all capability attributes, construct the engine capability set, and based on all modification operations, construct the operation set;

[0066] Based on the engine capability set and the operation set, construct the DDL execution engine for the target database;

[0067] The engine capability set represents the functions supported by the DDL execution engine.

[0068] The modification operation can be a DDL handler operation.

[0069] During the storage engine design phase, the functions supported by each storage engine, i.e., the capability attributes of each storage engine, are extracted. Also during the design phase, the operations of the storage engine are determined, among which DDL handler operations that may modify the data directory of the target database are extracted as modification actions.

[0070] The extracted capability attributes and modification operations are registered with the DDL execution engine, enabling the DDL execution engine to possess the capabilities of multiple storage engines supported by the target database. Based on the support capabilities of different storage engines, the engine capabilities involved in DDL statements can be summarized as follows: the data types supported by different engines, such as int, char, bool, and blob; the constraint types supported by different engines, such as primary keys, foreign keys, and unique; and whether temporary tables, movepartitions, data type modification, and constraint modification are supported.

[0071] Optionally, the step of obtaining the capability attributes of multiple storage engines supported by the target database includes:

[0072] Based on the storage engine support functions of the multiple storage engines in the target database, extract the capability attributes of the multiple storage engines.

[0073] The capability attribute can be used to set the capabilities supported by each storage engine type supported by the target database.

[0074] DDL handlers mainly include some behaviors that may affect data operations that impact storage: creating, deleting, or truncate tables; adding, deleting, truncate, or moving table partitions; and deleting columns.

[0075] Figure 2 This is a flowchart illustrating the method for constructing DDL engine capability modules provided by this invention, as shown below. Figure 2 As shown, it includes:

[0076] Extract the capabilities supported by engine A from storage engine type A, and extract the capabilities supported by engine B from storage engine type B to construct the engine capability set; extract the inheritance of engines A and B and implement all operations in the DDL handler to construct the DDL handler operation.

[0077] Based on the engine capability set and DDL handler operations, construct engine capability modules.

[0078] The database operation method for supporting multiple storage engines provided by the present invention extracts the capability attributes and modification operations of each storage engine supported by the database, enabling the DDL execution engine to operate on multiple storage engines, thus providing a basis for replacing multiple storage engines.

[0079] Furthermore, in step S3, if the first verification passes, the operation instruction is subjected to a second verification based on the capabilities supported by the DDL execution engine.

[0080] If the target database's operation permissions support the operation command, the first verification passes. Then, the DDL execution engine uses the engine capability set to perform a second verification on the operation command to determine whether the capabilities supported by the engine capability set support the operation command.

[0081] Optionally, the second verification of the operation instruction based on the capabilities supported by the DDL execution engine includes:

[0082] Based on the operation action, the operation instruction is subjected to a second verification;

[0083] If any capability attribute in the engine capability set of the DDL execution engine supports the operation action, the second verification is determined to be successful;

[0084] If none of the capability attributes in the engine capability set of the DDL execution engine support the operation action, the second verification is determined to fail.

[0085] The operation actions of the operation command are verified by using the engine capability set in the DDL execution engine to determine whether the capabilities supported by the engine capability set support the operation command.

[0086] If the DDL execution engine's capability set supports the operation action, the second verification is confirmed to be successful;

[0087] If the DDL execution engine's capability set does not support the operation action, the second verification is determined to fail.

[0088] Furthermore, if the second verification fails, the engine that supports the operation action of the operation instruction can be obtained, and the capability attributes of the storage engine and the modification operation of the storage engine on the data directory of the target database can be extracted. The capability attributes are added to the engine capability set of the DDL execution engine, and the modification operation is added to the operation set of the DDL execution engine. This allows the DDL execution engine to not only replace multiple storage engines of the target database, but also to easily add other storage engines that meet the needs of the target database. This enables the updating and upgrading of the DDL execution engine, which can meet the needs of users.

[0089] Each storage engine needs to include engine capabilities and modification operations. In a DDL execution engine, the engine capability set contains the capabilities that can be selectively supported; the DDL handler operations in the operation set are the operations that must be implemented.

[0090] For example, if the operation instruction is to create a table, many constraints can be specified when creating the table. For example, the unique column must be unique. During the second verification of the operation instruction, it is checked whether the storage engine supports these requirements and whether they can be met. Before inserting, it is checked whether the data already inserted in the table exists and whether the unique operation can be achieved. If it can be achieved, the second verification passes.

[0091] The database operation method provided by the present invention supports multiple storage engines. By utilizing the DDL execution engine to re-verify the operation actions of the operation instructions, it is ensured that the DDL execution engine can operate on the database smoothly.

[0092] Furthermore, in step S4, if the second verification passes, the DDL execution engine is invoked to operate on the target database according to the operation instructions.

[0093] Optionally, the step of invoking the DDL execution engine to operate on the target database according to the operation instructions includes:

[0094] According to the operation instructions, the target operation is determined in the operation set of the DDL execution engine;

[0095] Perform the target operation on the target database.

[0096] For example, check if the DDL execution engine supports the unique operation. If it does, the corresponding DDL handler operation can be invoked in the operation set to create the table.

[0097] Different tables have different creation methods. For example, you can set the path to the table name, or two storage engines may set the same path when creating tables, but the rules may be different. You must implement these rules yourself in order to call the DDL handler and finally create the table successfully.

[0098] The database provided by this invention supports multiple storage engine operation methods. By using the database and DDL execution engine to verify the operation instructions, the DDL execution engine can successfully complete the data operation. It can process data stored on different storage engines without switching databases, simplifying the operation and thus improving the operation efficiency.

[0099] Figure 3This is the second flowchart illustrating the database operation method supporting multiple storage engines provided by the present invention, as shown below. Figure 3 As shown, it includes:

[0100] Parsing the abstract syntax tree (AST) of operation instructions can reveal the operation type and action of the operation instructions.

[0101] Based on the operation type, determine whether the operation type belongs to the operation permission of the DDL execution engine, in order to determine whether it conforms to the basic rules, and implement the first verification of the operation instruction;

[0102] If the operation type belongs to the DDL execution engine's operation permissions, and it is determined that it meets the basic rules, the first verification passes;

[0103] If the operation type does not fall within the operation permissions of the DDL execution engine, it is determined that it does not comply with the basic rules, and the first check fails.

[0104] If the basic rules are met and the first verification passes, the operation action of the operation instruction is verified by the engine capability set in the DDL execution engine to determine whether the capability supported by the engine capability set supports the operation instruction.

[0105] If the engine capability set supports the operation instruction, then the engine capability set can achieve the following: in the operation set of the DDL execution engine, obtain the DDL handler operation of the storage engine corresponding to the operation instruction, and use the DDL handler operation to execute the corresponding operation of the operation instruction.

[0106] If the engine capability set does not support the operation instruction, then the engine capability set cannot be implemented.

[0107] The present invention also provides a database server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the database support for multiple storage engines operation method as described in any of the above embodiments.

[0108] The database server described in this invention verifies operation instructions using the database and DDL execution engine, enabling the DDL execution engine to successfully complete data operations. It can process data stored on different storage engines without switching storage, simplifying operations and thus improving operational efficiency.

[0109] The following describes the database operation device supporting multiple storage engines provided by the present invention. The database operation device supporting multiple storage engines described below and the database operation method supporting multiple storage engines described above can be referred to in correspondence.

[0110] Figure 4 This is a schematic diagram of the structure of the database operation device supporting multiple storage engines provided by the present invention, as shown below. Figure 4 As shown, it includes:

[0111] The receiving module 401 is used to receive any operation command on the target database; the target database supports multiple storage engines.

[0112] The first verification module 402 is used to perform a first verification on the operation instruction based on the operation permissions of the DDL execution engine of the target database; the DDL execution engine is determined based on the multiple storage engines.

[0113] The second verification module 403 is used to perform a second verification on the operation instruction based on the capabilities supported by the DDL execution engine if the first verification passes.

[0114] Module 404 is invoked to invoke the DDL execution engine to operate on the target database according to the operation instructions if the second verification passes.

[0115] During device operation, receiving module 401 is used to receive any operation command on the target database; the target database supports multiple storage engines; first verification module 402 is used to perform a first verification on the operation command based on the operation permissions of the DDL execution engine of the target database; the DDL execution engine is determined based on the multiple storage engines; second verification module 403 is used to perform a second verification on the operation command based on the capabilities supported by the DDL execution engine if the first verification passes; invocation module 404 is used to invocation of the DDL execution engine to operate on the target database according to the operation command if the second verification passes.

[0116] First, the receiving module 401 receives any operation command for the target database; the target database supports multiple storage engines.

[0117] Operation commands can be used to perform operations such as adding, deleting, and modifying data on the target database.

[0118] Furthermore, the first verification module 402 performs a first verification on the operation instruction based on the operation permissions of the DDL execution engine of the target database; the DDL execution engine is determined based on the multiple storage engines.

[0119] The operation command is validated to determine whether the target database has the necessary permissions to perform the operation.

[0120] The first verification module 402 is specifically used for:

[0121] The operation instruction is parsed to determine the operation type and operation action of the operation instruction;

[0122] The operation instruction is first verified according to the operation type;

[0123] If the operation type belongs to any operation permission of the DDL execution engine, the first verification is determined to be successful;

[0124] If the operation type does not fall within the operation permissions of the DDL execution engine, the first verification is determined to fail.

[0125] Specifically, parsing the operation instructions can reveal the operation type and action of the instruction.

[0126] For example, if the operation type is to delete column 'a' in table A of the target database stored in the DDL execution engine, firstly, table A in the DDL execution engine needs to be validated to determine whether column 'a' exists in table A. If column 'a' exists, then the operation type belongs to the operation permissions of the DDL execution engine, and the first validation passes; if column 'a' does not exist, then the operation type does not belong to the operation permissions of the DDL execution engine, and the first validation fails.

[0127] The database provided by the present invention supports multiple storage engine operation devices, and uses the operated object stored in the DDL operation engine to perform preliminary verification of the operation type of the operation instruction, thereby ensuring that the operation instruction is valid.

[0128] Optionally, the apparatus further includes a construction module, which is configured to perform the following operations before performing a first verification on the operation instruction based on the operation permissions of the DDL execution engine of the target database:

[0129] Obtain the capability attributes of multiple storage engines supported by the target database, as well as the modification operations of the data directories of the multiple storage engines;

[0130] Based on all capability attributes, construct the engine capability set, and based on all modification operations, construct the operation set;

[0131] Based on the engine capability set and the operation set, construct the DDL execution engine for the target database;

[0132] The engine capability set represents the functions supported by the DDL execution engine.

[0133] The modification operation can be a DDL handler operation.

[0134] During the storage engine design phase, the functions supported by each storage engine, i.e., the capability attributes of each storage engine, are extracted. Also during the design phase, the operations of the storage engine are determined, among which DDL handler operations that may modify the data directory of the target database are extracted as modification actions.

[0135] The extracted capability attributes and modification operations are registered with the DDL execution engine, enabling the DDL execution engine to possess the capabilities of multiple storage engines supported by the target database. Based on the support capabilities of different storage engines, the engine capabilities involved in DDL statements can be summarized as follows: the data types supported by different engines, such as int, char, bool, and blob; the constraint types supported by different engines, such as primary keys, foreign keys, and unique; and whether temporary tables, movepartitions, data type modification, and constraint modification are supported.

[0136] Optionally, building modules are specifically used for:

[0137] Based on the storage engine support functions of the multiple storage engines in the target database, extract the capability attributes of the multiple storage engines.

[0138] The capability attribute can be used to set the capabilities supported by each storage engine type supported by the target database.

[0139] DDL handlers mainly include some behaviors that may affect data operations that impact storage: creating, deleting, or truncate tables; adding, deleting, truncate, or moving table partitions; and deleting columns.

[0140] like Figure 2 As shown, it includes:

[0141] Extract the capabilities supported by engine A from storage engine type A, and extract the capabilities supported by engine B from storage engine type B to construct the engine capability set; extract the inheritance of engines A and B and implement all operations in the DDL handler to construct the DDL handler operation.

[0142] Based on the engine capability set and DDL handler operations, construct engine capability modules.

[0143] The database provided by the present invention supports multiple storage engine operation devices. By extracting the capability attributes and modification operations of each storage engine supported by the database, the DDL execution engine is equipped with the ability to operate on multiple storage engines, providing a basis for replacing multiple storage engines.

[0144] Furthermore, if the first verification passes, the second verification module 403 performs a second verification on the operation instruction based on the capabilities supported by the DDL execution engine.

[0145] If the target database's operation permissions support the operation command, the first verification passes. Then, the DDL execution engine uses the engine capability set to perform a second verification on the operation command to determine whether the capabilities supported by the engine capability set support the operation command.

[0146] Optionally, the second verification module 403 is specifically used for:

[0147] Based on the operation action, the operation instruction is subjected to a second verification;

[0148] If any capability attribute in the engine capability set of the DDL execution engine supports the operation action, the second verification is determined to be successful;

[0149] If none of the capability attributes in the engine capability set of the DDL execution engine support the operation action, the second verification is determined to fail.

[0150] The operation actions of the operation command are verified by using the engine capability set in the DDL execution engine to determine whether the capabilities supported by the engine capability set support the operation command.

[0151] If the DDL execution engine's capability set supports the operation action, the second verification is confirmed to be successful;

[0152] If the DDL execution engine's capability set does not support the operation action, the second verification is determined to fail.

[0153] Furthermore, if the second verification fails, the engine that supports the operation action of the operation instruction can be obtained, and the capability attributes of the storage engine and the modification operation of the storage engine on the data directory of the target database can be extracted. The capability attributes are added to the engine capability set of the DDL execution engine, and the modification operation is added to the operation set of the DDL execution engine. This allows the DDL execution engine to not only replace multiple storage engines of the target database, but also to easily add other storage engines that meet the needs of the target database. This enables the updating and upgrading of the DDL execution engine, which can meet the needs of users.

[0154] Each storage engine needs to include engine capabilities and modification operations. In a DDL execution engine, the engine capability set contains the capabilities that can be selectively supported; the DDL handler operations in the operation set are the operations that must be implemented.

[0155] For example, if the operation instruction is to create a table, many constraints can be specified when creating the table. For example, the unique column must be unique. During the second verification of the operation instruction, it is checked whether the storage engine supports these requirements and whether they can be met. Before inserting, it is checked whether the data already inserted in the table exists and whether the unique operation can be achieved. If it can be achieved, the second verification passes.

[0156] The database provided by the present invention supports multiple storage engine operation devices. By utilizing the DDL execution engine to re-verify the operation actions of the operation instructions, it is ensured that the DDL execution engine can operate on the database smoothly.

[0157] Furthermore, if the second verification passes, the calling module 404 calls the DDL execution engine to operate on the target database according to the operation instructions.

[0158] Optionally, module 404 is invoked, specifically for:

[0159] According to the operation instructions, the target operation is determined in the operation set of the DDL execution engine;

[0160] Perform the target operation on the target database.

[0161] For example, check if the DDL execution engine supports the unique operation. If it does, the corresponding DDL handler operation can be invoked in the operation set to create the table.

[0162] Different tables have different creation methods. For example, you can set the path to the table name, or two storage engines may set the same path when creating tables, but the rules may be different. You must implement these rules yourself in order to call the DDL handler and finally create the table successfully.

[0163] The database provided by this invention supports multiple storage engine operation devices. By using the database and DDL execution engine to verify the operation instructions, the DDL execution engine can successfully complete the data operation. It can process data stored on different storage engines without switching databases, simplifying the operation and thus improving the operation efficiency.

[0164] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 5As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can invoke logical instructions in the memory 530 to execute a database operation method supporting multiple storage engines. This method includes: receiving any operation instruction on a target database; the target database supporting multiple storage engines; performing a first verification on the operation instruction based on the operation permissions of the target database's DDL execution engine; the DDL execution engine being determined based on the multiple storage engines; if the first verification passes, performing a second verification on the operation instruction based on the capabilities supported by the DDL execution engine; and if the second verification passes, invoking the DDL execution engine to operate on the target database according to the operation instruction.

[0165] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0166] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the database operation method supporting multiple storage engines provided by the above methods. The method includes: receiving any operation instruction on a target database; the target database supporting multiple storage engines; performing a first verification on the operation instruction based on the operation permissions of the DDL execution engine of the target database; the DDL execution engine being determined based on the multiple storage engines; if the first verification passes, performing a second verification on the operation instruction based on the capabilities supported by the DDL execution engine; and if the second verification passes, invoking the DDL execution engine to operate on the target database according to the operation instruction.

[0167] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a database operation method supporting multiple storage engines provided by the methods described above. The method includes: receiving any operation instruction on a target database; the target database supporting multiple storage engines; performing a first verification on the operation instruction based on the operation permissions of the DDL execution engine of the target database; the DDL execution engine being determined based on the multiple storage engines; if the first verification passes, performing a second verification on the operation instruction based on the capabilities supported by the DDL execution engine; and if the second verification passes, invoking the DDL execution engine to operate on the target database according to the operation instruction.

[0168] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0169] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for supporting multiple storage engine operations in a database, characterized in that, include: Receive any operation command for the target database; The target database supports multiple storage engines; Based on the storage engine support functions of the multiple storage engines in the target database, extract the capability attributes of the multiple storage engines; Obtain the modification operations of the data directories of the multiple storage engines; Based on all capability attributes, construct the engine capability set, and based on all modification operations, construct the operation set; Based on the engine capability set and the operation set, a DDL execution engine for the target database is constructed; the engine capability set characterizes the functions supported by the DDL execution engine. Based on the operation permissions of the DDL execution engine of the target database, the operation instruction is first verified; The DDL execution engine is determined based on the plurality of storage engines; If the first verification passes, a second verification is performed on the operation instruction based on the capabilities supported by the DDL execution engine, including: determining the operation action of the operation instruction; if none of the capability attributes in the engine capability set of the DDL execution engine support the operation action, determining that the second verification fails; if the second verification fails, obtaining the storage engine that supports the operation action of the operation instruction, and extracting the capability attributes of the storage engine that supports the operation action of the operation instruction, as well as the modification operation of the data directory of the target database by the capability attributes of the storage engine that supports the operation action of the operation instruction; adding the extracted capability attributes of the storage engine that supports the operation action of the operation instruction to the engine capability set of the DDL execution engine, and adding the extracted modification operation to the operation set of the DDL execution engine; If the second verification passes, the DDL execution engine is invoked to operate on the target database according to the operation instructions.

2. The database operation method supporting multiple storage engines according to claim 1, characterized in that, The operation permissions based on the DDL execution engine of the target database, and the first verification of the operation instructions, include: The operation instruction is parsed to determine the operation type and operation action of the operation instruction; The operation instruction is first verified according to the operation type; If the operation type belongs to any operation permission of the DDL execution engine, the first verification is determined to be successful; If the operation type does not fall within the operation permissions of the DDL execution engine, the first verification is determined to fail.

3. The database operation method supporting multiple storage engines according to claim 2, characterized in that, The second verification of the operation instructions based on the capabilities supported by the DDL execution engine further includes: If any capability attribute in the engine capability set of the DDL execution engine supports the operation action, the second verification is determined to be successful.

4. The database operation method supporting multiple storage engines according to claim 1, characterized in that, The step of invoking the DDL execution engine to operate on the target database according to the operation instructions includes: According to the operation instructions, the target operation is determined in the operation set of the DDL execution engine; Perform the target operation on the target database.

5. A database server, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the program, implements the database support for multiple storage engines operation method as described in any one of claims 1-4.

6. A database operation device supporting multiple storage engines, characterized in that, include: The receiving module is used to receive any operation command for the target database; The target database supports multiple storage engines; The building module is used to extract the capability attributes of the multiple storage engines based on the storage engine support functions of the multiple storage engines in the target database. The construction module is also used to obtain the modification operations of the data directories of the multiple storage engines; The building module is also used to build an engine capability set based on all capability attributes, and to build an operation set based on all modification operations; The construction module is further configured to construct a DDL execution engine for the target database based on the engine capability set and the operation set; the engine capability set characterizes the functions supported by the DDL execution engine. The first verification module is used to perform a first verification on the operation instruction based on the operation permissions of the DDL execution engine of the target database; The DDL execution engine is determined based on the plurality of storage engines; The second verification module is used to perform a second verification on the operation instruction based on the capabilities supported by the DDL execution engine, provided that the first verification passes. This includes: determining the operation action of the operation instruction; determining that the second verification fails if none of the capability attributes in the engine capability set of the DDL execution engine support the operation action; if the second verification fails, obtaining the storage engine that supports the operation action of the operation instruction, and extracting the capability attributes of the storage engine that supports the operation action of the operation instruction, as well as the modification operations of the data directory of the target database by the capability attributes of the storage engine that supports the operation action of the operation instruction; adding the extracted capability attributes of the storage engine that supports the operation action of the operation instruction to the engine capability set of the DDL execution engine, and adding the extracted modification operations to the operation set of the DDL execution engine. The calling module is used to invoke the DDL execution engine to operate on the target database according to the operation instructions if the second verification passes.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the database operation method supporting multiple storage engines as described in any one of claims 1-4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the database operation method supporting multiple storage engines as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Database management method and device, equipment and storage medium

    CN114238273A