Database management method and device, electronic equipment and storage medium

By using the file system's shared storage path to backup and restore data in Greenplum database, the problem of data inconsistency and recovery difficulties in database failure is solved, the efficiency of data backup and recovery is improved, and the continuous availability of the database is ensured.

CN119088879APending Publication Date: 2024-12-06WUHAN STONE INFORMATION SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411122420.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

When the Greenplum database encounters machine shutdown, power outage and network disconnection, the database cannot be used normally, the hardware usage rate of non-failed nodes becomes higher, the corresponding performance cannot be achieved, and the data is inconsistent, so it cannot be started as usual.

Method used

Provide a database management method, by obtaining data processing requests, determining data information, backing up data to the shared directory of the file system during backup requests, and recovering data from the file system to a specified address when restoring requests, using the file system provided by the file system. Share storage paths to improve the efficiency of data backup and recovery.

Benefits of technology

By backing up data from all nodes of a relational distributed database to the same location, it is easy to manage and improves the efficiency of data backup and recovery, ensuring that the database can maintain continuous availability in the event of failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088879A_ABST
    Figure CN119088879A_ABST
Patent Text Reader

Abstract

The invention discloses a database management method and device, electronic equipment and a storage medium, the method is applied to a management center of a database cluster, the database cluster comprises a relational distributed database and a file system, and the method comprises the following steps: obtaining a data processing request of the relational distributed database, the method comprises the steps of determining data information of data corresponding to a data processing request, determining a first address stored by first data corresponding to a backup request when the data processing request is a backup request, and performing backup operation on the first data under the first address in a relational distributed database so as to backup the first data to a file system, and when the data processing request is a recovery request and the data information satisfies a recovery condition, recovering second data corresponding to the data processing request from the file system to a specified second address. By backing up the data of all the nodes of the relational distributed database to the same position, the data management can be facilitated, and the data backup and recovery efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a database management method, device, electronic equipment and storage medium. Background Art

[0002] Greenplum Database is a relational distributed database that includes multiple nodes. It uses a large-scale parallel processing architecture of shared-noting (a distributed computing architecture) and has the advantages of full scalability, high availability, high performance, high cost performance and resource sharing.

[0003] However, when using the Greenplum database, the machine is often shut down, the power is cut off, and the network is disconnected. When the above situations occur, the Greenplum database will have the following problems: the database cannot be used normally; the database can be used, but due to individual node failures, the hardware utilization rate of non-faulty nodes becomes high and the corresponding performance cannot be achieved.

[0004] When problems occur in the above database, the nodes will be unable to connect, resulting in data inconsistency and verification failure, and thus the inability to start each node as usual. Therefore, a database management method is urgently needed to solve the above technical problems. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a database management method, device, electronic device and storage medium to solve the technical problems that exist when the relational distributed database encounters the problems in the above-mentioned background technology.

[0006] In a first aspect, an embodiment of the present invention provides a database management method, which is applied to a management center of a database cluster, wherein the database cluster includes a relational distributed database and a file system, and the database management method includes:

[0007] Obtaining a data processing request of the relational distributed database, and determining data information of data corresponding to the data processing request;

[0008] In a case where the data processing request is a backup request, determining a first address of first data corresponding to the backup request in the relational distributed database;

[0009] performing a backup operation on the first data at the first address in the relational distributed database according to a backup tool of the relational distributed database, so as to back up the first data to a shared directory of the file system;

[0010] When the data processing request is a recovery request and the data information satisfies a preset recovery condition, the second data corresponding to the data processing request is restored from the file system to a second address in the relational distributed database specified by the recovery request.

[0011] In some embodiments, before obtaining the data processing request of the relational distributed database and determining the data information of the data corresponding to the data processing request, the method further includes:

[0012] Creating a shared directory in the file system;

[0013] The client of the file system is configured on each node of the relational distributed database so that the shared directory is mounted on each node.

[0014] In some embodiments, the backing up operation on the first data at the first address in the relational distributed database according to the backup tool of the relational distributed database to back up the first data to the shared directory of the file system includes:

[0015] Obtaining a data processing command set corresponding to the relational distributed database;

[0016] Selecting a backup command capable of executing a backup operation from the data processing command set;

[0017] A first processing command for the first data is sent to the relational distributed database, so that the relational distributed database writes the first data at the first address into a shared directory of the file system based on the first processing command.

[0018] In some embodiments, the data information includes first version information, and when the data processing request is a recovery request and the data information satisfies a preset recovery condition, restoring second data corresponding to the data processing request from the file system to a second address in the relational distributed database specified by the recovery request includes:

