Snapshot processing method and device for database, equipment, medium and product

By generating snapshots in the database and determining the storage method based on the operating status information, the problem of inflexible snapshot retention time in the prior art is solved, and the database stores and analyzes snapshots more flexiblely, enhancing the functionality and business execution efficiency of the database.

CN119917453APending Publication Date: 2025-05-02CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411962263.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In the prior art, it is impossible to set the retention time of database snapshots flexibly, resulting in the database being unable to implement related functions based on stored snapshots.

Method used

By generating a database snapshot and determining its running status information, and determining whether to set the snapshot to a baseline for storage based on the running status information, thereby flexibly selecting the storage method of the baseline or the storage method of the snapshot.

Benefits of technology

It realizes a more flexible storage method for databases to store snapshots, allowing databases to achieve more functions based on stored snapshots, especially when performing performance analysis services such as state analysis, which can more effectively retain and analyze historical snapshots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917453A_ABST
    Figure CN119917453A_ABST
Patent Text Reader

Abstract

The invention provides a snapshot processing method and device for a database, equipment, a medium and a product, so that the database can more flexibly determine whether to set a snapshot as a baseline for storage according to the running state information, thereby storing the snapshot based on a baseline storage mode or a snapshot mode. The snapshots are stored in a more appropriate storage mode, when the database executes performance analysis services such as running state analysis, the snapshots generated and stored earlier time can be analyzed, and the effectiveness of the database on service execution is guaranteed. Therefore, according to the method, the database can realize more functions based on the stored snapshots by enriching the mode that the database stores the snapshots.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a database snapshot processing method, device, equipment, medium and product. Background Art

[0002] A database snapshot is a technology that stores the current state of a database in the form of a snapshot. When the database state needs to be restored later, the stored snapshot can be called to restore the database to the state corresponding to the snapshot, thereby reducing the impact of database errors on the data stored in the database.

[0003] In the prior art, a database generates and stores snapshots of the database at preset intervals. In order to reduce the storage space occupied by the snapshots in the database, the database provides a certain retention time for the snapshots, and the database will periodically delete the stored snapshots that have reached the retention time.

[0004] In some cases, if the retention time of the snapshot is short, the number of snapshots stored in the database is small, which may cause the database to be unable to implement related functions based on the snapshots. Therefore, how to store snapshots more flexibly is a technical problem that needs to be solved in the art. Summary of the invention

[0005] The present application provides a database snapshot processing method, device, equipment, medium and product to solve the technical problem in the prior art that the retention time of the snapshot cannot be flexibly set.

[0006] The first aspect of the present application provides a database snapshot processing method, comprising: generating a snapshot of the database; determining the operating status information of the database; determining whether to set the snapshot as a baseline for storage based on the operating status information; if so, storing the snapshot based on the baseline storage method; if not, storing the snapshot based on the snapshot storage method.

[0007] A second aspect of the present application provides a snapshot processing device for a database, comprising: a generation module for generating a snapshot of the database; a state determination module for determining operating state information of the database; a storage method determination module for determining whether to set the snapshot as a baseline for storage based on the operating state information; and a storage module for storing the snapshot based on a baseline storage method or storing the snapshot based on a snapshot storage method.

[0008] The third aspect of the present application provides an electronic device, comprising: a memory and a processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor executes the method described in the first aspect of the present application.

[0009] A fourth aspect of the present application provides a computer-readable storage medium storing computer-executable instructions, which, when executed, implement the method described in the first aspect of the present application.

[0010] A fifth aspect of the present application provides a computer program product, including a computer program, which implements the method described in the first aspect of the present application when executed.

