Data management method, device, equipment and medium

By generating and storing metadata information of logical block addresses, physical block addresses and time stamps, the problem of large data volume and complex management in incremental storage backup based on time periods is solved, and efficient data access and security management are achieved.

CN119148927BActive Publication Date: 2025-09-26INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411046520.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2025-09-26
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

In the prior art, when performing incremental storage backup based on time periods, the data volume is large, the management is complex, and the efficiency of reading data that has not been updated for a long time is low, and the storage space is unreasonable.

Method used

By generating and storing metadata information such as logical block address, physical block address and time stamp when receiving a write request, data within multiple time periods can be managed uniformly, and metadata records can be used to quickly find and delete data.

Benefits of technology

It improves data access efficiency, ensures that data within different time periods are saved, reduces storage space usage, simplifies the management process, and improves data security and access speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119148927B_ABST
    Figure CN119148927B_ABST
Patent Text Reader

Abstract

The present application provides a data management method, apparatus, device, and medium, relating to the field of data management technology, including: receiving a write request for a first logical block address; storing first data carried by the write request in a first physical block address, and using the first logical block address, the first physical block address, and a time stamp of a current first time period as metadata information of the first data; storing the metadata information in a metadata record corresponding to the first logical block address, the metadata record including metadata information of multiple data written to the first logical block address within multiple time periods, the metadata record of the first logical block address being used for searching or deleting data, thereby improving data access efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data management technology, and in particular to a data management method, apparatus, device and medium. Background Art

[0002] In today's society, data has become a crucial new factor of production, generating significant value. It is also an asset, even a core asset, for nations, governments, businesses, and individuals, making it incredibly valuable. However, virus attacks, human error, and data storage hardware failures can often damage data and threaten its security, necessitating high standards and demands for data security. As a means of production and a carrier of information, data requires access and manipulation, necessitating high standards and demands for efficient data access. Summary of the Invention

[0003] In view of this, embodiments of the present application provide a data management method, apparatus, device, and medium to overcome the above-mentioned problems or at least partially solve the above-mentioned problems.

[0004] A first aspect of an embodiment of the present application provides a data management method, the method comprising:

[0005] receiving a write request for a first logical block address;

[0006] storing the first data carried by the write request in a first physical block address, and using the first logical block address, the first physical block address, and a timestamp of a current first time period as metadata information of the first data;

[0007] The metadata information is stored in a metadata record corresponding to the first logical block address, wherein the metadata record contains metadata information of multiple data written to the first logical block address within multiple time periods, and the metadata record of the first logical block address is used to search or delete data.

[0008] Optionally, the method further includes:

[0009] When it is necessary to read second data written to the second logic block address within the second time period, receiving a read request for the second data;

[0010] Based on the second logical block address, access a plurality of metadata information corresponding to the second logical block address;

[0011] determining a time stamp required for the read request;

[0012] Obtain target metadata information whose time stamp is not later than the time stamp required by the read request from the plurality of metadata information corresponding to the second logical block address;

[0013] Based on the target metadata information, a physical block address where the second data is located is obtained, and the second data is read from the physical block address.

[0014] Optionally, determining a time stamp required for the read request includes:

[0015] determining whether the second time period is within the existing time period;

[0016] When the second time period is within the existing time period, determining that the time stamp required for the read request is the time stamp corresponding to the second time period;

[0017] When the second time period is not within the existing time period, the time mark required for the read request is determined to be a mark for marking expired data.

[0018] Optionally, the method further includes:

[0019] Setting a special time period, a special time mark corresponding to the special time period, and a preset number threshold of the time period;

[0020] The first time marker in the metadata information of the plurality of third data corresponding to the earliest time period in the existing time periods is updated to the special time marker, where the special time marker is used to mark expired data.

[0021] Optionally, before using the first logical block address, the first physical block address, and the time stamp of the current first time period as metadata information of the first data, the method further includes:

[0022] Determine whether the number of existing time periods is equal to a preset number threshold;

[0023] When the number of the existing time periods is equal to the preset number threshold, updating the first time marker in the metadata information of the plurality of third data corresponding to the earliest time period among the existing time periods to the special time marker, so that the plurality of third data are merged into the special time period corresponding to the special time marker;

[0024] The using the first logical block address, the first physical block address, and the time stamp of the current first time period as metadata information of the first data includes: storing the first time stamp as the time stamp of the first time period in the metadata information of the first data;

[0025] When the number of the existing time periods is less than the preset number threshold, directly storing the time stamp of the first time period in the metadata information of the first data;

[0026] The special time mark is used to mark the plurality of third data corresponding to the earliest time period in the existing time periods as expired data, and the data in the special time period is expired data.

[0027] Optionally, before updating the first time markers in the metadata information of the plurality of third data corresponding to the earliest time period in the existing time periods to the special time marker, the method further includes:

[0028] Determining whether there is fourth data having the same logical block address as the third data among the plurality of data written in the special time period corresponding to the special time mark;