[0019] When the data processing request is a recovery request, obtaining first version information in the data information;

[0020] Obtaining second version information of second data corresponding to the recovery request in the shared directory;

[0021] In a case where the first version information is identical to the second version information, the second data corresponding to the data processing request is restored from the file system to a second address in the relational distributed database specified by the restoration request.

[0022] In some embodiments, the data information further includes first verification code information and a generation algorithm for generating the first verification code information, and when the first version information is the same as the second version information, restoring the second data corresponding to the data processing request from the file system to a second address in the relational distributed database specified by the recovery request includes:

[0023] When the first version information is the same as the second version information, obtaining first verification code information in the data information and a generation algorithm for generating the first verification code information;

[0024] Based on the generation algorithm, calculating second verification code information of second data corresponding to the recovery request in the shared directory;

[0025] In a case where the first verification code information is identical to the second verification code information, the second data corresponding to the data processing request is restored from the file system to a second address in the relational distributed database specified by the restoration request.

[0026] In some embodiments, the generation algorithm includes a hash algorithm, and the calculating, based on the generation function, second verification code information of the second data corresponding to the recovery request in the shared directory includes:

[0027] Based on the hash algorithm, an integrity check is performed on the second data corresponding to the recovery request in the shared directory to generate second verification code information of the second data.

[0028] In some embodiments, the method further comprises:

[0029] According to a preset time interval, each node in the relational distributed system is regularly detected to obtain a detection result;

[0030] When the detection result indicates that there is a target node failure, a target instruction is sent to the relational distributed database so that the relational distributed database recovers and restarts the target node.

[0031] In a second aspect, an embodiment of the present invention provides a database management device, which is applied to a management center of a database cluster, wherein the database cluster includes a relational distributed database and a file system, and the database management device includes:

[0032] An acquisition module, used to acquire a data processing request of the relational distributed database and determine data information of data corresponding to the data processing request;

[0033] A determination module, configured to determine, when the data processing request is a backup request, a first address of first data corresponding to the backup request in the relational distributed database;

[0034] a backup module, configured to perform a backup operation on the first data at the first address in the relational distributed database according to a backup tool of the relational distributed database, so as to back up the first data to a shared directory of the file system;

[0035] A recovery module is used to restore the second data corresponding to the data processing request from the file system to the second address in the relational distributed database specified by the recovery request when the data processing request is a recovery request and the data information meets the preset recovery condition.

[0036] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned database management methods when executing the computer program.

[0037] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned database management methods are implemented.

[0038] The embodiment of the present invention provides a database management method, device, electronic device and storage medium. The method obtains a data processing request of a relational distributed database, determines the data information of the data corresponding to the data processing request, determines the first address where the first data corresponding to the backup request is stored when the data processing request is a backup request, and performs a backup operation on the first data under the first address in the relational distributed database, so as to back up the first data on all nodes of the relational distributed database to the same directory of the file system, and when the data processing request is a recovery request and the data information meets the recovery condition, restores the second data corresponding to the data processing request from the file system to a specified second address. By backing up the data of all nodes of the relational distributed database to the same location, not only can the management of the data be facilitated, but also the efficiency of data backup and recovery can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flow chart of a database management method provided by an embodiment of the present invention;

[0040] Figure 2 It is a flowchart of a method for performing a backup operation provided by an embodiment of the present invention;

[0041] Figure 3 It is a flowchart of a method for performing a recovery operation provided by an embodiment of the present invention;

[0042] Figure 4 is a flowchart of another method for performing a recovery operation provided by an embodiment of the present invention;

[0043] Figure 5 It is a structural schematic diagram of a database management device provided by an embodiment of the present invention;

[0044] Figure 6 is a structural schematic diagram of an electronic device provided by an embodiment of the present invention;

[0045] Figure 7 This is another structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.

[0047] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0048] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0049] In the related technology, Greenplum database is a relational distributed database, which includes multiple nodes and adopts a large-scale parallel processing architecture of shared-noting (a distributed computing architecture). It has the advantages of full scalability, high availability, high performance, high cost performance and resource sharing.

[0050] However, when using the Greenplum database, the machine is often shut down, the power is cut off, and the network is disconnected. When the above situations occur, the Greenplum database will have the following problems: the database cannot be used normally; the database can be used, but due to individual node failures, the hardware utilization rate of non-faulty nodes becomes high and the corresponding performance cannot be achieved.

