Data management method and device, electronic equipment, storage medium and program product

By judging the free hash buckets in the hash table and determining the target hash bucket for data segment allocation according to the allocation bitmap, the problem of low data management efficiency caused by hash conflicts is solved, and more efficient data management is achieved.

CN120611065APending Publication Date: 2025-09-09SUGON INFORMATION IND +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510608424.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

The probability of hash conflicts in existing hash tables increases when dealing with large amounts of data, resulting in low data management efficiency.

Method used

By obtaining the current hash table and its corresponding allocation bitmap, it is determined whether there is an idle hash bucket, and the target hash bucket is determined according to the allocation bitmap for data segment allocation. The hash bucket depth is 1 to reduce the probability of hash collision.

Benefits of technology

It improves data management efficiency, reduces the probability of hash conflicts, and ensures the regularity and predictability of data storage and access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120611065A_ABST
    Figure CN120611065A_ABST
Patent Text Reader

Abstract

The invention provides a data management method and device, electronic equipment, a storage medium and a program product. The method comprises the steps that in response to a received data segment distribution request, at least one current hash table and a distribution bitmap corresponding to each current hash table are obtained, each current hash table comprises n hash buckets, the depth of each hash bucket is 1, and each distribution bitmap comprises slots corresponding to the n hash buckets respectively and the distribution state of each slot; judging whether an idle hash bucket exists in at least one current hash table or not; if yes, determining a target hash bucket in at least one current hash table according to the allocation bitmap; according to the target hash bucket, data segment distribution processing is carried out, a data segment distribution response is generated, the data segment distribution response comprises the identifier of the target hash table and the identifier of the target hash bucket, the at least one current hash table comprises the target hash table, the target hash table comprises the target hash bucket, and the data management efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of cloud computing and big data technologies, the management requirements of distributed storage systems are increasing. Hash tables are widely used in data management due to their fast search capabilities.

[0003] Currently, data management of hash tables can be implemented in the following way: data is mapped to a table of an initially set size through a hash function. When new data is to be inserted, the hash code of the key value is calculated through the hash function, and the hash code is converted into an index in the hash table. If the index position is empty, the data is directly inserted; if it is occupied, hash conflicts can be handled through chain address method or open addressing method.

[0004] In the above data management process, if the amount of data is large, the probability of processing hash conflicts will also increase greatly, resulting in low data management efficiency. Summary of the Invention

[0005] The present application provides a data management method, device, electronic device, storage medium and program product to solve the technical problem of low data management efficiency in the prior art.

[0006] In a first aspect, the present application provides a data management method, the method comprising:

[0007] In response to the received data segment allocation request, obtain at least one current hash table and an allocation bitmap corresponding to each current hash table, wherein the current hash table includes n hash buckets, the depth of the hash buckets is 1, and the allocation bitmap includes slots corresponding to the n hash buckets and an allocation status of each slot;

[0008] Determine whether there is an idle hash bucket in the at least one current hash table;

[0009] If so, determining a target hash bucket in the at least one current hash table according to the allocation bitmap;

[0010] According to the target hash bucket, data segment allocation processing is performed and a data segment allocation response is generated, wherein the data segment allocation response includes an identifier of a target hash table and an identifier of a target hash bucket, wherein the at least one current hash table includes the target hash table, and the target hash bucket includes the target hash table.

[0011] In this way, since the depth of the hash bucket is 1, the target hash bucket corresponding to the data segment is determined according to the current hash table and the allocation bitmap, which reduces the probability of hash collision and improves data management efficiency.

[0012] Optionally, the method described above, determining the target hash bucket in the at least one current hash table according to the allocation bitmap, includes:

[0013] Determine a creation time corresponding to at least one current hash table;

[0014] In descending order of the creation time, the allocation bitmaps corresponding to the at least one current hash table are detected and processed in sequence until the target slot in the allocation state is determined to be in the unallocated state;

[0015] The hash bucket corresponding to the target slot is determined as the target hash bucket.

[0016] In this way, the target hash bucket corresponding to the data segment is determined according to the current hash table and allocation bitmap, the probability of hash collision is reduced, and the front slots are used in order first, which can ensure that the storage and access of data have a certain regularity and predictability, and improve the efficiency of data management.

[0017] Optionally, the method described above includes sequentially detecting and processing the allocation bitmaps corresponding to the at least one current hash table in descending order of the creation time until determining that the target slot in the allocation state is an unallocated state, including:

[0018] In the i-th allocation bitmap corresponding to the i-th hash table, determining whether there is at least one to-be-selected slot, the to-be-selected slot being a slot in an unallocated state;

[0019] If so, determining slot numbers corresponding to the at least one to-be-selected slot, and determining the to-be-selected slot with the smallest slot number among the at least one to-be-selected slot as the target slot;

[0020] Here, the value of i is 1, 2, ..., in sequence, until i is N, or the target slot is determined; N is the number of the at least one current hash table, and N is a positive integer.