[0029] When there is fourth data with the same logical block address as the third data among the multiple data written within the special time period, after updating the first time mark in the metadata information of the multiple third data corresponding to the earliest time period in the existing time period to the special time mark, the metadata information of the fourth data is overwritten by the metadata information of the third data, and the fourth data is deleted.

[0030] Optionally, all time markers except the special time marker can be reused cyclically.

[0031] A second aspect of an embodiment of the present application provides a data management device, the device comprising:

[0032] A receiving module, configured to receive a write request for a first logical block address;

[0033] a metadata information generating module, configured to store the first data carried in the write request in a first physical block address, and use the first logical block address, the first physical block address, and a timestamp of a current first time period as metadata information of the first data;

[0034] A storage module is used to store the metadata information in a metadata record corresponding to the first logical block address, where the metadata record contains metadata information of multiple data written to the first logical block address within multiple time periods, and the metadata record of the first logical block address is used to search or delete data.

[0035] The third aspect of the embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the data management method as described in the first aspect.

[0036] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the data management method as described in the first aspect is implemented.

[0037] Beneficial effects of this application:

[0038] Embodiments of the present application provide a data management method, apparatus, device, and medium, including: receiving a write request for a first logical block address; storing first data carried in the write request in a first physical block address, and using the first logical block address, the first physical block address, and a time stamp of a current first time period as metadata information of the first data; storing the metadata information in a metadata record corresponding to the first logical block address, the metadata record including metadata information of multiple data written to the first logical block address within multiple time periods, the metadata record of the first logical block address being used for searching or deleting data.

[0039] The technical solution provided by the present application enables, when writing first data, the first logical block address and first physical block address corresponding to the first data, as well as the time stamp of the first time period in which the current time is written, to be used as metadata information of the first data. The metadata information of the first data is then stored in the metadata record corresponding to the first logical block address. This allows metadata information of multiple data written to the first logical block address within multiple time periods to be stored together, facilitating operations such as searching or deleting the multiple data written to the first logical block address. By uniformly managing the metadata information of the multiple data written to the first logical block address, data written to the same first logical block address within different time periods is preserved and stored in different physical block addresses. The multiple metadata information in the metadata record establishes an association between the first logical block address and the multiple physical block addresses, as well as the time stamp of each data item. When accessing data written to the first logical block address within a certain time period, the target data can be quickly accessed based on the associations recorded in the multiple metadata information in the metadata record corresponding to the first logical block address, thereby improving data access efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings that constitute a part of this application are used to provide further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute improper limitations on this application.

[0041] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for the description of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0042] Figure 1 This is a flowchart of a data management method provided by an embodiment of the present application;

[0043] Figure 2 This is a schematic diagram of a time period change process in a data management method provided by an embodiment of the present application;

[0044] Figure 3 It is a structural diagram of a data management device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0045] It should be noted that, unless there is any conflict, the embodiments and features in the embodiments of this application can be combined with each other.

[0046] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0047] To ensure data security, incremental storage and backup of data by time period is an important method. Incremental storage and backup by time period means that all data written in each time period is saved. Even if data is written to the same logical block address in each time period, these multiple copies of data will be saved, rather than the latest written data overwriting the previously written data. This allows you to find the corresponding data when you need data from a previous time period. When data errors or anomalies occur that affect actual business, you can find and use the data closest to the latest data (that is, the data saved in the previous time period) to restore business, thereby resolving errors and anomalies in the latest data and resuming normal business.

[0048] Backups are stored incrementally by time period so that data from each time period can be found. If the latest data has been destroyed, data written in an earlier time period can be recovered to the maximum extent possible, thereby improving data security.

[0049] However, when a large number of time periods are superimposed, there will be two major problems: First, the amount of data will be extremely large, the required storage space will also be extremely large, and management will be extremely complicated. In addition, for some logical block addresses, data may have been written a long time ago, but its data content has been continuously updated since then. The data written a long time ago is of little value, but it still occupies storage space and needs to be managed. Second, when reading data at the location of a logical block address that has not been updated for a long time, it is necessary to search forward in time to see whether there is data written to the location of the logical block address. There are many time periods between the write time and the specific time to be queried, so it takes a long time.

[0050] To solve the above problems, this application proposes a data management method, device, equipment and medium. Figure 1 This is a flow chart of a data management method provided by an embodiment of the present application. Figure 1 As shown, an embodiment of the present application provides a data management method, the method comprising:

[0051] Step S101, receiving a write request for a first logical block address;

[0052] Step S102: storing the first data carried in the write request in a first physical block address, and using the first logical block address, the first physical block address, and a timestamp of the current first time period as metadata information of the first data;

[0053] Step S103: Store the metadata information in a metadata record corresponding to the first logical block address. The metadata record contains metadata information of multiple data written to the first logical block address within multiple time periods. The metadata record of the first logical block address is used to search or delete data.