[0051] When problems occur in the above database, the nodes will be unable to connect, resulting in data inconsistency and verification failure, and thus the inability to start each node as usual. Therefore, a database management method is urgently needed to solve the above technical problems.

[0052] In order to solve the technical problems existing in the related art, the embodiment of the present invention provides a database management method, which can be applied to the management center of a database cluster, wherein the database cluster includes a relational distributed database and a file system. For details, please refer to Figure 1 , Figure 1 1 is a flow chart of a database management method provided by an embodiment of the present invention, the method comprising steps 101 to 104;

[0053] Step 101: Obtain a data processing request of the relational distributed database, and determine data information of data corresponding to the data processing request.

[0054] In this embodiment, the data information provided in this embodiment may be summary information of the data corresponding to the data processing request, such as version information, checksum information, etc., which are used to describe the information corresponding to the data processing request. The data processing request includes a data backup request, a data recovery request, a data write request, or a data read request of the relational distributed database, etc., corresponding to executable operations of the relational distributed database.

[0055] The management center of the database cluster provided in this embodiment may be a control server of the database cluster, which is respectively connected to the relational distributed database and the file system for communication and is used to receive various data processing requests sent by the relational distributed database and the file system. Specifically, the relational distributed database provided in this embodiment may be a Greenplum database, and the file system provided in this embodiment may be a file system that can realize shared file storage, such as an NFS (Network File System) file system and an HDFS (Hadoop Distributed File System) distributed file system.

[0056] As an optional embodiment, in order to simultaneously back up the data of all nodes in the relational distributed database to a directory of the file system, the database management method provided in this embodiment may also include: creating a shared directory in the file system; configuring a client of the file system on each node in the relational distributed database so that the shared directory is mounted on each of the nodes, before obtaining the data processing request of the relational distributed database and determining the data information of the data corresponding to the data processing request.

[0057] Specifically, this embodiment can set up a file system such as an NFS server file system on an independent server, and create a shared directory as a backup storage path, while ensuring that the file system has been correctly configured and started, and can be provided to a relational distributed database, such as all nodes in a Greenplum database for access. Among them, a backup directory for a specified Greenplum database can be created under the shared directory of the NFS server file system to specifically store the backup data of the specified Greenplum database. At the same time, ensure that the backup directory has sufficient available space, and that all nodes of the specified Greenplum database can access and write backup data. Then, on each node of the relational distributed database, install and configure the NFS client so that the shared directory on the NFS server file system can be mounted, while ensuring that each node in the Greenplum database can correctly mount the NFS shared directory and have appropriate permissions to read and write backup data.

[0058] In this way, after completing the above configuration operations, the purpose of simultaneously backing up the data of all nodes in the relational distributed database to a directory in the file system can be achieved, effectively improving the efficiency of data backup and data recovery of the relational distributed database, so that when the primary node or backup node of the relational distributed database fails, the continuous availability of data in the relational distributed database can still be guaranteed.

[0059] Step 102: When the data processing request is a backup request, determine a first address of first data corresponding to the backup request in the relational distributed database.

[0060] In this embodiment, when it is determined that the data processing request of the relational distributed database is a backup request, the first address of the first data specified by the backup request in the relational distributed database may be determined according to the backup request.

[0061] In one case, the backup request usually carries the storage address specified by the requested data, in which case the first address for storing the first data can be determined directly based on the backup request; in another case, when the backup request does not carry the storage address specified by the requested data, the metadata of the first data specified by the backup request can be obtained first, and then the first address for storing the first data can be determined based on the metadata.

[0062] Step 103: Perform a backup operation on the first data at the first address in the relational distributed database according to the backup tool of the relational distributed database, so as to back up the first data to a shared directory of the file system.

[0063] In this embodiment, the backup tool provided in this embodiment may be a backup tool for the relational distributed database, such as a command tool for executing data processing. Figure 2 , Figure 2 FIG. 1 is a flow chart of a method for performing a backup operation provided by an embodiment of the present invention. Figure 2 As shown, the backup tool according to the relational distributed database provided in this embodiment performs a backup operation on the first data under the first address in the relational distributed database to back up the first data to the shared directory of the file system, which may include steps 201 to 203;

[0064] Step 201, obtaining a data processing command set corresponding to the relational distributed database.

[0065] In this embodiment, the backup tool for the relational distributed database provided in this embodiment is equivalent to the data processing command set corresponding to the relational distributed database, and the data processing command set may include data write commands, data backup commands, and other commands that can back up data. This embodiment only uses one command in the data processing command set that can back up data. The relational distributed database provided in this embodiment may be a Greenplum database. Since the Greenplum database fully supports the SQL standard, the data processing command set of the Greenplum database may use the SQL command set.