[0021] In this way, the target hash bucket corresponding to the data segment is determined according to the current hash table and allocation bitmap, the probability of hash collision is reduced, and the front slots are used in order first, which can ensure that the storage and access of data have a certain regularity and predictability, and improve the efficiency of data management.

[0022] Optionally, in the above method, determining whether there is an idle hash bucket in the at least one current hash table includes:

[0023] In the allocation bitmaps respectively corresponding to the at least one current hash table, determining whether there is a slot in an unallocated state;

[0024] If so, determining that there is a free hash bucket in the at least one current hash table;

[0025] If not, it is determined that there is no free hash bucket in the at least one current hash table.

[0026] In this way, if there are unallocated slots in the current hash table, the data segment can be dynamically allocated to the current hash table, thereby improving data management efficiency.

[0027] Optionally, in the above method, determining whether there is an idle hash bucket in the at least one current hash table includes:

[0028] Obtaining counters corresponding to the at least one current hash table;

[0029] Determine whether there is at least one target counter whose corresponding count value is less than n, and the counter is used to record the number of hash buckets used in the current hash table;

[0030] If so, determining that there is a free hash bucket in the at least one current hash table;

[0031] If not, it is determined that there is no free hash bucket in the at least one current hash table.

[0032] In this way, it is determined that there is an idle hash bucket in the at least one current hash table, and the data segment can be dynamically allocated to the current hash table, thereby improving data management efficiency.

[0033] Optionally, in the above method, when there is no free hash bucket in the at least one current hash table, the method further includes:

[0034] Get the remaining capacity of the current storage unit group;

[0035] Determining whether the remaining capacity is greater than a threshold;

[0036] If so, create a first hash table and an allocation bitmap of the first hash table based on the at least one current hash table, wherein the first hash table includes n hash buckets, and the depth of the hash buckets is 1;

[0037] A target hash bucket is determined in the first hash table according to the allocation bitmap of the first hash table.

[0038] In this way, the new table capacity can be dynamically created according to the load, and the target hash bucket corresponding to the data segment can be determined according to the current hash table and allocation bitmap, which reduces the probability of hash conflicts and improves data management efficiency.

[0039] Optionally, the method as described above further includes:

[0040] In response to the received data segment release request, determining a hash table identifier and a hash bucket identifier corresponding to the data segment release request;

[0041] Determine a second hash table corresponding to the hash table identifier and a hash bucket corresponding to the hash bucket identifier;

[0042] releasing the hash bucket corresponding to the hash bucket identifier and updating the allocation bitmap of the second hash table to obtain a processing result;

[0043] A data segment release response is generated according to the processing result.

[0044] In this way, after the data segment is released, the allocation bitmap is updated synchronously, and the current data storage situation can be determined based on the allocation bitmap, thereby improving data management efficiency.

[0045] In a second aspect, the present application provides a data management device, the device comprising:

[0046] an acquisition module, configured to, in response to a received data segment allocation request, acquire at least one current hash table and an allocation bitmap corresponding to each current hash table, wherein the current hash table includes n hash buckets, the depth of the hash buckets is 1, and the allocation bitmap includes slots corresponding to the n hash buckets, respectively, and an allocation status of each slot;

[0047] A judging module, configured to judge whether there is an idle hash bucket in the at least one current hash table;

[0048] If so, a determination module is configured to determine a target hash bucket in the at least one current hash table according to the allocation bitmap;

[0049] A generation module is used to perform data segment allocation processing according to the target hash bucket and generate a data segment allocation response, wherein the data segment allocation response includes an identifier of a target hash table and an identifier of a target hash bucket, the at least one current hash table includes the target hash table, and the target hash bucket is included in the target hash table.

[0050] Optionally, in the above-mentioned device, the determination module is specifically configured to:

[0051] Determine a creation time corresponding to at least one current hash table;

[0052] In descending order of the creation time, the allocation bitmaps corresponding to the at least one current hash table are detected and processed in sequence until the target slot in the allocation state is determined to be in the unallocated state;

[0053] The hash bucket corresponding to the target slot is determined as the target hash bucket.

[0054] Optionally, in the above-mentioned device, the determination module is specifically configured to:

[0055] In the i-th allocation bitmap corresponding to the i-th hash table, determining whether there is at least one to-be-selected slot, the to-be-selected slot being a slot in an unallocated state;

[0056] If so, determining slot numbers corresponding to the at least one to-be-selected slot, and determining the to-be-selected slot with the smallest slot number among the at least one to-be-selected slot as the target slot;

[0057] Here, the value of i is 1, 2, ..., in sequence, until i is N, or the target slot is determined; N is the number of the at least one current hash table, and N is a positive integer.

[0058] Optionally, in the above device, the judgment module is specifically configured to:

[0059] In the allocation bitmaps respectively corresponding to the at least one current hash table, determining whether there is a slot in an unallocated state;

[0060] If so, determining that there is a free hash bucket in the at least one current hash table;

[0061] If not, it is determined that there is no free hash bucket in the at least one current hash table.

[0062] Optionally, in the above device, the judgment module is specifically configured to:

[0063] Obtaining counters corresponding to the at least one current hash table;

