Data management method and device, equipment and medium

By recording metadata information when data is written and quickly positioning target data based on metadata information when reading, the problems of large amount of data and low access efficiency caused by time period superposition in data management are solved, and efficient data management and Security.

CN119148927AActive Publication Date: 2024-12-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When existing data management technologies face the problems of large amount of data, complex storage space occupies and low access efficiency for data not updated for a long time when a large number of time periods are superimposed.

Method used

By recording the metadata information of the logical block address, physical block address and time period when data is written, and quickly locate the target data based on the metadata information during reading, it realizes unified data management and search, and sets special time period marks expired. Data, reduce invalid data storage.

Benefits of technology

Improve data access efficiency, reduce storage space usage, and ensure data security and management simplicity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119148927A_ABST
    Figure CN119148927A_ABST
Patent Text Reader

Abstract

The invention provides a data management method and device, equipment and a medium, and relates to the technical field of data management, and the method comprises the steps: receiving a write request for a first logic block address; storing first data carried by the write request in a first physical block address, and taking the first logic block address, the first physical block address and a time stamp of a current first time period as metadata information of the first data; the metadata information is stored in a metadata record corresponding to the first logic block address, the metadata record comprises metadata information of multiple pieces of data written into the first logic block address in multiple time periods, and the metadata record of the first logic block address is used for searching or deleting data. The data access efficiency can be improved.
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, device, equipment and medium. Background Art

[0002] In today's society, data has become an important new production factor that can generate high value. It is also an asset of the country, government, enterprise and individual, and even a core asset. It is very important. However, virus attacks, human errors, data storage hardware failures, etc. can often destroy data and threaten data security, so there are high requirements and great demands for high data security. As a means of production and information carrier, data needs to be accessed and operated, so there are also high requirements and great demands for data access efficiency. 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 time stamp 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, 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 comprises:

[0009] When it is necessary to read second data written to the second logic block address within a 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] Acquire target metadata information whose time stamp is not later than the time stamp required by the read request among 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 mark required for the read request is the time mark 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 comprises:

[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 mark 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 mark, where the special time mark 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 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, so that the plurality of third data are merged into the special time period corresponding to the special time mark;

[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 comprises: 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 mark of the first time period in the metadata information of the first data;

[0026] The special time mark is used to mark a 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 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, the method further includes:

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

[0029] 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, after the first time mark in the metadata information of the multiple third data corresponding to the earliest time period in the existing time periods is updated 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, other 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 by the write request in a first physical block address, and use 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;

[0034] A storage module is used to store the metadata information 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.

[0035] A third aspect of the embodiments of the present application provides an electronic device, including 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] The embodiment of the present application provides a data management method, apparatus, device and medium, 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 in multiple time periods, the metadata record of the first logical block address being used for searching or deleting data,

[0039] Through the technical solution provided by the present application, when writing the first data, the first logical block address, the first physical block address corresponding to the written first data, and the time stamp of the first time period in which the current time is located when writing the first data can be used as the 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, so that the metadata information of multiple data written to the first logical block address in multiple time periods can be stored together, which is convenient for 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, the data written to the same first logical block address in different time periods are all saved and stored in different physical block addresses, and the association between the first logical block address and the multiple physical block addresses and the time stamp of each data is realized through the multiple metadata information in the metadata record. When it is necessary to access the data written to the first logical block address in a certain time period, the target data can be quickly accessed based on the association relationship recorded in the multiple metadata information in the metadata record corresponding to the first logical block address, thereby improving the data access efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.

[0041] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. 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 paying any creative labor.

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

[0043] Figure 2 It is a schematic diagram of a time period change process in a data management method provided in 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, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.

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

[0047] In order to ensure data security, it is an important method to perform incremental storage and backup of data according to time periods. Incremental storage and backup according to time periods means that all data written in each time period are saved. Even if data is written to the same logical block address in each time period, these multiple copies of data will also be saved, rather than the latest written data overwriting the previously written data. In this way, when data from a previous time is needed, the corresponding data can be found. When errors or anomalies occur in the data and affect the actual business, the data closest to the latest data (that is, the data saved in the previous time period) can be found and used to restore the business, thereby resolving errors and anomalies in the latest data and restoring 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 important problems: first, the amount of data will be extremely large, the storage space required will also be extremely large, and the management will be extremely complicated. In addition, for some logical block addresses, the data may have been written a long time ago, but its data content has been continuously updated subsequently. 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 the data at the location of the 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, and there will be more time periods between its write time and the specific time to be queried, so it will take a long time.

[0050] To solve the above problems, the present application proposes a data management method, device, equipment and medium. Figure 1 is a flow chart of a data management method provided by an embodiment of the present application, such as 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 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;

[0053] Step S103, storing the metadata information 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.

[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) as a first logical block address. The first logical block address is a logical block address used by a user or other application to identify a storage location of the first data, and the first logical block address can be mapped to an actual physical storage location of the first data, namely, a 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, wherein the first time period represents the current time period (such as 00:10 to 00:20) in which the first data is located when it 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 at 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 at 3 o'clock to obtain file A1. 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 to say, 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 the first data, the first logical block address, the first physical block address, and the time stamp of the first time period in which the current time is located when writing the first data can be used as the 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, so that the metadata information of multiple data written to the first logical block address in multiple time periods can be stored together, which is convenient for 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, the data written to the same first logical block address in different time periods are all saved and stored in different physical block addresses, and the association between the first logical block address and the multiple physical block addresses and the time stamp of each data is realized through the multiple metadata information in the metadata record. When it is necessary to access the data written to the first logical block address in a certain time period, the target data can be quickly accessed based on the association relationship recorded in the multiple metadata information in the metadata record corresponding to the first logical block address, thereby improving the data access efficiency.

[0059] Optionally, the method further comprises:

[0060] When it is necessary to read second data written to the second logic block address within a 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] Acquire target metadata information whose time stamp is not later than the time stamp required by the read request among 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, the read request including 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 according to 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 of the multiple data written to the second logical block address is an association relationship between the second logical block address and a time stamp of a time period in which the physical block address where the data is actually stored and the time when 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 acquired multiple metadata information, 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, from the time stamps in the multiple metadata information corresponding to the second logical block address, the time stamp of the latest time period in the time period corresponding to the time stamp required by the read request, 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 where the second data is located in the target metadata information is obtained, the second data is read from the physical block address where the second data is located, and returned to the user or other application that issued the read request.