[0066] Step 202: Select a backup command capable of executing a backup operation from the data processing command set.

[0067] Step 203: Send a first processing command for the first data to the relational distributed database, so that the relational distributed database writes the first data at the first address into a shared directory of the file system based on the first processing command.

[0068] In this embodiment, by integrating the data processing command set corresponding to the relational distributed database in the management center of the database cluster, after obtaining the data processing request of the relational distributed database, it is possible to adaptively select a data processing command that matches the data processing request, and send the data processing command to the relational distributed database so that the relational distributed database can execute the data processing operation corresponding to the data processing request, thereby effectively improving the efficiency of data processing in the database cluster.

[0069] Optionally, during the backup process, you can use the backup tools provided by Greenplum Database, such as gpbackup, to perform database backup operations and store the backup data in an NFS shared directory. During the backup process, you need to ensure that all nodes in the Greenplum Database can access the NFS shared directory and that the backup data can be correctly written to the NFS shared directory.

[0070] Step 104, when the data processing request is a recovery request and the data information meets a preset recovery condition, restore the second data corresponding to the data processing request from the file system to a second address in the relational distributed database specified by the recovery request.

[0071] In this embodiment, during the recovery operation, it is necessary to determine whether to block the data processing request of the recovery operation based on the data information of the data requested by the data processing request, so as to avoid restoring erroneous data or data that affects the user experience. In one implementation, the data information provided by this embodiment may include first version information, so that based on the first version information, it can be determined whether the second data corresponding to the data processing request is the data the user wants. For details, please refer to Figure 3 , Figure 3 FIG. 1 is a flow chart of a method for performing a recovery operation provided by an embodiment of the present invention. Figure 3 As shown, the step provided in this embodiment of restoring the second data corresponding to the data processing request from the file system to the second address in the relational distributed database specified by the recovery request when the data processing request is a recovery request and the data information meets the preset recovery condition may include steps 301 to 303;

[0072] Step 301: When the data processing request is a recovery request, obtain first version information in the data information.

[0073] During the data recovery operation, since the data are all stored in the same directory of the file system, and a large amount of data, such as software packages, may have multiple software packages with the same name but different version numbers in the shared directory of the file system, if the data recovery operation of the software package is performed, it is necessary to select the version required by the user from multiple versions. Therefore, in order to improve the accuracy of data recovery, this embodiment can first obtain the first version information of the data corresponding to the data processing request when executing the recovery request, so as to facilitate the subsequent confirmation of the version information.

[0074] Step 302: Obtain second version information of second data corresponding to the recovery request in the shared directory.

[0075] In this embodiment, this embodiment can search under the shared directory based on the name of the second data corresponding to the recovery request to determine all data named as the second data, and then confirm the second version information corresponding to each data in turn to facilitate comparison with the first version information of the second data.

[0076] Step 303: When the first version information is the same as the second version information, restore the second data corresponding to the data processing request from the file system to a second address in the relational distributed database specified by the restore request.

[0077] By comparing the first version information with the second version information, it can be determined whether the data stored in the shared directory is the second data required by the user. Only when the first version information is the same as the second version information, can it be determined that the data stored in the shared directory is exactly the data required by the user. At this time, the second data corresponding to the data processing request can be restored from the file system to the second address in the relational distributed database specified by the recovery request.

[0078] Optionally, during the recovery process, this implementation can also use the recovery tools provided by the Greenplum database, such as gpprestore, to read the backup data from the NFS shared directory and restore the read backup data to the corresponding database. During the recovery process, it is necessary to ensure that all nodes in the Greenplum database can access the NFS shared directory and can correctly read the backup data in the NFS shared directory.

[0079] In some embodiments, in order to ensure the consistency and integrity of data recovery, the data information provided in this embodiment may also include first verification code information and a generation algorithm for generating the first verification code information. Figure 4 , Figure 4FIG. 1 is a flow chart of another method for performing a recovery operation provided by an embodiment of the present invention. Figure 4 As shown, the step of restoring the second data corresponding to the data processing request from the file system to the second address in the relational distributed database specified by the recovery request when the first version information is the same as the second version information provided in this embodiment may include steps 401 to 403;

[0080] Step 401: When the first version information is the same as the second version information, obtain first verification code information in the data information and a generation algorithm for generating the first verification code information.

[0081] In this embodiment, the first verification code information provided in this embodiment is mainly used to verify the consistency and integrity of the data. The generation algorithm of the first verification code information provided in this embodiment may include MD4 algorithm, MD5 algorithm, SHA algorithm, etc. As long as the algorithm can verify the integrity and consistency of the data, no specific limitation is made here.

