Data writing method, system, equipment and medium
By using the first search identifier and the second search identifier in the distributed storage system to query and create fingerprint tables, and establishing a mapping fingerprint table to integrate mapping addresses, the problems of low fingerprint query efficiency and large memory usage in the distributed storage system are solved, and efficient data management and query are achieved.
Patent Information
- Application Number
- CN202412000431.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In distributed storage systems, how to improve fingerprint query efficiency, reduce fingerprint memory occupancy, and solve the problem that the deduplication rate cannot be guaranteed.
By using the first search identifier and the second search identifier in the fingerprint pool to query and create fingerprint tables, the single global fingerprint table is avoided from affecting the query efficiency too much, and by establishing a mapping fingerprint table, integrating multiple mapping addresses, controlling the amount of fingerprint table data, and accelerating query efficiency.
It improves fingerprint query efficiency, reduces fingerprint memory occupancy, and realizes efficient data management and query of distributed storage systems.
Smart Images

Figure CN119806424A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data storage, and in particular to a data writing method, system, device and medium. Background Art
[0002] In the related art, deleting duplicate data in a storage system is a technology for cleaning duplicate data in a storage system, thereby reducing the storage space actually occupied by the data. A global fingerprint table can be maintained in the storage system. In order to ensure the search speed of the fingerprint table, the fingerprint table needs to be saved in the memory. However, as data is continuously written, the fingerprint table will occupy a large amount of memory.
[0003] However, in a distributed storage system, storage resources are distributed on multiple storage nodes with a large number of nodes. If a copy of the global fingerprint table is maintained on each node, the consistency of the fingerprint table is difficult to achieve and it will also occupy a large amount of system resources. If each node only maintains its own local fingerprint table, the deduplication rate, that is, the data reduction rate of duplicate data deletion cannot be guaranteed.
[0004] In the related art, fingerprints are directly stored in a metadata pool or a data pool, which will result in too many fingerprint objects and low query efficiency. In addition, the fingerprint cache stores all fingerprints in the memory, which will result in excessive memory usage.
[0005] Therefore, how to improve the efficiency of fingerprint query and reduce the memory occupied by fingerprints has become an urgent problem to be solved. Summary of the invention
[0006] Based on the above technical problems, the embodiments of the present application provide a data writing method, system, device and medium, aiming to improve the efficiency of fingerprint query and reduce the memory occupied by fingerprints.
[0007] A first aspect of an embodiment of the present application provides a data writing method, which is applied to a fingerprint terminal, and the method includes:
[0008] In response to a target fingerprint corresponding to a target data block sent by the cache end, determining a first search identifier and a second search identifier of the target fingerprint;
[0009] According to the first search identifier of the target fingerprint, query a target fingerprint table corresponding to the target fingerprint in a fingerprint pool, wherein the fingerprint pool includes a plurality of fingerprint tables with different first search identifiers, and each of the fingerprint tables includes a plurality of fingerprints with different second search identifiers;
[0010] In the case that the second search identifier of the target fingerprint does not exist in the target fingerprint table, creating a target fingerprint entry in the target fingerprint table, and sending feedback information that the target fingerprint does not exist in the target fingerprint table to the cache end;
[0011] Receive the target storage address and the target mapping address sent by the cache end, and write the target storage address and the target mapping address into the target fingerprint entry.
[0012] Optionally, when the second search identifier of the target fingerprint exists in the target fingerprint table, the method further includes:
[0013] Acquire information stored in a fingerprint entry corresponding to the second search identifier of the target fingerprint in the target fingerprint table as target information;
[0014] When the target storage address exists in the target information, sending the target storage address corresponding to the target fingerprint to the cache end;
[0015] In the case that the target storage address does not exist in the target information, the query operation is suspended until a target storage address corresponding to the target fingerprint is generated in the fingerprint entry corresponding to the second search identifier of the target fingerprint.
[0016] Optionally, when the target storage address exists in the target information, the method further includes:
[0017] Creating a mapping address table of the target fingerprint, the mapping address table is used to store the mapping address of the target fingerprint, the mapping address table at least includes: a third search identifier, a mapping object and a mapping object address;
[0018] Determine a mapping object and a mapping object address of a first entry in a mapping address table of the target fingerprint according to a mapping address in a fingerprint entry corresponding to the second search identifier of the target fingerprint;
[0019] Determine, according to the target mapping address of the target fingerprint sent by the cache end, a mapping object and a mapping object address of a second entry in the mapping address table of the target fingerprint;
[0020] A third search identifier is determined according to the target fingerprint, and the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint is updated to the third search identifier.
[0021] Optionally, when there is no target fingerprint table corresponding to the target fingerprint in the multiple fingerprint tables, the method further includes:
[0022] Creating an original fingerprint table according to the first search identifier of the target fingerprint;
[0023] Creating the target fingerprint entry in the original fingerprint table;
[0024] The target storage address and the target mapping address sent by the cache end are received, and the target storage address and the target mapping address are written into the target fingerprint entry to obtain the target fingerprint table.
[0025] A second aspect of an embodiment of the present application provides a data writing method, which is applied to a cache end, and the method includes:
[0026] In response to a write operation on target data, obtaining a target fingerprint of a target data block in the target data, and sending the target fingerprint to a fingerprint terminal;
[0027] Receive feedback information sent by the fingerprint terminal, write the target data block corresponding to the target fingerprint into the data pool, and obtain the target storage address of the target data block in the data pool, wherein the feedback information is used to indicate that the target fingerprint does not exist in the target fingerprint table in the fingerprint pool;
[0028] The target mapping address of the target data block corresponding to the target storage address is recorded in the buffer pool, and the target storage address and the target mapping address are sent to the fingerprint end.
[0029] Optionally, the method further comprises:
[0030] receiving a target storage address in a fingerprint entry corresponding to the second search identifier of the target fingerprint sent by the fingerprint terminal, and deleting the target data block corresponding to the target fingerprint;
[0031] According to the target storage address in the fingerprint entry corresponding to the second search identifier of the target fingerprint, the target mapping address of the target data block corresponding to the target fingerprint is recorded in the cache pool.
[0032] Optionally, after recording the target mapping address of the target data block corresponding to the target storage address in the cache pool, the method further includes:
[0033] Based on the fingerprint table in the fingerprint pool, a cache fingerprint table is created in the cache pool, wherein the cache fingerprint table includes at least a cache fingerprint, and the cache fingerprint is a fingerprint identifier corresponding to each fingerprint stored in each fingerprint table of the fingerprint terminal;
[0034] Creating a cache fingerprint entry corresponding to the cache fingerprint;
[0035] In response to a user's query operation on the data in the data pool, querying the cache fingerprint table for cache fingerprints corresponding to a plurality of data blocks in the data;
[0036] The step of creating a cache fingerprint entry corresponding to the cache fingerprint includes:
[0037] In the case that the mapping address table does not exist in the fingerprint table, the cache fingerprint is used as information of the cache fingerprint entry;
[0038] When there is a mapping address table in the fingerprint table, the storage address and the mapping address are obtained from the fingerprint table and written into the cache fingerprint entry.
[0039] A third aspect of an embodiment of the present application provides a data writing system, the system comprising a fingerprint end and a cache end:
[0040] The cache end is used to obtain a target fingerprint of a target data block in the target data in response to a write operation on the target data, and send the target fingerprint to the fingerprint end;
[0041] The fingerprint end is used to determine the first retrieval identifier and the second retrieval identifier of the target fingerprint in response to the target fingerprint corresponding to the target data block sent by the cache end; query the target fingerprint table corresponding to the target fingerprint in the fingerprint pool according to the first retrieval identifier of the target fingerprint; if the second retrieval identifier of the target fingerprint does not exist in the target fingerprint table, create a target fingerprint entry in the target fingerprint table, and send feedback information that the target fingerprint does not exist in the target fingerprint table to the cache end;
[0042] The cache end is further used to receive feedback information sent by the fingerprint end, write the target data block corresponding to the target fingerprint into the data pool, and obtain the target storage address of the target data block in the data pool; record the target mapping address of the target data block corresponding to the target storage address in the cache pool, and send the target storage address and the target mapping address to the fingerprint end;
[0043] The fingerprint end is further used to receive the target storage address and the target mapping address sent by the cache end, and write the target storage address and the target mapping address into the target fingerprint entry.
[0044] A fourth aspect of the present application provides a data writing device, which is applied to a fingerprint terminal, and the device includes:
[0045] A search identifier determination module, configured to determine a first search identifier and a second search identifier of the target fingerprint in response to a target fingerprint corresponding to a target data block sent by the cache end;
[0046] a target fingerprint table query module, configured to query a target fingerprint table corresponding to the target fingerprint in a fingerprint pool according to the first retrieval identifier of the target fingerprint, wherein the fingerprint pool comprises a plurality of fingerprint tables with different first retrieval identifiers, and each of the fingerprint tables comprises a plurality of fingerprints with different second retrieval identifiers;
[0047] a target fingerprint entry creation module, configured to create a target fingerprint entry in the target fingerprint table if the second search identifier of the target fingerprint does not exist in the target fingerprint table, and send feedback information that the target fingerprint does not exist in the target fingerprint table to the cache end;
[0048] The target fingerprint entry writing module is used to receive the target storage address and the target mapping address sent by the cache end, and write the target storage address and the target mapping address into the target fingerprint entry.
[0049] Optionally, the data writing device further includes:
[0050] a target information acquisition module, configured to acquire information stored in a fingerprint entry corresponding to the second search identifier of the target fingerprint in the target fingerprint table as target information;
[0051] A storage address sending module, configured to send the target storage address corresponding to the target fingerprint to the cache end if the target storage address exists in the target information;
[0052] The query operation suspension module is used to suspend the query operation when the target storage address does not exist in the target information, until a target storage address corresponding to the target fingerprint is generated in the fingerprint entry corresponding to the second search identifier of the target fingerprint.
[0053] Optionally, the storage address sending module further includes:
[0054] A mapping address table creation submodule, used to create a mapping address table of the target fingerprint, the mapping address table is used to store the mapping address of the target fingerprint, the mapping address table at least includes: a third search identifier, a mapping object and a mapping object address;
[0055] A first entry information determination submodule, configured to determine a mapping object and a mapping object address of a first entry in a mapping address table of the target fingerprint according to a mapping address in a fingerprint entry corresponding to the second search identifier of the target fingerprint;
[0056] A second entry information determination submodule, configured to determine a mapping object and a mapping object address of a second entry in a mapping address table of the target fingerprint according to a target mapping address of the target fingerprint sent by the cache end;
[0057] The mapping address updating submodule is used to determine a third search identifier according to the target fingerprint, and update the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint to the third search identifier.
[0058] Optionally, the data writing device further includes:
[0059] An original fingerprint table creation module, used for creating an original fingerprint table according to the first search identifier of the target fingerprint;
[0060] A target fingerprint entry creation module, used to create the target fingerprint entry in the original fingerprint table;
[0061] The target fingerprint table determination module is used to receive the target storage address and the target mapping address sent by the cache end, write the target storage address and the target mapping address into the target fingerprint entry, and obtain the target fingerprint table.
[0062] A fifth aspect of an embodiment of the present application provides a data writing device, which is applied to a cache end, and the device includes:
[0063] A fingerprint acquisition module, configured to acquire a target fingerprint of a target data block in the target data in response to a write operation on the target data, and send the target fingerprint to a fingerprint terminal;
[0064] a target data block writing module, configured to receive feedback information sent by the fingerprint terminal, write the target data block corresponding to the target fingerprint into a data pool, and obtain a target storage address of the target data block in the data pool, wherein the feedback information is used to indicate that the target fingerprint table in the fingerprint pool does not contain a second retrieval identifier;
[0065] The target mapping address acquisition module is used to record the target mapping address of the target data block corresponding to the target storage address in the cache pool, and send the target storage address and the target mapping address to the fingerprint end.
[0066] Optionally, the data writing device further includes:
[0067] a target data block deletion module, configured to receive a target storage address in a fingerprint entry corresponding to the second search identifier of the target fingerprint sent by the fingerprint terminal, and delete the target data block corresponding to the target fingerprint;
[0068] The target mapping address recording module is used to record the target mapping address of the target data block corresponding to the target fingerprint in the cache pool according to the target storage address in the fingerprint entry corresponding to the second search identifier of the target fingerprint.
[0069] Optionally, the data writing device further includes:
[0070] A cache fingerprint table creation module, used to create a cache fingerprint table in the cache pool based on the fingerprint table in the fingerprint pool, wherein the cache fingerprint table at least includes a cache fingerprint, and the cache fingerprint is a fingerprint identifier corresponding to each fingerprint stored in each fingerprint table of the fingerprint terminal;
[0071] A cache fingerprint entry creation module, used to create a cache fingerprint entry corresponding to the cache fingerprint;
[0072] A cache fingerprint query module, configured to query cache fingerprints corresponding to a plurality of data blocks in the data in the cache fingerprint table in response to a user's query operation on the data in the data pool;
[0073] The step of creating a cache fingerprint entry corresponding to the cache fingerprint includes:
[0074] A cache fingerprint entry information determination module, used to use the cache fingerprint as cache fingerprint entry information when there is no mapping address table in the fingerprint table;
[0075] The cache fingerprint entry writing module is used to obtain the storage address and the mapping address in the fingerprint table when there is a mapping address table in the fingerprint table, and write them into the cache fingerprint entry.
[0076] A sixth aspect of an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the data writing method of the first aspect of the embodiment of the present application is implemented, or, when the computer program is executed by the processor, the data writing method of the second aspect of the embodiment of the present application is implemented.
[0077] A seventh aspect of an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the data writing method of the first aspect of the embodiment of the present application, or when the computer program is executed by a processor, it implements the data writing method of the first aspect of the embodiment of the present application.
[0078] An eighth aspect of an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the data writing method of the first aspect of the embodiment of the present application, or, when executed by a processor, implements the data writing method of the first aspect of the embodiment of the present application.
[0079] Through the data writing method of the embodiment of the present application, for multiple nodes in a distributed storage system, according to the fingerprints of each data block after the data is written, the fingerprint pool is searched for whether there is a corresponding fingerprint table and a fingerprint entry in the fingerprint table according to the first retrieval identifier and the second retrieval identifier. For fingerprints not stored in the fingerprint pool, a fingerprint entry is created in the corresponding fingerprint table, and relevant information is supplemented and written into the fingerprint entry according to the storage address and mapping address corresponding to the fingerprint sent by the cache end. For fingerprints that already exist in the fingerprint pool, the storage address corresponding to the fingerprint is directly sent to the cache end.
[0080] In the present application, based on the previous data deduplication based on the fingerprint table, a method for writing data to a distributed storage system is proposed. According to the different fingerprints corresponding to each data block, a global fingerprint table with a large amount of data is divided into multiple smaller fingerprint tables based on the first retrieval identifier and the second retrieval identifier, thereby avoiding the influence of a single fingerprint table being too large on the fingerprint query efficiency. In addition, by establishing a mapping fingerprint table, data is integrated for fingerprints with multiple mapping addresses, and the data volume in a single fingerprint table is further controlled, the fingerprint query efficiency is accelerated, and the cache size of the fingerprint is controlled, thereby realizing efficient data management and query based on the fingerprint table. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments 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.
[0082] Figure 1 This is a flow chart of a data writing method applied to a fingerprint terminal proposed in one embodiment of the present application;
[0083] Figure 2 This is a flow chart of a data writing method applied to a cache end proposed in one embodiment of the present application;
[0084] Figure 3 is a schematic diagram of a data writing system proposed in an embodiment of the present application;
[0085] Figure 4 This is a schematic diagram of a data writing process proposed in an embodiment of the present application;
[0086] Figure 5 It is a structural block diagram of a data writing device applied to a fingerprint terminal provided by an embodiment of the present application;
[0087] Figure 6is a structural block diagram of a data writing device applied to a cache end provided by an embodiment of the present application;
[0088] Figure 7 It is a schematic diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0089] 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.
[0090] In the drawings, the size of the constituent elements, the thickness of the layer or the area may be exaggerated for the sake of clarity. Therefore, any implementation of the present disclosure is not necessarily limited to the size shown in the drawings, and the shapes and sizes of the components in the drawings do not reflect the true proportions. In addition, the drawings schematically show ideal examples, and any implementation of the present disclosure is not limited to the shapes or values shown in the drawings.
[0091] In the method of deduplicating data through a fingerprint table, a global fingerprint table is often established in the storage node, which contains fingerprints corresponding to all data blocks. By querying the relevant fingerprints in the fingerprint table, it is determined whether a new data block has been stored in the storage node when the data block is newly written, thereby avoiding the waste of storage resources caused by repeatedly storing the same data block in the node.
[0092] However, although the related technology can delete duplicate data by establishing a fingerprint table, when applied to a distributed storage system, due to the huge amount of data storage, the related technology's method of simply establishing a global fingerprint table not only reduces the fingerprint query efficiency, but also occupies more storage resources, and is not suitable for application in a distributed storage system.
[0093] Therefore, in order to at least partially solve one or more of the above-mentioned problems and other potential problems, an embodiment of the present application proposes a data writing method, which can not only split a single global fingerprint table into multiple fingerprint tables for fingerprint storage, but also hierarchically plan and manage the data information of each fingerprint entry in the fingerprint table, which not only speeds up the fingerprint query efficiency, but also controls the scale of the fingerprint table.
[0094] Please refer to Figure 1 , Figure 1 1 is a flow chart of a data writing method applied to a fingerprint terminal proposed in one embodiment of the present application. Figure 1As shown, the method may include steps S101 to S104:
[0095] Step S101: In response to a target fingerprint corresponding to a target data block sent by a cache end, determining a first search identifier and a second search identifier of the target fingerprint;
[0096] Step S102: According to the first search identifier of the target fingerprint, query the target fingerprint table corresponding to the target fingerprint in the fingerprint pool, the fingerprint pool includes a plurality of fingerprint tables with different first search identifiers, and each of the fingerprint tables includes a plurality of fingerprints with different second search identifiers;
[0097] Step S103: when the second search identifier of the target fingerprint does not exist in the target fingerprint table, create a target fingerprint entry in the target fingerprint table, and send feedback information that the target fingerprint does not exist in the target fingerprint table to the cache end;
[0098] Step S104: receiving the target storage address and the target mapping address sent by the cache end, and writing the target storage address and the target mapping address into the target fingerprint entry.
[0099] In the present application, a data writing method suitable for a distributed storage system is proposed, which is applied to a fingerprint terminal, wherein the fingerprint terminal at least includes a fingerprint pool and a fingerprint pool operation module, the fingerprint pool is used to store various fingerprints, the fingerprint pool operation module is used to maintain the fingerprint table, and provides operations such as querying, writing, and deleting fingerprints. Different from the previous global fingerprint table indexing method according to fingerprints, the present application proposes a method of determining a first retrieval identifier and a second retrieval identifier of a fingerprint according to the fingerprint corresponding to each data block, and splitting the fingerprint table into multiple fingerprint tables according to the retrieval identifier, and the multiple fingerprint tables contain multiple fingerprint entries. The fingerprints are counted and stored in a hierarchical manner, and the fingerprint table where the fingerprint is stored is determined by inserting the first retrieval identifier, and the fingerprint entry where the fingerprint is stored is determined by retrieving the second retrieval identifier. In this way, data is written based on the fingerprint table, so that the fingerprint table occupies less space when storing a large number of fingerprints, and has higher query efficiency when performing fingerprint queries.
[0100] Step S101: In response to a target fingerprint corresponding to a target data block sent by a cache end, a first search identifier and a second search identifier of the target fingerprint are determined.
[0101] In the embodiment of the present application, in order to manage the fingerprints in the distributed storage system, a method is proposed to create a metadata pool outside the original data pool for storing data or to share the existing metadata pool, and the fingerprint table is dispersedly stored in the OSD (Object Storage Daemon) service of the metadata pool. Through the distributed storage management hard disk, the service of the underlying data storage is realized, and the fingerprint table is stored and maintained. In an optional embodiment, the fingerprint pool can be deployed on the SSD (Solid State Disk) disk, and the fingerprint table PG (Placement Group) is set in the fingerprint pool to handle various operations in the fingerprint pool. In the present application, the fingerprint pool serves as a storage carrier of the fingerprint end. When the target fingerprint corresponding to the target data block sent by the cache end is received, the first retrieval identifier and the second retrieval identifier of the target fingerprint need to be determined according to the fingerprint information of the target fingerprint, and the first retrieval identifier and the second retrieval identifier are used to query whether the fingerprint already exists in the fingerprint table. The fingerprint exists in the form of a character string consisting of multiple characters. Since the data blocks correspond to the fingerprints one-to-one, it is necessary to determine the number of possible fingerprints based on the types of data blocks that may exist in the storage system. Therefore, in an optional example, the first m characters in the fingerprint character string are used as the first retrieval identifier of the fingerprint, and the remaining characters are used as the second retrieval identifier of the fingerprint.
[0102] In an optional embodiment, the number of characters used to distinguish the first search identifier from the second search identifier can be determined according to the capacity of the data pool of the storage system. For example, assuming that the capacity of the data pool is k MB and the size of a single logical object stored is 4 MB, then at most k / 4 logical objects are stored in the data pool. Assuming that a logical object is split into 512 data blocks of 8 KB in size, and each data block corresponds to a fingerprint, then at most 512×k / 4 fingerprints exist in the data pool, that is, 128k fingerprints. Assuming that the first m characters of the fingerprint are used as the first search identifier of the fingerprint to distinguish the fingerprint table, it will be divided into 2 4M fingerprint table. Assuming that a fingerprint table contains 8k fingerprints, it satisfies 8×1024×2 4M = k / 4, then 2 4M +15=k. Then, according to the capacity k of the data pool, the first few characters in the character string that needs to be divided into fingerprints can be obtained as the first search identifier, so as to meet the use needs of the number of fingerprints in the data pool. For example, if the capacity of the data pool is 128TB, then k = 128TB, and m = 3 is calculated, then the first 3 characters in the fingerprint character string can be taken as the first search identifier, which can meet the fingerprint search needs of all data in the data pool; similarly, if the capacity of the data pool is 2PB, then m = 4 can be calculated, then the first 4 characters in the fingerprint character string can be taken as the first search identifier, which can meet the fingerprint search needs of all data in the data pool.
[0103] Step S102: According to the first search identifier of the target fingerprint, query the target fingerprint table corresponding to the target fingerprint in the fingerprint pool, the fingerprint pool includes multiple fingerprint tables with different first search identifiers, and each fingerprint table includes multiple fingerprints with different second search identifiers.
[0104] In the embodiment of the present application, after obtaining the first search identifier and the second search identifier of the target fingerprint, it is necessary to search each fingerprint table in the fingerprint pool according to the search identifier. First, according to the first search identifier, the first search identifier is used to distinguish different fingerprint tables. Different fingerprint tables correspond to different first search identifiers one by one. In the same fingerprint table, the first search identifiers of each fingerprint are the same, and they are further distinguished according to the second search identifier. In this way, hierarchical management of fingerprints is realized, and a huge global fingerprint table is split into multiple different fingerprint tables according to the first search identifier, which reduces space occupation and improves query efficiency. Here, the fingerprint table corresponding to the first search identifier of the target fingerprint is used as the target fingerprint table.
[0105] Step S103: when the second search identifier of the target fingerprint does not exist in the target fingerprint table, a target fingerprint entry is created in the target fingerprint table, and feedback information that the target fingerprint does not exist in the target fingerprint table is sent to the cache end.
[0106] In the embodiment of the present application, after determining the target fingerprint table, it is necessary to search in the target fingerprint table according to the second search identifier of the target fingerprint to determine whether the target fingerprint is stored in the target fingerprint table. If the data block corresponding to the target fingerprint has also been stored in the previous data writing process, there will be a corresponding fingerprint entry in the target fingerprint table to record the relevant information of the fingerprint. However, if the data block corresponding to the target fingerprint is not stored in the storage system, the second search identifier corresponding to the target fingerprint does not exist in the target fingerprint table. In this case, a new fingerprint entry should be added to the target fingerprint table, the target fingerprint is stored in the target fingerprint table, and feedback information that the target fingerprint does not exist in the target fingerprint table is sent to the cache end.
[0107] Step S104: receiving the target storage address and the target mapping address sent by the cache end, and writing the target storage address and the target mapping address into the target fingerprint entry.
[0108] In an embodiment of the present application, after the target fingerprint is stored in the target fingerprint table, the fingerprint end will feed back the information that the target fingerprint does not exist in the fingerprint pool to the cache end. After the cache end performs the data storage operation, it will return the specific target storage address of the target data block corresponding to the target fingerprint and the corresponding target mapping address to the fingerprint end. Here, the target storage address is the specific storage address of the data block corresponding to the target fingerprint in the data pool. In an optional embodiment, it can be the location of a hard disk in a specific node in the distributed storage system; and the target mapping address represents which data contains the data block corresponding to the target fingerprint, which is recorded in the fingerprint entry. In an optional embodiment, the target storage address of the target fingerprint can be recorded as<data_obj,off,len> The target mapping address of the target fingerprint can be stored as<src_obj,off,len> form.
[0109] In combination with the above embodiments, in one implementation, the present application further provides a data writing method, which, when the second search identifier of the target fingerprint exists in the target fingerprint table, specifically includes the following contents:
[0110] First, information stored in a fingerprint entry corresponding to the second search identifier of the target fingerprint in the target fingerprint table is obtained as target information.
[0111] In the embodiment of the present application, on the basis of the embodiment described above, there is also such a situation, that is, after the target fingerprint table is determined, a second retrieval identifier of the target fingerprint may exist in the target fingerprint table, that is, the target fingerprint has been stored in the fingerprint pool before this write operation. In this case, there is no need to rewrite the target fingerprint into the target fingerprint table, and only the specific information of the target fingerprint in the target fingerprint entry in the target fingerprint table needs to be checked. Here, the present application determines the information stored in the fingerprint entry corresponding to the second retrieval identifier of the target fingerprint in the target fingerprint table as the target information.
[0112] Then, when the target storage address exists in the target information, the target storage address corresponding to the target fingerprint is sent to the cache end.
[0113] In the embodiment of the present application, when the second retrieval identifier of the target fingerprint is stored in the target fingerprint table, there are two possibilities. First, in the target information saved under the target fingerprint entry, the target storage address of the target fingerprint is recorded, and it is determined that the data block corresponding to the target fingerprint has been stored in the data pool. In this case, it is only necessary to return the target storage address as the queried target storage address to the cache end.
[0114] In another case, when the target storage address does not exist in the target information, the query operation is suspended until a target storage address corresponding to the target fingerprint is generated in the fingerprint entry corresponding to the second search identifier of the target fingerprint.
[0115] In the embodiment of the present application, since multiple tasks may be processed simultaneously in the fingerprint pool, when the processing targets of the two tasks being performed simultaneously are both target fingerprints, if the target fingerprint does not exist in the target fingerprint table, the task that is performed first will create a target fingerprint entry in the target fingerprint table according to the method described above, and then it is necessary to wait for the cache end to return the target storage address and target mapping address of the target fingerprint and write them into the newly created target fingerprint entry. If during this waiting process, the task that is performed later also queries the target fingerprint in the target fingerprint table, thereby querying the target fingerprint entry just created by the previous task, but the target fingerprint entry does not contain the target information, the task that is performed later needs to temporarily stop the query operation until the cache end returns the target storage address and target mapping address of the target fingerprint.
[0116] In an optional embodiment, there may be multiple fingerprint tables PG on the fingerprint end, each fingerprint table PG corresponds to multiple fingerprint tables, and the fingerprint table PG corresponding to the fingerprint table can be determined according to the first search identifier. Specifically, the pgid of the PG can be obtained by performing a modulo operation on the total number pg_num of the fingerprint table PG by writing the first search identifier as ID here:
[0117] ID%pg_num=pgid.
[0118] In combination with the above embodiments, in one implementation, the present application further provides a data writing method, which, when the target storage address exists in the target information, specifically includes the following contents:
[0119] First, a mapping address table of the target fingerprint is created, wherein the mapping address table is used to store the mapping address of the target fingerprint, and the mapping address table at least includes: a third search identifier, a mapping object, and a mapping object address.
[0120] In the embodiment of the present application, as described above, the target data block corresponding to the target fingerprint has been stored in the data pool, and the target storage address and the target mapping address have been updated in the corresponding target fingerprint entry. In this case, the target fingerprint is written again. Considering data deduplication, it is not necessary to write the target data block corresponding to the target fingerprint in the data pool again, which causes data duplication and occupies more resources. However, since the newly added data contains the target data block, when the newly added data is stored in the storage system, it is necessary to associate the newly added data with the target fingerprint. In the present application, the mapping address is used to determine which data the target fingerprint corresponds to. However, since the data blocks corresponding to some fingerprints are included in multiple stored data, recording them one by one in the fingerprint entry will occupy more resources and is not convenient for query. Therefore, the present application proposes to create a mapping address table for fingerprints including more than one mapping. The mapping address table is used to store multiple mapping addresses of the target fingerprint, and the third search identifier is used to distinguish the mapping address tables of different fingerprints, and the mapping object and the mapping object address of the target fingerprint are recorded in the mapping address table, and the target information of the target fingerprint is further hierarchically processed, so that the fingerprint storage is clearly hierarchical and clear.
[0121] In an optional embodiment, in the mapping address table of the target fingerprint, the third search identifier may be a character string of the target fingerprint, the mapping object of the target fingerprint may be recorded in the form of src_obj, and the mapping object address of the target fingerprint may be recorded in the form of (off, len).
[0122] Then, according to the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint, the mapping object and the mapping object address of the first entry in the mapping address table of the target fingerprint are determined.
[0123] In an embodiment of the present application, after creating the mapping address table of the target fingerprint, the content in the mapping address table needs to be updated. Since the mapping address table is created for the target fingerprint when new data is written, it is first necessary to write the target fingerprint entry in the mapping address table. The mapping address originally corresponding to the target fingerprint is determined based on the original mapping address, and the mapping object and the mapping object address are written into the first entry of the mapping address table.
[0124] Next, according to the target mapping address of the target fingerprint sent by the cache end, the mapping object and the mapping object address of the second entry in the mapping address table of the target fingerprint are determined.
[0125] In an embodiment of the present application, the mapping address corresponding to the newly written data also needs to be recorded in the mapping address table of the target fingerprint. According to the mapping address of the target fingerprint sent by the cache pool, the mapping address corresponding to the newly written data is written into the second entry in the mapping address table in the form of a mapping object and a mapping object address.
[0126] Finally, a third search identifier is determined according to the target fingerprint, and the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint is updated to the third search identifier.
[0127] In the embodiment of the present application, since more than one mapping is stored in the target fingerprint, it is necessary to create a mapping address table to store the mapping address of the target fingerprint. However, in the subsequent query of the target fingerprint, it is still necessary to query the target fingerprint table according to the first retrieval identifier and the second retrieval identifier. The mapping address for the target fingerprint in the target fingerprint entry needs to be pointed to the mapping address table of the target fingerprint. Then, when the target fingerprint entry is retrieved, the mapping address information of the target fingerprint can also be obtained. Therefore, in the present application, the mapping address in the target fingerprint entry needs to be updated to the third retrieval flag, and the mapping address table corresponding to the target fingerprint can be queried according to the third retrieval identifier.
[0128] Specifically, there are two situations for the mapping address of the target fingerprint: first, if the data stored in the data pool is modified, the data block corresponding to the modified part needs to recalculate the corresponding fingerprint. If the fingerprint is changed, the mapping address of the data corresponding to the fingerprint before modification in the mapping address table needs to be deleted, and the mapping address of the data is added to the mapping address table corresponding to the modified fingerprint; then, there is another situation that the data stored in the data pool is deleted, and the mapping of the deleted data in the mapping address table needs to be deleted. In these two situations, if the data corresponding to the same fingerprint is less than two due to data modification or data deletion, the fingerprint no longer needs the mapping address table to store its corresponding mapping address, then the mapping address table is deleted, and the third search identifier in its fingerprint entry is modified to the only remaining mapping address of the fingerprint.
[0129] In an optional embodiment, a fingerprint entry also includes a fingerprint information flag, which can at least be used to mark whether the fingerprint corresponding to the fingerprint entry has a mapping address table and whether the storage address of the fingerprint has been written into the fingerprint entry. Specifically, the fingerprint information of the fingerprint can be represented by a flag.
[0130] In an optional embodiment, as shown in Table 1, Table 1 is a fingerprint table proposed in an embodiment of the present application, wherein different fingerprint tables are distinguished according to a first search identifier, and fingerprint entries of each fingerprint are distinguished by a second search identifier in the fingerprint table, and in each fingerprint entry, the fingerprint information, storage address and mapping address of the fingerprint are recorded.
[0131] Table 1 Fingerprint meaning table
[0132]
[0133] In an optional embodiment, as shown in Table 2, Table 2 is a mapping address table proposed in an embodiment of the present application, wherein the fingerprint to which the mapping address table belongs is distinguished based on a third retrieval identifier, and then the mapping addresses corresponding to the fingerprint are written into each entry in the mapping address table.
[0134] Table 2 Mapping address table
[0135]
[0136] In combination with the above embodiments, in one implementation, the present application further provides a data writing method, which specifically includes the following contents when there is no target fingerprint table corresponding to the target fingerprint in multiple fingerprint tables:
[0137] First, an original fingerprint table is created according to the first search identifier of the target fingerprint.
[0138] In the embodiment of the present application, when searching for the target fingerprint table of the target fingerprint in the fingerprint pool, there is still a situation where there is no corresponding fingerprint table. In this case, it is necessary to create an original fingerprint table based on the first search identifier of the target fingerprint. The original fingerprint table is used to store the fingerprint information of each fingerprint having the same first search identifier as the target fingerprint.
[0139] Then, the target fingerprint entry is created in the original fingerprint table.
[0140] In an embodiment of the present application, after creating the target fingerprint table, it is also necessary to create a target fingerprint entry corresponding to the target fingerprint to store fingerprint information related to the target fingerprint, which, as described above, at least includes the second retrieval identifier, fingerprint information, storage address and mapping address of the target fingerprint.
[0141] Finally, the target storage address and the target mapping address sent by the cache end are received, and the target storage address and the target mapping address are written into the target fingerprint entry to obtain the target fingerprint table.
[0142] In the embodiment of the present application, as described above, after creating the target fingerprint entry, it is necessary to wait for the cache end to return the target storage address and the target mapping address corresponding to the target fingerprint to the fingerprint end, and then write them in the target fingerprint entry. After writing the complete information of the target fingerprint, the newly created original fingerprint table can be determined as the target fingerprint table.
[0143] Please refer to Figure 2 , Figure 2 1 is a flow chart of a data writing method applied to a cache end proposed in one embodiment of the present application. Figure 2 As shown, the method may include steps S201 to S203:
[0144] Step S201: in response to a write operation on target data, a target fingerprint of a target data block in the target data is obtained, and the target fingerprint is sent to a fingerprint terminal.
[0145] In an embodiment of the present application, a data writing method suitable for a distributed storage system is proposed, which is applied to a cache end, wherein the cache end at least includes a cache pool and a cache pool operation module, the cache pool is used to store cache data, and the cache operation module is used to process the client's read and write requests. When a new data needs to be written to the data pool, the write operation will first be sent to the cache end. The cache end blocks the target data according to the write operation on the target data according to a block algorithm or other methods to obtain multiple data blocks, and then the cache end also needs to calculate the fingerprint of each data block. Optionally, a hash algorithm can be selected to calculate the fingerprint of each data block, such as sha256. After the target fingerprint of the target data block is calculated, the target fingerprint query instruction can be sent to the fingerprint end for subsequent operations.
[0146] Step S202: receiving feedback information sent by the fingerprint terminal, writing the target data block corresponding to the target fingerprint into the data pool, and obtaining the target storage address of the target data block in the data pool, wherein the feedback information is used to indicate that the target fingerprint does not exist in the target fingerprint table in the fingerprint pool.
[0147] In an embodiment of the present application, after the target fingerprint is sent to the fingerprint end, the cache end waits for the query result of the fingerprint end. If the target fingerprint is not found in the fingerprint pool, it means that the data block corresponding to the target fingerprint is not stored in the storage system, and the target data block needs to be written to the data pool. After the writing is completed, the target storage address where the target data block is specifically written needs to be recorded so that there is a trace to follow when the target data block needs to be viewed later.
[0148] Step S203: recording the target mapping address of the target data block corresponding to the target storage address in the buffer pool, and sending the target storage address and the target mapping address to the fingerprint end.
[0149] In an embodiment of the present application, after completing the storage of the target data block, it is also necessary to record the target mapping address of the target data block specifically mapped to the target data in the cache pool, so as to associate the target data block with the target data. After recording the target mapping address of the target data block, it is also necessary to send both the target storage address and the target mapping address to the fingerprint end, so as to update the target information in the target fingerprint entry.
[0150] In combination with the above embodiments, in one implementation, the present application further provides a data writing method, which specifically includes the following contents:
[0151] First, a target storage address in a fingerprint entry corresponding to the second search identifier of the target fingerprint sent by the fingerprint terminal is received, and the target data block corresponding to the target fingerprint is deleted.
[0152] In the example of the present application, if the target fingerprint is queried at the fingerprint end and is stored in the target fingerprint table, the storage address of the target fingerprint queried by the fingerprint end can be received, indicating that the target data block has been stored in the storage system and there is no need to store it again, thus avoiding wasting more resources. Therefore, the target data block in the cache is deleted to achieve deduplication of duplicate data.
[0153] Then, according to the target storage address in the fingerprint entry corresponding to the second search identifier of the target fingerprint, the target mapping address of the target data block corresponding to the target fingerprint is recorded in the cache pool.
[0154] In an embodiment of the present application, after obtaining the specific storage address of the target data block, it is also necessary to record the correspondence between the target data block and the target data in the cache pool and the fingerprint pool. Therefore, the target mapping address of the target data block corresponding to the target fingerprint is recorded in the cache pool, and the target mapping address is sent to the fingerprint end and recorded in the corresponding mapping fingerprint table.
[0155] In combination with the above embodiments, in one implementation, the present application further provides a data writing method, which specifically includes the following contents after recording the target mapping address of the target data block corresponding to the target storage address in the buffer pool:
[0156] First, based on the fingerprint table in the fingerprint pool, a cache fingerprint table is created in the cache pool, wherein the cache fingerprint table at least includes a cache fingerprint, and the cache fingerprint is a fingerprint identifier corresponding to each fingerprint stored in each fingerprint table of the fingerprint terminal.
[0157] In the embodiment of the present application, in order to improve the efficiency of fingerprint query when querying data in the database, it is also necessary to create a cache fingerprint table in the cache pool. The cache fingerprint table is created based on the fingerprint table in the fingerprint pool. The cache fingerprint table is used to record multiple cache fingerprints. The cache fingerprints correspond one-to-one to the fingerprints stored in each fingerprint table of the fingerprint end. In this way, when viewing the data in the database, there is no need to retrieve the fingerprint on the fingerprint end, and the cache fingerprint pool can be directly viewed on the cache end, which improves the query efficiency.
[0158] Then, a cache fingerprint entry corresponding to the cache fingerprint is created.
[0159] In the embodiment of the present application, after the cache fingerprint table is created, it is also necessary to create a plurality of cache fingerprint entries in the cache fingerprint table, each cache fingerprint entry corresponding to a cache fingerprint.
[0160] Next, in response to a user's query operation on the data in the data pool, the cache fingerprint table is queried for cache fingerprints corresponding to a plurality of data blocks in the data.
[0161] In the embodiment of the present application, when a user queries data in a data pool, it is not necessary to query the fingerprint table in the fingerprint pool, but it is possible to directly query the cache fingerprint table in the cache pool to query the cache fingerprint corresponding to each data block in the data.
[0162] The step of creating a cache fingerprint entry corresponding to the cache fingerprint includes:
[0163] In the case that the mapping address table does not exist in the fingerprint table, the cache fingerprint is used as information of the cache fingerprint entry;
[0164] When there is a mapping address table in the fingerprint table, the storage address and the mapping address are obtained from the fingerprint table and written into the cache fingerprint entry.
[0165] In the embodiment of the present application, although creating a cache fingerprint table in the cache pool can improve the data query efficiency, it will also face the problem of occupying more memory. Therefore, the present application proposes to divide the cache fingerprints in the cache fingerprint pool into two categories. The distinction standard is whether there is a mapping address table in the fingerprint pool for the fingerprint corresponding to the cache fingerprint. If there is no mapping address table, the fingerprint has only one mapping address, and it is considered that the probability of the data block corresponding to the fingerprint being viewed is relatively low. Therefore, only the existence of the fingerprint is recorded in the corresponding cache fingerprint entry, and its related fingerprint information is not recorded, saving storage space; if there is a mapping address table, the fingerprint has multiple mapping addresses, and it is considered that the probability of the data block corresponding to the fingerprint being viewed is relatively high. Therefore, in its corresponding cache fingerprint entry, the storage address, mapping address, etc. of the fingerprint are recorded, so that when querying the data block corresponding to the fingerprint, relevant information can be directly obtained in the cache fingerprint table of the cache end, thereby improving the query efficiency.
[0166] Based on the same inventive concept, the present application embodiment discloses a data writing system, referring to Figure 3 , Figure 3 Schematic diagram of a data writing system provided by an embodiment of the present application. Figure 3 As shown, the system includes a fingerprint end and a cache end, wherein:
[0167] The cache end is used to obtain a target fingerprint of a target data block in the target data in response to a write operation on the target data, and send the target fingerprint to the fingerprint end;
[0168] The fingerprint end is used to determine the first retrieval identifier and the second retrieval identifier of the target fingerprint in response to the target fingerprint corresponding to the target data block sent by the cache end; query the target fingerprint table corresponding to the target fingerprint in the fingerprint pool according to the first retrieval identifier of the target fingerprint; if the second retrieval identifier of the target fingerprint does not exist in the target fingerprint table, create a target fingerprint entry in the target fingerprint table, and send feedback information that the target fingerprint does not exist in the target fingerprint table to the cache end;
[0169] The cache end is further used to receive feedback information sent by the fingerprint end, write the target data block corresponding to the target fingerprint into the data pool, and obtain the target storage address of the target data block in the data pool; record the target mapping address of the target data block corresponding to the target storage address in the cache pool, and send the target storage address and the target mapping address to the fingerprint end;
[0170] The fingerprint end is further used to receive the target storage address and the target mapping address sent by the cache end, and write the target storage address and the target mapping address into the target fingerprint entry.
[0171] In an optional embodiment, if Figure 4 As shown, Figure 4 This is a data writing process diagram proposed in an embodiment of the present application. First, the cache end receives the write operation of the target data, divides the target data into blocks and obtains the fingerprint of each data block, and then sends the fingerprint query instruction to the fingerprint end. After receiving the instruction, the fingerprint end queries the fingerprint table. If the target fingerprint already exists, it is necessary to check whether there is a physical address in the corresponding fingerprint entry. If it exists, the physical address is returned to the cache end. If it does not exist, wait for the physical address to be updated. The target data block in the cache end pool can be directly deleted, and the mapping address in the cache pool is updated; if the target fingerprint does not exist in the fingerprint table, it is necessary to create a target fingerprint entry corresponding to the target fingerprint, and return the information of the non-existence of the target fingerprint to the cache end. After the cache end writes the target data block into the data pool, it returns the storage address and the mapping address to the fingerprint end, and updates the storage address and the mapping address in the target fingerprint entry.
[0172] Based on the same design concept, an embodiment of the present application provides a data writing device, which is applied to a fingerprint terminal. Figure 5 , Figure 5 1 is a structural block diagram of a data writing device applied to a fingerprint terminal provided by an embodiment of the present application. Figure 5 As shown, the device comprises:
[0173] A search identifier determination module, configured to determine a first search identifier and a second search identifier of the target fingerprint in response to a target fingerprint corresponding to a target data block sent by the cache end;
[0174] a target fingerprint table query module, configured to query a target fingerprint table corresponding to the target fingerprint in a fingerprint pool according to the first retrieval identifier of the target fingerprint, wherein the fingerprint pool comprises a plurality of fingerprint tables with different first retrieval identifiers, and each of the fingerprint tables comprises a plurality of fingerprints with different second retrieval identifiers;
[0175] a target fingerprint entry creation module, configured to create a target fingerprint entry in the target fingerprint table if the second search identifier of the target fingerprint does not exist in the target fingerprint table, and send feedback information that the target fingerprint does not exist in the target fingerprint table to the cache end;
[0176] The target fingerprint entry writing module is used to receive the target storage address and the target mapping address sent by the cache end, and write the target storage address and the target mapping address into the target fingerprint entry.
[0177] Optionally, the data writing device further includes:
[0178] a target information acquisition module, configured to acquire information stored in a fingerprint entry corresponding to the second search identifier of the target fingerprint in the target fingerprint table as target information;
[0179] A storage address sending module, configured to send the target storage address corresponding to the target fingerprint to the cache end if the target storage address exists in the target information;
[0180] The query operation suspension module is used to suspend the query operation when the target storage address does not exist in the target information, until a target storage address corresponding to the target fingerprint is generated in the fingerprint entry corresponding to the second search identifier of the target fingerprint.
[0181] Optionally, the storage address sending module further includes:
[0182] A mapping address table creation submodule, used to create a mapping address table of the target fingerprint, the mapping address table is used to store the mapping address of the target fingerprint, the mapping address table at least includes: a third search identifier, a mapping object and a mapping object address;
[0183] A first entry information determination submodule, configured to determine a mapping object and a mapping object address of a first entry in a mapping address table of the target fingerprint according to a mapping address in a fingerprint entry corresponding to the second search identifier of the target fingerprint;
[0184] A second entry information determination submodule, configured to determine a mapping object and a mapping object address of a second entry in a mapping address table of the target fingerprint according to a target mapping address of the target fingerprint sent by the cache end;
[0185] The mapping address updating submodule is used to determine a third search identifier according to the target fingerprint, and update the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint to the third search identifier.
[0186] Optionally, the data writing device further includes:
[0187] An original fingerprint table creation module, used for creating an original fingerprint table according to the first search identifier of the target fingerprint;
[0188] A target fingerprint entry creation module, used to create the target fingerprint entry in the original fingerprint table;
[0189] The target fingerprint table determination module is used to receive the target storage address and the target mapping address sent by the cache end, write the target storage address and the target mapping address into the target fingerprint entry, and obtain the target fingerprint table.
[0190] Based on the same design concept, an embodiment of the present application provides a data writing device, which is applied to a cache end. Figure 6 , Figure 6 1 is a structural block diagram of a data writing device applied to a cache end provided by an embodiment of the present application. Figure 6 As shown, the device comprises:
[0191] A fingerprint acquisition module, configured to acquire a target fingerprint of a target data block in the target data in response to a write operation on the target data, and send the target fingerprint to a fingerprint terminal;
[0192] a target data block writing module, configured to receive feedback information sent by the fingerprint terminal, write the target data block corresponding to the target fingerprint into a data pool, and obtain a target storage address of the target data block in the data pool, wherein the feedback information is used to indicate that the target fingerprint table in the fingerprint pool does not contain a second retrieval identifier;
[0193] The target mapping address acquisition module is used to record the target mapping address of the target data block corresponding to the target storage address in the cache pool, and send the target storage address and the target mapping address to the fingerprint end.
[0194] Optionally, the data writing device further includes:
[0195] a target data block deletion module, configured to receive a target storage address in a fingerprint entry corresponding to the second search identifier of the target fingerprint sent by the fingerprint terminal, and delete the target data block corresponding to the target fingerprint;
[0196] The target mapping address recording module is used to record the target mapping address of the target data block corresponding to the target fingerprint in the cache pool according to the target storage address in the fingerprint entry corresponding to the second search identifier of the target fingerprint.
[0197] Optionally, the data writing device further includes:
[0198] A cache fingerprint table creation module, used to create a cache fingerprint table in the cache pool based on the fingerprint table in the fingerprint pool, wherein the cache fingerprint table at least includes a cache fingerprint, and the cache fingerprint is a fingerprint identifier corresponding to each fingerprint stored in each fingerprint table of the fingerprint terminal;
[0199] A cache fingerprint entry creation module, used to create a cache fingerprint entry corresponding to the cache fingerprint;
[0200] A cache fingerprint query module, configured to query cache fingerprints corresponding to a plurality of data blocks in the data in the cache fingerprint table in response to a user's query operation on the data in the data pool;
[0201] The step of creating a cache fingerprint entry corresponding to the cache fingerprint includes:
[0202] A cache fingerprint entry information determination module, used to use the cache fingerprint as cache fingerprint entry information when there is no mapping address table in the fingerprint table;
[0203] The cache fingerprint entry writing module is used to obtain the storage address and the mapping address in the fingerprint table when there is a mapping address table in the fingerprint table, and write them into the cache fingerprint entry.
[0204] Based on the same design concept, another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the data writing method described in any of the above embodiments of the present application are implemented.
[0205] Based on the same design concept, another embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in the data writing method described in any of the above embodiments of the present application.
[0206] Based on the same design concept, another embodiment of the present application provides an electronic device, such as Figure 7 shown. Figure 7 1 is a schematic diagram of an electronic device shown in an embodiment of the present application. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes, the steps in the data writing method described in any of the above embodiments of the present application are implemented.
[0207] As for the device embodiment, 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.
[0208] 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.
[0209] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of the present application may 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.) that contain computer-usable program code.
[0210] 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.
[0211] 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.
[0212] 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.
[0213] 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.
[0214] 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.
[0215] The above is a detailed introduction to a data writing method, system, device 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 writing method, characterized in that: Applied to fingerprint terminal, including: In response to a target fingerprint corresponding to a target data block sent by the cache end, determining a first search identifier and a second search identifier of the target fingerprint; According to the first search identifier of the target fingerprint, query a target fingerprint table corresponding to the target fingerprint in a fingerprint pool, wherein the fingerprint pool includes a plurality of fingerprint tables with different first search identifiers, and each of the fingerprint tables includes a plurality of fingerprints with different second search identifiers; In the case that the second search identifier of the target fingerprint does not exist in the target fingerprint table, creating a target fingerprint entry in the target fingerprint table, and sending feedback information that the target fingerprint does not exist in the target fingerprint table to the cache end; Receive the target storage address and the target mapping address sent by the cache end, and write the target storage address and the target mapping address into the target fingerprint entry.
2. The data writing method according to claim 1, characterized in that: In the case where the second search identifier of the target fingerprint exists in the target fingerprint table, the method further includes: Acquire information stored in a fingerprint entry corresponding to the second search identifier of the target fingerprint in the target fingerprint table as target information; When the target storage address exists in the target information, sending the target storage address corresponding to the target fingerprint to the cache end; In the case that the target storage address does not exist in the target information, the query operation is suspended until a target storage address corresponding to the target fingerprint is generated in the fingerprint entry corresponding to the second search identifier of the target fingerprint.
3. The data writing method according to claim 2, characterized in that: In the case where the target storage address exists in the target information, the method further includes: Creating a mapping address table of the target fingerprint, the mapping address table is used to store the mapping address of the target fingerprint, the mapping address table at least includes: a third search identifier, a mapping object and a mapping object address; Determine a mapping object and a mapping object address of a first entry in a mapping address table of the target fingerprint according to a mapping address in a fingerprint entry corresponding to the second search identifier of the target fingerprint; Determine, according to the target mapping address of the target fingerprint sent by the cache end, a mapping object and a mapping object address of a second entry in the mapping address table of the target fingerprint; A third search identifier is determined according to the target fingerprint, and the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint is updated to the third search identifier.
4. The data writing method according to claim 1, characterized in that: In the case that there is no target fingerprint table corresponding to the target fingerprint in the multiple fingerprint tables, the method further includes: Creating an original fingerprint table according to the first search identifier of the target fingerprint; Creating the target fingerprint entry in the original fingerprint table; The target storage address and the target mapping address sent by the cache end are received, and the target storage address and the target mapping address are written into the target fingerprint entry to obtain the target fingerprint table.
5. A data writing method, characterized in that: Applied to the cache side, including: In response to a write operation on target data, obtaining a target fingerprint of a target data block in the target data, and sending the target fingerprint to a fingerprint terminal; Receive feedback information sent by the fingerprint terminal, write the target data block corresponding to the target fingerprint into the data pool, and obtain the target storage address of the target data block in the data pool, wherein the feedback information is used to indicate that the target fingerprint does not exist in the target fingerprint table in the fingerprint pool; The target mapping address of the target data block corresponding to the target storage address is recorded in the buffer pool, and the target storage address and the target mapping address are sent to the fingerprint end.
6. The data writing method according to claim 5, characterized in that: The method further comprises: receiving a target storage address in a fingerprint entry corresponding to the second search identifier of the target fingerprint sent by the fingerprint terminal, and deleting the target data block corresponding to the target fingerprint; According to the target storage address in the fingerprint entry corresponding to the second search identifier of the target fingerprint, the target mapping address of the target data block corresponding to the target fingerprint is recorded in the cache pool.
7. The data writing method according to claim 5, characterized in that: After recording the target mapping address of the target data block corresponding to the target storage address in the buffer pool, the method further includes: Based on the fingerprint table in the fingerprint pool, a cache fingerprint table is created in the cache pool, wherein the cache fingerprint table includes at least a cache fingerprint, and the cache fingerprint is a fingerprint identifier corresponding to each fingerprint stored in each fingerprint table of the fingerprint terminal; Creating a cache fingerprint entry corresponding to the cache fingerprint; In response to a user's query operation on the data in the data pool, querying the cache fingerprint table for cache fingerprints corresponding to a plurality of data blocks in the data; The step of creating a cache fingerprint entry corresponding to the cache fingerprint includes: In the case that the mapping address table does not exist in the fingerprint table, the cache fingerprint is used as information of the cache fingerprint entry; When there is a mapping address table in the fingerprint table, the storage address and the mapping address are obtained from the fingerprint table and written into the cache fingerprint entry.
8. A data writing system, characterized in that: The system includes a fingerprint terminal and a cache terminal; The cache end is used to obtain a target fingerprint of a target data block in the target data in response to a write operation on the target data, and send the target fingerprint to the fingerprint end; The fingerprint end is used to determine the first search identifier and the second search identifier of the target fingerprint in response to the target fingerprint corresponding to the target data block sent by the cache end; and query the target fingerprint table corresponding to the target fingerprint in the fingerprint pool according to the first search identifier of the target fingerprint; In the case that the second search identifier of the target fingerprint does not exist in the target fingerprint table, creating a target fingerprint entry in the target fingerprint table, and sending feedback information that the target fingerprint does not exist in the target fingerprint table to the cache end; The cache end is further used to receive feedback information sent by the fingerprint end, write the target data block corresponding to the target fingerprint into the data pool, and obtain the target storage address of the target data block in the data pool; record the target mapping address of the target data block corresponding to the target storage address in the cache pool, and send the target storage address and the target mapping address to the fingerprint end; The fingerprint end is further used to receive the target storage address and the target mapping address sent by the cache end, and write the target storage address and the target mapping address into the target fingerprint entry.
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 steps in the data writing method described in any one of claims 1 to 4, or the processor executes the computer program to implement the steps in the data writing method described in any one of claims 5 to 7.
10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by the processor, the steps in the data writing method described in any one of claims 1-4 are implemented; or, when the computer program / instruction is executed by the processor, the steps in the data writing method described in any one of claims 5-7 are implemented.
Citation Information
Patent Citations
Data re-deletion method and storage device
CN107329692A
Method for deleting duplicated data in storage system, storage system and controller
CN109074226A
Repeated data deleting method in storage system, storage system and controller
CN111427855A
Data management method and system, electronic equipment and storage medium
CN111881168A
Storage space management method and device, equipment, medium and program product
CN113254365A