Method, apparatus, device, medium and program product for performing data recovery task
Patent Information
- Application Number
- CN202611396190.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-09
- Publication Date
- 2026-10-30
AI Technical Summary
相关技术需要人工介入完成恢复任务甄别、恢复环境筛选与配置等工作,操作人员需要核查多台备份服务器资源情况,手工搭建适配的恢复环境,再执行数据恢复以及后续环境处置流程,以此完成文件、数据库等类型数据的恢复处理,数据恢复任务的执行效率有待提升
Smart Images

Figure CN123011609A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of big data and distributed technology, specifically to data recovery technology, and more specifically to a method, apparatus, device, medium, and program product for performing a data recovery task. Background Technology
[0002] Data backup and recovery is a crucial technical means to ensure the security of business data. During the operation of business systems, when situations such as accidental data deletion or system failure occur, corresponding data recovery tasks need to be initiated to restore the backup data using a recovery environment. This process requires manual intervention to identify recovery tasks, select and configure the recovery environment, and perform other tasks. Operators need to verify the resources of multiple backup servers, manually build a suitable recovery environment, and then execute data recovery and subsequent environment handling procedures to recover files, databases, and other types of data. Therefore, the efficiency of data recovery task execution needs improvement. Summary of the Invention
[0003] In view of the above problems, embodiments of this application provide a method, apparatus, device, medium, and program product for performing data recovery tasks.
[0004] According to a first aspect of this application, a method for executing a data recovery task is provided, comprising: determining a target recovery task to be executed based on task status information of multiple data recovery tasks; determining at least one candidate recovery environment matching the target recovery task from multiple available recovery environments based on task characteristic information of the target recovery task and environmental characteristic information of each of the multiple available recovery environments; sorting the at least one candidate recovery environment according to a preset sorting strategy, and determining a target recovery environment adapted to the target recovery task based on the sorting result; and executing the target recovery task using the target recovery environment.
[0005] According to embodiments of this application, based on the task characteristic information of the target recovery task and the resource characteristic information of each of the multiple available recovery environments, determining at least one candidate recovery environment that matches the target recovery task from the multiple available recovery environments includes: obtaining the resource requirements of the target recovery task, and determining at least one candidate recovery environment that meets the resource requirements from the multiple available recovery environments based on the resource characteristic information of each of the multiple available recovery environments; and / or determining at least one candidate recovery environment that matches the target recovery task based on the environmental health status of the multiple available recovery environments.
[0006] According to an embodiment of this application, the resource requirements of the target recovery task are obtained, and at least one candidate recovery environment that meets the resource requirements is determined from the multiple available recovery environments based on the resource characteristic information of each of the multiple available recovery environments. This includes: determining an available recovery environment as a candidate recovery environment in response to the storage space size, recovery environment type, and database instance version of the available recovery environment meeting the resource requirements. In the case that a data recovery task has been performed in the available recovery environment, the resource characteristic information includes at least one of the storage space size, recovery environment type, or database instance version.
[0007] According to an embodiment of this application, determining at least one candidate recovery environment that matches a target recovery task based on the environmental health status of multiple available recovery environments includes: determining the environmental health status of the available recovery environment according to at least one of the storage unit characteristics, environmental purity characteristics, task recovery success rate characteristics, and system load characteristics of the available recovery environment, and in accordance with a preset evaluation rule; and determining the available recovery environment as a candidate recovery environment in response to the environmental health status of the available recovery environment meeting a health status threshold.
[0008] According to an embodiment of this application, the method further includes: performing an environment repair operation on the available recovery environment when the environmental health level of the available recovery environment does not meet the health level threshold; and marking the available recovery environment as unavailable in response to the cumulative number of times the environment repair operation is performed reaching a preset target number.
[0009] According to an embodiment of this application, after performing a target recovery task using the target recovery environment, the method further includes: performing an environment cleanup operation on the target recovery environment to obtain a cleaned recovery environment; obtaining an environment health score of the cleaned recovery environment based on the resource characteristic information of the cleaned recovery environment and according to a preset scoring rule; and, in response to the environment health score of the cleaned recovery environment meeting the preset health score conditions, designating the cleaned recovery environment as a usable recovery environment.
[0010] According to an embodiment of this application, performing a target recovery task using a target recovery environment includes: when task feature information indicates that the target recovery task is a file recovery task, mounting a snapshot of the target backup file to the target address of the target recovery environment in read-only mode; and performing file recovery using the snapshot of the target backup file to complete the target recovery task.
[0011] According to an embodiment of this application, performing a target recovery task using a target recovery environment includes: when the task feature information indicates that the target recovery task is a database recovery task, creating a target database instance in the target recovery environment according to a preset database template; mounting the snapshot corresponding to the target backup file to the data directory of the target database instance; and calling a recovery script that matches the target database instance to perform data restoration on the target database instance based on the snapshot, so as to complete the target recovery task.
[0012] According to a second aspect of this application, an execution apparatus for a data recovery task is provided, comprising: a task determination module, configured to determine a target recovery task to be executed based on task status information of multiple data recovery tasks; a candidate recovery environment determination module, configured to determine at least one candidate recovery environment matching the target recovery task from multiple available recovery environments based on task feature information of the target recovery task and environment feature information of each of the multiple available recovery environments; a target recovery environment determination module, configured to sort the at least one candidate recovery environment according to a preset sorting strategy, and determine a target recovery environment suitable for the target recovery task based on the sorting result; and a recovery execution module, configured to execute the target recovery task using the target recovery environment.
[0013] According to a third aspect of this application, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0014] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.
[0015] According to a fifth aspect of this application, a computer program product is also provided, comprising a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description
[0016] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0017] Figure 1 The illustration schematically depicts an application scenario of a data recovery task execution method, apparatus, device, medium, and program product according to embodiments of this application;
[0018] Figure 2 The flowchart illustrating an execution method for a data recovery task according to an embodiment of this application is shown schematically.
[0019] Figure 3 A flowchart illustrating a second data recovery task execution method according to an embodiment of this application is shown schematically.
[0020] Figure 4 A flowchart illustrating a third data recovery task execution method according to an embodiment of this application is shown schematically.
[0021] Figure 5 This schematically illustrates a state transition diagram of a recovery environment according to an embodiment of this application;
[0022] Figure 6 This illustration schematically depicts a component architecture diagram for performing a data recovery task according to an embodiment of this application;
[0023] Figure 7 This schematic diagram illustrates a structural block diagram of an execution apparatus for a data recovery task according to an embodiment of this application;
[0024] Figure 8 A block diagram of an electronic device suitable for implementing a data recovery task according to an embodiment of this application is shown schematically. Detailed Implementation
[0025] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0028] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0029] When performing data recovery using related technologies, manual operation is required. Operators need to log in to each backup server to complete resource verification. The recovery-related resources of each backup server are managed independently, which can easily lead to resource fragmentation and make it difficult to coordinate and schedule resources. When performing database data recovery, manual configuration of the database instance is also required. The environment preparation process is cumbersome, the overall data recovery process is inefficient, and the resources of the recovery environment are not fully utilized.
[0030] Figure 1 The illustration schematically depicts an application scenario of a data recovery task execution method, apparatus, device, medium, and program product according to embodiments of this application.
[0031] like Figure 1 As shown, application scenario 100 according to an embodiment of this application may include a first terminal device 101, a second terminal device 102, a database 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the database 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. For example, a user can use the first terminal device 101 and the second terminal device 102 to interact with the server 105 and / or the database 103 through the network 104 to receive or send information, etc.
[0032] The first terminal device 101 and the second terminal device 102 can be electronic devices such as smartphones, wearable devices, personal computers, intelligent voice interaction devices, smart home appliances, intelligent vehicles, in-vehicle terminals, aircraft, unmanned vending terminals, and extended reality devices. Extended reality devices can include virtual reality devices, augmented reality devices, and mixed reality devices. A client application for the target application can be installed and run on the terminal device. This target application can include, but is not limited to, financial transaction applications, payment applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, and social media platform software (these are just examples). Furthermore, this application embodiment does not limit the form of the target application, including but not limited to applications, mini-programs, etc., installed on the terminal device, and can also be in web page form.
[0033] Server 105 can be a server providing various services, such as a backend management server supporting websites browsed by users using the first terminal device 101 and the second terminal device 102 (this is just an example). The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data. The server can be a backend server for the aforementioned target application, used to provide backend services to the clients of the target application.
[0034] Database 103 is a professional storage system for storing and managing data. It can store various types of data related to the target application, such as user account information, business transaction records, and content resource data. It supports structured, semi-structured, or unstructured data storage and has management capabilities such as data creation, deletion, modification, querying, backup, and recovery. In this application scenario, database 103 can be connected to server 105 via a communication link. Server 105 can retrieve the required data from database 103 for processing based on requests from the first terminal device 101 and the second terminal device 102. It can also synchronously store new data generated by the operations of the first terminal device 101 and the second terminal device 102 into database 103, thereby achieving data persistence and efficient retrieval.
[0035] It should be noted that the data recovery task execution method provided in this application embodiment can generally be executed by server 105 and / or terminal devices 101-102. Accordingly, the data recovery task execution device provided in this application embodiment can generally be located in server 105 and / or terminal devices 101-102.
[0036] It should be understood that Figure 1 The number of terminal devices, networks, databases, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, databases, and servers can be included.
[0037] Figure 2 A flowchart illustrating a method for performing a data recovery task according to an embodiment of this application is shown.
[0038] like Figure 2 As shown, the data recovery task execution method according to the embodiments of this application may include steps S210 to S240.
[0039] In step S210, the target recovery task to be executed is determined based on the task status information of multiple data recovery tasks.
[0040] A data recovery task is a task that restores backed-up data. Data recovery tasks can be triggered by external operations or by internal system events. Data recovery tasks can correspond to different data objects, including file-type data and database-type data. Database-type data can include instance data of relational databases, etc.
[0041] Multiple data recovery tasks can be maintained in a task management parameter set. The task management parameter set can record various parameters corresponding to each data recovery task. The task management parameter set can be stored in the form of a data table (such as a recovery task list). This data table can record information such as task identifier, recovery type, data volume parameters, version requirements, task status information, creation time, and update time.
[0042] Task status information can be parameters used to characterize the processing stage of a data recovery task. Task status information can be at least one of the following states: pending recovery, pending allocation, environment preparation, recovery in progress, recovered, pending release, etc. Figure 5 As shown, the task status information can change as the processing flow changes. The task status information corresponding to the task can be restored by reading multiple data entries through polling.
[0043] The target recovery task can be a task selected from multiple data recovery tasks and awaiting execution. The task status information of multiple data recovery tasks can be traversed and identified, and tasks whose status meets preset conditions can be selected as the target recovery task. For example, in some embodiments, tasks with the status information "pending recovery" can be selected as target recovery tasks; target recovery tasks can be filtered according to the order in which they were generated; target recovery tasks can be filtered according to their priority; or target recovery tasks can be filtered by combining the task generation time and task priority.
[0044] In step S220, based on the task feature information of the target recovery task and the environmental feature information of each of the multiple available recovery environments, at least one candidate recovery environment that matches the target recovery task is determined from the multiple available recovery environments.
[0045] Task characteristic information can be various parameters describing the data recovery task itself. It may include at least one of the following: the data type corresponding to the recovery task, the size of the data to be recovered, the database version requirements, or the storage location of the backup files. Task characteristic information can be pre-entered or obtained by reading relevant data from the backup system.
[0046] An available recovery environment can be a server environment that can be invoked and is capable of carrying out data recovery operations. Multiple available recovery environments can collectively form a recovery resource pool. Basic software components can be pre-deployed in available recovery environments. Different available recovery environments may differ in the storage size they provide, the types of data recovery they support, and the compatible database instance versions. Information about available recovery environments can be maintained within an environment resource parameter set, which can be stored in the form of a data table (e.g., a recovery resource list). This data table can record information such as environment identifier, available storage space, supported recovery types, compatible software versions, environment status, health-related evaluation parameters, and heartbeat detection time.
[0047] Environmental characteristic information can be parameters that describe the resources and operating status of the available recovery environment itself. For example, environmental characteristic information can include at least one of the following: storage space size, recovery environment type, database instance version, storage unit related parameters, environment purity related parameters, historical task recovery success rate, or system load parameters.
[0048] Candidate recovery environments can be initially selected from all available recovery environments and are a set of recovery environments with the potential to adapt to the target recovery task. The number of candidate recovery environments can be one or more.
[0049] In step S230, at least one candidate recovery environment is sorted according to a preset sorting strategy, and a target recovery environment suitable for the target recovery task is determined based on the sorting results.
[0050] The preset sorting strategy can be pre-defined and can be set by referring to at least one dimension such as system load, historical task execution status, storage resource availability, and environmental health score.
[0051] For example, in some embodiments, a preset sorting strategy may prioritize candidate recovery environments with lower system load. For example, in some embodiments, a preset sorting strategy may prioritize candidate recovery environments with higher historical recovery success rates. In some embodiments, the preset sorting strategy may combine system load and historical recovery success rate to perform the sorting process.
[0052] The target recovery environment can be selected from the candidate recovery environments after being sorted, and is used to actually run the target recovery task. After selecting the target recovery environment, the set of environment resource parameters can be updated to mark the recovery environment as occupied, and the set of task management parameters can be updated to register the recovery environment identifier assigned to this data recovery task.
[0053] In step S240, the target recovery task is performed using the target recovery environment.
[0054] Performing a target recovery task within the target recovery environment involves restoring the original backup data to the target recovery environment, generating recovered files or a usable database instance. The recovered data can reside within the target recovery environment and can be read or exported by the business side. This process can be differentiated between different types, such as file recovery and database recovery. After the recovery operation is complete, relevant notification information can be output.
[0055] The embodiments of this application can identify the task to be processed, and then perform preliminary screening by combining the characteristics of the task itself and the characteristics of each recovery environment. By sorting, the target recovery environment suitable for the target recovery task is determined. In the scenario of a resource pool with multiple recovery environments, the environment matching and scheduling execution of the data recovery task to be processed can be completed automatically, reducing manual intervention.
[0056] In some embodiments, the task management parameter set can be periodically polled to identify task status information and determine the target recovery task. For example, the polling time interval can be set to 30 seconds, 1 hour, or 1 day, or other durations. In some embodiments, an external trigger signal can be responded to to initiate the reading of task status information and determine the target recovery task. In some embodiments, the target recovery task corresponds to a large amount of data to be recovered, and multiple candidate recovery environments are obtained after screening. The target recovery environment can be determined from these candidates by following a preset sorting strategy. In some embodiments, the target recovery task corresponds to a small amount of data to be recovered, and only a single candidate recovery environment is obtained after initial screening. The sorting process can directly determine this candidate recovery environment as the target recovery environment.
[0057] In the embodiments of this application, the task to be restored is determined based on the task status, candidate restoration environments are screened by combining the resource characteristics information of the target data restoration task and available restoration environment resources, and the target restoration environment resources are determined by a preset sorting strategy. This achieves global pooling and overall scheduling of restoration resources, and comprehensive allocation of data restoration tasks and restoration environment resources. It eliminates the need for manual login to each backup server to verify resources and manually match and allocate restoration environments. By sorting at least one candidate restoration environment resource according to a preset sorting strategy to determine the target restoration environment resource suitable for the target data restoration task, the manual verification of each restoration environment resource can be reduced, improving resource utilization and achieving cluster load balancing, thereby improving the execution effect of the data restoration task.
[0058] According to embodiments of this application, determining at least one candidate recovery environment that matches the target recovery task from among the multiple available recovery environments, based on the task characteristic information of the target recovery task and the resource characteristic information of each of the multiple available recovery environments, may include: obtaining the resource requirements of the target recovery task, and determining at least one candidate recovery environment that meets the resource requirements from among the multiple available recovery environments based on the resource characteristic information of each of the multiple available recovery environments; and / or determining at least one candidate recovery environment that matches the target recovery task based on the environmental health status of the multiple available recovery environments.
[0059] Resource requirements can be various resource-level requirements for the recovery environment when a target recovery task performs data recovery processing. Resource requirements can originate from task characteristic information and may include at least one of the following: storage space size requirements, recovery environment type requirements, database instance version requirements, etc. Resource requirements can be entered when the task is submitted, or they can be obtained by parsing backup metadata after connecting to the backup-related system.
[0060] Resource characteristic information can be relevant parameters of the available recovery environment at the resource level. This information may include at least one of the following: storage space size, recovery environment type, database instance version, etc. If a data recovery task has been performed in the available recovery environment, the resource characteristic information may also include resource-related status parameters retained after the historical task execution.
[0061] Meeting resource requirements refers to the availability of resource characteristics in the recovery environment, which covers the resource requirements of the target recovery task. Meeting resource requirements can mean simultaneously meeting multiple resource dimensions, or meeting only some of them.
[0062] Environmental health can be a quantitative evaluation of the overall operational status of the available recovery environment. It can be derived by integrating characteristics from multiple dimensions and can be expressed using either a scoring system or a graded system. Environmental health reflects whether the recovery environment is suitable for undertaking new data recovery tasks.
[0063] The embodiments of this application can complete the screening of candidate recovery environments from at least one dimension, namely resource matching dimension and environmental operation health dimension. The two screening methods can be used alone or in combination to adjust the screening conditions of candidate recovery environments.
[0064] Figure 3 A flowchart illustrating a second data recovery task execution method according to an embodiment of this application is shown. Figure 5 A schematic diagram illustrating the state transition of a recovery environment according to an embodiment of this application is shown.
[0065] like Figure 3 The flowchart of the data recovery task execution method shown includes steps S301 to S308.
[0066] In step S301, a recovery task is submitted. The data recovery task submitted by the user may include a task identifier, task type (e.g., database recovery), backup path, data size, and instance parameters (e.g., version, instance name, size, etc.). The recovery task submitted by the user is a task to be executed, and its status can be "pending recovery," such as... Figure 5 The "Pending Recovery" item 510 is listed below. The resource requirements for this recovery task can be determined based on the information submitted by the user.
[0067] In step S302, status detection. Data recovery tasks with a status of "pending recovery" (that need to be executed) can be detected by periodic polling.
[0068] In step S303, the backup system is connected to verify the backup data, which yields the actual size of the backup data. In step S304, the data size parameter is updated to prevent inaccurate information submitted by the user. After the update, the status of the data recovery task can be set to "Pending Assignment," such as... Figure 5 The number 520 is "pending allocation".
[0069] In step S305, status detection. For data recovery tasks with a status of "pending allocation", step S306 is executed.
[0070] In step S306, resource matching is performed. In some embodiments, candidate recovery environments can be screened solely based on resource requirement matching, with available recovery environments whose resource feature information covers the resource requirements being selected as candidate recovery environments. In some embodiments, candidate recovery environments can be screened solely based on environmental health status, with available recovery environments whose environmental health status meets the corresponding standard being selected as candidate recovery environments. In some embodiments, both resource requirement matching and environmental health status can be combined; only available recovery environments that simultaneously meet both resource requirements and environmental health status criteria will be identified as candidate recovery environments.
[0071] If resource matching is successful, proceed to step S307 to allocate resources according to the matched resources; if matching fails, proceed to step S308 to issue an alarm notification. The status of the target data recovery task can be "Environment preparing" 530.
[0072] In the embodiments of this application, available recovery environment resources can be verified based on hard resource requirements such as storage capacity, data type, and software version, and also based on the health status of the environment. This dual constraint filters out unqualified environment resources, avoiding the allocation of servers with insufficient storage space, incompatible versions, or abnormal malfunctions. This eliminates resource allocation failures and errors during recovery tasks from the source, improves the accuracy of resource matching and the success rate of task execution, and takes into account both resource availability and operational quality.
[0073] According to embodiments of this application, obtaining the resource requirements of a target recovery task and determining at least one candidate recovery environment that meets the resource requirements from multiple available recovery environments based on their respective resource characteristic information may include: determining an available recovery environment as a candidate recovery environment in response to the storage space size, recovery environment type, and database instance version meeting the resource requirements, wherein, in the case that a data recovery task has been performed in an available recovery environment, the resource characteristic information includes at least one of the storage space size, recovery environment type, or database instance version.
[0074] Storage space size can refer to the storage capacity that the recovery environment can provide for data recovery operations, or it can be the space after deducting the already occupied storage portion. The storage space requirements corresponding to the target recovery task can be related to the size of the backup data to be recovered.
[0075] The recovery environment type characterizes the category of data recovery services it is adapted to. Recovery environment types can include different categories such as those adapted to file recovery services, those adapted to Category 1 database recovery services, and those adapted to Category 2 database recovery services. Different recovery environment types can have different pre-configured basic software components.
[0076] The database instance version can refer to the version of the database software pre-installed within the recovery environment, or it can be a reusable version of the database software retained after previous data recovery tasks. Different backup data may correspond to different database versions. Backup data restoration operations may have compatibility requirements regarding the database instance version.
[0077] In response to the requirement that storage space size, recovery environment type, and database instance version meet resource requirements, the available recovery environment can be defined as follows: the available storage space size of the available recovery environment is greater than or equal to the storage capacity required by the target recovery task; the type of the recovery environment is compatible with the business category of the target recovery task; and the database instance version of the recovery environment is compatible with the version required by the backup data to be recovered. If multiple conditions are met, the available recovery environment can be identified as a candidate recovery environment.
[0078] If a data recovery task has been performed in an available recovery environment, and that recovery environment has undergone previous recovery task execution, its resource characteristics can retain at least one of the following: storage space size, recovery environment type, or database instance version. After a historical data recovery task is executed, the storage space size may change due to the occupation of old data. The recovery environment type and database instance version can remain in their original configuration or be modified.
[0079] Figure 3 Step S306 may include comparing and determining at least one of the following: storage space size, recovery environment type, or database instance version.
[0080] For example, in some embodiments, an available recovery environment may have historically undertaken multiple database recovery tasks. Resource characteristic information continuously records the storage space size and database instance version of this environment. After each task is completed, the storage space size value can be updated. The target recovery task is a database recovery task, and its resource requirements include storage capacity, recovery environment type, and database instance version. All three items must match for the corresponding available recovery environment to be included in the candidate recovery environment list.
[0081] In other embodiments, if the target recovery task is a file recovery task, there are no requirements for the database instance version. The database instance version can be excluded from the condition judgment, and only the storage space size and recovery environment type are checked.
[0082] In the embodiments of this application, candidate recovery environments can be screened by verifying the storage space size, recovery environment type, and database instance version, which can reduce the probability of task execution abnormalities caused by insufficient storage, type mismatch, or version incompatibility.
[0083] According to embodiments of this application, determining at least one candidate recovery environment that matches the target recovery task based on the environmental health status of multiple available recovery environments may include: determining the environmental health status of the available recovery environment according to at least one of the storage unit characteristics, environmental purity characteristics, task recovery success rate characteristics, and system load characteristics of the available recovery environment, and in accordance with a preset evaluation rule; and determining the available recovery environment as a candidate recovery environment in response to the environmental health status of the available recovery environment meeting a health status threshold.
[0084] Storage unit characteristics can be parameters related to the underlying storage of the recovery environment, such as at least one of parameters such as index node utilization, storage fragmentation rate, and read / write response speed, which can reflect the current operating status of the storage unit.
[0085] Environment purity characteristics can be used to characterize whether a recovery environment contains residual instances, residual port occupancy, residual mounted file systems, etc., after completing past recovery tasks. The value of the environment purity characteristic can decrease as the amount of residual content increases.
[0086] The task recovery success rate characteristic can be an indicator derived from statistics of data recovery tasks historically executed in this recovery environment. It can be the percentage of successful completions among the past N historical recovery tasks, where N can be selected as 5, 10, or other numbers.
[0087] System load characteristics can be the operating load parameters of the recovery environment server. System load characteristics can include at least one of the following parameters: processor load, memory usage, or number of processes. System load characteristics can reflect the current workload of the recovery environment server.
[0088] The preset evaluation rule can be a weighted calculation of the above features to obtain the environmental health level. For example, the preset evaluation rule can be expressed as: S = w1 * storage health + w2 * instance cleanliness + w3 * historical recovery success rate + w4 * system load, where S represents the environmental health score, and w1, w2, w3, and w4 are the weight coefficients corresponding to each feature. The values of each weight coefficient can be adjusted according to the actual scenario. Storage health can be calculated from storage unit features, and instance cleanliness can be calculated from environmental purity features.
[0089] The health threshold can be a pre-set score or level condition. Meeting the health threshold indicates that the overall operational status of the recovery environment is ready to undertake new tasks. Recovery environments that do not meet the health standard can be excluded from the candidate recovery environments.
[0090] For example, in some embodiments, storage unit characteristics, environmental purity characteristics, task recovery success rate characteristics, and system load characteristics can be simultaneously used, weighted according to preset evaluation rules to obtain an environmental health score, which is then compared with a health threshold. If the environmental health score is greater than or equal to the health threshold, the usable recovery environment can be determined as a candidate recovery environment. In some embodiments, storage unit characteristics and task recovery success rate characteristics can be selected for evaluating the environmental health level. In some embodiments, environmental purity characteristics and system load characteristics can be selected for evaluating the environmental health level.
[0091] In the embodiments of this application, the environmental health level can be obtained by combining multi-dimensional features with preset evaluation rules, and then the candidate recovery environment can be screened by comparing the health level threshold. Recovery environments with poor operating status can be excluded, which can increase the possibility of the candidate recovery environment running stably when undertaking tasks.
[0092] Figure 4 A flowchart illustrating a third data recovery task execution method according to an embodiment of this application is shown.
[0093] like Figure 4 As shown, the data recovery task in this application embodiment may further include steps S308 to S312.
[0094] In step S309, the recovery is performed. The status of the target data recovery task can be "Recovering" 540. If the data recovery task is successfully executed, the process can proceed to step S310 to notify the administrator, and the status of the target data recovery task can be "Recovered" 550; if the data recovery task fails, the process can proceed to step S308 to issue an alarm notification.
[0095] In step S311, the target recovery environment occupied by the target recovery task is set to be released. The status corresponding to the target data recovery task can be "Pending Release" 560. In step S312, resources are released. For example, the recovery environment to be released can be released during periodic inspections. For databases, automated scripts can be used to suspend the corresponding database instance and delete the mounted virtualized file system, setting it to an "idle" state.
[0096] According to an embodiment of this application, the method for executing a data recovery task may further include: performing an environment repair operation on the available recovery environment when the environmental health level of the available recovery environment does not meet a health level threshold; and marking the available recovery environment as "unavailable" in response to the cumulative number of executions of the environment repair operation reaching a preset target number.
[0097] Environment remediation operations can be various remedial actions performed on a recoverable environment whose health level does not meet the health threshold, eliminating various factors causing the low health level. Environment remediation operations may include at least one of the following: formatting the file system, cleaning up residual database instances, releasing occupied ports, and cleaning up residual mounted file systems. Environment remediation operations can be initiated automatically by the scheduling component or by manual intervention.
[0098] The cumulative execution count can be the total number of times an environment repair operation has been initiated for the same available recovery environment. The value of the cumulative execution count can be stored in the environment resource parameter set. Each time an environment repair operation is completed, the value of the cumulative execution count for the corresponding recovery environment can be incremented by one.
[0099] The preset target number of attempts can be a pre-defined limit. For example, the preset target number of attempts can be set to 3, or it can be set to other values. The preset target number of attempts can be set based on operational experience and the probability of failure.
[0100] Marking a recovery environment as "unavailable" can be a status field within the set of updated environment resource parameters. Once marked, this recovery environment will no longer participate in the subsequent candidate recovery environment selection process and will not be assigned to any target recovery task. Recovery environments marked as "unavailable" can wait for subsequent manual intervention to troubleshoot underlying hardware failures, or they can perform operations such as file system deletion and complete resource release.
[0101] In some embodiments, the purity of the available recovery environment is low, and there may be residual database instances. Environment repair operations may include: executing instance stop and deletion scripts, cleaning up residual instances, and after repair, re-collecting various characteristic parameters of the recovery environment to recalculate the environment health level. In some embodiments, the storage unit characteristics of the available recovery environment are abnormal, and there may be a high storage fragmentation rate. Environment repair operations may include performing file system formatting to complete storage-level repair, with the cumulative execution count incremented synchronously. In some embodiments, if the same available recovery environment triggers three environment repair operations, and the environment health level still fails to reach the health threshold after repair, the available recovery environment is marked as "unavailable," and a deletion operation of the underlying file system can be triggered to release resources.
[0102] In the embodiments of this application, an environment repair operation can be performed on an available recovery environment whose health level does not meet the health level threshold. This can enable some recovery environments with slightly abnormal states to regain the ability to undertake tasks. After the cumulative number of repairs reaches a preset target number, the environment is marked as "unavailable", which can reduce the possibility of task failure caused by repeatedly calling the faulty environment.
[0103] According to embodiments of this application, after performing a target recovery task using the target recovery environment, the process may further include: performing an environment cleanup operation on the target recovery environment to obtain a cleaned recovery environment; obtaining an environment health score of the cleaned recovery environment based on the resource characteristic information of the cleaned recovery environment and according to a preset scoring rule; and recognizing the cleaned recovery environment as a usable recovery environment in response to the environment health score of the cleaned recovery environment meeting preset health score conditions.
[0104] Environment cleanup is a resource reclamation process performed on the target recovery environment after a data recovery task has been completed. Environment cleanup may include at least one of the following: stopping the database instance, releasing occupied ports, unmounting snapshot mount directories, or deleting the file system directories corresponding to the task. Environment cleanup can dispose of temporary data and instance configurations generated by the current recovery task, reducing interference with subsequent tasks. The cleaned recovery environment must undergo a health score verification before it can be put back into the resource pool.
[0105] The preset scoring rules can be consistent with the preset evaluation rules used to calculate the environmental health level in the above embodiments, or a different set of independent scoring logic can be used. For example, the preset scoring rules can perform weighted calculations on storage unit characteristics, environmental purity characteristics, task recovery success rate characteristics, and system load characteristics to output an environmental health score.
[0106] An environmental health score is a numerical score calculated and output from various resource characteristics of the restored environment after cleanup is completed.
[0107] Preset health score criteria can be used to determine whether a cleaned recovery environment can be reused. These criteria can be a health score greater than or equal to a set threshold. After the recovery task completes, environment cleanup can be performed first, followed by a health score check. Only environments that pass the check are reassigned as usable recovery environments. This avoids directly assigning environments with residual anomalies to subsequent data recovery task allocation processes.
[0108] In some embodiments, after the target recovery environment completes a database-type recovery task, the environment cleanup operation can call the corresponding script to stop the database instance, release the ports occupied by the task, unmount the mounted snapshot directory, and clean up the directory files corresponding to the task, resulting in a cleaned recovery environment. Parameters such as inode usage, port occupancy status, and system load of the cleaned recovery environment are collected, and an environment health score is obtained according to preset scoring rules. If the score meets the preset health score conditions, the recovery environment is classified as an available recovery environment. In some embodiments, after the target recovery environment completes a file-type recovery task, the environment cleanup operation can perform unmounting processing on the snapshot mount point, reclaim storage space, and then collect storage-related characteristic parameters to calculate the environment health score. In some embodiments, if the environment health score of the cleaned recovery environment does not meet the preset health score conditions after the environment cleanup operation is completed, an environment repair operation can be triggered. After the repair is completed, a scoring judgment can be performed again.
[0109] In the embodiments of this application, an environment cleanup operation is performed after the task is completed, and the environment is returned to the resource pool after passing an environment health score verification. This ensures that the recovery environment maintains a good operating state before undertaking the next task, increasing the reliability of the recovery environment's reuse. After the recovery task is completed, the environment health is assessed, and qualified environments are returned to the resource pool to await new task allocation, which can improve the cluster recovery environment reuse rate and the execution efficiency of data recovery tasks.
[0110] According to an embodiment of this application, performing a target recovery task using a target recovery environment may include: when the task feature information indicates that the target recovery task is a file recovery task, mounting a snapshot of the target backup file to the target address of the target recovery environment in read-only mode, and using the snapshot of the target backup file to perform file recovery to complete the target recovery task.
[0111] File recovery tasks are data recovery tasks that use file objects as the recovery objects, and can be used to restore various business files, configuration files and other objects.
[0112] The target backup file can be a pre-backed-up file containing the business data to be restored. A snapshot of the target backup file can be a snapshot version generated based on the target backup file. Snapshots can preserve the data state of the backup file at a specific point in time. Snapshots are used in read-only mode, which can reduce the possibility of the original backup data being modified during the mount operation.
[0113] Read-only mounting maps a snapshot to an access path within the target recovery environment. This path only supports read operations and does not support write, modify, or delete operations, thus protecting the original backup data corresponding to the snapshot from being altered.
[0114] The target address can be a pre-defined access directory path within the target recovery environment. The target address can be set by a path template. Different target recovery tasks can correspond to different target addresses, thereby achieving directory isolation between tasks.
[0115] File recovery using a snapshot of the target backup file involves reading the necessary file data from an already mounted read-only snapshot, performing operations such as copying and exporting files, and restoring the business files to complete the target recovery task. After the task is completed, the recovery result notification can be saved, awaiting the subsequent environment release process.
[0116] In some embodiments, the target recovery task is a file recovery task for a regular business configuration file. After obtaining the snapshot corresponding to the target backup file, for example, the snapshot can be mounted read-only to the path / DEF / ABC001. The business process can read the configuration file to be recovered from this mounted path, export it to the business working directory, and complete the file recovery task. In some embodiments, the target recovery task corresponds to the recovery of a large number of log files, and the snapshot size is large. After mounting it to the target address in read-only mode, the log files can be read directly from the snapshot path to complete the data extraction, without the need to copy all the backup data, which can reduce the read and write overhead of storage resources.
[0117] In the embodiments of this application, a snapshot read-only mounting method is adopted for file recovery tasks, which can reduce the environmental deployment steps of file recovery tasks and reduce the risk of the original backup data being modified.
[0118] According to an embodiment of this application, performing a target recovery task using a target recovery environment may include: when the task feature information indicates that the target recovery task is a database recovery task, a target database instance may be created in the target recovery environment according to a preset database template; a snapshot corresponding to the target backup file may be mounted to the data directory of the target database instance; and a recovery script matching the target database instance may be called to perform data restoration on the target database instance based on the snapshot to complete the target recovery task.
[0119] Database recovery tasks can be data recovery tasks that use database instance data as the recovery object, and database recovery tasks can correspond to different types of database software.
[0120] The preset database template can be a pre-prepared instance template, which can include basic instance configuration and parameter configuration. Different database versions and different database types can correspond to their own independent preset database templates.
[0121] The target database instance can be a newly created database instance in the target recovery environment based on a preset database template. The instance identifier of the target database instance can be associated with the task identifier. In some scenarios, the database instance can use ports from a pre-reserved port pool. The port pool can contain a group of consecutive ports, with different instances assigned different ports to reduce port conflicts. The data directory can be the directory path used by the target database instance to store business data files.
[0122] Recovery scripts can be automated execution scripts adapted to the database version and database type. Recovery scripts can read backup data from snapshots, execute restore commands to the target database instance, and complete the restoration of business data within the database.
[0123] Data restoration of the target database instance based on a snapshot can be performed by a recovery script reading the backup data in the snapshot mounted in the data directory, performing a database restoration operation, importing the business data from the backup into the target database instance, and after the data restoration process is completed, the database instance will contain the business data corresponding to the backup time point, thus completing the target recovery task.
[0124] By using a preset database template to quickly create an instance, then mounting a backup snapshot, and calling a suitable recovery script to restore the database, the process of creating an instance, mounting data, and restoring data can be automated. This reduces the need for manual configuration of database instances and improves the efficiency of data recovery tasks.
[0125] Figure 6 The schematic diagram illustrates a component architecture diagram of performing a data recovery task according to an embodiment of this application.
[0126] like Figure 6 As shown, the component architecture for executing data recovery tasks can include an interface layer 610, a resource layer 620, a scheduling engine 630, and a control layer 640. The interface layer 610 receives requests for task submission and status queries, connecting downwards to the resource layer 620. The resource layer 620 may contain a backup server cluster, providing underlying computing and storage resources. The scheduling engine 630 performs task parsing, environment matching, and scheduling decisions. The control layer 640 maintains the recovery resource list and recovery task list, storing parameter data for recovery tasks and resources. The scheduling control logic runs within the scheduling engine 630, which can issue task instructions to the snapshot management component and the mount management component, completing the component interaction process for snapshot generation and read-only mounting. The scheduling engine 630 can also interact with the template management component, the snapshot management component, and the script execution component. The template management component provides preset database templates to create instances, the snapshot management component mounts snapshots, and the script execution component calls the corresponding recovery script to perform data restoration. The control layer 640 stores parameters such as database version, port allocation, and task-instance mapping relationships.
[0127] Combination Figure 6 In the component architecture, the scheduling engine 630 can issue instructions to the template management component to create a target database instance based on a preset database template; the snapshot management component can mount the snapshot corresponding to the target backup file to the data directory of the instance; the script execution component can load the matching recovery script, read the snapshot data and complete the instance restoration; the relevant instance, port, and mount path parameters can be synchronously updated to the data table maintained by the control layer 640.
[0128] For example, in some embodiments, the database recovery task can correspond to a first type of relational database. It can call a preset database template to generate a target database instance bound to the task identifier, allocate an idle port from the port pool for the instance to use, mount the target backup file snapshot to the instance's data directory, call a recovery script adapted to the database version, perform data restoration, and complete the database recovery task.
[0129] In other embodiments, the database recovery task corresponds to a second type of relational database. The instance initialization can be completed using the corresponding preset database template. After the snapshot is mounted, the recovery script performs the restore operation. After the restore is completed, the task completion status information is output.
[0130] In some other embodiments, multiple database recovery tasks are executed concurrently. Each task creates an independent target database instance, is assigned a different port, and mounts its corresponding snapshot. The data directories of each instance are isolated from each other, and the multiple recovery tasks can operate without interfering with each other.
[0131] In the embodiments of this application, the database recovery task can adopt a process of creating an instance from a template, mounting a snapshot, and calling a recovery script to perform the restoration. This can reduce the workload of manual configuration of the database instance and improve the automation level of the database recovery task execution process.
[0132] According to embodiments of this application, a unified recovery task list and recovery resource list can be formed for comprehensive resource allocation. The recovery task list manages data recovery tasks, and the recovery resource list manages available recovery environments. The data table structures of the recovery task list and recovery resource list are shown in Table 1. It provides automated recovery environment resource allocation, environment setup, automatic recovery, and automatic cleanup capabilities. It reduces manual intervention and improves resource utilization and implementation efficiency.
[0133] Table 1 shows the data representation structure of the recovery task list and the recovery resource list.
[0134]
[0135] Based on the above-described method for executing data recovery tasks, embodiments of this application also provide an apparatus for executing data recovery tasks. The following will be combined with... Figure 7 The device is described in detail.
[0136] Figure 7 A schematic block diagram of an execution apparatus for a data recovery task according to an embodiment of this application is shown.
[0137] like Figure 7As shown, the data recovery task execution device 700 of this embodiment includes a recovery task determination module 710, a candidate recovery environment determination module 720, a target recovery environment determination module 730, and a recovery task execution module 740.
[0138] The recovery task determination module 710 is used to determine the target recovery task to be executed based on the task status information of multiple data recovery tasks. In some embodiments, the recovery task determination module 710 can be used to execute the step S210 described above, which will not be repeated here.
[0139] The candidate recovery environment determination module 720 is used to determine at least one candidate recovery environment that matches the target recovery task from among the multiple available recovery environments, based on the task characteristic information of the target recovery task and the environmental characteristic information of each of the multiple available recovery environments. In some embodiments, the candidate recovery environment determination module 720 may be used to perform step S220 described above, which will not be repeated here.
[0140] The target recovery environment determination module 730 is used to sort at least one candidate recovery environment according to a preset sorting strategy, and determine the target recovery environment suitable for the target recovery task based on the sorting result. In some embodiments, the target recovery environment determination module 730 can be used to perform step S230 described above, which will not be repeated here.
[0141] The recovery task execution module 740 is used to execute a target recovery task using the target recovery environment. In some embodiments, the target recovery environment determination module 730 may be used to execute step S240 described above, which will not be repeated here.
[0142] According to an embodiment of this application, the candidate recovery environment determination module 720 can also be used to obtain the resource requirements of the target recovery task, and determine at least one candidate recovery environment that meets the resource requirements from the multiple available recovery environments based on the resource characteristic information of each of the multiple available recovery environments; and / or determine at least one candidate recovery environment that matches the target recovery task based on the environmental health status of the multiple available recovery environments.
[0143] According to an embodiment of this application, the candidate recovery environment determination module 720 can also be used to determine an available recovery environment as a candidate recovery environment in response to the fact that the storage space size, recovery environment type, and database instance version of the available recovery environment meet the resource requirements. In the case that a data recovery task has been performed in the available recovery environment, the resource characteristic information includes at least one of the storage space size, recovery environment type, or database instance version.
[0144] According to an embodiment of this application, the candidate recovery environment determination module 720 can also be used to determine the environmental health level of the available recovery environment according to at least one of the storage unit characteristics, environmental purity characteristics, task recovery success rate characteristics and system load characteristics of the available recovery environment, and in accordance with a preset evaluation rule; in response to the environmental health level of the available recovery environment meeting the health level threshold, the available recovery environment is determined as a candidate recovery environment.
[0145] According to an embodiment of this application, the candidate recovery environment determination module 720 can also be used to perform an environment repair operation on the available recovery environment when the environmental health level of the available recovery environment does not meet the health level threshold; in response to the cumulative number of executions of the environment repair operation reaching a preset target number, the available recovery environment is marked as "unavailable".
[0146] According to an embodiment of this application, the candidate recovery environment determination module 720 can also be used to perform an environment cleanup operation on the target recovery environment to obtain a cleaned recovery environment; based on the resource characteristic information of the cleaned recovery environment, and according to a preset scoring rule, to obtain an environment health score of the cleaned recovery environment; in response to the environment health score of the cleaned recovery environment meeting the preset health score conditions, the cleaned recovery environment is designated as an available recovery environment.
[0147] According to an embodiment of this application, the recovery task execution module 740 can also be used to mount a snapshot of the target backup file to the target address of the target recovery environment in read-only mode when the task feature information indicates that the target recovery task is a file recovery task; and use the snapshot of the target backup file to perform file recovery to complete the target recovery task.
[0148] According to an embodiment of this application, the recovery task execution module 740 can also be used to create a target database instance in the target recovery environment according to a preset database template when the task feature information indicates that the target recovery task is a database recovery task; mount the snapshot corresponding to the target backup file to the data directory of the target database instance; call the recovery script that matches the target database instance, and perform data restoration on the target database instance based on the snapshot to complete the target recovery task.
[0149] According to embodiments of this application, any multiple modules among the recovery task determination module 710, candidate recovery environment determination module 720, target recovery environment determination module 730, and recovery task execution module 740 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the recovery task determination module 710, candidate recovery environment determination module 720, target recovery environment determination module 730, and recovery task execution module 740 can be at least partially implemented as hardware circuitry, such as field-programmable gate arrays, programmable logic arrays, systems-on-a-chip, systems-on-a-substrate, systems-on-package, application-specific integrated circuits, or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the recovery task determination module 710, the candidate recovery environment determination module 720, the target recovery environment determination module 730, and the recovery task execution module 740 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.
[0150] Figure 8 A block diagram of an electronic device suitable for implementing a data recovery task according to an embodiment of this application is shown schematically.
[0151] like Figure 8 As shown, an electronic device 800 according to an embodiment of this application includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory 802 or a program loaded from a storage portion 808 into a random access memory 803. The processor 801 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a dedicated microprocessor. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for executing different steps of the method flow according to an embodiment of this application.
[0152] Random access memory 803 stores various programs and data required for the operation of electronic device 800. Processor 801, read-only memory 802, and random access memory 803 are interconnected via bus 804. Processor 801 executes various steps of the method flow according to embodiments of this application by executing programs stored in read-only memory 802 and / or random access memory 803. It should be noted that programs may also be stored in one or more memories other than read-only memory 802 and random access memory 803. Processor 801 may also execute various steps of the method flow according to embodiments of this application by executing programs stored in one or more memories.
[0153] According to embodiments of this application, the electronic device 800 may further include an input / output interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the input / output interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube, liquid crystal display, etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card, such as a local area network card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.
[0154] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0155] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include the read-only memory 802 described above, and / or random access memory 803, and / or one or more memories other than read-only memory 802 and random access memory 803.
[0156] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.
[0157] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0158] In embodiments of this application, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by processor 801, it performs the functions defined in the system of embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0159] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0160] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0161] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A method for executing a data recovery task, characterized in that, include: Based on the task status information of multiple data recovery tasks, determine the target recovery task to be executed; Based on the task feature information of the target recovery task and the environmental feature information of each of the multiple available recovery environments, at least one candidate recovery environment that matches the target recovery task is determined from the multiple available recovery environments. The at least one candidate recovery environment is sorted according to a preset sorting strategy, and a target recovery environment suitable for the target recovery task is determined based on the sorting results; and The target recovery task is performed using the target recovery environment.
2. The method according to claim 1, characterized in that, The step of determining at least one candidate recovery environment matching the target recovery task from among the multiple available recovery environments, based on the task characteristic information of the target recovery task and the resource characteristic information of each of the multiple available recovery environments, includes: Obtain the resource requirements of the target recovery task, and based on the resource characteristics of each of the multiple available recovery environments, determine at least one candidate recovery environment that meets the resource requirements from the multiple available recovery environments; and / or Based on the environmental health status of the multiple available recovery environments, at least one candidate recovery environment is determined to match the target recovery task.
3. The method according to claim 2, characterized in that, The step of obtaining the resource requirements of the target recovery task and determining at least one candidate recovery environment that meets the resource requirements from the multiple available recovery environments based on their respective resource characteristic information includes: If the storage space size, recovery environment type, and database instance version of the available recovery environment meet the resource requirements, the available recovery environment is determined as a candidate recovery environment. Wherein, if a data recovery task has been performed in the available recovery environment, the resource characteristic information includes at least one of the following: storage space size, recovery environment type, or database instance version.
4. The method according to claim 2, characterized in that, The step of determining at least one candidate recovery environment matching the target recovery task based on the environmental health status of multiple available recovery environments includes: Based on at least one of the storage unit characteristics, environment purity characteristics, task recovery success rate characteristics, and system load characteristics of the available recovery environment, the environmental health level of the available recovery environment is determined according to a preset evaluation rule. In response to the fact that the environmental health level of the available recovery environment meets the health level threshold, the available recovery environment is determined as a candidate recovery environment.
5. The method according to claim 4, characterized in that, Also includes: If the environmental health level of the available recovery environment does not meet the health level threshold, an environmental repair operation is performed on the available recovery environment. In response to the cumulative number of times the environment repair operation is executed reaching a preset target number, the available recovery environment is marked as unavailable.
6. The method according to claim 1, characterized in that, After performing the target recovery task using the target recovery environment, the method further includes: Perform an environment cleanup operation on the target recovery environment to obtain a cleaned recovery environment; Based on the resource characteristic information of the cleaned and restored environment, and in accordance with the preset scoring rules, the environmental health score of the cleaned and restored environment is obtained. If the environmental health score of the cleaned recovery environment meets the preset health score conditions, the cleaned recovery environment is designated as a usable recovery environment.
7. The method according to claim 1, characterized in that, The step of performing the target recovery task using the target recovery environment includes: If the task feature information indicates that the target recovery task is a file recovery task, a snapshot of the target backup file is mounted in read-only mode to the target address of the target recovery environment; File recovery is performed using a snapshot of the target backup file to complete the target recovery task.
8. The method according to claim 1, characterized in that, The step of performing the target recovery task using the target recovery environment includes: If the task feature information indicates that the target recovery task is a database recovery task, a target database instance is created in the target recovery environment according to a preset database template. Mount the snapshot corresponding to the target backup file to the data directory of the target database instance; Invoke the recovery script that matches the target database instance, and perform data restoration on the target database instance based on the snapshot to complete the target recovery task.
9. An execution device for a data recovery task, characterized in that, include: The task determination module is used to determine the target recovery task to be executed based on the task status information of multiple data recovery tasks. The candidate recovery environment determination module is used to determine at least one candidate recovery environment that matches the target recovery task from the multiple available recovery environments, based on the task feature information of the target recovery task and the environmental feature information of each of the multiple available recovery environments. The target recovery environment determination module is used to sort the at least one candidate recovery environment according to a preset sorting strategy, and determine the target recovery environment suitable for the target recovery task based on the sorting result. as well as The recovery execution module is used to execute the target recovery task using the target recovery environment.
10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.