[0011] The database snapshot processing method, device, equipment, medium and product provided by the present application enable the database to more flexibly determine whether to set the snapshot as a baseline for storage according to the operation status information, so as to store the snapshot based on the storage method of the baseline or the snapshot method, so as to store the snapshot in a more appropriate storage method. When the database is performing performance analysis services such as operation status analysis, the snapshot generated and stored at an earlier time can be analyzed through the snapshot stored in the baseline storage method with a longer retention time, and then the changes in various indicators under the long-term operation of the database are analyzed, thereby ensuring the effectiveness of the database in executing the business. Therefore, the present application can enrich the way in which the database stores snapshots, so that the database can realize more functions based on the stored snapshots. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0013] Figure 1 A schematic diagram of the application scenario of this application;

[0014] Figure 2 A schematic diagram of a process for clearing snapshots of a database in the prior art;

[0015] Figure 3 A schematic diagram of snapshot retention time in the prior art;

[0016] Figure 4 A schematic diagram of a process flow of an embodiment of a database snapshot processing method provided by the present application;

[0017] Figure 5 A schematic diagram of the storage method provided for this application;

[0018] Figure 6 A flowchart of another embodiment of the database snapshot processing method provided by the present application;

[0019] Figure 7A schematic diagram of the structure of a database snapshot processing device provided by the present application;

[0020] Figure 8 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0023] Figure 1 This is a schematic diagram of the application scenario of this application, such as Figure 1 As shown, the present application is applied to a database 10, and the database may be, for example, Oracle, DM or OpenGauss, etc. The embodiment of the present application does not limit the specific implementation method of the database.

[0024] Specifically, during the operation of the database, the database will record the current state of the database at a specific time point and generate a copy of the current state for storage. This copy can be called a snapshot. Figure 1 In the scenario shown, the database generates snapshots at time t1, t2, t3, ... at regular intervals, and they are recorded as snapshot 1, snapshot 2, snapshot 3, ... respectively.

[0025] Snapshots can be used for data backup, data recovery, data analysis, etc., thereby improving the data consistency of the database and increasing the speed of data recovery. For example, when a database failure or data loss occurs, the stored snapshot can be used to restore the database to the state at the corresponding time point of the snapshot, thereby reducing database damage and data loss. For another example, when a database failure occurs, the stored snapshot can be used to trace back the operating state of the database, thereby generating a comparison report to analyze specific problems in the database.

[0026] Since the storage space of the database is limited, in order to prevent snapshots from occupying the storage space, the database provides a certain retention time for snapshots and regularly deletes the stored snapshots that have reached the retention time for clearing.

[0027] Figure 2 The present invention is a flowchart of clearing a snapshot of a database in the prior art, wherein after the database creates a snapshot through S10, it determines whether the snapshot meets the preset conditions in S20. If the preset conditions are met, the stored snapshot is deleted through S30 to save the storage space of the database. If the preset conditions are not met, it returns to S20 to continue to determine whether the preset conditions are met until the snapshot is deleted. The preset conditions may be that the preset retention time of the snapshot has timed out, or the database determines whether the snapshot is aged based on system information, message information, waiting time information, etc., and when it is determined that the snapshot is aged, the snapshot is cleared.

[0028] pass Figure 2 Although the method shown can clear the snapshots stored in the database, the preset conditions for clearing the snapshots are relatively simple and cannot be adjusted. In some cases, when the database requires snapshots with different retention times, they may have been cleared, making the database unable to implement related functions.

[0029] For example, when the database performs performance analysis such as running status analysis, it generates a detailed comparison report by comparing two specified snapshots. However, if the snapshots to be analyzed have been cleared, the database cannot generate the comparison report normally.

[0030] Figure 3 Schematic diagram of snapshot retention time in the prior art. Let the retention time of the database for snapshots be T. When the database needs to perform performance analysis and other services at time tx, the snapshots stored in the database at this time are the total n snapshots generated from time t1 to time tn. The snapshots t01-t1 before time t1 have exceeded the retention time, so the database has deleted these snapshots. Therefore, at time tx, the database can only perform analysis based on the snapshots stored from time t1 to time tn, but cannot analyze the snapshots before time t1.