[0082] Step 402: Calculate second verification code information of second data corresponding to the recovery request in the shared directory based on the generation algorithm.

[0083] In this embodiment, when storing data in a relational distributed database in a shared directory of a file system, it is necessary to store the verification code information of the stored data corresponding to the data when storing the data, so as to facilitate the subsequent comparison of the verification code information to verify the integrity and consistency of the data. Therefore, after obtaining the verification code generation algorithm for the data, the second verification code information of the second data corresponding to the recovery request in the shared directory can be calculated.

[0084] Optionally, the generation algorithm provided in this embodiment may include a hash algorithm, and the step of calculating the second verification code information of the second data corresponding to the recovery request in the shared directory based on the generation function provided in this embodiment may include: based on the hash algorithm, performing an integrity check on the second data corresponding to the recovery request in the shared directory, and generating second verification code information of the second data.

[0085] The hash algorithm may adopt the MD5 algorithm, which specifically generates a "character" information summary through an irreversible string transformation algorithm to check and verify the integrity and consistency of information transmission.

[0086] Step 403: When the first verification code information is the same as the second verification code information, restore the second data corresponding to the data processing request from the file system to a second address in the relational distributed database specified by the restore request.

[0087] After calculating the second verification code information of the second data corresponding to the recovery request under the shared directory, the first verification code information stored in advance during the backup can be compared to see whether it is consistent with the second verification code information. Then, if it is determined that the first verification code information and the second verification code information are consistent, it can be determined that the second data requested by the data processing request is complete and not damaged. At this time, the second data corresponding to the data processing request can be restored from the file system to the second address in the relational distributed database specified by the recovery request.

[0088] It should be noted that the recovery operation provided in this embodiment can not only restore the data under the shared directory of the file system to any address in the relational distributed database, but also restore the data under the shared directory of the file system to any device / server that is communicatively connected to the database cluster, thereby avoiding the need to continue using the relational distributed database for complex recovery operations and effectively improving the efficiency of data recovery operations.

[0089] As an optional embodiment, in order to ensure the integrity and availability of the backup data, this embodiment also requires regular testing of the backup and recovery process. Specifically, the database management method provided in this embodiment may also include: regularly testing each node in the relational distributed system at a preset time interval to obtain a test result; when the test result indicates that the target node is faulty, sending a target instruction to the relational distributed database so that the relational distributed database recovers and restarts the target node.

[0090] Among them, the preset time interval provided in this embodiment can be 24 hours, 10 hours, 1 hour, etc., and the detection can be fault detection such as data backup process detection, data recovery process detection, etc.

[0091] Specifically, when the Greenplum database is running normally, a status table will be generated. The status table is a database table such as gp_segment_configuration. The attributes of the status table include the role of the current node and the status of the current node, including whether it is faulty. The status table will display the status of each node in the table, including the port number of the current node, whether the current node is a faulty node, the role of the current node, and whether the current node is recovering. Therefore, the status of each node can be seen in the status table to detect whether the node is faulty.

[0092] In this embodiment, whether a node in the Greenplum database is faulty can be detected by detecting whether each node has data communication. The specific detection method may include using the ping command. For example, the IP address of another node may be input in any node to detect whether there is data communication. If there is a network connectivity problem between the two nodes, the ping command may be input and Enter may be pressed to view detailed connectivity problems, thereby determining the specific cause of the fault. Then, the faulty node may be restored and restarted according to the specific cause of the fault, thereby ensuring that each subsequent node can normally complete the data backup or recovery operation, thereby ensuring the availability of the Greenplum database.

[0093] The above is a detailed description of the database management method provided by the present embodiment. Through the database management method provided by the embodiment of the present invention, it is possible to store the backup data of the relational distributed database in the same path through the shared storage path provided by the file system, and to perform recovery operations when necessary, thereby effectively improving the efficiency of data backup and data recovery.

[0094] In summary, an embodiment of the present invention provides a database management method, which is applied to a management center of a database cluster, wherein the database cluster includes a relational distributed database and a file system, and the method includes obtaining a data processing request of the relational distributed database, determining data information of data corresponding to the data processing request, determining a first address where first data corresponding to the backup request is stored when the data processing request is a backup request, performing a backup operation on the first data under the first address in the relational distributed database to back up the first data to the file system, and restoring the second data corresponding to the data processing request from the file system to a specified second address when the data processing request is a recovery request and the data information meets the recovery condition. By backing up the data of all nodes of the relational distributed database to the same location, not only can the management of the data be facilitated, but also the efficiency of data backup and recovery can be improved.