[0069] Through the above-mentioned embodiments, when responding to a data read request, according to 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, and then according to the second time period in the read request and the time stamp in the multiple metadata information corresponding to the second logical block address, the time stamp required for the read request can be determined, and 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 stamp in the multiple metadata information as the target metadata information, and the physical block address where the second data is actually stored is determined from the target metadata information, and the read request is responded to using the correspondence between the logical block address and the metadata record and the association relationship contained in the metadata information, 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 mark required for the read request is the time mark 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-00:30. Further, determine whether the second time period of 00:20-00:30 is within the current time period. The existing time period is represented as the current valid time period. The written data 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] Further, 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 does not exist in the storage system. The data of the second time period is expired time. Therefore, the time mark required for the read request is determined to be 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 comprises:

[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 mark 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 mark, where the special time mark 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 writing data of a new time period, 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 the expired data. When the user needs to find the valid data that is latest written to the logical block address, the special time mark in the metadata record corresponding to the logical block address can be used to distinguish between the valid data and the expired data, 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 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, so that the plurality of third data are merged into the special time period corresponding to the special time mark;

[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 comprises: 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 mark of the first time period in the metadata information of the first data;

[0089] The special time mark is used to mark a 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 a 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 is equal to the preset number threshold, new data needs to be written, so 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, so the first time mark in the metadata information of the third data needs to be updated to the special time mark. The special time mark is used to mark the multiple third data corresponding to the earliest time period of the existing time periods as expired data, and the data in the special time period is 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 the current valid data is small 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 first data 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 according to the existing time period data, thereby ensuring the access efficiency of the latest written data.

[0095] Optionally, before updating 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, the method further includes:

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

[0097] 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, after the first time mark in the metadata information of the multiple third data corresponding to the earliest time period in the existing time periods is updated 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 mark in the metadata information of the plurality of third data corresponding to the earliest time period in the existing time period to the special time mark, first, it is necessary to determine whether there is a fourth data with the same logical block address as the third data among the plurality of data contained in the current special time period, wherein the third data and the fourth data are both data written to the same logical block address, and the time period in which the fourth data is written is earlier than the third data. When there is a fourth data with the same logical block address as the third data among the plurality of data written in the special time period, in order to reduce the storage of a large amount of invalid expired data, only one data with the same logical block address is stored in the special time period. Therefore, for the plurality of data with the same logical block address, only the latest data is stored in the special time period. Since the time period in which the third data is written is later than the fourth data, the fourth data needs to be replaced by the third data, that is, the first time mark in the metadata information of the plurality of third data corresponding to the earliest time period in the existing time period is updated to the special time mark, and the fourth data is deleted, and the metadata information of the fourth data is deleted.

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

[0100] Optionally, other 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 cyclically, so there is no need to store a large amount of time information. Only a limited number of time tags need to be stored, saving 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 is a schematic diagram of a time period change process in a data management method provided in an embodiment of the present application, such as 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 earlier than 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 them 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 them in the logical block addresses P11 and P20. The metadata information of all the data written in each logical block address is stored in the same metadata record.

[0104] Therefore, in the first stage, the metadata information contained in the metadata record corresponding to L0 is: L0-P00-T0 and L0-P01-T1, where L0-P00-T0 represents the metadata information of the data written to the logical block address L0 and stored in P00 during the time period 00:10 to 00:20 with the time mark T0, and L0-P01-T1 represents the metadata information of the data written to the logical block address L0 and stored in P10 during the time period 00:20 to 00:30 with the time mark T1; the metadata information contained in the metadata record corresponding to L1 is: L1-P10-T1 and L1-P11-T2, where , L1-P10-T1 represents the metadata information of the data written to the 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 the metadata information of the data written to the logical block address L1 and stored in P11 during the time period 00:30 to 00:40 with the time mark T2; the metadata information contained in the metadata record corresponding to L2 is: L2-P20-T2, wherein L2-P20-T2 represents the metadata information of the data written to the 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 metadata information, and a data can be uniquely identified through the metadata information, which will not be repeated here.

[0106] In the second stage, a new time period of 00:40 to 00:50 is added, causing the data written in the earliest time period of 00:10 to 00:20 to become expired data and transferred to the special time period. Therefore, the special time period becomes earlier than 00:20. In the second stage, 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 the 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 into P30 and P21 is T0.

[0112] In the third stage, a new time period of 00:50-01:00 is added, causing the data written in the earliest time period of 00:20-00:30 among the existing time periods to become expired data and be transferred to the special time period. Therefore, the special time period becomes earlier than 00:30. In the third stage, 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] Furthermore, in the second stage, the data with metadata information L0-P00-T0 in the first stage is transferred to the special time period, so that the metadata information of this data becomes L0-P00-T-1. In the second stage, the data with metadata information L0-P02-T1 in the time period with time mark 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. However, 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 mark 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 stage, no new data is written, but a new time period of 01:00-01:10 is added, causing the data written in the earliest time period of 00:30-00:40 among the existing time periods to become expired data and be transferred to the special time period. Therefore, the special time period becomes earlier than 00:40. In the fourth stage, 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 there is data written to L1 (L1-P10-T-1) 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 is, the less valuable it is, therefore, in multiple special time periods, the number of time periods contained in each special time period is set to be different. For example, they are sorted from the longest to the shortest time period, 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 of 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 The first special time period may be 18:00-19:00, including 6 time periods; the second special time period may be 16:00-18:00, including 12 time periods; the third special time period may be 13:00-16:00, including 18 time periods; the fourth special time period may be 09:00-13:00, including 24 time periods; the fifth special time period may be 04:00-09:00, including 30 time periods, and 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, thereby avoiding the loss of user data. However, the time period interval between the write time of the saved data is determined by the interval between the data write time and the current latest time period. The longer the interval between the data write time and the current latest time period, the older the data is, and the lower the value of the data is. Therefore, there is no need to store it frequently according to the time period. On the contrary, the shorter the interval between the data write time and the current latest time period, the newer the data is, and the higher the value of the data is. Therefore, data can be stored with fewer viewing periods.

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

[0130] The receiving module 11 is used 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 by the write request in a first physical block address, and use 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;

[0132] The storage module 13 is used to store the metadata information 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.

[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 logic block address within a second time period needs to be read;

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

[0136] A determination module, used to determine the 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 a 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 used to obtain the 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, a module is determined, including:

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

[0141] A first determining unit, configured to determine, when the second time period is within an existing time period, 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, used 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 used 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 judgment module is used to judge 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 the metadata information of the first data;

[0148] A second updating module is used for updating 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 when the number of the existing time periods is equal to the preset number threshold, so that the plurality of third data are merged into the special time period corresponding to the special time mark;

[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 a 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 is used for judging whether there is fourth data having the same logical block address as the third data among the multiple data written in the special time period corresponding to the special time period before 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;

[0154] An overwriting module is used for, 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, 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, overwriting the metadata information of the fourth data with the metadata information of the third data and deleting the fourth data.

[0155] Optionally, other 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, including 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 perform the data management method as 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 on which a computer program is stored, 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 in combination with 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 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 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.

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

[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 The steps for the functions specified in one or more boxes.

[0165] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. 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 application.

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

[0167] The above is a detailed introduction to a data management method, device, equipment and medium provided by the present application. Specific examples are used in this article 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 idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method 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 time stamp of a current first time period as metadata information of the first data; The metadata information is stored 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, and the metadata record of the first logical block address is used to search or delete data.

2. The data management method according to claim 1, characterized in that: The method further comprises: When it is necessary to read second data written to the second logic block address within a 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; Acquire target metadata information whose time stamp is not later than the time stamp required by the read request among 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.

3. The data management method according to claim 2, characterized in that: Determining a 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 mark required for the read request is the time mark 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.

4. The data management method according to claim 1, characterized in that: 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 the time period; 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 is updated to the special time mark, where the special time mark is used to mark expired data.

5. The data management method according to claim 4, characterized in that: 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 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, so that the plurality of third data are merged into the special time period corresponding to the special time mark; 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 comprises: 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 mark of the first time period in the metadata information of the first data; The special time mark is used to mark a 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.

6. The data management method according to claim 5, characterized in that: Before updating 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, the method further includes: Determine whether there is fourth data having the same logical block address as the third data among the multiple data written in the special time period corresponding to the special time mark; 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, after the first time mark in the metadata information of the multiple third data corresponding to the earliest time period in the existing time periods is updated 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.

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

8. 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 by the write request in a first physical block address, and use 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; A storage module is used to store the metadata information 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.

9. 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 7.

10. 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 7 is implemented.

Citation Information

Patent Citations

  • Data processing method and apparatus

    CN103761190A

  • Metadata management method and device

    CN110727403A

  • Data storage method and system and computer readable storage medium

    CN114756178A

  • Remote copy system and remote copy method

    US20220276785A1