[0031] Based on the above Figure 2 and Figure 3 It can be seen that the conditions for clearing snapshots in the database in the prior art are relatively simple and cannot be adjusted, so that the database cannot implement related functions based on the stored snapshots. Therefore, how to set the retention time of snapshots in the database more flexibly so that the database can implement more functions based on the stored snapshots is a technical problem that needs to be solved in this field.

[0032] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0033] Figure 4 A schematic diagram of a process flow of an embodiment of a database snapshot processing method provided by the present application, such as Figure 4 The method described can be applied to Figure 1 In the scenario shown, it is executed by the database. Specifically, the database snapshot processing method provided in this embodiment includes:

[0034] S101: The database generates a snapshot. The database may generate a snapshot of the current time at a preset snapshot generation time. The embodiment of the present application does not limit the specific method of generating the snapshot by the database.

[0035] In one embodiment, the preset snapshot generation time may be specified, may be set by a user of the database, or may be determined in real time by the database according to information such as the current database operation status. For example, the database generates a snapshot once every hour, and thus step S101 is performed once every hour.

[0036] S102: Determine the running state of the database. Before storing the snapshot, the database also determines the current running state of the database.

[0037] In one embodiment, the operation status information of the database includes: at least one of the response time, throughput, resource utilization, waiting time, cache hit rate or stability of the database. It is understandable that these operation status information can be flexibly set according to the load, hardware configuration and application scenario of different databases. Through these operation status information, the present application can more effectively evaluate the operation status of the database, thereby effectively measuring the database load and system resources and other information, and then more accurately provide a basis for subsequent database processing.

[0038] In one embodiment, the database may periodically execute S102 to determine the operating status of the database.

[0039] In one embodiment, after the database generates a snapshot in S101, it can determine the operating status of the database through S102, or the database can determine the operating status of the database in S102 and then generate a snapshot through S101. The embodiment of the present application does not limit the order of S101 and S102, and both S101 and S102 can be executed before S103.

[0040] S103: According to the running status determined in S102, it is determined whether to set the snapshot generated in S101 as a baseline for storage.

[0041] Specifically, the database provided in the present application supports storing snapshots in at least two different storage modes, namely, a snapshot storage mode and a baseline storage mode. Then, in S103, the database determines a storage mode from the at least two different storage modes to store the snapshot.

[0042] In an embodiment of the present application, the retention time of snapshots stored in the storage mode of snapshots supported by the database is different from that of snapshots stored in the storage mode of baselines. For example, when the database stores snapshots in the storage mode of baselines, the retention time of snapshots is recorded as the first retention time; when the database stores snapshots in the storage mode of snapshots, the retention time of snapshots is recorded as the second retention time. Then, the first retention time and the second retention time are different, and the first retention time of the baseline is not controlled or limited by the second retention time of the snapshot. The first retention time can be set to be greater than the second retention time.

[0043] Figure 5 A schematic diagram of the storage method provided for this application, such as Figure 5 The processing logic of the database is shown, wherein the database determines a storage method to store the snapshot from a baseline storage method and a snapshot storage method according to the determined running status information.

[0044] S104: If it is determined in S103 that the snapshot is to be stored as a baseline according to the operation status information, the database stores the snapshot in the same manner as the baseline.

[0045] In a specific embodiment, the database creates a baseline in a storage space, and stores the snapshot using the created baseline.

[0046] S105: If it is determined in S103 that the snapshot is not to be set as a baseline for storage according to the operation status information, the database stores the snapshot generated in S101 in the form of a snapshot, wherein the database directly stores the snapshot in the storage space, and does not store the snapshot through a baseline.