[0064] Determine whether there is at least one target counter whose corresponding count value is less than n, and the counter is used to record the number of hash buckets used in the current hash table;

[0065] If so, determining that there is a free hash bucket in the at least one current hash table;

[0066] If not, it is determined that there is no free hash bucket in the at least one current hash table.

[0067] Optionally, in the above apparatus, when there is no free hash bucket in the at least one current hash table, the apparatus further includes a creation module, the creation module being configured to:

[0068] Get the remaining capacity of the current storage unit group;

[0069] Determining whether the remaining capacity is greater than a threshold;

[0070] If so, create a first hash table and an allocation bitmap of the first hash table based on the at least one current hash table, wherein the first hash table includes n hash buckets, and the depth of the hash buckets is 1;

[0071] A target hash bucket is determined in the first hash table according to the allocation bitmap of the first hash table.

[0072] Optionally, the device as described above further comprises a releasing module, the releasing module being configured to:

[0073] In response to the received data segment release request, determining a hash table identifier and a hash bucket identifier corresponding to the data segment release request;

[0074] Determine a second hash table corresponding to the hash table identifier and a hash bucket corresponding to the hash bucket identifier;

[0075] releasing the hash bucket corresponding to the hash bucket identifier and updating the allocation bitmap of the second hash table to obtain a processing result;

[0076] A data segment release response is generated according to the processing result.

[0077] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0078] The memory stores computer-executable instructions;

[0079] The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of the first aspects.

[0080] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.

[0081] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a computer, implements the method as described in any one of the first aspects.

[0082] The data management method, device, electronic device, storage medium and program product provided by the present application obtain at least one current hash table and an allocation bitmap corresponding to each current hash table in response to a received data segment allocation request, wherein the current hash table includes n hash buckets, the depth of the hash bucket is 1, and the allocation bitmap includes slots corresponding to the n hash buckets and the allocation status of each slot; determines whether there is an idle hash bucket in at least one current hash table; if so, determines the target hash bucket in at least one current hash table according to the allocation bitmap; performs data segment allocation processing according to the target hash bucket, and generates a data segment allocation response, wherein the data segment allocation response includes an identifier of the target hash table and an identifier of the target hash bucket, wherein at least one current hash table includes the target hash table, and the target hash table includes the target hash bucket. In this way, since the depth of the hash bucket is 1, the target hash bucket corresponding to the data segment is determined according to the current hash table and the allocation bitmap, thereby reducing the probability of hash conflicts and improving data management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0083] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0084] Figure 1 A schematic diagram of a data storage architecture provided in an embodiment of the present application;

[0085] Figure 2 A flowchart of a data management method provided in an embodiment of the present application;

[0086] Figure 3 A flowchart of another data management method provided in an embodiment of the present application;

[0087] Figure 4 A flowchart of another data management method provided in an embodiment of the present application;

[0088] Figure 5 A schematic diagram of a current hash table and an allocation bitmap provided in an embodiment of the present application;

[0089] Figure 6 A schematic diagram of the structure of a data management device provided in an embodiment of the present application;

[0090] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0091] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0092] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0093] It should be noted that although the terms "first" and "second" are used to describe various information in the embodiments of this application, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from each other. Alternatively, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.

[0094] It should be understood that the terms "comprise" and "include" indicate the presence of the previously mentioned features, steps, or operations, but do not exclude the presence, occurrence, or addition of one or at least one other feature, step, or operation. The terms "and / or" and the like used in this application may be interpreted as inclusive, or may mean any one or any combination. Alternatively, "A and / or B" means "any of the following: A; B; A and B." In addition, the character " / " in this document generally indicates that the preceding and following objects are in an "or" relationship.

[0095] With the rapid development of cloud computing and big data technologies, the management requirements of distributed storage systems are increasing. Hash tables are widely used in data management due to their fast search capabilities.

[0096] In related technologies, data management of hash tables can be implemented as follows: data is mapped to a table of an initially set size through a hash function. When new data is to be inserted, the hash code of the key value is calculated through the hash function, and the hash code is converted into an index in the hash table. If the index position is empty, the data is directly inserted; if it is occupied, hash conflicts can be handled through chain addressing or open addressing.

[0097] In the above data management process, if the amount of data is large, the probability of processing hash conflicts will also increase greatly, resulting in low data management efficiency.

[0098] To address the above technical issues, an embodiment of the present application provides a data management method. In response to a received data segment allocation request, the method obtains at least one current hash table and an allocation bitmap corresponding to each current hash table. The current hash table includes n hash buckets, each with a hash bucket depth of 1. Based on the at least one current hash table and the allocation bitmap, a target hash bucket is determined. Data segment allocation processing is performed based on the target hash bucket, and a data segment allocation response is generated. Thus, because the hash bucket depth is 1, the target hash bucket corresponding to the data segment is determined based on the current hash table and the allocation bitmap, reducing the probability of hash conflicts and improving data management efficiency.

[0099] Next, combine Figure 1 , gives an example of data storage architecture.

