Database management method, apparatus, device, storage medium, and program product
By constructing a real-time monitoring and termination strategy for twin databases, the shortcomings of delayed processing performance in traditional database management methods are solved, enabling timely detection and termination of potential problems, and improving database management efficiency and performance maintenance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-08-10
- Publication Date
- 2026-05-01
AI Technical Summary
Traditional database management methods delay handling when database performance issues occur, failing to mitigate these issues in a timely manner and leading to slow or unavailable application systems.
By constructing a twin database, data access requests that conform to the termination execution policy can be monitored and terminated in real time, the processing of the physical database can be controlled in a timely manner, and the termination policy can be adjusted based on the running speed of the twin database to ensure the performance of the physical database.
It enables the timely detection and termination of data access requests with potential performance issues, reduces database performance problems, improves the efficiency of database management and performance maintenance, and reduces the cost of manual troubleshooting.
Smart Images

Figure CN117271470B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital twin technology, and in particular to a database management method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] When a production application system becomes temporarily or for an extended period of time unavailable, a large part of the reason is related to database performance. Due to a large number of concurrent users accessing the system and the uncertainty of access, the database may experience performance problems at a certain moment, resulting in slow response or unavailability of the entire application system.
[0003] Therefore, database performance management is particularly important. In traditional technologies, the monitoring system only alerts when a database performance problem occurs. After receiving the alert, the operations and maintenance personnel will handle the database. At this time, they may find that a large number of SQL statements are running. The database administrator needs to locate each SQL statement and then eliminate the problematic SQL statements.
[0004] However, this approach introduces delays and cannot reduce performance issues in the database. Summary of the Invention
[0005] Therefore, it is necessary to provide a database management method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can reduce performance problems in databases, in order to address the aforementioned technical issues.
[0006] Firstly, this application provides a database management method. The method includes:
[0007] Upon receiving a data access request, the data access request is sent to the physical database and simultaneously sent to the twin database corresponding to the physical database;
[0008] In the twin database, the processing procedure corresponding to the data access request that conforms to the suspension execution policy is suspended, while the data access request that does not conform to the suspension execution policy continues to be executed;
[0009] Get the running speed of the twin database after the abort operation is performed;
[0010] If the running speed is greater than the first speed threshold, the abort operation is synchronized to the physical database to control the processing of data access requests that conform to the abort execution policy in the physical database to be suspended.
[0011] In one embodiment, the construction steps of the twin database include:
[0012] Obtain environmental and storage information from the physical database;
[0013] Based on the environmental and storage information of the physical database, a twin database is constructed for the physical database.
[0014] In one embodiment, the step of suspending the processing procedure corresponding to the data access request that conforms to the suspension policy includes:
[0015] Get the number of data access requests that need to be executed at present;
[0016] If the number of data access requests that need to be executed exceeds the thread threshold, then the suspension operation is performed on the processing request process corresponding to the data access requests that exceed the thread threshold.
[0017] In one embodiment, the step of suspending the processing procedure corresponding to the data access request that conforms to the suspension policy includes:
[0018] Get the execution time of each data access request currently in execution;
[0019] If, at the current moment, there is a data access request whose execution time exceeds a time threshold, then the processing procedure corresponding to the data access request whose execution time exceeds the time threshold will be suspended.
[0020] In one embodiment, the step of suspending the processing procedure corresponding to the data access request that conforms to the suspension policy includes:
[0021] Get the performance percentage of each data access request currently being executed;
[0022] If, at any given moment, the performance percentage of an ongoing data access request exceeds a performance threshold, then the processing procedure corresponding to that data access request with a performance percentage exceeding the performance threshold will be terminated.
[0023] In one embodiment, the method further includes:
[0024] If the running speed is not greater than the first speed threshold, an adjustment value is obtained, which includes at least one of a first adjustment value, a second adjustment value, or a third adjustment value; the first adjustment value is used to adjust the size of the thread threshold; the second adjustment value is used to adjust the size of the time threshold; and the third adjustment value is used to adjust the size of the performance threshold.
[0025] Based on the adjustment value, the execution termination strategy is adjusted to obtain the adjusted execution termination strategy;
[0026] According to the adjusted suspension strategy, the suspension operation is re-executed for the processing request process corresponding to the data access request that conforms to the adjusted suspension strategy, until the running speed of the twin database is greater than the first speed threshold.
[0027] Secondly, this application also provides a database management apparatus. The apparatus includes:
[0028] The request response module is used to send the data access request to the physical database and simultaneously send it to the twin database corresponding to the physical database when a data access request is received.
[0029] The strategy execution module is used in the twin database to terminate the processing of data access requests that conform to the termination execution policy, and to continue to execute data access requests that do not conform to the termination execution policy.
[0030] The running speed acquisition module is used to acquire the running speed of the twin database after the abort operation is performed;
[0031] The access request abort module is used to synchronize the abort operation to the physical database when the running speed is greater than a first speed threshold, so as to control the processing of data access requests that conform to the abort execution policy in the physical database to be aborted.
[0032] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0033] Upon receiving a data access request, the data access request is sent to the physical database and simultaneously sent to the twin database corresponding to the physical database;
[0034] In the twin database, the processing procedure corresponding to the data access request that conforms to the suspension execution policy is suspended, while the data access request that does not conform to the suspension execution policy continues to be executed;
[0035] Get the running speed of the twin database after the abort operation is performed;
[0036] If the running speed is greater than the first speed threshold, the abort operation is synchronized to the physical database to control the processing of data access requests that conform to the abort execution policy in the physical database to be suspended.
[0037] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0038] Upon receiving a data access request, the data access request is sent to the physical database and simultaneously sent to the twin database corresponding to the physical database;
[0039] In the twin database, the processing procedure corresponding to the data access request that conforms to the suspension execution policy is suspended, while the data access request that does not conform to the suspension execution policy continues to be executed;
[0040] Get the running speed of the twin database after the abort operation is performed;
[0041] If the running speed is greater than the first speed threshold, the abort operation is synchronized to the physical database to control the processing of data access requests that conform to the abort execution policy in the physical database to be suspended.
[0042] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0043] Upon receiving a data access request, the data access request is sent to the physical database and simultaneously sent to the twin database corresponding to the physical database;
[0044] In the twin database, the processing procedure corresponding to the data access request that conforms to the suspension execution policy is suspended, while the data access request that does not conform to the suspension execution policy continues to be executed;
[0045] Get the running speed of the twin database after the abort operation is performed;
[0046] If the running speed is greater than the first speed threshold, the abort operation is synchronized to the physical database to control the processing of data access requests that conform to the abort execution policy in the physical database to be suspended.
[0047] The aforementioned database management method, apparatus, computer equipment, storage medium, and computer program product, upon receiving a data access request, send the data access request to the physical database and simultaneously to the corresponding twin database. In the twin database, the processing procedures for data access requests that conform to the suspension execution policy are suspended, while data access requests that do not conform to the suspension execution policy continue to be executed. The running speed of the twin database after the suspension operation is obtained. If the running speed exceeds a first speed threshold, the suspension operation is synchronized to the physical database to control the suspension of processing procedures for data access requests that conform to the suspension execution policy in the physical database. Compared to traditional technologies that require manual investigation of database problems after an alarm occurs, this method manages the physical database through suspension operations executed in the twin database. This allows for timely identification of processing procedures for potentially problematic data access requests in the physical database, minimizing performance issues, maintaining physical database performance, and improving the management effectiveness of the physical database. Attached Figure Description
[0048] Figure 1 This is a diagram illustrating the application environment of a database management method in one embodiment.
[0049] Figure 2 This is a flowchart illustrating a database management method in one embodiment;
[0050] Figure 3 This is a flowchart illustrating the database management method in another embodiment;
[0051] Figure 4 This is a structural block diagram of a database management device in one embodiment;
[0052] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] The database management method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server.
[0055] Upon receiving a data access request from terminal 102, server 104 sends the data access request to the physical database and simultaneously to the corresponding twin database. In the twin database, it suspends the processing of data access requests that conform to the suspension policy and continues to execute data access requests that do not conform to the suspension policy. It obtains the running speed of the twin database after the suspension operation, and if the running speed is greater than a first speed threshold, it synchronizes the suspension operation to the physical database to control the suspension of the processing of data access requests that conform to the suspension policy in the physical database.
[0056] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0057] In one embodiment, such as Figure 2 As shown, a database management method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0058] Step 202: Upon receiving a data access request, the data access request is sent to the physical database and simultaneously sent to the twin database corresponding to the physical database.
[0059] Data access requests can include SQL statements, mainly categorized as CRUD operations (Create, Read, Update, Delete). A twin database is a virtual database system built upon a physical database. The running status of the twin database, its processor and memory usage, process usage, execution time, etc., can be monitored to assess the status of the physical database.
[0060] For example, upon receiving a data access request, server 104 may send the data access request to the physical database and simultaneously send it to the twin database corresponding to the physical database.
[0061] Step 204: In the twin database, the processing procedure corresponding to the data access request that conforms to the suspension execution policy is suspended, and the data access request that does not conform to the suspension execution policy is continued to be executed.
[0062] Among them, the execution suspension policy can be used to suspend the processing of data access requests.
[0063] For example, in a twin database, the processing procedure corresponding to a data access request that conforms to the suspension policy can be suspended, while data access requests that do not conform to the suspension policy can continue to be executed.
[0064] Step 206: Obtain the running speed of the twin database after the abort operation.
[0065] The running speed of a twin database can be used to measure the performance of the database. Specifically, for the same database, the faster the database runs, the better its performance; the slower the database runs, the worse its performance.
[0066] For example, the server can obtain the running speed of the twin database after the operation is aborted.
[0067] Step 208: If the running speed is greater than the first speed threshold, the abort operation is synchronized to the physical database to control the processing of data access requests that conform to the abort execution policy in the physical database to be suspended.
[0068] The value of the first speed threshold can be set based on empirical values, and this invention does not limit it.
[0069] For example, if the running speed of the twin database exceeds a first speed threshold, the server can control the synchronization of the abort operation to the physical database, thereby controlling the suspension of the processing requests corresponding to data access requests that conform to the abort execution policy in the physical database.
[0070] In the aforementioned database management method, upon receiving a data access request, the request is sent to the physical database and simultaneously to the corresponding twin database. In the twin database, the processing procedures for data access requests conforming to the suspension strategy are suspended, while data access requests that do not conform to the suspension strategy continue to be executed. The running speed of the twin database after the suspension operation is obtained. If the running speed exceeds a first speed threshold, the suspension operation is synchronized to the physical database to control the suspension of processing procedures for data access requests conforming to the suspension strategy in the physical database. Compared to traditional technologies that require manual investigation of database issues after an alarm occurs, this method manages the physical database through suspension operations executed in the twin database. This allows for timely identification of processing procedures for potentially problematic data access requests in the physical database, minimizing performance issues, maintaining physical database performance, and improving the management effectiveness of the physical database.
[0071] In one embodiment, the steps for constructing the twin database include:
[0072] Obtain environmental and storage information from the physical database;
[0073] Based on the environmental and storage information of the physical database, a twin database is constructed for the physical database.
[0074] The environmental information of the physical database may include, but is not limited to, the deployment method of the physical database. The storage information of the database may include, but is not limited to, table information and database relationship information.
[0075] A connection must be established between the twin database and the physical database to maintain a high degree of consistency with the physical database.
[0076] For example, the server can obtain the environmental and storage information of the physical database to construct a twin database for the physical database based on the environmental and storage information of the physical data.
[0077] In the above embodiments, a twin database is constructed. The twin database is a virtual database. The processing process corresponding to data access requests in the physical database is monitored through the twin database, which enables timely detection of data access requests with problems in the processing process of the physical database.
[0078] In one embodiment, the step of suspending the processing procedure corresponding to the data access request that conforms to the suspension policy includes:
[0079] Get the number of data access requests that need to be executed at present;
[0080] If the number of data access requests that need to be executed exceeds the thread threshold, then the suspension operation is performed on the processing request process corresponding to the data access requests that exceed the thread threshold.
[0081] The server can obtain real-time operational information and data access request processing information from the twin database. Operational information may include, but is not limited to, the database's thread threshold, current thread count, lock status information, and operating speed. Data access request processing information may include, but is not limited to, the execution thread number corresponding to the data access request, execution time, and metadata information.
[0082] The execution termination strategy can include a thread-specific execution termination strategy, which determines whether to execute the execution termination strategy based on the thread threshold and the data of the data access request that needs to be executed.
[0083] In practice, the thread threshold can have an adjustment value to fine-tune its size, thereby allowing for adjustment of the thread threshold.
[0084] For example, the server can obtain the number of data access requests that need to be executed at present, and if the number of data access requests that need to be executed at present exceeds the thread threshold, the server can perform a stop operation on the processing of the data access requests that exceed the thread threshold.
[0085] In the above embodiments, the processing of data access requests exceeding the thread threshold in the twin database is terminated by using a thread threshold. This synchronizes the termination operation performed in the twin database to the physical database, thereby terminating the processing of the corresponding data access requests in the physical database. This ensures that the physical database maintains good performance and achieves the maintenance of physical database performance.
[0086] In one embodiment, the step of suspending the processing procedure corresponding to the data access request that conforms to the suspension policy includes:
[0087] Get the execution time of each data access request currently in execution;
[0088] If, at the current moment, there is a data access request whose execution time exceeds a time threshold, then the processing procedure corresponding to the data access request whose execution time exceeds the time threshold will be suspended.
[0089] The server can obtain the time threshold for data access requests, as well as the execution time of each data access request currently being executed.
[0090] The execution suspension strategy can include execution suspension strategies based on execution time. Specifically, it is determined whether to execute the execution suspension strategy by using a time threshold and the execution time of any currently executing data access requests.
[0091] In practice, the time threshold can have a corresponding adjustment value to fine-tune its size, thereby achieving adjustment of the time threshold.
[0092] For example, the server can obtain the execution time of each data access request currently being executed; if the execution time of a data access request currently being executed is greater than a time threshold, the server can perform the suspension operation on the processing request corresponding to the data access request whose execution time is greater than the time threshold.
[0093] In the above embodiments, the processing of data access requests in the twin database that take longer than the time threshold is stopped by using a time threshold. This synchronizes the stop operation performed in the twin database to the physical database, thereby stopping the corresponding data access requests in the physical database and keeping the performance of the physical database in good condition, thus achieving the maintenance of the physical database performance.
[0094] In one embodiment, the step of suspending the processing procedure corresponding to the data access request that conforms to the suspension policy includes:
[0095] Get the performance percentage of each data access request currently being executed;
[0096] If, at any given moment, the performance percentage of an ongoing data access request exceeds a performance threshold, then the processing procedure corresponding to that data access request with a performance percentage exceeding the performance threshold will be terminated.
[0097] Among them, the performance ratio can be the proportion of system performance occupied during the processing of data access requests.
[0098] The server can obtain the performance threshold for data access requests, as well as the performance percentage of each data access request currently being executed.
[0099] The execution suspension strategy can include a suspension strategy based on the percentage of runtime performance. Specifically, it is determined whether to execute the execution suspension strategy by using a performance threshold and the percentage of runtime performance for data access requests currently in execution.
[0100] In practice, the performance threshold can have an adjustment value to fine-tune its size, thereby adjusting the performance threshold.
[0101] For example, the server can obtain the performance percentage of each data access request currently being executed, and if the performance percentage is greater than a performance threshold, the server can terminate the processing of the data access request whose performance percentage is greater than the performance threshold.
[0102] In the above embodiments, the processing of data access requests whose performance ratio in the twin database exceeds the performance threshold is stopped by using a performance threshold. This allows the stop operation executed in the twin database to be synchronized to the physical database, thereby stopping the corresponding data access requests in the physical database and keeping the performance of the physical database in good condition, thus achieving the maintenance of the physical database performance.
[0103] In one embodiment, the method further includes:
[0104] If the running speed is not greater than the first speed threshold, an adjustment value is obtained, which includes at least one of a first adjustment value, a second adjustment value, and a third adjustment value; the first adjustment value is used to adjust the size of the thread threshold; the second adjustment value is used to adjust the size of the time threshold; and the third adjustment value is used to adjust the size of the performance threshold.
[0105] Based on the adjustment value, the execution termination strategy is adjusted to obtain the adjusted execution termination strategy;
[0106] According to the adjusted suspension strategy, the suspension operation is re-executed for the processing request process corresponding to the data access request that conforms to the adjusted suspension strategy, until the running speed of the twin database is greater than the first speed threshold.
[0107] The adjustment value may include at least one of a first adjustment value, a second adjustment value, or a third adjustment value; the first adjustment value may be used to adjust the size of the thread threshold, the second adjustment value may be used to adjust the size of the time threshold, and the third adjustment value may be used to adjust the size of the performance threshold. Specifically, the adjustment value is used to decrease the size of the threshold corresponding to the adjustment value.
[0108] For example, if the running speed is not greater than the first speed threshold, an adjustment value is obtained, and the suspension execution strategy is adjusted according to the adjustment value to obtain the adjusted suspension execution strategy. According to the adjusted suspension execution strategy, the suspension operation is re-executed on the processing request process corresponding to the data access request that conforms to the adjusted suspension execution strategy until the running speed of the twin database is greater than the first speed threshold.
[0109] In practice, if the running speed is not greater than the first speed threshold, the number of adjustment values can be determined based on the difference between the running speed and the first speed threshold. Specifically, if the difference between the running speed and the first speed threshold is relatively large, a first adjustment value, a second adjustment value, and a third adjustment value can be selected, and these three adjustment values are adjusted separately to terminate the execution strategy. If the difference between the running speed and the first speed threshold is relatively small, the adjustment value with the highest priority can be adjusted according to a pre-set priority, or an adjustment value can be randomly selected for adjustment. Specifically, the pre-set priority can be that the priority of the first adjustment value is higher than the priority of the second adjustment value, and the priority of the second adjustment value is higher than the priority of the third adjustment value; or, the priority of the first adjustment value is lower than the priority of the second adjustment value, and the priority of the second adjustment value is lower than the priority of the third adjustment value.
[0110] In the above embodiments, if the running speed is not greater than the first speed threshold, an adjustment value is obtained, which includes at least one of a first adjustment value, a second adjustment value, or a third adjustment value. Based on the adjustment value, the termination execution strategy is adjusted to obtain the adjusted termination execution strategy. Based on the adjusted termination execution strategy, the termination operation is re-executed for the processing request process corresponding to the data access request that conforms to the adjusted termination execution strategy until the running speed of the twin database is greater than the first speed threshold. The threshold value corresponding to the adjustment value is reduced by adjusting the value, thereby terminating the processing process of more data access requests and maintaining the performance of the physical database in a timely manner.
[0111] To better understand the complete database management process in this embodiment of the invention, a complete example is provided. (Refer to...) Figure 3 The diagram illustrates a flow chart of a database management method in another embodiment, including the following steps:
[0112] Step 302: Obtain the environmental and storage information of the physical database; based on the environmental and storage information of the physical database, construct a twin database for the physical database.
[0113] Step 304: Upon receiving a data access request, send the data access request to the physical database and simultaneously send it to the corresponding twin database of the physical database.
[0114] Step 306: In the twin database, if the number of data access requests that need to be executed exceeds the thread threshold, then the processing of the data access requests that exceed the thread threshold will be terminated.
[0115] Step 308: If, at the current moment, there is a data access request whose execution time is greater than a time threshold, then the processing procedure corresponding to the data access request whose execution time is greater than the time threshold will be terminated.
[0116] Step 310: If the performance ratio of a currently executing data access request is greater than the performance threshold, then the processing procedure corresponding to the data access request whose performance ratio is greater than the performance threshold shall be terminated.
[0117] Step 312: Continue executing data access requests that do not comply with the termination policy.
[0118] Step 314: Obtain the running speed of the twin database after the abort operation.
[0119] Step 316: If the running speed is greater than the first speed threshold, the abort operation is synchronized to the physical database to control the processing of data access requests that conform to the abort execution policy in the physical database to be suspended.
[0120] Step 318: If the running speed is not greater than the first speed threshold, adjust the termination execution strategy according to the adjustment value to obtain the adjusted termination execution strategy; according to the adjusted termination execution strategy, re-execute the termination operation on the processing request process corresponding to the data access request that conforms to the adjusted termination execution strategy until the running speed of the twin database is greater than the first speed threshold.
[0121] In this embodiment, upon receiving a data access request, the request is sent to the physical database and simultaneously to the corresponding twin database. In the twin database, the processing procedures for data access requests conforming to the suspension strategy are suspended, while data access requests that do not conform to the suspension strategy continue to be executed. The running speed of the twin database after the suspension operation is obtained. If the running speed exceeds a first speed threshold, the suspension operation is synchronized to the physical database to control the suspension of processing procedures for data access requests conforming to the suspension strategy in the physical database. Compared to traditional techniques that require manual investigation of database issues after an alarm occurs, this method manages the physical database through suspension operations executed in the twin database. This allows for timely identification of processing procedures for potentially problematic data access requests in the physical database, minimizing performance issues and maintaining physical database performance, thus improving management effectiveness. Furthermore, compared to traditional methods requiring manual investigation, this method reduces labor costs.
[0122] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0123] Based on the same inventive concept, this application also provides a database management device for implementing the database management method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more database management device embodiments provided below can be found in the limitations of the database management method described above, and will not be repeated here.
[0124] In one embodiment, such as Figure 4 As shown, a database management device is provided, including: a request response module 402, a policy execution module 404, a running speed acquisition module 406, and an access request abort module 408, wherein:
[0125] The request response module 402 is used to send the data access request to the physical database and simultaneously send it to the twin database corresponding to the physical database when a data access request is received.
[0126] The strategy execution module 404 is used in the twin database to perform a stop operation on the processing request process corresponding to the data access request that conforms to the stop execution policy, and to continue to execute the data access request that does not conform to the stop execution policy.
[0127] The running speed acquisition module 406 is used to acquire the running speed of the twin database after the abort operation is performed;
[0128] The access request abort module 408 is used to synchronize the abort operation to the physical database when the running speed is greater than the first speed threshold, so as to control the processing of data access requests that conform to the abort execution policy in the physical database to be aborted.
[0129] In some embodiments, the database management apparatus includes:
[0130] The environment and storage information acquisition module is used to acquire the environment and storage information of the physical database.
[0131] The twin database construction module is used to construct a twin database for the physical database based on the environmental and storage information of the physical database.
[0132] In some embodiments, the policy execution module 404 includes:
[0133] The quantity acquisition unit is used to acquire the number of data access requests that need to be executed at present.
[0134] The first strategy execution unit is used to perform the suspension operation on the processing request process corresponding to the data access requests that exceed the thread threshold when the number of data access requests to be executed is greater than the thread threshold.
[0135] In some embodiments, the policy execution module 404 includes:
[0136] The execution time acquisition unit is used to acquire the execution time of each data access request currently being executed.
[0137] The second strategy execution unit is used to perform the suspension operation on the processing request corresponding to the data access request whose execution time is greater than the time threshold at the current moment.
[0138] In some embodiments, the policy execution module 404 includes:
[0139] The performance percentage acquisition unit is used to acquire the performance percentage of each data access request currently being executed.
[0140] The third strategy execution unit is used to perform the suspension operation on the processing request corresponding to the data access request whose running performance ratio is greater than the performance threshold at the current moment.
[0141] In some embodiments, the database management apparatus further includes:
[0142] The adjustment value acquisition module is used to acquire an adjustment value when the running speed is not greater than the first speed threshold. The adjustment value includes at least one of a first adjustment value, a second adjustment value, or a third adjustment value. The first adjustment value is used to adjust the size of the thread threshold; the second adjustment value is used to adjust the size of the time threshold; and the third adjustment value is used to adjust the size of the performance threshold.
[0143] The termination execution strategy acquisition module is used to adjust the termination execution strategy according to the adjustment value to obtain the adjusted termination execution strategy;
[0144] The abort operation execution module is used to re-execute the abort operation on the processing request process corresponding to the data access request that conforms to the adjusted abort execution strategy, until the running speed of the twin database is greater than the first speed threshold.
[0145] Each module in the aforementioned database management device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0146] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores thread thresholds, time thresholds, thread thresholds, and corresponding adjustment values. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a database management method.
[0147] The display unit of this computer device is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of this computer device can be a touch layer covering the display screen, or buttons, a trackball, or a touchpad set on the casing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0148] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0149] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0150] Upon receiving a data access request, the data access request is sent to the physical database and simultaneously sent to the twin database corresponding to the physical database;
[0151] In the twin database, the processing procedure corresponding to the data access request that conforms to the suspension execution policy is suspended, while the data access request that does not conform to the suspension execution policy continues to be executed;
[0152] Get the running speed of the twin database after the abort operation is performed;
[0153] If the running speed is greater than the first speed threshold, the abort operation is synchronized to the physical database to control the processing of data access requests that conform to the abort execution policy in the physical database to be suspended.
[0154] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0155] Obtain environmental and storage information from the physical database;
[0156] Based on the environmental and storage information of the physical database, a twin database is constructed for the physical database.
[0157] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0158] Get the number of data access requests that need to be executed at present;
[0159] If the number of data access requests that need to be executed exceeds the thread threshold, then the suspension operation is performed on the processing request process corresponding to the data access requests that exceed the thread threshold.
[0160] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0161] Get the execution time of each data access request currently in execution;
[0162] If, at the current moment, there is a data access request whose execution time exceeds a time threshold, then the processing procedure corresponding to the data access request whose execution time exceeds the time threshold will be suspended.
[0163] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0164] Get the performance percentage of each data access request currently being executed;
[0165] If, at any given moment, the performance percentage of an ongoing data access request exceeds a performance threshold, then the processing procedure corresponding to that data access request with a performance percentage exceeding the performance threshold will be terminated.
[0166] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0167] If the running speed is not greater than the first speed threshold, an adjustment value is obtained, which includes at least one of a first adjustment value, a second adjustment value, or a third adjustment value; the first adjustment value is used to adjust the size of the thread threshold; the second adjustment value is used to adjust the size of the time threshold; and the third adjustment value is used to adjust the size of the performance threshold.
[0168] Based on the adjustment value, the execution termination strategy is adjusted to obtain the adjusted execution termination strategy;
[0169] According to the adjusted suspension strategy, the suspension operation is re-executed for the processing request process corresponding to the data access request that conforms to the adjusted suspension strategy, until the running speed of the twin database is greater than the first speed threshold.
[0170] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0171] Upon receiving a data access request, the data access request is sent to the physical database and simultaneously sent to the twin database corresponding to the physical database;
[0172] In the twin database, the processing procedure corresponding to the data access request that conforms to the suspension execution policy is suspended, while the data access request that does not conform to the suspension execution policy continues to be executed;
[0173] Get the running speed of the twin database after the abort operation is performed;
[0174] If the running speed is greater than the first speed threshold, the abort operation is synchronized to the physical database to control the processing of data access requests that conform to the abort execution policy in the physical database to be suspended.
[0175] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0176] Obtain environmental and storage information from the physical database;
[0177] Based on the environmental and storage information of the physical database, a twin database is constructed for the physical database.
[0178] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0179] Get the number of data access requests that need to be executed at present;
[0180] If the number of data access requests that need to be executed exceeds the thread threshold, then the suspension operation is performed on the processing request process corresponding to the data access requests that exceed the thread threshold.
[0181] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0182] Get the execution time of each data access request currently in execution;
[0183] If, at the current moment, there is a data access request whose execution time exceeds a time threshold, then the processing procedure corresponding to the data access request whose execution time exceeds the time threshold will be suspended.
[0184] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0185] Get the performance percentage of each data access request currently being executed;
[0186] If, at any given moment, the performance percentage of an ongoing data access request exceeds a performance threshold, then the processing procedure corresponding to that data access request with a performance percentage exceeding the performance threshold will be terminated.
[0187] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0188] If the running speed is not greater than the first speed threshold, an adjustment value is obtained, which includes at least one of a first adjustment value, a second adjustment value, or a third adjustment value; the first adjustment value is used to adjust the size of the thread threshold; the second adjustment value is used to adjust the size of the time threshold; and the third adjustment value is used to adjust the size of the performance threshold.
[0189] Based on the adjustment value, the execution termination strategy is adjusted to obtain the adjusted execution termination strategy;
[0190] According to the adjusted suspension strategy, the suspension operation is re-executed for the processing request process corresponding to the data access request that conforms to the adjusted suspension strategy, until the running speed of the twin database is greater than the first speed threshold.
[0191] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0192] Upon receiving a data access request, the data access request is sent to the physical database and simultaneously sent to the twin database corresponding to the physical database;
[0193] In the twin database, the processing procedure corresponding to the data access request that conforms to the suspension execution policy is suspended, while the data access request that does not conform to the suspension execution policy continues to be executed;
[0194] Get the running speed of the twin database after the abort operation is performed;
[0195] If the running speed is greater than the first speed threshold, the abort operation is synchronized to the physical database to control the processing of data access requests that conform to the abort execution policy in the physical database to be suspended.
[0196] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0197] Obtain environmental and storage information from the physical database;
[0198] Based on the environmental and storage information of the physical database, a twin database is constructed for the physical database.
[0199] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0200] Get the number of data access requests that need to be executed at present;
[0201] If the number of data access requests that need to be executed exceeds the thread threshold, then the suspension operation is performed on the processing request process corresponding to the data access requests that exceed the thread threshold.
[0202] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0203] Get the execution time of each data access request currently in execution;
[0204] If, at the current moment, there is a data access request whose execution time exceeds a time threshold, then the processing procedure corresponding to the data access request whose execution time exceeds the time threshold will be suspended.
[0205] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0206] Get the performance percentage of each data access request currently being executed;
[0207] If, at any given moment, the performance percentage of an ongoing data access request exceeds a performance threshold, then the processing procedure corresponding to that data access request with a performance percentage exceeding the performance threshold will be terminated.
[0208] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0209] If the running speed is not greater than the first speed threshold, an adjustment value is obtained, which includes at least one of a first adjustment value, a second adjustment value, or a third adjustment value; the first adjustment value is used to adjust the size of the thread threshold; the second adjustment value is used to adjust the size of the time threshold; and the third adjustment value is used to adjust the size of the performance threshold.
[0210] Based on the adjustment value, the execution termination strategy is adjusted to obtain the adjusted execution termination strategy;
[0211] According to the adjusted suspension strategy, the suspension operation is re-executed for the processing request process corresponding to the data access request that conforms to the adjusted suspension strategy, until the running speed of the twin database is greater than the first speed threshold.
[0212] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0213] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0214] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0215] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A database management method, characterized in that, The method includes: Upon receiving a data access request, the data access request is sent to the physical database and simultaneously sent to the twin database corresponding to the physical database; In the twin database, the processing procedure corresponding to the data access request that conforms to the suspension execution policy is suspended, while the data access request that does not conform to the suspension execution policy continues to be executed; Get the running speed of the twin database after the abort operation is performed; If the running speed is greater than the first speed threshold, the abort operation will be synchronized to the physical database to control the processing of data access requests that meet the abort execution policy in the physical database to be suspended. The steps for constructing the twin database include: Obtain environmental and storage information from the physical database; Based on the environmental and storage information of the physical database, a twin database is constructed for the physical database. The environmental information includes the deployment method of the physical database, and the storage information includes table information and database association information in the physical database.
2. The method according to claim 1, characterized in that, The step of suspending the processing procedure for data access requests that conform to the suspension policy includes: Get the number of data access requests that need to be executed at present; If the number of data access requests that need to be executed exceeds the thread threshold, the suspension operation is performed on the processing request process corresponding to the data access requests that exceed the thread threshold.
3. The method according to claim 1, characterized in that, The step of suspending the processing procedure corresponding to the data access request that conforms to the suspension policy includes: Get the execution time of each data access request currently in execution; If, at the current moment, there is a data access request whose execution time exceeds a time threshold, then the processing procedure corresponding to the data access request whose execution time exceeds the time threshold will be suspended.
4. The method according to claim 1, characterized in that, The step of suspending the processing procedure corresponding to the data access request that conforms to the suspension policy includes: Get the performance percentage of each data access request currently being executed; If, at any given moment, the performance percentage of an ongoing data access request exceeds a performance threshold, then the processing procedure corresponding to that data access request with a performance percentage exceeding the performance threshold will be terminated.
5. The method according to claim 1, characterized in that, The method further includes: If the running speed is not greater than the first speed threshold, an adjustment value is obtained, which includes at least one of a first adjustment value, a second adjustment value, or a third adjustment value; the first adjustment value is used to adjust the size of the thread threshold; the second adjustment value is used to adjust the size of the time threshold; and the third adjustment value is used to adjust the size of the performance threshold. Based on the adjustment value, the execution suspension strategy is adjusted to obtain the adjusted execution suspension strategy; According to the adjusted suspension strategy, the suspension operation is re-executed for the processing request process corresponding to the data access request that conforms to the adjusted suspension strategy, until the running speed of the twin database is greater than the first speed threshold.
6. A database management device, characterized in that, The device includes: The request response module is used to send the data access request to the physical database and simultaneously send it to the twin database corresponding to the physical database when a data access request is received. The strategy execution module is used in the twin database to terminate the processing of data access requests that conform to the termination execution policy, and to continue to execute data access requests that do not conform to the termination execution policy. The running speed acquisition module is used to acquire the running speed of the twin database after the abort operation is performed; The access request abort module is used to synchronize the abort operation to the physical database when the running speed is greater than a first speed threshold, so as to control the processing of data access requests that conform to the abort execution policy in the physical database to be aborted. The environment and storage information acquisition module is used to acquire the environment and storage information of the physical database. The twin database construction module is used to construct a twin database for the physical database based on the environment information and storage information of the physical database. The environment information includes the deployment method of the physical database, and the storage information includes table information and database association information in the physical database.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the database management method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the database management method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the database management method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method, device and system for controlling access to database resources
CN102915374A
Method and device for acquiring configuration parameters of database
CN112783854A
Database index determination and validation
CN113597606A