Continuous data protection method and device, electronic equipment and medium
By combining logical addresses with new version information in the storage system and using multiple index trees for data management, the problem that traditional snapshot methods cannot achieve high-density snapshots and high performance is solved, and efficient data version management and recovery capabilities are achieved.
Patent Information
- Application Number
- CN202410946866.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-26
AI Technical Summary
Traditional snapshot methods cannot meet high-performance requirements when implementing high-density continuous data protection, and due to memory limitations, truly high-frequency intensive snapshots cannot be achieved, resulting in degradation in storage system performance.
By combining logical addresses with new version information in the target volume of the storage system, using multiple index trees for data management, ensuring that different versions of data are stored in sequence, and using the b+tree index structure for efficient retrieval and storage, avoiding unnecessary IO overhead.
It realizes efficient data version management and recovery without affecting the performance of the storage system, supports from simple single point recovery to complex historical data recovery, and improves data access efficiency and system response speed.
Smart Images

Figure CN119025520A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a continuous data protection method, device, electronic device and medium. Background Art
[0002] CDP (Continuous Data Protection) is a method that can continuously capture or track any changes that occur to target data without affecting the operation of primary data, and can restore it to any previous time point.
[0003] Traditional snapshots are divided into COW (Copy-On-Write) snapshots and ROW
[0004] (Redirect-On-Write) snapshots. However, the three read and write operations of COW snapshots to modify metadata will greatly increase the latency of IO (Input / Output) access, reduce the host's access performance to storage, and cannot meet the needs of high-end users for low latency and high performance. Since the snapshot volume data mapping table of ROW snapshots stores the original copy of the source data volume, the read performance of a single machine will be significantly reduced, and the snapshot volume and the source volume have independent data structures. The storage system is limited by the size of the memory and cannot achieve truly high-frequency and dense snapshots. Therefore, the traditional snapshot method cannot truly achieve continuous protection and lossless performance of high-density snapshots. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the present disclosure provides a continuous data protection method, device, electronic device and medium. The technical solution of the present disclosure is as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, a continuous data protection method is provided, including:
[0007] When a write operation of the current version of data corresponding to the first logical address is performed on the target volume of the storage system, the first logical address is combined with the new version information to obtain a first logical address carrying the new version information; and a root address corresponding to the first logical address is searched from the root sets of multiple index trees corresponding to the target volume;
[0008] According to the root address corresponding to the first logical address, the new version of data corresponding to the write operation is used as the value, and the first logical address carrying the new version information is used as the key and stored in the first index tree, in which different versions of data corresponding to the first logical address are stored.
[0009] Optionally, in the case of accessing the latest data of the storage system, the method further includes:
[0010] receiving an access request; the access request carrying a second logical address issued by the host to the access request;
[0011] Determine a second index tree corresponding to the second logical address;
[0012] Determine the leftmost key of the second index tree as the key corresponding to the access request;
[0013] The latest data is obtained through the second index tree according to the key corresponding to the access request.
[0014] Optionally, in the case of accessing historical data of the storage system, the method further includes:
[0015] receiving an access request; the access request carrying a second logical address issued by the host to the access request;
[0016] Determine a second index tree corresponding to the second logical address;
[0017] Identifying historical version information of the historical data carried in the access request;
[0018] Determine the second logical address carrying the historical version information as the key corresponding to the access request;
[0019] The historical data is obtained through the second index tree according to the key corresponding to the access request.
[0020] Optionally, the first index tree stores different versions of data corresponding to the first logical address, including:
[0021] The first logical address carrying the new version information is used as a key and inserted into the first index tree in sequence; the insertion into the first index tree in sequence indicates that different versions of data corresponding to the first logical address are arranged in sequence in the first index tree.
[0022] Optionally, the inserting the first logical address carrying the new version information into the first index tree in sequence as a key includes:
[0023] The first logical address carrying the new version information is used as a key and inserted into the current leftmost position of the first index tree; the leftmost insertion indicates that the key corresponding to the historical version information is located to the right of the key corresponding to the new version information.
[0024] Optionally, combining the first logical address with the new version information includes:
[0025] The generation of the current storage system is obtained; the generation increases monotonically during the entire life cycle of the storage system; and the current generation is determined as the current new version information.
[0026] Optionally, querying the root address corresponding to the first logical address from the root sets of the plurality of index trees corresponding to the target volume includes:
[0027] Obtaining a management strategy of the index tree for the logical address;
[0028] Determine the number of the index tree that manages the first logical address based on the management policy according to the first logical address;
[0029] According to the number of the index tree, determine the root address corresponding to the first logical address from the root set; wherein the management strategy is used to determine the logical addresses managed by each index tree and each data corresponding to the logical address;
[0030] The method of storing the new version data corresponding to the write operation as a value and the first logical address carrying the new version information as a key in the first index tree corresponding to the root address according to the root address corresponding to the first logical address includes:
[0031] The data of the first logical address is distributed to the index tree through threads fixedly corresponding to the index tree; wherein the threads correspond to the index tree one by one, and the threads are independent of each other.
[0032] According to a second aspect of an embodiment of the present disclosure, there is provided a continuous data protection device, including:
[0033] A combining module, configured to combine the first logical address with the new version information to obtain a first logical address carrying the new version information when a write operation of the current version of data corresponding to the first logical address is performed on the target volume of the storage system;
[0034] A query module, configured to query a root address corresponding to the first logical address from a root set of multiple index trees corresponding to the target volume;
[0035] A storage module is used to store the new version of data corresponding to the write operation as a value and the first logical address carrying the new version information as a key in the first index tree according to the root address corresponding to the first logical address. The first index tree stores different versions of data corresponding to the first logical address.
[0036] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the continuous data protection method described in the first aspect are implemented.
[0037] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the continuous data protection method described in the first aspect are implemented.
[0038] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program, which implements the steps of the continuous data protection method described in the first aspect when executed by a processor. The present disclosure combines the generation and the logical address, so that data of different generations with the same logical address can be placed in the same index tree, and the sorting operation can be completed during the insertion process, and the host performs IO reading under the premise of order. Compared with the traditional snapshot method, the present disclosure does not increase unnecessary overhead due to the generation of CDP volumes, but after taking a snapshot of the original data, the data corresponding to each snapshot is stored in the same index tree of the same volume. By using the index tree structure, different versions of data can be efficiently indexed and retrieved. Different versions of data of each logical address are stored in the first index tree, so that any version of the data can be quickly located and accessed. When data recovery is required, the index tree can be used to quickly locate any specific version of the data, supporting simple single-point recovery to complex comprehensive historical data recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the description of the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 is a schematic diagram of the steps of a continuous data protection method shown in an embodiment of the present disclosure;
[0041] Figure 2 is a schematic diagram of a composite logical address shown in an embodiment of the present disclosure;
[0042] Figure 3 is a block diagram of a continuous data protection device shown in an embodiment of the present disclosure;
[0043] Figure 4is a schematic diagram of an electronic device shown in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0045] The terms "first", "second", etc. in the specification and claims of the present disclosure 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 interchangeable when appropriate, so that the embodiments of the present disclosure can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0046] The current IT information system carries more and more user services. All walks of life are realizing informatization and digitization. In particular, the financial, insurance, securities, medical and other industries have very high requirements for the stability of the entire IT system, data security and real-time system response. The storage system, as the bottom-level data storage part of the entire IT system, provides the functions of storing and accessing user data. The stability, reliability and performance of the storage system play a decisive role in the entire IT system.
[0047] Continuous data protection (CDP) is a method that can continuously capture or track any changes to target data without affecting the operation of primary data, and can restore to any previous time point. The CDP system can provide block-level, file-level and application-level backup, as well as unlimited and variable recovery points for recovery targets, providing an additional guarantee for the security of production data.
[0048] Traditional snapshots are divided into COW snapshots and ROW snapshots. After creating a snapshot in the COW snapshot method, if the data of the source volume changes, the snapshot system will first copy the original data to the corresponding data block on the snapshot volume, and then rewrite the source volume; the three read and write operations of modifying metadata (reading source data, writing source data to the snapshot volume, and writing new data to the source data volume) will greatly increase the latency of IO access, reduce the performance of host access to storage, and cannot meet the needs of high-end users for low latency and high performance. After creating a snapshot in the ROW snapshot method, the snapshot system redirects the write request to the data volume to the storage space reserved for the snapshot, and directly writes the new data to the snapshot volume; the original data is saved in the source volume; however, based on the implementation principle of ROW, the snapshot volume data mapping table of ROW saves the original copy of the source data volume, and the read performance of a single machine will be significantly reduced; and traditional ROW snapshots are generally implemented based on physical volumes. The snapshot volume and the source volume have independent data structures and can be independently mapped to the host for reading and writing. However, because they both have independent data structures, the storage system is limited by the size of the memory and cannot achieve truly high-frequency and intensive snapshots.
[0049] Therefore, although CDP can provide data protection from the storage level, in addition to data security, another very important indicator of the storage system is low latency and high performance. If the CDP function is not guaranteed by a good algorithm and implementation, it will ultimately not be able to be truly commercialized.
[0050] Therefore, in order to solve the above technical problems, the present disclosure proposes a continuous data protection method, which can achieve continuous data protection while ensuring the stability of the entire storage system, and the host's overhead for accessing the CDP type volume of the storage system will not be significantly increased compared to normal volumes.
[0051] Figure 1 FIG. 1 is a schematic diagram of the steps of a continuous data protection method shown in an embodiment of the present disclosure. Figure 1 As shown, the continuous data protection method may specifically include the following steps:
[0052] Step S11: when a write operation of the current version of data corresponding to the first logical address is performed on the target volume of the storage system, the first logical address is combined with the new version information to obtain a first logical address carrying the new version information.
[0053] The logical address is an abstract location where data is stored. It is decoupled from the physical address, making data management more flexible. Through the logical address, the system can accurately locate the data block stored on the hard disk.
[0054] Determine the logical address where the data will be written. This logical address is the logical address where the original data corresponding to the write operation is located.
[0055] To query the latest version of the current data, you can obtain the most recently written version number by accessing metadata or a dedicated version management database. Based on the latest version number, the system generates a new version number. This new version number is unique and can reflect the order in which the data is updated. This version number can be an increasing serial number or a more complex structure, such as a timestamp or GUID. This version number identifies the uniqueness of this write operation and its order in the data life cycle.
[0056] The first logical address is combined with the newly generated version number to create a new composite logical address, which can be done by adding a suffix, appending the version number to the logical address using a specific separator, or combining the two through a hash function to generate a new unique identifier, which can be specifically: logical address: version number, to ensure fast retrieval and space efficiency. This composite logical address not only points to the physical storage location, but also contains version control information. The new composite logical address can be stored in the metadata or index of the system, for example, by modifying the index table of the file system, a database, or any other form of metadata storage, for future retrieval and version control. After writing the data, a data integrity check can be performed to confirm the correctness and integrity of the data. For example, the original data and the data corresponding to the write operation can be identified; the original data and the write operation data can be aligned; when the original data and the write operation data are completely aligned, the write operation data is determined as the target data. At this time, the original data and the write operation data are completely aligned, which is characterized by: the write operation data completely covers the original data; when the original data and the write operation data are not completely aligned, the data of the unaligned part in the original data is read; the data of the unaligned part is merged into the write operation data; and the write operation data after merging with the original data is determined as the target data.
[0057] Figure 2 FIG. 1 is a schematic diagram of a composite logical address shown in an embodiment of the present disclosure. Figure 2 As shown, the logical address is described by a first number of bits, such as the 64 bits on the left; the version information is described by a second number of bits, such as the 24 bits on the left; the logical address of the first number of bits and the version information of the second number of bits are spliced to form a composite logical address; wherein the first number of bits of the logical address is on the left side of the composite logical address, and the second number of bits of the generation is on the right side of the composite logical address. The logical address includes lunid, reserved, treeid (5:8), treeid (0:4) and pageid; the version information is represented by genid.
[0058] Among them, in an optional embodiment, combining the first logical address with the new version information includes: obtaining the generation of the current storage system; the generation monotonically increases throughout the life cycle of the storage system; and determining the current generation as the current new version information.
[0059] A generation is added based on the original metadata structure. This generation is stored in a non-volatile medium, that is, this generation is a monotonically increasing serial number independent of the system time. During the entire life cycle of the storage, the generation must be monotonically increasing and will not change monotonically due to changes in the system timestamp.
[0060] Add a field to the existing metadata structure to store the generation, and this field can store all possible generation values that may appear during the life cycle of the system. At the beginning of the entire life cycle, the generation can start from a preset starting value, such as 0 or 1. And, if the system is distributed, ensure that the generation initial value on all components or nodes is synchronized to ensure that the same generation will not appear repeatedly.
[0061] Get the current generation. Since the generation is monotonically increasing, that is, the generations obtained at different times are different, and each generation is unique in the system, the new version information can be reflected by the current generation, and the generation can be directly determined as the new version information.
[0062] By adopting the embodiments of the present disclosure, by directly associating the data version with the generation of the storage system, the history of each version of the data can be tracked more accurately. The monotonically increasing generation mechanism ensures the consistency of the data version in the system, whether in data recovery, backup or synchronization. By combining the data version with the generation, a specific version of the data can be located more quickly in scenarios where data rollback or historical data access is required.
[0063] Step S12: querying the root address corresponding to the first logical address from the root sets of multiple index trees corresponding to the target volume.
[0064] Identify the target volume for storing data, which is the physical or logical storage area containing the required data files or data blocks. A target volume can be associated with one or more index trees, each corresponding to different types of data, different version control strategies, and different performance requirements. Each index tree has a root node, which contains pointers to other parts of the tree. The system needs to access the target volume's index tree root set, which can be a directory or a database table that lists all available root nodes.
[0065] The index tree uses a b+tree index structure, and each index tree can manage logical addresses. For example, the physical data of different logical addresses of a single volume can be divided into different trees according to certain rules (range, type, access frequency, etc.). The logical address can be mapped to a specific index tree through a hash algorithm. The hash algorithm can ensure the uniform distribution of data and reduce the possibility of overloading a certain tree. For example, the result of (\text{hash}(logical address)\mod n) can be used to select an index tree, where (n) is the number of index trees. Logical addresses of different ranges can be mapped to different index trees. For example, the first tree manages logical addresses from 0 to 999, the second tree manages logical addresses from 1000 to 1999, and so on.
[0066] The management strategy of the index tree for the logical address is encoded into the firmware or software of the storage system. When the data of a logical address is operated, for example, updated, accessed or added, the management strategy can be used to determine which index tree should be accessed based on the first logical address.
[0067] Step S13: According to the root address corresponding to the first logical address, the new version of the data corresponding to the write operation is used as the value, and the first logical address carrying the new version information is used as the key, and stored in the first index tree. The first index tree stores different versions of data corresponding to the first logical address.
[0068] The index tree uses the b+tree index structure. The core of storing data through b+tree is that the data structure is in the form of key-value pairs. The "key" is used for sorting and searching, and the "value" is usually the actual data or a pointer to the data. In b+tree, all keys are ordered, which allows search, insertion, and deletion operations to be completed in logarithmic time. In the database, the key-value pair format allows the system to lock and operate data more accurately when executing transactions and handling concurrent access. For example, you can lock the leaf node containing a specific key instead of the entire database or table.
[0069] Based on the characteristics of b+tree, the logical address combined with the new version information is used as a new key for data storage and retrieval in the index tree. This key not only locates the data, but also identifies its version, and ensures accurate tracking and management of data versions.
[0070] The data in the volume can be classified by logical addresses, and the data at different logical addresses can be managed through different index trees. The logical addresses managed by each index tree are stored. Therefore, using the first logical address, the corresponding root address is queried in the root set of multiple index trees corresponding to the target volume. This root address points to the index tree used to store the data corresponding to the write operation.
[0071] According to the queried root address, find the corresponding first index tree. Store the new version of data (as value) and the combined first logical address (as key) into this index tree. The selected index tree uses key-value pairs to store data. Each key corresponds to a version of data, and the first index tree can store multiple versions of data with the same logical address.
[0072] The index tree can be dynamically updated based on new write operations, such as adding new nodes, balancing the tree structure, etc., to maintain efficient data access performance. The system can adopt a version expiration strategy. For example, when a version of data is no longer needed, it can be deleted from the tree to save space and maintain the efficiency of the index tree. Among them, in an optional embodiment, querying the root address corresponding to the first logical address from the root set of multiple index trees corresponding to the target volume includes: obtaining the management policy of the index tree for the logical address; determining the number of the index tree that manages the first logical address based on the management policy according to the first logical address; determining the root address corresponding to the first logical address from the root set according to the number of the index tree; wherein the management policy is used to determine the logical addresses managed by each index tree and each data corresponding to the logical address; according to the root address corresponding to the first logical address, taking the new version of the data corresponding to the write operation as the value and the first logical address carrying the new version information as the key, storing them in the first index tree corresponding to the root address, includes: dividing the data of the first logical address into the index tree through a thread fixedly corresponding to the index tree; wherein the thread corresponds to the index tree one-to-one, and each thread is independent of each other.
[0073] Metadata is stored on the disk in a tree organization structure. If a single volume is carried by a single tree, the tree layer height will be very high, reading and writing will be very time-consuming, and random writes cannot be processed concurrently. Therefore, multiple trees can be used to manage data at different logical addresses, and a corresponding thread can be set for each tree. This thread is fixed, which improves the management of data in the storage space.
[0074] How the index tree manages the logical address can be determined by loading a storage policy configuration file or obtaining policy information from a management database. The management policy can determine how to allocate logical addresses to different index trees. According to the first logical address and the management policy, it is calculated which index tree is responsible for the logical address, which can be determined based on a hash algorithm, range partitioning, or other algorithms. The index tree number is calculated, and the root address of the index tree is found from the multiple index tree root sets of the target volume through the index tree number.
[0075] Through the thread that is fixedly corresponding to the index tree, the new version of the data (as a value) and the first logical address carrying the new version information (as a key) are stored in the index tree corresponding to the determined root address. Each thread specifically handles the data operation of an index tree, which can avoid conflicts and lock requirements during multi-threaded operations and improve system performance. For example, when the data of logical address 1 managed by index tree 1 is updated or added, in order to complete this operation, the updated or added data can be distributed to index tree 1 through thread 1; if the data of logical address 2 managed by index tree 2 is updated or added, in order to complete this operation, the updated or added data can be distributed to index tree 2 through thread 2. Since thread 1 and thread 2 are independent of each other, the update or addition of the data of logical address 1 managed by index tree 1 and the update or addition of the data of logical address 2 managed by index tree 2 can be performed synchronously.
[0076] By adopting the embodiments of the present disclosure, through a special management strategy and index tree structure, the system can quickly locate and retrieve data and reduce data access delay. Due to the one-to-one correspondence between threads and index trees, each thread only processes the write operation of one index tree, thereby reducing competition between threads and improving write efficiency. The way a single thread processes a single index tree reduces the risk of errors in data operations and enhances data consistency and security.
[0077] Using the embodiments of the present disclosure, by combining the logical address of each write operation with the new version information, a unique versioned logical address is created. This method can track and store multiple versions of the data, so that each modification of the data is saved as a new version instead of overwriting the old data, thereby providing more powerful data recovery capabilities and historical data tracing functions. Because each version is stored independently in the form of a key-value pair, the system can quickly access and restore to a specific old version of the data. Using multiple index trees to manage data versions at different logical addresses can optimize the data storage structure and improve data access speed. The index tree structure allows for fast search, insertion, and deletion operations, and multiple versions of data can be efficiently maintained. By using multiple index trees to manage data at different logical addresses, fine-grained version control can be performed on each logical address.
[0078] Among them, in an optional embodiment, the first index tree stores different versions of data corresponding to the first logical address, including: using the first logical address carrying the new version information as a key, and inserting it into the first index tree in sequence; the inserting it into the first index tree in sequence indicates that the different versions of data corresponding to the first logical address are arranged in sequence in the first index tree.
[0079] An index tree can be used to store and manage data containing multiple versions, allowing the system to add new versions of data without overwriting old data.
[0080] The first logical address carrying the new version information is used as the key. At this time, the key structure is preset. The key is generated according to the preset key structure combined with the version information and the logical address. The key and the data corresponding to the key are inserted into the first index tree in a certain order to ensure the normal order of the data. This order can be determined based on the version information or timestamp. Inserting the key carrying the version information into the index tree in order can ensure the logical consistency and retrieval efficiency of the data version.
[0081] By adopting the embodiments of the present disclosure, by storing different versions of data in order in the index tree, the system can manage multiple versions of data very efficiently and provide fast data access and recovery capabilities. Since the data versions are stored in order, efficient algorithms such as binary search can be used to quickly locate data of a specific version, greatly improving retrieval efficiency. The sequential insertion mechanism ensures the integrity and consistency of the data, and the relationship between each version is clear, which facilitates the execution of operations such as rollback.
[0082] Among them, in an optional embodiment, the first logical address carrying the new version information is used as a key and inserted into the first index tree in sequence, including: using the first logical address carrying the new version information as a key and inserting it at the current leftmost position of the first index tree; the leftmost insertion indicates that the key corresponding to the historical version information is located to the right of the key corresponding to the new version information.
[0083] Each key contains a first logical address and version information. The version information can be a timestamp, a serial number, or a monotonically increasing generation number, which is used to distinguish different versions of data at the same logical address.
[0084] In b+tree, data is inserted into the appropriate location of the tree to keep the data in order. The first logical address carrying the new version information is used as the key, and the keys are inserted in order. At this time, the order of key insertion is determined by the version information.
[0085] Find the most suitable position to insert the new key in the index tree. Determine the leftmost insertion point. The key of the new version must be inserted to the left of all existing historical version keys. That is, the key of the new version information is placed to the left of all existing keys. This ensures that the new version is always accessed first during traversal, and the historical version information is arranged in order.
[0086] After insertion, it can be verified that the key of the new version information is correctly located to the left of the keys of all related historical version information.
[0087] By using the embodiments of the present disclosure, the latest version information is used as the leftmost key to ensure that the information can be retrieved as quickly as possible, and the orderliness of historical data is maintained on the left side of the new data to ensure that historical queries can be performed in chronological order, which is suitable for applications that need to perform timeline analysis. Through special structural adjustments (such as leftmost insertion), the read and write performance of the tree can be optimized and the time to find a suitable insertion point can be reduced. Data version control can be supported so that each version of the data can be effectively tracked and managed.
[0088] Among them, in an optional embodiment, when accessing the latest data of the storage system, it also includes: receiving an access request; the access request carries a second logical address issued by the host to the access request; determining a second index tree corresponding to the second logical address; determining the leftmost key of the second index tree as the key corresponding to the access request; and obtaining the latest data through the second index tree according to the key corresponding to the access request.
[0089] An access request is accepted, where the access request can carry a designated logical address sent by the host, namely, a second logical address, where the second logical address is used to identify an address where data to be accessed is located.
[0090] In a volume, it is pre-set which logical addresses are managed by which index trees, and which logical addresses are managed by the index tree can be determined by the address range of the logical address or the type of data. Therefore, after receiving an access request, the second index tree determined by the second logical address can be determined based on the second logical address carried in the access request. This index tree stores all the data of the logical address, including various versions of a data. Each version of the data is stored in the form of a key-value pair through the index tree. As long as the key of the data is determined, the value of the data can be obtained through the index tree.
[0091] When the data to be accessed is the latest data of the second logical address, the key of the latest version of the data can be found from a specific position in the index tree. The keys of the newer versions of the data in the second index tree are inserted to the left of the second index tree. Therefore, the leftmost key of the second index tree is directly used as the key corresponding to the access request. The latest data of the second logical address can be obtained through this key. Specifically, the latest version of the data can be obtained by traversing the index tree and reading data.
[0092] By adopting the embodiments of the present disclosure, the system can quickly access the latest data by placing the data key position of the latest version on the far left of the second index tree. This design optimizes the data access path, reduces the search time, and significantly improves the response speed and processing power of the system. Moreover, since the system design includes a mechanism for directly locating the latest data, this reduces the time required to find specific data items in large data sets, thereby reducing the overall data access delay. In multi-version data management, by precisely controlling the index tree corresponding to each logical address, the system can ensure the consistency and integrity of the data. The design using logical addresses and index trees provides a good foundation for the expansion of the system.
[0093] Among them, in an optional embodiment, when accessing the historical data of the storage system, it also includes: receiving an access request; the access request carries a second logical address issued by the host to the access request; determining a second index tree corresponding to the second logical address; identifying historical version information of the historical data carried by the access request; determining the second logical address carrying the historical version information as the key corresponding to the access request; and obtaining the historical data through the second index tree according to the key corresponding to the access request.
[0094] An access request is accepted, where the access request can carry a designated logical address sent by the host, namely, a second logical address, where the second logical address is used to identify an address where data to be accessed is located.
[0095] According to the second logical address, the corresponding second index tree is located. The index tree is a data structure for managing data versions, and each node may represent data records of different versions.
[0096] The access request also carries specific historical version information, which can identify the specific data version that the user wants to access. Before obtaining the historical version information through the access request, it can be verified whether the requested version is open to the requester.
[0097] The system needs to parse the incoming access request and extract the version identifier, which can be achieved through the request parameters, headers or specific data fields. You can first confirm whether you need to retrieve data from the historical record by comparing the current version and the historical version. If it is confirmed that the user needs to access the historical version, the system checks whether the corresponding version exists based on the extracted version identifier. If the corresponding version exists, you can combine the historical version information with the second logical address to determine a specific key, which directly corresponds to a node in the index tree that stores the required historical data version. The index tree can be traversed according to the key (including the first logical address and version information) to determine the node corresponding to this key in the index tree.
[0098] The key obtained when accessing historical data at this time, which combines the historical version information and the second logical address, is combined in the same way as the key obtained when writing to update or add new data, which combines the new version information and the first logical address, and therefore has the same structure. Therefore, the second logical address combined with the historical version information can be used as a key to obtain the corresponding historical version of data from the index tree corresponding to the second logical address through this key.
[0099] By using the embodiments of the present disclosure, by combining the logical address and historical version information, the system can accurately access a specific data version in the storage system, avoiding redundant data searches and improving access efficiency. The use of the index tree optimizes the retrieval process of historical data. By maintaining detailed version information and index trees, the system can provide powerful data recovery capabilities in the event of data damage or loss.
[0100] In an optional embodiment, before storing the data version in the index tree, it is first checked whether there is a data version with the same content. If a version with the same content is found, only a reference or pointer can be stored instead of repeatedly storing the same data. In addition, the data stored in the index tree can be compressed, especially the historical data version can be compressed. A suitable compression algorithm can be selected, such as Zlib, Bzip2, LZ4, etc., and the most suitable compression level can be selected according to the characteristics of the data and the access frequency.
[0101] Figure 3 is a block diagram of a continuous data protection device shown in an embodiment of the present disclosure. Figure 3 As shown, the device comprises:
[0102] A combining module 310 is used to combine the first logical address with the new version information to obtain a first logical address carrying the new version information when a write operation of the current version of data corresponding to the first logical address is performed on the target volume of the storage system;
[0103] A query module 320, configured to query a root address corresponding to the first logical address from a root set of multiple index trees corresponding to the target volume;
[0104] The storage module 330 is used to store the new version of data corresponding to the write operation as a value and the first logical address carrying the new version information as a key in the first index tree according to the root address corresponding to the first logical address, wherein the first index tree stores different versions of data corresponding to the first logical address. Optionally, when accessing the latest data of the storage system, the device further includes: a receiving module for receiving an access request; the access request carries a second logical address issued by the host to the access request;
[0105] A first determining module, configured to determine a second index tree corresponding to the second logical address;
[0106] A second determination module is used to determine the leftmost key of the second index tree as the key corresponding to the access request; and an acquisition module is used to acquire the latest data through the second index tree according to the key corresponding to the access request.
[0107] Optionally, the device, in the case of accessing historical data of the storage system, further comprises: a receiving module, further configured to receive an access request; the access request carries a second logical address issued by the host to the access request;
[0108] The first determining module is further used to determine a second index tree corresponding to the second logical address;
[0109] An identification module, used to identify historical version information of the historical data carried by the access request;
[0110] The second determining module is further used to determine the second logical address carrying the historical version information as the key corresponding to the access request;
[0111] The acquisition module is further used to acquire the historical data through the second index tree according to the key corresponding to the access request.
[0112] Optionally, the storage module is specifically used to execute:
[0113] The first logical address carrying the new version information is used as a key and inserted into the first index tree in sequence; the insertion into the first index tree in sequence indicates that different versions of data corresponding to the first logical address are arranged in sequence in the first index tree.
[0114] Optionally, the storage module is specifically used to execute:
[0115] The first logical address carrying the new version information is used as a key and inserted into the current leftmost position of the first index tree; the leftmost insertion indicates that the key corresponding to the historical version information is located to the right of the key corresponding to the new version information.
[0116] Optionally, the combination module is specifically used to execute:
[0117] The generation of the current storage system is obtained; the generation increases monotonically during the entire life cycle of the storage system; and the current generation is determined as the current new version information.
[0118] Optionally, the query module is specifically used to execute:
[0119] Obtaining a management strategy of the index tree for the logical address;
[0120] Determine the number of the index tree that manages the first logical address based on the management policy according to the first logical address;
[0121] According to the number of the index tree, determine the root address corresponding to the first logical address from the root set; wherein the management strategy is used to determine the logical addresses managed by each index tree and each data corresponding to the logical address;
[0122] The storage module is specifically used to execute:
[0123] The data of the first logical address is distributed to the index tree through threads fixedly corresponding to the index tree; wherein the threads correspond to the index tree one by one, and the threads are independent of each other.
[0124] It should be noted that the system embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.
[0125] The present disclosure also provides an electronic device, referring to Figure 4 , Figure 4 Schematic diagram of an electronic device shown in an embodiment of the present disclosure. Figure 4 As shown, the electronic device 400 includes: a memory 410 and a processor 420. The memory 410 and the processor 420 are connected via a bus communication. A computer program is stored in the memory 410. The computer program can be run on the processor 420 to implement the steps in the continuous data protection method disclosed in the embodiment of the present disclosure.
[0126] The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the continuous data protection method disclosed in the embodiment of the present disclosure are implemented.
[0127] The embodiments of the present disclosure further provide a computer program product, including a computer program. When the computer program is executed by a processor, the steps in the continuous data protection method disclosed in the embodiments of the present disclosure are implemented.
[0128] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0129] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, devices or computer program products. Therefore, the embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0130] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, 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 terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. 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.
[0131] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps of the functions specified in a box or multiple boxes. Although some embodiments of the embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concepts. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present disclosure. The above is a detailed introduction to a continuous data protection method, device, electronic device and storage medium provided by the present disclosure. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core idea; at the same time, for those of ordinary skill in the art, according to the ideas of the present disclosure, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
Claims
1. A continuous data protection method, characterized in that: include: When a write operation of the current version of data corresponding to the first logical address is performed on the target volume of the storage system, the first logical address is combined with the new version information to obtain a first logical address carrying the new version information; Querying a root address corresponding to the first logical address from a root set of multiple index trees corresponding to the target volume; According to the root address corresponding to the first logical address, the new version data corresponding to the write operation is used as the value, and the first logical address carrying the new version information is used as the key and stored in the first index tree, in which different versions of data corresponding to the first logical address are stored.
2. The method according to claim 1, characterized in that: In the case of accessing the latest data in the storage system, it also includes: receiving an access request; the access request carrying a second logical address issued by the host to the access request; Determine a second index tree corresponding to the second logical address; Determine the leftmost key of the second index tree as the key corresponding to the access request; The latest data is obtained through the second index tree according to the key corresponding to the access request.
3. The method according to claim 1, characterized in that: In the case of accessing the historical data of the storage system, the method further includes: receiving an access request; the access request carrying a second logical address issued by the host to the access request; Determine a second index tree corresponding to the second logical address; Identifying historical version information of the historical data carried in the access request; Determine the second logical address carrying the historical version information as the key corresponding to the access request; The historical data is obtained through the second index tree according to the key corresponding to the access request.
4. The method according to claim 1, characterized in that: The first index tree stores different versions of data corresponding to the first logical address, including: The first logical address carrying the new version information is used as a key and inserted into the first index tree in sequence; the insertion into the first index tree in sequence indicates that different versions of data corresponding to the first logical address are arranged in sequence in the first index tree.
5. The method according to claim 4, characterized in that The step of inserting the first logical address carrying the new version information into the first index tree in sequence as a key includes: The first logical address carrying the new version information is used as a key and inserted into the current leftmost position of the first index tree; the leftmost insertion indicates that the key corresponding to the historical version information is located to the right of the key corresponding to the new version information.
6. The method according to claim 1, characterized in that The combining the first logical address with the new version information includes: Obtaining a generation of the current storage system; the generation increases monotonically throughout the life cycle of the storage system; The current generation is determined as the current new version information.
7. The method according to claim 1, characterized in that The querying the root address corresponding to the first logical address from the root sets of the plurality of index trees corresponding to the target volume includes: Obtaining a management strategy of the index tree for the logical address; Determine the number of the index tree that manages the first logical address based on the management policy according to the first logical address; Determine, from the root set, a root address corresponding to the first logical address according to the number of the index tree; Wherein, the management strategy is used to determine the logical addresses managed by each index tree and each data corresponding to the logical address; According to the root address corresponding to the first logical address, the new version data corresponding to the write operation is used as a value, and the first logical address carrying the new version information is used as a key to store the data in the first index tree corresponding to the root address, including: By means of a thread fixedly corresponding to the index tree, the data of the first logical address is distributed to the index tree; The threads correspond to the index trees one by one, and the threads are independent of each other.
8. A continuous data protection device, characterized in that: include: A combining module, configured to combine the first logical address with the new version information to obtain a first logical address carrying the new version information when a write operation of the current version of data corresponding to the first logical address is performed on the target volume of the storage system; A query module, configured to query a root address corresponding to the first logical address from a root set of multiple index trees corresponding to the target volume; A storage module is used to store the new version of data corresponding to the write operation as a value and the first logical address carrying the new version information as a key in the first index tree according to the root address corresponding to the first logical address. The first index tree stores different versions of data corresponding to the first logical address.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the continuous data protection method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the continuous data protection method according to any one of claims 1 to 7 are implemented.