[0100] Figure 1 This is a schematic diagram of a data storage architecture provided in an embodiment of the present application. Figure 1 , Figure 1 It can include logical grouping layer, data carrier layer and physical storage layer.

[0101] The logical grouping layer can include multiple storage unit groups. A storage unit group can be a logical management unit for data storage. A storage unit group can be used to group and plan data, enabling the data storage system to schedule and manage data storage. A storage unit group can include multiple storage units.

[0102] The data carrier layer can include multiple storage blocks. Storage blocks are the physical carriers of data. Storage units can establish mapping relationships with multiple data blocks based on specific rules. These mapping relationships can be used to represent how storage units reference storage blocks, enabling precise association between storage units and the actual storage blocks carrying data, thus establishing a connection between the data logic management unit and the physical data carriers.

[0103] The physical storage layer can include multiple hard disks. A hard disk can contain multiple storage blocks. Multiple hard disks can work together to store data in a distributed manner. Distributed storage enables parallel reading and writing of data, improving storage performance.

[0104] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0105] The technical solutions shown in this application are described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be repeated in different embodiments.

[0106] Figure 2 This is a flow chart of a data management method provided in an embodiment of the present application. The execution subject of the embodiment of the present application may be a processor. The processor may be implemented by software or by a combination of software and hardware. Figure 2 , the method comprising:

[0107] S201 . In response to a received data segment allocation request, obtain at least one current hash table and an allocation bitmap corresponding to each current hash table.

[0108] The current hash table includes n hash buckets, and the depth of the hash bucket is 1.

[0109] The current hash table may be a hash table that already exists in the current system.

[0110] Hash tables can be used to implement operations such as searching, inserting, and deleting data.

[0111] A hash table can map a data segment into a fixed-size hash bucket through specific rules.

[0112] Hash buckets are used to store data segments calculated using specific rules.

[0113] The depth of a hash bucket can be used to indicate the number of data segments stored in the hash bucket.

[0114] A hash bucket depth of 1 indicates that the hash bucket can store one data segment.

[0115] The allocation bitmap includes the slots corresponding to the n hash buckets and the allocation status of each slot.

[0116] The allocation bitmap can be used to represent the allocation status of each hash bucket in the current hash table.

[0117] The allocation bitmap can be composed of a binary vector, where each bit in the binary vector corresponds to the allocation status of a hash bucket. 0 can be used to represent the unallocated state, and 1 can be used to represent the allocated state.

[0118] You can quickly determine whether a hash bucket has been allocated by querying the corresponding bit in the allocation bitmap.

[0119] The data segment allocation request may be used to request the processor to allocate a storage unit for the data segment.

[0120] The data segment allocation request may include at least one of a request identifier, data segment description information, request source information, and allocation strategy information.

[0121] The data segment allocation request may be sent by a process to the processor, or may be sent by a program to the processor, which is not limited here.

[0122] A data segment allocation request can be received and verified. After the verification is passed, at least one current hash table corresponding to the data segment allocation request is determined according to the data storage configuration, and an allocation bitmap corresponding to the at least one current hash table is determined.

[0123] S202: Determine whether there is an idle hash bucket in at least one current hash table.

[0124] The free hash bucket can be used to indicate that the hash bucket is in an unallocated state.

[0125] It can be determined in sequence whether there are free hash buckets in at least one current hash table according to the allocation bitmap or the counter.

[0126] Optionally, you can determine whether there is an idle hash bucket in at least one current hash table by:

[0127] Method 1: In the allocation bitmap corresponding to at least one current hash table, determine whether there is an unallocated slot. If so, determine whether there is a free hash bucket in at least one current hash table. If not, determine whether there is no free hash bucket in at least one current hash table.

[0128] The allocation bitmap may be used to indicate the allocation status of each hash bucket in the current hash table.

[0129] Method 2: Obtain the counters corresponding to at least one current hash table and determine whether there is at least one target counter whose count value is less than n. If so, determine that there is an idle hash bucket in at least one current hash table. If not, determine that there is no idle hash bucket in at least one current hash table.

[0130] The counter may be used to record the number of hash buckets currently used in the hash table.

[0131] Optionally, when there is no free hash bucket in at least one current hash table, obtain the remaining capacity of the current storage unit group; determine whether the remaining capacity is greater than a threshold; if so, create a first hash table and an allocation bitmap of the first hash table based on at least one current hash table; and determine the target hash bucket in the first hash table based on the allocation bitmap of the first hash table.

[0132] The storage capacity corresponding to the current storage unit group may be fixed.

[0133] The remaining capacity of the current storage unit group may be determined according to at least one current hash table.

[0134] The threshold value may be a preset value.

[0135] For example, the size of the threshold may be the capacity corresponding to a hash table.

[0136] The first hash table may be a newly created hash table.

[0137] The first hash table includes n hash buckets, and the depth of the hash bucket is 1.

[0138] The serial numbers corresponding to the slots in the first hash table may be determined according to the serial numbers corresponding to the slots in at least one current hash table.