[0054] First, in step S101, when a user or other application attempts to write first data to a storage system, the storage system receives a write request for a specific logical block address (LBA)—a first logical block address. The first logical block address is used by the user or other application to identify the storage location of the first data. The first logical block address can be mapped to the actual physical storage location of the first data, namely, the physical block address (PBA).

[0055] Further, in step S102, the write request will carry the first data that the user or other application program wishes to write, and the storage system will write the first data to the first physical block address corresponding to the first logical block address. At the same time, in order to manage the life cycle and historical records of the first data, the storage system will generate metadata information corresponding to the first data. The metadata information corresponding to the first data includes the association relationship between the first logical block address, the first physical block address, and the time mark of the current first time period. The first time period represents the current time period (such as 00:10 to 00:20) in which the first data is written, and the time mark of the current first time period is used to represent the first time period, that is, one time period corresponds to one time mark, and the time mark is a mark that occupies a storage space value less than the actual time stored and can represent the order of time.

[0056] In fact, writing multiple data to the same logical block address in different time periods can be understood as the user's update process of a data object in different time periods. For example, the user writes to file A at 1 o'clock and modifies file A to obtain file A1 at 3 o'clock. Then, file A and file A1 are different data written to the same logical block address, but are stored in different physical block addresses.

[0057] Finally, in step S103, after the storage system stores the first data and generates metadata information corresponding to the first data, the metadata information of the first data generated above is stored in the metadata record corresponding to the first logical block address. That is, the metadata record is associated with the first logical block address, and the metadata record records metadata information of multiple data written to multiple logical-physical block addresses corresponding to the first logical block address within multiple time periods. The metadata of the first logical block address can be used to perform operations such as searching or deleting multiple data corresponding to the first logical block address.

[0058] Through the above embodiment, when writing first data, the first logical block address and first physical block address corresponding to the first data, as well as the time stamp of the first time period in which the current time is when the first data is written, can be used as metadata information of the first data, and the metadata information of the first data can be stored in the metadata record corresponding to the first logical block address. This allows metadata information of multiple data written to the first logical block address in multiple time periods to be stored together, facilitating operations such as searching or deleting the multiple data written to the first logical block address. By uniformly managing the metadata information of the multiple data written to the first logical block address, data written to the same first logical block address in different time periods can be preserved and stored in different physical block addresses. The multiple metadata information in the metadata record is used to establish an association between the first logical block address and the multiple physical block addresses, as well as the time stamp of each data. When accessing data written to the first logical block address in a certain time period, the target data can be quickly accessed based on the associations recorded in the multiple metadata information in the metadata record corresponding to the first logical block address, thereby improving data access efficiency.

[0059] Optionally, the method further includes:

[0060] When it is necessary to read second data written to the second logic block address within the second time period, receiving a read request for the second data;

[0061] Based on the second logical block address, access a plurality of metadata information corresponding to the second logical block address;

[0062] determining a time stamp required for the read request;

[0063] Obtain target metadata information whose time stamp is not later than the time stamp required by the read request from the plurality of metadata information corresponding to the second logical block address;

[0064] Based on the target metadata information, a physical block address where the second data is located is obtained, and the second data is read from the physical block address.

[0065] Specifically, in one embodiment, when a user or other application attempts to read second data written to a second logical block address in a storage system within a second time period, a read request for the second data is issued to the storage system, where the read request includes the second time period and the second logical block address. After receiving the read request issued by the user or other application, the storage system queries the metadata record corresponding to the second logical block in a database storing all metadata records in the storage system based on the second logical block address included in the read request, and obtains multiple metadata information corresponding to the second logical block address included in the metadata record. The metadata record of the second logical block address records metadata information of multiple data written to the second logical block address within each time period, and each metadata information in the metadata information of the multiple data written to the second logical block address is an association relationship between the second logical block address, the physical block address where the data is actually stored, and the time stamp of the time period in which the data is written to the second logical block address.

[0066] Furthermore, the storage system determines the time stamp required for the read request based on the received read request and in combination with the multiple metadata information obtained, wherein the time stamp required for the read request is not necessarily the time stamp corresponding to the second time period when the second data is written.

[0067] Further, after determining the time stamp that actually corresponds to the second data, based on the time stamp required by the read request, determine the time stamp of the latest time period in the time period corresponding to the time stamp required by the read request from the time stamps in the multiple metadata information corresponding to the second logical block address, and use the metadata information corresponding to the time stamp of the latest time period as the target metadata information, which is the metadata information of the second data corresponding to the read request.

[0068] Finally, according to the target metadata information, the physical block address of the second data in the target metadata information is obtained, the second data is read from the physical block address of the second data, and returned to the user or other application that issued the read request.

