Database operation method, apparatus and system
By distinguishing between operation types on the database query and modification application side, a solution was achieved where query operations can be quickly completed and interrupted on the query application side, and modification operations are executed on the modification application side, thus solving the difficulty of application restart and upgrade in existing technologies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2026-03-17
AI Technical Summary
Existing database query tools cannot be shut down or restarted when performing time-consuming DDL and DML operations, and the upgrade process cannot be interrupted, making operation difficult.
By distinguishing operation types between the database query application and the modification application, query operations are executed on the query application and modification operations are executed on the modification application, and the results are stored in the configuration library, enabling operations to be completed and interrupted quickly.
This resolves the issue of applications failing to restart while executing DDL and DML operations, allowing applications to be immediately shut down, restarted, or upgraded after operations are complete.
Smart Images

Figure CN115080589B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to the field of database processing technology, and in particular to a database operation method, apparatus, and system. Background Technology
[0002] Existing database query tools can be used to query data in single-machine databases such as MySQL, Oracle, and SQL Server, as well as distributed databases (execute SELECT statements), rewrite data in the database (execute DML (Data Manipulation Language) operations, such as INSERT and UPDATE SQL statements), and modify table structures (DDL (Data Definition Language) operations, such as CREATE, ALTER, and INDEX SQL statements).
[0003] Since these tools are all standalone versions, all SQL operations are executed within a single application, which mainly presents the following problems:
[0004] 1) When executing time-consuming DDL and DML operations, the running application cannot be closed or restarted. Closing or restarting the application will cause the DDL and DML execution to be interrupted.
[0005] 2) When an application needs to be upgraded, the application cannot be closed for the upgrade because DDL and DML are running. The upgrade must wait for the current DDL and DML to complete. New DDL and DML requests may arrive at any time while the DDL and DML are executing, making the upgrade difficult. Summary of the Invention
[0006] This application provides a database operation method, apparatus, device, and storage medium.
[0007] According to a first aspect, embodiments of this application provide a database operation method, the method comprising: acquiring an input database operation statement; in response to determining that the operation type corresponding to the database operation statement is a query operation, executing the database operation statement and outputting a result; and in response to determining that the operation type corresponding to the database operation statement is a modification operation, sending the database operation statement to a database modification application.
[0008] According to the second aspect, embodiments of this application provide another database operation method, the method comprising: responding to receiving a database operation statement sent by a database query application, sending a confirmation message based on the database operation statement; executing the database operation statement, and storing the execution result in a preset configuration library.
[0009] According to a third aspect, embodiments of this application provide a database operation apparatus, the apparatus comprising: an acquisition module configured to acquire an input database operation statement; a query module configured to execute the database operation statement and output a result in response to determining that the operation type corresponding to the database operation statement is a query operation; and a modification module configured to send the database operation statement to an additional database modification application in response to determining that the operation type corresponding to the database operation statement is a modification operation.
[0010] According to a fourth aspect, embodiments of this application provide another database operation apparatus, the apparatus comprising: a receiving module configured to, in response to receiving a database operation statement sent by a database query application, send a confirmation message based on the database operation statement; and an execution module configured to execute the database operation statement and store the execution result in a preset configuration library.
[0011] According to a fifth aspect, embodiments of this application provide a database operating system, which includes: a database query application and a database modification application. The database query application is configured to acquire an input database operation statement; in response to determining that the operation type corresponding to the database operation statement is a query operation, execute the database operation statement and output the result; in response to determining that the operation type corresponding to the database operation statement is a modification operation, send the database operation statement to the database modification application; the database modification application is configured to, in response to receiving the database operation statement sent by the database query application, send a confirmation message based on the database operation statement; execute the database operation statement and store the execution result in a preset configuration library.
[0012] According to a sixth aspect, embodiments of this application provide an electronic device including one or more processors; a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any implementation of the first or second aspect.
[0013] According to a seventh aspect, embodiments of this application provide a computer-readable medium having a computer program stored thereon that, when executed by a processor, implements the method as described in any of the implementations of the first or second aspect.
[0014] This application obtains the input database operation statement; in response to determining that the operation type of the database operation statement is a query operation, executes the database operation statement and outputs the result; in response to determining that the operation type of the database operation statement is a modification operation, sends the database operation statement to the database modification application, so that database operation statements corresponding to different operation types are executed on different application terminals. That is, database operation statements that can be completed quickly and interrupted are executed on the database query application terminal, while database operation statements that take too long to execute and cannot be interrupted are executed on the database modification application terminal. The application executing the database operation statement that can be completed quickly and interrupted can be shut down, restarted and upgraded at any time, thereby solving the problem in the prior art that the application cannot be restarted when executing DDL and DML.
[0015] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0016] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0017] Figure 2 This is a flowchart of one embodiment of the database operation method according to this application;
[0018] Figure 3 This is a schematic diagram of an application scenario of the database operation method according to this application;
[0019] Figure 4 This is a flowchart of another embodiment of the database operation method according to this application;
[0020] Figure 5 This is a schematic diagram of one embodiment of the database operation apparatus according to this application;
[0021] Figure 6 This is a schematic diagram of another embodiment of the database operation apparatus according to this application;
[0022] Figure 7 This is a schematic diagram of an embodiment of the database operating system according to this application;
[0023] Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing the server embodiments of this application. Detailed Implementation
[0024] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0025] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0026] Figure 1 An exemplary system architecture 100 is shown, in which the database operation methods of this application can be applied.
[0027] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0028] Terminal devices 101, 102, and 103 interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications, such as database processing applications and communication applications, can be installed on terminal devices 101, 102, and 103.
[0029] Terminal devices 101, 102, and 103 can be either hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with displays, including but not limited to mobile phones and laptops. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software programs or software modules (e.g., services for providing database operations) or as a single software program or software module. No specific limitations are made here.
[0030] Server 105 can be a server that provides various services, such as: obtaining input database operation statements; executing database operation statements and outputting results in response to determining that the operation type of the database operation statement is a query operation; and sending the database operation statement to the database modification application in response to determining that the operation type of the database operation statement is a modification operation.
[0031] It should be noted that server 105 can be either hardware or software. When server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 105 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide database operation services), or as a single software program or software module. No specific limitations are made here.
[0032] It should be noted that the database operation method provided in the embodiments of this disclosure can be executed by server 105, terminal devices 101, 102, and 103, or by server 105 and terminal devices 101, 102, and 103 in cooperation with each other. Accordingly, the various parts (e.g., various units, sub-units, modules, and sub-modules) of the database operation apparatus can all be set in server 105, all in terminal devices 101, 102, and 103, or they can be set in server 105 and terminal devices 101, 102, and 103 respectively.
[0033] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0034] Figure 2 A flowchart 200 illustrates an embodiment of the database operation method applicable to this application. In this embodiment, the database operation method includes the following steps:
[0035] Step 201: Obtain the input database operation statement.
[0036] In this embodiment, the execution subject (such as...) Figure 1 The server 105 or terminal devices 101, 102, 103 shown can obtain database operation statements input by the user via a database client.
[0037] Here, database operation statements can be statements that operate on the database using existing or future technologies, such as SQL statements.
[0038] Step 202: In response to determining that the operation type corresponding to the database operation statement is a query operation, execute the database operation statement and output the result.
[0039] In this embodiment, after obtaining the database operation statement, the executing entity can determine the operation type corresponding to the database operation statement. If it is determined that the operation type corresponding to the database operation statement is a query operation, that is, querying data in the database, then the database operation statement is executed directly and the result is output.
[0040] Specifically, after the executing entity obtains the SQL statement, it judges the SQL statement. If it is determined that the operation type corresponding to the SQL statement is a query operation, such as querying data in a single-machine database or a distributed database such as MySQL, Oracle, or SQL Server, then the SQL statement is executed and the result is output.
[0041] Step 203: In response to determining that the operation type corresponding to the database operation statement is a modification operation, the database operation statement is sent to the database modification application.
[0042] In this embodiment, after obtaining the database operation statement, the executing entity can determine the operation type corresponding to the database operation statement. If it is determined that the operation type corresponding to the database operation statement is a modification operation, such as modifying data in the database or modifying the table structure of the database, the database operation statement is sent to the database modification application for execution.
[0043] Specifically, after the executing entity obtains the SQL statement, it judges the SQL statement. If it is determined that the operation type corresponding to the SQL statement is a modification operation, such as rewriting data in the database (executing DML operations, such as insert, update, etc.) or modifying the table structure (executing DDL operations, such as create, alter, index, etc.), then the database operation statement is sent to the database modification application for execution.
[0044] In some alternative approaches, the method further includes: in response to receiving confirmation information sent by the database modification application based on the database operation statement, querying the execution result corresponding to the database operation statement from a preset configuration library.
[0045] In this implementation, the execution entity can monitor the confirmation information sent by the database modification application based on the received data operation statements in real time or periodically. In response to receiving the confirmation information, it queries the execution results of the database operation statements stored in the database modification application from the preset configuration library.
[0046] This implementation method helps to obtain the execution results of database operation statements in a timely manner by responding to the confirmation information sent by the database modification application based on the database operation statement.
[0047] In some alternative approaches, the method further includes: in response to determining that the operation type corresponding to the database operation statement is a modification operation, storing the database operation statement in a preset configuration library.
[0048] In this implementation, once the executing entity determines that the operation type corresponding to the database operation statement is a modification operation, it sends the database operation statement to the database modification application for execution and stores the database operation statement in a preset configuration library.
[0049] This implementation stores the database operation statement in a preset configuration library in response to determining that the operation type of the database operation statement is a modification operation. This helps users to query the database operation statement executed by the application in subsequent database modification queries.
[0050] See also Figure 3 , Figure 3 This is a schematic diagram of an application scenario of the database operation method according to this embodiment.
[0051] exist Figure 3 In the application scenario, the execution entity 301 can obtain the database operation statement 302 input by the user, such as an SQL statement; in response to determining that the operation type corresponding to the database operation statement is a query operation 303, such as querying data in single-machine databases and distributed databases such as MySQL, Oracle, and SQL Server, it executes the database operation statement and outputs the result; in response to determining that the operation type corresponding to the database operation statement is a modification operation 304, such as rewriting data in the database (executing DML operations, insert, update, and other SQL statements), modifying the table structure (executing DDL operations, create, alter, index, and other SQL statements), it sends the database operation statement to the database modification application 305 for execution and obtains the execution result.
[0052] The database operation method disclosed herein obtains an input database operation statement; in response to determining that the operation type corresponding to the database operation statement is a query operation, executes the database operation statement and outputs the result; in response to determining that the operation type corresponding to the database operation statement is a modification operation, sends the database operation statement to the database modification application, so that database operation statements corresponding to different operation types are executed on different application terminals. That is, database operation statements that can be completed quickly and interrupted are executed on the database query application, while database operation statements that take too long to execute and cannot be interrupted are executed on the database modification application. The application executing database operation statements that can be completed quickly and interrupted can be shut down, restarted, and upgraded at any time, thereby solving the problem in the prior art that the application cannot be restarted when executing DDL and DML statements because query statements and DDL / DML statements are executed in the same application.
[0053] Further reference Figure 4 , Figure 4A flowchart 400 illustrates an embodiment of the database operation method applicable to this application. In this embodiment, the database operation method includes the following steps:
[0054] Step 401: In response to receiving the database operation statement sent by the database query application, send a confirmation message based on the database operation statement.
[0055] In this embodiment, the execution entity (database modification application) can monitor the database operation statements sent by the database query application via wired or wireless connection in real time or periodically, and in response to receiving the database operation statement, send a confirmation message according to the database operation statement.
[0056] Here, the database operation statement corresponds to an update operation.
[0057] The aforementioned wireless connection methods may include, but are not limited to, 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other currently known or future wireless connection methods.
[0058] Step 402: Execute database operation statements and store the execution results in the preset configuration library.
[0059] In this embodiment, after obtaining the database operation statement, the executing entity can execute the database operation statement and store the execution result in a preset configuration library.
[0060] In some alternative approaches, executing database operation statements includes: in response to determining that the data source type for which the database operation statement is executed is a non-distributed database, invoking a multi-data source connection pool component to obtain a connection and execute the database operation statement.
[0061] In this implementation, after obtaining the database operation statement, the executing entity determines the data source type of the database operation statement. If it is determined that the data source type of the database operation statement is a non-distributed database, such as MySQL, Oracle, MsSQL, etc., then the multi-data source connection pool component is called to obtain a connection and execute the database operation statement.
[0062] Among them, the multi-data source connection pool component is a public component. It is a buffer pool technology used to create and manage database connections. Connections in the buffer pool can be used by any thread that needs them. When a thread needs to perform a database operation, it will request a corresponding connection from the pool. When the connection is used up, it will be returned to the connection pool to wait for other threads to serve.
[0063] Specifically, in response to determining that the data source type for the database operation statement is a non-distributed database, such as MySQL, the executing entity directly calls the connection of the corresponding MySQL database in the multi-data source connection pool component and executes the database operation statement based on that connection.
[0064] This implementation achieves operation on non-distributed databases by responding to the determination that the data source type for the database operation statement is a non-distributed database, calling the multi-data source connection pool component to obtain a connection and execute the database operation statement, and storing the execution result in a preset configuration library.
[0065] In some alternative approaches, executing database operation statements includes: in response to determining that the data source type for the database operation statement is a distributed database, splitting the database operation statement into sub-database operation statements to be executed for each shard and table; calling a multi-datasource connection pool component to obtain connections for each shard and executing sub-database operation statements for each shard and table.
[0066] In this implementation, after obtaining the database operation statement, the executing entity determines the data source type of the database operation statement. If it is determined that the data source type of the database operation statement is a distributed database, such as CDS (Completed Database Sharding), the database operation statement is split into sub-database operation statements to be executed for each shard and table. The multi-data source connection pool component is called to obtain the connection for each shard and the database operation statement is executed for each shard and table.
[0067] Specifically, in response to determining that the data source type for the database operation statement is a distributed database, such as CDS, the execution entity breaks down the database operation statement into sub-database operation statements that need to be executed for each shard and table, and calls the connection of each shard of the distributed database CDS in the multi-database connection pool component. Based on the connection of each shard, the sub-database operation statement is executed for each shard and table.
[0068] This implementation achieves operation on the distributed database by responding to the determination that the data source type for the database operation statement is a distributed database, splitting the database operation statement into sub-database operation statements to be executed for each shard and table; calling the multi-database connection pool component to obtain connections for each shard, executing the sub-database operation statements for each shard and table, and storing the execution results in a preset configuration library.
[0069] from Figure 4As can be seen from the above, this embodiment mainly emphasizes that in response to receiving a database operation statement, a confirmation message is sent based on the database operation statement, the operation type corresponding to the database operation statement is a modification operation, the database operation statement is executed, and the execution result is stored in a preset configuration library, so that the database operation statement corresponding to the modification operation is executed in a separate application.
[0070] Further reference Figure 5 As an implementation of the methods shown in the above figures, this application provides an embodiment of a database operation device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0071] like Figure 5 As shown, the database operation device 500 of this embodiment includes: an acquisition module 501, a query module 502, and a modification module 503.
[0072] The acquisition module 501 can be configured to acquire input database operation statements.
[0073] The query module 502 can be configured to execute the database operation statement and output the result in response to determining that the operation type corresponding to the database operation statement is a query operation.
[0074] Modification module 503 can be configured to send the database operation statement to the additional database modification application in response to determining that the operation type corresponding to the database operation statement is a modification operation.
[0075] In some optional embodiments of this invention, the device further includes: a confirmation module, configured to query the execution result corresponding to the database operation statement from a preset configuration library in response to receiving confirmation information sent by the database modification application based on the database operation statement.
[0076] In some optional embodiments of this invention, the device further includes a storage module configured to store the database operation statement in a preset configuration library in response to determining that the operation type corresponding to the database operation statement is a modification operation.
[0077] Further reference Figure 6 As an implementation of the methods shown in the above figures, this disclosure provides another embodiment of a database operation apparatus, which is similar to... Figure 4 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0078] like Figure 6 As shown, the database operation device 600 of this embodiment includes a receiving module 601 and an execution module 602.
[0079] The receiving module 601 can be configured to send a confirmation message based on the database operation statement received from the database query application.
[0080] The execution module 602 can be configured to execute database operation statements and store the execution results in a preset configuration library.
[0081] In some optional embodiments of this example, the execution module is further configured to, in response to determining that the data source type for the database operation statement is a non-distributed database, call the multi-data source connection pool component to obtain a connection and execute the database operation statement.
[0082] In some optional embodiments of this example, the execution module is further configured to, in response to determining that the data source type for the database operation statement is a distributed database, split the database operation statement into sub-database operation statements to be executed for each shard and table; call the multi-data source connection pool component to obtain connections for each shard and execute the sub-database operation statements for each shard and table.
[0083] Further reference Figure 7 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a database operating system.
[0084] like Figure 7 As shown, the database operating system 700 in this embodiment includes: a database query application terminal 701 and a database modification application terminal 702.
[0085] The database query application 701 can be configured to obtain input database operation statements; in response to determining that the operation type corresponding to the database operation statement is a query operation, execute the database operation statement and output the result; in response to determining that the operation type corresponding to the database operation statement is a modification operation, send the database operation statement to the database modification application.
[0086] The database modification application 702 can be configured to respond to a database operation statement sent by the database query application, send a confirmation message based on the database operation statement, execute the database operation statement, and store the execution result in a preset configuration library.
[0087] Specifically, the database operating system includes a database query application, such as the application MyDB. MyDB receives database operation statements, such as SQL statements, input by the user, and determines the operation type corresponding to the SQL statement. If the operation type corresponding to the SQL statement is a query operation, the SQL statement is executed and the result is output. If the operation type corresponding to the SQL statement is a modification operation, the SQL statement is sent to the database modification application, such as MyDB worker, for execution and to obtain the execution result.
[0088] Here, the execution results can be stored in a default configuration library shared by the application MyDB and the application MyDB worker.
[0089] In addition, the preset configuration library can also be used to store the configuration information of the MyDB application, and the database operation statement for the operation type sent to the MyDB worker application, as well as the execution status information of the database operation statement.
[0090] According to embodiments of this application, this application also provides an electronic device and a readable storage medium.
[0091] like Figure 8 The diagram shown is a block diagram of an electronic device for a database operation method according to an embodiment of this application.
[0092] 800 is a block diagram of an electronic device for a database operation method according to embodiments of this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0093] like Figure 8As shown, the electronic device includes one or more processors 801, a memory 802, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 8 Take the 801 processor as an example.
[0094] The memory 802 is the non-transitory computer-readable storage medium provided in this application. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the database operation method provided in this application. The non-transitory computer-readable storage medium of this application stores computer instructions for causing a computer to perform the database operation method provided in this application.
[0095] Memory 802, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the database operation method in the embodiments of this application (e.g., appendix). Figure 5 The acquisition module 501, query module 502, and modification module 503 are shown. The processor 801 executes various server functions and data processing by running non-transient software programs, instructions, and modules stored in the memory 802, thereby implementing the database operation method in the above method embodiment.
[0096] Memory 802 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the use of the electronic device for database operations. Furthermore, memory 802 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 802 may optionally include memory remotely located relative to processor 801, and these remote memories can be connected to the electronic device for database operations via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0097] The electronic device for database operation methods may further include an input device 803 and an output device 804. The processor 801, memory 802, input device 803, and output device 804 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.
[0098] Input device 803 can receive input numerical or character information, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 804 may include a display device, auxiliary lighting device (e.g., LED), and haptic feedback device (e.g., vibration motor). The display device may include, but is not limited to, a liquid crystal display (LCD), a light-emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touchscreen.
[0099] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, application-specific integrated circuits (ASICs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0100] These computational programs (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) used to provide machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term “machine-readable signal” refers to any signal used to provide machine instructions and / or data to a programmable processor.
[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0102] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0103] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.
[0104] According to the technical solution of the embodiments of this application, encrypted logs are stored, which facilitates subsequent retrieval of encrypted logs and ensures log security.
[0105] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.
[0106] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A database operation method applied to a database query application, the method comprising: obtaining an input database operation statement; in response to determining that an operation type corresponding to the database operation statement is a query operation, executing the database operation statement and outputting a result; in response to determining that the operation type corresponding to the database operation statement is a modification operation, sending the database operation statement to a database modification application, the database modification application being configured to, in response to determining that a data source type executed by the database operation statement is a distributed database, split the database operation statement into sub-database operation statements to be executed by each sub-database table, call a multi-data source connection pool component to obtain a connection of each sub-database, and execute the sub-database operation statements for each sub-database table; in response to receiving an acknowledgement information sent by the database modification application based on the database operation statement, querying an execution result corresponding to the database operation statement from a preset configuration library. 2.The method of claim 1, further comprising: in response to determining that the operation type corresponding to the database operation statement is a modification operation, storing the database operation statement to a preset configuration library. 3.A database operation method applied to a database modification application, the method comprising: in response to receiving a database operation statement sent by a database query application, sending an acknowledgement information based on the database operation statement, the database query application being configured to obtain an input database operation statement; in response to determining that an operation type corresponding to the database operation statement is a query operation, executing the database operation statement and outputting a result; in response to determining that the operation type corresponding to the database operation statement is a modification operation, sending the database operation statement to a database modification application; executing the database operation statement and storing an execution result to a preset configuration library, the executing the database operation statement comprising: in response to determining that a data source type executed by the database operation statement is a distributed database, splitting the database operation statement into sub-database operation statements to be executed by each sub-database table, calling a multi-data source connection pool component to obtain a connection of each sub-database, and executing the sub-database operation statements.
4. The method of claim 3, wherein, the executing the database operation statement comprising: in response to determining that the data source type executed by the database operation statement is a non-distributed database, calling a multi-data source connection pool component to obtain a connection and execute the database operation statement. 5.A database operation apparatus applied to a database query application, the apparatus comprising: an obtaining module configured to obtain an input database operation statement; a querying module configured to, in response to determining that an operation type corresponding to the database operation statement is a query operation, execute the database operation statement and output a result; The modification module is configured to, in response to determining that the operation type corresponding to the database operation statement is a modification operation, send the database operation statement to a database modification application end, the database modification application end being configured to, in response to determining that the data source type executed by the database operation statement is a distributed database, split the database operation statement into sub-database operation statements to be executed by each sub-database table; call a multi-data source connection pool component to obtain connections of each sub-database, and execute the sub-database operation statements for each sub-database table. The acknowledgement module is configured to, in response to receiving acknowledgement information sent by the database modification application end based on the database operation statement, query an execution result corresponding to the database operation statement from a preset configuration library.
6. A database operation apparatus applied to a database modification application end, the apparatus comprising: The receiving module is configured to, in response to receiving a database operation statement sent by a database query application end, send acknowledgement information based on the database operation statement, the database query application end being configured to obtain an input database operation statement; in response to determining that the operation type corresponding to the database operation statement is a query operation, execute the database operation statement and output a result; in response to determining that the operation type corresponding to the database operation statement is a modification operation, send the database operation statement to the database modification application end; The execution module is configured to execute the database operation statement and store an execution result to a preset configuration library, the execution of the database operation statement comprising: in response to determining that the data source type executed by the database operation statement is a distributed database, splitting the database operation statement into sub-database operation statements to be executed by each sub-database table; calling a multi-data source connection pool component to obtain connections of each sub-database, and executing the sub-database operation statements for each sub-database table.
7. A database operation system comprising a database query application end and a database modification application end: The database query application end is configured to acquire an input database operation statement; in response to determining that an operation type corresponding to the database operation statement is a query operation, execute the database operation statement and output a result. in response to determining that the operation type corresponding to the database operation statement is a modification operation, sending the database operation statement to the database modification application end; The database modification application end is configured to, in response to receiving a database operation statement sent by the database query application end, send acknowledgement information based on the database operation statement; execute the database operation statement and store an execution result to a preset configuration library, the execution of the database operation statement comprising: in response to determining that the data source type executed by the database operation statement is a distributed database, splitting the database operation statement into sub-database operation statements to be executed by each sub-database table; calling a multi-data source connection pool component to obtain connections of each sub-database, and executing the sub-database operation statements for each sub-database table.
8. An electronic device, comprising: comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to execute the method of any one of claims 1-4.
9. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The computer instructions are for causing the computer to perform the method of any one of claims 1-4.
Citation Information
Patent Citations
Data query method and device, computer equipment and storage medium
CN108628986A
Data read-write method and system
CN111339131A