[0095] According to the method described in the above embodiment, this embodiment will be further described from the perspective of a database management device. The database management device can be implemented as an independent entity or integrated into an electronic device, such as a terminal. The terminal can include a mobile phone, a tablet computer, etc.

[0096] In order to solve the same technical problem, this embodiment also provides a database management device, which is applied to the management center of a database cluster, and the database cluster includes a relational distributed database and a file system. For details, please refer to Figure 5 , Figure 5 Schematic diagram of a database management device provided by an embodiment of the present invention. Figure 5 As shown, the database management device 500 provided in the embodiment of the present invention includes: an acquisition module 501, a determination module 502, a backup module 503 and a recovery module 504;

[0097] The acquisition module 501 is used to acquire a data processing request of the relational distributed database and determine data information of data corresponding to the data processing request.

[0098] In an embodiment of the present invention, the database management device 500 provided in this embodiment may also include a creation module and a configuration module, wherein the creation module is used to create a shared directory in the file system; the configuration module is used to configure the client of the file system on each node in the relational distributed database so that the shared directory is mounted on each of the nodes.

[0099] The determination module 502 is configured to determine, when the data processing request is a backup request, a first address of first data corresponding to the backup request in the relational distributed database.

[0100] The backup module 503 is used to perform a backup operation on the first data at the first address in the relational distributed database according to the backup tool of the relational distributed database, so as to back up the first data to a shared directory of the file system.

[0101] In this embodiment, the backup module 503 provided in this embodiment is specifically used to: obtain a data processing command set corresponding to the relational distributed database; select a backup command that can execute a backup operation from the data processing command set; send a first processing command for the first data to the relational distributed database, so that the relational distributed database writes the first data under the first address to the shared directory of the file system based on the first processing command.

[0102] The recovery module 504 is used to restore the second data corresponding to the data processing request from the file system to the second address in the relational distributed database specified by the recovery request when the data processing request is a recovery request and the data information meets the preset recovery condition.

[0103] In one embodiment, the data information provided by this embodiment may include first version information. The recovery module 504 provided by this embodiment is specifically used to: when the data processing request is a recovery request, obtain the first version information in the data information; obtain the second version information of the second data corresponding to the recovery request under the shared directory; when the first version information is the same as the second version information, restore the second data corresponding to the data processing request from the file system to the second address in the relational distributed database specified by the recovery request.

[0104] In another embodiment, the data information provided by this embodiment may also include first verification code information and a generation algorithm for generating the first verification code information. The recovery module 504 provided by this embodiment is further specifically used to: when the first version information is the same as the second version information, obtain the first verification code information in the data information and the generation algorithm for generating the first verification code information; based on the generation algorithm, calculate the second verification code information of the second data corresponding to the recovery request under the shared directory; when the first verification code information is the same as the second verification code information, restore the second data corresponding to the data processing request from the file system to the second address in the relational distributed database specified by the recovery request.

[0105] Among them, the search generation algorithm provided in this embodiment may include a hash algorithm, and the recovery module 504 provided in this embodiment is specifically used to: based on the hash algorithm, perform integrity verification on the second data corresponding to the recovery request in the shared directory, and generate second verification code information of the second data.

[0106] As an optional embodiment, the database management device 500 provided in this embodiment may also include a detection module and a restart module, wherein the detection module is used to periodically detect each node in the relational distributed system at a preset time interval to obtain a detection result; the restart module is used to send a target instruction to the relational distributed database when the detection result indicates that the target node is faulty, so that the relational distributed database recovers and restarts the target node.

[0107] During specific implementation, the above modules and / or units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above modules and / or units can refer to the previous method embodiments. The specific beneficial effects that can be achieved can also refer to the beneficial effects in the previous method embodiments, which will not be repeated here.

[0108] Also, see Figure 6 , Figure 6 1 is a schematic diagram of a structure of an electronic device provided by an embodiment of the present invention, and the electronic device may be a mobile terminal such as a smart phone, a tablet computer, or the like. Figure 6 As shown, the electronic device 600 includes a processor 601 and a memory 602. The processor 601 is electrically connected to the memory 602.

[0109] The processor 601 is the control center of the electronic device 600. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device 600 and processes data by running or loading applications stored in the memory 602 and calling data stored in the memory 602, thereby monitoring the electronic device 600 as a whole.

