CN114237981A - Data recovery method, device, equipment and storage medium - Google Patents
Data recovery method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN114237981A CN114237981A CN202111508571.2A CN202111508571A CN114237981A CN 114237981 A CN114237981 A CN 114237981A CN 202111508571 A CN202111508571 A CN 202111508571A CN 114237981 A CN114237981 A CN 114237981A
- Authority
- CN
- China
- Prior art keywords
- data recovery
- node
- performance
- nodes
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000011084 recovery Methods 0.000 title claims abstract description 233
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000004590 computer program Methods 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 8
- 230000004044 response Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1469—Backup restoration techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present disclosure relates to a data recovery method, apparatus, device and storage medium, applied to a target node in a clustered database, the method comprising: acquiring a data recovery request; responding to the data recovery request, determining the performance score of the node, wherein the performance score of the node is determined according to a target performance index corresponding to a target node; receiving performance scores of other nodes sent by other nodes, wherein the performance scores of the other nodes are determined according to target performance indexes corresponding to the other nodes; and if the performance score of the node is greater than the performance scores of other nodes corresponding to all other nodes, executing a data recovery task corresponding to the data recovery request to obtain a data recovery result. According to the embodiment of the disclosure, the node executing the data recovery task may be the node with the optimal performance in the cluster database, so that the data recovery efficiency is improved, the cluster database can recover data quickly, and the user's requirement for quickly recovering data can be met.
Description
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a data recovery method, apparatus, device, and storage medium.
Background
With the advent of the big data era, the amount of data is continuously increased, so that a cluster database for storing data in a distributed manner is developed. The cluster database is composed of a plurality of nodes, each node can be used for deploying one database, and data can be stored on different nodes of the cluster database in a distributed mode.
In order to avoid loss of access data of the external client, when a node in the cluster database fails, the data stored by the failed node can be recovered by using other nodes in the cluster database. However, in the current data recovery method, data recovery is performed by using other nodes which are closest to the number of the failed node and have a number greater than the number of the failed node, and the efficiency of data recovery is often low, so that the cluster database cannot recover data quickly.
Disclosure of Invention
In order to solve the technical problem, the present disclosure provides a data recovery method, apparatus, device and storage medium.
In a first aspect, the present disclosure provides a data recovery method applied to a target node in a clustered database, the method including:
acquiring a data recovery request;
responding to the data recovery request, determining the performance score of the node, wherein the performance score of the node is determined according to a target performance index corresponding to a target node;
receiving performance scores of other nodes sent by other nodes, wherein the performance scores of the other nodes are determined according to target performance indexes corresponding to the other nodes;
and if the performance score of the node is greater than the performance scores of other nodes corresponding to all other nodes, executing a data recovery task corresponding to the data recovery request to obtain a data recovery result.
In a second aspect, the present disclosure provides a data recovery apparatus configured at a target node in a cluster database, the apparatus including:
a data recovery request acquisition module for acquiring a data recovery request;
the node performance score determining module is used for responding to the data recovery request and determining the node performance score according to a target performance index corresponding to the target node;
the other node performance score receiving module is used for receiving other node performance scores sent by other nodes, and the other node performance scores are determined according to target performance indexes corresponding to the other nodes;
and the data recovery module is used for executing a data recovery task corresponding to the data recovery request to obtain a data recovery result if the performance score of the node is greater than the performance scores of other nodes corresponding to all other nodes.
In a third aspect, an embodiment of the present disclosure further provides a data recovery device, where the data recovery device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the data recovery method provided by the first aspect.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data recovery method provided in the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the data recovery method, apparatus, device and storage medium of the embodiments of the present disclosure, when a target device in a cluster database obtains a data recovery request, may determine a performance score of the node in response to the data recovery request, receive performance scores of other nodes sent by the other nodes, perform a data recovery task corresponding to the data recovery request if the performance score of the node is greater than the performance scores of the other nodes corresponding to all the other nodes, and obtain a data recovery result, whereby each node in the database cluster may calculate the performance score based on the data recovery request, the performance score of the node may be determined according to a target performance index corresponding to the target node, and the performance scores of the other nodes may be determined according to target performance indexes corresponding to the other nodes, each node may compare the performance score of the node with the performance scores of the other nodes, therefore, the node for executing the data recovery task can be the node with the optimal performance in the cluster database, so that the data recovery efficiency is improved, the data recovery efficiency of the cluster database is improved, and the requirement of a user on rapid data recovery can be met.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a data recovery method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a database cluster according to an embodiment of the present disclosure;
fig. 3 is a logic diagram of a data recovery method according to an embodiment of the present disclosure;
fig. 4 is a schematic flow chart of another data recovery method provided in the embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a data recovery apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a data recovery device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
In order to solve the above problem, embodiments of the present disclosure provide a data recovery method, apparatus, device, and storage medium capable of determining a data recovery task for executing a data recovery task according to a performance score of a node.
Next, a data recovery method provided by an embodiment of the present disclosure is first described with reference to fig. 1 to 4.
Fig. 1 shows a flowchart of a data recovery method provided by an embodiment of the present disclosure.
In some embodiments of the present disclosure, the data recovery method illustrated in fig. 1 may be performed by a target node in a clustered database. Wherein the target node may be any one of the clustered databases.
As shown in fig. 1, the data recovery method may include the following steps.
And S110, acquiring a data recovery request.
In the embodiment of the present disclosure, when the target device accesses the cluster database, if the current node accessed by the target device fails, the current node cannot store the access data of the target device, and in order to avoid the loss of the access data of the target device, the cluster database needs to recover the access data of the target device by using other nodes, so that each node in the cluster database may receive a data recovery request and perform a data recovery task corresponding to the data access request in response to the data recovery request.
In the embodiment of the present disclosure, the data access request may be a request issued by a cluster management platform of the cluster server to start a target node to perform a data recovery task.
In the embodiments of the present disclosure, the data recovery request may carry a data recovery task.
Optionally, the data recovery task may include access data of the target device.
In the present disclosure is an embodiment, the target device may be any electronic device capable of executing a data access function.
And S120, responding to the data recovery request, and determining the performance score of the node, wherein the performance score of the node is determined according to the target performance index corresponding to the target node.
In the embodiment of the present disclosure, after each node in the cluster database acquires the data recovery request, for the target node, the target node may calculate the performance score of the node according to the target performance index corresponding to the target node.
In the embodiment of the present disclosure, the target performance index may include a server resource where the target node is located and a current state.
Optionally, the target performance index may include data such as the number of server processes, the speed of a processor, the idle time of the processor, the size of a memory, the idle size, the idle status of a work queue of a database instance in a node, and the like.
In this disclosure, the performance score of the node may be an evaluation index used to determine whether to perform a data recovery task corresponding to the data recovery request by using the node.
And S130, receiving performance scores of other nodes sent by the other nodes, wherein the performance scores of the other nodes are determined according to target performance indexes corresponding to the other nodes.
In the embodiment of the present disclosure, after each node in the cluster database acquires the data recovery request, for other nodes, the other nodes may also calculate performance scores of the other nodes according to target performance indexes corresponding to the other nodes, and each node may mutually transmit the calculated performance scores, so that the target node may receive the performance scores of the other nodes sent by the other nodes.
In this embodiment of the present disclosure, the performance score of the other node may be an evaluation index used to determine whether to perform a data recovery task corresponding to the data recovery request by using the other node.
And S140, if the performance score of the node is greater than the performance scores of other nodes corresponding to all other nodes, executing a data recovery task corresponding to the data recovery request to obtain a data recovery result.
In this embodiment of the present disclosure, after the target node calculates the performance score of the node and obtains the performance scores of other nodes corresponding to all other nodes, the performance score of the node may be compared with the performance scores of other nodes corresponding to all other nodes, and if the performance score of the node is greater than the performance scores of other nodes corresponding to all other nodes, the target node executes a data recovery task corresponding to the data recovery request, so as to obtain a data recovery result.
Specifically, the target node can recover and store the access data of the target device corresponding to the data recovery task, so that the access data of the target device can be recovered by the target device when the current node in the database cluster fails, and data loss is avoided.
In the disclosed embodiment, the data recovery result may be a result that the access data of the target device has been recovered and stored on the target node.
Fig. 2 shows a schematic structural diagram of a database cluster provided in an embodiment of the present disclosure.
As shown in FIG. 2, the database cluster includes a shared storage area. The shared storage area comprises three nodes which are a first node, a second node and a third node respectively, and each node comprises a database module and a performance collection module. The database module may include a database and an instance, and the performance collection module may store a performance index corresponding to the node.
Specifically, the database module may obtain the performance index of the node from the performance collection module, and the performance collection module may obtain the database and the instance of the node from the database module. Moreover, the performance collection module in any node can transmit the performance index of the node and the calculated node performance score to the performance collection modules of other nodes, so that each node can obtain the performance index and the node performance score of other nodes.
Further, after S140, the method further includes the steps of:
receiving an access request sent by target equipment;
and responding to the access request, and feeding back target data corresponding to the access request to the target equipment.
In the disclosed embodiments, the data access task may be performed after the target node performs the data recovery task. Specifically, the access request sent by the target device may be received, and in response to the access request, target data corresponding to the access request may be queried, and the target data may be fed back to the target device.
Wherein the access request may be a request for accessing the target data.
It should be noted that, when the target node executes the data recovery task, the target node cannot provide the data access task, and the database cluster may execute the data access task through other nodes.
In the embodiment of the disclosure, when a target device in the cluster database acquires a data recovery request, the node performance score may be determined in response to the data recovery request, the other node performance scores sent by other nodes may be received, if the node performance score is greater than the other node performance scores corresponding to all other nodes, a data recovery task corresponding to the data recovery request may be executed, and a data recovery result may be obtained, so that each node in the database cluster may calculate a performance score based on the data recovery request, the node performance score may be determined according to a target performance index corresponding to the target node, and the other node performance scores may be determined according to target performance indexes corresponding to other nodes, each node may compare the node performance score with the other node performance scores, so that the cluster database may select a node with the largest performance score to execute the data recovery task, therefore, the node executing the data recovery task can be the node with the optimal performance in the cluster database, so that the data recovery efficiency is improved, the data recovery efficiency of the cluster database is improved, and the requirement of a user on rapid data recovery can be met.
In another embodiment of the present disclosure, the node performance score may be calculated in different manners.
In this embodiment of the present disclosure, for S110, the data recovery request is sent by the cluster management platform corresponding to the cluster database when detecting the node failure.
Specifically, the cluster management platform corresponding to the cluster database may detect whether a node fails in real time, and if a node failure is detected, generate a data recovery request and issue the data recovery request to each node of the cluster database, so that each node can obtain the data recovery request.
In the embodiment of the present disclosure, the target node may calculate the performance score of the node in different manners.
In some embodiments, S120 may specifically include the following steps:
s1201, obtaining various target performance indexes;
s1202, the target performance indexes are subjected to weighted summation to obtain the performance score of the node.
Specifically, the target node may obtain the performance index corresponding to the node from the corresponding performance collection module, that is, obtain the target performance index, and perform weighted summation on the target performance indexes according to the weight corresponding to each target performance index to obtain the performance score of the node.
In other embodiments, S120 may specifically include the following steps:
s1203, obtaining various target performance indexes;
s1204, calculating the performance difference between each target performance index and the performance standard value corresponding to the target performance index;
and S1205, carrying out weighted summation on the performance difference corresponding to each target performance index to obtain the performance score of the node.
Wherein, the performance standard value may be a reference value of performance set in advance as required.
Specifically, the target node may obtain the performance index corresponding to the node from the corresponding performance collection module, that is, obtain the target performance index, calculate the performance difference between each target performance index and the performance standard value corresponding to the target performance index, and perform weighted summation on the performance differences according to the weight of the performance difference corresponding to each target performance index to obtain the performance score of the node.
In the embodiments of the present disclosure, other nodes may calculate other node performance scores in different manners.
In some embodiments, the other node performance scores are determined by the other nodes by weighted summation according to the corresponding multiple target performance indicators.
In other embodiments, the performance scores of the other nodes are determined by performing weighted summation on the other nodes according to the performance differences corresponding to the multiple corresponding target performance indexes.
It should be noted that the way of calculating the performance scores of other nodes is the same as the way of calculating the performance scores of the node, and details are not described herein.
Therefore, in the embodiment of the disclosure, different modes can be adopted to calculate the performance score of the node, and the calculation flexibility of the performance score of the node is improved.
Fig. 3 illustrates a logic diagram of a data recovery method according to an embodiment of the present disclosure. The above process is specifically explained in conjunction with fig. 3.
As shown in fig. 3, the data recovery method may specifically include the following steps:
s310, the cluster management platform detects that a fault node exists in the cluster database.
In this disclosure, the cluster management platform may detect a state value of each node in the cluster database in real time, and determine that a failed node exists in the cluster database if the state value of one of the nodes is a failure value.
Wherein the failure value may be a pre-stored failure detection criterion used to determine whether a node has failed.
S320, the cluster management platform sends a data recovery request to each node in the cluster database.
In the embodiment of the present disclosure, when the cluster management platform detects that a faulty node exists in the cluster database, a data recovery request may be sent to each node in the cluster database, so that each node calculates a performance score of the node based on the data recovery request.
In embodiments of the present disclosure, the data recovery request may include a failure notification instruction and a performance score calculation request.
And the fault notification instruction is used for notifying the node fault detection result to each node in the cluster database.
The performance score calculation request can be used for requesting each node to calculate the performance score of the node.
S330, the target node responds to the data recovery request, and the performance score of the node is determined according to the target performance index corresponding to the target node.
S340, the target node receives the performance scores of other nodes sent by other nodes, and the performance scores of other nodes are determined according to target performance indexes corresponding to other nodes.
S330 to S340 are similar to S120 to S130, and are not described herein.
S350, the target node determines whether the performance score of the node is larger than the performance scores of other nodes corresponding to all other nodes.
In this embodiment, the target node may compare the performance score of the node with the performance scores of other nodes to determine whether the performance score of the node is greater than the performance scores of other nodes corresponding to all other nodes.
And S360, if the target node determines that the performance score of the node is larger than the performance scores of other nodes corresponding to all other nodes, executing a data recovery task corresponding to the data recovery request, and obtaining a data recovery result.
S360 is similar to S140, and is not described herein.
In yet another embodiment of the present disclosure, each node may also determine whether to perform a data recovery task based on a performance score threshold and a performance score.
Fig. 4 shows a schematic flow chart of another data recovery method provided by the embodiment of the present disclosure.
As shown in fig. 4, the data recovery method may specifically include the following steps:
and S410, acquiring a data recovery request.
And S420, responding to the data recovery request, and determining the performance score of the node, wherein the performance score of the node is determined according to the target performance index corresponding to the target node.
And S430, receiving the performance scores of other nodes sent by other nodes, wherein the performance scores of other nodes are determined according to target performance indexes corresponding to other nodes.
And S440, if the performance score of the node is larger than the performance scores of other nodes corresponding to all other nodes, executing a data recovery task corresponding to the data recovery request to obtain a data recovery result.
S410 to S440 are similar to S110 to S140, and are not described herein.
And S450, if the performance score of the node is larger than the preset performance score threshold, executing a data recovery task corresponding to the data recovery request to obtain a data recovery result.
In this disclosure, each node in the cluster database may compare the calculated performance score with a preset performance score threshold, and if the performance score of the node is greater than the preset performance score threshold, perform a data recovery task corresponding to the data recovery request.
In this embodiment of the present disclosure, the preset performance score threshold may be a performance score preset as needed to determine whether to execute a data recovery task corresponding to a data recovery request by the node.
Therefore, in the embodiment of the present disclosure, if the node determines that the performance score of the node is greater than the preset performance score threshold, the node executes the data recovery task corresponding to the data recovery request without comparing the performance score of the node with performance scores of other nodes calculated by other nodes, so as to reduce the processes of transmitting and determining the performance value, and reduce the number of interactions between nodes.
And S460, if the performance score of the node is greater than the preset performance score threshold value and the performance scores of other nodes are greater than the preset performance score threshold value, determining whether the data recovery task corresponding to the data recovery request is detected.
In this disclosure, each node in the cluster database may compare the calculated performance score with a preset performance score threshold, receive performance scores of other nodes sent by other nodes, and compare the performance scores of other nodes with the preset performance score threshold, if the performance score of the node is greater than the preset performance score threshold and the performance scores of other nodes are greater than the preset performance score threshold, the cluster management platform sends a data recovery task corresponding to the data recovery request to the cluster database, and each node needs to detect whether to detect the data recovery task corresponding to the data recovery request, so that each node has an authority to execute the data recovery task corresponding to the data recovery request.
And S470, if the data recovery task corresponding to the data recovery request is detected, executing the data recovery task corresponding to the data recovery request to obtain a data recovery result.
In this embodiment of the present disclosure, if the node detects a data recovery task corresponding to the data recovery request, the node executes the data recovery task corresponding to the data recovery request to obtain a data recovery result.
Therefore, in the embodiment of the present disclosure, each node may set a performance score threshold, compare the performance score of the node and the performance scores of other nodes with a preset performance score threshold, if the performance score of the node and the performance scores of other nodes are greater than the preset performance score threshold, each node may detect a data recovery task corresponding to the data recovery request, and execute the data recovery task by the node that detects the data recovery task, so as to obtain a data recovery result, thereby improving the accuracy of the data recovery process.
In summary, the node executing the data recovery task may be determined only according to the performance score threshold and the performance score, and does not need to compare with performance scores of other nodes calculated by other nodes, so as to reduce the number of interactions between nodes, and the node executing the data recovery task may also be determined according to the performance score of other nodes, the performance score of the node, and the performance score threshold, so as to improve the flexibility of the data recovery method.
The embodiment of the present disclosure further provides a data recovery apparatus for implementing the foregoing data recovery apparatus, which is described below with reference to fig. 5. In the disclosed embodiment, the data recovery apparatus may be configured to a target node in the cluster database.
Fig. 5 shows a schematic structural diagram of a data recovery apparatus according to an embodiment of the present disclosure.
As shown in fig. 5, the data recovery apparatus 500 may include: a data recovery request acquisition module 510, a local node performance score determination module 520, an other node performance score receiving module 530 and a data recovery module 540.
A data recovery request obtaining module 510, configured to obtain a data recovery request;
the node performance score determining module 520 is configured to determine a node performance score in response to the data recovery request, where the node performance score is determined according to a target performance index corresponding to a target node;
the other node performance score receiving module 530 is configured to receive other node performance scores sent by other nodes, where the other node performance scores are determined according to target performance indexes corresponding to the other nodes;
and the data recovery module 540 is configured to, if the performance score of the node is greater than the performance scores of the other nodes corresponding to all the other nodes, execute a data recovery task corresponding to the data recovery request, and obtain a data recovery result.
In the embodiment of the disclosure, when a target device in the cluster database acquires a data recovery request, the node performance score may be determined in response to the data recovery request, the other node performance scores sent by other nodes may be received, if the node performance score is greater than the other node performance scores corresponding to all other nodes, a data recovery task corresponding to the data recovery request may be executed, and a data recovery result may be obtained, so that each node in the database cluster may calculate a performance score based on the data recovery request, the node performance score may be determined according to a target performance index corresponding to the target node, and the other node performance scores may be determined according to target performance indexes corresponding to other nodes, each node may compare the node performance score with the other node performance scores, so that the cluster database may select a node with the largest performance score to execute the data recovery task, therefore, the node executing the data recovery task can be the node with the optimal performance in the cluster database, so that the data recovery efficiency is improved, the data recovery efficiency of the cluster database is improved, and the requirement of a user on rapid data recovery can be met.
In some embodiments of the present disclosure, the node performance score determining module 520 may include:
a target performance index obtaining unit, which can be used for obtaining various target performance indexes;
the node performance score determining unit can be used for weighting and summing the target performance indexes to obtain the node performance score.
In some embodiments of the present disclosure, the performance scores of the other nodes are determined by performing a weighted summation by the other nodes according to the corresponding multiple target performance indicators.
In some embodiments of the present disclosure, the apparatus may further include:
the first data recovery task execution module may be configured to execute a data recovery task corresponding to the data recovery request to obtain a data recovery result if the performance score of the node is greater than a preset performance score threshold.
In some embodiments of the present disclosure, the apparatus may further include:
the data recovery task detection module may be configured to determine whether a data recovery task corresponding to the data recovery request is detected if the performance score of the node is greater than the preset performance score threshold and the performance scores of the other nodes are greater than the preset performance score threshold;
the second data recovery task execution module may be configured to execute the data recovery task corresponding to the data recovery request to obtain a data recovery result if the data recovery task corresponding to the data recovery request is detected.
In some embodiments of the present disclosure, the data recovery request is sent by a cluster management platform corresponding to the cluster database when a node failure is detected.
In some embodiments of the present disclosure, the apparatus may further include:
the access request receiving module can be used for receiving an access request sent by target equipment;
and the target data feedback module can be used for responding to the access request and feeding back target data corresponding to the access request to the target equipment.
It should be noted that the data recovery apparatus 500 shown in fig. 5 may perform each step in the method embodiment shown in fig. 1 to 4, and implement each process and effect in the method embodiment shown in fig. 1 to 4, which are not described herein again.
Fig. 6 shows a schematic structural diagram of a data recovery device according to an embodiment of the present disclosure. The data recovery device may be a target node in the clustered database.
As shown in fig. 6, the data recovery device may include a processor 601 and a memory 602 storing computer program instructions.
Specifically, the processor 601 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
The processor 601 executes the steps of the data recovery method provided by the embodiments of the present disclosure by reading and executing the computer program instructions stored in the memory 602.
In one example, the data recovery device may also include a transceiver 603 and a bus 604. As shown in fig. 6, the processor 601, the memory 602, and the transceiver 603 are connected via a bus 604 and communicate with each other.
The following is an embodiment of a computer-readable storage medium provided in an embodiment of the present disclosure, the computer-readable storage medium and the video segmentation method in the foregoing embodiments belong to the same inventive concept, and details that are not described in detail in the embodiment of the computer-readable storage medium may refer to the embodiment of the data recovery method.
The present embodiments provide a storage medium containing computer-executable instructions which, when executed by a computer processor, are operable to perform a data recovery method for a target node in a clustered database, the method comprising:
acquiring a data recovery request;
responding to the data recovery request, determining the performance score of the node, wherein the performance score of the node is determined according to a target performance index corresponding to a target node;
receiving performance scores of other nodes sent by other nodes, wherein the performance scores of the other nodes are determined according to target performance indexes corresponding to the other nodes;
and if the performance score of the node is greater than the performance scores of other nodes corresponding to all other nodes, executing a data recovery task corresponding to the data recovery request to obtain a data recovery result.
Of course, the storage medium provided by the embodiments of the present disclosure contains computer-executable instructions, and the computer-executable instructions are not limited to the above method operations, and may also perform related operations in the data recovery method provided by any embodiments of the present disclosure.
From the above description of the embodiments, it is obvious for a person skilled in the art that the present disclosure can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present disclosure may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk, or an optical disk of a computer, and includes several instructions to enable a computer cloud platform (which may be a personal computer, a server, or a network cloud platform, etc.) to execute the data recovery method provided in the embodiments of the present disclosure.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will appreciate that the present disclosure is not limited to the specific embodiments illustrated herein and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the present disclosure. Therefore, although the present disclosure has been described in greater detail with reference to the above embodiments, the present disclosure is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present disclosure, the scope of which is determined by the scope of the appended claims.
Claims (10)
1. A data recovery method applied to a target node in a clustered database, the method comprising:
acquiring a data recovery request;
responding to the data recovery request, and determining the performance score of the node, wherein the performance score of the node is determined according to a target performance index corresponding to the target node;
receiving performance scores of other nodes sent by other nodes, wherein the performance scores of the other nodes are determined according to target performance indexes corresponding to the other nodes;
and if the performance score of the node is greater than the performance scores of other nodes corresponding to all the other nodes, executing a data recovery task corresponding to the data recovery request to obtain a data recovery result.
2. The method of claim 1, wherein determining the performance score of the node comprises:
obtaining a plurality of target performance indexes;
and carrying out weighted summation on the target performance indexes to obtain the performance score of the node.
3. The method of claim 1, wherein the other node performance score is determined by the other node by a weighted sum of the corresponding plurality of target performance metrics.
4. The method of claim 1, wherein after said determining the performance score of the local node, the method further comprises:
and if the performance score of the node is greater than a preset performance score threshold value, executing a data recovery task corresponding to the data recovery request to obtain a data recovery result.
5. The method of claim 1, wherein after said determining the performance score of the local node, the method further comprises:
if the performance score of the node is larger than a preset performance score threshold value, and the performance scores of other nodes are larger than the preset performance score threshold value, determining whether a data recovery task corresponding to the data recovery request is detected;
and if the data recovery task corresponding to the data recovery request is detected, executing the data recovery task corresponding to the data recovery request to obtain the data recovery result.
6. The method of claim 1, wherein the data recovery request is sent by a corresponding cluster management platform of the clustered database upon detecting a node failure.
7. The method according to claim 1, wherein after the recovering the target data corresponding to the data recovery request, the method further comprises:
receiving an access request sent by target equipment;
and responding to the access request, and feeding back target data corresponding to the access request to the target equipment.
8. A data recovery apparatus, configured to a target node in a clustered database, the apparatus comprising:
a data recovery request acquisition module for acquiring a data recovery request;
the node performance score determining module is used for responding to the data recovery request and determining the node performance score, and the node performance score is determined according to a target performance index corresponding to the target node;
the other node performance score receiving module is used for receiving other node performance scores sent by other nodes, and the other node performance scores are determined according to target performance indexes corresponding to the other nodes;
and the data recovery module is used for executing a data recovery task corresponding to the data recovery request to obtain a data recovery result if the performance score of the node is greater than the performance scores of other nodes corresponding to all the other nodes.
9. A data recovery apparatus, comprising:
a processor;
a memory for storing executable instructions;
wherein the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the data recovery method of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the storage medium stores the computer program, which, when executed by a processor, causes the processor to carry out the data recovery method of any of the preceding claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111508571.2A CN114237981A (en) | 2021-12-10 | 2021-12-10 | Data recovery method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111508571.2A CN114237981A (en) | 2021-12-10 | 2021-12-10 | Data recovery method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114237981A true CN114237981A (en) | 2022-03-25 |
Family
ID=80754681
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111508571.2A Pending CN114237981A (en) | 2021-12-10 | 2021-12-10 | Data recovery method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114237981A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115437843A (en) * | 2022-08-25 | 2022-12-06 | 北京万里开源软件有限公司 | Database storage partition recovery method based on multi-level distributed consensus |
-
2021
- 2021-12-10 CN CN202111508571.2A patent/CN114237981A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115437843A (en) * | 2022-08-25 | 2022-12-06 | 北京万里开源软件有限公司 | Database storage partition recovery method based on multi-level distributed consensus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109587008B (en) | Method, device and storage medium for detecting abnormal flow data | |
CN111641621B (en) | Internet of things security event identification method and device and computer equipment | |
US10275682B2 (en) | Information processing apparatus, information processing method, and storage medium | |
CN110162270B (en) | Data storage method, storage node and medium based on distributed storage system | |
JP7040104B2 (en) | Learning programs, learning methods and learning devices | |
CN108596079B (en) | Gesture recognition method and device and electronic equipment | |
CN109325548B (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN112905333A (en) | Computing load scheduling method and device for distributed video intelligent analysis platform | |
CN113657249B (en) | Training method, prediction method, device, electronic equipment and storage medium | |
CN111104438A (en) | Method and device for determining periodicity of time sequence and electronic equipment | |
CN114237981A (en) | Data recovery method, device, equipment and storage medium | |
CN110135326B (en) | Identity authentication method, electronic equipment and computer readable storage medium | |
JP2017117449A (en) | Data flow programming of computing apparatus with vector estimation-based graph partitioning | |
CN114398521B (en) | Device type determining method and data processing system for acquiring abnormal device | |
CN110728306B (en) | Target parameter selection method in reverse proxy evaluation model and related device | |
CN112532455A (en) | Abnormal root cause positioning method and device | |
CN112596985B (en) | IT asset detection method, device, equipment and medium | |
CN111476668B (en) | Identification method and device of credible relationship, storage medium and computer equipment | |
CN113656354A (en) | Log classification method, system, computer device and readable storage medium | |
CN114116688B (en) | Data processing and quality inspection method and device and readable storage medium | |
CN116824707A (en) | Signature verification method, device, equipment, storage medium and product | |
CN111833232A (en) | Image processing device | |
CN111694588B (en) | Engine upgrade detection method and device, computer equipment and readable storage medium | |
CN114265813A (en) | Snapshot query method, device, equipment and storage medium | |
CN110035392B (en) | Method and device for identifying whether equipment is located in target area or not and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Country or region after: China Address after: 100102 201, 2 / F, 101, No. 5 building, No. 7 Rongda Road, Chaoyang District, Beijing Applicant after: China Electronics Technology Group Jincang (Beijing) Technology Co.,Ltd. Address before: 100102 201, 2 / F, 101, No. 5 building, No. 7 Rongda Road, Chaoyang District, Beijing Applicant before: BEIJING KINGBASE INFORMATION TECHNOLOGIES Inc. Country or region before: China |
|
CB02 | Change of applicant information |