A method and apparatus for data backup based on a skip list
By using a skip list-based data backup method, the initial backup data is divided into blocks and hash values are calculated to build index information, which solves the problem of low data backup efficiency in scenarios with massive small files, and achieves efficient data storage and reliable data recovery.
Patent Information
- Application Number
- CN202511495721.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-10-20
AI Technical Summary
Existing data backup technologies are inefficient, have low storage space utilization, and are unreliable in scenarios with massive amounts of small files, failing to meet the high efficiency and low resource consumption requirements of NAS devices.
A skip list-based data backup method is adopted. By dividing the initial backup data into blocks, calculating hash values and storing descriptive information, skip list index information is constructed. Incremental backup is performed when updated data is received, and the skip list index information is used for fast location and storage.
It improves the efficiency of data backup and storage space utilization, and ensures the reliability, accuracy and ease of operation of data backup and recovery.
Smart Images

Figure CN121029496B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of digital information technology, and particularly relates to a data backup method and device based on a skip list. BACKGROUND
[0002] In the actual application of a NAS (Network Attached Storage) device, the data volume grows exponentially, especially in the scenario of mass small files, which urgently demands the efficiency, storage space utilization rate and reliability of data backup.
[0003] The current mainstream backup technology is divided into three types of full backup, incremental backup and differential backup. The full backup is simple to restore, but has high data duplication rate, large occupied space and long time consumption; the differential backup has performance between the full backup and the incremental backup, and still does not solve the efficiency problem under large-scale data; the incremental backup saves space and time, but has defects of long recovery dependency chain and single-point failure leading to backup chain failure. In addition, in the application of data structure, the existing backup system mostly adopts B + tree to organize metadata index, which has basic query capability, but needs a large number of disk I / O for deep traversal in the scenario of mass small files, and has slow backup speed; some schemes use hash table to record data changes, but need to maintain a large global hash index table, which consumes a large amount of memory and is difficult to adapt to the limited performance of the NAS device, that is, cannot meet the requirements of high efficiency and low resource consumption for large-scale data backup.
[0004] Therefore, how to break through the existing limitations and improve the efficiency and reliability of data backup and recovery is a problem that personnel in the field need to solve urgently. SUMMARY
[0005] Embodiments of the application provide a data backup method and device based on a skip list, aiming to improve the backup efficiency and the utilization rate of backup storage space, and at the same time guarantee the reliability, accuracy and operation convenience of data backup and recovery.
[0006] In a first aspect, the embodiments of the application provide a data backup method based on a skip list, which comprises:
[0007] In the case of receiving initial backup data, performing a blocking operation on the initial backup data to obtain a plurality of initial backup data blocks;
[0008] Calculating the hash value of each initial backup data block, and storing each initial backup data block and generating the storage description information of each initial backup data block;
[0009] constructing a skip list index information based on the hash values of the initial backup data blocks and the storage description information; wherein the skip list index information is composed of index nodes organized in a skip list form, each index node taking the hash value of a corresponding initial backup data block as a sorting key and storing the storage description information of the corresponding initial backup data block;
[0010] In a case where update backup data is received, performing an incremental backup operation on the update backup data based on the skip list index information.
[0011] Optionally, the performing of the incremental backup operation on the update backup data based on the skip list index information comprises:
[0012] performing a block operation on the update backup data to obtain a plurality of update backup data blocks;
[0013] calculating hash values of the update backup data blocks and determining a plurality of incremental backup data blocks in each of the update backup data blocks based on the hash values of the update backup data blocks and the skip list index information;
[0014] storing each of the incremental backup data blocks to obtain storage description information of each of the incremental backup data blocks;
[0015] updating the skip list index information based on the hash values of the incremental backup data blocks and the storage description information.
[0016] Optionally, after the constructing of the skip list index information based on the hash values of the initial backup data blocks and the storage description information, the method further comprises:
[0017] In a case where a backup data recovery request is received, determining a target backup data block based on the skip list index information;
[0018] performing a data reorganization operation on the target backup data block to obtain backup recovery data.
[0019] Optionally, the storage description information comprises storage location information and backup version information.
[0020] Correspondingly, the determining of the target backup data block based on the skip list index information comprises:
[0021] determining a target index node based on the skip list index information and target backup version information in the backup data recovery request;
[0022] determining a target data block storage file based on the storage location information stored in the target index node;
[0023] read the target data block storage file to obtain target backup data blocks.
[0024] Optionally, the initial backup data is divided into a plurality of initial backup data blocks, including:
[0025] The initial backup data is scanned based on a preset sliding window to obtain candidate block data content, and boundary identification information is determined based on the candidate block data content;
[0026] If the boundary identification information meets a preset boundary determination condition, the candidate block data content is determined as an initial backup data block;
[0027] If the boundary identification information does not meet the preset boundary determination condition, the initial backup data is continuously scanned to update the candidate block data content until the candidate block data content meets a preset scanning stop condition, and the candidate block data content is determined as an initial backup data block;
[0028] The above steps are repeatedly executed until full scanning of the initial backup data is completed.
[0029] Optionally, each of the initial backup data blocks is stored, and storage description information of each of the initial backup data blocks is generated, including:
[0030] Each of the initial backup data blocks is distributed to a corresponding storage node for persistent storage according to a preset storage strategy;
[0031] The storage location information of each of the initial backup data blocks is recorded, and the metadata information of each of the initial backup data blocks is generated;
[0032] The storage location information and the metadata information are associated and integrated to obtain the storage description information of each of the initial backup data blocks.
[0033] Optionally, the hash value of each of the initial backup data blocks and the storage description information are used to construct a skip list index information, including:
[0034] The hash value of each of the initial backup data blocks is used as a sorting key to construct a basic linked list layer of a skip list; wherein the basic linked list layer includes index nodes corresponding to all initial backup data blocks, and the index nodes store the storage description information of the corresponding initial backup data blocks;
[0035] A random layer height is generated for each of the index nodes in the basic linked list layer based on a preset probability algorithm, and a multi-layer index structure is constructed by expanding upward according to the random layer height to obtain a skip list index information.
[0036] In a second aspect, the embodiments of the present application provide a data backup device based on a skip list, the device comprising:
[0037] a data chunking module configured to, in a case where initial backup data is received, perform a chunking operation on the initial backup data to obtain a plurality of initial backup data chunks;
[0038] an information determining module configured to calculate a hash value of each of the initial backup data chunks and store each of the initial backup data chunks to obtain storage description information of each of the initial backup data chunks;
[0039] an index constructing module configured to construct skip list index information based on the hash value and the storage description information of each of the initial backup data chunks, wherein the skip list index information is composed of index nodes organized in a skip list form, each index node taking the hash value of a corresponding initial backup data chunk as a sorting key and storing the storage description information of the initial backup data chunk;
[0040] an incremental backup module configured to, in a case where updated backup data is received, perform an incremental backup operation on the updated backup data based on the skip list index information.
[0041] Optionally, the incremental backup module is specifically configured to:
[0042] perform a chunking operation on the updated backup data to obtain a plurality of updated backup data chunks;
[0043] calculate a hash value of each of the updated backup data chunks and determine a plurality of incremental backup data chunks in each of the updated backup data chunks based on the hash value of each of the updated backup data chunks and the skip list index information;
[0044] store each of the incremental backup data chunks to obtain storage description information of each of the incremental backup data chunks;
[0045] update the skip list index information based on the hash value and the storage description information of each of the incremental backup data chunks.
[0046] Optionally, the device is further configured to:
[0047] in a case where a backup data recovery request is received, determine a target backup data chunk based on the skip list index information;
[0048] perform a data reorganization operation on the target backup data chunk to obtain backup recovery data.
[0049] Optionally, the storage description information comprises storage location information and backup version information.
[0050] Correspondingly, the apparatus is further configured to:
[0051] In a case where a backup data recovery request is received, a target index node is determined based on the skip list index information and target backup version information in the backup data recovery request;
[0052] A target data block storage file is determined based on storage location information stored in the target index node;
[0053] The target data block storage file is read to obtain target backup data blocks;
[0054] Data reorganization is performed on the target backup data blocks to obtain backup recovery data.
[0055] Optionally, the data block module is specifically configured to:
[0056] In a case where initial backup data is received, candidate block data content is obtained by scanning the initial backup data based on a preset sliding window, and boundary identification information is determined based on the candidate block data content;
[0057] If the boundary identification information satisfies a preset boundary determination condition, the candidate block data content is determined as an initial backup data block;
[0058] If the boundary identification information does not satisfy the preset boundary determination condition, the initial backup data is continuously scanned to update the candidate block data content until the candidate block data content satisfies a preset scanning stop condition, and the candidate block data content is determined as an initial backup data block;
[0059] The above steps are repeatedly executed until full scanning of the initial backup data is completed.
[0060] Optionally, the information determination module is specifically configured to:
[0061] Hash values of each of the initial backup data blocks are calculated;
[0062] Each of the initial backup data blocks is distributed to a corresponding storage node for persistent storage according to a preset storage strategy;
[0063] Storage location information of each of the initial backup data blocks is recorded, and metadata information of each of the initial backup data blocks is generated;
[0064] The storage location information and the metadata information are associated and integrated to obtain storage description information of each of the initial backup data blocks.
[0065] Optionally, the index construction module is specifically configured to:
[0066] constructing a basic linked list layer of the skip list with the hash values of the initial backup data blocks as sorting keys; wherein the basic linked list layer comprises index nodes corresponding to all the initial backup data blocks, and the index nodes store storage description information of the corresponding initial backup data blocks;
[0067] generating random layer heights for each of the index nodes in the basic linked list layer based on a preset probability algorithm, and expanding and constructing a multi-layer index structure according to the random layer heights to obtain skip list index information.
[0068] In a third aspect, an electronic device is provided, which includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, and the program or instructions, when executed by the processor, implement the method of the first aspect.
[0069] In a fourth aspect, a readable storage medium is provided, which stores a program or instructions, and the program or instructions, when executed by a processor, implement the method of the first aspect.
[0070] In the embodiments of the present application, in the case of receiving initial backup data, the initial backup data is subjected to a blocking operation to obtain a plurality of initial backup data blocks; the hash values of the initial backup data blocks are calculated, and each of the initial backup data blocks is stored, and storage description information of each of the initial backup data blocks is generated; skip list index information is constructed based on the hash values and the storage description information of each of the initial backup data blocks; wherein the skip list index information is composed of index nodes organized in the form of a skip list, each index node takes the hash value of the corresponding initial backup data block as a sorting key, and stores the storage description information of the corresponding initial backup data block; in the case of receiving update backup data, the update backup data is subjected to an incremental backup operation based on the skip list index information. The above-mentioned skip list-based data backup method realizes the improvement of backup efficiency and the utilization rate of backup storage space, while guaranteeing the reliability, accuracy and operation convenience of data backup and recovery. BRIEF DESCRIPTION OF DRAWINGS
[0071] Figure 1 is a flowchart of a skip list-based data backup method provided by the embodiments of the present application;
[0072] Figure 2 is a flowchart of another skip list-based data backup method provided by the embodiments of the present application;
[0073] Figure 3 is a flowchart of a method for updating skip list index information provided by the embodiments of the present application;
[0074] Figure 4 is a flow diagram of another data backup method based on a skip list provided by an embodiment of the present application;
[0075] Figure 5 is a structural diagram of a data backup device based on a skip list provided by an embodiment of the present application;
[0076] Figure 6 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0077] In order to make the objectives, technical solutions and advantages of the present application clearer, the following will further describe the specific embodiments of the present application with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the contents. Before discussing the example embodiments in more detail, it should be mentioned that some example embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The processes can be terminated when the operations are completed, but can also have additional steps not included in the drawings. The processes can correspond to methods, functions, procedures, subroutines, etc.
[0078] The technical solutions in the embodiments of the present application will be described clearly with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art belong to the scope of protection of the present application.
[0079] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of a kind and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / ", generally means that the objects before and after are in an "or" relationship.
[0080] With reference to the accompanying drawings, the application will be described in detail below in conjunction with specific embodiments and application scenarios.
[0081] Firstly, the application is applicable to the scenario of backup storage of data. Based on the above use scenario, it can be understood that the execution subject of the application can be a client connected with a data storage device.
[0082] The data storage device can be a hardware or logical device with data persistence storage capability, for example, a network attached storage device. Specifically, the network attached storage device can be a special file storage device connected with a network and providing file level data storage service.
[0083] The client can be a terminal device or software process with data processing and network communication capability, and is an object generating data needing backup.
[0084] Figure 1 is a flow diagram of a data backup method based on a skip list provided by the application. As shown in Figure 1 , the method comprises the following steps:
[0085] S101, in the case of receiving initial backup data, performing block operation on the initial backup data to obtain a plurality of initial backup data blocks.
[0086] The initial backup data can be original data to be backed up submitted for the first time by a user or a business system, including but not limited to file data, database table data, log data or streaming data, etc., and the data format can be structured data, semi-structured data or unstructured data.
[0087] In one embodiment, the way of receiving initial backup data can adopt local file reading, network protocol transmission, application program interface calling or message queue subscription, etc.
[0088] The initial backup data block can be a data segment with independent storage and indexing significance obtained by block processing of the initial backup data, each data block contains part of the content of the original data, and the complete initial backup data can be restored by splicing all the data blocks.
[0089] In one embodiment, the way of performing block operation on the initial backup data to obtain a plurality of initial backup data blocks can adopt fixed size block algorithm to perform block operation on the initial backup data to obtain a plurality of initial backup data blocks with consistent size.
[0090] Optionally, the block operation on the initial backup data to obtain a plurality of initial backup data blocks comprises:
[0091] obtaining candidate chunk data content based on scanning the initial backup data according to a preset sliding window, and determining boundary identification information based on the candidate chunk data content;
[0092] If the boundary identification information satisfies a preset boundary determination condition, the candidate chunk data content is determined as an initial backup data chunk.
[0093] If the boundary identification information does not satisfy the preset boundary determination condition, the initial backup data is continuously scanned to update the candidate chunk data content until the candidate chunk data content satisfies a preset scanning stop condition, and the candidate chunk data content is determined as an initial backup data chunk.
[0094] The above steps are repeatedly performed until full scanning of the initial backup data is completed.
[0095] The preset sliding window can be a memory buffer with a fixed byte length, used for local content extraction and analysis of the initial backup data, and the length can be preset according to data characteristics (for example, 48 bytes or 64 bytes).
[0096] The candidate chunk data content can be a continuous data segment from a current scanning start point (i.e., the end position of the last initial backup data chunk) to the end position covered by the preset sliding window at the current time.
[0097] In an embodiment, the manner of obtaining candidate chunk data content based on scanning the initial backup data according to a preset sliding window can be to start the preset sliding window from the start position of the initial backup data, move the preset sliding window by a preset sliding window length step by step, and determine the continuous data segment between the current scanning start point and the end position covered by the preset sliding window at the current time as the candidate chunk data content.
[0098] The boundary identification information can be a feature value calculated based on the candidate chunk data content, used to determine whether the end position covered by the preset sliding window at the current time is suitable as a chunk boundary.
[0099] In an embodiment, the manner of determining boundary identification information based on the candidate chunk data content can be to calculate the hash value of the candidate chunk data content as the boundary identification information.
[0100] The preset boundary determination condition can be a feature threshold or rule used to determine the chunk boundary, generally associated with the boundary identification information. For example, if the boundary identification information is a hash value, the preset boundary determination condition can be that the last N bits of the hash value are a preset binary sequence.
[0101] The boundary identification information satisfying the preset boundary determination condition can indicate that the candidate block data content is suitable for being an independent data block, and thus the candidate block data content can be directly determined as the initial backup data block.
[0102] The boundary identification information not satisfying the preset boundary determination condition can indicate that the candidate block data content is not suitable for being an independent data block, and thus the initial backup data needs to be continuously scanned to update the candidate block data content until the candidate block data content satisfies the preset scanning stop condition, and the candidate block data content is determined as the initial backup data block.
[0103] The preset scanning stop condition can include that the boundary identification information of the updated candidate block data content satisfies the preset boundary determination condition, and can also include a limit rule (for example, the length of the candidate block data content reaches the maximum data block length) for forcibly terminating the expansion of the current candidate block data content.
[0104] The full scanning of the initial backup data can mean that all the initial backup data is allocated to the corresponding initial backup data block, and there is no remaining data to be processed.
[0105] The advantage of the scheme is that the candidate block data content is obtained by scanning the initial backup data based on the preset sliding window, and the corresponding block determination logic is executed based on the boundary identification information of the candidate block data content, which can make the division of the data block more suitable for the content characteristics of the data itself, and only a small amount of associated data block is affected when the data is locally modified, reducing the redundant data transmission during incremental backup. At the same time, the preset scanning stop condition avoids the occurrence of abnormally sized data blocks, and the flexibility of block division and the efficiency of storage management are taken into account.
[0106] S102, calculate the hash value of each initial backup data block, store each initial backup data block, and generate the storage description information of each initial backup data block.
[0107] The hash value can be a fixed-length string obtained by calculating the data content by a hash algorithm, which is used as a unique digital fingerprint of the data content to quickly check the integrity and uniqueness of the data content.
[0108] In one embodiment, the way of calculating the hash value of each initial backup data block can be to calculate the data content of the initial backup data block by a hash algorithm (for example, SHA-256 algorithm, MD5 algorithm) to obtain the hash value thereof.
[0109] In one embodiment, the manner of storing each initial backup data block can be to store each initial backup data block in order according to the original logical order of each initial backup data block in the initial backup data.
[0110] The storage description information can be a set of structured information for identifying and locating the initial backup data block.
[0111] In one embodiment, the manner of generating the storage description information of each initial backup data block can be to automatically collect the storage node identifier after the storage of the initial backup data block is completed, and to generate a logical storage path based on the storage node identifier as the storage description information.
[0112] Optionally, the storing of each initial backup data block and the generating of the storage description information of each initial backup data block comprises:
[0113] distributing each initial backup data block to a corresponding storage node according to a preset storage strategy for persistent storage;
[0114] recording the storage location information of each initial backup data block and generating the metadata information of each initial backup data block;
[0115] associating and integrating the storage location information and the metadata information to obtain the storage description information of each initial backup data block.
[0116] The preset storage strategy can be a storage resource allocation rule for the internal storage of a network attached storage device, for example, storing large-size data blocks to a large-capacity partition, storing high-frequency access data blocks to a high-performance cache area, or dividing storage directories according to data block backup timestamps to realize ordered management.
[0117] The storage node can be a logical storage unit inside the network attached storage device.
[0118] The persistent storage can be a process of writing the initial backup data block from the client memory or temporary buffer to the non-volatile storage medium of the network attached storage device, and realizing long-term storage of data through the file system of the network attached storage device itself.
[0119] In one embodiment, the manner of distributing each initial backup data block to the corresponding storage node for persistent storage according to the preset storage strategy can adopt establishing a connection with a network-attached storage device through a network file protocol, determining the storage node corresponding to each initial backup data block according to the preset storage strategy, writing the initial backup data block into the physical storage area corresponding to the storage node through the network file protocol, and completing the persistent landing of data by the network-attached storage device. In the process of writing the initial backup data block into the physical storage area corresponding to the storage node through the network file protocol, CRC32 check can be performed.
[0120] The storage location information can be a logical storage path used to locate the specific position of the data block in the network-attached storage device.
[0121] In one embodiment, the manner of recording the storage location information of each initial backup data block can adopt returning the logical storage path in the file system of the network-attached storage device as the storage location information after the initial backup data block is written into the corresponding storage node of the network-attached storage device.
[0122] The metadata information can be auxiliary information describing the attributes of the initial backup data block, and can include the data block size, the backup task identification to which the data block belongs, and the logical serial number in the original initial backup data.
[0123] In one embodiment, the manner of generating the metadata information of each initial backup data block can adopt collecting by the client in the process of writing the initial backup data block.
[0124] In one embodiment, the manner of associating and integrating the storage location information and the metadata information to obtain the storage description information of each initial backup data block can adopt encapsulating the storage location information and the metadata information into a unified structure (such as JSON format) as the storage description information of each initial backup data block.
[0125] The advantage of this scheme is that the storage location information and the metadata information of the initial backup data block are associated and integrated to obtain the storage description information of each initial backup data block, which not only realizes the accurate positioning and fast access of the data block in a single device, but also completes the integrity check and logical relationship tracing of the data block with the help of the metadata, thereby improving the backup collaboration and data management efficiency.
[0126] S103, constructing a skip list index information based on the hash value and the storage description information of each initial backup data block; wherein the skip list index information is composed of index nodes organized in the form of a skip list, each index node takes the hash value of the corresponding initial backup data block as the sorting key, and stores the storage description information of the corresponding initial backup data block.
[0127] The skip list index information is composed of index nodes organized in a skip list form. Specifically, the skip list can be a data structure composed of multiple layers of ordered linked lists, the bottom layer being a basic linked list containing all index nodes, and the upper layer being a sparse index layer based on the bottom layer linked list, achieving fast query through the inter-node pointer association; the index node can be a basic unit carrying data in the skip list, each index node containing key value information (i.e. sorting key, specifically the hash value of the corresponding initial backup data block), associated data (storage description information of the corresponding initial backup data block), and multiple layers of pointers pointing to other index nodes (used to establish index association in different levels).
[0128] Further, each index node takes the hash value of the corresponding initial backup data block as the sorting key. The sorting key can be a core identifier used to determine the logical position of the index node in the skip list.
[0129] Further, each index node stores the storage description information of the corresponding initial backup data block. The storage description information, as the associated data of the index node, forms a key-value pair relationship with the hash value. When the target index node is located through the hash value, the storage description information can be directly obtained from the target index node, and then the initial backup data and / or incremental backup data block can be quickly located.
[0130] In one embodiment, the process of constructing the skip list index information based on the hash value and the storage description information of each initial backup data block can include constructing a basic linked list layer of the skip list with the hash value of each initial backup data block as the sorting key, generating a random layer height for each index node in the basic linked list layer based on a preset probability algorithm, and expanding and constructing a multi-layer index structure according to the random layer height to obtain the skip list index information.
[0131] Optionally, constructing the skip list index information based on the hash value and the storage description information of each initial backup data block includes:
[0132] constructing a basic linked list layer of the skip list with the hash value of each initial backup data block as the sorting key; wherein the basic linked list layer includes index nodes corresponding to all initial backup data blocks, and the index nodes store the storage description information of the corresponding initial backup data block;
[0133] generating a random layer height for each index node in the basic linked list layer based on a preset probability algorithm, and expanding and constructing a multi-layer index structure according to the random layer height to obtain the skip list index information.
[0134] The basic linked list layer can refer to a bottom layer ordered linked list containing all index nodes in the skip list, and is a basic carrier of the entire index structure. The index nodes of all initial backup data blocks are sequentially arranged according to the sorting rule of the hash value, and each index node forms a unidirectional or bidirectional association with an adjacent index node through a pointer.
[0135] In an embodiment, the manner of constructing the basic linked list layer of the skip list with the hash value of each initial backup data block as a sorting key can include the following steps: first, sorting all the hash values of the initial backup data blocks; then, creating index nodes in sequence according to the sorting result, and writing the storage description information of the corresponding initial backup data block into each index node; and finally, connecting adjacent index nodes in sequence through a pointer to form a continuous basic linked list, which is the basic linked list layer of the skip list.
[0136] The preset probability algorithm can be a probability distribution algorithm for randomly generating the layer height of the index node, and generally adopts a geometric distribution model. For example, the probability of the index node expanding by one layer upward is set to 1 / 2, and the algorithm is used to control the sparsity of the index nodes in each layer.
[0137] The random layer height can be the number of layers that each index node expands upward in the skip list, and is a key parameter for determining the position of the index node in the multi-layer index structure.
[0138] In an embodiment, the manner of generating the random layer height of each index node in the basic linked list layer based on the preset probability algorithm can include the following steps: for each index node, a random number between 0 and 1 is generated by a pseudo-random number generator; if the random number is less than a preset probability threshold (for example, 0.5), the current layer height is increased by 1, and the process is repeated until the random number does not satisfy the condition of being less than the preset probability threshold; and finally, the cumulative number of layers obtained is the random layer height of the index node.
[0139] The multi-layer index structure can be a plurality of sparse indexes constructed above the basic linked list layer, each layer consisting of part of the index nodes, and the index nodes in the upper layer being a subset of the index nodes in the lower layer. The index nodes are associated in order through lateral pointers between the index nodes, and are used for quickly locating a target index node.
[0140] In an embodiment, the manner of expanding upward to construct the multi-layer index structure according to the random layer height to obtain the skip list index information can include the following steps: determining the maximum layer height of the skip list (determined by the maximum value of the random layer height of all index nodes); and starting from the basic linked list layer, creating a pointer for each index node according to its random layer height and establishing an association with an index node adjacent in the same layer in the corresponding layer, to finally form a multi-layer index structure with full amount in the bottom layer and sparsity in the upper layer, i.e., the skip list index information.
[0141] The advantage of the scheme is that the hash value of each initial backup data block is used as the sorting key to construct the base linked list layer of the skip list, and the random layer height is generated for each index node in the base linked list layer based on the preset probability algorithm, and the multi-layer index structure is constructed by expanding upwards according to the random layer height to obtain the skip list index information, which not only guarantees the integrity of the index through the base linked list layer, but also greatly improves the query speed of the hash value matching by means of the multi-layer sparse index, and provides high-performance support for the data block comparison and index in the subsequent incremental backup and the index query of the backup recovery.
[0142] Optionally, the method further comprises: calculating the hash value of the stored backup data block according to a preset period, and verifying the skip list index information based on the hash value of the stored backup data block; and in the case of verification failure, reconstructing the skip list index information based on the hash value of the stored backup data block and the storage information.
[0143] The method further comprises: generating backup skip list index information based on the skip list index information; in the case of change of the skip list index information, updating the backup skip list index information based on the skip list index information; and in the case of inaccessible of the skip list index information, replacing the skip list index information with the backup skip list index information.
[0144] S104, in the case of receiving the updated backup data, performing an incremental backup operation on the updated backup data based on the skip list index information.
[0145] The updated backup data can be the to-be-backed-up data formed after the initial backup data is modified, added or deleted.
[0146] In one embodiment, the way of receiving the updated backup data can adopt local file reading, network protocol transmission, application program interface calling or message queue subscription, etc.
[0147] In one embodiment, the way of performing the incremental backup operation on the updated backup data based on the skip list index information can adopt the way of performing block operation on the updated backup data to obtain a plurality of updated backup data blocks, calculating the hash value of each updated backup data block, and determining a plurality of incremental backup data blocks in each updated backup data block based on the hash value of each updated backup data block and the skip list index information, storing each incremental backup data block, obtaining the storage description information of each incremental backup data block, and updating the skip list index information based on the hash value of each incremental backup data block and the storage description information.
[0148] In the embodiment of the present application, in the case of receiving initial backup data, the initial backup data is subjected to a block operation to obtain a plurality of initial backup data blocks; the hash value of each initial backup data block is calculated, each initial backup data block is stored, and the storage description information of each initial backup data block is generated; the skip list index information is constructed based on the hash value and the storage description information of each initial backup data block; wherein the skip list index information is composed of index nodes organized in the form of a skip list, each index node takes the hash value of the corresponding initial backup data block as the sorting key, and stores the storage description information of the corresponding initial backup data block; in the case of receiving update backup data, the update backup data is subjected to an incremental backup operation based on the skip list index information. The above-mentioned data backup method based on a skip list realizes improving the backup efficiency and the utilization rate of the backup storage space, while guaranteeing the reliability, accuracy and operation convenience of data backup and recovery.
[0149] Figure 2 is another flowchart of a data backup method based on a skip list provided by the embodiment of the present application. As shown in Figure 2 , the specific steps include the following steps:
[0150] S201, in the case of receiving initial backup data, the initial backup data is subjected to a block operation to obtain a plurality of initial backup data blocks.
[0151] S202, the hash value of each initial backup data block is calculated, each initial backup data block is stored, and the storage description information of each initial backup data block is generated.
[0152] S203, the skip list index information is constructed based on the hash value and the storage description information of each initial backup data block; wherein the skip list index information is composed of index nodes organized in the form of a skip list, each index node takes the hash value of the corresponding initial backup data block as the sorting key, and stores the storage description information of the corresponding initial backup data block.
[0153] S204, in the case of receiving update backup data, the update backup data is subjected to a block operation to obtain a plurality of update backup data blocks.
[0154] Among them, the update backup data block can be a data segment with independent storage and indexing significance obtained by block processing the update backup data.
[0155] The manner of performing the chunking operation on the updated backup data to obtain a plurality of updated backup data chunks can be to perform the chunking operation on the updated backup data by a fixed-size chunking algorithm to obtain a plurality of updated backup data chunks of consistent size; or can be to obtain candidate chunked data content based on a preset sliding window scanning the updated backup data, and determine boundary identification information based on the candidate chunked data content, if the boundary identification information satisfies a preset boundary determination condition, the candidate chunked data content is determined as an updated backup data chunk, if the boundary identification information does not satisfy the preset boundary determination condition, the initial backup data is continuously scanned to update the candidate chunked data content, until the candidate chunked data content satisfies a preset scanning stop condition, and the candidate chunked data content is determined as an updated backup data chunk, the above steps are repeatedly executed until the full scanning of the updated backup data is completed.
[0156] S205, calculating a hash value of each of the updated backup data chunks, and determining a plurality of incremental backup data chunks in each of the updated backup data chunks based on the hash value of each of the updated backup data chunks and the skip list index information.
[0157] In one embodiment, the manner of calculating the hash value of each updated backup data chunk can be to calculate the hash value of the data content of the updated backup data chunk by a hash algorithm (such as SHA-256 algorithm, MD5 algorithm).
[0158] Among them, the incremental backup data chunk can be a data chunk in the updated backup data chunk, whose hash value does not have a matching item in the skip list index information, i.e. a data segment that is newly added or modified in content compared with the initial backup data chunk, which is the core data unit that needs to be stored incrementally.
[0159] In one embodiment, the manner of determining a plurality of incremental backup data chunks in each of the updated backup data chunks based on the hash value of each of the updated backup data chunks and the skip list index information can be to traverse each of the updated backup data chunks, take its hash value as a query key, and perform a quick search through the multi-layer index structure of the skip list index information, if the corresponding index node (i.e. the hash value does not have a matching item) is not found in the skip list index information, the updated backup data chunk is marked as an incremental backup data chunk, if the matching index node is found, the updated backup data chunk is determined not to be an incremental backup data chunk.
[0160] S206, storing each of the incremental backup data chunks to obtain storage description information of each of the incremental backup data chunks.
[0161] The storage of each incremental backup data block and the obtaining of the storage description information of each incremental backup data block can be performed in the following manner: each incremental backup data block is distributed to a corresponding storage node according to a preset storage strategy for persistent storage, the storage location information of each incremental backup data block is recorded, the metadata information of each incremental backup data block is generated, the storage location information and the metadata information are associated and integrated, and the storage description information of each incremental backup data block is obtained.
[0162] In S207, the skip list index information is updated based on the hash value and the storage description information of each incremental backup data block.
[0163] In one embodiment, the updating of the skip list index information based on the hash value and the storage description information of each incremental backup data block can be performed in the following manner: for each incremental backup data block, a new index node is created with the hash value as the sorting key, the corresponding storage description information is written into the index node, the index node is sequentially inserted into the base linked list layer, a random layer height is generated for the new index node by a preset probability algorithm, the insertion position corresponding to the hash value is found layer by layer, the pointer association between the new index node and the adjacent index node in the same layer is established, and the updating of the skip list index information is completed.
[0164] Figure 3 is a flowchart of updating skip list index information provided by the embodiments of the present application. The initial state (i.e., the skip list index information before updating): L1 is the base linked list layer, L2 and L3 are the upper sparse index layers, L1 contains the initial backup data block index nodes arranged in order according to the hash value (L1: 10→15→20), L2 contains the index nodes 10 and 20 (L2: 10→20), and L3 contains only one index node 0 (L3: 10). First, the incremental index node 25 is inserted: first, the incremental index node 25 is inserted into L1, and then a random layer height is generated for it according to a preset probability algorithm (such as the geometric distribution probability simulated by "coin tossing"), and it is assumed that the algorithm determines that the index node 25 needs to be expanded to the L2, L3, and L4 layers, so the skip list index information is updated to L1 (10→15→20→25), L2 (10→20→25), L3 (10→25), and L4 (25). Then, the incremental index node 40 is inserted: first, the incremental index node 40 is inserted into L1, and then a random layer height is generated for it according to a preset probability algorithm, and it is assumed that the algorithm determines that the index node 40 needs to be expanded to the L4 layer, so the skip list index information is updated to L1 (10→15→20→25→40), L2 (10→20→25), L3 (10→25), and L4 (25→40).
[0165] The advantage of this scheme is that based on the hash value of each updated backup data block and the skip list index information in each updated backup data block, a plurality of incremental backup data blocks are determined, based on the hash value of each incremental backup data block and the storage description information, the skip list index information is updated, which can realize targeted storage and index update of only the changed data block, reduces the data transmission and storage overhead of incremental backup, and through the dynamic update mechanism of the skip list, ensures the real-time and accuracy of the index information, so that the subsequent data query, recovery and other operations can quickly locate the target data block based on the latest index.
[0166] Figure 4 is a flow diagram of another data backup method based on a skip list provided by the embodiment of the application. As shown in Figure 4 , the method comprises the following steps:
[0167] S401, in the case of receiving initial backup data, performing a blocking operation on the initial backup data to obtain a plurality of initial backup data blocks.
[0168] S402, calculating the hash value of each initial backup data block, and storing each initial backup data block and generating storage description information of each initial backup data block.
[0169] S403, constructing skip list index information based on the hash value of each initial backup data block and the storage description information; wherein the skip list index information is composed of index nodes organized in the form of a skip list, each index node takes the hash value of the corresponding initial backup data block as the sorting key, and stores the storage description information of the corresponding initial backup data block.
[0170] S404, in the case of receiving updated backup data, performing incremental backup operation on the updated backup data based on the skip list index information.
[0171] S405, in the case of receiving a backup data recovery request, determining a target backup data block based on the skip list index information.
[0172] Wherein, the backup data recovery request can be an instruction initiated by a user or a business system to restore the backup data.
[0173] Wherein, the target backup data block can be a set of all backup data blocks required to complete the backup data recovery and matched with the recovery request.
[0174] In one embodiment, the way of determining the target backup data block based on the skip list index information can adopt determining the target physical storage address based on the storage location information stored in all index nodes in the skip list index information, and reading the corresponding data block storage file based on the target physical storage address to obtain the target backup data block.
[0175] Optionally, the storage description information includes storage location information and backup version information.
[0176] Correspondingly, the determining the target backup data block based on the skip list index information includes:
[0177] determining a target index node based on the skip list index information and the target backup version information in the backup data recovery request;
[0178] determining a target data block storage file based on the storage location information stored in the target index node;
[0179] reading the target data block storage file to obtain the target backup data block.
[0180] The backup version information can be characteristic information used for identifying a backup batch or a time point to which the backup data block belongs, including but not limited to a version number, a backup timestamp, an incremental backup sequence identifier, etc.
[0181] The target index node can be an index node in the skip list index information, in which the backup version information contained in the storage description information matches the target backup version information in the backup data recovery request.
[0182] In one embodiment, the way of determining the target index node based on the skip list index information and the target backup version information in the backup data recovery request can adopt taking the target backup version information in the backup data recovery request as a screening condition, traversing each index node in the skip list index information, checking whether the backup version information in the storage description information of each index node is consistent with the target backup version information, and determining the index node as the target index node if the backup version information is consistent with the target backup version information.
[0183] The target data block storage file can be a file used for saving the entity content of the target backup data block.
[0184] In one embodiment, the way of determining the target data block storage file based on the storage location information stored in the target index node can adopt directly locating the corresponding data block storage file through the storage location information stored in the target index node, and determining the data block storage file as the target data block storage file.
[0185] In one embodiment, the manner of reading the target data block storage file to obtain the target backup data block can be to open the target data block storage file and read all data contents therein as the target backup data block.
[0186] The advantage of this scheme is that the storage description information further includes backup version information, and the target backup data block is obtained based on the skip list index information and the target backup version information in the backup data recovery request, which can accurately filter the backup data block of a specific version, meet the recovery requirement of historical data in a multi-version backup scenario, and quickly locate the target data block storage file with the help of the efficient index searching capability of the skip list, thereby improving the efficiency and accuracy of data recovery.
[0187] S406, performing a data reorganization operation on the target backup data block to obtain backup recovery data.
[0188] The backup recovery data can be usable data that is consistent with the original backup data structure and complete in content and is restored by reorganizing the target backup data block, and can directly meet the application requirement of a user or a business system on the recovery data.
[0189] In one embodiment, the manner of performing a data reorganization operation on the target backup data block to obtain backup recovery data can be to sort the target backup data blocks according to their hash values, and sequentially splice the data contents of the target backup data blocks according to the sorting result to form continuous complete data (i.e., backup recovery data).
[0190] The advantage of this scheme is that, in the case of receiving a backup data recovery request, the target backup data block is determined based on the skip list index information, a data reorganization operation is performed on the target backup data block to obtain backup recovery data, and the required backup data block can be quickly located with the help of the efficient query capability of the skip list index, thereby reducing the data retrieval time in the recovery process.
[0191] Figure 5 FIG. 1 is a structural schematic diagram of a data backup device based on a skip list provided by an embodiment of the present application. As shown in FIG. 1, the device includes: Figure 5
[0192] The data chunking module 510 is configured to, in the case of receiving initial backup data, perform a chunking operation on the initial backup data to obtain a plurality of initial backup data chunks.
[0193] The information determination module 520 is configured to calculate the hash value of each initial backup data chunk, and store each initial backup data chunk to obtain storage description information of each initial backup data chunk.
[0194] The index construction module 530 is configured to construct a skip list index information based on the hash values of the initial backup data blocks and the storage description information; the skip list index information is composed of index nodes organized in a skip list form, each index node taking the hash value of a corresponding initial backup data block as a sorting key and storing the storage description information of the initial backup data block;
[0195] The incremental backup module 540 is configured to perform an incremental backup operation on the update backup data based on the skip list index information when the update backup data is received.
[0196] Optionally, the incremental backup module 540 is specifically configured to:
[0197] perform a block operation on the update backup data to obtain a plurality of update backup data blocks when the update backup data is received;
[0198] calculate the hash values of the update backup data blocks, and determine a plurality of incremental backup data blocks in each of the update backup data blocks based on the hash values of the update backup data blocks and the skip list index information;
[0199] store each of the incremental backup data blocks to obtain storage description information of each of the incremental backup data blocks;
[0200] update the skip list index information based on the hash values of the incremental backup data blocks and the storage description information.
[0201] Optionally, the apparatus is further configured to:
[0202] determine a target backup data block based on the skip list index information when a backup data recovery request is received;
[0203] perform a data reorganization operation on the target backup data block to obtain backup recovery data.
[0204] Optionally, the storage description information includes storage location information and backup version information.
[0205] Correspondingly, the apparatus is further configured to:
[0206] determine a target index node based on the skip list index information and target backup version information in the backup data recovery request when the backup data recovery request is received;
[0207] determine a target physical storage address based on the storage location information stored in the target index node;
[0208] read a corresponding data block storage file based on the target physical storage address to obtain a target backup data block.
[0209] performing a data reorganization operation on the target backup data block to obtain backup recovery data.
[0210] Optionally, the data block module 510 is specifically configured to:
[0211] In the case of receiving initial backup data, candidate block data content is obtained by scanning the initial backup data based on a preset sliding window, and boundary identification information is determined based on the candidate block data content;
[0212] If the boundary identification information meets a preset boundary determination condition, the candidate block data content is determined as an initial backup data block;
[0213] If the boundary identification information does not meet the preset boundary determination condition, the initial backup data is continuously scanned to update the candidate block data content until the candidate block data content meets a preset scanning stop condition, and the candidate block data content is determined as an initial backup data block;
[0214] The above steps are repeatedly executed until full scanning of the initial backup data is completed.
[0215] Optionally, the information determination module 520 is specifically configured to:
[0216] Calculate the hash value of each initial backup data block;
[0217] Distribute each initial backup data block to a corresponding storage node for persistent storage according to a preset storage strategy;
[0218] Record the storage location information of each initial backup data block, and generate metadata information of each initial backup data block;
[0219] Integrate the storage location information and the metadata information to obtain storage description information of each initial backup data block.
[0220] Optionally, the index construction module 530 is specifically configured to:
[0221] The hash value of each initial backup data block is used as a sorting key to construct a basic linked list layer of a skip list; wherein the basic linked list layer includes index nodes corresponding to all initial backup data blocks, and the index nodes store storage description information of the corresponding initial backup data blocks;
[0222] A random layer height is generated for each index node in the basic linked list layer based on a preset probability algorithm, and a multi-layer index structure is constructed by expanding upwards according to the random layer height to obtain skip list index information.
[0223] In the embodiment of the present application, the data block module is configured to perform a block operation on the initial backup data to obtain a plurality of initial backup data blocks when the initial backup data is received; the information determination module is configured to calculate a hash value of each initial backup data block and store each initial backup data block to obtain storage description information of each initial backup data block; the index construction module is configured to construct a skip list index information based on the hash value and the storage description information of each initial backup data block; wherein the skip list index information is composed of index nodes organized in a skip list form, each index node takes the hash value of the corresponding initial backup data block as a sorting key, and stores the storage description information of the initial backup data block; and the incremental backup module is configured to perform an incremental backup operation on the update backup data based on the skip list index information when the update backup data is received. The above-mentioned data backup device based on the skip list can improve the backup efficiency and the utilization rate of the backup storage space, while ensuring the reliability, accuracy and operation convenience of data backup and recovery.
[0224] The data backup device based on the skip list in the embodiment of the present application can be a device, a component, an integrated circuit or a chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not limited specifically.
[0225] The data backup device based on the skip list in the embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, an IOS operating system or other possible operating systems, and the embodiment of the present application is not limited specifically.
[0226] The data backup device based on the skip list provided by the embodiment of the present application can implement the processes implemented by each of the above-mentioned embodiments, and thus details are not repeated here.
[0227] Figure 6 is a structural schematic diagram of an electronic device provided by the embodiment of the present application. As shown inFigure 6 As shown, the electronic device 600 according to the embodiment of the present application includes a processor 601 and a memory 602. The memory 602 stores programs or instructions which, when executed by the processor 601, implement the processes of the above-mentioned embodiments of the method for data backup based on a skip list and achieve the same technical effects. To avoid repetition, details are not described herein again.
[0228] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device described above.
[0229] The embodiments of the present application further provide a readable storage medium having programs or instructions stored thereon. The programs or instructions, when executed by a processor, implement the processes of the above-mentioned embodiments of the method for data backup based on a skip list and achieve the same technical effects. To avoid repetition, details are not described herein again.
[0230] The processor is the processor in the electronic device described in the above-mentioned embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, etc.
[0231] It should be noted that, in this document, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article, or apparatus that includes a list of elements not only includes those elements, but also includes other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element. In addition, it should be pointed out that the scope of the methods and apparatus in the embodiments of the present application is not limited to the order of performing the functions as shown or discussed, but can also include performing the functions in a substantially simultaneous manner or in a reverse order, for example, the described method can be performed in an order different from that described, and various steps can be added, omitted, or combined. In addition, features described with reference to certain examples can be combined in other examples.
[0232] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned example method can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product in essence or in the form of a computer software product that contributes to the prior art. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disc, optical disc), and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, or network device, etc.) execute the method described in each embodiment of the present application.
[0233] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative and not restrictive. Those skilled in the art can make many forms without departing from the scope of the present application and the protection scope of the claims under the inspiration of the present application, which all belong to the protection scope of the present application.
[0234] The above are only the preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions made by those skilled in the art will not deviate from the scope of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application. The scope of the present application is determined by the scope of the claims.
Claims
1. A method for data backup based on a skip list, characterized by, The method comprises: In the case of receiving initial backup data, the initial backup data is subjected to a blocking operation to obtain a plurality of initial backup data blocks; The blocking operation of the initial backup data to obtain a plurality of initial backup data blocks comprises: scanning the initial backup data based on a preset sliding window to obtain candidate blocking data content, and determining boundary identification information based on the candidate blocking data content; if the boundary identification information meets a preset boundary determination condition, the candidate blocking data content is determined as an initial backup data block; if the boundary identification information does not meet the preset boundary determination condition, the initial backup data is continuously scanned to update the candidate blocking data content until the candidate blocking data content meets a preset scanning stop condition, and the candidate blocking data content is determined as an initial backup data block; the above steps are repeatedly executed until the full scan of the initial backup data is completed; The hash value of each initial backup data block is calculated, each initial backup data block is stored, and the storage description information of each initial backup data block is generated; A skip list index information is constructed based on the hash value and the storage description information of each initial backup data block; wherein the skip list index information is composed of index nodes organized in the form of a skip list, each index node takes the hash value of the corresponding initial backup data block as the sorting key, and stores the storage description information of the corresponding initial backup data block; In the case of receiving update backup data, the update backup data is subjected to an incremental backup operation based on the skip list index information; The incremental backup operation of the update backup data based on the skip list index information comprises: the update backup data is subjected to a blocking operation to obtain a plurality of update backup data blocks; the hash value of each update backup data block is calculated, and based on the hash value of each update backup data block and the skip list index information, a plurality of incremental backup data blocks are determined in each update backup data block; each incremental backup data block is stored to obtain the storage description information of each incremental backup data block; and the skip list index information is updated based on the hash value and the storage description information of each incremental backup data block.
2. The skip list-based data backup method according to claim 1, wherein, After the skip list index information is constructed based on the hash value and the storage description information of each initial backup data block, it further comprises: In the case of receiving a backup data recovery request, a target backup data block is determined based on the skip list index information; Data reorganization is performed on the target backup data block to obtain backup recovery data.
3. The skip list based data backup method of claim 2, wherein, The storage description information comprises storage location information and backup version information; Correspondingly, the determination of the target backup data block based on the skip list index information comprises: Based on the skip list index information and the target backup version information in the backup data recovery request, a target index node is determined; Based on the storage location information stored in the target index node, a target data block storage file is determined; The target data block storage file is read to obtain a target backup data block.
4. The skip list based data backup method of claim 1, wherein, The storing each initial backup data block and generating storage description information of each initial backup data block comprises: Distributing each initial backup data block to a corresponding storage node according to a preset storage strategy for persistent storage; Recording storage location information of each initial backup data block and generating metadata information of each initial backup data block; Integrating the storage location information and the metadata information to obtain storage description information of each initial backup data block.
5. The skip list based data backup method of claim 1, wherein, The constructing a skip list index information based on the hash value of each initial backup data block and the storage description information comprises: Taking the hash value of each initial backup data block as a sorting key, constructing a basic linked list layer of a skip list; wherein the basic linked list layer comprises index nodes corresponding to all initial backup data blocks, and the index nodes store the storage description information of the corresponding initial backup data blocks; Based on a preset probability algorithm, generating a random layer height for each index node in the basic linked list layer, and expanding and constructing a multi-layer index structure according to the random layer height to obtain skip list index information.
6. A skip list-based data backup apparatus characterized by comprising: The device comprises: A data blocking module configured to, in a case where initial backup data is received, perform a blocking operation on the initial backup data to obtain a plurality of initial backup data blocks; The data blocking module is specifically configured to: based on a preset sliding window, scan the initial backup data to obtain candidate blocking data content, and based on the candidate blocking data content, determine boundary identification information; if the boundary identification information satisfies a preset boundary determination condition, the candidate blocking data content is determined as an initial backup data block; if the boundary identification information does not satisfy the preset boundary determination condition, the initial backup data is continuously scanned to update the candidate blocking data content until the candidate blocking data content satisfies a preset scanning stop condition, and the candidate blocking data content is determined as an initial backup data block; repeat the above steps until the full scan of the initial backup data is completed; An information determination module configured to calculate the hash value of each initial backup data block and store each initial backup data block to obtain storage description information of each initial backup data block; An index construction module configured to construct a skip list index information based on the hash value of each initial backup data block and the storage description information; wherein the skip list index information is composed of index nodes organized in a skip list form, each index node takes the hash value of the corresponding initial backup data block as a sorting key, and stores the storage description information of the initial backup data block; An incremental backup module configured to, in a case where update backup data is received, perform an incremental backup operation on the update backup data based on the skip list index information. The incremental backup module is specifically configured to: perform a block operation on the updated backup data to obtain a plurality of updated backup data blocks; calculate a hash value of each of the updated backup data blocks, and determine a plurality of incremental backup data blocks in each of the updated backup data blocks based on the hash value of each of the updated backup data blocks and the skip list index information; store each of the incremental backup data blocks to obtain storage description information of each of the incremental backup data blocks; and update the skip list index information based on the hash value and the storage description information of each of the incremental backup data blocks.
7. An electronic device, comprising: A processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions being executed by the processor to implement the skip list-based data backup method according to any one of claims 1-5.
8. A readable storage medium, characterized by, A program or instructions are stored on the readable storage medium, and the program or instructions are executed by the processor to implement the skip list-based data backup method according to any one of claims 1-5.
Citation Information
Patent Citations
Data processing method and device, electronic equipment and medium
CN111125107A
Method for backing up data, equipment and computer program product.
CN112241336A