Method, electronic device and computer program product for searching data

CN122964060APending Publication Date: 2026-10-23DELL PROD LP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510498740.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2026-10-23

Smart Images

  • Figure CN122964060A_ABST
    Figure CN122964060A_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a method, an electronic device and a computer program product for searching data. The method comprises determining a search range in which a target key corresponding to target data is to be searched, in a node in a tree index structure in which a target index of the target key is located. The method further comprises obtaining a sampling index of a sampling key by parsing a binary stream of the sampling key at a middle position of the search range; and searching the target data by comparing the target index and the sampling index. Through embodiments of the present disclosure, memory consumption can be reduced and search efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of this disclosure relate to the field of computers, and more specifically, to methods, electronic devices, and computer program products for searching data. Background Technology

[0002] A tree-structured index is a self-balancing multi-way search tree designed specifically for external storage systems such as disk storage. Its features include multi-way branching and strict balancing. The advantages of tree-structured indexes lie in their high efficiency in disk input / output (I / O), stable operation, and support for range queries, making them widely used in database indexes and file systems. To achieve index persistence, nodes must be serialized into a storable binary format and written to disk. When searching for an object, deserialization is required to re-parse the binary data on disk into node objects in memory for operation. Summary of the Invention

[0003] Embodiments of this disclosure provide a method, electronic device, and computer program product for searching data.

[0004] According to a first aspect of this disclosure, a method for searching data is provided. The method includes determining a search range for which the target key will be searched within a node of a tree index structure containing a target index of a target key corresponding to target data. The method further includes obtaining a sampled index of the sampled key by parsing a binary stream of a sampled key located at the middle of the search range. The method also includes searching the target data by comparing the target index with the sampled index.

[0005] According to a second aspect of this disclosure, an electronic device is also provided. The electronic device includes a processor and a memory coupled to the processor, the memory having instructions stored therein, the instructions causing the device to perform actions when executed by the processor. The actions include determining a search range for the target key to be searched within a node of a tree index structure containing the target index of the target key corresponding to the target data. The actions also include obtaining a sample index of the sample key by parsing a binary stream of a sample key located at the middle position of the search range. The actions further include searching for the target data by comparing the target index with the sample index.

[0006] According to a third aspect of this disclosure, a computer program product is provided, which is tangibly stored on a computer-readable medium and includes computer-executable instructions that, when executed by a device, cause the device to perform the method according to the first aspect.

[0007] The summary section is provided to present the chosen concepts in a simplified form, which will be further described in the detailed description below. The summary section is not intended to identify key or principal features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. Attached Figure Description

[0008] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0009] Figure 1 The illustration shows a schematic diagram of an example environment in which embodiments of the present disclosure can be implemented;

[0010] Figure 2 A schematic diagram of nodes of a plurality of tree index structures according to an exemplary implementation of the present disclosure is shown;

[0011] Figure 3 A flowchart illustrating an exemplary implementation of a method for searching data according to this disclosure is shown schematically;

[0012] Figure 4 A schematic diagram of a plurality of sampling keys according to an exemplary implementation of the present disclosure is shown;

[0013] Figure 5 The illustration shows a schematic diagram of serialization and deserialization according to an exemplary implementation of this disclosure;

[0014] Figure 6 A schematic diagram illustrating a partial deserialization implementation according to this disclosure is shown.

[0015] Figure 7 The illustration schematically depicts a method for searching a target key using partial deserialization according to an exemplary implementation of the present disclosure;

[0016] Figure 8 A flowchart illustrating a detailed process for searching data according to an exemplary implementation of this disclosure is shown schematically; and

[0017] Figure 9 A block diagram of a device for searching data according to an exemplary implementation of the present disclosure is shown schematically.

[0018] In all the accompanying figures, the same or similar reference numerals denote the same or similar elements. Detailed Implementation

[0019] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0020] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "this embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below. Furthermore, all specific numerical values ​​herein are illustrative and are intended only to aid understanding, and are not intended to limit the scope.

[0021] In storage system services, tree-structured indexes (e.g., B-trees) are typically used to manage metadata. Metadata can be information describing data attributes, i.e., "data about the data." It explains the meaning, structure, source, and purpose of the data, providing background information to help the system manage and understand the data efficiently. The main types of metadata can include: descriptive metadata (such as title, author), structured metadata (such as database field relationships), and administrative metadata (such as permissions, version).

