Management method and device containing self-increasing list, equipment and medium
Through the coordinated work of multiple nodes in the distributed database system, using operation version numbers and related data copies, rapid recovery with self-increase lists is achieved, solving the complex and time-consuming problems of recovery operations in the existing technology, improving recovery efficiency and ensuring data security.
Patent Information
- Application Number
- CN202411984255.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
AI Technical Summary
In a distributed database system, recovery of self-increasing lists is complex and time-consuming, and cannot meet the needs of fast recovery.
Through the coordinated work of computing nodes, data nodes, global transaction management nodes and metadata management nodes, the operation version number, table data copy, table self-increase column attribute snapshot and table data dictionary copy are used to realize the sequential recovery of table data, table self-increase column and table data dictionary.
It realizes the quickly recovering of deleted or cleared self-increment lists with just one simple flashback statement, without complex operations, improving recovery efficiency, reducing the risks of data loss or corruption, and providing guarantees for the data security and stability of distributed database systems.
Smart Images

Figure CN119902928A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed technology, and in particular to a management method, device, equipment and medium containing a self-incrementing list. Background Art
[0002] Flashback technology is a database recovery technology that allows a database or database object to be restored to a certain point in the past or to a state corresponding to a system change number. It is of great significance for scenarios such as timely repair of accidental deletions, data recovery drills, and problem diagnosis.
[0003] In a distributed database system, due to the existence of multiple data nodes, the implementation of table auto-increment columns is usually more complicated than that of a single-machine database. In order to ensure global auto-increment, it is generally managed and allocated uniformly by the global transaction management node.
[0004] Based on the implementation mechanism of the above distributed database, the auto-increment table list of the deleted or emptied distributed database system is usually restored by using the full and incremental backup files of the table data, table operation log, table auto-increment column and table data dictionary. This backup and recovery method involves various operations such as pre-configuration of backup strategies, selection of full and incremental backup files required for recovery, playback of incremental operations, and rollback of active data. It is more suitable for backup and recovery of the entire database. For the recovery of a table containing auto-increment, the operation is complex and time-consuming, and cannot meet the needs of fast recovery. Summary of the invention
[0005] The present invention provides a management method, device, equipment and medium containing a self-incrementing list, which can realize the flashback containing a self-incrementing list, and has simple operation and rapid recovery.
[0006] According to one aspect of the present invention, a management method containing an auto-increment list is provided, which is executed by a computing node, a data node, a global transaction management node, and a metadata management node in a distributed database system, and includes:
[0007] When receiving a table recovery request sent by the application side, the computing node determines the first operation version number according to the table recovery request, and notifies other nodes in the distributed database system according to the table recovery request;
[0008] Determine, by means of the data node, in a data node recycle bin, a table data copy corresponding to the first operation version number, and perform a table recovery operation according to the table data copy;
[0009] Obtaining, through the global transaction management node, a first table auto-increment column attribute snapshot corresponding to the first operation version number, and performing a table auto-increment column recovery operation according to the first table auto-increment column attribute snapshot;
[0010] The table data dictionary copy corresponding to the first operation version number is determined in the metadata management node recycle bin through the metadata management node, and the table data dictionary recovery operation is performed according to the table data dictionary copy.
[0011] According to another aspect of the present invention, a management device including an auto-increment list is provided, which is executed by a computing node, a data node, a global transaction management node, and a metadata management node in a distributed database system, and includes:
[0012] A table recovery notification module, configured to determine the first operation version number according to the table recovery request when receiving the table recovery request sent by the application side through the computing node, and notify other nodes in the distributed database system according to the table recovery request;
[0013] A table recovery module, configured to determine, through a data node, in a data node recycle bin, a table data copy corresponding to the first operation version number, and perform a table recovery operation according to the table data copy;
[0014] A table auto-increment column recovery module, configured to obtain, through a global transaction management node, a first table auto-increment column attribute snapshot corresponding to the first operation version number, and perform a table auto-increment column recovery operation according to the first table auto-increment column attribute snapshot;
[0015] The table data dictionary recovery module is used to determine the table data dictionary copy corresponding to the first operation version number in the metadata management node recycle bin through the metadata management node, and perform the table data dictionary recovery operation according to the table data dictionary copy.
[0016] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the management method containing a self-incrementing list described in any embodiment of the present invention.
[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the management method containing a self-incrementing list described in any embodiment of the present invention when executed.
[0021] The technical solution of the embodiment of the present invention uses a computing node to determine a first operation version number when receiving a table recovery request sent by an application side, and notifies the remaining nodes in the distributed database system according to the table recovery request, uses a data node to determine a table data copy corresponding to the first operation version number, and performs a table recovery operation, uses a global transaction management node to obtain a first table auto-increment column attribute snapshot corresponding to the first operation version number, and performs a table auto-increment column recovery operation, uses a metadata management node to determine a table data dictionary copy corresponding to the first operation version number, and performs a table data dictionary recovery operation. This can realize sequential recovery of table data, table auto-increment columns, and table data dictionaries, and on the basis of ensuring global consistency of distributed database system data, only one simple flashback statement is executed to flashback and recover deleted or cleared auto-increment columns, without complex operations, and one-time complete recovery is realized, which greatly improves recovery efficiency, effectively reduces the risks and losses caused by data loss or damage, and provides a strong guarantee for data security and stability of distributed database systems.
[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 is a flow chart of a management method including an auto-increment list provided according to Embodiment 1 of the present invention;
[0025] Figure 2 is a flowchart of another management method including an auto-increment list provided according to Embodiment 2 of the present invention;
[0026] Figure 3 is a flowchart of another management method including an auto-increment list provided according to Embodiment 3 of the present invention;
[0027] Figure 4 is a schematic diagram of the structure of a management device including a self-incrementing list provided according to a fourth embodiment of the present invention;
[0028] Figure 5 It is a structural diagram of an electronic device that implements the management method including the self-incrementing list according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] Embodiment 1
[0032] Figure 1 A flowchart of a management method for a self-incrementing list is provided for the first embodiment of the present invention. This embodiment is applicable to the case of processing a self-incrementing list in a distributed database system. The method can be executed by a management device for a self-incrementing list. The management device for a self-incrementing list can be implemented in the form of hardware and / or software, and can generally be configured in a distributed database system with data processing functions. Figure 1 As shown, the method includes:
[0033] S110. When receiving a table recovery request sent by the application side, the computing node determines a first operation version number according to the table recovery request, and notifies other nodes in the distributed database system according to the table recovery request.
[0034] Optionally, the management method containing the self-incrementing list described in the present invention requires the cooperation and execution of computing nodes, metadata management nodes, global transaction management nodes and data nodes in the distributed database system.
[0035] Optionally, the computing node can interact with the application side, and can also interact with the metadata management node, the global transaction management node, and the data node in the distributed database.
[0036] Optionally, a Flashback request in a distributed database allows the user to restore a database or data object (such as a table, index, etc.) to a point in the past or to a state corresponding to a system change number. A table recovery request may refer to a FlashbackTable request, which is a flashback table request. A table recovery request can restore a table to a state at a point in the past.
[0037] Optionally, a table auto-increment column is a special column in a database table, whose value will automatically increment according to pre-set rules. For example, each time a new record is inserted, the value of the auto-increment column will increase by a fixed value. The table auto-increment column is mainly used to provide a unique identifier for each record in the table, facilitating data management, indexing, and association operations between tables.
[0038] Optionally, a table with auto-increment columns refers to a table containing one or more auto-increment columns, and the table also has other columns for storing normal table data.
[0039] It is understandable that in the process of deleting a table containing an auto-increment table, the table, the table auto-increment column and the table data dictionary need to be deleted at the same time. Accordingly, when restoring the table, the table, the table auto-increment column and the table data dictionary need to be restored.
[0040] Optionally, when a table recovery request is received, the request statement can be parsed to determine whether the table recovery request statement includes an operation version number. If so, the operation version number is used as the first operation version number. If not, the last generated operation version number is queried in the metadata management node, and the last generated operation version number is determined as the first operation version number.
[0041] Optionally, the metadata management node associates and binds the operation version number, the table auto-increment column attribute snapshot, and the table data dictionary each time a table is deleted, and moves them into a recycle bin as table metadata. The table metadata moved into the recycle bin can be used as a table metadata copy.
[0042] Optionally, if there is no operation version number in the table recovery request, a query request for the operation version number is sent to the metadata management node through the computing node, and the metadata management node determines the last table metadata copy moved in in the recycle bin, determines the operation version number of the table metadata copy, and returns the operation version number to the computing node.
[0043] When receiving the table recovery request sent by the application side through the computing node, after determining the first operation version number according to the table recovery request, the method may further include:
[0044] Sending a query request for a table auto-increment column attribute snapshot corresponding to the first operation version number to the metadata management node through a computing node;
[0045] After receiving a query request for the table auto-increment column attribute snapshot, the metadata management node searches for a first table auto-increment column attribute snapshot associated with the first operation version number in a metadata management node recycle bin, and returns the first table auto-increment column attribute snapshot to the computing node;
[0046] After obtaining the first table auto-increment column attribute snapshot returned by the metadata management node, the computing node sends the first table auto-increment column attribute snapshot to the global transaction management node.
[0047] Optionally, after receiving a query request for the table auto-increment column attribute snapshot through the metadata management node, querying the first table auto-increment column attribute snapshot associated with the first operation version number in the metadata management node recycle bin may include: determining, through the metadata management node, a table metadata copy with the first operation version number in the metadata management node recycle bin, and determining the first table auto-increment column attribute snapshot having a binding relationship with the first operation version number based on the binding relationship between the operation version number and the table auto-increment column attribute snapshot in the table metadata copy.
[0048] Optionally, based on the table recovery request, notifying the remaining nodes in the distributed database system, including: sending the first operation version number and the table recovery instruction to the data node through the computing node; sending the first table auto-increment column attribute snapshot and the table auto-increment column recovery instruction to the global transaction management node through the computing node; sending the first operation version number and the table data dictionary recovery instruction to the metadata management node through the computing node.
[0049] S120. Determine, through the data node, in the data node recycle bin, a table data copy corresponding to the first operation version number, and perform a table recovery operation according to the table data copy.
[0050] Optionally, in a distributed database system, a data node is a unit that actually stores data. It can be a storage device on a physical server or a logical unit in a distributed storage system that is responsible for storing and managing data blocks. A data node recycle bin is an area in a data node that is used to temporarily store copies of data that have been deleted or marked as deleted, and can be used for data recovery under certain conditions.
[0051] Optionally, the data node is used to manage and maintain each table in the distributed database system. When the data node deletes each table, the table is moved to the recycle bin. The table in the recycle bin can be used as a copy of the table data. At the same time, the recycle bin of the data node will also associate the operation version number corresponding to the deletion operation with the table data copy.
[0052] Optionally, after receiving the first operation version number and table recovery instruction sent by the computing node, the data node can query the table data copy identified by the first operation version number in the recycle bin of the data node, and restore the table to the data node by restoring the table data copy corresponding to the first operation version number.
[0053] Optionally, in a distributed database, due to its distributed storage characteristics, a table can be stored in multiple data nodes. Accordingly, when restoring, it is also necessary to restore in each data node that maintains the table. The data nodes are not limited to a single node.
[0054] S130: Obtain, through the global transaction management node, a first table auto-increment column attribute snapshot corresponding to the first operation version number, and perform a table auto-increment column recovery operation according to the first table auto-increment column attribute snapshot.
[0055] Optionally, the global transaction management node can maintain and manage the table auto-increment column. When a table deletion operation is executed, the global transaction management node deletes the table auto-increment column. When the global transaction management node receives the first table auto-increment column attribute snapshot and the table auto-increment column recovery instruction sent by the computing node, the global transaction management node executes the table auto-increment column recovery operation according to the first table auto-increment column attribute snapshot.
[0056] Optionally, the table auto-increment column attribute snapshot is a snapshot synchronously generated by the global transaction management node when deleting the table auto-increment column. The table auto-increment column attribute snapshot may include key characteristics such as the starting value, current value, auto-increment step, data type, and whether it is a primary key. These characteristics together define the state of the auto-increment column at a certain point in time. The table auto-increment column attribute snapshot is generated by the global transaction management node and stored in the recycle bin of the metadata management node.
[0057] S140 . Determine, through the metadata management node, in the metadata management node recycle bin, a table data dictionary copy corresponding to the first operation version number, and perform a table data dictionary recovery operation according to the table data dictionary copy.
[0058] Optionally, a table metadata copy is stored in a metadata management node recycle bin, and each table metadata copy includes a binding relationship between a table data dictionary copy, a table operation version number, and a table auto-increment column attribute snapshot.
[0059] Optionally, through the metadata management node, when the first operation version number and the table data dictionary recovery instruction sent by the computing node are received, the target table metadata copy can be determined according to the first table operation version number in the metadata management node recycle bin, and the table data dictionary copy in the target table metadata copy can be restored.
[0060] Optionally, the table data dictionary may refer to a collection of database table information, which records various attributes and related information of each table in the database, and may include the table structure, column details, constraints, indexes, and the like.
[0061] Optionally, the management method of the auto-increment list may also include:
[0062] When it is determined through the computing node that the distributed database system has completed the table recovery operation or the deletion operation, the operation completion result is returned to the application side.
[0063] Optionally, through the computing node, when it is determined that the metadata management node, the global transaction management node, and the data node have all completed the corresponding recovery operations, it is determined that the table recovery operation is completed, and the operation completion result is returned to the application side.
[0064] The technical solution of the embodiment of the present invention uses a computing node to determine a first operation version number when receiving a table recovery request sent by an application side, and notifies the remaining nodes in the distributed database system according to the table recovery request, uses a data node to determine a table data copy corresponding to the first operation version number, and performs a table recovery operation, uses a global transaction management node to obtain a first table auto-increment column attribute snapshot corresponding to the first operation version number, and performs a table auto-increment column recovery operation, uses a metadata management node to determine a table data dictionary copy corresponding to the first operation version number, and performs a table data dictionary recovery operation. This can realize sequential recovery of table data, table auto-increment columns, and table data dictionaries, and on the basis of ensuring global consistency of distributed database system data, only one simple flashback statement is executed to flashback and recover deleted or cleared auto-increment columns, without complex operations, and one-time complete recovery is realized, which greatly improves recovery efficiency, effectively reduces the risks and losses caused by data loss or damage, and provides a strong guarantee for data security and stability of distributed database systems.
[0065] Embodiment 2
[0066] Figure 2 This is a flowchart of a management method including an auto-increment list provided in the second embodiment of the present invention. This embodiment specifically describes a recovery method including an auto-increment list based on the above embodiment. Figure 2 As shown, the method includes:
[0067] S210. When receiving a table recovery request sent by the application side, the computing node determines a first operation version number according to the table recovery request, and notifies other nodes in the distributed database system according to the table recovery request.
[0068] When receiving a table recovery request sent by the application side, determining the first operation version number according to the table recovery request by the computing node may include:
[0069] When receiving a table recovery request sent by the application side, the computing node parses the table recovery request, and determines whether the table recovery request includes an operation version number according to the parsing result;
[0070] By computing the node, if yes, the operation version number in the table recovery request is used as the first operation version number;
[0071] Through the computing node, if not, an operation version number query request is sent to the metadata management node, and the most recently recorded operation version number returned by the metadata management node is used as the first operation version number.
[0072] S220: Send a query request for a table auto-increment column attribute snapshot corresponding to the first operation version number to the metadata management node through the computing node.
[0073] S230. After receiving a query request for a table auto-increment column attribute snapshot, the metadata management node searches for a first table auto-increment column attribute snapshot associated with a first operation version number in a metadata management node recycle bin, and returns the first table auto-increment column attribute snapshot to the computing node.
[0074] S240 . After obtaining the first table auto-increment column attribute snapshot returned by the metadata management node, the computing node sends the first table auto-increment column attribute snapshot to the global transaction management node.
[0075] S250: Determine, through the data node, in the data node recycle bin, a table data copy corresponding to the first operation version number, and perform a table recovery operation according to the table data copy.
[0076] S260: Obtain, through the global transaction management node, a first table auto-increment column attribute snapshot corresponding to the first operation version number, and perform a table auto-increment column recovery operation according to the first table auto-increment column attribute snapshot.
[0077] S270 . Determine, through the metadata management node, in the metadata management node recycle bin, a table data dictionary copy corresponding to the first operation version number, and perform a table data dictionary recovery operation according to the table data dictionary copy.
[0078] S280. When it is determined through the computing node that the distributed database system completes the table recovery operation, the operation completion result is returned to the application side.
[0079] The technical solution of the embodiment of the present invention uses a computing node to determine a first operation version number when receiving a table recovery request sent by an application side, and notifies the remaining nodes in the distributed database system according to the table recovery request, uses a data node to determine a table data copy corresponding to the first operation version number, and performs a table recovery operation, uses a global transaction management node to obtain a first table auto-increment column attribute snapshot corresponding to the first operation version number, and performs a table auto-increment column recovery operation, uses a metadata management node to determine a table data dictionary copy corresponding to the first operation version number, and performs a table data dictionary recovery operation. This can realize sequential recovery of table data, table auto-increment columns, and table data dictionaries, and on the basis of ensuring global consistency of distributed database system data, only one simple flashback statement is executed to flashback and recover deleted or cleared auto-increment columns, without complex operations, and one-time complete recovery is realized, which greatly improves recovery efficiency, effectively reduces the risks and losses caused by data loss or damage, and provides a strong guarantee for data security and stability of distributed database systems.
[0080] Embodiment 3
[0081] Figure 3 This is a flowchart of a management method for a self-incrementing list provided in Embodiment 3 of the present invention. Based on the above embodiments, this embodiment specifically describes a method for deleting a self-incrementing list. Figure 3 As shown, the method includes:
[0082] S310. When receiving a deletion request sent by the application side, the computing node generates a second operation version number corresponding to the current request, and interacts with the remaining nodes in the distributed database system according to the deletion request and the second operation version number.
[0083] Optionally, the deletion request may include a first deletion request and a second deletion request. The first deletion request may be a Drop request in a distributed database system. Drop may refer to an instruction request used to delete database objects in database operations, and may act on auto-increment lists in a distributed database system, aiming to delete all table data containing auto-increment lists. The second deletion request may be a Truncate request in a distributed database system. The Truncate request is mainly used to quickly clear data in a table. It directly reclaims the space occupied by table data from the storage level, so that the table quickly becomes an empty table state both logically and physically. After executing the Truncate operation, the relevant data pages will be marked as reusable, and these spaces can be reused when new data is subsequently inserted.
[0084] Optionally, when a deletion request sent by the application side is received, a second operation version number is generated, where the second operation version number refers to an operation version number for marking the current deletion operation.
[0085] The step of interacting with other nodes in the distributed database system according to the deletion request and the second operation version number may include:
[0086] After receiving the deletion request sent by the application side, the computing node sends the deletion request and the second operation version number to the data node;
[0087] Through the computing node, according to the deletion request, the global transaction management node is notified to delete the auto-increment column of the target table;
[0088] The second table auto-increment column attribute snapshot returned by the global transaction management node is received through the computing node, and the deletion class request, the second table auto-increment column attribute snapshot and the second operation version number are sent to the metadata management node.
[0089] S320. Execute a delete operation of the target table through the data node according to the delete request.
[0090] The step of executing the target table deletion operation according to the deletion request through the data node may include any of the following:
[0091] When receiving the first deletion request sent by the computing node, the data node moves the target table into the recycle bin, and associates the second operation version number sent by the computing node with the table data copy in the recycle bin;
[0092] When receiving the second deletion request sent by the computing node, the data node copies the table structure of the target table, rebuilds an empty table in the data node, moves the target table into a recycle bin, and associates the second operation version number with the table data copy in the recycle bin;
[0093] The target table moved into the data node recycle bin serves as a copy of the table data in the recycle bin.
[0094] Optionally, the target table may refer to the table to be deleted specified in the delete request.
[0095] S330. Execute the deletion operation of the target table auto-increment column through the global transaction management node, generate a second table auto-increment column attribute snapshot, and return the second table auto-increment column attribute snapshot to the computing node, so that the computing node sends the second table auto-increment column attribute snapshot to the metadata management node.
[0096] Optionally, the second table auto-increment column attribute snapshot refers to the table auto-increment column attribute snapshot corresponding to the currently deleted table. After completing the deletion of the target table auto-increment column, the global transaction management node returns a response to the computing node and carries the second table auto-increment column attribute snapshot in the response.
[0097] Optionally, target table auto-increment column refers to the auto-increment column of the target table.
[0098] S340: Perform an associative binding operation on the second operation version number, the second table auto-increment column attribute snapshot, and the target table data dictionary through the metadata management node, and move the binding results to the metadata management node recycle bin.
[0099] Optionally, after receiving the deletion class request, the second table auto-increment column attribute snapshot and the second operation version number sent by the computing unit, the metadata management node determines the target table data dictionary corresponding to the target table, binds the target table data dictionary, the second operation version number and the second table auto-increment column, generates table metadata, and moves the table metadata into the metadata management node recycle bin.
[0100] Optionally, the table metadata moved into the metadata management node recycle bin can be used as a table metadata copy, and the table data dictionary in the table metadata copy can be used as a table data dictionary copy.
[0101] Optionally, the management method of the auto-increment list may also include:
[0102] When it is determined through the computing node that the distributed database system has completed the table recovery operation or the deletion operation, the operation completion result is returned to the application side.
[0103] The advantage of this setting is that the deletion operation is performed through the data node, the global transaction management node and the metadata management node respectively, and the table data copy and the table metadata copy are saved in the recycle bin of the data node and the metadata management node respectively. When the table flashback operation is performed subsequently, the corresponding copy can be quickly obtained in the recycle bin and the copy can be restored. By coordinating deletion and recovery, the table flashback can be achieved through simple operations, ensuring the global consistency of the distributed database system.
[0104] The technical solution of the embodiment of the present invention uses a computing node to generate a second operation version number corresponding to the current request when receiving a deletion request sent by an application side, and interacts with other nodes in the distributed database system according to the deletion request and the second operation version number, uses a data node to execute a deletion operation of a target table according to the deletion request, uses a global transaction management node to execute a deletion operation of an auto-increment column of the target table, and generates a second table auto-increment column attribute snapshot, returns the second table auto-increment column attribute snapshot to the computing node, uses a metadata management node to perform an association binding operation on the second operation version number, the second table auto-increment column attribute snapshot and the target table data dictionary, and moves the binding results into a metadata management node recycle bin together, so as to realize the execution of table deletion operations according to different deletion instructions, and can serve as a basis for subsequent table flashback. During the table flashback operation, the table flashback can be realized through simple operations, thereby ensuring the global consistency of the distributed database system.
[0105] Embodiment 4
[0106] Figure 4 This is a schematic diagram of a management device including a self-incrementing list provided in the fourth embodiment of the present invention. Figure 4 As shown, the device includes: a table recovery notification module 410, a table recovery module 420, a table auto-increment column recovery module 430 and a table data dictionary recovery module 440.
[0107] The table recovery notification module 410 is used to determine the first operation version number according to the table recovery request sent by the application side through the computing node, and notify the remaining nodes in the distributed database system according to the table recovery request.
[0108] The table recovery module 420 is used to determine, through the data node, in the data node recycle bin, a table data copy corresponding to the first operation version number, and perform a table recovery operation according to the table data copy.
[0109] The table auto-increment column recovery module 430 is used to obtain the first table auto-increment column attribute snapshot corresponding to the first operation version number through the global transaction management node, and perform the table auto-increment column recovery operation according to the first table auto-increment column attribute snapshot.
[0110] The table data dictionary recovery module 440 is used to determine the table data dictionary copy corresponding to the first operation version number in the metadata management node recycle bin through the metadata management node, and perform the table data dictionary recovery operation according to the table data dictionary copy.
[0111] The technical solution of the embodiment of the present invention uses a computing node to determine a first operation version number when receiving a table recovery request sent by an application side, and notifies the remaining nodes in the distributed database system according to the table recovery request, uses a data node to determine a table data copy corresponding to the first operation version number, and performs a table recovery operation, uses a global transaction management node to obtain a first table auto-increment column attribute snapshot corresponding to the first operation version number, and performs a table auto-increment column recovery operation, uses a metadata management node to determine a table data dictionary copy corresponding to the first operation version number, and performs a table data dictionary recovery operation. This can realize sequential recovery of table data, table auto-increment columns, and table data dictionaries, and on the basis of ensuring global consistency of distributed database system data, only one simple flashback statement is executed to flashback and recover deleted or cleared auto-increment columns, without complex operations, and one-time complete recovery is realized, which greatly improves recovery efficiency, effectively reduces the risks and losses caused by data loss or damage, and provides a strong guarantee for data security and stability of distributed database systems.
[0112] Based on the above embodiments, the table recovery notification module 410 is specifically used for:
[0113] When receiving a table recovery request sent by the application side, the computing node parses the table recovery request, and determines whether the table recovery request includes an operation version number according to the parsing result;
[0114] By computing the node, if yes, the operation version number in the table recovery request is used as the first operation version number;
[0115] Through the computing node, if not, an operation version number query request is sent to the metadata management node, and the most recently recorded operation version number returned by the metadata management node is used as the first operation version number.
[0116] Based on the above embodiments, a table auto-increment column attribute snapshot acquisition module may also be included, which is used to:
[0117] Sending a query request for a table auto-increment column attribute snapshot corresponding to the first operation version number to the metadata management node through a computing node;
[0118] After receiving a query request for the table auto-increment column attribute snapshot, the metadata management node searches for a first table auto-increment column attribute snapshot associated with the first operation version number in a metadata management node recycle bin, and returns the first table auto-increment column attribute snapshot to the computing node;
[0119] After obtaining the first table auto-increment column attribute snapshot returned by the metadata management node, the computing node sends the first table auto-increment column attribute snapshot to the global transaction management node.
[0120] On the basis of the above embodiments, a table deletion module may also be included, including:
[0121] A deletion request acquisition unit, configured to generate a second operation version number corresponding to the current request through a computing node when receiving a deletion request sent by the application side, and interact with other nodes in the distributed database system according to the deletion request and the second operation version number;
[0122] A table deletion unit, configured to execute a deletion operation of a target table according to the deletion request through a data node;
[0123] A table auto-increment column deletion unit is used to execute the deletion operation of the target table auto-increment column through the global transaction management node, and generate a second table auto-increment column attribute snapshot, and return the second table auto-increment column attribute snapshot to the computing node, so that the computing node sends the second table auto-increment column attribute snapshot to the metadata management node;
[0124] The table data dictionary deletion unit is used to perform an associative binding operation on the second operation version number, the second table auto-increment column attribute snapshot and the target table data dictionary through the metadata management node, and move the binding results to the metadata management node recycle bin.
[0125] Based on the above embodiments, the table deletion unit can be used to perform any of the following:
[0126] When receiving the first deletion request sent by the computing node, the data node moves the target table into the recycle bin, and associates the second operation version number sent by the computing node with the table data copy in the recycle bin;
[0127] When receiving the second deletion request sent by the computing node, the data node copies the table structure of the target table, rebuilds an empty table in the data node, moves the target table into a recycle bin, and associates the second operation version number with the table data copy in the recycle bin;
[0128] The target table moved into the data node recycle bin serves as a copy of the table data in the recycle bin.
[0129] Based on the above embodiments, the deletion request obtaining unit may be specifically used for:
[0130] After receiving the deletion request sent by the application side, the computing node sends the deletion request and the second operation version number to the data node;
[0131] Through the computing node, according to the deletion request, the global transaction management node is notified to delete the auto-increment column of the target table;
[0132] The second table auto-increment column attribute snapshot returned by the global transaction management node is received through the computing node, and the deletion class request, the second table auto-increment column attribute snapshot and the second operation version number are sent to the metadata management node.
[0133] Based on the above embodiments, a result returning module may be further included, which is used to:
[0134] When it is determined through the computing node that the distributed database system has completed the table recovery operation or the deletion operation, the operation completion result is returned to the application side.
[0135] The management device including the self-incrementing list provided in the embodiment of the present invention can execute the management method including the self-incrementing list provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.
[0136] Embodiment 5
[0137] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0138] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0139] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0140] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the management method containing the self-incrementing list described in the embodiment of the present invention. That is:
[0141] When receiving a table recovery request sent by the application side, the computing node determines the first operation version number according to the table recovery request, and notifies other nodes in the distributed database system according to the table recovery request;
[0142] Determine, by means of the data node, in a data node recycle bin, a table data copy corresponding to the first operation version number, and perform a table recovery operation according to the table data copy;
[0143] Obtaining, through the global transaction management node, a first table auto-increment column attribute snapshot corresponding to the first operation version number, and performing a table auto-increment column recovery operation according to the first table auto-increment column attribute snapshot;
[0144] The table data dictionary copy corresponding to the first operation version number is determined in the metadata management node recycle bin through the metadata management node, and the table data dictionary recovery operation is performed according to the table data dictionary copy.
[0145] In some embodiments, the management method containing a self-increasing list can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the management method containing a self-increasing list described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the management method containing a self-increasing list in any other appropriate manner (for example, by means of firmware).
[0146] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0147] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0148] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0149] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0150] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0151] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0152] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0153] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A management method containing an auto-increment list, which is executed by a computing node, a data node, a global transaction management node and a metadata management node in a distributed database system, characterized in that: include: When receiving a table recovery request sent by the application side, the computing node determines the first operation version number according to the table recovery request, and notifies other nodes in the distributed database system according to the table recovery request; Determine, by means of the data node, in a data node recycle bin, a table data copy corresponding to the first operation version number, and perform a table recovery operation according to the table data copy; Obtaining, through the global transaction management node, a first table auto-increment column attribute snapshot corresponding to the first operation version number, and performing a table auto-increment column recovery operation according to the first table auto-increment column attribute snapshot; The table data dictionary copy corresponding to the first operation version number is determined in the metadata management node recycle bin through the metadata management node, and the table data dictionary recovery operation is performed according to the table data dictionary copy.
2. The method according to claim 1, characterized in that When receiving a table recovery request sent by the application side, by the computing node, determining a first operation version number according to the table recovery request includes: When receiving a table recovery request sent by the application side, the computing node parses the table recovery request, and determines whether the table recovery request includes an operation version number according to the parsing result; By computing the node, if yes, the operation version number in the table recovery request is used as the first operation version number; Through the computing node, if not, an operation version number query request is sent to the metadata management node, and the most recently recorded operation version number returned by the metadata management node is used as the first operation version number.
3. The method according to claim 1, characterized in that When receiving a table recovery request sent by the application side through the computing node, after determining the first operation version number according to the table recovery request, the method further includes: Sending a query request for a table auto-increment column attribute snapshot corresponding to the first operation version number to the metadata management node through a computing node; After receiving a query request for the table auto-increment column attribute snapshot, the metadata management node searches for a first table auto-increment column attribute snapshot associated with the first operation version number in a metadata management node recycle bin, and returns the first table auto-increment column attribute snapshot to the computing node; After obtaining the first table auto-increment column attribute snapshot returned by the metadata management node, the computing node sends the first table auto-increment column attribute snapshot to the global transaction management node.
4. The method according to claim 1, characterized in that: Also includes: When receiving a deletion request sent by the application side, the computing node generates a second operation version number corresponding to the current request, and interacts with other nodes in the distributed database system according to the deletion request and the second operation version number; Through the data node, according to the deletion request, execute the deletion operation of the target table; Through the global transaction management node, a delete operation of the target table auto-increment column is executed, and a snapshot of the attributes of the second table auto-increment column is generated, and the snapshot of the attributes of the second table auto-increment column is returned to the computing node, so that the computing node sends the snapshot of the attributes of the second table auto-increment column to the metadata management node; Through the metadata management node, an association binding operation is performed on the second operation version number, the second table auto-increment column attribute snapshot, and the target table data dictionary, and the binding results are moved to the metadata management node recycle bin.
5. The method according to claim 4, characterized in that Through the data node, according to the deletion request, a deletion operation of the target table is performed, including any of the following: When receiving the first deletion request sent by the computing node, the data node moves the target table into the recycle bin, and associates the second operation version number sent by the computing node with the table data copy in the recycle bin; When receiving the second deletion request sent by the computing node, the data node copies the table structure of the target table, rebuilds an empty table in the data node, moves the target table into a recycle bin, and associates the second operation version number with the table data copy in the recycle bin; The target table moved into the data node recycle bin serves as a copy of the table data in the recycle bin.
6. The method according to claim 5, characterized in that According to the deletion request and the second operation version number, interacting with other nodes in the distributed database system includes: After receiving the deletion request sent by the application side, the computing node sends the deletion request and the second operation version number to the data node; Through the computing node, according to the deletion request, the global transaction management node is notified to delete the auto-increment column of the target table; The second table auto-increment column attribute snapshot returned by the global transaction management node is received through the computing node, and the deletion class request, the second table auto-increment column attribute snapshot and the second operation version number are sent to the metadata management node.
7. The method according to claim 4, characterized in that Also includes: Through the computing node, when it is determined that the distributed database system has completed the table recovery operation or the deletion operation, the operation completion result is returned to the application side.
8. A management device including an auto-increment list, executed by a computing node, a data node, a global transaction management node and a metadata management node in a distributed database system, characterized in that: include: A table recovery notification module, configured to determine the first operation version number according to the table recovery request when receiving the table recovery request sent by the application side through the computing node, and notify other nodes in the distributed database system according to the table recovery request; A table recovery module, configured to determine, through a data node, in a data node recycle bin, a table data copy corresponding to the first operation version number, and perform a table recovery operation according to the table data copy; A table auto-increment column recovery module, configured to obtain, through a global transaction management node, a first table auto-increment column attribute snapshot corresponding to the first operation version number, and perform a table auto-increment column recovery operation according to the first table auto-increment column attribute snapshot; The table data dictionary recovery module is used to determine the table data dictionary copy corresponding to the first operation version number in the metadata management node recycle bin through the metadata management node, and perform the table data dictionary recovery operation according to the table data dictionary copy.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the management method containing a self-incrementing list as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the management method containing a self-incrementing list according to any one of claims 1 to 7 when executed.