[0139] For example, at least one current hash table is 2 current hash tables, the serial numbers corresponding to the slots in the first current hash table are 1 to n, and the serial numbers corresponding to the slots in the second current hash table are n+1 to 2n, then the serial numbers corresponding to the slots in the first hash table are 2n+1 to 3n.

[0140] Optionally, at least one current hash table can sort the serial numbers of multiple slots corresponding to at least one current hash table in order from the earliest to the latest creation time, and sort the serial numbers of each slot in the first hash table according to the serial numbers corresponding to each slot in at least one current hash table.

[0141] Optionally, the target hash bucket may be determined in the first hash table according to the allocation bitmap of the first hash table in the following manner: determining the slot with the smallest slot sequence number in the allocation bitmap of the first hash table, and determining the hash bucket corresponding to the slot as the target hash bucket.

[0142] S203: If yes, determine a target hash bucket in at least one current hash table according to the allocation bitmap.

[0143] The target hash bucket may be used to indicate a hash bucket allocated according to a data segment allocation request.

[0144] The target hash bucket may be used to store the data segment corresponding to the data segment allocation request.

[0145] If so, traverse at least one current hash table according to the allocation bitmap and determine the target hash bucket in at least one free hash bucket.

[0146] Optionally, the target hash bucket can be determined in at least one current hash table according to the allocation bitmap in the following manner: determining the creation time corresponding to at least one current hash table; sequentially detecting and processing the allocation bitmaps corresponding to at least one current hash table in descending order of the creation time until determining the target slot whose allocation state is unallocated; and determining the hash bucket corresponding to the target slot as the target hash bucket.

[0147] Optionally, the target hash bucket may be determined in the at least one current hash table according to the allocation bitmap in the following manner: determining at least one free hash bucket in the at least one current hash table, and determining the target hash bucket in the at least one free hash bucket.

[0148] It should be noted that the target hash bucket can be determined in at least one current hash table according to any feasible implementation method and the allocation bitmap, and the embodiment of the present application is not limited to this.

[0149] S204: Perform data segment allocation processing according to the target hash bucket and generate a data segment allocation response.

[0150] The data segment allocation response includes an identifier of a target hash table and an identifier of a target hash bucket. At least one current hash table includes the target hash table, and the target hash bucket is included in the target hash table.

[0151] The data segment allocation response may be used to feed back the allocation result to the sender corresponding to the data segment allocation request.

[0152] The data segment allocation response may include allocation status, target hash bucket information, etc.

[0153] The allocation status can be used to indicate whether the data segment is successfully allocated.

[0154] The allocation status may include allocation success and allocation failure.

[0155] The target hash bucket information may include an identifier of a target hash table and an identifier of a target hash bucket.

[0156] The data segment allocation process may be used to store the received data segment into a target hash bucket, and after storing the data segment, update the current hash table and the allocation bitmap corresponding to the current hash table.

[0157] The data segment corresponding to the data segment allocation request can be stored in the target hash bucket, and the current hash table and the allocation bitmap corresponding to the current hash table can be updated to generate a data segment allocation response.

[0158] Optionally, the data management method also includes data segment release processing, and the data segment release processing can be performed in the following manner: in response to a received data segment release request, determining a hash table identifier and a hash bucket identifier corresponding to the data segment release request; determining a second hash table corresponding to the hash table identifier, and a hash bucket corresponding to the hash bucket identifier; releasing the hash bucket corresponding to the hash bucket identifier, and updating the allocation bitmap of the second hash table to obtain a processing result; and generating a data segment release response based on the processing result.

[0159] The data segment release request may be used to release the storage space occupied by the corresponding data segment.

[0160] The data segment release request includes information about the data segment to be released.

[0161] The data segment information may include a hash table identifier and a hash bucket identifier.

[0162] The data management method provided in this embodiment obtains at least one current hash table and an allocation bitmap corresponding to each current hash table in response to a received data segment allocation request. The current hash table includes n hash buckets, the hash bucket depth is 1, and the allocation bitmap includes slots corresponding to the n hash buckets and the allocation status of each slot. The method determines whether there is an idle hash bucket in the at least one current hash table. If so, the method determines a target hash bucket in the at least one current hash table based on the allocation bitmap. The method performs data segment allocation processing based on the target hash bucket and generates a data segment allocation response. The data segment allocation response includes an identifier of the target hash table and an identifier of the target hash bucket. The at least one current hash table includes the target hash table, and the target hash table includes the target hash bucket. In this way, since the hash bucket depth is 1, the target hash bucket corresponding to the data segment is determined based on the current hash table and the allocation bitmap, thereby reducing the probability of hash conflicts and improving data management efficiency.

[0163] Next, combine Figure 3 , the process (S203) of determining the target hash bucket in the at least one current hash table according to the allocation bitmap is explained.

[0164] Figure 3 This is a flow chart of another data management method provided in the embodiment of the present application. Based on the above embodiment, please refer to Figure 3 , the method comprising:

[0165] S301: Determine a creation time corresponding to at least one current hash table.

[0166] The creation time can be used to indicate the time when the current hash table is created.

[0167] Configuration information corresponding to at least one current hash table may be obtained, and creation times corresponding to the at least one current hash table may be determined based on the configuration information.