[0069] Through the above embodiment, when responding to a data read request, based on the second logical block address indicated by the read request and the correspondence between the second logical block address and the metadata record, multiple metadata information in the metadata record corresponding to the second logical block address can be quickly accessed from the database. Then, based on the second time period in the read request and the time stamps in the multiple metadata information corresponding to the second logical block address, the time stamp required for the read request can be determined. According to the time period corresponding to the time stamp required for the read request, metadata information corresponding to the time stamp of the latest time period that is no later than the time period corresponding to the time stamp required for the read request is determined from the multiple time periods corresponding to the time stamps in the multiple metadata information as target metadata information. The physical block address where the second data is actually stored is determined from the target metadata information. The correspondence between the logical block address and the metadata record and the association contained in the metadata information are used to respond to the read request, thereby improving data access efficiency.

[0070] Optionally, determining a time stamp required for the read request includes:

[0071] determining whether the second time period is within the existing time period;

[0072] When the second time period is within the existing time period, determining that the time stamp required for the read request is the time stamp corresponding to the second time period;

[0073] When the second time period is not within the existing time period, the time mark required for the read request is determined to be a mark for marking expired data.

[0074] Specifically, in one embodiment, the step of determining the time stamp required for the read request includes:

[0075] First, determine whether the second time period indicated in the read request is within the existing time period. For example, the read request is to obtain data written to the second logical block address in the time period of 00:20 to 00:30. Further, determine whether the second time period of 00:20 to 00:30 is within the current time period. The existing time period is represented as the current valid time period. The data written in the existing time period are all high-value data or data with a relatively new writing time or hot data, that is, data that the user is very likely to access again. The data written in the time period that does not currently exist is represented as older data or low-value data or cold data.

[0076] Furthermore, when the second time period is within the existing time period, the data of the second time period is valid data, and the time stamp required for the read request can be directly determined to be the time stamp corresponding to the second time period. For example, the existing time periods are 00:10-00:20, 00:20-00:30, 00:30-00:40, and 00:40-00:50, and each existing time period corresponds to a time stamp. Therefore, when the second time period of the read request is within the existing time period, the time stamp required for the read request is the time stamp corresponding to the second time period.

[0077] When the second time period is not within the existing time period, the data of the second time period is expired data, and the second time period does not exist in the storage system. The data of the second time period is the expiration time. Therefore, the time mark required for determining the read request is the mark for marking expired data.

[0078] Through the above embodiment, the time stamp required for the read request can be determined based on whether the second time period is within the existing time period. The second data can be quickly acquired through the time stamp required for the read request, thereby improving data access efficiency.

[0079] Optionally, the method further includes:

[0080] Setting a special time period, a special time mark corresponding to the special time period, and a preset number threshold of the time period;

[0081] The first time marker in the metadata information of the plurality of third data corresponding to the earliest time period in the existing time periods is updated to the special time marker, where the special time marker is used to mark expired data.

[0082] Specifically, in one embodiment, a special time period, a special time mark corresponding to the special time period, and a preset number threshold of the time period can be set, wherein the preset number threshold is the number of the latest time periods corresponding to the latest data that needs to be saved, that is, the number of time periods for storing data has an upper limit, and when data of a new time period is written, the data of the earliest time period in the saved time periods is placed in the special time period, and the special time period is used to save data of time periods exceeding the preset number threshold, and the time mark in the metadata information of the special time period data is updated to the special time mark corresponding to the special time period, and the data marked by the special time period is expired data.

[0083] Through the above embodiment, the logical block address can mark expired data through a special time period, which is convenient for distinguishing the latest valid data written from expired data. When the user needs to find the valid data that is latest written to the logical block address, the valid data and expired data can be distinguished through the special time mark in the metadata record corresponding to the logical block address, and the data corresponding to the time mark other than the special time mark can be accessed without accessing the metadata information of the special data, thereby improving the access efficiency of the latest data.

[0084] Optionally, before using the first logical block address, the first physical block address, and the time stamp of the current first time period as metadata information of the first data, the method further includes:

[0085] Determine whether the number of existing time periods is equal to a preset number threshold;

[0086] When the number of the existing time periods is equal to the preset number threshold, updating the first time marker in the metadata information of the plurality of third data corresponding to the earliest time period among the existing time periods to the special time marker, so that the plurality of third data are merged into the special time period corresponding to the special time marker;

[0087] The using the first logical block address, the first physical block address, and the time stamp of the current first time period as metadata information of the first data includes: storing the first time stamp as the time stamp of the first time period in the metadata information of the first data;

[0088] When the number of the existing time periods is less than the preset number threshold, directly storing the time stamp of the first time period in the metadata information of the first data;

[0089] The special time mark is used to mark the plurality of third data corresponding to the earliest time period in the existing time periods as expired data, and the data in the special time period is expired data.

[0090] Specifically, in one embodiment, when writing the first data and before obtaining the metadata information of the first data, it is necessary to first determine whether the number of existing time periods is equal to the preset number threshold. If it is not equal to the preset number threshold, it means that the number of existing time periods is less than the preset number threshold.