[0110] In this embodiment, the processor 601 in the electronic device 600 will load the instructions corresponding to the processes of one or more applications into the memory 602 according to the following steps, and the processor 601 will run the application stored in the memory 602, thereby implementing any step in the database management method provided in the above embodiment.

[0111] The electronic device 600 can implement the steps in any embodiment of the database management method provided in the embodiments of the present invention, and therefore can achieve the beneficial effects that can be achieved by any database management method provided in the embodiments of the present invention. Please refer to the previous embodiments for details and will not be repeated here.

[0112] See also Figure 7 , Figure 7 is another structural schematic diagram of an electronic device provided by an embodiment of the present invention, such as Figure 7 As shown, Figure 7 The electronic device 700 is a block diagram of a specific structure of an electronic device provided in an embodiment of the present invention, and the electronic device can be used to implement the database management method provided in the above embodiment. The electronic device 700 can be a mobile terminal such as a smart phone or a laptop computer.

[0113] The RF circuit 710 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The RF circuit 710 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity module (SIM) cards, memories, etc. The RF circuit 710 can communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices through wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The above-mentioned wireless networks can use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (such as Institute of Electrical and Electronics Engineers standards IEEE 802.11a, IEEE 802.11b, IEEE802.11g and / or IEEE802.11n), Voice over Internet Protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), other protocols for email, instant messaging and short messages, and any other suitable communication protocols, even those that have not yet been developed.

[0114] The memory 720 can be used to store software programs and modules, such as the program instructions / modules corresponding to the database management method in the above-mentioned embodiment. The processor 780 executes various functional applications and manages the database by running the software programs and modules stored in the memory 720.

[0115] The memory 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 720 may further include a memory remotely arranged relative to the processor 780, and these remote memories may be connected to the electronic device 700 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0116] The input unit 730 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 730 may include a touch-sensitive surface 731 and other input devices 732. The touch-sensitive surface 731, also known as a touch display screen or touch pad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 731), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 731 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 780, and can receive and execute commands sent by the processor 780. In addition, the touch-sensitive surface 731 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 731, the input unit 730 may further include other input devices 732. Specifically, the other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0117] The display unit 740 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device 700, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 740 may include a display panel 741, and optionally, the display panel 741 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 731 may cover the display panel 741, and when the touch-sensitive surface 731 detects a touch operation on or near it, it is transmitted to the processor 780 to determine the type of the touch event, and then the processor 780 provides corresponding visual output on the display panel 741 according to the type of the touch event. Although in the figure, the touch-sensitive surface 731 and the display panel 741 are implemented as two independent components to implement input and output functions, in some embodiments, the touch-sensitive surface 731 and the display panel 741 can be integrated to implement input and output functions.

[0118] The electronic device 700 may also include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 741 according to the brightness of the ambient light, and the proximity sensor may generate an interrupt when the flip cover is closed or closed. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can also be configured in the electronic device 700, they will not be repeated here.

[0119] The audio circuit 760, the speaker 761, and the microphone 762 can provide an audio interface between the user and the electronic device 700. The audio circuit 760 can transmit the electrical signal converted from the received audio data to the speaker 761, which is converted into a sound signal for output; on the other hand, the microphone 762 converts the collected sound signal into an electrical signal, which is received by the audio circuit 760 and converted into audio data, and then the audio data is output to the processor 780 for processing, and then sent to another terminal through the RF circuit 710, or the audio data is output to the memory 720 for further processing. The audio circuit 760 may also include an earplug jack to provide communication between an external headset and the electronic device 700.

[0120] The electronic device 700 can help the user receive requests, send information, etc. through the first transmission module 770 (such as a Wi-Fi module), which provides the user with wireless broadband Internet access. Although the first transmission module 770 is shown in the figure, it is understandable that it is not a necessary component of the electronic device 700 and can be omitted as needed without changing the essence of the invention.

[0121] The processor 780 is the control center of the electronic device 700. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 720, and calling data stored in the memory 720, it executes various functions of the electronic device 700 and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 780 may include one or more processing cores; in some embodiments, the processor 780 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 780.

[0122] The electronic device 700 also includes a power supply 790 (such as a battery) for supplying power to various components. In some embodiments, the power supply can be logically connected to the processor 780 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 790 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0123] Although not shown, the electronic device 700 also includes a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the display unit of the electronic device is a touch screen display, and the mobile terminal also includes a memory, and one or more programs, wherein one or more programs are stored in the memory, and are configured to be executed by one or more processors to implement any step in the database management method provided in the above embodiment.

[0124] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation of the above modules can be found in the previous method embodiments, which will not be repeated here.