[0047] In summary, the snapshot processing method of the database provided in this embodiment enables the database to more flexibly determine whether to set the snapshot as a baseline for storage according to the running status information, so as to store the snapshot based on the storage method of the baseline or the snapshot method, so as to store the snapshot in a more appropriate storage method. When the database is performing performance analysis services such as running status analysis, the snapshot generated and stored at an earlier time can be analyzed by the snapshot stored in the baseline storage method with a longer retention time, and then the changes in various indicators under the long-term operation of the database are analyzed, thereby ensuring the effectiveness of the database in executing the business. Therefore, the present application can enrich the conditions for clearing the snapshot by enriching the way the database stores the snapshot, so that the database can realize more functions based on the stored snapshot. In addition, the baseline storage method provided in this embodiment is implemented on the basis of the existing snapshot storage method, so that the two storage methods can run independently and will not interfere with each other, ensuring the effective application and promotion of the embodiments of the present application.

[0048] For example, the amount of data in the database during the daytime period is large, and the amount of data during the nighttime period is small. If the performance analysis of the database is required, the analysis value of the data during the daytime period is higher. Figure 4 The method shown determines the storage method for different time periods, for example, the snapshots generated in the daytime period are stored in the baseline storage method, and the snapshots generated in the nighttime period are stored in the snapshot storage method, and the first retention time corresponding to the baseline storage method is greater than the second retention time corresponding to the snapshot storage method. Subsequently, when the database is performing performance analysis services such as operation status analysis, snapshots stored in a longer baseline can be obtained from the baseline, and a comparison report can be generated based on the snapshots stored in the baseline storage method, which not only increases the time period in which the database can perform performance analysis, but also improves the analysis value of the data to be analyzed, and ensures the effectiveness of the database in performing performance analysis tasks. At the same time, the snapshots stored in the snapshot storage method still retain their original second retention time, and the database can still restore the snapshots of the nighttime period within the second retention time.

[0049] In one embodiment, the database determines in S103 whether to set the snapshot as a baseline for storage based on whether each item in the running status information is within a preset range.

[0050] In this embodiment, each item in the operation status information is divided into three ranges according to the utilization of the database: low utilization, medium utilization and high utilization. Low utilization indicates that the database load is light and the system resources are sufficient, but there may be certain resource waste problems; medium utilization indicates that the utilization is moderate, the load is within a reasonable range and the use of system resources is relatively balanced, which is the ideal state of most database production environments; high utilization indicates that the database load is heavy and the system resources are tight, and there may be problems such as slow database response time and timeout.

[0051] At the same time, considering the limitations of using a single piece of information in the running status information to judge the database performance, it cannot fully reflect the health status and performance issues of the database. Therefore, this embodiment judges the performance status of the database by comprehensively considering the resource utilization (CPU utilization, memory utilization, storage utilization and I / O utilization) and cache hit rate of the database.

[0052] For example, the following Table 1 shows the numerical range of the medium utilization corresponding to each item of the resource utilization and cache hit rate in the operation status information of the database.

[0053] Table 1

[0054] index Numerical range CPU Utilization 20%~80% Memory Utilization 20%~80% Storage Utilization 20%~80% I / O Utilization 20%~80% Cache hit rate 70%~90%

[0055] Therefore, after the database obtains the operation status information of the database, each item of the resource utilization rate and the cache hit rate in the operation status information can be compared with the numerical range of the item in Table 1. According to the comparison result, when each item in the operation status information is within the corresponding preset range in Table 1, it is determined that the snapshot is set to be stored in the storage mode of the baseline; when at least one item in the operation status information exceeds the corresponding preset range, it is determined not to set the snapshot to be stored in the storage mode of the baseline, but to still store the snapshot in the storage mode of the snapshot.

[0056] In summary, in the database snapshot processing method provided in this embodiment, the database determines, based on the operating status information, that when the database is at medium utilization, the database operating status is stable and there is a certain amount of business volume. Therefore, without affecting the normal operation of the database, the snapshot retention time is increased as much as possible by creating a baseline storage snapshot, so that the snapshot stored through the baseline can exist and be deleted as needed.