[0091] When the number of existing time periods equals a preset threshold, new data needs to be written. Therefore, the third data written in the earliest time period of the existing time periods needs to be transferred to the special time period as expired data. Therefore, the first time stamp in the metadata information of the third data needs to be updated to the special time stamp. The special time stamp is used to mark the plurality of third data corresponding to the earliest time period of the existing time periods as expired data, and the data within the special time period is considered expired data.

[0092] Furthermore, the first time stamp is used as the time stamp of the written first data, and the first time stamp is stored in the metadata information of the first data.

[0093] When the number of existing time periods is less than the preset threshold, it means that there is less valid data at present and there is no data in the special time period. At this time, there is no need to transfer the data. Therefore, the time stamp of the first time period is directly stored as the time stamp stored in the metadata information of the first data.

[0094] Through the above embodiment, before writing data, the time period of the first data to be written and whether data transfer is required can be determined based on existing time period data, thereby ensuring access efficiency of the latest written data.

[0095] Optionally, before updating the first time markers in the metadata information of the plurality of third data corresponding to the earliest time period in the existing time periods to the special time marker, the method further includes:

[0096] Determining whether there is fourth data having the same logical block address as the third data among the plurality of data written in the special time period corresponding to the special time mark;

[0097] When there is fourth data with the same logical block address as the third data among the multiple data written within the special time period, after updating the first time mark in the metadata information of the multiple third data corresponding to the earliest time period in the existing time period to the special time mark, the metadata information of the fourth data is overwritten by the metadata information of the third data, and the fourth data is deleted.

[0098] Specifically, in one embodiment, before updating the first time stamp in the metadata information of multiple third data corresponding to the earliest time period in an existing time period to a special time stamp, it is first necessary to determine whether there is fourth data with the same logical block address as the third data among the multiple data included in the current special time period. The third data and the fourth data are both data written to the same logical block address, and the fourth data is written in a time period earlier than the third data. If the fourth data has the same logical block address as the third data among the multiple data written in the special time period, in order to reduce the storage of a large amount of invalid and expired data, only one piece of data with the same logical block address is stored in the special time period. Therefore, for multiple data with the same logical block address, only the latest data is stored in the special time period. Since the third data is written in a time period later than the fourth data, the fourth data needs to be replaced with the third data. That is, the first time stamp in the metadata information of the multiple third data corresponding to the earliest time period in the existing time period is updated to the special time stamp, and the fourth data is deleted, as well as the metadata information of the fourth data.

[0099] Through the above embodiments, the storage of invalid and expired data can be reduced, saving storage space of the storage system.

[0100] Optionally, all time stamps except the special time stamp can be reused cyclically.

[0101] Specifically, the number of time tags is limited. When the data of a time period is transferred to a special time period, the time tag of the time period of the transferred data will be used to mark the data of the new time period. As the time period is updated, the time tag will be reused. Therefore, there is no need to store a large amount of time information. Only a limited number of time tags need to be stored, which saves storage space of the storage system.

[0102] The following is an example to illustrate the content of the technical solution of this application. Figure 2 FIG. 1 is a schematic diagram of a time period change process in a data management method provided by an embodiment of the present application. Figure 2 As shown, assuming that the preset number threshold of the time period is 3, the update of the time period includes four stages.

[0103] In the first stage, the time period before 00:10 is represented as a special time period, and the corresponding special time mark is T-1. 00:10-00:20, 00:20-00:30, and 00:30-00:40 are three existing time periods, and the corresponding time marks are T0, T1, and T2 respectively. Among them, in the first stage, there is no data in the special time period. The time period 00:10-00:20 with the time mark T0 writes data to the logical block address L0 and stores it in the logical block address P00. The time period 00:20-00:30 with the time mark T1 writes data to the logical block addresses L0 and L1, and stores it in the logical block addresses P01 and P10 respectively. The time period 00:30-00:40 with the time mark T2 writes data to the logical block addresses L1 and L2, and stores it in the logical block addresses P11 and P20. The metadata information of all data written to each logical block address is stored in the same metadata record.

[0104] Therefore, in the first stage, the metadata record corresponding to L0 contains metadata information: L0-P00-T0 and L0-P01-T1, where L0-P00-T0 represents metadata information of data written to logical block address L0 and stored in P00 during the time period 00:10 to 00:20 with time stamp T0, and L0-P01-T1 represents metadata information of data written to logical block address L0 and stored in P10 during the time period 00:20 to 00:30 with time stamp T1; the metadata record corresponding to L1 contains metadata information: L1-P10-T1 and L1-P11-T2, where , L1-P10-T1 represents metadata information of data written to logical block address L1 and stored in P10 during the time period 00:10 to 00:20 with the time mark T1, L1-P11-T2 represents metadata information of data written to logical block address L1 and stored in P11 during the time period 00:30 to 00:40 with the time mark T2; the metadata record corresponding to L2 contains metadata information: L2-P20-T2, wherein L2-P20-T2 represents metadata information of data written to logical block address L2 and stored in P20 during the time period 00:30 to 00:40 with the time mark T2.

