Data recovery method and device and electronic equipment
By detecting data and resource status in cloud and edge computing networks, determining the optimal recovery path, and restoring data in stages, the problem of excessively long data recovery time in disaster recovery systems is solved, achieving efficient and reliable data recovery.
Patent Information
- Application Number
- CN202511351823.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-01-06
AI Technical Summary
Existing disaster recovery systems suffer from excessively long recovery times and poor reliability when resources are limited or network fluctuations occur, resulting in data recovery tasks waiting for extended periods.
By detecting the data status in the cloud network and the resource status of the edge computing network, the optimal recovery path is determined, and the data is fragmented for dependency analysis and priority ranking. A dynamic programming algorithm is then used to perform data recovery in stages.
It enables efficient and reliable data recovery in the shortest possible time under complex network and resource constraints, reducing recovery latency by 30%-50% and improving data processing response speed and recovery efficiency.
Smart Images

Figure CN121284039A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more specifically, to a data recovery method, apparatus, and electronic device. Background Technology
[0002] In scenarios where data recovery is required due to abnormal data within a system, most disaster recovery systems employ a one-off decision-making model. This means that in the initial stages of data loss or corruption, the system makes a full recovery decision, lacking a dynamic adjustment mechanism based on real-time resource and network conditions. This static decision-making model, under resource constraints or network fluctuations, can lead to prolonged waiting times for certain data recovery tasks, thus extending the overall recovery time. Consequently, disaster recovery systems in related technologies suffer from low efficiency, exhibiting problems such as excessively long recovery times or poor recovery reliability.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides a data recovery method, apparatus, and electronic device to at least solve the technical problem of excessively long data recovery time in the process of recovering abnormal data in related technologies.
[0005] According to one aspect of the embodiments of this application, a data recovery method is provided, comprising: detecting the data status in a cloud network; acquiring abnormal data when the data status indicates that there is a data anomaly in the cloud network; acquiring the resource status of a server in an edge computing network, wherein the resource status includes the server's maximum concurrent bandwidth and remaining bandwidth; determining an optimal recovery path for data recovery of the abnormal data based on the abnormal data and the server's resource status, wherein the optimal recovery path represents the shortest time required to recover each abnormal data; and performing data recovery of the abnormal data in stages according to the optimal recovery path.
[0006] Optionally, after obtaining the abnormal data, the method further includes: dividing the abnormal data into multiple fragments and determining the dependencies between the fragments; and determining the priority of data recovery for the multiple fragments based on the dependencies.
[0007] Optionally, determining the optimal recovery path for data recovery of abnormal data includes: in the case of unrecovered shards and available servers, determining a first state variable for a first state, where the first state variable represents the first minimum cumulative recovery time when k shards have been recovered and the remaining bandwidth of the available servers is a first remaining bandwidth S, where the available servers are servers in the edge computing network whose remaining bandwidth is not zero, k is an integer, and 0≤k≤n, where n represents the number of shards, and S={s1,s2,...,s...} m}, s m Let S represent the first remaining bandwidth of available server m, where the first remaining bandwidth is greater than or equal to 0 and less than or equal to the maximum concurrent bandwidth of available server m; determine the second state variable for the second state, where the second state represents the next state after the first state, and the second state variable represents the second minimum cumulative recovery time when k+1 shards have been recovered and the remaining bandwidth of the available server is the second remaining bandwidth S', where each second remaining bandwidth is greater than or equal to 0 and less than or equal to the maximum concurrent bandwidth of the available server; determine the state transition equation based on the first and second state variables; determine the objective function based on the state transition equation, where the objective function represents minimizing the recovery time of all shards; solve the objective function to obtain the optimal recovery path.
[0008] Optionally, the state transition equation is determined by the first minimum cumulative recovery time and the first time consumed by the server to transmit fragments when transitioning from the first state variable to the second state variable.
[0009] Optionally, the first time is determined by the following methods: obtaining the third remaining bandwidth available for server transmission of the target fragment when transitioning from the first state variable to the second state variable, wherein the target fragment is a fragment that has not undergone data recovery; obtaining the fragment data volume of the target fragment; and determining the first time based on the third remaining bandwidth and the fragment data volume.
[0010] Optionally, data recovery of abnormal data is performed in stages according to the optimal recovery path, including: obtaining the first fragment to be recovered and the first dependency relationship of the first fragment, wherein the first dependency relationship is used to represent the set of other fragments required to perform data recovery on the first fragment; performing data recovery on the first fragment after all fragments in the first dependency relationship have completed data recovery; obtaining the second fragment set in the first dependency relationship that has not been recovered after some fragments in the first dependency relationship have completed data recovery; and performing data recovery on the first fragment after all fragments in the second fragment set have completed data recovery.
[0011] Optionally, after performing data recovery on the abnormal data in stages according to the optimal recovery path, the method further includes: obtaining the recovered data after the abnormal data recovery; verifying the recovered data using a checksum algorithm to obtain a first checksum; comparing the first checksum with the second checksum when backing up the original data to obtain a comparison result; determining that the data recovery process ends when the comparison result indicates that the first checksum and the second checksum are consistent; and re-performing data recovery on the abnormal data when the comparison result indicates that the first checksum and the second checksum are inconsistent.
[0012] According to another aspect of the embodiments of this application, a data recovery apparatus is also provided, comprising: a detection module, configured to detect the data status in a cloud network, and acquire abnormal data when the data status indicates that there is a data anomaly in the cloud network; an acquisition module, configured to acquire the resource status of a server in an edge computing network, wherein the resource status includes the server's maximum concurrent bandwidth and remaining bandwidth; a determination module, configured to determine the optimal recovery path for data recovery of the abnormal data based on the abnormal data and the server's resource status, wherein the optimal recovery path represents the shortest time required to recover each abnormal data; and a recovery module, configured to perform data recovery of the abnormal data in stages according to the optimal recovery path.
[0013] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory for storing program instructions; and a processor connected to the memory for executing program instructions to perform the following functions: detecting data status in a cloud network; acquiring abnormal data when the data status indicates that there is data abnormality in the cloud network; acquiring the resource status of a server in an edge computing network, wherein the resource status includes the server's maximum concurrent bandwidth and remaining bandwidth; determining an optimal recovery path for data recovery of the abnormal data based on the abnormal data and the server's resource status, wherein the optimal recovery path represents the shortest time required to recover each abnormal data; and performing data recovery of the abnormal data in stages according to the optimal recovery path.
[0014] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored computer program, wherein the device where the non-volatile storage medium is located executes the above-described data recovery method by running the computer program.
[0015] According to another aspect of the embodiments of this application, a computer program product is also provided, including computer instructions that, when executed by a processor, implement the above-described data recovery method.
[0016] In this embodiment, by detecting the data status in the cloud network, abnormal data is obtained when the data status indicates that there is data anomaly in the cloud network; the resource status of the server in the edge computing network is obtained, wherein the resource status includes the server's maximum concurrent bandwidth and remaining bandwidth; based on the abnormal data and the server's resource status, the optimal recovery path for data recovery of the abnormal data is determined, wherein the optimal recovery path is used to indicate the shortest time required to recover each abnormal data; the abnormal data is recovered in stages according to the optimal recovery path, achieving the goal of efficient and accurate data recovery, thereby realizing the technical effect of improving the response speed and recovery efficiency of data processing, and thus solving the technical problem of excessively long data recovery time in the process of data recovery of abnormal data in related technologies. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0018] Figure 1 This is a hardware structure block diagram of a computer terminal for implementing a data recovery method according to an embodiment of this application;
[0019] Figure 2 This is a flowchart of a data recovery method according to an embodiment of this application;
[0020] Figure 3 This is a structural diagram of a data recovery device according to an embodiment of this application. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0023] To address the problems existing in related technologies, this application provides a data recovery method, which can be run on... Figure 1 The computer terminal shown is explained below.
[0024] The data recovery method embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1A hardware block diagram of a computer terminal for implementing a data recovery method is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors (shown as 102a, 102b, ..., 102n in the figure) (the processor may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions connected via wired and / or wireless networks. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0025] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be implemented wholly or partially as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be wholly or partially integrated into any other element in the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as processor control (e.g., selection of a variable resistor termination path connected to an interface).
[0026] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the data recovery method in this embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned data recovery method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0027] The transmission module 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission module 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission module 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0028] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.
[0029] It should be noted here that, in some optional embodiments, the above... Figure 1 The computer terminal shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1 This is only one instance of a specific particular instance, and is intended to illustrate the types of components that may exist in the aforementioned computer terminal.
[0030] In the above operating environment, this application provides a data recovery method embodiment. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than that shown here.
[0031] Figure 2 This is a flowchart of a data recovery method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:
[0032] Step S202: Detect the data status in the cloud network. If the data status indicates that there is a data anomaly in the cloud network, obtain the abnormal data.
[0033] In step S202 above, the disaster recovery system continuously monitors the data status stored in the cloud network. This data status includes, but is not limited to, data availability, integrity, consistency, and data access and modification history. The monitoring mechanism can be implemented through periodic data scanning, real-time log analysis, or intelligent analysis of data usage patterns. The system is equipped with an anomaly detection algorithm to analyze the monitored data status information and identify data that deviates from the normal state. Causes of abnormal data include data corruption, accidental deletion, virus infection, and abnormal data access (such as frequent reading or modification). Upon detecting data anomalies, the system immediately identifies the abnormal data, for example, by adding an anomaly marker to the data's metadata or creating an anomaly data list that records all detected abnormal data and its related details (such as data location, anomaly type, and discovery time).
[0034] Step S204: Obtain the resource status of the server in the edge computing network, wherein the resource status includes the server's maximum concurrent bandwidth and remaining bandwidth.
[0035] In step S204 above, the edge computing network consists of server nodes distributed across different geographical locations. These nodes are typically closer to the data source or user, thus enabling them to provide low-latency data processing and transmission services. Server nodes can be represented in dictionary form as M{node1: J1, node2: J2, ..., nodeM: J...} M The network state of edge computing can be represented as W[W E W C R d S e→e ], where W E This indicates the status of servers in the cloud network. This represents the state of the servers in the cloud network at time t, where ej represents the server, and A ej B represents the cumulative duration of the server task queue. ej This refers to the CPU cores of the server. This represents the combined value of server CPU and memory resource utilization at time t+1. C W represents a list of states of a server cluster in an edge computing network. C ={A ec B ec}, A ec B represents the duration of the server task queue. ec This represents the peak CPU performance during the time interval t to t+1. R d R represents the list of states of the recovery queue. d ={tO i ,P i Q i}, tOi P represents the maximum latency value for task i in the intelligent disaster recovery data queue. i Q represents the computing resources required for disaster recovery data. i This indicates the amount of data required for disaster recovery cloud data restoration. e→e This indicates the bandwidth of servers in the edge computing network.
[0036] During data recovery, it's necessary to obtain the resource status of servers in the edge computing network. This resource status includes, but is not limited to, the server's maximum concurrent bandwidth and remaining bandwidth. Maximum concurrent bandwidth refers to the maximum rate at which an edge server can simultaneously process data transmissions at a specific point in time; this metric reflects the server's network communication capacity. Remaining bandwidth refers to the bandwidth resources a server can use for additional data transmission tasks under the current data transmission load. In actual data recovery, edge servers may simultaneously handle multiple tasks, including data processing, storage, and requests from other users. Therefore, the server's actual available bandwidth will be lower than its theoretical maximum concurrent bandwidth. Remaining bandwidth information reflects the server's current network resource utilization. When allocating data recovery tasks, abnormal data is transmitted to servers with sufficient bandwidth resources for data recovery, avoiding data recovery delays or failures due to insufficient bandwidth.
[0037] Step S206: Based on the abnormal data and the server's resource status, determine the optimal recovery path for data recovery of the abnormal data, where the optimal recovery path represents the shortest time required to recover each abnormal data.
[0038] In step S206 above, the system analyzes the abnormal data to determine the resource requirements and data transmission time needed to recover each data shard. Simultaneously, it collects server resource status data, including current network bandwidth, CPU utilization, and memory usage, to assess the server's service capacity and available resources. Based on the analysis results, the system uses a dynamic programming algorithm to calculate the optimal recovery path. Dynamic programming treats the entire recovery process as a series of stages, each involving a transition from the current state (number of recovered shards and remaining server resources) to the next state, aiming to find a recovery sequence that minimizes the total recovery time. In this algorithm, state transition equations are used to evaluate and calculate the optimal recovery path. These equations consider the server's maximum concurrent bandwidth, potential dependencies between shards, and the impact of data transmission time on node resources. Through continuous iteration, it seeks the shortest path to recover all abnormal data under given constraints (such as resource utilization limits and data dependency order). Determining the optimal recovery path involves not only the order of data recovery but also the resource scheduling of specific servers. The system intelligently allocates server resources based on path planning, ensuring that each data recovery task is performed on the optimal server node with the most suitable network bandwidth, thereby avoiding resource conflicts and waste and improving recovery efficiency. If there are dependencies between data shards, the system also needs to ensure that the recovery path follows the order of dependencies between shards to avoid data recovery failures or data inconsistencies caused by unmet dependencies.
[0039] It should be noted that the optimal recovery path is dynamically adjusted according to real-time changes in server resource status and network conditions, ensuring that the recovery strategy always makes the best decision based on the latest resource availability. Unlike traditional locally optimal strategies (such as greedy algorithms), dynamic programming methods strive for a globally optimal solution, and can find the recovery strategy with the shortest time required to recover all abnormal data, even under complex dependencies and resource constraints.
[0040] Step S208: Perform data recovery on the abnormal data in stages according to the optimal recovery path.
[0041] In step S208 above, the optimal recovery path is analyzed and decomposed into a series of specific recovery tasks. Each task includes the target data shard to be recovered, the server node responsible for the recovery, and the task execution priority and time window. Based on the task division results, server resources in the edge computing network are scheduled and reserved. This ensures that each recovery task has sufficient remaining bandwidth and computing power on its corresponding server node before execution, while avoiding over-allocation or uneven distribution of resources. Data recovery jobs are started one by one according to the optimized task order. At each stage, only data shards related to the current stage's task are recovered, ignoring other data that has not yet been scheduled. This approach not only accelerates the recovery of critical data but also avoids network congestion caused by processing large amounts of data simultaneously. During the recovery process, the system monitors the server's resource status and data recovery progress in real time. If changes in resource status or abnormalities in recovery task execution are detected, the recovery plan is immediately adjusted to ensure the continuity and efficiency of the data recovery process. If an unforeseen obstacle is encountered at any of the above stages, such as a sudden server crash, network connection interruption, or other resource limitations, the system will trigger an exception handling process. This may include recalculating the optimal path or temporarily adjusting the task sequence to ensure that data recovery can continue until completion.
[0042] By breaking down the recovery process into multiple stages and executing them in stages, server resources can be controlled and allocated more precisely, avoiding excessive concentration or dispersion of resources and ensuring efficient utilization of resources.
[0043] Through steps S202 to S208 described above, the goal of efficient and accurate data recovery is achieved, thereby improving the response speed and recovery efficiency of data processing. This solves the technical problem of excessively long data recovery times in related technologies for recovering abnormal data. The following is a further explanation.
[0044] In step S202 of the above data recovery method, after obtaining the abnormal data, the method further includes: dividing the abnormal data into multiple fragments and determining the dependencies between the fragments; and determining the priority of data recovery for the multiple fragments based on the dependencies.
[0045] In some embodiments of this application, the abnormal data is divided into multiple fragments, for example, split into n fragments D = {d1, d2, ..., dn}. nThis allows for the parallel recovery of these data fragments, significantly accelerating the overall data recovery time. Dependencies between shards can include predecessor-successor dependencies, data consistency dependencies, spatial location dependencies, and so on. For example, in database recovery scenarios, some tables may depend on data from other tables for correct recovery; that is, there are dependencies between these tables. In-depth analysis of the data's metadata can identify these dependencies between shards. Based on these dependencies, the priority of data recovery can be determined. Prioritizing the recovery of critical shards that do not depend on other shards or are depended upon by multiple shards can avoid deadlocks or inconsistencies during the data recovery process.
[0046] In step S206 of the above data recovery method, determining the optimal recovery path for recovering abnormal data includes: when there are unrecovered shards and available servers, determining a first state variable for a first state, where the first state variable represents the first minimum cumulative recovery time when k shards have been recovered and the remaining bandwidth of the available servers is the first remaining bandwidth S. Available servers are servers in the edge computing network whose remaining bandwidth is not zero, k is an integer, and 0 ≤ k ≤ n, where n represents the number of shards, and S = {s1, s2, ..., s...} m}, s m Let S represent the first remaining bandwidth of available server m, where the first remaining bandwidth is greater than or equal to 0 and less than or equal to the maximum concurrent bandwidth of available server m; determine the second state variable for the second state, where the second state represents the next state after the first state, and the second state variable represents the second minimum cumulative recovery time when k+1 shards have been recovered and the remaining bandwidth of the available server is the second remaining bandwidth S', where each second remaining bandwidth is greater than or equal to 0 and less than or equal to the maximum concurrent bandwidth of the available server; determine the state transition equation based on the first and second state variables; determine the objective function based on the state transition equation, where the objective function represents minimizing the recovery time of all shards; solve the objective function to obtain the optimal recovery path.
[0047] In some embodiments of this application, each of the n shards can be accessed through m available servers N = {n1, n2, ..., n} m Replication / fragment restoration in} (available on server n) j Storage of a subset of D ), n j The maximum concurrent bandwidth is S j (Unit: MB / s) The bandwidth required by the node (i.e., available server) for transmitting fragment i is s. j,i .
[0048] The first state variable can be represented as DP[k][s], defined as follows: k shards have been recovered, and the remaining bandwidth of all available servers in the current system is S = {s1, s2, ..., s}. m The minimum cumulative recovery time required to reach this state is given by s. Here, k is an integer, and 0 ≤ k ≤ n (where n is the total number of fragments). m This represents the current remaining bandwidth of server m, s m The value is limited to between 0 and the server's maximum concurrent bandwidth. The second state variable can be represented as DP[k+1][s'], indicating a transition from the first state to when k+1 shards have been recovered, and the server's remaining bandwidth is updated to S'={s′1,s′2,...,s′}. m The minimum cumulative recovery time required when the state is}. The second remaining bandwidth S' also satisfies the condition that each s' is greater than or equal to 0 and less than or equal to the maximum concurrent bandwidth of the corresponding server, reflecting the changes in server resources during data recovery. The state transition equation is used to describe how to transition from the state of recovering k fragments to the state of recovering k+1 fragments, while updating the server's remaining bandwidth. The objective function is the sum of the time taken to recover all fragments, and its goal is to find the minimum value of the time required to recover all fragments. At the beginning of the algorithm, DP[0][s] (i.e., the cumulative time when no fragments are recovered) is initialized to 0, representing the initial state of the system. Using the state transition equation, starting from k=0, the value of DP[k][s] is calculated step by step to k=n. In each step, by evaluating all possible fragment transmission options, the scheme that can lead to the shortest cumulative recovery time is selected. When all values of DP[n][s] have been calculated, that is, all fragments have been recovered, the system can reconstruct the optimal recovery path that achieves the minimum cumulative recovery time by tracing back the selection history in the DP array.
[0049] The specific process includes the following steps:
[0050] 1. Initialization: Set DP[0][s] = 0, which means that the cumulative recovery time is 0 when no data fragments are recovered;
[0051] 2. State transition calculation: Starting from k=1, for each value of k, calculate all possible values of DP[k][s]. For each k and s, find all possible combinations of shard m and server n, calculate the transition time from DP[k][s] to DP[k+1][s'], and select the minimum value;
[0052] 3. Resource status update: While calculating the transfer time, update the server's remaining bandwidth status represented by s' to ensure that server resources are correctly reflected after each transfer;
[0053] 4. Global optimization: Continue to perform the above calculations until the value of k reaches or covers all fragments. The final result DP[n][s'] will give the shortest cumulative time required to restore all fragments under the current resource state.
[0054] 5. Path Decision: Based on the records in the DP array, the system can reconstruct the optimal recovery path, that is, determine which server each shard should be restored on, and the order in which they should be restored.
[0055] Through precise calculations using dynamic programming algorithms, the optimal data recovery path can be automatically found and determined by comprehensively considering factors such as data shard size, maximum concurrent bandwidth of the server, remaining bandwidth, and dependencies between shards. This effectively avoids resource waste and data inconsistency issues during the recovery process. Furthermore, dynamic programming algorithms can adjust recovery strategies based on dynamic network changes, improving the flexibility and efficiency of disaster recovery cloud data recovery.
[0056] In the above steps, the state transition equation is determined by the first minimum cumulative recovery time and the first time consumed by the server to transmit fragments when transitioning from the first state variable to the second state variable.
[0057] In the above steps, the first time is determined in the following way: when the state variable transitions from the first state variable to the second state variable, the third remaining bandwidth available for the server to transmit the target fragment is obtained, wherein the target fragment is a fragment that has not undergone data recovery; the fragment data volume of the target fragment is obtained; and the first time is determined based on the third remaining bandwidth and the fragment data volume.
[0058] In some embodiments of this application, the state transition equation can be expressed by the following formula:
[0059] DP[k][s]→DP[k+1][s']=min{DP[k][s]+t m,n}
[0060] Among them, t m,n The formula representing the "first time" mentioned above is as follows:
[0061]
[0062] Where size(m) represents the amount of data in the target fragment m to be recovered, i.e., the size of the target fragment m, s n This represents the available transmission bandwidth that available server n can provide when transmitting target fragment m, which is the third remaining bandwidth mentioned above. When transmitting target fragment m through available server n, the remaining bandwidth of available server n is adjusted to s. n -s n,m s n,mThis refers to the bandwidth consumed when server n transmits target fragment m, while the remaining bandwidth of other available servers remains unchanged.
[0063] The following example illustrates a data recovery scenario: Assume there are three data fragments to be recovered (m1, m2, m3) and two selectable nodes (n1, n2), where n1 has an initial bandwidth of 10MB / s and n2 has an initial bandwidth of 8MB / s; the data fragment sizes are m1 = 5MB, stored only on n1; m2 = 4MB, stored on both n1 and n2; and m3 = 6MB, stored only on n2. The transmission latency and bandwidth used between each node for each fragment are calculated using the state transition equation. By continuously updating the state variables during each new round of state transitions to find the optimal data recovery path, a solution for the current data recovery task can be obtained.
[0064] In step S208 of the above data recovery method, abnormal data is recovered in stages according to the optimal recovery path, including: obtaining the first fragment to be recovered and the first dependency relationship of the first fragment, wherein the first dependency relationship is used to represent the set of other fragments required when performing data recovery on the first fragment; performing data recovery on the first fragment when all fragments in the first dependency relationship have completed data recovery; obtaining the second fragment set in the first dependency relationship that has not completed data recovery when some fragments in the first dependency relationship have completed data recovery; and performing data recovery on the first fragment when all fragments in the second fragment set have completed data recovery.
[0065] In some embodiments of this application, the next data shard to be recovered, referred to as the first shard, is identified from the optimal recovery path. The metadata of the first shard is analyzed to identify the set of other data shards that must be recovered before the first shard can be recovered, thus obtaining the dependencies of the first shard. For example, if the first shard is a table in a database, it may depend on data in other tables; these other tables are the dependencies of the first shard. Before the recovery of the first shard begins, the system checks whether all shards in the first dependency have completed data recovery. If all shards in the first dependency have completed recovery, then the first shard can begin data recovery. The system performs this operation based on the server resources allocated in the optimal path and the recovery priority. If only some shards in the first dependency have completed recovery, the system needs to identify the shards in the first dependency that have not yet been recovered, obtaining a second set of shards. By prioritizing the recovery of shards in the second set, after all shards in the second set have completed recovery, the system again checks whether the first dependency has been fully satisfied. When all dependent shards in the first dependency have completed recovery, the data recovery task of the first shard can be safely started and executed.
[0066] By following the steps above, data recovery tasks can be completed efficiently and systematically while ensuring that data dependencies are met. This not only significantly shortens the total data recovery time but also improves the controllability and reliability of the data recovery process.
[0067] In step S208 of the above data recovery method, after recovering the abnormal data in stages according to the optimal recovery path, the method further includes: obtaining the recovered data after recovering the abnormal data; verifying the recovered data using a checksum algorithm to obtain a first checksum; comparing the first checksum with the second checksum when backing up the original data to obtain a comparison result; determining that the recovery process of the recovered data ends when the comparison result indicates that the first checksum and the second checksum are consistent; and re-performing data recovery on the abnormal data when the comparison result indicates that the first checksum and the second checksum are inconsistent.
[0068] In some embodiments of this application, after each fragment completes recovery according to the optimal recovery path, the system collects all recovered data to form complete recovery data. A checksum algorithm (such as CRC32, MD5, SHA-1, or SHA-256) is used to process the recovered data to generate a unique first checksum. A second checksum is generated when the original data is backed up and stored in the disaster recovery system as an identifier of the original data state. The second checksum is also calculated from the original data using a checksum algorithm and is used for comparison after future data recovery. The first checksum is compared with the second checksum to verify whether the recovered data is completely consistent with the original data. If the first checksum matches the second checksum, it indicates that the recovered data is identical to the original data in content and structure, with no data corruption or loss, and the recovery process is considered complete. If the first checksum does not match the second checksum, it indicates that the data recovery has not met the expected quality standards, and an anomaly handling process is triggered. For example, based on the optimal recovery path or a recalculated path, a second recovery attempt is made on the problematic anomaly data.
[0069] The data recovery method using dynamic programming provided in this application can reduce recovery latency by 30%-50%. This method, based on a phased iterative calculation process, accurately selects the lowest-cost combination of shards and nodes (servers) at a given moment, and infers the remaining bandwidth of each node at each time point based on previous time series data. It then allocates resources according to the remaining bandwidth of each node at each time point, ensuring that the overall allocation rhythm matches the recovery progress. This eliminates losses caused by idle bandwidth or uneven load, ensuring maximum utilization of system resources from the algorithmic level. It possesses strong scalability, versatility, and adaptability, better adapting to the dynamic and ever-changing characteristics of disaster recovery clouds.
[0070] The dynamic programming framework of this application can dynamically adjust the dimensionality of state variables according to the amount of data that needs to be recovered (such as adjusting the values of key parameters according to the amount of data that needs to be recovered), so as to achieve adaptive recovery of data of any scale. In addition, the processing method for sharding can be any complex sharding dependency such as chain dependency or tree dependency, which can be satisfied without modifying the core logic of the algorithm. Therefore, this application can better adapt to different application scenarios and provide strong support for large-scale dynamic scenarios of disaster recovery cloud.
[0071] Figure 3 This is a structural diagram of a data recovery apparatus according to an embodiment of this application, such as... Figure 3 As shown, the device includes:
[0072] The detection module 40 is used to detect the data status in the cloud network and to obtain abnormal data when the data status indicates that there is a data anomaly in the cloud network.
[0073] The acquisition module 42 is used to acquire the resource status of the server in the edge computing network, wherein the resource status includes the server's maximum concurrent bandwidth and remaining bandwidth;
[0074] The determination module 44 is used to determine the optimal recovery path for data recovery of abnormal data based on the abnormal data and the resource status of the server. The optimal recovery path is used to indicate the shortest time required to recover data for each abnormal data.
[0075] Recovery module 46 is used to recover abnormal data in stages according to the optimal recovery path.
[0076] Through the detection module, acquisition module, determination module and recovery module in the above data recovery device, the goal of efficient and accurate data recovery is achieved, thereby realizing the technical effect of improving the response speed and recovery efficiency of data processing, and thus solving the technical problem of excessively long data recovery time in the process of recovering abnormal data in related technologies.
[0077] In the detection module of the aforementioned data recovery device, the detection module is also used to divide the abnormal data into multiple fragments and determine the dependencies between the fragments; and to determine the priority of data recovery for multiple fragments based on the dependencies.
[0078] In the determining module of the aforementioned data recovery device, the determining module is further used to determine a first state variable of a first state when there are unrecovered shards and available servers. The first state variable represents the first minimum cumulative recovery time when k shards have been recovered and the remaining bandwidth of the available servers is a first remaining bandwidth S. The available servers are servers in the edge computing network whose remaining bandwidth is not zero. k is an integer, and 0 ≤ k ≤ n, where n represents the number of shards, and S = {s1, s2, ..., s...} m}, s m Let S represent the first remaining bandwidth of available server m, where the first remaining bandwidth is greater than or equal to 0 and less than or equal to the maximum concurrent bandwidth of available server m; determine the second state variable for the second state, where the second state represents the next state after the first state, and the second state variable represents the second minimum cumulative recovery time when k+1 shards have been recovered and the remaining bandwidth of the available server is the second remaining bandwidth S', where each second remaining bandwidth is greater than or equal to 0 and less than or equal to the maximum concurrent bandwidth of the available server; determine the state transition equation based on the first and second state variables; determine the objective function based on the state transition equation, where the objective function represents minimizing the recovery time of all shards; solve the objective function to obtain the optimal recovery path.
[0079] In the determination module of the aforementioned data recovery device, the state transition equation is determined by the first minimum cumulative recovery time and the first time consumed by the server to transmit fragments when transitioning from the first state variable to the second state variable.
[0080] In the determination module of the aforementioned data recovery device, the first time is determined in the following way: when the data changes from the first state variable to the second state variable, the third remaining bandwidth available for server transmission of the target fragment is obtained, wherein the target fragment is a fragment that has not undergone data recovery; the fragment data volume of the target fragment is obtained; and the first time is determined based on the third remaining bandwidth and the fragment data volume.
[0081] In the recovery module of the aforementioned data recovery device, the recovery module is further configured to obtain a first fragment of data to be recovered, and a first dependency relationship of the first fragment, wherein the first dependency relationship represents the set of other fragments required to perform data recovery on the first fragment; if all fragments in the first dependency relationship have completed data recovery, data recovery is performed on the first fragment; if some fragments in the first dependency relationship have completed data recovery, a second set of fragments in the first dependency relationship that have not completed data recovery is obtained; if data recovery is performed on all fragments in the second set of fragments, data recovery is performed on the first fragment.
[0082] In the recovery module of the aforementioned data recovery device, the recovery module is further configured to acquire the recovered data after data recovery of the abnormal data; verify the recovered data using a checksum algorithm to obtain a first checksum; compare the first checksum with the second checksum when backing up the original data to obtain a comparison result; determine the end of the data recovery process if the comparison result indicates that the first checksum and the second checksum are consistent; and re-perform data recovery of the abnormal data if the comparison result indicates that the first checksum and the second checksum are inconsistent.
[0083] It should be noted that, Figure 3 The data recovery device shown is used to perform Figure 2 The data recovery method shown above is also applicable to this data recovery device, and will not be repeated here.
[0084] This application also provides an electronic device, which includes a memory and a processor. The memory stores program instructions, and the processor is connected to the memory and executes program instructions to perform the following functions: detecting the data status in a cloud network; acquiring abnormal data when the data status indicates that there is a data anomaly in the cloud network; acquiring the resource status of a server in an edge computing network, wherein the resource status includes the server's maximum concurrent bandwidth and remaining bandwidth; determining the optimal recovery path for data recovery of the abnormal data based on the abnormal data and the server's resource status, wherein the optimal recovery path represents the shortest time required to recover each abnormal data; and performing data recovery of the abnormal data in stages according to the optimal recovery path.
[0085] It should be noted that the aforementioned electronic equipment is used to perform Figure 2 The data recovery method shown above also applies to this electronic device, and will not be repeated here.
[0086] This application embodiment also provides a non-volatile storage medium, which includes a stored computer program. The device containing the non-volatile storage medium executes the following data recovery method by running the computer program: detecting the data status in a cloud network; if the data status indicates that there is data anomaly in the cloud network, acquiring the abnormal data; acquiring the resource status of a server in an edge computing network, wherein the resource status includes the server's maximum concurrent bandwidth and remaining bandwidth; determining the optimal recovery path for data recovery of the abnormal data based on the abnormal data and the server's resource status, wherein the optimal recovery path represents the shortest time required to recover each abnormal data; and performing data recovery of the abnormal data in stages according to the optimal recovery path.
[0087] It should be noted that the aforementioned non-volatile storage media is used for execution. Figure 2 The data recovery method shown above is also applicable to this non-volatile storage medium, and will not be repeated here.
[0088] This application also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the data recovery methods in various embodiments of this application.
[0089] This application also provides a computer program that, when executed by a processor, implements the steps of the data recovery methods in various embodiments of this application.
[0090] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0091] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0092] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0093] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0094] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0095] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0096] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A data recovery method, characterized by, The method comprises the following steps: detecting a data state in a cloud network, and acquiring abnormal data when the data state indicates that there is an abnormality in the cloud network; acquiring a resource state of a server in an edge computing network, wherein the resource state comprises maximum concurrent bandwidth and residual bandwidth of the server; determining an optimal recovery path for data recovery of the abnormal data according to the abnormal data and the resource state of the server, wherein the optimal recovery path represents that the time required for data recovery of each abnormal data is the shortest; performing data recovery on the abnormal data in stages according to the optimal recovery path.
2. The method of claim 1, wherein, After acquiring the abnormal data, the method further comprises the following steps: dividing the abnormal data into multiple shards and determining a dependency relationship between the shards; determining a priority for data recovery of the multiple shards according to the dependency relationship.
3. The method of claim 2, wherein, The method of determining the optimal recovery path for data recovery of the abnormal data comprises the following steps: In the presence of un-recovered shards and available servers, a first state variable of a first state is determined, wherein the first state variable is used to represent a first minimum cumulative recovery time when k shards have been recovered and the remaining bandwidth of available servers is a first remaining bandwidth S, the available servers are servers whose remaining bandwidth is not 0 in the edge computing network, k is an integer, and 0≤k≤n, n represents the number of shards, S={s1,s2,...,sn}, sn represents the first remaining bandwidth of the available server n, and 0≤sn≤Sm, Sm represents the maximum concurrent bandwidth of the available server m. m} and sn m represents the first remaining bandwidth of the available server m, which is greater than or equal to 0 and less than or equal to the maximum concurrent bandwidth of the available server m. determining a second state variable of a second state, wherein the second state represents a next state of the first state, the second state variable represents a second minimum cumulative recovery time when k+1 shards have been recovered and the residual bandwidth of the available server is a second residual bandwidth S', each second residual bandwidth is greater than or equal to 0 and less than or equal to the maximum concurrent bandwidth of the available server; determining a state transition equation according to the first state variable and the second state variable; determining an objective function according to the state transition equation, wherein the objective function represents that the time required for recovery of all shards is the least; solving the objective function to obtain the optimal recovery path.
4. The method of claim 3, wherein, The state transition equation is determined by the first minimum cumulative recovery time and a first time consumed by the available server for transmitting shards when the first state variable is transferred to the second state variable.
5. The method of claim 4, wherein, The first time is determined by the following steps: acquiring a third residual bandwidth of the available server for transmitting a target shard when the first state variable is transferred to the second state variable, wherein the target shard is a shard that has not been subjected to data recovery; acquiring a shard data volume of the target shard; determining the first time according to the third residual bandwidth and the shard data volume.
6. The method of claim 2, wherein, The method of performing data recovery on the abnormal data in stages according to the optimal recovery path comprises the following steps: acquiring a first shard to be subjected to data recovery and a first dependency relationship of the first shard, wherein the first dependency relationship represents a set of other shards required for performing data recovery on the first shard; performing data recovery on the first shard when all shards in the first dependency relationship have been subjected to data recovery; acquiring a second set of shards in the first dependency relationship that have not been subjected to data recovery when part of the shards in the first dependency relationship have been subjected to data recovery; performing data recovery on the first shard when all shards in the second set of shards have been subjected to data recovery.
7. The method of claim 1, wherein, After performing data recovery on the abnormal data in stages according to the optimal recovery path, the method further comprises the following steps: obtain recovery data after data recovery of the abnormal data is performed; perform a check on the recovery data by using a checksum algorithm to obtain a first checksum; compare the first checksum with a second checksum obtained when the original data is backed up to obtain a comparison result; determine that a recovery process of the recovery data is ended in a case where the comparison result indicates that the first checksum is consistent with the second checksum; re-perform data recovery on the abnormal data in a case where the comparison result indicates that the first checksum is inconsistent with the second checksum.
8. A data recovery apparatus, characterized by comprising: comprise: a detection module configured to detect a data state in a cloud network, and obtain abnormal data in a case where the data state indicates that there is data abnormality in the cloud network; an obtaining module configured to obtain a resource state of a server in an edge computing network, wherein the resource state comprises maximum concurrent bandwidth and residual bandwidth of the server; a determination module configured to determine an optimal recovery path for data recovery of the abnormal data according to the abnormal data and the resource state of the server, wherein the optimal recovery path is used to represent that a time required for data recovery of each abnormal data is the shortest; a recovery module configured to perform data recovery on the abnormal data in stages according to the optimal recovery path.
9. An electronic device, comprising: comprise: a memory configured to store program instructions; a processor connected with the memory and configured to execute the program instructions to implement the following functions: detecting a data state in a cloud network, and obtaining abnormal data in a case where the data state indicates that there is data abnormality in the cloud network; obtaining a resource state of a server in an edge computing network, wherein the resource state comprises maximum concurrent bandwidth and residual bandwidth of the server; determining an optimal recovery path for data recovery of the abnormal data according to the abnormal data and the resource state of the server, wherein the optimal recovery path is used to represent that a time required for data recovery of each abnormal data is the shortest; and performing data recovery on the abnormal data in stages according to the optimal recovery path.
10. A non-volatile storage medium, comprising: The non-volatile storage medium comprises a stored computer program, wherein a device in which the non-volatile storage medium is located performs the data recovery method in any one of claims 1 to 7 by running the computer program.
11. A computer program product comprising computer instructions, characterized in that, The computer instructions are executed by the processor to implement the data recovery method in any one of claims 1 to 7.