[0022] However, in existing storage systems, each search for data (e.g., object metadata) requires the complete deserialization of all nodes in the tree structure index. This not only increases memory overhead (which can be interchanged with memory or RAM in this article), but also triggers frequent garbage collection (GC) operations in high-concurrency scenarios, causing performance bottlenecks.

[0023] As an example, during a key-value lookup, a binary search needs to be performed on all key-value pairs contained under the current node. This necessitates performing a complete deserialization operation on the binary stream of the current node before instantiating all key-value pairs contained in the node, in order to perform the subsequent binary search. Considering that an index node may contain approximately 600 to 1000 key-value pairs, this will result in a huge memory overhead. For example, in a storage system service, each read request needs to query the metadata information of its object from a B-tree. For billions of objects, the B-tree will reach 4 levels, meaning that to query the metadata of an object, it is necessary to go through 4 levels of nodes (root node #0 → index node #1 → index node #2 → leaf node #3).

[0024] As an example, it is estimated that instantiating (deserializing) a key-value pair will consume 120 bytes of memory. If a node contains approximately 600 key-value pairs, the total consumption will be approximately 72KB. Even considering that the root node is always cached and that leaf nodes are smaller than inodes, a single read request still requires at least 144KB of memory to resolve these two inodes. Assuming that the client reads 40K transactions per second (TPS) per node, this would consume approximately 5.8GB of heap memory per second (40K × 144KB ≈ 5.8GB). Such large-scale memory allocation and deallocation will lead to frequent garbage collection and create a performance bottleneck.

[0025] To address the aforementioned drawbacks, embodiments of this disclosure provide a scheme for searching data based on incomplete node deserialization. This scheme effectively reduces GC frequency and pause times under high-load environments by selectively and partially deserializing the node page binary stream, thereby significantly improving the overall performance of the storage system.

[0026] Figure 1 A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. For example... Figure 1 As shown, in example environment 100, target key 102 is obtained. Target key 102 can represent the key in the key-value pair of the target data 114 (data is also called an object, which can be used interchangeably in this article) to be searched in the tree index structure.

[0027] Based on the lowest and highest boundaries of a node, the key at its middle position can be determined as the sampling key 104. For example, assuming the index of the target key 102 is 246, the index of the key at the middle position of the node referencing index 246 can be determined as the index of the sampling key 104.

[0028] In memory 106, the target key 102 can be located by sequentially querying the root node 108, index node 110, and leaf node 112 based on the comparison between the index of the target key 102 and the index of the sample key 104. After locating the target key 102, the value in the key-value pair can be determined by parsing the binary stream of the target key 102, and the target data 114 can be read from the storage device according to the memory address indicated by the value.

[0029] It should be understood that the architecture and functionality in example environment 100 are described for illustrative purposes only and do not imply any limitation on the scope of this disclosure. Embodiments of this disclosure can also be applied to other environments with different structures and / or functionalities.

[0030] Figure 2 A schematic diagram 200 illustrates nodes of multiple tree-structured indexes according to an exemplary implementation of this disclosure. To efficiently manage large numbers of objects, storage systems typically employ B-tree index structures to organize all metadata information. B-tree indexes support fast lookup of specific metadata (e.g., object storage location, etc.) using key-value pairs. Figure 2 As shown, a B-tree index consists of multiple ordered nodes, each storing a list of key-value pairs sorted by key value. Based on functional differences, a B-tree contains three different types of nodes: root node 204, index node 210, and leaf node 214.

[0031] The root node represents the top-level node, such as the root of a B-tree index structure. Whenever you want to look up a key in a B-tree, you start here. The values ​​in the key-value pairs of the root node represent reference addresses to child nodes (e.g., ref 206 represents reference addresses from 0 to 100, etc.). Each child node is responsible for a contiguous range of key values. The key-value pairs between the values ​​(addresses) indicate the boundaries between these ranges. As an example, assuming the target key's index is 246, you can find ref 208 in the root node, which represents index node 210 referencing indices 200-300.

[0032] Similar to the root node, the values ​​in the key-value pairs of an inode also represent references to leaf nodes. It breaks down the range of keys it is responsible for into smaller sub-ranges within the leaf nodes. For example, in inode 210, we can find that ref 212 references leaf node 214, which has indices 240-260.

[0033] Leaf nodes are the bottom of the B-tree structure, containing each key and its corresponding value. In practical applications, the value in the key-value pairs is usually a byte string of the serialized object. For example, in leaf node 214, the value (val) 216 corresponding to key 246 can be found. After deserializing value 216, object 218 is obtained.

[0034] Figure 3 A flowchart illustrating an exemplary implementation of a method 300 for searching data according to this disclosure is shown schematically. For ease of understanding, the specific data sizes mentioned in the following description are exemplary and not intended to limit the scope of this disclosure. It will be understood that the embodiments described below may also include additional actions not shown and / or actions shown may be omitted, and the scope of this disclosure is not limited in this respect.

[0035] At box 302, within the node of the tree index structure containing the target index of the target key corresponding to the target data, determine the search range to be searched for the target key. For example, if the target key's index size is 246, then the search range to be searched for the target key can be determined within the index node that references index 246. Assuming that the index node referencing index 246 references a total of indices 200-299, then the search range can be determined as indices 200-299.

[0036] At box 304, the sampling index of the sampling key is obtained by parsing the binary stream of the sampling key located at the middle position of the search range. For example, continuing the assumption in the example above, if the search range is indices 200-299, then index 250 at the midpoint of the search range could be the index of the sampling key.

[0037] At box 306, the target data is searched by comparing the target index with the sampled index. For example, continuing the assumption from the previous example, since the target key index is 246 and the sampled key index is 250, the target key index is less than the sampled key index. Therefore, it can be determined that the target key lies between index 200 and index 250. This reduces the range of further searches for the target key.

[0038] In some embodiments, it can be achieved through Figure 4 To understand the embodiments of how to determine the sampling key and determine or update the search range in method 300. Figure 4 A schematic diagram 400 illustrating a plurality of sample keys according to an exemplary implementation of the present disclosure is shown. Assuming that index node 402 references indices 0-400, then during the initial search for the target key, the index located at the midpoint between the lowest boundary 404 (representing index 0) and the highest boundary 406 (representing index 400) of the index node can be determined as sample index 408. Therefore, the size of the index of sample index 408 is 200.

[0039] In some examples, assume the target index size is 90. By comparing the target index with the sampled index 408, it can be determined that the target index is less than the sampled index 408, thus indicating that the target index lies between the lowest boundary 404 and the sampled index 408. Therefore, in the next search, the search range can be narrowed. For example, the search range can be defined as interval 412 in index node 402-1. For instance, the highest boundary 406 is updated from index 400 to index 200, i.e., the updated highest boundary 406-1 in index node 402-1, while the lowest boundary 404 remains unchanged. The sampled search 408 can then be updated to the sampled index 408-1 (representing an index size of 100) at the midpoint between the lowest boundary 404 and the highest boundary 406-1. In the next search, the target key can be searched only within the updated search range 412, for example, by comparing the updated sampled index 408-1 with the target key.

[0040] In some examples, assume the target index size is 350. By comparing the target index with the sampled index 408, it can be determined that the target index is greater than the sampled index 408. Therefore, the target index can be determined to be between the sampled index 408 and the highest boundary 406. In the next search, the search range can be narrowed. For example, the search range can be defined as interval 414 in index node 402-2. For example, the lowest boundary 404 can be updated from index 0 to index 200, i.e., the updated lowest boundary 404-2 in index node 402-2, while the highest boundary 406 remains unchanged. The sampled search 408 can then be updated to the sampled index 408-2 at the midpoint between the lowest boundary 404-2 and the highest boundary 406 (representing an index size of 300). In the next search, the target key can be searched only within the updated search range 414, for example, by comparing the updated sampled index 408-2 with the target key.

[0041] Figure 5A schematic diagram 500 illustrates serialization and deserialization according to an exemplary implementation of this disclosure. To maintain a massive B-tree containing billions of objects, nodes can be serialized into binary format using a specific data serialization format and persisted to disk (e.g., hard disk, SSD, etc.). Several third-party protocols support the conversion between object and data serialization and deserialization. In storage system services, the Google Protocol Buffer (GPB) is used to serialize nodes (e.g., serialize 512) into fixed-length binary streams (e.g., 64KB for inodes and 8KB for leaf nodes), and the reference addresses in the root / inode are the physical storage addresses of these binary streams on disk. Because key-value pairs are contained within the internal structure of the node object, after a node is serialized into a binary stream, each key-value pair within it is also serialized and presented as a physically contiguous subsequence within the node's binary stream. Furthermore, the physical order of the key-value pair subsequences in the binary stream is strictly ordered. Based on the predefined GPB encoding format, the storage system service can directly locate a specific key-value pair sequence from the node stream and perform deserialization on it individually without deserializing the entire node.

[0042] For example, the physical address of the root node (e.g., parent node 502) can be obtained, and then the node's binary stream (e.g., node binary stream 508) can be read in. A specific key-value pair in that node can be deserialized (510) into a list of key-value pairs in the child node (506). For the key of a specific key-value pair, a binary search is performed within the search range, for example, comparing the specific key with the sampled key, to find a matching key-value pair from the list of key-value pairs.

[0043] Figure 6 A schematic diagram 600 illustrates partial deserialization according to an exemplary implementation of this disclosure. B-tree node objects in a storage system service can be structured data defined in GPB format. During serialization, node objects are encoded into binary representations in a specific order and format. The internal field key-value pairs of node objects can also be structured data defined in GPB format and are similarly encoded into binary representations. The serialization of key-value pairs is included in the node serialization process. Based on this GPB mechanism, the binary representations of key-value pairs in the node binary stream are physically adjacent and strictly ordered. Therefore, the node binary stream can be scanned (without complete deserialization) to instantiate only specific key-value pairs at arbitrary indices, ignoring the undeserialized portions before and after them.

[0044] As an example, key-value pair 604 in node 602 can be serialized into binary stream 610 in binary stream 606, and other key-value pairs can be serialized into binary 608 and other unnumbered binary streams. Then, a key-value pair 612 that matches key-value pair 604 can be found by deserializing only binary stream 610, without deserializing the other key-value pairs.

[0045] Figure 7 A schematic diagram 700 illustrates a partial deserialization method for searching a target key according to an exemplary implementation of this disclosure. When searching for a specific key in a B-tree node, the target key (also referred to as the search key) needs to be compared with the keys in the key-value pairs of the current node. This inevitably involves deserialization, requiring the keys to be parsed from the node's binary stream. Since the key-value pairs in the node's binary stream are ordered, this embodiment does not iterate through and compare all keys with the search key one by one. Instead, this embodiment can directly apply a binary search strategy to the node's binary stream.

[0046] For example, at box 702, the index of the target key is obtained, for example, equal to 246. In index node 704, following method 300, only the sample key 706 can be parsed (deserialized) to obtain the leaf node 708 referenced by the sample key. In leaf node 708, the metadata of object 712 can be obtained by parsing only the key-value pair 710.

[0047] Thus, by execution Figure 3 Method 300 and by combining Figures 4-7 As the description shows, Method 300 is a more lightweight search method for matching key-value pairs. It finds key-value pairs that match the target key at each node without requiring full deserialization. Therefore, Method 300 achieves better B-tree search performance and is fully backward compatible with older node versions. By executing Method 300, it is not necessary to parse and instantiate the entire list of key-value pairs from the node. Instead, it only needs to instantiate the key-value pairs that match the target key at each node level (e.g., ...). Figure 7 As shown in the figure, this reduces the space complexity of B-tree queries from O(n) to O(1).

[0048] Figure 8 A flowchart illustrating a detailed process 800 for searching data according to an exemplary implementation of this disclosure is shown schematically. Process 800 may be, for example, logic suitable for writing a computer program that performs method 300. At 802, process 800 begins. At 804, let i = 1, P L =-1, P H =Count of key-value pairs in the current node -1, P S =(P L +P H-1) / 2, where i represents the index of the current key-value pair to be read, P L P represents the lowest boundary of the search interval. H P represents the highest boundary of the search interval. S This represents the key-value pair index of the next sampling point, and it is always P. L and P H The midpoint. At position 808, read the bytes of the current node from the node's binary stream 806.

[0049] At 810, determine whether the currently read binary stream is the end of the stream (i.e., P). H If yes, proceed from step 800 to step 822. If no, proceed from step 800 to step 812. At step 812, determine if the end of the stream is a key-value pair. If yes, proceed from step 800 to step 814. If no, proceed from step 800 to step 808. At step 814, let i = i + 1. At step 816, determine if i is equal to P. S If not, process 800 proceeds to 838. At 838, parsing the current key is omitted. After 838, process 800 proceeds to 808.

[0050] At position 818, only P is resolved. S The key in the key-value pair at position 820. At position 820, P... S The key at the given location is compared with the search key (target key). If P S If the key at point P is less than the search key, then process 800 proceeds to 822. S If the key at point P equals the search key, then process 800 proceeds to 824. S If the key at point 800 is greater than the search key, then process 800 proceeds to 826. At point 822, let P... L =i. At position 824, let P L =i and P H =i. At position 826, let P H =i. At position 828, determine P. L -P H Is it less than or equal to 1? If yes, proceed from step 800 to step 830. If no, proceed from step 800 to step 834, which means the search interval has not yet been fully compressed.

[0051] At position 830, only P is resolved. L The key-value pair at point 800 is returned as the matching key-value pair found during the search. At point 832, process 800 ends. At point 834, let P... S =(P L +P H -1) / 2 and i = P L Then, process 800 proceeds to 836. At 836, the read cursor is reset to P.L This halves the search interval. Then, process 800 proceeds to 808, that is, process 800 is executed iteratively. If P L = -1 indicates that there is no key-value pair matching the search key in the current node, and returns null.

[0052] By iteratively executing process 800, memory consumption is reduced and search performance is improved by avoiding the instantiation of unnecessary key-value pairs in each node. Since B-tree queries are crucial on almost all storage system service paths, process 800 will significantly reduce Java GC frequency and improve the performance of storage system services. Furthermore, because process 800 does not involve any changes to the B-tree persistence structure, it can be seamlessly applied to existing storage system service products without any backward compatibility issues.

[0053] In some embodiments, unlike traditional binary search based on arrays of key-value pairs, binary search based on node binary streams lacks direct pointers to key-value pairs at specific indices. This is because the byte size of key-value pairs in the node binary stream is variable, and the byte offset of each key-value pair in the stream cannot be predicted. To accommodate binary search on a stream, some shuttle operations can be introduced in procedure 800: to reach P S The key-value pairs at the location will always reset the byte read cursor of the node's binary stream to P. L The end offset of the key-value pair (which is also P) L The starting offset of the next key-value pair is at +1, and then the key-value pairs are counted from here until P is reached. S While this may result in some duplicate reads on the node's binary stream, the read operations themselves do not consume much CPU or memory resources as long as they do not involve the creation of new objects. The lookup time complexity remains O(log n). n Compared to existing solutions, it improves search performance because it saves the cost of instantiating the entire list of key-value pairs.

[0054] In some embodiments, performance tests were conducted using the scheme proposed in this disclosure. For example, a PoC version of application method 300 was deployed on an ECS EXF960 (a model of a storage system) environment, and its performance was compared with that of the original ECS. The test scenario was 10KB read with 4 × 150 load threads. The test results are shown in Table 1.

[0055]

[0056] Table 1

[0057] The results show that, with the PoC version applying method 300, the number of Young GCs decreased from 75 to 52 per minute, while the total GC time decreased by approximately 17%. With almost no change in response latency, the system TPS improved by approximately 20%.

[0058] Figure 9 A schematic block diagram of a device 900 that can be used to implement embodiments of the present disclosure is shown. Device 900 may be the device or apparatus described in the embodiments of the present disclosure. Figure 9 As shown, device 900 includes a central processing unit / graphics processing unit (CPU / GPU) 901, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 902 or loaded from storage unit 908 into random access memory (RAM) 903. The RAM 903 can also store various programs and data required for the operation of device 900. CPU / GPU 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904. Although not shown in... Figure 9 As shown, device 900 may also include a coprocessor.

[0059] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0060] The various methods or processes described above can be executed by CPU / GPU 901. For example, in some embodiments, the methods can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by CPU / GPU 901, one or more steps or actions in the methods or processes described above can be performed.