[0168] S302. Initialize i to 1.

[0169] S303 : In the i-th allocation bitmap corresponding to the i-th hash table, determine whether there is at least one slot to be selected.

[0170] The slot to be selected is an unassigned slot.

[0171] It can be determined whether the first preset value exists in the i-th allocation bitmap corresponding to the i-th hash table. If so, it is determined that there is at least one slot to be selected; if not, it is determined that there is not at least one slot to be selected.

[0172] If yes, execute S304;

[0173] If not, execute S306.

[0174] S304: Determine the slot sequence numbers corresponding to at least one of the candidate slots, and determine the candidate slot with the smallest slot sequence number among the at least one candidate slot as the target slot.

[0175] Each slot has a unique slot number.

[0176] For example, assuming that at least one to-be-selected slot has slot numbers 5, 18, and 29, respectively, the to-be-selected slot with slot number 5 is determined as the target slot.

[0177] Prioritizing the use of earlier slots in order ensures that data storage and access are regular and predictable, and is also beneficial for improving the locality of data structures and cache hit rates, thereby improving system performance and efficiency.

[0178] S305: Determine the hash bucket corresponding to the target slot as the target hash bucket.

[0179] S306: Determine whether i is less than N.

[0180] If yes, execute S307;

[0181] If not, then end.

[0182] N is the number of at least one current hash table, and N is a positive integer.

[0183] S307. Update i to i+1.

[0184] After S307 , S303 is executed.

[0185] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.

[0186] The data management method provided in this embodiment determines the creation time corresponding to at least one current hash table, and in the i-th allocation bitmap corresponding to the i-th hash table, determines whether there is at least one candidate slot, which is an unallocated slot. If so, determines the slot number corresponding to each of the at least one candidate slot, and determines the candidate slot with the smallest slot number among the at least one candidate slot as the target slot, where i is 1, 2, ..., until i is N, or determines the target slot, and determines the hash bucket corresponding to the target slot as the target hash bucket. In this way, since the depth of the hash bucket is 1, the target hash bucket corresponding to the data segment is determined based on the current hash table and the allocation bitmap, reducing the probability of hash conflicts and improving data management efficiency.

[0187] Next, combine Figure 4 , the technical solutions shown in this application are explained through specific examples.

[0188] Figure 4 This is a flow chart of another data management method provided in the embodiment of the present application. Figure 4 , the method comprising:

[0189] S401 : In response to a received data segment allocation request, obtain at least one current hash table and an allocation bitmap corresponding to each current hash table.

[0190] S402: Determine whether there is an unallocated slot in the allocation bitmap corresponding to at least one current hash table.

[0191] If yes, execute S403;

[0192] If not, execute S409.

[0193] Next, combine Figure 5 , an example is given for the current hash table and the allocation bitmap corresponding to the current hash table.

[0194] Figure 5 This is a schematic diagram of a current hash table and an allocation bitmap provided in an embodiment of the present application. Figure 5 , Figure 5 Contains the current hash table and allocation bitmap.

[0195] The current hash table includes n hash buckets, and the depth of the hash bucket is 1.

[0196] The allocation bitmap includes the slots corresponding to the n hash buckets (represented by a cell) and the allocation status of each slot.

[0197] “1” may indicate that the hash bucket corresponding to the slot is in an allocated state, and “0” may indicate that the hash bucket corresponding to the slot is in an unallocated state.

[0198] S403: Determine the creation time corresponding to at least one current hash table.

[0199] S404. Initialize i to 1.

[0200] S405 : In the i-th allocation bitmap corresponding to the i-th hash table, determine whether there is at least one slot to be selected.

[0201] If yes, execute S406;

[0202] If not, execute S408.

[0203] S406: Determine the slot sequence numbers corresponding to at least one of the candidate slots, and determine the candidate slot with the smallest slot sequence number among the at least one candidate slot as the target slot.

[0204] S407: Determine the hash bucket corresponding to the target slot as the target hash bucket.

[0205] After S407 , S412 is executed.

[0206] S408. When i is less than N, update i to i+1.

[0207] After S408 , S405 is executed.

[0208] S409: Obtain the remaining capacity of the current storage unit group.

[0209] S410: When the remaining capacity is greater than a threshold, create a first hash table and an allocation bitmap of the first hash table according to at least one current hash table.

[0210] S411 : Determine a target hash bucket in the first hash table according to the allocation bitmap of the first hash table.

[0211] S412: Perform data segment allocation processing according to the target hash bucket and generate a data segment allocation response.

[0212] The execution process of S401-S412 can refer to the execution process of the above steps, which will not be repeated here.

[0213] In this way, since the depth of the hash bucket is 1, the target hash bucket corresponding to the data segment is determined according to the current hash table and the allocation bitmap, which reduces the probability of hash collision and improves data management efficiency.

[0214] Figure 6This is a structural diagram of a data management device provided in an embodiment of the present application. Figure 6 The data management device 600 includes an acquisition module 601, a judgment module 602, a determination module 603 and a generation module 604, wherein:

