A data writing method, system, device and medium
By splitting the global fingerprint table into multiple fingerprint tables and managing them using a mapping address table, the problems of low query efficiency and high memory consumption of fingerprint tables in distributed storage systems are solved, achieving efficient data management and querying.
Patent Information
- Application Number
- CN202412000431.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In distributed storage systems, existing technologies struggle to effectively manage the query efficiency and memory usage of fingerprint tables, resulting in low deduplication rates and wasted resources.
By splitting the global fingerprint table into multiple fingerprint tables and managing them using a mapping address table, and utilizing the first and second retrieval identifiers for hierarchical storage and retrieval of fingerprints, a mapping address table is established to optimize fingerprint query efficiency and memory usage.
It improves fingerprint query efficiency, reduces the memory space occupied by fingerprints, and enables efficient management and querying of data in distributed storage systems.
Smart Images

Figure CN119806424B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data storage, in particular to a data writing method, system, device and medium. BACKGROUND
[0002] In the related art, deleting repeated data in a storage system is a technology for cleaning repeated data in the storage system, thereby reducing the actual storage space 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, with continuous data writing, 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, and the number of nodes is large. If a copy of the global fingerprint table is maintained on each node, the consistency of the fingerprint table is difficult to achieve, and a large amount of system resources will also be occupied. If each node only maintains its own local fingerprint table, the deduplication rate, i.e. the data reduction rate of the repeated data deletion, cannot be guaranteed.
[0004] In the related art, the fingerprint is directly saved in the metadata pool or the data pool, which causes the number of fingerprint objects to be too large and the query efficiency to be low. In addition, the fingerprint cache saves all fingerprints in the memory, which causes the memory usage to be too large.
[0005] Therefore, how to improve the fingerprint query efficiency and reduce the memory occupied by the fingerprint has become a problem to be solved. SUMMARY
[0006] In view of the above technical problems, the embodiments of the present application provide a data writing method, system, device and medium, which aims to improve the fingerprint query efficiency and reduce the memory occupied by the fingerprint.
[0007] The first aspect of the embodiments of the present application provides a data writing method applied to a fingerprint end, the method comprising:
[0008] 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;
[0009] According to the first search identifier of the target fingerprint, querying a target fingerprint table corresponding to the target fingerprint in a fingerprint pool, the fingerprint pool comprising a plurality of fingerprint tables with different first search identifiers, and each of the fingerprint tables comprising 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] 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.
[0012] Optionally, in the case that the second search identifier of the target fingerprint exists in the target fingerprint table, the method further comprises:
[0013] obtaining information stored in the fingerprint entry corresponding to the second search identifier of the target fingerprint in the target fingerprint table as target information;
[0014] in the case that 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, suspending the query operation until the 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, in the case that the target storage address exists in the target information, the method further comprises:
[0017] creating a mapping address table of the target fingerprint, the mapping address table being used to store mapping addresses of the target fingerprint, the mapping address table at least comprising a third search identifier, a mapping object and a mapping object address;
[0018] determining the mapping object and the mapping object address of a first entry in the mapping address table of the target fingerprint according to the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint;
[0019] determining the mapping object and the mapping object address of a second entry in the mapping address table of the target fingerprint according to the target mapping address of the target fingerprint sent by the cache end;
[0020] determining a third search identifier according to the target fingerprint, and updating the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint to the third search identifier.
[0021] Optionally, in the case that the target fingerprint table corresponding to the target fingerprint does not exist in a plurality of fingerprint tables, the method further comprises:
[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] receiving the target storage address and the target mapping address sent by the cache end, writing the target storage address and the target mapping address into the target fingerprint entry, and obtaining the target fingerprint table.
[0025] The second aspect of the embodiments of the present application provides a data writing method applied to a cache end, and the method comprises the following steps.
[0026] In response to a writing 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 end;
[0027] receiving feedback information sent by the fingerprint end, writing the target data block corresponding to the target fingerprint into a data pool, and obtaining a target storage address of the target data block in the data pool, wherein the feedback information is used to represent a second search identifier of the target fingerprint table in the fingerprint pool, and the second search identifier represents that the target fingerprint does not exist in the target fingerprint table;
[0028] recording a target mapping address of the target data block corresponding to the target storage address in a cache pool, and sending the target storage address and the target mapping address to the fingerprint end.
[0029] Optionally, the method further comprises the following steps.
[0030] receiving a target storage address in a fingerprint entry corresponding to the second search identifier of the target fingerprint sent by the fingerprint end, and deleting the target data block corresponding to the target fingerprint;
[0031] recording a 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.
[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 comprises the following steps.
[0033] creating a cache fingerprint table in the cache pool based on the fingerprint tables in the fingerprint pool, wherein the cache fingerprint table at least comprises cache fingerprints, and the cache fingerprints are fingerprint identifiers corresponding to each fingerprint stored in each fingerprint table of the fingerprint end;
[0034] creating a cache fingerprint entry corresponding to the cache fingerprint;
[0035] in response to a query operation of a user on data in the data pool, querying cache fingerprints corresponding to a plurality of data blocks in the data in the cache fingerprint table;
[0036] The creating of the cache fingerprint entry corresponding to the cache fingerprint comprises the following steps.
[0037] In the case that the mapping address table does not exist in the fingerprint table, the cache fingerprint is taken as the information of the cache fingerprint entry;
[0038] In the case that the mapping address table exists in the fingerprint table, the storage address and the mapping address are obtained in the fingerprint table, and are written in the cache fingerprint entry.
[0039] The third aspect of the 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 configured to obtain a target fingerprint of a target data block in target data in response to a writing operation on the target data, and send the target fingerprint to the fingerprint end.
[0041] The fingerprint end is configured to determine a first search identifier and a second search identifier of the target fingerprint in response to the target fingerprint corresponding to the target data block sent by the cache end, query a target fingerprint table corresponding to the target fingerprint in a fingerprint pool according to the first search identifier of the target fingerprint, create a target fingerprint entry in the target fingerprint table in the case that 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.
[0042] The cache end is further configured to receive the feedback information sent by the fingerprint end, 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; record a target mapping address of the target data block corresponding to the target storage address in a cache pool, and send the target storage address and the target mapping address to the fingerprint end.
[0043] The fingerprint end is further configured 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] The fourth aspect of the embodiment of the present application provides a data writing device, which is applied to a fingerprint end, and the device comprises:
[0045] A search identifier determination module is configured to determine a first search identifier and a second search identifier of a target fingerprint in response to the target fingerprint corresponding to a target data block sent by a cache end.
[0046] A target fingerprint table query module is configured to query a target fingerprint table corresponding to the target fingerprint in a fingerprint pool according to the first search identifier of the target fingerprint, wherein the fingerprint pool comprises a plurality of fingerprint tables with different first search identifiers, and each of the fingerprint tables comprises a plurality of fingerprints with different second search identifiers.
[0047] a target fingerprint item creation module, configured to create a target fingerprint item 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] a target fingerprint item writing module, configured 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 item.
[0049] Optionally, the data writing device further comprises:
[0050] a target information acquisition module, configured to acquire information stored in a fingerprint item 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 a target storage address corresponding to the target fingerprint to the cache end if the target storage address exists in the target information;
[0052] a query operation suspension module, configured to suspend a query operation if the target storage address does not exist in the target information, until a target storage address corresponding to the target fingerprint is generated in a fingerprint item corresponding to the second search identifier of the target fingerprint.
[0053] Optionally, the storage address sending module further comprises:
[0054] a mapping address table creation submodule, configured to create a mapping address table of the target fingerprint, the mapping address table being configured to store mapping addresses of the target fingerprint, and the mapping address table at least comprising a third search identifier, a mapping object and a mapping object address;
[0055] a first item information determination submodule, configured to determine a mapping object and a mapping object address of a first item in the mapping address table of the target fingerprint according to a mapping address in a fingerprint item corresponding to the second search identifier of the target fingerprint;
[0056] a second item information determination submodule, configured to determine a mapping object and a mapping object address of a second item in the mapping address table of the target fingerprint according to a target mapping address of the target fingerprint sent by the cache end;
[0057] a mapping address updating submodule, configured to determine a third search identifier according to the target fingerprint, and update the mapping address in the fingerprint item corresponding to the second search identifier of the target fingerprint to the third search identifier.
[0058] Optionally, the data writing device further comprises:
[0059] a raw fingerprint table creating module configured to create a raw fingerprint table according to the first search identifier of the target fingerprint;
[0060] a target fingerprint entry creating module configured to create the target fingerprint entry in the raw fingerprint table;
[0061] a target fingerprint table determining module configured 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] In a fifth aspect, the embodiment of the present application provides a data writing device applied to a cache end, and the device comprises:
[0063] a fingerprint obtaining module configured to obtain a target fingerprint of a target data block in target data in response to a writing operation on the target data, and send the target fingerprint to a fingerprint end;
[0064] a target data block writing module configured to receive feedback information sent by the fingerprint end, write a 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 represent that a second search identifier of the target fingerprint does not exist in a target fingerprint table in a fingerprint pool;
[0065] a target mapping address obtaining module configured to record a target mapping address of the target data block corresponding to the target storage address in a cache pool, and send the target storage address and the target mapping address to the fingerprint end.
[0066] Optionally, the data writing device further comprises:
[0067] a target data block deleting 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 end, and delete the target data block corresponding to the target fingerprint;
[0068] a target mapping address recording module configured to record a 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 comprises:
[0070] The cache fingerprint table creation module is configured to create a cache fingerprint table in the cache pool based on the fingerprint table in the fingerprint pool, the cache fingerprint table including at least a cache fingerprint corresponding to each fingerprint stored in each fingerprint table of the fingerprint end.
[0071] The cache fingerprint entry creation module is configured to create a cache fingerprint entry corresponding to the cache fingerprint.
[0072] The cache fingerprint query module is configured to query the cache fingerprint corresponding to a plurality of data blocks in the data in the cache fingerprint table in response to a query operation on the data in the data pool by a user.
[0073] The cache fingerprint entry creation module is configured to create a cache fingerprint entry corresponding to the cache fingerprint.
[0074] The cache fingerprint entry information determination module is configured to, in a case where the mapping address table does not exist in the fingerprint table, take the cache fingerprint as information of the cache fingerprint entry.
[0075] The cache fingerprint entry writing module is configured to, in a case where the mapping address table exists in the fingerprint table, acquire a storage address and a mapping address in the fingerprint table, and write the cache fingerprint entry.
[0076] The sixth aspect of the embodiment of the present application provides an electronic device, the electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, 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] The seventh aspect of the embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, when the computer program is executed by a 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 a processor, the data writing method of the first aspect of the embodiment of the present application is implemented.
[0078] The eighth aspect of the embodiment of the present application provides a computer program product, comprising computer programs / instructions, when the computer programs / instructions are executed by a processor, the data writing method of the first aspect of the embodiment of the present application is implemented, or when the computer programs / instructions are executed by a processor, the data writing method of the first aspect of the embodiment of the present application is implemented.
[0079] According to the data writing method in the embodiment of the present application, for multiple nodes in the distributed storage system, according to the fingerprints of each data block after data writing, whether the corresponding fingerprint table and the fingerprint entries in the fingerprint table exist in the fingerprint pool is searched according to the first search identifier and the second search identifier, for the fingerprint not stored in the fingerprint pool, the fingerprint entries are created in the corresponding fingerprint table, and according to the storage address and the mapping address corresponding to the fingerprint sent by the cache end, the related information is supplemented and written into the fingerprint entries, and for the fingerprint existing in the fingerprint pool, the storage address corresponding to the fingerprint is directly sent to the cache end.
[0080] In the present application, on the basis of the data deduplication based on the fingerprint table in the prior art, the method for writing data into the distributed storage system is proposed, according to the different fingerprints corresponding to each data block, the first search identifier and the second search identifier are taken as the basis, a data amount huge global fingerprint table is divided into multiple smaller fingerprint tables, the influence of the query efficiency of the fingerprint by the too large single fingerprint table is avoided, and through the establishment of the mapping fingerprint table, the data integration is performed on the fingerprint with multiple mapping addresses, the data amount size in the single fingerprint table is further controlled, the query efficiency of the fingerprint is accelerated, the cache size of the fingerprint is controlled, and the efficient management and query of the data based on the fingerprint table are realized. BRIEF DESCRIPTION OF DRAWINGS
[0081] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0082] Figure 1 is a flow chart of a data writing method applied to a fingerprint end according to an embodiment of the present application;
[0083] Figure 2 is a flow chart of a data writing method applied to a cache end according to an embodiment of the present application;
[0084] Figure 3 is a schematic diagram of a data writing system according to an embodiment of the present application;
[0085] Figure 4 is a data writing flow schematic diagram according to an embodiment of the present application;
[0086] Figure 5 is a structural block diagram of a data writing device applied to a fingerprint end according to 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 is a schematic diagram of an electronic device shown by an embodiment of the present application. DETAILED DESCRIPTION
[0089] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0090] In the drawings, the size of a constituent element, the thickness of a layer, or a region may be exaggerated for the sake of clarity in some cases. Therefore, the size of any one implementation of the present disclosure is not necessarily limited to the size shown in the drawings. The shapes and sizes of components in the drawings do not reflect actual proportions. Furthermore, the drawings schematically show ideal examples, and any one implementation of the present disclosure is not limited to the shapes or values shown in the drawings.
[0091] In the method for deduplicating data by using a fingerprint table, a global fingerprint table is usually established in a storage node, which contains fingerprints corresponding to all data blocks. By querying the relevant fingerprints in the fingerprint table, it is determined whether a data block has been stored in the storage node when a new data block is written, so as to avoid the waste of storage resources caused by storing the same data block in the node repeatedly.
[0092] However, although the related technology can delete duplicate data by establishing a fingerprint table, when applied to a distributed storage system, due to a large amount of data storage, the related technology simply establishes a global fingerprint table, which not only reduces the query efficiency of the fingerprint, 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 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 storing fingerprints, but also hierarchically plan and manage the data information of each fingerprint entry in the fingerprint table, thereby not only accelerating the fingerprint query efficiency, but also controlling the size of the fingerprint table.
[0094] Please refer to Figure 1 , Figure 1 is a flowchart of a data writing method applied to a fingerprint end proposed by an embodiment of the present application. As shown in Figure 1As shown, the method can include steps S101 to S104:
[0095] Step S101: in response to the target fingerprint corresponding to the target data block sent by the cache end, determining the first search identifier and the second search identifier of the target fingerprint;
[0096] Step S102: according to the first search identifier of the target fingerprint, querying the target fingerprint table corresponding to the target fingerprint in the fingerprint pool, the fingerprint pool containing a plurality of fingerprint tables with different first search identifiers, and each of the fingerprint tables containing a plurality of fingerprints with different second search identifiers;
[0097] Step S103: 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;
[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 this application, a data writing method suitable for a distributed storage system is proposed, which is applied to a fingerprint end. The fingerprint end at least includes a fingerprint pool and a fingerprint pool operation module. The fingerprint pool is used to store various fingerprints, and the fingerprint pool operation module is used to maintain a fingerprint table, provide fingerprint query, writing, deletion and other operations. Different from the previous global fingerprint table indexing method according to fingerprints, this application proposes a method of determining the first search identifier and the second search identifier of the fingerprint according to the fingerprint corresponding to each data block, and splitting the fingerprint table into multiple fingerprint tables according to the search identifier, and multiple fingerprint tables contain multiple fingerprint entries. The fingerprints are hierarchically counted and stored. The first search identifier is determined by the fingerprint table where the fingerprint is stored, and the second search identifier is determined by the fingerprint entry where the fingerprint is stored. Through this method, the data writing based on the fingerprint table makes the fingerprint table occupy less space when storing a large number of fingerprints, and has higher query efficiency when querying the fingerprint.
[0100] Step S101: in response to the target fingerprint corresponding to the target data block sent by the cache end, determining the first search identifier and the second search identifier of the target fingerprint.
[0101] In the embodiments of the present application, in order to manage the fingerprints in the distributed storage system, it is proposed to create a metadata pool outside the original data pool for storing data or share the existing metadata pool, to store the fingerprint table in the OSD (Object Storage Daemon) service of the metadata pool, to manage the hard disk through the distributed storage, to realize the service of the data bottom layer storage, to store and maintain the fingerprint table, and 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 process each operation in the fingerprint pool. In the present application, the fingerprint pool is the 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 search identifier and the second search identifier of the target fingerprint are determined according to the fingerprint information of the target fingerprint, and whether the fingerprint exists in the fingerprint table is queried through the first search identifier and the second search identifier. The fingerprint exists in the form of a string composed of multiple characters, and since the data block and the fingerprint are one-to-one corresponding, the number of possible fingerprints needs to be determined according to the type of the data block that may exist in the storage system, and therefore in an optional example, the first m characters in the string of the fingerprint are taken as the first search identifier of the fingerprint, and the remaining characters are taken as the second search identifier of the fingerprint.
[0102] In an optional embodiment, the number of characters used to distinguish the first search identifier and the second search identifier can be determined according to the capacity scale 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, and assuming that a logical object is divided into 512 data blocks with a size of 8 KB, each data block corresponds to a fingerprint, then at most 512×k / 4 fingerprints, i.e. 128k fingerprints, exist in the data pool. Assuming that the first m characters of the fingerprint are taken as the first search identifier of the fingerprint to distinguish the fingerprint table, then 2 4M k / 4, then 2 4M = k / 4, then 2 4M +15=k. Then according to the capacity k of the data pool, the first several characters in the string of the fingerprint to be divided can be obtained as the first search identifier, which can meet the use needs of the number of fingerprints in the data pool. For example, if the capacity of the data pool is 128TB, k=128TB, m=3 is calculated, and the first 3 characters in the string of the fingerprint 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, m=4 can be calculated, and the first 4 characters in the string of the fingerprint 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: querying the target fingerprint table corresponding to the target fingerprint according to the first search identifier of the target fingerprint, wherein the fingerprint pool comprises a plurality of fingerprint tables with different first search identifiers, and each of the fingerprint tables comprises a plurality of 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, the first search identifier is used to distinguish different fingerprint tables, and 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 the second search identifier is used for further distinction. In this way, hierarchical management of fingerprints is realized, a large global fingerprint table is split into a plurality of different fingerprint tables according to the first search identifier, the space occupation is reduced, and the query efficiency is improved. Here, the fingerprint table corresponding to the first search identifier of the target fingerprint is taken as the target fingerprint table.
[0105] Step S103: 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.
[0106] In the embodiment of the present application, after determining the target fingerprint table, it is necessary to search 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 is also stored in the previous data writing process, the corresponding fingerprint entry will exist in the target fingerprint table to record the related 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, and a new fingerprint entry should be added in the target fingerprint table to store the target fingerprint 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 the embodiment of the present application, after the target fingerprint is stored in the target fingerprint table, the fingerprint end feeds back 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, the target data block corresponding to the target fingerprint is returned to the fingerprint end, and the specific target storage address of the target data block corresponding to the target fingerprint in the data pool and the corresponding target mapping address are returned to the fingerprint end. In an optional embodiment, the target storage address can be the position of a specific hard disk in a specific node in a distributed storage system. The target mapping address represents which data contains the data block corresponding to the target fingerprint, and is recorded in the fingerprint entry. In an optional embodiment, the target storage address of the target fingerprint can be recorded in the form of <data_obj, off, len>, and the target mapping address of the target fingerprint can be stored in the form of <src_obj, off, len>.
[0109] In combination with the above embodiment, in an embodiment, the present application further provides a data writing method. In the case where the second search identifier of the target fingerprint exists in the target fingerprint table, the method specifically includes the following contents:
[0110] First, the information stored in the 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 above-described embodiment, there is also a case that after the target fingerprint table is determined, the second search identifier of the target fingerprint exists in the target fingerprint table, that is, the target fingerprint has been stored in the fingerprint pool before this writing operation. In this case, the target fingerprint does not need to be written into the target fingerprint table again, and only the specific information in the target fingerprint entry of the target fingerprint in the target fingerprint table needs to be checked. In this case, the information stored in the fingerprint entry corresponding to the second search identifier of the target fingerprint in the target fingerprint table is determined as target information.
[0112] Then, in the case where 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, in the case that the second search identifier of the target fingerprint is stored in the target fingerprint table, there are two possibilities. First, the target storage address of the target fingerprint is recorded in the target information stored under the target fingerprint entry. Then it is determined that the data block corresponding to the target fingerprint has been stored in the data pool. Therefore, only the target storage address is returned to the cache end as the target storage address obtained.
[0114] In another case, in the case that the target storage address does not exist in the target information, the query operation is suspended until the 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 can be processed in the fingerprint pool at the same time, when the processing targets of two tasks performed at the same time are both target fingerprints, if the target fingerprint does not exist in the target fingerprint table, the task performed first will create a target fingerprint entry in the target fingerprint table according to the method described above. Then it is necessary to wait for the target storage address and the target mapping address of the target fingerprint returned by the cache end and written into the newly created target fingerprint entry. If during this waiting process, the task performed later also queries the target fingerprint in the target fingerprint table, the target fingerprint entry created by the previous task will be queried. However, the target information does not exist in the target fingerprint entry. Therefore, the task performed later needs to temporarily stop the query operation until the target storage address and the target mapping address of the target fingerprint are returned by the cache end.
[0116] In an optional embodiment, the fingerprint end can have multiple fingerprint tables PG, and each fingerprint table PG corresponds to multiple fingerprint tables. The fingerprint table PG corresponding to the fingerprint table can be determined according to the first search identifier, which is written as ID here. Specifically, the pgid of PG can be obtained by performing a modulo operation on the total number of fingerprint tables PG pg_num with the first search identifier ID:
[0117] ID % pg_num = pgid.
[0118] In combination with the above embodiment, in an implementation, the present application further provides a data writing method. In the case that the target storage address exists in the target information, the method specifically includes the following contents:
[0119] First, a mapping address table of the target fingerprint is created. 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.
[0120] In the embodiments of the present application, in the above description, 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, when the target fingerprint is written again, for the consideration of data deduplication, the target data block corresponding to the target fingerprint does not need to be written again in the data pool, which causes data duplication and occupies more resources. However, since the newly added data includes the target data block, when the newly added data is stored in the storage system, the newly added data needs to be associated 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 block corresponding to some fingerprints is 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, in the present application, a mapping address table for the fingerprint including more than one mapping is created. The mapping address table is used to store multiple mapping addresses of the target fingerprint. A third search identifier, also called a search identifier of the mapping address table, 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. The target information of the target fingerprint is further processed in layers, so that the layers of the fingerprint storage are clear and the order is clear.
[0121] In an optional embodiment, in the mapping address table of the target fingerprint, the third search identifier can be a string of the target fingerprint, the mapping object of the target fingerprint can be recorded in the form of src_obj, and the mapping object address of the target fingerprint can be recorded in the form of (off, len).
[0122] Then, the mapping object and the mapping object address of the first entry in the mapping address table of the target fingerprint are determined according to the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint.
[0123] In the embodiments of the present application, after the mapping address table of the target fingerprint is created, the content in the mapping address table needs to be updated. Since the mapping address table of the target fingerprint is created when new data is written, the original mapping address of the target fingerprint needs to be written in the mapping address table first. According to the original mapping address, the mapping object and the mapping object address are determined and written in the first entry of the mapping address table.
[0124] Then, the mapping object and the mapping object address of the second entry in the mapping address table of the target fingerprint are determined according to the target mapping address of the target fingerprint sent by the cache end.
[0125] In the embodiments of the present application, the mapping address corresponding to the newly written data is recorded in the mapping address table of the target fingerprint, and the mapping address corresponding to the newly written data is written into the second entry of the mapping address table in the form of a mapping object and a mapping object address according to the mapping address of the target fingerprint sent by the cache pool.
[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 embodiments of the present application, since the target fingerprint is stored in more than one mapping, it is necessary to create a mapping address table to store the mapping address of the target fingerprint. However, when the target fingerprint is queried subsequently, the target fingerprint table is queried according to the first search identifier and the second search identifier, and the mapping address of the target fingerprint in the target fingerprint entry is pointed to the mapping address table of the target fingerprint. Therefore, the mapping address of the target fingerprint can be obtained when the target fingerprint entry is searched. Therefore, in the present application, the mapping address in the target fingerprint entry is updated to the third search identifier, and the mapping address table corresponding to the target fingerprint can be queried according to the third search identifier.
[0128] Specifically, the mapping address of the target fingerprint also has the following two cases: first, if the data stored in the data pool is modified, the data block corresponding to the modified part needs to be recalculated to obtain the corresponding fingerprint. If the fingerprint is changed, the mapping address of the data corresponding to the fingerprint before the modification needs to be deleted in the mapping address table, and the mapping address of the data is added to the mapping address table corresponding to the modified fingerprint. Then, there is another case that the data stored in the data pool is deleted, and the mapping of the deleted data in the mapping address table also needs to be deleted. In the two cases, if the same fingerprint corresponding to the data is less than two due to data change or data deletion, the fingerprint no longer needs the mapping address table to store the corresponding mapping address, and the mapping address table is deleted, and the third search identifier in the fingerprint entry of the fingerprint is modified to the remaining mapping address of the fingerprint.
[0129] In an optional embodiment, the fingerprint information flag is further included in a fingerprint entry, which can 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 in the fingerprint entry. Specifically, the fingerprint information of the fingerprint can be represented by a flag.
[0130] In an alternative embodiment, as shown in Table 1, Table 1 is a fingerprint representation table according to an embodiment of the present application, wherein different fingerprint tables are distinguished according to first search identifiers, and each fingerprint entry of each fingerprint is distinguished according to a second search identifier, and in each fingerprint entry, fingerprint information, a storage address and a mapping address of the fingerprint are recorded.
[0131] Table 1: Fingerprint representation table
[0132]
[0133] In an alternative embodiment, as shown in Table 2, Table 2 is a mapping address representation table according to an embodiment of the present application, wherein whether the mapping address table belongs to which fingerprint is distinguished according to a third search identifier, and in each entry of the mapping address table, each mapping address corresponding to the fingerprint is written.
[0134] Table 2: Mapping address representation table
[0135]
[0136] In combination with the above embodiments, in an implementation, the present application further provides a data writing method, and in the case that there is no target fingerprint table corresponding to a target fingerprint in a plurality of fingerprint tables, the method further includes the following steps:
[0137] First, an original fingerprint table is created according to the first search identifier of the target fingerprint.
[0138] In the present embodiment, in the case that there is no corresponding fingerprint table when searching for a target fingerprint table of a target fingerprint in a fingerprint pool, an original fingerprint table is created according to the first search identifier of the target fingerprint, and the original fingerprint table is used to store 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 the present embodiment, after the target fingerprint table is created, a target fingerprint entry corresponding to the target fingerprint is created to store fingerprint information related to the target fingerprint, wherein the fingerprint information at least includes the second search identifier of the target fingerprint, fingerprint information, a storage address and a mapping address, as described above.
[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, after the target fingerprint entry is created, the target fingerprint corresponding target storage address and target mapping address need to be returned to the fingerprint end by the cache end, and then written in the target fingerprint entry. After the complete information of the target fingerprint is written, the newly created original fingerprint table can be determined as the target fingerprint table.
[0143] Please refer to Figure 2 , Figure 2 is a flowchart of a data writing method applied to the cache end according to an embodiment of the present application. As shown in Figure 2 , the method can 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 the fingerprint end.
[0145] In the embodiment of the present application, a data writing method suitable for a distributed storage system is proposed, which is applied to the cache end. 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 read and write requests of the client. When a new data needs to be written into the data pool, the write operation is first sent to the cache end. The cache end divides the target data into multiple data blocks according to the write operation on the target data and according to a block division algorithm or other ways. Then the cache end needs to calculate the fingerprints of the data blocks. Optionally, a hash algorithm such as sha256 can be selected to calculate the fingerprints of the data blocks. 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 operation.
[0146] Step S202: The feedback information sent by the fingerprint end is received, the target data block corresponding to the target fingerprint is written into the data pool, and the target storage address of the target data block in the data pool is obtained. The feedback information is used to represent that the second search identifier of the target fingerprint does not exist in the target fingerprint table in the fingerprint pool.
[0147] In the 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 queried 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 into the data pool. After the writing is completed, the target storage address where the target data block is specifically written needs to be recorded, which can be used as a clue when the target data block needs to be viewed later.
[0148] Step S203: The target mapping address of the target data block corresponding to the target storage address is recorded in the cache pool, and the target storage address and the target mapping address are sent to the fingerprint end.
[0149] In the embodiment of the present application, after the storage of the target data block is completed, the target mapping address of the target data block specifically mapped to the target data needs to be recorded in the cache pool, for associating the target data block with the target data together. After the target mapping address of the target data block is recorded, the target storage address and the target mapping address are both sent to the fingerprint end, for updating the target information in the target fingerprint entry.
[0150] In combination with the above embodiment, in an implementation, the present application further provides a data writing method, which further includes the following content:
[0151] Firstly, the target storage address in the fingerprint entry corresponding to the second search identifier of the target fingerprint sent by the fingerprint end 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 found to be stored in the target fingerprint table in the fingerprint end, the storage address of the target fingerprint found by the fingerprint end can be received, which indicates that the target data block has been stored in the storage system, and it is not necessary to store repeatedly again, so as to avoid wasting more resources. Therefore, the target data block in the cache is deleted, and the repeated data is deleted.
[0153] Then, the target mapping address of the target data block corresponding to the target fingerprint is recorded in the cache pool according to the target storage address in the fingerprint entry corresponding to the second search identifier of the target fingerprint.
[0154] In the embodiment of the present application, after the specific storage address of the target data block is obtained, the corresponding relationship between the target data block and the target data needs to be recorded 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 embodiment, in an implementation, the present application further provides a data writing method, which further includes the following content after recording the target mapping address of the target data block corresponding to the target storage address in the cache pool:
[0156] Firstly, a cache fingerprint table is created in the cache pool based on the fingerprint table in the fingerprint pool, and the cache fingerprint table at least includes a cache fingerprint, which is the fingerprint identifier corresponding to each fingerprint stored in each fingerprint table of the fingerprint end.
[0157] In the embodiment of the present application, in order to improve the efficiency of fingerprint query when querying data in the database, a cache fingerprint table needs to be created in the cache pool. The cache fingerprint table is created according to the fingerprint table in the fingerprint pool. The cache fingerprint table is used to record a plurality of cache fingerprints. The cache fingerprint corresponds to the fingerprint stored in each fingerprint table of the fingerprint end. In this way, when viewing the data in the database, the fingerprint retrieval in the fingerprint end is not needed, and the cache fingerprint pool can be directly viewed in the cache end, thereby improving the query efficiency.
[0158] Then, the 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, a plurality of cache fingerprint entries need to be created in the cache fingerprint table. Each cache fingerprint entry corresponds to a cache fingerprint.
[0160] Next, in response to the query operation of the user on the data in the data pool, the cache fingerprint corresponding to each data block in the data is queried in the cache fingerprint table.
[0161] In the embodiment of the present application, when the user queries the data in the data pool, the fingerprint table in the fingerprint pool does not need to be queried. The cache fingerprint table in the cache pool can be directly queried to query the cache fingerprint corresponding to each data block in the data.
[0162] The cache fingerprint entry corresponding to the cache fingerprint is created, including:
[0163] In the case where the mapping address table does not exist in the fingerprint table, the cache fingerprint is taken as the information of the cache fingerprint entry;
[0164] In the case where the mapping address table exists in the fingerprint table, the storage address and the mapping address in the fingerprint table are obtained and written into the cache fingerprint entry.
[0165] In the embodiment of the present application, although creating the cache fingerprint table in the cache pool can improve the data query efficiency, it will also face the problem of occupying more memory. Therefore, in the present application, the cache fingerprints in the cache fingerprint pool are divided into two categories, and the division standard is whether the fingerprint corresponding to the cache fingerprint has a mapping address table in the fingerprint pool. If there is no mapping address table, it is considered that the probability of the data block corresponding to the fingerprint being viewed is relatively low, and only the existence of the fingerprint is recorded in the corresponding cache fingerprint entry without recording the related fingerprint information, thereby saving storage space. If there is a mapping address table, it is considered that the probability of the data block corresponding to the fingerprint being viewed is relatively high, and the storage address and mapping address of the fingerprint are recorded in the corresponding cache fingerprint entry, so that when the data block corresponding to the fingerprint is queried, the related information can be directly obtained from the cache fingerprint table at the cache end, thereby improving the query efficiency.
[0166] Based on the same inventive concept, the embodiment of the present application discloses a data writing system, which refers to Figure 3 , Figure 3 is a schematic diagram of a data writing system provided by an embodiment of the present application. As shown in Figure 3 , the system includes a fingerprint end and a cache end, wherein:
[0167] The cache end is configured to, in response to a write operation on target data, acquire a target fingerprint of a target data block in the target data, and send the target fingerprint to the fingerprint end.
[0168] The fingerprint end is configured to, in response to the target fingerprint corresponding to the target data block sent by the cache end, determine a first search identifier and a second search identifier of the target fingerprint, query a target fingerprint table corresponding to the target fingerprint in a fingerprint pool according to the first search identifier of the target fingerprint, create a target fingerprint entry in the target fingerprint table in a case where 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.
[0169] The cache end is further configured to receive the feedback information sent by the fingerprint end, write a target data block corresponding to the target fingerprint into a data pool, and acquire a target storage address of the target data block in the data pool; record a target mapping address of the target data block corresponding to the target storage address in a cache pool, and send the target storage address and the target mapping address to the fingerprint end.
[0170] The fingerprint end is further configured 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 alternative embodiment, as shown in Figure 4 , Figure 4 is a data writing process schematic diagram provided by an embodiment of the present application. First, the cache end receives a write operation of target data, blocks the target data, and obtains the fingerprints of each data block. Then, the fingerprint query instruction is sent to the fingerprint end. After the fingerprint end receives the instruction, the fingerprint table is queried. If the target fingerprint already exists, it is necessary to check whether the physical address exists in the corresponding fingerprint entry. If it exists, the physical address is returned to the cache end. If it does not exist, it waits for the update of the physical address. The target data block in the cache 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, the target fingerprint entry corresponding to the target fingerprint needs to be created, and the information that the target fingerprint does not exist is returned to the cache end. After the cache end writes the target data block into the data pool, the storage address and the mapping address are returned to the fingerprint end, and the storage address and the mapping address are updated in the target fingerprint entry.
[0172] Based on the same design concept, an embodiment of the present application provides a data writing device applied to the fingerprint end. Referring to Figure 5 , Figure 5 is a structural block diagram of the data writing device applied to the fingerprint end provided by an embodiment of the present application. As shown in Figure 5 , the device comprises:
[0173] The search identifier determination module is configured to determine a first search identifier and a second search identifier of the target fingerprint in response to the target fingerprint corresponding to the target data block sent by the cache end.
[0174] The target fingerprint table query module is configured to query the target fingerprint table corresponding to the target fingerprint in the fingerprint pool according to the first search identifier of the target fingerprint. The fingerprint pool comprises a plurality of fingerprint tables with different first search identifiers. Each of the fingerprint tables comprises a plurality of fingerprints with different second search identifiers.
[0175] The target fingerprint entry creation module is configured to create a target fingerprint entry in the target fingerprint table in the case that 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 configured 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 comprises:
[0178] The target information acquisition module is 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] The target storage address sending module is 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 configured to suspend a query operation 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 if the target storage address does not exist in the target information.
[0181] Optionally, the target storage address sending module further includes:
[0182] The mapping address table creation submodule is configured to create a mapping address table of the target fingerprint, and the mapping address table is configured to store mapping addresses of the target fingerprint, and the mapping address table at least includes a third search identifier, a mapping object and a mapping object address.
[0183] The first entry information determination submodule is configured to determine a mapping object and a mapping object address of a first entry in the mapping address table of the target fingerprint according to a mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint.
[0184] The second entry information determination submodule is configured to determine a mapping object and a mapping object address of a second entry in the 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 configured to update the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint to a third search identifier according to the target fingerprint.
[0186] Optionally, the data writing device further includes:
[0187] The original fingerprint table creation module is configured to create an original fingerprint table according to the first search identifier of the target fingerprint.
[0188] The target fingerprint entry creation module is configured to create the target fingerprint entry in the original fingerprint table.
[0189] The target fingerprint table determination module is configured to receive a target storage address and a 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 applied to a cache end. Referring to Figure 6 , Figure 6 is a structural block diagram of the data writing device applied to the cache end provided by an embodiment of the present application. As shown in Figure 6 , the device comprises:
[0191] a fingerprint obtaining module, configured to obtain a target fingerprint of a target data block in target data in response to a writing operation on the target data, and send the target fingerprint to a fingerprint end;
[0192] a target data block writing module, configured to receive feedback information sent by the fingerprint end, write a 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 represent that a second search identifier of the target fingerprint does not exist in a target fingerprint table in a fingerprint pool;
[0193] a target mapping address obtaining module, configured to record a target mapping address of the target data block corresponding to the target storage address in a cache pool, and send the target storage address and the target mapping address to the fingerprint end.
[0194] Optionally, the data writing device further comprises:
[0195] a target data block deleting 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 end, and delete the target data block corresponding to the target fingerprint;
[0196] a target mapping address recording module, configured to record a 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 comprises:
[0198] a cache fingerprint table creating module, configured to create a cache fingerprint table in the cache pool based on fingerprint tables in the fingerprint pool, wherein the cache fingerprint table at least comprises a cache fingerprint, and the cache fingerprint is a fingerprint identifier corresponding to each fingerprint stored in each fingerprint table of the fingerprint end;
[0199] a cache fingerprint entry creating module, configured to create a cache fingerprint entry corresponding to the cache fingerprint;
[0200] a cache fingerprint querying 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 query operation on the data in the data pool by a user;
[0201] The creating the cache fingerprint entry corresponding to the cache fingerprint comprises:
[0202] The cache fingerprint entry information determination module is configured to, in the case that the mapping address table does not exist in the fingerprint table, take the cache fingerprint as the information of the cache fingerprint entry.
[0203] The cache fingerprint entry writing module is configured to, in the case that the mapping address table exists in the fingerprint table, acquire the storage address and the mapping address in the fingerprint table, and write into the cache fingerprint entry.
[0204] Based on the same design concept, another embodiment of the present application provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps in the data writing method according to any one of the above embodiments of the present application.
[0205] Based on the same design concept, another embodiment of the present application provides a computer program product, which includes computer programs / instructions. The computer programs / instructions are executed by a processor to implement the steps in the data writing method according to any one 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, as shown in the accompanying drawings. Figure 7 The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the steps in the data writing method according to any one of the above embodiments of the present application. Figure 7 For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related parts are described in the part of the method embodiment.
[0207] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts between the embodiments can be referred to each other.
[0208] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a device, or a computer program product. Therefore, the embodiments of the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can be in 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 codes.
[0209]
[0210] The embodiments of the present application are described with reference to the flowchart illustrations and / or block diagrams of the methods, terminal devices (systems) and computer program products according to the embodiments of the present application. It is understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal devices to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal devices, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.
[0211] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal devices to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.
[0212] These computer program instructions can also be loaded into a computer or other programmable data processing terminal devices, such that a series of operational steps are carried out on the computer or other programmable terminal devices to produce a computer implemented process so that the instructions executed on the computer or other programmable terminal devices provide steps for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.
[0213] Although the preferred embodiments of the present application have been described, those skilled in the art will be able to make additional modifications and variations to these embodiments once they have the benefit of the foregoing description. Accordingly, it is intended that the appended claims be construed to include all such modifications and variations as fall within the scope of the embodiments of the present application.
[0214] Finally, it is to be understood that the phraseology or terminology such as "first" and "second" etc. used herein is merely intended to differentiate one entity or operation from another entity or operation, without necessarily requiring or implying any actual such relationship or order between such entities or operations. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0215] The above provides a detailed description of the data writing method, system, device and medium provided by the present application. The principles and implementation modes of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method and its core idea of the present application. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A data write method, characterized by, The application is applied to a fingerprint end, comprising: In response to target fingerprint corresponding to target data block sent by a cache end, determining first search identifier and second search identifier of the target fingerprint; According to the first search identifier of the target fingerprint, querying target fingerprint table corresponding to the target fingerprint in a fingerprint pool, the fingerprint pool containing multiple fingerprint tables with different first search identifiers, each of the fingerprint tables containing multiple 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 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; Receiving target storage address and target mapping address sent by the cache end, and writing the target storage address and target mapping address into the target fingerprint entry; In the case that the second search identifier of the target fingerprint exists in the target fingerprint table, and the target storage address of the target fingerprint exists in the information saved under the fingerprint entry corresponding to the second search identifier of the target fingerprint, creating mapping address table of the target fingerprint, the mapping address table being used for storing mapping address of the target fingerprint, the mapping address table at least including third search identifier, mapping object and mapping object address; According to the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint, determining mapping object and mapping object address of the first entry in the mapping address table of the target fingerprint; According to target mapping address of the target fingerprint sent by the cache end, determining mapping object and mapping object address of the second entry in the mapping address table of the target fingerprint; According to the third search identifier determined according to the target fingerprint, updating the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint into the third search identifier.
2. The data write method of claim 1, wherein, In the case that the second search identifier of the target fingerprint exists in the target fingerprint table, the method further comprises: Obtaining information stored in the fingerprint entry corresponding to the second search identifier of the target fingerprint in the target fingerprint table as target information; In the case that the target storage address exists in the target information, sending 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, suspending the query operation until 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 write method of claim 1, wherein, In the case that target fingerprint table corresponding to the target fingerprint does not exist in multiple fingerprint tables, the method further comprises: According to the first search identifier of the target fingerprint, creating original fingerprint table; Creating the target fingerprint entry in the original fingerprint table; Receiving target storage address and target mapping address sent by the cache end, and writing the target storage address and target mapping address into the target fingerprint entry to obtain the target fingerprint table.
4. A data writing method characterized by comprising: The application is applied to a cache end, comprising: 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 end; Receiving feedback information sent by the fingerprint end; In the case where the feedback information is used to represent that a second search identifier of the target fingerprint does not exist in a target fingerprint table in a fingerprint pool, writing the target data block corresponding to the target fingerprint into a data pool, and obtaining a target storage address of the target data block in the data pool; Recording a target mapping address of the target data block corresponding to the target storage address in a cache pool, and sending the target storage address and the target mapping address to the fingerprint end; In the case where the second search identifier of the target fingerprint exists in the target fingerprint table, and the target storage address of the target fingerprint exists in the information saved under the fingerprint entry corresponding to the second search identifier of the target fingerprint, receiving the target storage address in the fingerprint entry corresponding to the second search identifier of the target fingerprint sent by the fingerprint end, 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, recording a target mapping address of the target data block corresponding to the target fingerprint in the cache pool, and sending the target mapping address to the fingerprint end, so that the fingerprint end creates a mapping address table of the target fingerprint, the mapping address table is used to store mapping addresses of the target fingerprint, and the mapping address table at least includes a third search identifier, a mapping object and a mapping object address; determining the mapping object and the mapping object address of the first entry in the mapping address table of the target fingerprint according to the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint; determining the mapping object and the mapping object address of the second entry in the mapping address table of the target fingerprint according to the target mapping address of the target fingerprint sent by the cache end; determining a third search identifier according to the target fingerprint, and updating the mapping address in the fingerprint entry corresponding to the second search identifier of the target fingerprint to the third search identifier.
5. The data write method of claim 4, wherein, After recording the target mapping address of the target data block corresponding to the target storage address in the cache pool, the method further comprises: Based on the fingerprint table in the fingerprint pool, creating a cache fingerprint table in the cache pool, and the cache fingerprint table at least includes a cache fingerprint, the cache fingerprint is a fingerprint identifier corresponding to each fingerprint stored in each fingerprint table of the fingerprint end; Creating a cache fingerprint entry corresponding to the cache fingerprint; In response to a query operation of a user on data in the data pool, querying the cache fingerprint table to obtain cache fingerprints corresponding to a plurality of data blocks in the data; Wherein, creating a cache fingerprint entry corresponding to the cache fingerprint comprises: In the case where the mapping address table does not exist in the fingerprint table, the cache fingerprint is used as the information of the cache fingerprint entry; In the case where the mapping address table exists in the fingerprint table, obtaining the storage address and the mapping address in the fingerprint table, and writing them into the cache fingerprint entry.
6. A data writing system, characterized by, The system comprises a fingerprint end and a cache end; The cache end is configured to acquire a target fingerprint of a target data block in target data and send the target fingerprint to the fingerprint end in response to a write operation on the target data; The fingerprint end is configured to determine a first search identifier and a second search identifier of the target fingerprint in response to the target fingerprint of the target data block sent by the cache end, query a target fingerprint table corresponding to the target fingerprint in a fingerprint pool according to the first search identifier of the target fingerprint, create a target fingerprint entry in the target fingerprint table in a case where 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, or send a target storage address corresponding to the target fingerprint to the cache end in a case where the second search identifier of the target fingerprint exists in the target fingerprint table and a target storage address of the target fingerprint exists in information saved in a fingerprint entry corresponding to the second search identifier of the target fingerprint; The cache end is further configured to receive the feedback information sent by the fingerprint end; In a case where the feedback information is used to represent that the second search identifier of the target fingerprint does not exist in a target fingerprint table in the fingerprint pool, the target data block corresponding to the target fingerprint is written into a data pool, a target storage address of the target data block in the data pool is acquired, a target mapping address of the target data block corresponding to the target storage address is recorded in a cache pool, and the target storage address and the target mapping address are sent to the fingerprint end; In a case where the feedback information is used to represent that the second search identifier of the target fingerprint exists in the target fingerprint table and the target storage address of the target fingerprint exists in the information saved in the fingerprint entry corresponding to the second search identifier of the target fingerprint, the target storage address in the fingerprint entry corresponding to the second search identifier of the target fingerprint sent by the fingerprint end is received, the target data block corresponding to the target fingerprint is deleted, a target mapping address of the target data block corresponding to the target fingerprint is recorded in the cache pool according to the target storage address in the fingerprint entry corresponding to the second search identifier of the target fingerprint, and the target mapping address is sent to the fingerprint end; The fingerprint end is further configured 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. Or, also 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: third search identification, mapping object and mapping object address; According to the mapping address in the fingerprint entry corresponding to the second search identification 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; 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; According to the third search identification determined by the target fingerprint, the mapping address in the fingerprint entry corresponding to the second search identification of the target fingerprint is updated to the third search identification.
7. An electronic device, comprising: A computer program product comprising a memory, a processor and a computer program stored on the memory, the processor executing the computer program to implement the steps in the data writing method of any one of claims 1-3, or the processor executing the computer program to implement the steps in the data writing method of any one of claims 4-5.
8. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, The computer program / instructions are executed by the processor to implement the steps in the data writing method of any one of claims 1-3, or the computer program / instructions are executed by the processor to implement the steps in the data writing method of any one of claims 4-5.
Citation Information
Patent Citations
Data re-deletion method and storage device
CN107329692A
Data management method and system, electronic equipment and storage medium
CN111881168A