[0061] In some embodiments, the methods and processes described above can be implemented as a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.

[0062] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0063] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper cables, fiber optic cables, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to computer-readable storage media within the respective computing / processing device.

[0064] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​and conventional procedural programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.

[0065] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0066] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0067] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0068] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for searching data, comprising: Within the nodes of the tree index structure where the target index of the target key corresponds to the target data is located, determine the search range for the target key to be searched; The sampling index of the sampling key is obtained by parsing the binary stream of the sampling key located in the middle of the search range; as well as The target data is searched by comparing the target index with the sampling index.

2. The method of claim 1, wherein searching for the target data by comparing the target index with the sampling index comprises: Based on the comparison between the target index and the sampled index, the search range for searching the target key is updated; as well as Search for the target data within the updated search scope.

3. The method according to claim 2, wherein the tree index structure includes multiple levels, the nodes of each level are serialized and stored in the form of a binary stream, the target key is stored in the form of a binary stream, and the node containing the target key is a leaf node of the tree index structure.

4. The method of claim 3, wherein determining the search range to be searched for the target key includes: Determine the lowest index at the lowest boundary of the node and the highest index at the highest boundary of the node; as well as Based on the lowest index and the highest index, the search range from the lowest index to the highest index is determined as the search range.

5. The method according to claim 4, wherein updating the search range for searching the target key based on a comparison of the target index and the sampled index includes: In response to the sampling index being less than the target index, the lowest index is updated to the sampling index, and the method further includes: The key at the midpoint between the updated lowest index and the highest index will be updated to the sampling key; and In response to the sampling index being greater than the target index, the highest index is updated to the sampling index, and the method further includes: The key at the midpoint between the lowest index and the updated highest index is updated to the sampling key.