[0105] Figure 2 The meaning of metadata information in other stages refers to the interpretation of metadata information in the first stage. Each data corresponds to a piece of metadata information, and a piece of data can be uniquely identified through the metadata information, which will not be repeated here.

[0106] In the second phase, a new time period of 00:40 to 00:50 is added. As a result, the data written in the earliest time period of 00:10 to 00:20 becomes expired data and is moved to the special time period. Therefore, the special time period becomes earlier than 00:20. In the second phase, multiple metadata records in the database are as follows:

[0107] The metadata record corresponding to L0 contains the following metadata information: L0-P00-T-1, L0-P01-T1;

[0108] The metadata record corresponding to L1 contains the following metadata information: L1-P10-T1, L1-P11-T2;

[0109] The metadata record corresponding to L2 contains the following metadata information: L2-P20-T2, L2-P21-T0;

[0110] The metadata record corresponding to L3 contains metadata information: L3-P30-T0.

[0111] It should be noted that during the second stage, the time stamp of the data stored in P00 changes from T0 in the first stage to T-1 in the second stage, and the time stamp T0 is used to mark the new time period 00:40~00:50. Therefore, the time period corresponding to the data written to P30 and P21 is T0.

[0112] In the third phase, a new time period of 00:50 to 01:00 is added. As a result, data written in the earliest time period of 00:20 to 00:30 becomes expired data and is moved to the special time period. Therefore, the special time period becomes earlier than 00:30. In the third phase, multiple metadata records in the database are:

[0113] The metadata record corresponding to L0 contains the following metadata information: L0-P01-T-1, L0-P02-T1;

[0114] The metadata record corresponding to L1 contains the following metadata information: L1-P10-T-1, L1-P11-T2;

[0115] The metadata record corresponding to L2 contains the following metadata information: L2-P20-T2, L2-P21-T0;

[0116] The metadata record corresponding to L3 contains the metadata information: L3-P30-T0, L3-P31-T1.

[0117] It should be noted that during the third stage, the time stamp of the data stored in P10 changes from T1 in the second stage to T-1 in the third stage, and the time stamp T1 is used to mark the new time period 00:50~01:00. Therefore, the time period corresponding to the data written into P02 and P31 is T1.

[0118] Moreover, since in the second stage, the data with metadata information L0-P00-T0 in the first stage is transferred to the special time period, the metadata information of this data becomes L0-P00-T-1, and in the second stage, the data with metadata information L0-P02-T1 in the time period with time stamp T1 needs to be transferred to the special time period value in the third stage, and there is already data with metadata information changed to L0-P00-T-1 in the special time period, but since the data L0-P00-T-1 and the data L0-P02-T1 are both written to L0, only the latest data is saved in the special time period. Therefore, it is necessary to replace the data L0-P00-T-1 with the data L0-P02-T1, and change the time stamp of the data with metadata information L0-P02-T1 to L0-P02-T-1, and delete the data in P00 at the same time.

[0119] In the fourth phase, no new data is written, but a new time period of 01:00 to 01:10 is added. As a result, the data written in the earliest time period of 00:30 to 00:40 becomes expired data and is moved to the special time period. Therefore, the special time period becomes earlier than 00:40. In the fourth phase, the multiple metadata records in the database are as follows:

[0120] The metadata record corresponding to L0 contains the following metadata information: L0-P01-T-1, L0-P02-T1;

[0121] The metadata record corresponding to L1 contains the following metadata information: L1-P10-T-1;

[0122] The metadata record corresponding to L2 contains the following metadata information: L2-P20-T-1, L2-P21-T0;

[0123] The metadata record corresponding to L3 contains the metadata information: L3-P30-T0, L3-P31-T1.

[0124] In this process, it should be noted that although no new data is written, the data of the time period increases. Therefore, it is still necessary to transfer the data of the earliest time period to the special time period, that is, to transfer the data of the time period of 00:30 to 00:40, including the data with metadata information L2-P20-T2 and the data with metadata information L1-P11-T2.

[0125] At this time, since data (L1-P10-T-1) has been written to L1 in the special time period, it is necessary to replace the data with metadata information L1-P10-T-1 with data with metadata information L1-P11-T2, and modify the time stamp of the data with metadata information L1-P11-T2 to T-1, and delete the data in the logical block address P10.

[0126] Optionally, there can be multiple special time periods. When there are multiple special time periods, each special time period actually contains data written in multiple time periods. In order to ensure that data that has not been updated for a long time can be found by users as much as possible without occupying a large amount of storage space in the storage system, this can be achieved by setting multiple special time periods.

