Data reading method and device, electronic equipment, storage medium and program product
Patent Information
- Application Number
- CN202510220757.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2026-08-28
AI Technical Summary
然而,在基于相关技术维护的映射关系进行数据读取时,存在数据读取效率低,影响业务处理效率的问题
[0019] According to a fifth aspect of this disclosure, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the steps of the method as described in the first aspect.
Smart Images

Figure CN122653522A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data storage, and in particular to a data reading method and apparatus, electronic device, storage medium, and program product. Background Technology
[0002] The actual location used to store data in a storage device is called the physical address. To simplify storage logic and avoid hardware interference, the system usually does not use the physical address directly when reading and writing data, but uses the logical address corresponding to the physical address.
[0003] Therefore, it is necessary to pre-record the mapping relationship between logical addresses and physical addresses, so that when data needs to be read, the physical address where the data is actually stored can be queried based on the logical address of the data.
[0004] In related technologies, the above mapping relationship is typically maintained using a two-level table management method. However, when reading data based on the mapping relationship maintained by these technologies, there is a problem of low data reading efficiency, which affects the efficiency of business processing. Summary of the Invention
[0005] This disclosure provides a data reading method and apparatus, electronic device, storage medium, and program product that can improve data reading efficiency and thus enhance business processing efficiency.
[0006] According to a first aspect of this disclosure, a data reading method is provided, comprising:
[0007] In response to a read command for target data, a target secondary search table containing the logical address of the target data is queried from a primary search table based on the logical address of the target data; the primary search table records the mapping relationship between multiple secondary search tables and their respective logical addresses.
[0008] The physical address corresponding to the logical address of the target data is queried from the target secondary search table, so as to read the target data according to the queried physical address; wherein, the multiple secondary search tables correspond to their respective services, each secondary search table records multiple data search entries involved in its corresponding service, and each search entry records the mapping relationship between the logical address and physical address of the corresponding data.
[0009] According to a second aspect of this disclosure, a data reading device is provided, comprising:
[0010] The first query unit, in response to a read instruction for target data, queries a target secondary search table that records the logical address of the target data from a primary search table, based on the logical address of the target data; the primary search table records the mapping relationship between multiple secondary search tables and their respective logical addresses;
[0011] The second query unit queries the physical address corresponding to the logical address of the target data from the target secondary retrieval table, so as to read the target data according to the queried physical address; wherein, the multiple secondary retrieval tables correspond to their respective services, each secondary retrieval table records multiple data retrieval entries related to its corresponding service, and each retrieval entry records the mapping relationship between the logical address and physical address of the corresponding data.
[0012] According to a third aspect of this disclosure, a data storage structure is provided, comprising:
[0013] The high-speed storage space includes a first area, a second area, and a third area, which are used to preload the original first-level table, the original second-level table, and the newly added first-level table, respectively; among them, after the preloading operation is completed, a portion of the original second-level table is loaded in the second area;
[0014] The low-speed storage space includes a low-performance area and a high-performance area. The low-performance area is used to store the full set of original secondary tables. The high-performance area is used to preload multiple newly added secondary tables. Each newly added secondary table corresponds to a specific business, and each newly added secondary table records multiple data retrieval entries related to its corresponding business. Each retrieval entry records the mapping relationship between the logical address and physical address of the corresponding data.
[0015] According to a fourth aspect of this disclosure, an electronic device is provided, comprising:
[0016] processor;
[0017] Memory used to store processor-executable instructions;
[0018] The processor implements the method as described in the first aspect by running the executable instructions.
[0019] According to a fifth aspect of this disclosure, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the steps of the method as described in the first aspect.
[0020] According to a sixth aspect of this disclosure, an electronic device is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the method as described in the first aspect.
[0021] In the technical solution disclosed herein, each search entry records the mapping relationship between the logical address and physical address of its corresponding data. The secondary search table records search entries for multiple data related to its corresponding business, while the primary search table records the mapping relationship between multiple secondary search tables and their respective logical addresses. Based on this, the primary search table can query the target secondary search table that records the logical address of the target data to be read, and the target secondary search table can query the physical address of the target data.
[0022] It should be understood that the secondary search tables in this disclosure record search entries for multiple data related to their respective business. This is equivalent to recording search entries for data related to a specific business in the same or a few secondary search tables based on the business dimension. Under this premise, when a specific business needs to be executed, since the search entries for data related to the specific business are clustered and maintained in a few secondary search tables, the number of secondary search tables that need to be read during business processing is greatly reduced, improving data reading efficiency and thus improving business processing efficiency. Attached Figure Description
[0023] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0024] Figure 1 This is a flowchart illustrating a data reading method according to an exemplary embodiment of this disclosure;
[0025] Figure 2 This is a schematic diagram illustrating a data storage structure according to an exemplary embodiment of the present disclosure;
[0026] Figure 3 This is a schematic diagram illustrating another data storage structure according to an exemplary embodiment of this disclosure;
[0027] Figure 4 This is a schematic diagram illustrating yet another data storage structure according to an exemplary embodiment of this disclosure;
[0028] Figure 5A This is a flowchart illustrating a preloading of a PSLIM according to an exemplary embodiment of the present disclosure;
[0029] Figure 5B This is a schematic diagram of a search entry in a PSLM, illustrating an exemplary embodiment of the present disclosure;
[0030] Figure 5C This is a schematic diagram of the structure of a PSLM as shown in an exemplary embodiment of the present disclosure;
[0031] Figure 5DThis is a schematic diagram illustrating the content of a Header according to an exemplary embodiment of this disclosure;
[0032] Figure 5E This is a schematic diagram of a B+ tree of a PSLM illustrated in an exemplary embodiment of this disclosure;
[0033] Figure 6 This is a schematic diagram illustrating a data reading logic according to an exemplary embodiment of this disclosure;
[0034] Figure 7 This is a block diagram illustrating a data reading device according to an exemplary embodiment of the present disclosure;
[0035] Figure 8 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0036] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0037] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0038] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0039] Storage devices typically employ a two-level table management approach to maintain the mapping relationship between the logical addresses and physical addresses of stored data.
[0040] In related technologies, the mapping relationship between the logical address and physical address of data is usually constructed and recorded according to the storage order of the data.
[0041] For example, when storing data using append-only (Append) methods, the data can be stored first at a specific physical address, and then logical addresses can be configured sequentially for that physical address, with the mapping relationship between the two recorded. "Sequentially" means that the logical address configured for the current data and the logical address configured for the previous stored data have a structural order. For instance, if the logical address of the previous data is "afhjdfjkl101", then the logical address of this data can be "afhjdfjkl102". It should be noted that this example is merely illustrative, used to illustrate that the construction of logical addresses has an order, and does not represent the actual format of logical addresses.
[0042] In this example, the mapping relationship between the logical address and the physical address of the data is recorded in the second-level table in the storage order, so that each second-level table records the mapping relationship between the logical address and the physical address within a specific logical address range.
[0043] However, when using the above-mentioned two-level table management method to maintain the mapping relationship between logical addresses and physical addresses, the related technology often suffers from low data reading efficiency during business processing, which leads to low business processing efficiency.
[0044] To address this issue, this disclosure proposes a data reading method to avoid the problem of low data reading efficiency and reduced business processing efficiency caused by the two-level table management method used in related technologies.
[0045] Figure 1 This is a flowchart illustrating a data reading method as an exemplary embodiment of the present disclosure. Figure 1 As shown, the method may include the following steps:
[0046] Step 102: In response to the read instruction for the target data, query the target secondary search table that records the logical address of the target data from the primary search table according to the logical address of the target data; the primary search table records the mapping relationship between multiple secondary search tables and their respective logical addresses.
[0047] As can be seen from the above introduction, when the relevant technologies use a two-level table management method to maintain the mapping relationship between the logical address and physical address of the data, they are prone to low data reading efficiency, which in turn affects the efficiency of business processing.
[0048] This disclosure addresses this problem by finding that the underlying issue is that when constructing retrieval tables, related technologies typically build and record the mapping relationships corresponding to the data according to the data storage order, resulting in the address mapping relationships of multiple data involved in the same business being scattered across different secondary tables.
[0049] For example, suppose business A involves data 1, 2, and 3. Processing business A requires reading data 1, 2, and 3 from the storage device. However, in related technologies, because the mapping relationship between the logical addresses and physical addresses of each data item is generated and recorded according to the storage order, the mapping relationship between the logical addresses and physical addresses of data 1, 2, and 3 may be recorded in three separate secondary tables. This results in situations where multiple secondary tables need to be queried during business processing, leading to low data retrieval efficiency and consequently affecting business processing efficiency.
[0050] Therefore, the reason why the aforementioned technologies suffer from low data retrieval efficiency, which in turn affects business processing efficiency, is essentially due to the fact that the generation and recording of mapping relationships are based on the data storage order. In other words, it's because the organization of secondary tables is based on the data storage order.
[0051] Therefore, this disclosure no longer constructs secondary tables in the manner described in related technologies, but instead constructs them based on the business dimension. In other words, the same secondary table constructed in this disclosure records the mapping relationship between the logical addresses and physical addresses of multiple data related to the business corresponding to that secondary table. Under this premise, the mapping relationship of multiple data related to the same business is usually clustered and recorded in the same or a few secondary tables, avoiding the problem in related technologies where data related to the same business is scattered across multiple secondary tables, resulting in a large number of secondary tables that need to be queried during business processing, reducing data reading efficiency, and thus affecting business processing efficiency.
[0052] To facilitate understanding, before providing a detailed description of the technical solutions disclosed herein, the concepts involved in this disclosure will be introduced first.
[0053] In this disclosure, target data refers to the data requested to be read, also known as data to be read. A search entry refers to a mapping relationship between a set of logical addresses and physical addresses, typically corresponding to a single piece of data. A secondary search table refers specifically to a secondary table organized and created in this disclosure based on the business dimension, recording search entries for multiple pieces of data related to its corresponding business. A target secondary search table refers to a secondary search table recording search entries for target data. A primary search table refers to a mapping table used to query which secondary search table the physical address of corresponding data corresponds to, recording the mapping relationship between multiple secondary search tables and their respective corresponding logical addresses.
[0054] It is important to emphasize that any secondary search table can correspond to either a single business or multiple businesses. When corresponding to a single business, all search entries recorded in that secondary search table belong to the same business. However, when corresponding to multiple businesses, all search entries recorded in that secondary search table can correspond to multiple businesses. For example, if the number of search entries that a secondary search table can record is greater than the amount of data involved in a single business, search entries from multiple businesses with smaller data volumes can be recorded together in that secondary search table.
[0055] Of course, the examples given here are merely illustrative. It should be understood that the correspondence between the secondary search tables and business operations in this disclosure is intended to emphasize that the search entries for multiple data items involved in the same business should be recorded in a single or a few secondary search tables as clustered as possible. For example, when the amount of data involved in a business is large, and a single secondary search table cannot record all the entries of the data involved, the entries for multiple data items involved in the business can also be recorded in two secondary search tables. That is, the correspondence between the secondary search tables and the business operations is many to one, and this disclosure does not impose any restrictions on this.
[0056] Step 104: Query the physical address corresponding to the logical address of the target data from the target secondary search table, so as to read the target data according to the queried physical address; wherein, the multiple secondary search tables correspond to their respective services, each secondary search table records the search entries of multiple data involved in its corresponding service, and each search entry records the mapping relationship between the logical address and physical address of the corresponding data.
[0057] In this disclosure, the component used for storing data is referred to as a storage component, which can be any carrier with data storage capabilities. For example, it can be a flash memory device, a database, a system consisting of multiple databases, etc., and this disclosure does not impose any limitations on it.
[0058] In this disclosure, the storage component may include high-speed storage space and low-speed storage space, wherein the former has a faster read and write speed but a smaller storage capacity, while the latter has a slower read and write speed but a larger storage capacity.
[0059] Based on this, this disclosure allows for the pre-loading of a primary lookup table into the high-speed storage space of the storage component. This leverages the high read / write speed of the high-speed storage space to quickly retrieve the target secondary lookup table containing the physical address of the target data from the primary lookup table. Furthermore, when the target secondary lookup table is retrieved from the primary lookup table, this disclosure allows for the use of various methods to query the physical address of the target data within the target secondary lookup table.
[0060] In one embodiment, a target secondary lookup table can be loaded from the low-speed storage space of the storage component to the high-speed storage space, so as to query the physical address corresponding to the logical address of the target data from the target secondary lookup table loaded into the high-speed storage space.
[0061] In this embodiment, the target secondary search table is loaded into the high-speed storage space first, so as to take advantage of the high speed of reading and writing of the high-speed storage space to quickly query the physical address of the target data from the target secondary search table, thereby improving the efficiency of querying the physical address from the secondary search table.
[0062] In another embodiment, a target secondary search table can be determined directly from multiple secondary search tables maintained in the low-speed storage space, so as to query the physical address corresponding to the logical address of the target data from the determined target secondary search table.
[0063] In this embodiment, it is equivalent to directly querying the physical address of the target data in the target secondary retrieval table maintained in the low-speed storage space. Although the query efficiency of the physical address is not as good as the previous embodiment, it reduces the amount of data that needs to be cached in the high-speed storage space, and the load on the high-speed storage space is smaller.
[0064] Of course, the above examples are merely illustrative. The specific method for retrieving the physical address of the target data from the target secondary search table, when such a table is found, can be determined by those skilled in the art based on actual needs. This disclosure does not impose any restrictions on this.
[0065] In this disclosure, the above-mentioned secondary search table can be constructed in various ways.
[0066] In one embodiment, the aforementioned secondary search table can be constructed during data storage. For example, corresponding secondary search tables can be pre-configured for different services so that, during data storage, the mapping relationship between the physical address of the data and the logical address configured for the data is recorded in the secondary search table corresponding to the service to which the data belongs.
[0067] In another embodiment, during data storage, secondary tables can still be constructed according to the methods described in related technologies. This disclosure refers to the secondary tables constructed during storage as original secondary tables, and the primary tables constructed based on the original secondary tables as original primary tables. The original primary tables can record the mapping relationships between multiple original secondary tables and their corresponding logical address ranges. Based on this, new secondary tables can be constructed from the original secondary tables to serve as the aforementioned secondary retrieval tables. Correspondingly, new primary tables constructed from multiple new secondary tables can serve as the aforementioned primary retrieval tables.
[0068] In this embodiment, the original first-level table can be preloaded into the high-speed storage space. Considering the limited storage capacity of the high-speed storage space, only a portion of the original second-level table can be preloaded into the high-speed storage space. Under this premise, when a read instruction for target data is received, the target original second-level table containing the logical address of the target data can be queried from the original first-level table preloaded into the high-speed storage space, based on the logical address of the target data.
[0069] If the original secondary tables preloaded into the high-speed storage space do not contain the target original secondary table, then the operation of querying the target secondary table in the primary search table in response to the read instruction is executed, and then the physical address of the target data is queried from the target secondary table. That is, the operation of querying the target newly added secondary table in the newly added primary table is executed, so as to query the physical address of the target data in the target newly added secondary table.
[0070] In this embodiment, it should be understood that since the original first-level table and part of the original second-level table are preloaded into the high-speed storage space, if the target original second-level table queried from the original first-level table has already been preloaded into the high-speed storage space, that is, if the part of the original second-level table preloaded into the high-speed storage space contains the target original second-level table, then the physical address corresponding to the logical address of the target data can be directly queried in the target original second-level table maintained in the high-speed storage space, thus achieving fast query of the physical address of the target data. The data reading efficiency is inherently high. Therefore, there is no need to read data based on the newly added first-level table and newly added second-level table constructed in this disclosure.
[0071] If the original secondary tables that are preloaded into the high-speed storage space do not contain the target original secondary table, then if the physical address of the target data is still queried from the original secondary table, it means that the target original secondary table needs to be queried from the low-speed storage space and preloaded into the high-speed storage space in order to query the physical address of the target data from there.
[0072] It's worth noting that, because the space allocated for the original second-level tables in high-speed storage is limited in related technologies, and as much of the original second-level tables as possible is typically loaded during preloading, this space is usually filled with the aforementioned portion of the original second-level tables. Therefore, when the target original second-level table has not been preloaded into the high-speed storage, a replacement method is needed to temporarily load the target original second-level table into the high-speed storage. It should be understood that this replacement operation involves unloading or deleting data, as well as uploading data, which significantly impacts the efficiency of physical address queries, i.e., severely affects data reading efficiency.
[0073] However, in this embodiment, if the original secondary table preloaded into the high-speed storage space does not contain the target original secondary table, the physical address of the target data is no longer queried based on the original secondary table. Instead, the target newly added secondary table, which records the physical address of the target data, is queried from the newly added primary table, so as to query the physical address of the target data from the target newly added secondary table.
[0074] It should be understood that this embodiment is equivalent to setting up an additional set of data reading logic for specific scenarios where data reading efficiency is low in the prior art, in order to avoid the problem of low reading efficiency in related technologies under certain scenarios. Specifically, when some of the original secondary tables preloaded into the high-speed storage space do not contain the target original secondary table queried from the original primary table, the physical address of the target data is queried by adding a new primary table and a new secondary table. This avoids the problem of low data reading efficiency caused by the need to perform the original secondary table replacement operation.
[0075] In this embodiment, if the target newly added secondary table is also preloaded into the high-speed storage space for physical address lookup, a region can be reserved in the high-speed storage space for loading the newly added secondary table. Of course, this is only an example of "querying the target newly added secondary table in the high-speed storage space". How to specifically query the target newly added secondary table can be determined by those skilled in the art according to actual needs, and this disclosure does not impose any restrictions on it.
[0076] In this disclosure, the low-speed storage space can contain multiple regions with varying performance. Under this premise, when maintaining the secondary lookup table, the low-speed storage space can record the secondary lookup table in a high-performance region of the low-speed storage space. For example, the low-speed storage space can contain SLC (Single-Level Cell) regions, MLC (Multi-Level Cell) regions, and TLC (Triple-Level Cell) regions. In this case, newly added secondary tables can be recorded in the SLC region.
[0077] It should be understood that because high-performance areas have stronger read and write performance compared to other areas in low-speed storage, data retrieval efficiency can be improved regardless of which method is used to query the physical address of target data from the secondary lookup table. For example, when loading the target secondary lookup table into high-speed storage for querying, the stronger read and write performance of the high-performance area can improve the efficiency of loading the target secondary lookup table from low-speed storage to high-speed storage; similarly, when querying directly in low-speed storage, since the target secondary lookup table is recorded in the high-performance area, its stronger read and write performance can also be utilized to improve the efficiency of querying the physical address of target data from the target secondary lookup table.
[0078] In this disclosure, the secondary search tables maintained in the high-performance region can be updated to ensure the timeliness of the search entries maintained in the secondary search tables. For example, an LRU (Least Recently Used) mechanism can be used for updates. In this case, the query frequency of each secondary search table within a specific time period can be counted. If the frequency is lower than a preset frequency, the secondary search table is deleted, and a new secondary search table is created and written to the high-performance region. For instance, if a specific business is frequently run but no corresponding secondary search table is recorded, a new secondary search table can be created based on that business and written to the high-performance region.
[0079] Of course, the above examples are merely illustrative. If the reading efficiency of the target secondary search table is not considered, the secondary search table can also be recorded in the regular area. How to maintain the secondary search table in low-speed storage space can be determined by those skilled in the art according to actual needs, and this disclosure does not impose any restrictions on it.
[0080] It should be noted that when the secondary retrieval table is a newly added secondary table, the original secondary table used to construct the newly added secondary table can also be updated using the LRU mechanism, and this disclosure does not restrict this.
[0081] In this disclosure, the above-mentioned secondary search table can be constructed in various ways.
[0082] For example, when the secondary retrieval table is the newly added secondary table mentioned above, a new secondary table can be constructed based on the original secondary table to serve as the secondary retrieval table. For instance, if the original primary table and original secondary tables constructed during data storage are collectively referred to as the primary retrieval table, then retrieval entries corresponding to the data of the service to be configured can be selected from each of the original secondary tables included in the primary retrieval table to construct a new secondary table corresponding to the service to be configured. This new secondary table can then serve as the secondary retrieval table corresponding to the service to be configured. Furthermore, if multiple new secondary tables are constructed in this way, a new primary table can be constructed based on these multiple new secondary tables, and then used as the primary retrieval table mentioned above.
[0083] For example, when constructing a secondary search table directly based on the stored data during the data storage process, the search entries for each data item can be recorded in the search table corresponding to each business according to the business to which the stored data belongs, thereby forming a secondary search table corresponding to each business.
[0084] Of course, this example is merely illustrative. How to construct the above-mentioned secondary search table can be determined by those skilled in the art based on actual needs, and this disclosure does not impose any restrictions on it.
[0085] In this disclosure, the operation of constructing the secondary search table described above can be performed at different times according to actual needs. For example, it can be performed when the associated electronic device starts up, when the application starts up, or even when a business execution instruction is received; this disclosure does not impose any restrictions on this.
[0086] It should be emphasized that the implementing entity of the technical solution disclosed herein can be any type of electronic device. For example, the electronic device can be a mobile terminal such as a smartphone or tablet computer, or a fixed terminal such as a smart TV or PC (personal computer). It should be understood that any electronic device equipped with a storage component with data storage function can serve as the implementing entity of this disclosure. The specific type of electronic device used as the implementing entity of the technical solution disclosed herein can be determined by those skilled in the art based on actual needs, and this disclosure does not impose any restrictions in this regard.
[0087] It should also be emphasized that, for some storage components with built-in controllers, the implementing entity of this disclosure can also be the controller included in the storage component, rather than a specific electronic device. Whether this disclosure is applied to a specific electronic device or to the controller of the storage component can be determined by those skilled in the art based on actual needs. For example, if a flash memory device has a built-in controller, when the flash memory device is assembled into any electronic device, the technical solution of this disclosure can be applied to either the controller of the flash memory device or the electronic device assembled with the flash memory device. This disclosure does not impose any limitations in this regard.
[0088] As can be seen from the above technical solution, the multiple secondary search tables in this disclosure correspond to their respective services. Each secondary search table records the search entries for data related to its corresponding service, and the primary search table records the mapping relationship between the multiple secondary search tables and their respective logical addresses. Under this premise, this disclosure can query the target secondary search table that records the logical address of the target data in the primary search table, and query the physical address of the target data in the target secondary search table.
[0089] It should be understood that this disclosure is equivalent to organizing the data retrieval entries into a secondary retrieval table based on the business dimension, so that the retrieval entries of multiple data involved in the same business are concentrated in a single or a few secondary tables as much as possible. Therefore, this disclosure can significantly reduce the number of secondary tables that need to be queried when reading data during business processing, and avoid the problem in related technologies where the retrieval entries of data involved in the business are scattered in multiple secondary tables, resulting in low data reading efficiency and affecting business processing efficiency.
[0090] As mentioned earlier, when using the secondary table management method in related technologies to maintain the mapping relationship between logical addresses and physical addresses, if the original secondary table containing the target data is not preloaded into the high-speed storage space, the original secondary table that has been preloaded into the high-speed storage space needs to be replaced with the target original secondary table that contains the physical address of the target data in order to query the physical address of the target data in the high-speed storage space.
[0091] In this situation, the technical solution of this disclosure can be adopted to avoid the problem of low data reading efficiency caused by needing to replace the original secondary table in the high-speed storage space. To achieve this purpose, this disclosure also proposes a data storage structure for implementing the data reading logic of this disclosure.
[0092] Figure 2 This is a schematic diagram illustrating a data storage structure as an exemplary embodiment of the present disclosure. Figure 2 As shown, the data storage structure includes:
[0093] The high-speed storage space 21 includes a first area 211, a second area 212, and a third area 213, which are used to preload the original first-level table, the original second-level table, and the newly added first-level table, respectively; among them, after the preloading operation is completed, the second area 212 is loaded with a portion of the original second-level table.
[0094] The low-speed storage space 22 includes a low-performance area 221 and a high-performance area 222. The low-performance area 221 is used to store the full set of original secondary tables. The high-performance area 222 is used to preload multiple newly added secondary tables. Each newly added secondary table corresponds to its own business, and each newly added secondary table records multiple data retrieval entries related to its corresponding business. Each retrieval entry records the mapping relationship between the logical address and physical address of the corresponding data.
[0095] In this embodiment, multiple cache areas for preloading retrieval tables can be pre-divided in the high-speed storage space 21 to meet the preloading requirements of different retrieval tables. For example, both the original first-level table and the newly added first-level table are used to realize the function of querying the second-level table based on the logical address. Therefore, in order to improve the efficiency of querying the second-level table, preloading areas can be divided for it, namely the first area 211 and the third area 213, to meet the requirements of preloading two first-level tables.
[0096] Correspondingly, to improve the query speed of physical addresses, as much of the original secondary tables as possible is preloaded into the high-speed storage space 21. Therefore, a preloading area, namely the second area 212 mentioned above, is also allocated for the original secondary tables within the high-speed storage space 21. It should be noted that, in order to preload as much of the original secondary tables as possible into the high-speed storage space 21, the second area 212 allocated for the original secondary tables is usually relatively large. However, due to the capacity limitation of the high-speed storage space 21, this second area 212 can usually only preload a portion of the full original secondary tables.
[0097] In this embodiment, the low-speed storage space 22 may include a low-performance region 221 and a high-performance region 222. The low-performance region 221 may maintain all original secondary tables, while the high-performance region 222 may pre-load multiple newly added secondary tables. As mentioned earlier, each newly added secondary table may correspond to its respective service and record multiple data retrieval entries related to that service. Each retrieval entry records the mapping relationship between the logical address and physical address of the corresponding data.
[0098] As mentioned above, the newly added secondary table can be created either by classifying and recording the data according to the business to which the data belongs during the data storage process, or by selecting and reorganizing the search entries from the original secondary table according to the business after the data storage is completed. This embodiment does not impose any restrictions on this.
[0099] Based on the above data storage structure, data can be read according to the data reading logic of this disclosed technical solution. That is, if the target original second-level table obtained from the original first-level table has been preloaded into the high-speed storage space 21, the physical address of the target data can be directly queried from the target original second-level table; if the target original second-level table has not been preloaded into the high-speed storage space 21, the newly added first-level table is queried to determine the target newly added second-level table that records the physical address of the target data, and the physical address of the target data is queried from the target newly added second-level table. As mentioned above, in this case, the target newly added second-level table can either be loaded into the high-speed storage space 21 before querying, or it can be queried directly in the low-speed storage space 22. This embodiment does not limit this.
[0100] To facilitate understanding, we will use flash memory devices as an example to introduce the improvements to the above storage structure, and based on this, introduce the improvements to the data reading logic:
[0101] I. Improvements in Storage Structure
[0102] Flash memory devices primarily consist of two storage spaces: DRAM and NAND. DRAM stands for Dynamic Random Access Memory, which is volatile, meaning that all data stored on it is lost when the power is turned off. It boasts high read and write speeds and is often used as cache or main memory, but its capacity is typically small and its price is higher. NAND, on the other hand, is flash memory, which is non-volatile. It retains data even when power is off, making it ideal for long-term data storage. It offers large capacity, but its read and write speeds are slower than DRAM.
[0103] During data storage, a two-level table management approach can be used to construct the original retrieval table. This original retrieval table can contain two parts, namely... Figure 3 The image shows an flm and multiple slms, where the former is the original first-level table mentioned above, and the latter is the original second-level table mentioned earlier. For example... Figure 3 As shown, a specific area, the Table Block area, is designated within the NAND flash memory as the storage space for the SLM (Search Engine Module), containing the full SLM data. It's important to note that the raw data of the FLIM (Film Module) is also stored in the NAND flash memory, but it is not shown in the diagram.
[0104] To facilitate data retrieval, a preloading operation can be performed on the data retrieval table. Preloading means loading the data retrieval table into DRAM in advance to improve data query efficiency. For example... Figure 3 As shown, a cache space called Slm Block for caching Slm can be pre-allocated in DRAM. Based on this, a preloading operation can be performed to preload the flm and slm into DRAM. However, due to the capacity limitation of DRAM, only a portion of the slm can be preloaded into DRAM, and the rest cannot be loaded into DRAM.
[0105] Based on this storage structure, related technologies are prone to problems when performing data queries, such as the SLM to be queried not being preloaded into DRAM, which requires SLM replacement and affects query efficiency.
[0106] For example, suppose the SLMs preloaded into DRAM include SLMs 1 through 5, and the target data to be queried is data X. Then, we can first search for the target SLM corresponding to the logical address of data X in the FLM. Suppose the target SLM found is SLM7. Since SLMs 1 through 5 do not contain SLM7, we need to find SLM7 in NAND and load it into DRAM. However, since the SLM Block is full, we need to replace one of SLMs 1 through 5 with SLM7. For example, we can delete SLM5 and then load SLM7 into the SLM Block. This replacement operation involves SLM deletion and SLM loading, which greatly reduces the data query efficiency. Moreover, since the replacement operation deletes part of the preloaded SLMs, it also affects subsequent data queries. For example, the next data to be read may be recorded in SLM5.
[0107] It is important to emphasize that business processing typically involves large amounts of data, and multiple data points related to the same business are highly likely to be distributed across multiple SLMs, increasing the probability that the retrieval entries for the data to be read have not been preloaded into DRAM. In other words, the aforementioned situation of replacing preloaded SLMs occurs frequently during business processing.
[0108] Based on this, this disclosure proposes Figure 2 The new data storage structure shown, when applied to flash memory devices, allows the data storage structure to be as follows: Figure 4 As shown, DRAM in Figure 3 Based on the structure shown, an additional area is allocated for preloading pflm, which is the newly added first-level table mentioned above. In NAND, an additional SLC area (i.e., the high-performance area mentioned above), namely the Pre-load Block area in the figure, is allocated for preloading pslm, which is the newly added second-level table mentioned above.
[0109] The operation of preloading PSLAM in the Pre-load Block area can be performed at any time as needed. It can be performed when the device starts up, or for example, when the service is executed. This embodiment does not limit this.
[0110] It should be noted that before preloading, the parameters related to preloading need to be configured first.
[0111] For example, if a flash memory device is used as a storage device for an electronic device, then that electronic device can be considered the host device for the flash memory device. Therefore, when the flash memory device is initially connected to the host, preload parameters can be configured. These parameters can include the size of the pre-load block, the size of the plsm cache, and the caching strategy, etc. For example, it can be shown in Table 1 below:
[0112] Pre-load config log
[0113] Pre-load Block Capacity Pre-load SLM Capacity Pre-load SLM cache policy
[0114] Table 1
[0115] In this table, Pre-load config log is the pre-load configuration log, Pre-load BlockCapacity is the capacity of the pre-load block, Pre-load slm Capacity is the capacity of the pre-loaded slm, and Pre-load slm cache policy is the caching policy for the pre-loaded slm.
[0116] It is worth noting that the Pre-load SLM Capacity limit defines the capacity of the SLM, which also limits the capacity of the original SLM and the reconstructed PSLM. These capacities are typically set to be the same to maintain consistency. The Pre-load SLM cache policy, on the other hand, defines the caching strategy, which includes policies set for the SLM and policies set for the PSLM.
[0117] Once the configuration is complete, the preloading operation can be performed. The preloading process for PSM can be found in [reference needed]. Figure 5A This includes the following steps:
[0118] Step 501A: Receive service information for the service to be configured;
[0119] In this embodiment, when the device starts up, it can send service information of the service to be configured to the flash memory device so that the flash memory device can generate a PSLM based on the received service information.
[0120] Step 502A: Select search entries from slm based on business information.
[0121] In this embodiment, after obtaining the service information to be configured, multiple search entries belonging to the same service can be filtered out from the search entries of each slm record contained in the Table Block and recombined into a PSLM.
[0122] For example, Figure 4 The entries marked with different shaded lines in each SLM are the search entries selected from them for reorganization into a PSLM.
[0123] Step 503A: Reorganize the search entries related to the same business into a PSLM.
[0124] Step 504A: Write the reconstituted pslm into the Pre-load Block.
[0125] In this embodiment, after the PSLM is reassembled, it can be preloaded into the Pre-load Block so that when the SLM preloaded into DRAM does not contain the target SLM, the physical address of the target data can be queried from the PSLM.
[0126] It should be noted that since NAND flash memory is a non-volatile storage medium, although the PSLM is written into the Pre-load Block using a pre-loading process, the written PSLM can be stored there for a long time.
[0127] After preloading is complete, any retrieval entry recorded in any PSLIM can be retrieved as follows: Figure 5B As shown, a search entry can be labeled as an Entry. If the LBA (Logical Block Address) of search entries recorded together is a consecutive logical address, the LBA of the first Entry and the number of search entries with an order relationship can be recorded directly. For example, if there are N consecutive logical addresses of Entries, Entry0 can be recorded directly as LBA address and LBAlength to represent the logical addresses of Entry0 to N.
[0128] To further improve the speed of querying logical addresses in a PSLM, a B+ tree organizational structure can be used for recording. In this case, the structure of any PSLM can be as follows: Figure 5C Each entry in this PSLIM contains a header and data (Dada). The header records the logical address of the data, while the content recorded in the header can be... Figure 5D As shown, it can include the root node, left node, right node, and whether the right node is contiguous in the B+ tree for the Entry to which the Header belongs. For example, Figure 5D The `continue` keyword in `Entry` signifies continuity, meaning that the right child of the current entry contains only the right child. For example, the structure of any PSLM's B+ tree can be as follows: Figure 5E As shown, the so-called continuous state of the right node refers to... Figure 5EThe state shown within the dashed circle indicates that the child nodes of the right node only include the right-side nodes, not the left-side nodes. Based on this, the entry corresponding to the LBA of the target data can be queried in the PSLAM's B+ tree. For example, the LBA of the target data can be compared with the LBAs of various nodes. If the LBA of the target data is smaller, the query continues to the left-side nodes; if it is larger, the query continues to the right-side nodes, until the LBA of the target data is found. Of course, this is only an example of using a B+ tree to record search entries in the PSLAM. The specific tree structure or other types of structures used to record search entries in the PSLAM can be determined by those skilled in the art according to actual needs, and this disclosure does not impose any restrictions on this.
[0129] After preloading the PSLIM, the PFFLM can be constructed based on the logical addresses recorded in each PSLIM to record the mapping relationship between logical addresses and PSLIMs. Once constructed, the PFFLM can be preloaded into DRAM, thus forming... Figure 4 The data structure shown.
[0130] In obtaining Figure 4 Based on the data structure shown, the data reading logic of the technical solution disclosed herein can be executed.
[0131] II. Data Reading Logic
[0132] As described above, based on the aforementioned data structure, if the target SLM obtained from the PLM query has been preloaded into DRAM, the physical address of the target data can be directly queried from the target SLM; if the target SLM has not been preloaded into DRAM, the PFLM is queried to determine the target PSLM that records the physical address of the target data, and the physical address of the target data is then queried from the target PSLM.
[0133] Below, in conjunction with Figure 4 The data storage structure shown is illustrated below. Taking "reading the above data X" as an example, the logic for reading this data will be explained in detail.
[0134] Figure 6 This is a schematic diagram illustrating a data reading logic as an exemplary embodiment of this disclosure. Figure 6 As shown, the method may include the following steps:
[0135] Step 601: Received read instruction for data X.
[0136] In this implementation, the read instruction may include the logical address of data X for use in querying the physical address.
[0137] Step 602: Query flm based on the logical address of data X.
[0138] In this embodiment, the flm records the correspondence between each slm and its corresponding logical address range. Therefore, this step can first determine the range to which the logical address of data X belongs, so as to determine which slm the logical address of data X is recorded in based on the range, and then determine it as the target slm.
[0139] Step 603: Determine whether the queried target slm is in the slm block; if yes, proceed to step 604; otherwise, proceed to step 605.
[0140] Following the previous example of "preloaded slms to DRAM include slm1 to 5", if the target slm found by querying the logical address of data X is slm1, then since slm1 has been preloaded into the Slm Block, the physical address of data X can be directly queried in slm1 within the Slm Block. If the target slm found by querying the logical address of data X is slm7, then since slm7 has not been loaded into DRAM, the physical address of the target data is not queried by querying the slm, but by querying the pflm and pslm.
[0141] Step 604: Query the physical address of data X in the target slm recorded in the Slm Block.
[0142] Step 605: Query pflm based on the logical address of data X.
[0143] Following the example above, you can query the target PSLM containing the physical address of data X in the DRAM's PFLM.
[0144] Step 606: Load the queried target PSM from the Pre-load Block into DRAM.
[0145] In this embodiment, a region can be reserved in DRAM for loading the target PSLM. For example, a fourth region can be further divided based on the first, second, and third regions mentioned above for loading the target PSLM.
[0146] Continuing with the example above, assuming the target PSLM is PSLM1, PSLM1 in the Pre-load Block can be loaded into DRAM to retrieve PSLM1 in DRAM and obtain the physical address corresponding to the logical address of the target data.
[0147] Step 607: Query the physical address of the target data in the target PSLM loaded into DRAM.
[0148] As can be seen from the above technical solution, when the original secondary table containing the physical address of the target data is preloaded, the physical address of the target data is directly queried from the original secondary table; while when the original secondary table containing the target data is not preloaded, the physical address of the target data is queried based on the newly added secondary table. This avoids the problem of low data reading efficiency caused by needing to replace the preloaded original secondary table when the original secondary table is not preloaded.
[0149] As can be seen, when using the data query logic of this disclosure to perform data query, regardless of whether the target original secondary table containing the physical address of the target data can be found in the pre-loaded original secondary table, the physical address of the target data can be efficiently queried, thereby ensuring efficient data reading.
[0150] Figure 7 This is a block diagram illustrating a data reading device according to an exemplary embodiment of this disclosure. (Refer to...) Figure 7 The device includes a first query unit 701 and a second query unit 702.
[0151] The first query unit 701, in response to a read instruction for target data, queries a target secondary query table from a primary query table that records the logical address of the target data, based on the logical address of the target data; the primary query table records the mapping relationship between multiple secondary query tables and their respective logical addresses;
[0152] The second query unit 702 queries the target secondary retrieval table for the physical address corresponding to the logical address of the target data, so as to read the target data according to the queried physical address; wherein, the multiple secondary retrieval tables correspond to their respective services, each secondary retrieval table records the retrieval entries of multiple data involved in its corresponding service, and each retrieval entry records the mapping relationship between the logical address and physical address of the corresponding data.
[0153] Optionally, the plurality of secondary retrieval tables are newly added secondary tables obtained based on the original secondary tables, and the primary retrieval table is a newly added primary table constructed based on the plurality of newly added secondary tables; the first query unit 701 is also used for:
[0154] In response to the read instruction, based on the logical address of the target data, the target original second-level table that records the logical address of the target data is queried from the original first-level table in the high-speed storage space preloaded into the storage component; the original first-level table records the mapping relationship between multiple original second-level tables and their respective corresponding logical address ranges;
[0155] In cases where the target original secondary table is not included in a portion of the original secondary tables preloaded into the high-speed storage space, an operation is performed to query the target secondary search table in the primary search table in response to the read instruction.
[0156] Optionally, the second query unit 702 is also used for:
[0157] If the target original secondary table is included in a portion of the original secondary tables preloaded into the high-speed storage space, the physical address corresponding to the logical address of the target data is queried in the target original secondary table maintained in the high-speed storage space.
[0158] Optionally, the primary lookup table is preloaded into the high-speed storage space of the storage component; the second query unit 702 is further used for:
[0159] If the target secondary search table is found from the primary search table, the target secondary search table is loaded from the low-speed storage space of the storage component to the high-speed storage space, so as to query the physical address corresponding to the logical address of the target data from the target secondary search table loaded into the high-speed storage space; or...
[0160] If the target secondary search table is found in the primary search table, the target secondary search table is determined from the multiple secondary search tables maintained in the low-speed storage space, so as to query the physical address corresponding to the logical address of the target data from the determined target secondary search table.
[0161] Optionally, the secondary lookup table maintained in the low-speed storage space of the storage component is recorded in the high-performance area of the low-speed storage space.
[0162] Optionally, the secondary search table maintained in the high-performance region is updated based on the LRU mechanism.
[0163] Optional, also includes:
[0164] Construction unit 703 selects search entries corresponding to the data involved in the service to be configured from each original secondary table contained in the original search table, and uses these entries to construct a new secondary table corresponding to the service to be configured, which serves as the secondary search table corresponding to the service to be configured; and, if multiple new secondary tables are constructed, a new primary table is constructed based on the multiple new secondary tables, which serves as the primary search table.
[0165] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0166] Accordingly, this disclosure also provides a data reading device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the data reading method as described in any of the above embodiments, for example, the method may include: in response to a reading instruction for target data, querying a target secondary search table recording the logical address of the target data from a primary search table according to the logical address of the target data; the primary search table recording a mapping relationship between multiple secondary search tables and their respective corresponding logical addresses; querying a physical address corresponding to the logical address of the target data from the target secondary search table, so as to read the target data according to the queried physical address; wherein the multiple secondary search tables correspond to their respective targeted services, each secondary search table recording a search entry for multiple data involved in its corresponding service, and each search entry recording a mapping relationship between the logical address and physical address of the corresponding data.
[0167] Accordingly, this disclosure also provides an electronic device, which includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors. The programs include instructions for implementing the data reading method as described in any of the above embodiments. For example, the method may include: responding to a reading instruction for target data, querying a target secondary search table from a primary search table that records the logical address of the target data, based on the logical address of the target data; the primary search table records a mapping relationship between multiple secondary search tables and their respective corresponding logical addresses; querying the physical address corresponding to the logical address of the target data from the target secondary search table, so as to read the target data based on the queried physical address; wherein the multiple secondary search tables correspond to their respective target services, each secondary search table records search entries for multiple data related to its corresponding service, and each search entry records a mapping relationship between the logical address and physical address of the corresponding data.
[0168] Accordingly, this disclosure also provides a computer program product, which includes a computer program / instruction. When executed by a processor, the computer program / instruction implements the data reading method as described in any of the above embodiments. For example, the method may include: responding to a reading instruction for target data, querying a target secondary search table that records the logical address of the target data from a primary search table; the primary search table records a mapping relationship between multiple secondary search tables and their respective corresponding logical addresses; querying the physical address corresponding to the logical address of the target data from the target secondary search table, so as to read the target data according to the queried physical address; wherein, the multiple secondary search tables correspond to their respective target services, each secondary search table records a search entry for multiple data involved in its corresponding service, and each search entry records a mapping relationship between the logical address and physical address of the corresponding data.
[0169] Figure 8 This is a block diagram illustrating an apparatus 800 for implementing a data reading method according to an exemplary embodiment. For example, apparatus 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0170] Reference Figure 8 The device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0171] Processing component 802 typically controls the overall operation of device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0172] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0173] Power supply component 806 provides power to various components of device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 800.
[0174] Multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0175] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0176] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0177] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of device 800. For example, sensor assembly 814 may detect the on / off state of device 800, the relative positioning of components such as the display and keypad of device 800, changes in the position of device 800 or a component of device 800, the presence or absence of user contact with device 800, the orientation or acceleration / deceleration of device 800, and temperature changes of device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0178] Communication component 816 is configured to facilitate wired or wireless communication between device 800 and other devices. Device 800 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G LTE, 5G NR (New Radio), or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0179] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0180] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of the device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0181] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0182] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
[0183] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A data reading method, characterized in that, include: In response to a read command for target data, the system queries a target secondary search table containing the logical address of the target data from the primary search table, based on the logical address of the target data. The primary search table records the mapping relationship between multiple secondary search tables and their corresponding logical addresses; The physical address corresponding to the logical address of the target data is queried from the target secondary search table, so as to read the target data according to the queried physical address; wherein, the multiple secondary search tables correspond to their respective services, each secondary search table records multiple data search entries involved in its corresponding service, and each search entry records the mapping relationship between the logical address and physical address of the corresponding data.
2. The method according to claim 1, characterized in that, The multiple secondary search tables are newly added secondary tables obtained based on the original secondary tables, and the primary search table is a newly added primary table constructed based on the multiple newly added secondary tables; The method further includes: in response to the read instruction, querying a target primary secondary table that records the logical address of the target data in a primary primary table of a high-speed storage space preloaded into the storage component, based on the logical address of the target data; the primary primary table records a mapping relationship between multiple primary secondary tables and their respective corresponding logical address ranges; In cases where the target original secondary table is not included in a portion of the original secondary tables preloaded into the high-speed storage space, an operation is performed to query the target secondary search table in the primary search table in response to the read instruction.
3. The method according to claim 2, characterized in that, Also includes: If the target original secondary table is included in a portion of the original secondary tables preloaded into the high-speed storage space, the physical address corresponding to the logical address of the target data is queried in the target original secondary table maintained in the high-speed storage space.
4. The method according to claim 1, characterized in that, The primary search table is preloaded into the high-speed storage space of the storage component; the step of querying the physical address corresponding to the logical address of the target data from the secondary search table includes: If the target secondary search table is found from the primary search table, the target secondary search table is loaded from the low-speed storage space of the storage component to the high-speed storage space, so as to query the physical address corresponding to the logical address of the target data from the target secondary search table loaded into the high-speed storage space; or... If the target secondary search table is found in the primary search table, the target secondary search table is determined from the multiple secondary search tables maintained in the low-speed storage space, so as to query the physical address corresponding to the logical address of the target data from the determined target secondary search table.
5. The method according to claim 2 or 4, characterized in that, The secondary lookup table maintained in the low-speed storage space of the storage component is recorded in the high-performance area of the low-speed storage space.
6. The method according to claim 5, characterized in that, The secondary search table maintained in the high-performance region is updated based on the LRU mechanism.
7. The method according to claim 1, characterized in that, The method further includes: From the original secondary tables contained in the original search table, select search entries that correspond to the data involved in the service to be configured, and use them to construct a new secondary table corresponding to the service to be configured, so as to serve as the secondary search table corresponding to the service to be configured. If multiple new secondary tables are constructed, a new primary table is constructed based on these multiple new secondary tables to serve as the primary retrieval table.
8. A data storage structure, characterized in that, include: The high-speed storage space includes a first area, a second area, and a third area, which are used to preload the original first-level table, the original second-level table, and the newly added first-level table, respectively; among them, after the preloading operation is completed, a portion of the original second-level table is loaded in the second area; The low-speed storage space includes a low-performance area and a high-performance area. The low-performance area is used to store the full set of original secondary tables. The high-performance area is used to preload multiple newly added secondary tables. Each newly added secondary table corresponds to a specific business, and each newly added secondary table records multiple data retrieval entries related to its corresponding business. Each retrieval entry records the mapping relationship between the logical address and physical address of the corresponding data.
9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor implements the method as described in any one of claims 1-7 by executing the executable instructions.
10. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1-7.
11. A computer program product, characterized in that, Includes a computer program / instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 7.