6. The method according to claim 5, further comprising: In response to the updated highest index being negative, it is determined that there is no key in the node that matches the target key; as well as The system displays a message indicating that the search results are empty.

7. The method of claim 5, wherein searching for the target data within the updated search scope comprises: The target data is searched within the updated search range based on a comparison between the target index and the updated index of the sampling key.

8. The method of claim 3, wherein obtaining the sampling index of the sampling key by parsing the binary stream of the sampling key located at the middle position of the search range comprises: The sample key-value pairs of the sample key are obtained by deserializing the binary stream; as well as The index of the key in the sampled key-value pair is determined as the sampled index.

9. The method according to claim 8, further comprising: In response to the sampling index being equal to the target index, it is determined that the sampling key matches the target key; Based on the value in the sampling key-value pair corresponding to the sampling key, determine the child node that references the node; as well as Search for the target data in the child nodes.

10. The method of claim 9, further comprising: In response to the target key being found in the child node, the physical address of the data is determined based on the value in the key-value pair corresponding to the target key; as well as The data is read from the storage device based on the physical address.

11. The method of claim 10, wherein at least one of the following: The data is metadata; The storage device is a flexible cloud storage device; or The tree-like index structure is a B-tree.

12. The method of claim 1, wherein the nodes of the tree index structure comprise: At least one of the root node, index node, and leaf node.

13. An electronic device, comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, the instructions causing the device to perform actions when executed by the processor, the actions including: Within the nodes of the tree index structure where the target index of the target key corresponds to the target data is located, determine the search range for the target key to be searched; The sampling index of the sampling key is obtained by parsing the binary stream of the sampling key located in the middle of the search range; The target data is searched by comparing the target index with the sampling index.

14. The electronic device of claim 13, wherein searching for the target data by comparing the target index with the sampling index comprises: Based on the comparison between the target index and the sampled index, the search range for searching the target key is updated; as well as Search for the target data within the updated search scope.

15. The electronic device of claim 14, wherein the tree index structure comprises multiple levels, the nodes of each level are serialized and stored in the form of a binary stream, the target key is stored in the form of a binary stream, and the node containing the target key is a leaf node of the tree index structure.

16. The electronic device of claim 15, wherein determining the search range to be searched for the target key includes: Determine the lowest index at the lowest boundary of the node and the highest index at the highest boundary of the node; as well as Based on the lowest index and the highest index, the search range from the lowest index to the highest index is determined as the search range.

17. The electronic device of claim 16, wherein updating the search range for searching the target key based on a comparison of the target index and the sampled index includes: In response to the sampling index being less than the target index, the lowest index is updated to the sampling index, and the action further includes: The key at the midpoint between the updated lowest index and the highest index will be updated to the sampling key; and In response to the sampling index being greater than the target index, the highest index is updated to the sampling index, and the action further includes: The key at the midpoint between the lowest index and the updated highest index is updated to the sampling key.

18. The electronic device according to claim 17, further comprising: In response to the updated highest index being negative, it is determined that there is no key in the node that matches the target key; as well as The system displays a message indicating that the search results are empty.

19. The electronic device of claim 17, wherein searching for the target data in the updated search range comprises: The target data is searched within the updated search range based on a comparison between the target index and the updated index of the sampling key.

20. A computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions that, when executed by a device, cause the device to: Within the nodes of the tree index structure where the target index of the target key corresponds to the target data is located, determine the search range for the target key to be searched; The sampling index of the sampling key is obtained by parsing the binary stream of the sampling key located in the middle of the search range; as well as The target data is searched by comparing the target index with the sampling index.