[0215] an acquisition module 601 configured to, in response to a received data segment allocation request, acquire at least one current hash table and an allocation bitmap corresponding to each current hash table, wherein the current hash table includes n hash buckets, the depth of the hash buckets is 1, and the allocation bitmap includes slots corresponding to the n hash buckets, respectively, and an allocation status of each slot;

[0216] A determination module 602 is configured to determine whether there is an idle hash bucket in the at least one current hash table;

[0217] If so, the determination module 603 is configured to determine a target hash bucket in the at least one current hash table according to the allocation bitmap;

[0218] The generation module 604 is used to perform data segment allocation processing according to the target hash bucket and generate a data segment allocation response, wherein the data segment allocation response includes an identifier of the target hash table and an identifier of the target hash bucket, the at least one current hash table includes the target hash table, and the target hash bucket is included in the target hash table.

[0219] Optionally, in the above apparatus, the determining module 603 is specifically configured to:

[0220] Determine a creation time corresponding to at least one current hash table;

[0221] In descending order of the creation time, the allocation bitmaps corresponding to the at least one current hash table are detected and processed in sequence until the target slot in the allocation state is determined to be in the unallocated state;

[0222] The hash bucket corresponding to the target slot is determined as the target hash bucket.

[0223] Optionally, in the above apparatus, the determining module 603 is specifically configured to:

[0224] In the i-th allocation bitmap corresponding to the i-th hash table, determining whether there is at least one to-be-selected slot, the to-be-selected slot being a slot in an unallocated state;

[0225] If so, determining slot numbers corresponding to the at least one to-be-selected slot, and determining the to-be-selected slot with the smallest slot number among the at least one to-be-selected slot as the target slot;

[0226] Here, the value of i is 1, 2, ..., in sequence, until i is N, or the target slot is determined; N is the number of the at least one current hash table, and N is a positive integer.

[0227] Optionally, in the above-mentioned device, the determination module 602 is specifically configured to:

[0228] In the allocation bitmaps respectively corresponding to the at least one current hash table, determining whether there is a slot in an unallocated state;

[0229] If so, determining that there is a free hash bucket in the at least one current hash table;

[0230] If not, it is determined that there is no free hash bucket in the at least one current hash table.

[0231] Optionally, in the above-mentioned device, the determination module 602 is specifically configured to:

[0232] Obtaining counters corresponding to the at least one current hash table;

[0233] Determine whether there is at least one target counter whose corresponding count value is less than n, and the counter is used to record the number of hash buckets used in the current hash table;

[0234] If so, determining that there is a free hash bucket in the at least one current hash table;

[0235] If not, it is determined that there is no free hash bucket in the at least one current hash table.

[0236] Optionally, in the above apparatus, when there is no free hash bucket in the at least one current hash table, the apparatus further includes a creation module 605, the creation module 605 being configured to:

[0237] Get the remaining capacity of the current storage unit group;

[0238] Determining whether the remaining capacity is greater than a threshold;

[0239] If so, create a first hash table and an allocation bitmap of the first hash table based on the at least one current hash table, wherein the first hash table includes n hash buckets, and the depth of the hash buckets is 1;

[0240] A target hash bucket is determined in the first hash table according to the allocation bitmap of the first hash table.

[0241] Optionally, the device as described above further includes a releasing module 606, and the releasing module 606 is configured to:

[0242] In response to the received data segment release request, determining a hash table identifier and a hash bucket identifier corresponding to the data segment release request;

[0243] Determine a second hash table corresponding to the hash table identifier and a hash bucket corresponding to the hash bucket identifier;

[0244] releasing the hash bucket corresponding to the hash bucket identifier and updating the allocation bitmap of the second hash table to obtain a processing result;

[0245] A data segment release response is generated according to the processing result.

[0246] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 , the electronic device 700 may include: a memory 701 , a processor 702 , and a transceiver 703 .

[0247] The memory 701 is used to store program instructions;

[0248] The processor 702 is configured to execute the program instructions stored in the memory, so as to enable the electronic device 700 to perform the above method.

[0249] The transceiver 703 may include a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, a transmitter, a transmission port, a transmission interface, or similar descriptions, and the receiver may also be referred to as a receiver, a reception port, a reception interface, or similar descriptions. For example, the memory 701, the processor 702, and the transceiver 703 are interconnected via a bus 704.

[0250] An embodiment of the present application further provides a computer program product, which can be executed by a processor. When the computer program product is executed, the above method can be implemented.

[0251] The data management device, electronic device, computer-readable storage medium and computer program product of the embodiments of the present application can execute the technical solutions shown in the above-mentioned data management method embodiments. Their implementation principles and beneficial effects are similar and will not be repeated here.

[0252] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.

[0253] It should be further noted that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0254] It should be understood that the above-described device embodiments are merely illustrative, and the device of the present application may also be implemented in other ways. For example, the division of units / modules in the above-described embodiments is merely a logical functional division, and actual implementations may employ other division methods. For example, multiple units, modules, or components may be combined or integrated into another system, or some features may be omitted or not implemented.