[0127] Specifically, considering that the older the data, the smaller its value, the number of time periods contained in each of the multiple special time periods is set to be different. For example, the special time periods are sorted from longest to shortest in order of distance to the nearest time period, and are divided into the first special time period, the second special time period, the third special time period, the fourth special time period, and the fifth special time period. Assuming that the current time period is 19:30, the interval between each time period is 00:10, and the preset number threshold of the existing time periods is 3, then the first special time period can be 18:00~19:00, including 6 time periods; the second special time period can be 16:00~18:00, including 12 time periods; the third special time period can be 13:00~16:00, including 18 time periods; the fourth special time period can be 09:00~13:00, including 24 time periods; the fifth special time period can be 04:00~09:00, including 30 time periods. In each special time period, the latest data in the time period covered by the special time period is still stored.

[0128] That is to say, older data will also be saved, thus avoiding the loss of user data, but the time period interval between the write time of the saved data is determined by the interval size between the write time of the data and the current latest time period. The longer the interval size between the write time of the data and the current latest time period, the older the data is, and the value of the data is relatively low. Therefore, there is no need to store it frequently according to the time period. On the contrary, the shorter the interval size between the write time of the data and the current latest time period, the newer the data is, and the value of the data is relatively high. Therefore, data can be stored with fewer viewing period intervals.

[0129] Figure 3 This is a structural diagram of a data management device provided by an embodiment of the present application. Figure 3 An embodiment of the present application provides a data management device, the device comprising:

[0130] A receiving module 11, configured to receive a write request for a first logical block address;

[0131] a metadata information generating module 12, configured to store the first data carried in the write request in a first physical block address, and use the first logical block address, the first physical block address, and a timestamp of a current first time period as metadata information of the first data;

[0132] The storage module 13 is used to store the metadata information in a metadata record corresponding to the first logical block address, where the metadata record contains metadata information of multiple data written to the first logical block address within multiple time periods. The metadata record of the first logical block address is used to search or delete data.

[0133] Optionally, the device further comprises:

[0134] a read request receiving module, configured to receive a read request for second data when second data written to a second logical block address within a second time period needs to be read;

[0135] a metadata information access module, configured to access a plurality of metadata information corresponding to the second logical block address based on the second logical block address;

[0136] A determination module, configured to determine a time stamp required for the read request;

[0137] A target metadata information acquisition module, configured to acquire target metadata information having a time stamp no later than the time stamp required by the read request from among the plurality of metadata information corresponding to the second logical block address;

[0138] The second data reading module is configured to obtain a physical block address where the second data is located based on the target metadata information, and read the second data from the physical block address.

[0139] Optionally, the module is determined to include:

[0140] A first determining module, configured to determine whether the second time period is within an existing time period;

[0141] a first determining unit, configured to, when the second time period is within an existing time period, determine that the time stamp required for the read request is the time stamp corresponding to the second time period;

[0142] The second determining unit is configured to determine, when the second time period is not within the existing time period, that the time mark required by the read request is a mark for marking expired data.

[0143] Optionally, the device further comprises:

[0144] A setting module, configured to set a special time period, a special time mark corresponding to the special time period, and a preset number threshold of the time period;

[0145] The first updating module is configured to update the first time mark in the metadata information of the plurality of third data corresponding to the earliest time period in the existing time periods to the special time mark, where the special time mark is used to mark expired data.

[0146] Optionally, the device further comprises:

[0147] a second determining module, configured to determine whether the number of existing time periods is equal to a preset number threshold before using the first logical block address, the first physical block address, and the time stamp of the current first time period as metadata information of the first data;

[0148] a second updating module configured to update, when the number of the existing time periods is equal to the preset number threshold, the first time marker in the metadata information of the plurality of third data corresponding to the earliest time period among the existing time periods to the special time marker, so that the plurality of third data are merged into the special time period corresponding to the special time marker;

[0149] The metadata information generating module 12 includes: a metadata information generating unit configured to store the first time mark as the time mark of the first time period in the metadata information of the first data;

[0150] a storage module, configured to directly store the time stamp of the first time period in the metadata information of the first data when the number of the existing time periods is less than the preset number threshold;

[0151] The special time mark is used to mark the plurality of third data corresponding to the earliest time period in the existing time periods as expired data, and the data in the special time period is expired data.

[0152] Optionally, the device further comprises:

[0153] a third judgment module, configured to judge whether, before updating the first time stamp in the metadata information of the plurality of third data corresponding to the earliest time period in the existing time periods to the special time stamp, there exists fourth data having the same logical block address as the third data among the plurality of data written in the special time period corresponding to the special time stamp;

[0154] An overwriting module is used to, when there is fourth data having the same logical block address as the third data among the multiple data written within the special time period, overwrite the metadata information of the fourth data with the metadata information of the third data after updating the first time mark in the metadata information of the multiple third data corresponding to the earliest time period in the existing time periods to the special time mark, and delete the fourth data.

[0155] Optionally, all time markers except the special time marker can be reused cyclically.

[0156] Based on the same inventive concept, another embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the data management method as described in any of the above embodiments.

[0157] Based on the same inventive concept, another embodiment of the present application further provides a computer program product, including a computer program, which is executed by a processor to implement the data management method described in any of the above embodiments.