[0057] In one embodiment, when the database determines that each item in the operating state is within the corresponding preset range, it can also be determined that the performance of the current database is relatively good, so all or part of the snapshots stored in the storage space are re-stored in the baseline storage mode, and then the snapshots stored in the storage space in the snapshot storage mode are deleted, so that more snapshots can be retained for a longer time in the baseline storage mode.

[0058] In an embodiment of the present application, information such as the inspection period for generating snapshots of the database, the first retention time of the baseline in the baseline storage method, and the range of snapshot groups that can be stored by the baseline storage method can be adjusted according to the actual application scenario of the database.

[0059] Then, when the database executes the step of deleting the snapshots stored in the baseline based on the trigger condition for clearing the baseline, the snapshots stored in the baseline of the storage space whose residence time is greater than the first residence time are deleted according to the first residence time. When the database executes the step of deleting the snapshots based on the trigger condition for clearing the snapshots, the snapshots stored in the storage space whose residence time is greater than the second residence time are deleted according to the second residence time.

[0060] Furthermore, since the first retention time of the snapshot stored through the baseline is longer than the second retention time of the snapshot and has a smaller impact range, when the database generates a comparison report through the snapshot stored in the baseline, the generated comparison report can better reflect the overall performance trend of the database under long-term operation, and timely adjust the data configuration and hardware to keep the database in a long-term and efficient working state. At the same time, when the database is stable and no new snapshot baselines are generated, that is, snapshots are no longer stored through the baseline storage method, it means that the database load and system resources have been overloaded, indicating that the database has a high probability of slowing down the database response time, timeouts and other problems. At this time, the database can process the relevant slow SQL, wait events, lock activities and other information in a timely manner, so that when the database updates patches and adjusts configurations, it can analyze through snapshot comparison reports to find out whether the update of patches and the adjustment of configurations have introduced new problems, thereby more effectively determining the performance bottleneck and optimization direction of the database.

[0061] In the aforementioned embodiment of the present application, a method is provided for the database to determine to store the snapshot in the storage mode of the baseline according to the operation status information. In another embodiment of the present application, the database can also receive instruction information sent by the user of the database, and thereby determine to store the snapshot in the storage mode of the baseline according to the instruction information.

[0062] Alternatively, the database may also receive an automatic snapshot baseline activation instruction message sent by a user of the database, thereby activating the automatic snapshot baseline function according to the instruction message to perform the following operations: Figure 4The snapshot processing method of the database shown in the figure can improve the interactivity between the database and the user, and can process the snapshot in a more real-time and effective manner to meet the user's requirements.

[0063] For example, Figure 6 A flowchart of another embodiment of the database snapshot processing method provided by the present application is shown as follows: Figure 6 The method shown shows Figure 4 The method shown is a specific implementation method, wherein, after the database turns on the automatic snapshot baseline capability and the automatic snapshot capability, it creates a plug-in, periodically creates snapshots and the automatic snapshot period, and then when the snapshot baseline check period times out, it determines whether the current database operation status information meets the performance standards provided in Table 1. When the operation status information meets the performance standards shown in Table 1, a baseline is created to store the snapshot, and an independent baseline timer is created. After the independent baseline timer times out, the snapshot baseline and the associated snapshot are deleted. When the operation status information does not meet the performance standards provided in Table 1, it returns whether the snapshot baseline check period has timed out.

[0064] In the above embodiments of the present application, the snapshot processing method of the database provided in the embodiments of the present application is introduced. In order to realize the functions in the snapshot processing method of the database provided in the above embodiments of the present application, the database as the execution subject can be realized by hardware structure and / or software module, for example, in the form of hardware structure, software module, or hardware structure plus software module to realize the above functions. Whether one of the above functions is executed in the form of hardware structure, software module, or hardware structure plus software module depends on the specific application and design constraints of the technical solution.