[0255] In addition, unless otherwise specified, the functional units / modules in the various embodiments of the present application may be integrated into a single unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The aforementioned integrated units / modules may be implemented in the form of hardware or software program modules.

[0256] If the integrated unit / module is implemented in hardware, the hardware may be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.

[0257] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0258] In the above embodiments, the description of each embodiment has its own focus. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0259] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0260] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A data management method, characterized in that: The method comprises: In response to the received data segment allocation request, obtain at least one current hash table and an allocation bitmap corresponding to each current hash table, wherein the current hash table includes n hash buckets, the depth of the hash buckets is 1, and the allocation bitmap includes slots corresponding to the n hash buckets and an allocation status of each slot; Determine whether there is an idle hash bucket in the at least one current hash table; If so, determining a target hash bucket in the at least one current hash table according to the allocation bitmap; According to the target hash bucket, data segment allocation processing is performed and a data segment allocation response is generated, wherein the data segment allocation response includes an identifier of a target hash table and an identifier of a target hash bucket, wherein the at least one current hash table includes the target hash table, and the target hash bucket includes the target hash table.

2. The method according to claim 1, characterized in that Determining a target hash bucket in the at least one current hash table according to the allocation bitmap includes: Determine a creation time corresponding to at least one current hash table; In descending order of the creation time, the allocation bitmaps corresponding to the at least one current hash table are detected and processed in sequence until the target slot in the allocation state is determined to be in the unallocated state; The hash bucket corresponding to the target slot is determined as the target hash bucket.

3. The method according to claim 2, characterized in that The method includes: detecting and processing the allocation bitmaps corresponding to the at least one current hash table in descending order of the creation time until determining that the target slot in the allocation state is an unallocated state. In the i-th allocation bitmap corresponding to the i-th hash table, determining whether there is at least one to-be-selected slot, the to-be-selected slot being a slot in an unallocated state; If so, determining slot numbers corresponding to the at least one to-be-selected slot, and determining the to-be-selected slot with the smallest slot number among the at least one to-be-selected slot as the target slot; Here, i is sequentially set to 1, 2, ..., until i is N, or the target slot is determined; N is the number of the at least one current hash table, and N is a positive integer.

4. The method according to any one of claims 1 to 3, characterized in that Determining whether there is an idle hash bucket in the at least one current hash table includes: In the allocation bitmaps respectively corresponding to the at least one current hash table, determining whether there is a slot in an unallocated state; If so, determining that there is a free hash bucket in the at least one current hash table; If not, it is determined that there is no free hash bucket in the at least one current hash table.

5. The method according to any one of claims 1 to 3, characterized in that Determining whether there is an idle hash bucket in the at least one current hash table includes: Obtaining counters corresponding to the at least one current hash table; Determine whether there is at least one target counter whose corresponding count value is less than n, and the counter is used to record the number of hash buckets used in the current hash table; If so, determining that there is a free hash bucket in the at least one current hash table; If not, it is determined that there is no free hash bucket in the at least one current hash table.

6. The method according to any one of claims 1 to 3, characterized in that In a case where there is no free hash bucket in the at least one current hash table, the method further includes: Get the remaining capacity of the current storage unit group; Determining whether the remaining capacity is greater than a threshold; If so, create a first hash table and an allocation bitmap of the first hash table based on the at least one current hash table, wherein the first hash table includes n hash buckets, and the depth of the hash buckets is 1; A target hash bucket is determined in the first hash table according to the allocation bitmap of the first hash table.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: In response to the received data segment release request, determining a hash table identifier and a hash bucket identifier corresponding to the data segment release request; Determine a second hash table corresponding to the hash table identifier and a hash bucket corresponding to the hash bucket identifier; releasing the hash bucket corresponding to the hash bucket identifier and updating the allocation bitmap of the second hash table to obtain a processing result; A data segment release response is generated according to the processing result.

8. A data management device, characterized in that: The device comprises: an acquisition module, configured to, in response to a received data segment allocation request, acquire at least one current hash table and an allocation bitmap corresponding to each current hash table, wherein the current hash table includes n hash buckets, the depth of the hash buckets is 1, and the allocation bitmap includes slots corresponding to the n hash buckets, respectively, and an allocation status of each slot; A judging module, configured to judge whether there is an idle hash bucket in the at least one current hash table; If so, a determination module is configured to determine a target hash bucket in the at least one current hash table according to the allocation bitmap; A generation module is used to perform data segment allocation processing according to the target hash bucket and generate a data segment allocation response, wherein the data segment allocation response includes an identifier of a target hash table and an identifier of a target hash bucket, the at least one current hash table includes the target hash table, and the target hash bucket is included in the target hash table.

9. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when executed by a processor.

Citation Information

Patent Citations

  • Data processing method of nonvolatile storage medium and computer storage medium

    CN112181288A

  • Data storage space management method and device

    CN114442927A

  • Logic address allocation method and device, electronic equipment and storage medium

    CN116633900A

  • Method and device for managing hash table, and computer program product

    US20190220190A1

  • Key value storage device with hashing

    US20230054127A1