Data sampling processing method and device
Through the automated data sampling and processing method and device, the problems of misoperation and low efficiency caused by manual operation are solved, and efficient data sampling is achieved, which is suitable for finance and other technical fields.
Patent Information
- Application Number
- CN202210529441.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-16
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-05-16
AI Technical Summary
The existing data sampling work is mainly completed manually, resulting in frequent misoperations and low efficiency.
A data sampling processing method and device are provided to automatically obtain the sampling table information of the backup strategy, execute corresponding commands according to the sampling status and type, and update the sampling table information, including media availability verification and data availability verification. By comparing the file or database recovery results in the verification environment, automated sampling is achieved.
It avoids erroneous operations caused by manual operation, improves the processing efficiency of data sampling tasks, and realizes a fully automatic backup data sampling process.
Smart Images

Figure CN114840526B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a data sampling processing method and device. Background Art
[0002] With the development of Internet technology, massive amounts of data have been generated, and some of the data need to be backed up. In order to ensure the accuracy and integrity of the data, the backup data needs to be spot-checked. Therefore, the data spot-checking work has become more arduous.
[0003] The existing data sampling work is mainly completed manually, which is prone to misoperation and low efficiency. Summary of the Invention
[0004] In response to the problems in the prior art, embodiments of the present invention provide a data sampling processing method and device, which can at least partially solve the problems in the prior art.
[0005] In one aspect, the present invention provides a data sampling processing method, comprising:
[0006] Obtaining sampling table information of the backup strategy; the sampling table information includes sampling status and sampling type;
[0007] If it is determined that the sampling inspection state is a pending sampling inspection state, obtaining data in the pending sampling inspection state, and executing a command corresponding to the sampling inspection type on the data;
[0008] Obtain the execution result of the command, and update the sampling inspection table information according to the execution result.
[0009] The sampling inspection type includes medium availability verification; accordingly, executing a command corresponding to the sampling inspection type on the data includes:
[0010] A verification sampling command is executed on the data.
[0011] The sampling inspection type includes data availability verification; accordingly, executing a command corresponding to the sampling inspection type on the data includes:
[0012] The backup policy type of the data is obtained, and recovery commands are respectively executed on the data corresponding to the backup policy type.
[0013] The backup policy type includes a file backup policy type; accordingly, executing the recovery command on the data corresponding to the backup policy type includes:
[0014] The latest backup image corresponding to the file backup policy type is restored to the verification environment; the verification environment is pre-checked.
[0015] The backup policy type includes a database backup policy type; accordingly, executing the recovery command on the data corresponding to the backup policy type includes:
[0016] The database recovery script is called in the verification environment, and the database recovery script is used to interact with the backup software to realize database recovery; the verification environment is initialized in advance according to the database instance and database parameters.
[0017] The obtaining of the execution result of the command and updating the sampling inspection table information according to the execution result includes:
[0018] Retrieving the restored files from the verification environment, and comparing the files with the file list in the latest backup image;
[0019] If it is determined that the comparison results of all comparison items are the same, the execution result is determined to be execution completed, and the sampling inspection table information is updated.
[0020] The obtaining of the execution result of the command and updating the sampling inspection table information according to the execution result includes:
[0021] The database is logged in the verification environment. If it is determined that the database recovery is complete, the execution result is determined to be execution completion, and the sampling inspection table information is updated.
[0022] Before the step of obtaining the sampling table information of the backup strategy, the data sampling processing method further includes:
[0023] A backup strategy is obtained, and corresponding backup strategy updating steps are performed according to a comparison result between the backup strategy and the pre-stored backup strategy in the sampling inspection table information.
[0024] The sampling table information includes an application level of the backup policy, and the application level reflects the importance of the application; after the step of executing the corresponding backup policy update step, the data sampling processing method further includes:
[0025] Determine the data sampling frequency and the sampling type according to the application level and the preset corresponding relationship; the preset corresponding relationship includes the corresponding relationship between the preset application level, the preset data sampling frequency and the preset sampling type;
[0026] Obtain the latest random inspection completion time of the backup strategy, and determine the time interval between the current time and the latest random inspection completion time;
[0027] If it is determined that the time interval is greater than or equal to the data sampling frequency, the sampling state is updated to the pending sampling state.
[0028] In one aspect, the present invention provides a data sampling processing device, comprising:
[0029] An acquisition unit, configured to acquire sampling inspection table information of a backup strategy; the sampling inspection table information includes a sampling inspection status and a sampling inspection type;
[0030] an execution unit, configured to, if determining that the sampling inspection state is a pending sampling inspection state, obtain data in the pending sampling inspection state and execute a command corresponding to the sampling inspection type on the data;
[0031] An updating unit is used to obtain the execution result of the command and update the sampling inspection table information according to the execution result.
[0032] On the other hand, an embodiment of the present invention provides an electronic device, comprising: a processor, a memory, and a bus, wherein:
[0033] The processor and the memory communicate with each other via the bus;
[0034] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the following method:
[0035] Obtaining sampling table information of the backup strategy; the sampling table information includes sampling status and sampling type;
[0036] If it is determined that the sampling inspection state is a pending sampling inspection state, obtaining data in the pending sampling inspection state, and executing a command corresponding to the sampling inspection type on the data;
[0037] Obtain the execution result of the command, and update the sampling inspection table information according to the execution result.
[0038] An embodiment of the present invention provides a non-transitory computer-readable storage medium, including:
[0039] The non-transitory computer-readable storage medium stores computer instructions, which cause the computer to execute the following method:
[0040] Obtaining sampling table information of the backup strategy; the sampling table information includes sampling status and sampling type;
[0041] If it is determined that the sampling inspection state is a pending sampling inspection state, obtaining data in the pending sampling inspection state, and executing a command corresponding to the sampling inspection type on the data;
[0042] Obtain the execution result of the command, and update the sampling inspection table information according to the execution result.
[0043] The data sampling processing method and device provided by the embodiment of the present invention obtain the sampling table information of the backup strategy; the sampling table information includes the sampling status and the sampling type; if it is determined that the sampling status is the pending sampling status, the data in the pending sampling status is obtained, and the command corresponding to the sampling type is executed on the data; the execution result of the command is obtained, and the sampling table information is updated according to the execution result, which can automatically complete the data sampling work, avoid erroneous operations caused by manual operations, and improve the efficiency of sampling task processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0045] Figure 1 It is a flowchart of a data sampling processing method provided by one embodiment of the present invention.
[0046] Figure 2 It is a flow chart of a data sampling and processing method provided by another embodiment of the present invention.
[0047] Figure 3 It is a flow chart of a data sampling and processing method provided by another embodiment of the present invention.
[0048] Figure 4 It is a structural diagram of a data sampling processing device provided by an embodiment of the present invention.
[0049] Figure 5 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of this application can be combined with each other in any manner.
[0051] Figure 1 FIG. 1 is a flow chart of a data sampling processing method provided by an embodiment of the present invention. Figure 1 As shown, the data sampling processing method provided by the embodiment of the present invention includes:
[0052] Step S1: Obtaining sampling table information of the backup strategy; the sampling table information includes sampling status and sampling type.
[0053] Step S2: If it is determined that the sampling inspection state is a waiting-for-spot inspection state, data in the waiting-for-spot inspection state is acquired, and a command corresponding to the sampling inspection type is executed on the data.
[0054] Step S3: Obtain the execution result of the command, and update the sampling inspection table information according to the execution result.
[0055] In step S1 above, the device obtains the backup policy's random inspection table information; the random inspection table information includes the random inspection status and random inspection type. The device can be a computer device that executes the method, such as a server or client. It should be noted that the acquisition and analysis of data in this embodiment of the present invention is authorized by the user.
[0056] Each record in the sampling inspection table can include the following information:
[0057] Number: used to identify each record.
[0058] Backup strategy: The backup strategy is the application that needs to be backed up, including: application name, application server that needs to be backed up, application content that needs to be backed up, and backup start time.
[0059] Application of backup strategy: that is, applying the above backup strategy.
[0060] Application level: Each application has a default level classification, which is ranked from important to unimportant: Class A applications are the most important, Class B applications are the second most important, Class C applications are the third most important, and Class D applications are the least important.
[0061] Inspection Status: refers to the inspection status of this backup policy, which can be: Never inspected, Inspected, Pending inspection, Inspecting, Not requiring inspection.
[0062] Latest spot check completion time: refers to the time point when the most recent spot check of this backup strategy was completed from the current moment.
[0063] The spot check table information may also include the spot check type, which includes data availability verification and medium availability verification; among which:
[0064] Data availability verification: In order to make the backup data usable normally, the backup data needs to be restored and verified.
[0065] Media availability verification: This means that you only need to verify whether the media containing the backup image of the backup data is available. You only need to call the verification media command through the backup software's API. The backup software reads the backup image and calculates whether the backup image is complete. There is no need to restore the backup data.
[0066] like Figure 2 As shown, the description is as follows:
[0067] 3.1 Start the sampling inspection task
[0068] Initiate random inspection tasks based on the information in the random inspection table. A polling mode can be used to periodically initiate random inspection tasks, making the task automated and eliminating the need for manual intervention.
[0069] 3.2 Obtaining the sampling inspection form
[0070] 3.3 retrieves the sampling inspection table from the database and returns it to 3.2. 3.2 makes a judgment based on the sampling inspection status. If the sampling inspection status of the backup policy is pending, it means that the sampling inspection of the backup policy is required for this sampling inspection task. The sampling inspection status is updated to in progress, and the sampling inspection task is started.
[0071] In the above step S2, if the device determines that the sampling state is the waiting-for-spot-inspection state, it obtains the data in the waiting-for-spot-inspection state and executes a command corresponding to the sampling type on the data.
[0072] The sampling inspection type includes medium availability verification; accordingly, executing a command corresponding to the sampling inspection type on the data includes:
[0073] A verification sampling command is executed on the data.
[0074] The sampling inspection type includes data availability verification; accordingly, executing a command corresponding to the sampling inspection type on the data includes:
[0075] The backup policy type of the data is obtained, and recovery commands are respectively executed on the data corresponding to the backup policy type.
[0076] The backup policy type includes a file backup policy type; accordingly, executing the recovery command on the data corresponding to the backup policy type includes:
[0077] The latest backup image corresponding to the file backup policy type is restored to the verification environment; the verification environment is pre-checked.
[0078] The backup policy type includes a database backup policy type; accordingly, executing the recovery command on the data corresponding to the backup policy type includes:
[0079] The database recovery script is called in the verification environment, and the database recovery script is used to interact with the backup software to realize database recovery; the verification environment is initialized in advance according to the database instance and database parameters.
[0080] Reference Figure 2 The instructions are as follows:
[0081] 3.4 Determine the verification environment based on the backup strategy type and sampling type
[0082] If the sampling check type is media availability verification, call the API verification sampling check command. Skip to 3.7 without going to 3.5.
[0083] If the sampling type is data availability verification, you need to call the API recovery command, which is divided into file backup policy type and database backup policy type. Both require restoring the backup data to the verification environment. You need to check the verification environment in advance.
[0084] 3.5 Check the verification environment
[0085] Based on the backup strategy and backup image, determine the size of the backup image. Use 3.6 to verify whether the size of the verification environment can be restored. If the backup strategy is a database, initialize it based on the database instance and database parameters. Existing proven technologies can be used to verify the verification environment, so I will not elaborate on this here.
[0086] 3.7 Execute the sampling inspection order
[0087] For the media availability verification type, you only need to start the API verification and sampling command in 3.8 and wait for the command execution result.
[0088] For the file backup policy type whose sampling type is data availability verification, execute 3.8API to control the backup software to restore the latest backup image corresponding to the file backup policy type to the verification environment.
[0089] For database backup policies with a random check type of data availability verification, you need to call the database recovery script in a verification environment that has been initialized and configured. The database recovery script automatically communicates with the backup software's API to complete the database recovery. The database recovery script can be pre-compiled and stored in the database.
[0090] In the above step S3, the device obtains the execution result of the command and updates the sampling inspection table information according to the execution result.
[0091] The obtaining of the execution result of the command and updating the sampling inspection table information according to the execution result includes:
[0092] Retrieving the restored files from the verification environment, and comparing the files with the file list in the latest backup image;
[0093] If it is determined that the comparison results of all comparison items are the same, the execution result is determined to be execution completed, and the sampling inspection table information is updated.
[0094] The obtaining of the execution result of the command and updating the sampling inspection table information according to the execution result includes:
[0095] The database is logged in the verification environment. If it is determined that the database recovery is complete, the execution result is determined to be execution completion, and the sampling inspection table information is updated.
[0096] like Figure 2 As shown, the description is as follows:
[0097] 3.9 Execution Check Results
[0098] After calling the command, get the command execution result.
[0099] For media availability verification: If the command execution result is completed (i.e. successful), it means that the random inspection of the backup policy is completed. Through 3.10, the random inspection status is updated to "already inspected", the random inspection time is updated to the current time, and it is written to the database.
[0100] For the file backup policy type whose sampling type is data availability verification: if the command execution result is execution completion (i.e. success), the restored file is obtained from the verification environment and compared with the file list in the latest backup image.
[0101] If the data file name, file size, and file timestamp are the same, the random inspection of the backup strategy is complete. In step 3.10, the random inspection status is updated to "completed", the random inspection time is updated to the current time, and the data is written to the database.
[0102] For a database backup policy with a sampling inspection type of data availability verification: If the command execution result is completed (i.e., successful), log in to the database in the verification environment. If the database recovery is confirmed to be complete, update the sampling inspection status to "Inspected" and the sampling inspection time to the current time through 3.10, and write it to the database.
[0103] It should be noted that if the execution result of the above command is incomplete (ie, failure), an alarm message may be generated, and the reason for the failure may be further generated to facilitate relevant personnel to investigate and handle the problem as soon as possible.
[0104] 3.11 Notification and Reporting
[0105] The main task is to record the verification results and notify the relevant system administrators. If any abnormalities occur in the random inspection, the relevant system administrators can be notified in a timely manner and intervene manually.
[0106] The data sampling processing method provided by the embodiment of the present invention obtains the sampling table information of the backup strategy; the sampling table information includes the sampling status and the sampling type; if it is determined that the sampling status is the pending sampling status, the data in the pending sampling status is obtained, and the command corresponding to the sampling type is executed on the data; the execution result of the command is obtained, and the sampling table information is updated according to the execution result. This can automatically complete the data sampling work, avoid erroneous operations caused by manual operations, and improve the efficiency of sampling task processing.
[0107] Furthermore, the sampling inspection type includes medium availability verification; accordingly, executing a command corresponding to the sampling inspection type on the data includes:
[0108] The verification sampling command is executed on the data. Please refer to the description of the above embodiment and no further details will be given.
[0109] The data sampling processing method provided by the embodiment of the present invention is applicable to data sampling processing of the sampling type being medium availability verification.
[0110] Furthermore, the sampling inspection type includes data availability verification; accordingly, executing a command corresponding to the sampling inspection type on the data includes:
[0111] The backup policy type of the data is obtained, and the recovery command is executed on the data corresponding to the backup policy type.
[0112] The data sampling processing method provided in the embodiment of the present invention is applicable to data sampling processing where the sampling type is data availability verification.
[0113] Furthermore, the backup policy type includes a file backup policy type; accordingly, executing the recovery command on the data corresponding to the backup policy type includes:
[0114] The latest backup image corresponding to the file backup policy type is restored to the verification environment; the verification environment has been pre-checked.
[0115] The data sampling processing method provided by the embodiment of the present invention is applicable to data sampling processing in which the backup policy type is a file backup policy type.
[0116] Furthermore, the backup policy type includes a database backup policy type; accordingly, executing the recovery command on the data corresponding to the backup policy type includes:
[0117] The database recovery script is called in the verification environment, and the database recovery script is used to interact with the backup software to restore the database. The verification environment is pre-initialized based on the database instance and database parameters. Please refer to the description of the above embodiment and will not be repeated here.
[0118] The data sampling processing method provided by the embodiment of the present invention is applicable to data sampling processing in which the backup policy type is a database backup policy type.
[0119] Furthermore, obtaining the execution result of the command and updating the sampling inspection table information according to the execution result includes:
[0120] The restored files are obtained from the verification environment, and the files are compared with the file list in the latest backup image. Please refer to the description of the above embodiment and no further details will be given.
[0121] If it is determined that the comparison results of all comparison items are the same, the execution result is determined to be completed, and the sampling inspection table information is updated.
[0122] The data sampling processing method provided by the embodiment of the present invention can adapt to the data sampling processing of the file backup strategy type.
[0123] Furthermore, obtaining the execution result of the command and updating the sampling inspection table information according to the execution result includes:
[0124] The database is logged in the verification environment, and if it is determined that the database recovery is complete, the execution result is determined to be execution complete, and the sampling inspection table information is updated.
[0125] The data sampling processing method provided by the embodiment of the present invention can adapt to the data sampling processing of the database backup strategy type.
[0126] Furthermore, before the step of obtaining the sampling table information of the backup strategy, the data sampling processing method further includes:
[0127] A backup strategy is obtained, and corresponding backup strategy updating steps are performed according to a comparison result between the backup strategy and the pre-stored backup strategy in the sampling inspection table information.
[0128] like Figure 3 As shown, the description is as follows:
[0129] For the sampling table for obtaining the backup strategy: the backup strategy is obtained from the database, and based on the comparison result between the backup strategy and the pre-stored backup strategy in the sampling table information, the corresponding backup strategy update steps are performed, including:
[0130] There is no need to update the backup policies that already exist in the sampling inspection table.
[0131] For backup strategies that are not in the sampling inspection table, add the backup strategies to the sampling inspection table.
[0132] For backup policies that do not exist in the backup policy table but exist in the random inspection table, random inspection is no longer required and the random inspection status needs to be updated to "no need for random inspection".
[0133] The data sampling processing method provided by the embodiment of the present invention can ensure the synchronization consistency between the acquired backup strategy and the pre-stored backup strategy in the sampling table information.
[0134] Furthermore, the sampling inspection table information includes an application level of the backup strategy, and the application level reflects the importance of the application; after the step of executing the corresponding backup strategy update step, the data sampling inspection processing method further includes:
[0135] Determine the data sampling frequency and the sampling type according to the application level and the preset corresponding relationship; the preset corresponding relationship includes the corresponding relationship between the preset application level, the preset data sampling frequency and the preset sampling type;
[0136] Obtain the latest random inspection completion time of the backup strategy, and determine the time interval between the current time and the latest random inspection completion time;
[0137] If it is determined that the time interval is greater than or equal to the data sampling frequency, the sampling state is updated to the pending sampling state.
[0138] like Figure 3 As shown, the description is as follows:
[0139] For confirming sampling inspection requirements based on type:
[0140] For Class AB applications with a high degree of importance, the data sampling frequency is relatively high and can be selected as once a month; the sampling type is data availability verification.
[0141] For less critical CD applications, the data sampling frequency is lower, perhaps once every three months; the sampling type is media availability verification. The correspondence between the sampling frequency, sampling type, and application level can be stored in the database and modified based on actual circumstances.
[0142] By comparing the time interval between the latest sampling completion time of each backup strategy and the current time, determine whether the time interval has exceeded the data sampling frequency corresponding to the backup strategy: If the time interval is less than the data sampling frequency, it means that no new sampling work is required.
[0143] If the time interval is greater than or equal to the data sampling frequency, it means that the backup strategy needs to perform a new sampling inspection, and the sampling inspection status of the sampling inspection status that has never been sampled or has been sampled is updated to the waiting sampling inspection status.
[0144] The data sampling processing method provided by the embodiment of the present invention can ensure the timeliness of the sampling status update.
[0145] To form the final inspection list:
[0146] According to the above changes, the sampling inspection table information is updated again, the sampling inspection status and sampling inspection type, etc. are updated in the sampling inspection table, and written into the database.
[0147] Before the step of obtaining the backup strategy, the data sampling processing method further includes:
[0148] Automatically collected information, including:
[0149] Obtain backup policies and backup data through the backup software API.
[0150] The backup strategy can refer to the above description and will not be repeated here.
[0151] Backup data refers to the successful completion of data backup after the backup job is initiated according to the preset start time of the backup policy. The relevant information of this data includes: the application to which the data belongs, the backup policy, the backup time, the backup image, and the backup image retention media information.
[0152] A backup image is the smallest unit of backup data.
[0153] When starting the backup, the backup software compresses the data to be backed up into an image and stores it on the designated backup medium.
[0154] Backup media refers to the target environment where the backup data is finally stored, which can be on tape or disk.
[0155] A backup data set can contain a backup image. Sometimes, to protect data, the backup data needs to be stored redundantly, so the image is copied to another backup medium. In this case, the backup data will have more than one backup image.
[0156] The above relevant information can be obtained from the backup software at regular intervals and updated to the system's own database to provide basic data support for subsequent operations.
[0157] The method of the embodiment of the present invention has the following beneficial effects:
[0158] 1. A fully automatic backup data sampling process has been realized.
[0159] 2. Effectively reduce manual operations, thereby shortening the transfer operation time and reducing manual errors, effectively shortening the sampling inspection work time; at the same time, it can also independently and flexibly configure backup strategies, improve the sampling inspection coverage, and enhance the effectiveness of the sampling inspection work.
[0160] It should be noted that the data sampling and processing method provided in the embodiment of the present invention can be used in the financial field, and can also be used in any technical field other than the financial field. The embodiment of the present invention does not limit the application field of the data sampling and processing method.
[0161] Figure 4 FIG. 1 is a structural diagram of a data sampling processing device provided by an embodiment of the present invention. Figure 4 As shown, the data sampling processing device provided by the embodiment of the present invention includes an acquisition unit 401, an execution unit 402 and an update unit 403, wherein:
[0162] The acquisition unit 401 is used to obtain the sampling table information of the backup strategy; the sampling table information includes the sampling status and the sampling type; the execution unit 402 is used to obtain the data in the pending sampling state if it is determined that the sampling status is the pending sampling state, and execute the command corresponding to the sampling type on the data; the update unit 403 is used to obtain the execution result of the command and update the sampling table information according to the execution result.
[0163] Specifically, the acquisition unit 401 in the device is used to obtain the sampling table information of the backup strategy; the sampling table information includes the sampling status and the sampling type; the execution unit 402 is used to obtain the data in the pending sampling state if it is determined that the sampling status is the pending sampling state, and execute the command corresponding to the sampling type on the data; the update unit 403 is used to obtain the execution result of the command and update the sampling table information according to the execution result.
[0164] The data sampling processing device provided by the embodiment of the present invention obtains the sampling table information of the backup strategy; the sampling table information includes the sampling status and the sampling type; if it is determined that the sampling status is the waiting sampling status, the data in the waiting sampling status is obtained, and the command corresponding to the sampling type is executed on the data; the execution result of the command is obtained, and the sampling table information is updated according to the execution result. This can automatically complete the data sampling work, avoid erroneous operations caused by manual operations, and improve the efficiency of sampling task processing.
[0165] Furthermore, the random inspection type includes medium availability verification; accordingly, the execution unit 402 is specifically configured to:
[0166] A verification sampling command is executed on the data.
[0167] The data sampling processing device provided in the embodiment of the present invention is suitable for data sampling processing of the sampling type being medium availability verification.
[0168] Furthermore, the sampling inspection type includes data availability verification; accordingly, the execution unit 402 is specifically configured to:
[0169] The backup policy type of the data is obtained, and recovery commands are respectively executed on the data corresponding to the backup policy type.
[0170] The data sampling processing device provided in the embodiment of the present invention is suitable for data sampling processing where the sampling type is data availability verification.
[0171] Furthermore, the backup policy type includes a file backup policy type; accordingly, the execution unit 402 is further specifically configured to:
[0172] The latest backup image corresponding to the file backup policy type is restored to the verification environment; the verification environment is pre-checked.
[0173] The data sampling and processing device provided by the embodiment of the present invention is suitable for data sampling and processing when the backup policy type is a file backup policy type.
[0174] Furthermore, the backup policy type includes a database backup policy type; accordingly, the execution unit 402 is further specifically configured to:
[0175] The database recovery script is called in the verification environment, and the database recovery script is used to interact with the backup software to realize database recovery; the verification environment is initialized in advance according to the database instance and database parameters.
[0176] The data sampling processing device provided by the embodiment of the present invention is suitable for data sampling processing where the backup policy type is a database backup policy type.
[0177] Furthermore, the updating unit 403 is specifically configured to:
[0178] Retrieving the restored files from the verification environment, and comparing the files with the file list in the latest backup image;
[0179] If it is determined that the comparison results of all comparison items are the same, the execution result is determined to be execution completed, and the sampling inspection table information is updated.
[0180] The data sampling processing device provided by the embodiment of the present invention can adapt to the data sampling processing of the file backup strategy type.
[0181] Furthermore, the updating unit 403 is specifically configured to:
[0182] The database is logged in the verification environment. If it is determined that the database recovery is complete, the execution result is determined to be execution completion, and the sampling inspection table information is updated.
[0183] The data sampling processing device provided by the embodiment of the present invention can adapt to the data sampling processing of the database backup strategy type.
[0184] Furthermore, before the step of obtaining the sampling table information of the backup strategy, the data sampling processing device is further used to:
[0185] A backup strategy is obtained, and corresponding backup strategy updating steps are performed according to a comparison result between the backup strategy and the pre-stored backup strategy in the sampling inspection table information.
[0186] The data sampling and processing device provided by the embodiment of the present invention can ensure the synchronization consistency between the acquired backup strategy and the pre-stored backup strategy in the sampling table information.
[0187] Furthermore, the sampling inspection table information includes an application level of the backup strategy, and the application level reflects the importance of the application; after the step of executing the corresponding backup strategy update step, the data sampling inspection processing device is further used to:
[0188] Determine the data sampling frequency and the sampling type according to the application level and the preset corresponding relationship; the preset corresponding relationship includes the corresponding relationship between the preset application level, the preset data sampling frequency and the preset sampling type;
[0189] Obtain the latest random inspection completion time of the backup strategy, and determine the time interval between the current time and the latest random inspection completion time;
[0190] If it is determined that the time interval is greater than or equal to the data sampling frequency, the sampling state is updated to the pending sampling state.
[0191] The data sampling and processing device provided by the embodiment of the present invention can ensure the timeliness of updating the sampling status.
[0192] The data sampling processing device provided in the embodiment of the present invention can be used to execute the processing flow of the above-mentioned method embodiments. Its functions are not described in detail here, and reference can be made to the detailed description of the above-mentioned method embodiments.
[0193] Figure 5A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Figure 5 As shown, the electronic device includes: a processor 501, a memory 502 and a bus 503;
[0194] The processor 501 and the memory 502 communicate with each other via a bus 503.
[0195] The processor 501 is configured to call the program instructions in the memory 502 to execute the methods provided by the above method embodiments, for example, including:
[0196] Obtaining sampling table information of the backup strategy; the sampling table information includes sampling status and sampling type;
[0197] If it is determined that the sampling inspection state is a pending sampling inspection state, obtaining data in the pending sampling inspection state, and executing a command corresponding to the sampling inspection type on the data;
[0198] Obtain the execution result of the command, and update the sampling inspection table information according to the execution result.
[0199] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided in the above-mentioned method embodiments, for example, including:
[0200] Obtaining sampling table information of the backup strategy; the sampling table information includes sampling status and sampling type;
[0201] If it is determined that the sampling inspection state is a pending sampling inspection state, obtaining data in the pending sampling inspection state, and executing a command corresponding to the sampling inspection type on the data;
[0202] Obtain the execution result of the command, and update the sampling inspection table information according to the execution result.
[0203] This embodiment provides a computer-readable storage medium storing a computer program. The computer program enables the computer to execute the methods provided in the above method embodiments, for example, including:
[0204] Obtaining sampling table information of the backup strategy; the sampling table information includes sampling status and sampling type;
[0205] If it is determined that the sampling inspection state is a pending sampling inspection state, obtaining data in the pending sampling inspection state, and executing a command corresponding to the sampling inspection type on the data;
[0206] Obtain the execution result of the command, and update the sampling inspection table information according to the execution result.
[0207] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0208] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0209] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0210] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0211] Throughout this specification, reference to terms such as "one embodiment," "a specific embodiment," "some embodiments," "for example," "example," "specific example," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0212] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A data sampling processing method, characterized in that: include: Obtaining sampling table information of the backup strategy; the sampling table information includes sampling status and sampling type; If it is determined that the sampling inspection state is a pending sampling inspection state, obtaining data in the pending sampling inspection state, and executing a command corresponding to the sampling inspection type on the data; Obtaining the execution result of the command, and updating the sampling inspection table information according to the execution result; Before the step of obtaining the sampling table information of the backup strategy, the method further includes: Obtaining a backup strategy, and executing a corresponding backup strategy update step based on a comparison result between the backup strategy and a pre-stored backup strategy in the sampling table information; the sampling table information includes an application level of the backup strategy, the application level reflecting the importance of the application; Determine the data sampling frequency and the sampling type according to the application level and the preset corresponding relationship; the preset corresponding relationship includes the corresponding relationship between the preset application level, the preset data sampling frequency and the preset sampling type; Obtain the latest random inspection completion time of the backup strategy, and determine the time interval between the current time and the latest random inspection completion time; If it is determined that the time interval is greater than or equal to the data sampling frequency, the sampling state is updated to the pending sampling state.
2. The data sampling processing method according to claim 1, characterized in that: The sampling inspection type includes medium availability verification; accordingly, executing a command corresponding to the sampling inspection type on the data includes: A verification sampling command is executed on the data.
3. The data sampling processing method according to claim 1, characterized in that: The sampling inspection type includes data availability verification; accordingly, executing a command corresponding to the sampling inspection type on the data includes: The backup policy type of the data is obtained, and recovery commands are respectively executed on the data corresponding to the backup policy type.
4. The data sampling processing method according to claim 3, characterized in that: The backup policy type includes a file backup policy type; accordingly, executing the recovery command on the data corresponding to the backup policy type includes: The latest backup image corresponding to the file backup policy type is restored to the verification environment; the verification environment is pre-checked.
5. The data sampling processing method according to claim 3, characterized in that: The backup policy type includes a database backup policy type; accordingly, executing the recovery command on the data corresponding to the backup policy type includes: The database recovery script is called in the verification environment, and the database recovery script is used to interact with the backup software to realize database recovery; the verification environment is initialized in advance according to the database instance and database parameters.
6. The data sampling processing method according to claim 4, characterized in that: The obtaining of the execution result of the command and updating the sampling inspection table information according to the execution result includes: Retrieving the restored files from the verification environment, and comparing the files with the file list in the latest backup image; If it is determined that the comparison results of all comparison items are the same, the execution result is determined to be execution completed, and the sampling inspection table information is updated.
7. The data sampling processing method according to claim 5, characterized in that: The obtaining of the execution result of the command and updating the sampling inspection table information according to the execution result includes: The database is logged in the verification environment. If it is determined that the database recovery is complete, the execution result is determined to be execution completion, and the sampling inspection table information is updated.
8. A data sampling processing device, characterized in that: include: An acquisition unit, used to obtain the sampling table information of the backup strategy; The inspection table information includes inspection status and inspection type; an execution unit, configured to, if determining that the sampling inspection state is a pending sampling inspection state, obtain data in the pending sampling inspection state and execute a command corresponding to the sampling inspection type on the data; An updating unit, configured to obtain an execution result of the command and update the sampling inspection table information according to the execution result; Before the step of obtaining the sampling table information of the backup strategy, the data sampling processing device is further used to: Obtaining a backup strategy, and executing a corresponding backup strategy update step based on a comparison result between the backup strategy and a pre-stored backup strategy in the sampling table information; the sampling table information includes an application level of the backup strategy, the application level reflecting the importance of the application; Determine the data sampling frequency and the sampling type according to the application level and the preset corresponding relationship; the preset corresponding relationship includes the corresponding relationship between the preset application level, the preset data sampling frequency and the preset sampling type; Obtain the latest random inspection completion time of the backup strategy, and determine the time interval between the current time and the latest random inspection completion time; If it is determined that the time interval is greater than or equal to the data sampling frequency, the sampling state is updated to the pending sampling state.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Data processing method and apparatus
CN105930226A
Intelligent risk quality inspection method and system based on service auditing, and electronic equipment
CN112348521A