[0065] For example, Figure 7 A schematic diagram of the structure of a database snapshot processing device provided by the present application, such as Figure 7 The device shown can be used to execute the database snapshot processing method provided in any embodiment of the present application. In one embodiment, Figure 7 The database snapshot processing method 1000 shown includes: a generation module 1001, a state determination module 1002, a storage mode determination module 1003 and a storage module 1004. The generation module 1001 is used to generate a snapshot of the database, the state determination module 1002 is used to determine the operation state information of the database; the storage mode determination module 1003 is used to determine whether to set the snapshot as a baseline for storage according to the operation state information; the storage module 1004 is used to store the snapshot based on the storage mode of the baseline, or store the snapshot based on the storage mode of the snapshot.

[0066] The specific implementation method and principle of the snapshot processing device of the above database refer to the description of the snapshot processing method of the above database, which will not be repeated here.

[0067] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the processing module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above-mentioned module is determined. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0068] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0069] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0070] For example, Figure 8 A schematic diagram of the structure of an electronic device provided in this application, such as Figure 8 The device shown can be used to execute the database snapshot processing method provided in any embodiment of the present application. In one embodiment, Figure 8 The electronic device 2000 shown includes one or more processors 2001 and a memory 2002; wherein the memory 2002 is used to store computer executable instructions, and the processor 2001 can execute the computer executable instructions stored in the memory 2002. When the computer executable instructions are executed by the processor 2001, the processor 2001 implements the snapshot processing method of any database in the aforementioned embodiments of the present application. In one embodiment, Figure 8 The electronic device 2000 shown further includes a communication interface 2003 , wherein the processor 2001 can communicate with other devices via the communication interface 2003 .

[0071] The present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed, they can be used to implement a snapshot processing method for a database in any of the aforementioned embodiments of the present application.

[0072] An embodiment of the present application also provides a chip for executing instructions, wherein the chip is used to execute a snapshot processing method of any database as described above in the present application.

[0073] An embodiment of the present application further provides a computer program product, including a computer program, which, when executed, implements any database snapshot processing method as described above in the present application.

[0074] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A database snapshot processing method, characterized in that: include: generating a snapshot of the database; Determining the operation status information of the database; Determining whether to set the snapshot as a baseline for storage according to the running status information; If so, storing the snapshot based on the storage method of the baseline; If not, the snapshot is stored based on the snapshot storage method.

2. The method according to claim 1, characterized in that The operation status information includes: at least one of response time, throughput, resource utilization, waiting events, cache hit rate or stability.

3. The method according to claim 2, characterized in that The step of determining, according to the running status information, whether to set the snapshot as a baseline for storage includes: When each item of the operation status information is within a corresponding preset range, determining to set the snapshot as a baseline for storage; When at least one item of the running status information exceeds the corresponding preset range, it is determined not to set the snapshot as the baseline for storage.

4. The method according to any one of claims 1 to 3, characterized in that: Also includes: Based on the clearing trigger condition of the baseline, deleting the snapshots stored in the baseline whose residence time is greater than the first residence time; Based on the snapshot clearing trigger condition, delete the snapshots stored in the snapshot storage space whose residence time is greater than the second residence time. The first dwell time is greater than the second dwell time.

5. The method according to claim 1, characterized in that Also includes: After receiving the automatic snapshot baseline start indication information, it is determined whether to set the snapshot as the baseline according to the running status information.

6. The method according to claim 1, characterized in that Also includes: Generates comparison reports based on snapshots stored in a baseline-based storage method.

7. A snapshot processing device for a database, characterized in that: include: A generation module, used for generating a snapshot of the database; A status determination module, used to determine the operation status information of the database; A storage mode determination module, used to determine whether to set the snapshot as a baseline for storage according to the operation status information; The storage module is used to store the snapshot in a baseline-based storage mode or in a snapshot-based storage mode.

8. An electronic device, characterized in that: include: Memory and processor; The memory stores computer executable instructions; The processor executes the computer executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: Computer executable instructions are stored, and when the computer executable instructions are executed, the method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed.