Host device, storage device, and system and method thereof
By retrieving target data inside the storage device, the problem of frequent I/O operations between the host device and the storage device in B-tree retrieval is solved, and the effect of reducing data migration and improving retrieval performance is achieved.
Patent Information
- Application Number
- CN202411411753.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-02-07
AI Technical Summary
When using B-tree retrieval, I/O operations between the host device and the storage device are frequent, resulting in a large amount of invalid data migration, consuming bandwidth resources and affecting performance.
By retrieving target data within the storage device, avoiding large amounts of data migration between the host device and the storage device, using a predetermined protocol to encapsulate the B-tree query request and query information to be sent to the storage device, and traversing the secondary index within the storage device is traversed. and main index to get the key value of the target field.
Reduces the amount of data movement between the host device and the storage device, reduces the resource utilization and bandwidth consumption of the host device, improves bandwidth utilization and I/O bandwidth within the storage device, and reduces the delay in retrieving target data and Improved retrieval performance.
Smart Images

Figure CN119396829A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of B-tree based retrieval, and more specifically, to a host device, a storage device, and a system and method thereof. Background Art
[0002] Recently, when performing a B-tree based search using, for example, the structured query language (MySQL), if a key is searched in the primary index, the page where the key is located and its primary key value can be retrieved by performing an input / output (I / O) operation between a host device and a storage device, and then the complete row of the key can be obtained, and there is no need to perform an I / O operation to obtain additional columns. Here, the B-tree can represent a self-balancing data structure that stores / retrieves data and is used for search, insert and / or delete operations. On the other hand, if a key is searched in the secondary index, the page where the key is located and its key value can be retrieved, and the key value is a pointer to the complete row that actually exists, and the key value is usually the primary key value. In this case, any search involving the secondary index must be performed by performing an I / O operation to navigate from the root node through the branch node to the correct leaf node in the secondary index to obtain the primary key value, and then perform an I / O operation again to navigate from the root node through the branch node to the correct leaf node in the primary index to obtain the data.
[0003] Figure 1 is a schematic diagram showing a B-tree search according to the prior art. Figure 1 As shown in the figure, when the height of the B-tree is three layers, if advance caching is not considered, the host device and the storage device need to interact six times. In addition, most of the I / O operations between the host device and the storage device are random IO, resulting in a large read overhead. The above phenomenon will cause a large amount of invalid data to move between the host device and the storage device, consuming bandwidth resources and affecting performance. Summary of the invention
[0004] According to some example embodiments of the present invention, there is provided a B-tree based retrieval method performed by a host device, comprising: acquiring query information from a memory of a storage device based on a B-tree query request for a table; sending the query information to the storage device to be stored in the memory of the storage device; sending a B-tree query request to the storage device to initiate a query for the table at the storage device; and receiving a result of the B-tree query request from the storage device.
[0005] The target field of the B-tree query request may be a field that is not included in the leaf node of the secondary index of the table.
[0006] The query information may include all fields of the table and their length information, at least one field of the table requested by the B-tree query request, page number information of the root nodes of the primary index and secondary index of the table, and at least one of the sizes of the B-tree pages.
[0007] The operation of sending the B-tree query request and query information to the storage device may include: encapsulating the B-tree query request and query information through a predetermined (or optional, desired or selected) protocol to send to the storage device.
[0008] According to some example embodiments conceived in the present invention, there is provided a host device, comprising: a memory; and a processor, configured to perform the following operations: obtaining query information from the memory of a storage device based on a B-tree query request for a table; sending the query information to the storage device to be stored in the memory of the storage device; sending a B-tree query request to the storage device to initiate a query for the table at the storage device; and receiving a result of the B-tree query request from the storage device.
[0009] The target field of the B-tree query request may be a field that is not included in the leaf node of the secondary index of the table.
[0010] The query information may include all fields of the table and their length information, at least one field of the table requested by the B-tree query request, page number information of the root nodes of the primary index and secondary index of the table, and at least one of the sizes of the B-tree pages.
[0011] The at least one processor may also be configured to encapsulate the B-tree query request and the query information through a predetermined (or optional, desired, or selected) protocol to send to the storage device.
[0012] According to some example embodiments of the present invention, there is provided a B-tree based retrieval method performed by a storage device, comprising: receiving query information from a host device and storing it in a memory; receiving a B-tree query request from the host device to initiate a query for a table; obtaining a result of the B-tree query request by using the query information; and sending the result of the B-tree query request to the host device.
[0013] The target field of the B-tree query request may be a field that is not included in the leaf node of the secondary index of the table.
[0014] The query information may include all fields of the table and their length information, at least one field of the table requested by the B-tree query request, page number information of the root nodes of the primary index and secondary index of the table, and at least one of the sizes of the B-tree pages.
[0015] The operation of obtaining the result of the B-tree query request may include: traversing and retrieving the root page of each root node of the secondary index of the table by using the query information to obtain the primary key value of the root page of at least one target root node of the table corresponding to the B-tree query request; traversing and retrieving the root page of the root node corresponding to the primary key value of the primary index of the table by using the query information to obtain the key value of the target field corresponding to the B-tree query request as the result of the B-tree query request.
[0016] The operation of obtaining the primary key value of the root page of at least one target root node of the table corresponding to the B-tree query request may include: based on all fields of the table and their length information and the page number information of the root node of the secondary index of the table, loading the root page of each root node of the secondary index of the table stored in the memory of the storage device into the memory of the storage device for retrieval in the size of the B-tree page, so as to obtain the primary key value of the root page of the at least one target root node.
[0017] The operation of obtaining the key value of the target field corresponding to the B-tree query request as the result of the B-tree query request may include: based on all the fields of the table and their length information and the page number information of the root node of the primary index of the table, loading the root page of the root node corresponding to the primary key value of the primary index of the table stored in the memory of the storage device into the memory of the storage device for retrieval in the size of the B-tree page, so as to obtain the key value of the target field.
[0018] The B-tree-based retrieval method may further include: sorting the primary key values, and sequentially loading the root pages of the root nodes corresponding to the sorted primary key values into the memory of the storage device for retrieval.
[0019] According to some example embodiments of the present invention, there is provided a storage device, including: a storage; a memory; and a processor, configured to perform the following operations: receiving query information from a host device and storing it in the memory; receiving a B-tree query request from the host device to initiate a query for a table; obtaining a result of the B-tree query request by using the query information; and sending the result of the B-tree query request to the host device.
[0020] The target field of the B-tree query request may be a field that is not included in the leaf node of the secondary index of the table.
[0021] The query information may include all fields of the table and their length information, at least one field of the table requested by the B-tree query request, page number information of the root nodes of the primary index and secondary index of the table, and at least one of the sizes of the B-tree pages.
[0022] The processor can also be configured to perform the following operations: traverse and retrieve the root page of each root node of the secondary index of the table by using the query information to obtain the primary key value of the root page of at least one target root node of the table corresponding to the B-tree query request; traverse and retrieve the root page of the root node corresponding to the primary key value of the primary index of the table by using the query information to obtain the key value of the target field corresponding to the B-tree query request as the result of the B-tree query request.
[0023] The processor can also be configured to perform the following operations: based on all the fields of the table and their length information and the page number information of the root node of the secondary index of the table, the root page of each root node of the secondary index of the table stored in the memory of the storage device is loaded into the memory of the storage device in the size of a B-tree page for retrieval to obtain the primary key value of the root page of the at least one target root node.
[0024] The processor can also be configured to perform the following operations: based on all the fields of the table and their length information and the page number information of the root node of the primary index of the table, the root pages of the root nodes corresponding to the primary key values of the primary index of the table stored in the memory of the storage device are loaded into the memory of the storage device in the size of a B-tree page for retrieval to obtain the key value of the target field.
[0025] The processor may also be configured to perform the following operations: sorting the primary key values, and sequentially loading the root pages of the root nodes corresponding to the sorted primary key values into the memory of the storage device for retrieval.
[0026] According to some example embodiments of the inventive concept, there is provided a system for performing B-tree storage application retrieval, including the aforementioned host device and the aforementioned storage device.
[0027] According to some example embodiments of the inventive concept, there is provided a computer-readable medium having computer-executable instructions stored thereon, and in response to executing the instructions, the aforementioned method is performed.
[0028] According to some example embodiments conceived in the present invention, by retrieving target data within a storage device, a large amount of data migration between the host device and the storage device can be avoided, thereby reducing the amount of data movement between the host device and the storage device, reducing the resource utilization and bandwidth consumption of the host device and improving bandwidth utilization, increasing the I / O bandwidth within the storage device, reducing the delay in retrieving target data, and improving retrieval performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The above and other objects and features of the present invention will become more apparent from the following detailed description in conjunction with the accompanying drawings, in which:
[0030] Figure 1 is a schematic diagram showing a B-tree search;
[0031] Figure 2 is a flowchart illustrating a B-tree based retrieval method performed by a host device according to some example embodiments of the inventive concept;
[0032] Figure 3 is a flowchart illustrating a B-tree based retrieval method performed by a storage device according to some example embodiments of the inventive concept;
[0033] Figure 4 is a block diagram illustrating a host device according to some example embodiments of the inventive concept;
[0034] Figure 5 is a block diagram illustrating a storage device according to some example embodiments of the inventive concept;
[0035] Figure 6 is a block diagram illustrating a system according to some example embodiments of the inventive concept;
[0036] Figure 7 is a schematic diagram illustrating a system to which a storage device is applied according to some example embodiments of the inventive concept;
[0037] Figure 8 is a block diagram illustrating a host storage system according to some example embodiments of the inventive concept;
[0038] Fig. 9 is a diagram illustrating a data center to which a storage device is applied according to some example embodiments of the inventive concept. DETAILED DESCRIPTION
[0039] In the following, various exemplary embodiments of the inventive concept are described with reference to the accompanying drawings, wherein the same reference numerals are used to represent the same or similar elements, features and structures. However, it is not intended that the inventive concept be limited to specific embodiments by the various exemplary embodiments described herein, and it is intended that: the inventive concept covers all modifications, equivalents and / or substitutes of the inventive concept, as long as they are within the scope of the attached claims and their equivalents. The terms and words used in the following specification and claims are not limited to their dictionary meanings, but are only used to enable a clear and consistent understanding of the inventive concept. Therefore, it should be apparent to those skilled in the art that the following description of various exemplary embodiments of the inventive concept is provided for illustrative purposes only, and not for the purpose of limiting the inventive concept defined by the attached claims and their equivalents.
[0040] It should be understood that unless the context clearly indicates otherwise, the singular includes the plural.The terms "include", "comprising" and "having" used herein indicate the presence of functions, operations or elements of the inventive concept, but do not exclude other functions, operations or elements.
[0041] For example, the expression "A or B" or "at least one of A and / or B" may indicate A and B, A or B. For example, the expression "A or B" or "at least one of A and / or B" may indicate (1) A, (2) B, or (3) both A and B.
[0042] In various example embodiments of the inventive concept, it is intended that when a component (e.g., a first component) is referred to as being "coupled" or "connected" to another component (e.g., a second component) or being "coupled" or "connected" to another component (e.g., the second component), the component may be directly connected to the other component or may be connected through another component (e.g., a third component). In contrast, when a component (e.g., a first component) is referred to as being "directly coupled" or "directly connected" to another component (e.g., the second component) or being directly coupled to or directly connected to another component (e.g., the second component), there is no other component (e.g., the third component) between the component and the other component.
[0043] The expression "configured to" used in describing various example embodiments of the inventive concept may be used interchangeably with expressions such as "suitable for", "capable of", "designed to", "suitable for", "manufactured to", and "capable of", for example, depending on the circumstances. The term "configured to" may not necessarily indicate that it is "specially designed to" in terms of hardware. On the contrary, the expression "a device configured to..." in some cases may indicate that the device and another device or part "can..." For example, the expression "a processor configured to perform A, B, and C" may indicate a dedicated processor (e.g., an embedded processor) for performing the corresponding operations or a general-purpose processor (e.g., a central processing unit CPU or an application processor (AP)) for performing the corresponding operations by executing at least one software program stored in a memory device.
[0044] The terms used herein are to describe certain example embodiments of the inventive concept, but are not intended to limit the scope of other example embodiments. Unless otherwise noted herein, all terms (including technical or scientific terms) used herein may have the same meaning as those generally understood by those skilled in the art. Generally, the terms defined in the dictionary should be considered to have the same meaning as the contextual meaning in the relevant field, and, unless clearly defined herein, should not be understood differently or understood to have an overly formal meaning. In any case, the terms defined in the inventive concept are not intended to be interpreted as excluding the example embodiments of the inventive concept.
[0045] Figure 1 is a schematic diagram showing B-tree retrieval. Figure 1 As shown in the figure, when the height of the B-tree is three layers, if advance caching is not considered, the host device and the storage device need to interact six times. In addition, most of the I / O operations between the host device and the storage device are random IO, resulting in a large read overhead. The above phenomenon will cause a large amount of invalid data to move between the host device and the storage device, consuming bandwidth resources and affecting performance.
[0046] Figure 2 is a flowchart illustrating a B-tree based retrieval method performed by a host device according to some example embodiments of the inventive concept.
[0047] Reference Figure 2 , in operation S210, query information may be obtained from a memory of a storage device based on a B-tree query request for a table. As an example only and not a limitation, a target field of a B-tree query request may be a field that is not included in a leaf node of a secondary index of the table. In addition, the query information may include at least one of all fields of the table and their length information, at least one field of the table requested to be queried by the B-tree query request, page number information of the root nodes of the primary index and the secondary index of the table, and the size of a B-tree page. According to some example embodiments of the present inventive concept, a B-tree query request for a table may be obtained by a database application (e.g., a B-tree type storage application) of a host device.
[0048] According to some example embodiments of the present invention, in operation S210, the B-tree query request for the table may be a SQL statement but is not limited thereto, and query information may be obtained based on "Select" and "Where" in the SQL statement. Here, the page number information of the root nodes of the primary index and the secondary index of the table may be obtained by querying database dictionary information (e.g., Logical Block Address (LBA) information) from the memory of the storage device based on the SQL statement. In addition, the size of the B-tree page may be obtained from the InnoDB module in the database application of the host device, and the size of the B-tree page may be a default value in the InnoDB module (e.g., 16K, etc.).
[0049] In operation S220, query information may be sent to the storage device to be stored in the memory of the storage device. According to some example embodiments of the inventive concept, the storage device may be first discovered, memory may be requested from the storage device, the memory of the storage device may be mapped to the host device, and query information may then be sent to the storage device to store the query information in the memory of the storage device.
[0050] In operation S230, a B-tree query request may be sent to the storage device to initiate a query for the table in the storage device.
[0051] According to some example embodiments of the present invention, the sending operation in operation S220 and operation S230 may encapsulate the B-tree query request and query information through a predetermined (or optional, expected or selected) protocol to send to the storage device. As an example only and not a limitation, the predetermined (or optional, expected or selected) protocol may be the Storage Networking Industry Association (SNIA) Computing Storage (CS) Application Programming Interface (API) or Open Computing Language (OpenCL). In addition, when the storage device is a non-volatile memory host controller interface specification (NVMe) device, the encapsulated information may be further sent to the storage device through the NVMe interface protocol through the NVMe device driver (e.g., NVMeTP4091 device driver, etc.). When the storage device is an NVMe device, before encapsulating the B-tree query request in operation S230, the B-tree query request may first be converted into an NVMe computing command (e.g., a storage device configuration command, a B-tree traversal command, etc.), and then encapsulated and sent.
[0052] In operation S240, a result of the B-tree query request may be received from the storage device.
[0053] Figure 3 is a flowchart illustrating a B-tree based retrieval method performed by a storage device according to some example embodiments of the inventive concept.
[0054] Reference Figure 3 , in operation S310, query information may be received from a host device and stored in a memory. Here, as an example only and not a limitation, the target field of the B-tree query request may be a field that is not included in a leaf node of a secondary index of the table. In addition, the query information may include all fields of the table and their length information, at least one field of the table requested by the B-tree query request, page number information of the root nodes of the primary index and the secondary index of the table, and the size of the B-tree page. According to some example embodiments of the present inventive concept, the query information may be stored in a database configuration module in a memory.
[0055] In operation S320, a B-tree query request may be received from a host device to initiate a query for a table. According to some example embodiments of the present inventive concept, a processor included in a storage device may be a Computational Storage Engine (CSE), and the CSE may include a Computational Storage Engine Entity (CSEE), and the CSEE may select a CSF for performing the following operations from at least one Computational Storage Function (CSF) included therein.
[0056] In operation S330, the result of the B-tree query request may be obtained by using the query information. According to some example embodiments of the present invention, the operation of obtaining the result of the B-tree query request of operation S330 may further include: traversing and retrieving the root page of each root node of the secondary index of the table by using the query information to obtain the primary key value of the root page of at least one target root node of the table corresponding to the B-tree query request; traversing and retrieving the root page of the root node corresponding to the primary key value of the primary index of the table by using the query information to obtain the key value of the target field corresponding to the B-tree query request as the result of the B-tree query request. That is, the above operation traverses the secondary index and the primary index to obtain the key value of the target field, and the root page of the root node may be repeatedly loaded into the memory of the storage device for retrieval.
[0057] According to some example embodiments conceived by the present invention, more specifically, the operation of obtaining the primary key value of the root page of at least one target root node of the table corresponding to the B-tree query request may include: based on all fields of the table and their length information and the page number information of the root node of the secondary index of the table, the root page of each root node of the secondary index of the table stored in the memory of the storage device is loaded into the memory of the storage device for retrieval in the size of a B-tree page, so as to obtain the primary key value of the root page of the at least one target root node.
[0058] According to some example embodiments conceived by the present invention, more specifically, the operation of obtaining the key value of the target field corresponding to the B-tree query request as the result of the B-tree query request includes: based on all the fields of the table and their length information and the page number information of the root node of the primary index of the table, the root pages of the root node corresponding to the primary key value of the primary index of the table stored in the memory of the storage device are loaded into the memory of the storage device for retrieval in the size of the B-tree page, respectively, to obtain the key value of the target field.
[0059] According to some example embodiments of the inventive concept, the next root node to be loaded may be determined based on a key value, and page number information of the next root node may be obtained. In addition, according to some example embodiments of the inventive concept, the key value of a target field as a result of a B-tree query request may be stored in a memory of a storage device.
[0060] According to some example embodiments of the inventive concept, in the above-described specific operations of operation S330, a target address and a source address in a memory of the storage device may be obtained based on page number information of a root node of a secondary index of the table and / or page number information of a root node of a primary index of the table, and direct memory access (DMA) negotiation with a storage controller included in the storage device may be initiated to establish a DMA data transfer channel between the memory of the storage device and the memory, so as to load a corresponding root page into the memory of the storage device. In addition, during the above retrieval process, comparison and retrieval of key values may be implemented through a comparator of CSF. For example, inputs of the comparator may be a key value A and a key value B for comparison, and outputs may be: A_greater_B, that is, a high level if A > B, otherwise a low level; A_equal_B, that is, a high level if A = B, otherwise a low level; A_less_B, that is, a high level if A < B, otherwise a low level.
[0061] Optionally, according to some example embodiments of the inventive concept, after obtaining a primary key value of a root page of at least one target root node, the primary key value may be sorted, and root pages of root nodes corresponding to the sorted primary key values may be sequentially loaded into the memory of the storage device for retrieval. By way of example only and not limitation, the primary key values may be sorted according to the size of the key values. Sorting the primary key values may optimize retrieval performance and reduce retrieval time.
[0062] In operation S340, a result of a B-tree query request may be sent to a host device. According to some example embodiments of the inventive concept, similar to sending query information and a B-tree query request to a storage device, the result of the B-tree query request may be encapsulated through a predetermined (or optional, desired, or selected) protocol to be sent to the host device, which will not be elaborated herein.
[0063] In addition, according to some example embodiments of the inventive concept, before sending a result of a B-tree query request to a host device, interrupt information may be sent to the host device to indicate that a result of the B-tree query request has been retrieved. Subsequently, a query server module in the host device may obtain the result of the B-tree query request from the memory, and the result may be returned to a database application of the host device.
[0064] In addition, according to some example embodiments of the inventive concept, the storage device may also send query information to the host device.
[0065] Figure 4 is a block diagram illustrating a host device 400 according to some example embodiments of the inventive concept.
[0066] Reference Figure 4 , the host device 400 according to some example embodiments of the inventive concepts may include a memory 410 and a processor 420 .
[0067] The processor 420 can be configured to perform the following operations: obtain query information from the memory of the storage device based on a B-tree query request for the table; send the query information to the storage device to be stored in the memory of the storage device; send a B-tree query request to the storage device to initiate a query for the table on the storage device; and receive the result of the B-tree query request from the storage device.
[0068] As an example only and not a limitation, the target field of the B-tree query request may be a field that is not included in the leaf node of the secondary index of the table. In addition, the query information may include at least one of all fields of the table and their length information, at least one field of the table requested by the B-tree query request, page number information of the root nodes of the primary index and the secondary index of the table, and the size of the B-tree page.
[0069] According to some example embodiments of the inventive concepts, the processor 420 may be further configured to encapsulate the B-tree query request and the query information through a predetermined (or optional, desired or selected) protocol to send to the storage device.
[0070] According to some example embodiments of the present inventive concept, the processor 420 may include: hardware or a hardware circuit with a logic circuit; a hardware / software combination, such as a processor that executes software and / or firmware; or a combination thereof. For example, the processor 420 may more specifically include a central processing unit (CPU), an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA), a system on a chip (SoC), a programmable logic unit, a microprocessor, an application specific integrated circuit (ASIC), etc., but is not limited thereto.
[0071] In addition to the above components, the host device 400 according to some example embodiments of the inventive concept may further include an interface module for sending / receiving data, etc., for implementing corresponding functions, which will not be described in detail herein.
[0072] Figure 5 is a block diagram illustrating a storage device 500 according to some example embodiments of the inventive concept.
[0073] Reference Figure 5, the storage device 500 according to some example embodiments of the inventive concepts may include a storage 510 , a memory 520 , and a processor 530 .
[0074] The processor 530 may be configured to perform the following operations: receive query information from a host device and store it in a memory; receive a B-tree query request from the host device to initiate a query for a table; obtain a result of the B-tree query request by using the query information; and send the result of the B-tree query request to the host device.
[0075] As an example only and not a limitation, the target field of the B-tree query request may be a field that is not included in the leaf node of the secondary index of the table. In addition, the query information may include at least one of all fields of the table and their length information, at least one field of the table requested by the B-tree query request, page number information of the root nodes of the primary index and the secondary index of the table, and the size of the B-tree page.
[0076] According to some example embodiments conceived by the present invention, the processor 530 may also be configured to perform the following operations: traverse and retrieve the root page of each root node of the secondary index of the table by using query information to obtain the primary key value of the root page of at least one target root node of the table corresponding to the B-tree query request; traverse and retrieve the root page of the root node corresponding to the primary key value of the primary index of the table by using query information to obtain the key value of the target field corresponding to the B-tree query request as a result of the B-tree query request.
[0077] According to some example embodiments conceived by the present invention, more specifically, the processor is further configured to perform the following operations: based on all fields of the table and their length information and the page number information of the root node of the secondary index of the table, the root page of each root node of the secondary index of the table stored in the memory of the storage device is loaded into the memory of the storage device for retrieval in the size of a B-tree page, so as to obtain the primary key value of the root page of the at least one target root node.
[0078] According to some example embodiments conceived by the present invention, more specifically, the processor is further configured to perform the following operations: based on all fields of the table and their length information and the page number information of the root node of the primary index of the table, the root pages of the root nodes corresponding to the primary key values of the primary index of the table stored in the memory of the storage device are loaded into the memory of the storage device for retrieval in the size of a B-tree page to obtain the key value of the target field.
[0079] According to some example embodiments of the inventive concept, the processor 530 may be further configured to perform the following operations: sorting the primary key values, and sequentially loading the root pages of the root nodes corresponding to the sorted primary key values into the memory of the storage device for retrieval.
[0080] In addition to the above components, the storage device 500 according to some example embodiments of the inventive concept may further include an interface module for sending / receiving data, etc., for implementing corresponding functions, which will not be described in detail herein.
[0081] According to some example embodiments of the present invention, the processor 530 may include: hardware or a hardware circuit with a logic circuit; a hardware / software combination, such as a processor that executes software and / or firmware; or a combination thereof. For example, the processor 530 may more specifically include a central processing unit (CPU), an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA), a system on a chip (SoC), a programmable logic unit, a microprocessor, an application specific integrated circuit (ASIC), etc., but is not limited thereto.
[0082] Figure 6 is a block diagram illustrating a system 600 according to some example embodiments of the inventive concepts.
[0083] Reference Figure 6 , a system 600 according to some example embodiments of the inventive concept may include a host device 610 and a storage device 620. The host device 610 may be connected to Figure 4 The host device 400 shown in FIG. 1 is the same as or similar to the host device 400 shown in FIG. 1 , and the storage device 620 may be connected to the host device 400 of FIG. 1 . Figure 5 The storage device 500 shown in FIG. 1 is the same as or similar to that shown in FIG. 1 , and will not be described in detail herein.
[0084] Figure 7 is a schematic diagram illustrating a system 1000 to which a storage device is applied according to some example embodiments of the inventive concept.
[0085] Figure 7 The system 1000 may basically be a mobile system, such as a portable communication terminal (e.g., a mobile phone), a smart phone, a tablet personal computer (PC), a wearable device, a healthcare device, or an Internet of Things (IOT) device. However, Figure 7 The system 1000 is not necessarily limited to a mobile system, and may be a PC, a laptop, a server, a media player, or an automotive device (eg, a navigation device).
[0086] Reference Figure 7 , the system 1000 may include a main processor 1100, a memory (e.g., 1200a and 1200b), and a storage device (e.g., 1300a and 1300b). In addition, the system 1000 may include at least one of an image capture device 1410, a user input device 1420, a sensor 1430, a communication device 1440, a display 1450, a speaker 1460, a power supply device 1470, and a connection interface 1480.
[0087] The main processor 1100 may control all operations of the system 1000, and more specifically, may control operations of other components included in the system 1000. The main processor 1100 may be implemented as a general-purpose processor, a dedicated processor, an application processor, or the like.
[0088] The main processor 1100 may include at least one central processing unit (CPU) core 1110, and further include a controller 1120 for controlling the memories 1200a and 1200b and / or the storage devices 1300a and 1300b. In some example embodiments, the main processor 1100 may further include an accelerator 1130, which is a dedicated circuit for high-speed data operations such as artificial intelligence (AI) data operations, etc. The accelerator 1130 may include a graphics processing unit (GPU), a neural processing unit (NPU), and / or a data processing unit (DPU), etc., and is implemented as a chip physically separated from other components of the main processor 1100.
[0089] The memories 1200a and 1200b may be used as main storage devices of the system 1000. Although the memories 1200a and 1200b may include volatile memories, such as static random access memory (SRAM) and / or dynamic random access memory (DRAM), etc., the memories 1200a and 1200b may include non-volatile memories, such as flash memory, phase change random access memory (PRAM), and / or resistive random access memory (RRAM), etc. The memories 1200a and 1200b may be implemented in the same package as the main processor 1100.
[0090] The storage devices 1300a and 1300b may be used as non-volatile storage devices, which are configured to store data regardless of whether they are powered on and have a larger storage capacity than the memories 1200a and 1200b. The storage devices 1300a and 1300b may include memory controllers (STRG CTRL) 1310a and 1310b and non-volatile memories (NVM) 1320a and 1320b, respectively, which are configured to store data via the control of the memory controllers 1310a and 1310b. Although the NVMs 1320a and 1320b may include V-NAND flash memories having a two-dimensional (2D) or three-dimensional (3D) structure, the NVMs 1320a and 1320b may include other types of NVMs, such as PRAM and / or RRAM, etc.
[0091] The storage devices 1300a and 1300b may be physically separated from the main processor 1100 and included in the system 1000, or may be implemented in the same package as the main processor 1100. In addition, the storage devices 1300a and 1300b may have a type of solid-state devices (SSDs) or memory cards, and may be removably combined with other components of the system 100 through an interface such as a connection interface 1480 to be described later. The storage devices 1300a and 1300b may be devices to which a standard protocol such as Universal Flash Storage (UFS), Embedded Multimedia Card (eMMC), or NVMe is applied, but are not limited thereto.
[0092] The image capture device 1410 can capture still images or moving images. The image capture device 1410 may include a camera, a camcorder, and / or a webcam, etc.
[0093] The user input device 1420 may receive various types of data input by a user of the system 1000 and includes a touch pad, a keypad, a keyboard, a mouse, a microphone, and the like.
[0094] The sensor 1430 may detect various types of physical quantities that may be acquired from the outside of the system 1000 and convert the detected physical quantities into electrical signals. The sensor 1430 may include a temperature sensor, a pressure sensor, an illumination sensor, a position sensor, an acceleration sensor, a biosensor, and / or a gyro sensor, etc.
[0095] The communication device 1440 may transmit and receive signals between other devices outside the system 1000 according to various communication protocols. The communication device 1440 may include an antenna, a transceiver, a modem, or the like.
[0096] Display 1450 and speaker 1460 may be used as output devices configured to output visual information and auditory information, respectively, to a user of system 1000 .
[0097] The power supply device 1470 may appropriately convert power supplied from a battery (not shown) embedded in the system 1000 and / or an external power source, and supply the converted power to each component of the system 1000 .
[0098] The connection interface 1480 may provide a connection between the system 1000 and an external device that is connected to the system 1000 and is capable of transmitting and receiving data to and from the system 1000. The connection interface 1480 may be implemented by using various interface schemes, for example, Advanced Technology Attachment (ATA), Serial ATA (SATA), External Serial ATA (e-SATA), Small Computer System Interface (SCSI), Serial Attached SCSI (SAS), Peripheral Component Interconnect (PCI), PCI express (PCIe), NVMe, IEEE 1394, Universal Serial Bus (USB) interface, Secure Digital (SD) card interface, Multimedia Card (MMC) interface, Embedded Multimedia Card (eMMC) interface, UFS interface, Embedded UFS (eUFS) interface, Compact Flash (CF) card interface, and the like.
[0099] Figure 8 is a block diagram illustrating a host memory system 10 according to some example embodiments of the inventive concept.
[0100] The host storage system 10 may include a host 100 and a storage device 200. In addition, the storage device 200 may include a memory controller 210 and an NVM 220. According to some example embodiments of the inventive concept, the host 100 may include a host controller 110 and a host memory 120. The host memory 120 may be used as a buffer memory configured to temporarily store data to be transmitted to or received from the storage device 200.
[0101] The storage device 200 may include a storage medium configured to store data in response to a request from the host 100. As an example, the storage device 200 may include at least one of an SSD, an embedded memory, and a removable external memory. When the storage device 200 is an SSD, the storage device 200 may be a device that complies with the NVMe standard. When the storage device 200 is an embedded memory or an external memory, the storage device 200 may be a device that complies with the UFS standard or the eMMC standard. Both the host 100 and the storage device 200 may generate a packet and send the packet according to the adopted standard protocol.
[0102] When the NVM 220 of the storage device 200 includes a flash memory, the flash memory may include a 2D NAND memory array or a 3D (or vertical) NAND (VNAND) memory array. As another example, the storage device 200 may include various other types of NVM. For example, the storage device 200 may include a magnetic random access memory (MRAM), a spin transfer torque MRAM, a conductive bridge RAM (CBRAM), a ferroelectric RAM (FRAM), a PRAM, a RRAM, and various other types of memory.
[0103] According to an example embodiment, the host controller 110 and the host memory 120 may be implemented as separate semiconductor chips. Alternatively, in some example embodiments, the host controller 110 and the host memory 120 may be integrated in the same semiconductor chip. As an example, the host controller 110 may be any one of a plurality of modules included in an application processor (AP). The AP may be implemented as a system on chip (SoC). In addition, the host memory 120 may be an embedded memory included in the AP or a memory module external to the AP.
[0104] The host controller 110 may manage an operation of storing data (eg, write data) of the buffer area of the host memory 120 in the NVM 220 or an operation of storing data (eg, read data) of the NVM 220 in the buffer area.
[0105] The memory controller 210 may include a host interface 211, a memory interface 212, and a CPU 213. In addition, the memory controller 210 may further include a flash translation layer (FTL), a packet manager 215, a buffer memory 216, an error correction code (ECC) engine 217, and an advanced encryption standard (AES) engine 218. The memory controller 210 may further include a working memory (not shown) in which the FTL 214 is loaded. The CPU 213 may execute the FTL 214 to control data write and read operations on the NVM 220.
[0106] The host interface 211 may transmit and receive packets to and from the host 100. The packets transmitted from the host 100 to the host interface 211 may include commands or data to be written to the NVM 220, etc. The packets transmitted from the host interface 211 to the host 100 may include responses to commands or data read from the NVM 220, etc. The memory interface 212 may transmit data to be written to the NVM 220 to the NVM 220 or receive data read from the NVM 220. The memory interface 212 may be configured to comply with a standard protocol such as Toggle or Open NAND Flash Interface (ONFI).
[0107] The FTL 214 may perform various functions, such as an address mapping operation, a wear leveling operation, and a garbage collection operation. The address mapping operation may be an operation of converting a logical address received from the host 100 into a physical address for actually storing data in the NVM 220. The wear leveling operation may be a technique for preventing excessive degradation of a specific block by allowing the blocks of the NVM 220 to be used evenly. As an example, the wear leveling operation may be implemented by using a firmware technique that balances the erase counts of physical blocks. The garbage collection operation may be a technique for ensuring available capacity in the NVM 220 by erasing an existing block after copying valid data of the existing block to a new block.
[0108] The packet manager 215 may generate a packet according to a protocol agreed to an interface of the host 100, or parse various types of information from a packet received from the host 100. In addition, the buffer memory 216 may temporarily store data to be written to or read from the NVM 220. Although the buffer memory 216 may be a component included in the memory controller 210, the buffer memory 216 may be outside the memory controller 210.
[0109] The ECC engine 217 may perform error detection and correction operations on read data read from the NVM 220. More specifically, the ECC engine 217 may generate parity bits for write data to be written to the NVM 220, and the generated parity bits may be stored together with the write data in the NVM 220. During reading of data from the NVM 220, the ECC engine 217 may correct errors in the read data by using the read data and the parity bits read from the NVM 220, and output the error-corrected read data.
[0110] The AES engine 218 may perform at least one of an encryption operation and a decryption operation on data input to the memory controller 210 by using a symmetric key algorithm.
[0111] Fig. 9 is a diagram illustrating a data center 3000 to which a storage device is applied according to some example embodiments of the inventive concept.
[0112] Platform part - server (application / storage)
[0113] Reference Fig. 9, the data center 3000 may be a facility that collects various types of data and provides services, and is referred to as a data storage center. The data center 3000 may be a system for operating a search engine and a database, and may be a computing system used by a company (e.g., a bank) or a government agency. The data center 3000 may include application servers 3100 to 3100n and storage servers 3200 to 3200m. According to example embodiments, the number of applications 3100 to 3100n and the number of storage servers 3200 to 3200m may be selected differently. The number of application servers 3100 to 3100n and the number of storage servers 3200 to 3200m may be different from each other.
[0114] The application server 3100 or the storage server 3200 may include at least one of the processors 3110 and 3210 and the memories 3120 and 3220. Now, the storage server 3200 will be described as an example. The processor 3210 may control all operations of the storage server 3200, access the memory 3220, and execute instructions and / or data loaded into the memory 3220. The memory 3220 may be a double data rate synchronous DRAM (DDR SDRAM), a high bandwidth memory (HBM), a hybrid memory cube (HMC), a dual in-line memory module (DIMM), an Optane DIMM, or a non-volatile DIMM (NVMDIMM). In some example embodiments, the number of processors 3210 and memories 3220 included in the storage server 3200 may be selected differently. In some example embodiments, the processor 3210 and the memory 3220 may provide a processor-memory pair. In some example embodiments, the number of processors 3210 and the number of memories 3220 may be different from each other. The processor 3210 may include a single-core processor or a multi-core processor. The above description of the storage server 3200 may be similarly applied to the application server 3100. In some embodiments, the application server 3100 may not include the storage device 3150. The storage server 3200 may include at least one storage device 3250. According to some example embodiments, the number of storage devices 3250 included in the storage server 3200 may be selected differently.
[0115] Platform part - Network
[0116] The application servers 3100 to 3100n can communicate with the storage servers 3200 to 3200m through the network 3300. The network 3300 can be implemented by using a fiber channel (FC) or Ethernet. In this case, FC can be a medium for relatively high-speed data transmission, and an optical switch with high performance and high availability can be used. According to the access method of the network 3300, the storage servers 3200 to 3200m can be set to file storage, block storage, or object storage.
[0117] In one embodiment, the network 3300 may be a network dedicated to storage, such as a storage area network (SAN). For example, the SAN may be an FC-SAN, which uses an FC network and is implemented according to the FC protocol (FCP). As another example, the SAN may be an Internet Protocol (IP)-SAN, which uses a transmission control protocol (TCP) / IP network and is implemented according to the SCSI or Internet SCSI (iSCSI) protocol over TCP / IP. In another embodiment, the network 3300 may be a general network, such as a TCP / IP network. For example, the network 3300 may be implemented according to protocols such as FC over Ethernet (FCoE), network attached storage (NAS), and NVMe over fabric (NVMe-oF).
[0118] Hereinafter, the application server 3100 and the storage server 3200 will be mainly described. The description of the application server 3100 may be applied to another application server 3100n, and the description of the storage server 3200 may be applied to another storage server 3200m.
[0119] The application server 3100 may store data requested to be stored by a user or client in one of the storage servers 3200 to 3200m through the network 3300. In addition, the application server 3100 may obtain data requested to be read by a user or client from one of the storage servers 3200 to 3200m through the network 3300. For example, the application server 3100 may be implemented as a network server or a database management system (DBMS).
[0120] The application server 3100 may access a memory 3120n or a storage device 3150n included in another application server 3100n through the network 3300. Alternatively, the application server 3100 may access a memory 3220 to 3220m or a storage device 3250 to 3250m included in the storage servers 3200 to 3200m through the network 3300. Therefore, the application server 3100 may perform various operations on the data stored in the application servers 3100 to 3100n and / or the storage servers 3200 to 3200m. For example, the application server 3100 may execute an instruction for moving or copying data between the application servers 3100 to 3100n and / or the storage servers 3200 to 3200m. In this case, data may be moved from the storage devices 3250 to 3250m of the storage servers 3200 to 3200m through the storage 3220 to 3220m of the storage servers 3200 to 3200m or directly to the storage 3120 to 3120n of the application servers 3100 to 3100n. The data moved through the network 3300 may be data encrypted for security or privacy.
[0121] Organic Relationship-Interface Structure / Type
[0122] The storage server 3200 will now be described as an example. The interface 3254 can provide a physical connection between the processor 3210 and the controller 3251 and a physical connection between the network interface card (NIC) 3240 and the controller 3251. For example, the interface 3254 can be implemented using a direct attached storage (DAS) solution, where the storage device 3250 is directly connected to a dedicated cable. For example, the interface 3254 can be implemented using various interface solutions, such as ATA, SATA, e-SATA, SCSI, SAS, PCI, PCIe, NVMe, IEEE 1394, USB interface, SD card interface, MMC interface, eMMC interface, UFS interface, eUFS interface, and CF card interface.
[0123] The storage server 3200 may further include a switch 3230 and a network interconnect (NIC) 3240. The switch 3230 may selectively connect the processor 3210 to the storage device 3250 or selectively connect the NIC 3240 to the storage device 3250 via the control of the processor 3210.
[0124] In one embodiment, the NIC 3240 may include a network interface card and a network adapter. The NIC 3240 may be connected to the network 3300 through a wired interface, a wireless interface, a Bluetooth interface, or an optical interface. The NIC 3240 may include an internal memory, a digital signal processor (DSP), and a host bus interface, and is connected to the processor 3210 and / or the switch 3230 through the host bus interface. The host bus interface may be implemented as one of the above examples of the interface 3254. In one embodiment, the NIC 3240 may be integrated with at least one of the processor 3210, the switch 3230, and the storage device 3250.
[0125] Organic Relationship-Interface Operation
[0126] In the storage servers 3200 to 3200m or the application servers 3100 to 3100n, the processor may send a command to the storage devices 3150 to 3150n and 3250 to 3250m or the memories 3120 to 3120n and 3220 to 3220m and program or read data. In this case, the data may be data in which an error is corrected by an ECC engine. The data may be data on which a data bus inversion (DBI) operation or a data masking (DM) operation is performed, and may include cyclic redundancy coding (CRC) information. The data may be data encrypted for security or privacy.
[0127] The storage devices 3150 to 3150n and 3250 to 3250m may send control signals and command / address signals to the NAND flash memory devices 3252 to 3252m in response to a read command received from the processor. Therefore, when data is read from the NAND flash memory devices 3252 to 3252m, a read enable (RE) signal may be input as a data output control signal, and thus, the data may be output to the DQ bus. The data strobe signal DQS may be generated using the RE signal. Depending on the rising edge or falling edge of the write enable (WE) signal, the command and address signals may be latched in the page buffer.
[0128] Product section - Basic operation of SSD
[0129] The controller 3251 may control all operations of the storage device 3250. In one embodiment, the controller 3251 may include an SRAM. The controller 3251 may write data to the NAND flash memory device 3252 in response to a write command, or read data from the NAND flash memory device 3252 in response to a read command. For example, a write command and / or a read command may be provided from a processor 3210 of the storage server 3200, a processor 3210m of another storage server 3200m, or processors 3110 and 3110n of application servers 3100 and 3100n. The DRAM 3253 may temporarily store (or buffer) data to be written to the NAND flash memory device 3252 or data to be read from the NAND flash memory device 3252. And, the DRAM 3253 may store metadata. Here, the metadata may be user data or data generated by the controller 3251 for managing the NAND flash memory device 3252. The storage device 3250 may include a secure element (SE) for security or privacy.
[0130] According to some example embodiments of the present invention, a computer-readable medium is provided, on which computer-executable instructions are stored, and when the instructions are executed, the aforementioned method is performed. Examples of computer-readable media here may include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (e.g., multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0131] According to the exemplary embodiments of the present invention, by retrieving the target data inside the storage device, a large amount of data migration between the host device and the storage device can be avoided, thereby reducing the amount of data movement between the host device and the storage device, reducing the resource usage and bandwidth consumption of the host device and improving the bandwidth utilization, improving the I / O bandwidth within the storage device, reducing the delay in retrieving the target data, and improving the retrieval performance. Therefore, the improved device and method overcome the shortcomings of the traditional device and method for accessing data, especially for obtaining the target data within the storage device, while reducing resource consumption (e.g., processing power, power consumption, bandwidth), improving data accuracy and resource allocation (e.g., delay).
[0132] As described herein, the electronic device and / or its portion according to any of the embodiments in some embodiments may include, may include in and / or may be implemented as one or more instances of a processing circuit such as hardware including a logic circuit, a hardware / software combination such as a processor executing software, or any combination thereof. For example, the processing circuit may more specifically include, but is not limited to, a central processing unit (CPU), an arithmetic logic unit (ALU), a graphics processing unit (GPU), an application processor (AP), a digital signal processor (DSP), a microcomputer, a field programmable gate array (FPGA), a programmable logic unit, a microprocessor, an application specific integrated circuit (ASIC), a neural network processing unit (NPU), an electronic control unit (ECU), an image signal processor (ISP), etc. In some example embodiments, the processing circuit may include: a non-transitory computer-readable storage device (e.g., a memory) storing a program of instructions, such as a DRAM device; a processor (e.g., a CPU) configured to execute a program of instructions to implement the functions and / or methods performed by some or all of any device, system, module, unit, controller, circuit, architecture, and / or its portion according to any of the example embodiments; and / or any portion.
[0133] While the inventive concept has been shown and described with reference to certain particular example embodiments, it will be understood by those skilled in the art that various changes in form and details may be made without departing from the spirit and scope of the inventive concept as defined by the claims and their equivalents.
Claims
1. A host device, comprising: Memory; and A processor configured to: Obtaining query information from a storage device based on a B-tree query request for the table; sending query information to the storage device for storage in a memory of the storage device; Sending a B-tree query request to a storage device to initiate a query for the table on the storage device; Receive the result of the B-tree query request from the storage device.
2. A B-tree based retrieval method performed by a storage device, comprising: receiving and storing in memory query information from a host device; receiving a B-tree query request from a host device to initiate a query for a table; Obtain the result of the B-tree query request by using the query information; Send the result of the B-tree query request to the host device.
3. The B-tree based retrieval method according to claim 2, wherein: The target field of the B-tree query request is a field that is not included in the leaf node of the secondary index of the table.
4. The B-tree based retrieval method as claimed in claim 3, wherein: The query information includes at least one of all fields of the table and their length information, at least one field of the table requested by the B-tree query request, page number information of the root nodes of the primary index and secondary index of the table, and the size of the B-tree page.
5. The B-tree based retrieval method as claimed in claim 4, wherein: The operations for obtaining the results of a B-tree query request include: By using the query information to traverse and retrieve the root page of each root node of the secondary index of the table, a primary key value of the root page of at least one target root node of the table corresponding to the B-tree query request is obtained; The root page of the root node corresponding to the primary key value of the primary index of the table is traversed and retrieved by using the query information to obtain the key value of the target field corresponding to the B-tree query request as a result of the B-tree query request.
6. The B-tree based retrieval method according to claim 5, wherein: The operation of obtaining the primary key value of the root page of at least one target root node of the table corresponding to the B-tree query request includes: Based on all the fields of the table and their length information and the page number information of the root node of the secondary index of the table, the root page of each root node of the secondary index of the table stored in the memory of the storage device is loaded into the memory of the storage device in the size of a B-tree page for retrieval to obtain the primary key value of the root page of the at least one target root node.
7. The B-tree based retrieval method according to claim 5, wherein: The operation of obtaining the key value of the target field corresponding to the B-tree query request as the result of the B-tree query request includes: Based on all the fields of the table and their length information and the page number information of the root node of the primary index of the table, the root pages of the root node corresponding to the primary key value of the primary index of the table stored in the memory of the storage device are loaded into the memory of the storage device in the size of a B-tree page for retrieval to obtain the key value of the target field.
8. The B-tree based retrieval method according to claim 6, further comprising: The primary key values are sorted, and the root pages of the root nodes corresponding to the sorted primary key values are sequentially loaded into the memory of the storage device for retrieval.
9. A storage device comprising: Memory; Memory; and A processor configured to: receiving and storing in memory query information from a host device; receiving a B-tree query request from a host device to initiate a query for a table; Obtain the result of the B-tree query request by using the query information; Send the result of the B-tree query request to the host device.