[0158] Based on the same inventive concept, another embodiment of the present application further provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the data management method as described in any of the above embodiments is implemented.

[0159] As for the device, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0160] 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.

[0161] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0162] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 produce 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 steps in the process. 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.

[0163] These computer program instructions may also be stored in a computer readable memory that can direct 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 The function specified in one or more boxes.

[0164] 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 1 A step that specifies a function in one or more boxes.

[0165] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic inventive concepts. Therefore, the appended 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 invention.

[0166] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0167] The above is a detailed introduction to the data management method, device, equipment and medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present application, there may 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 application.

Claims

1. A data management method, characterized in that: The method comprises: receiving a write request for a first logical block address; storing the first data carried by the write request in a first physical block address, and using the first logical block address, the first physical block address, and a timestamp of a current first time period as metadata information of the first data; storing the metadata information in a metadata record corresponding to the first logical block address, the metadata record including metadata information of a plurality of data written to the first logical block address within a plurality of time periods, the metadata record of the first logical block address being used for searching or deleting the data; The method further comprises: When it is necessary to read second data written to the second logic block address within the second time period, receiving a read request for the second data; Based on the second logical block address, access a plurality of metadata information corresponding to the second logical block address; determining a time stamp required for the read request; Obtain target metadata information whose time stamp is not later than the time stamp required by the read request from the plurality of metadata information corresponding to the second logical block address; Based on the target metadata information, a physical block address where the second data is located is obtained, and the second data is read from the physical block address.

2. The data management method according to claim 1, wherein: Determining the time stamp required for the read request includes: determining whether the second time period is within the existing time period; When the second time period is within the existing time period, determining that the time stamp required for the read request is the time stamp corresponding to the second time period; When the second time period is not within the existing time period, the time mark required for the read request is determined to be a mark for marking expired data.

3. The data management method according to claim 2, wherein: The method further comprises: Setting a special time period, a special time mark corresponding to the special time period, and a preset number threshold of time periods; The first time marker in the metadata information of the plurality of third data corresponding to the earliest time period in the existing time periods is updated to the special time marker, where the special time marker is used to mark expired data.

4. The data management method according to claim 3, wherein: Before using the first logical block address, the first physical block address, and the time stamp of the current first time period as metadata information of the first data, the method further includes: Determine whether the number of existing time periods is equal to a preset number threshold; When the number of the existing time periods is equal to the preset number threshold, updating the first time marker in the metadata information of the plurality of third data corresponding to the earliest time period among the existing time periods to the special time marker, so that the plurality of third data are merged into the special time period corresponding to the special time marker; The using the first logical block address, the first physical block address, and the time stamp of the current first time period as metadata information of the first data includes: storing the first time stamp as the time stamp of the first time period in the metadata information of the first data; When the number of the existing time periods is less than the preset number threshold, directly storing the time stamp of the first time period in the metadata information of the first data; The special time mark is used to mark the plurality of third data corresponding to the earliest time period in the existing time periods as expired data, and the data in the special time period is expired data.

5. The data management method according to claim 4, characterized in that: Before updating the first time markers in the metadata information of the plurality of third data corresponding to the earliest time period in the existing time periods to the special time marker, the method further includes: Determining whether there is fourth data having the same logical block address as the third data among the plurality of data written in the special time period corresponding to the special time mark; When there is fourth data with the same logical block address as the third data among the multiple data written within the special time period, after updating the first time mark in the metadata information of the multiple third data corresponding to the earliest time period in the existing time period to the special time mark, the metadata information of the fourth data is overwritten by the metadata information of the third data, and the fourth data is deleted.

6. The data management method according to any one of claims 3 to 5, characterized in that: All other time stamps except the special time stamp can be reused cyclically.

7. A data management device, characterized in that: The device comprises: A receiving module, configured to receive a write request for a first logical block address; a metadata information generating module, configured to store the first data carried in the write request in a first physical block address, and use the first logical block address, the first physical block address, and a timestamp of a current first time period as metadata information of the first data; a storage module, configured to store the metadata information in a metadata record corresponding to the first logical block address, the metadata record including metadata information of a plurality of data written to the first logical block address within a plurality of time periods, the metadata record of the first logical block address being used for searching or deleting data; The device further comprises: a read request receiving module, configured to receive a read request for second data when second data written to a second logical block address within a second time period needs to be read; a metadata information access module, configured to access a plurality of metadata information corresponding to the second logical block address based on the second logical block address; A determination module, configured to determine a time stamp required for the read request; A target metadata information acquisition module, configured to acquire target metadata information having a time stamp no later than the time stamp required by the read request from among the plurality of metadata information corresponding to the second logical block address; The second data reading module is configured to obtain a physical block address where the second data is located based on the target metadata information, and read the second data from the physical block address.

8. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the data management method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that A computer program is stored thereon, wherein when the computer program is executed by a processor, the data management method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Metadata management method and device

    CN110727403A

  • Data storage method and system and computer readable storage medium

    CN114756178A