[0125] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a storage medium, which stores a plurality of instructions, and when the instructions are executed by the processor, any step in the database management method provided in the above embodiments can be implemented.

[0126] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0127] Since the instructions stored in the storage medium can execute the steps in any embodiment of the database management method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any database management method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0128] The above is a detailed introduction to a database management method, device, electronic device and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of ​​the present application. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application. Moreover, for those of ordinary skill in the art, without departing from the principles of the present invention, several improvements and modifications can be made, and these improvements and modifications are also regarded as the protection scope of the present invention.

Claims

1. A method for managing a database, characterized in that: The management center is applied to a database cluster, wherein the database cluster includes a relational distributed database and a file system, and the database management method includes: Obtaining a data processing request of the relational distributed database, and determining data information of data corresponding to the data processing request; In a case where the data processing request is a backup request, determining a first address of first data corresponding to the backup request in the relational distributed database; performing a backup operation on the first data at the first address in the relational distributed database according to a backup tool of the relational distributed database, so as to back up the first data to a shared directory of the file system; When the data processing request is a recovery request and the data information satisfies a preset recovery condition, the second data corresponding to the data processing request is restored from the file system to a second address in the relational distributed database specified by the recovery request.

2. The database management method according to claim 1, characterized in that: Before obtaining the data processing request of the relational distributed database and determining data information of data corresponding to the data processing request, the method further includes: Creating a shared directory in the file system; The client of the file system is configured on each node of the relational distributed database so that the shared directory is mounted on each node.

3. The database management method according to claim 2, characterized in that: The step of performing a backup operation on the first data at the first address in the relational distributed database according to the backup tool of the relational distributed database to back up the first data to a shared directory of the file system includes: Obtaining a data processing command set corresponding to the relational distributed database; Selecting a backup command capable of executing a backup operation from the data processing command set; A first processing command for the first data is sent to the relational distributed database, so that the relational distributed database writes the first data at the first address into a shared directory of the file system based on the first processing command.

4. The database management method according to claim 1, characterized in that: The data information includes first version information, and when the data processing request is a recovery request and the data information satisfies a preset recovery condition, restoring second data corresponding to the data processing request from the file system to a second address in the relational distributed database specified by the recovery request, including: When the data processing request is a recovery request, obtaining first version information in the data information; Obtaining second version information of second data corresponding to the recovery request in the shared directory; In a case where the first version information is identical to the second version information, the second data corresponding to the data processing request is restored from the file system to a second address in the relational distributed database specified by the restoration request.

5. The database management method according to claim 4, characterized in that: The data information also includes first verification code information and a generation algorithm for generating the first verification code information, and when the first version information is the same as the second version information, restoring the second data corresponding to the data processing request from the file system to a second address in the relational distributed database specified by the restoration request includes: When the first version information is the same as the second version information, obtaining first verification code information in the data information and a generation algorithm for generating the first verification code information; Based on the generation algorithm, calculating second verification code information of second data corresponding to the recovery request in the shared directory; In a case where the first verification code information is identical to the second verification code information, the second data corresponding to the data processing request is restored from the file system to a second address in the relational distributed database specified by the restoration request.

6. The database management method according to claim 5, characterized in that: The generation algorithm includes a hash algorithm, and the calculating, based on the generation function, second verification code information of second data corresponding to the recovery request in the shared directory includes: Based on the hash algorithm, an integrity check is performed on the second data corresponding to the recovery request in the shared directory to generate second verification code information of the second data.

7. The database management method according to claim 1, characterized in that: The method further comprises: According to a preset time interval, each node in the relational distributed system is regularly detected to obtain a detection result; In the case where the detection result indicates that there is a target node that is faulty, a target instruction is sent to the relational distributed database so that the relational distributed database recovers and restarts the target node.

8. A database management device, characterized in that: A management center applied to a database cluster, wherein the database cluster includes a relational distributed database and a file system, and the database management device includes: An acquisition module, used to acquire a data processing request of the relational distributed database and determine data information of data corresponding to the data processing request; A determination module, configured to determine, when the data processing request is a backup request, a first address of first data corresponding to the backup request in the relational distributed database; a backup module, configured to perform a backup operation on the first data at the first address in the relational distributed database according to a backup tool of the relational distributed database, so as to back up the first data to a shared directory of the file system; A recovery module is used to restore the second data corresponding to the data processing request from the file system to the second address in the relational distributed database specified by the recovery request when the data processing request is a recovery request and the data information meets the preset recovery condition.

9. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the steps in the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.