CN111459919B - Data query method, loading component, searching component and storage medium - Google Patents

Data query method, loading component, searching component and storage medium Download PDF

Info

Publication number
CN111459919B
CN111459919B CN202010337214.3A CN202010337214A CN111459919B CN 111459919 B CN111459919 B CN 111459919B CN 202010337214 A CN202010337214 A CN 202010337214A CN 111459919 B CN111459919 B CN 111459919B
Authority
CN
China
Prior art keywords
data
information
mapping table
searched
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010337214.3A
Other languages
Chinese (zh)
Other versions
CN111459919A (en
Inventor
胡伟
高晟昊
邓羽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Biwin Storage Technology Co Ltd
Original Assignee
Biwin Storage Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Biwin Storage Technology Co Ltd filed Critical Biwin Storage Technology Co Ltd
Priority to CN202010337214.3A priority Critical patent/CN111459919B/en
Publication of CN111459919A publication Critical patent/CN111459919A/en
Application granted granted Critical
Publication of CN111459919B publication Critical patent/CN111459919B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Fuzzy Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data query method, a loading component, a searching component and a storage medium, wherein the data query method comprises the following steps: the loading component finds the address to be loaded corresponding to the block to be recovered in the first-level mapping table from the second-level mapping table, loads first-level mapping data from the address to be loaded in the first-level mapping table as data to be searched, distributes the data to be searched to a plurality of searching components according to preset capacity, and the plurality of searching components process the received data to be searched concurrently to obtain all effective physical address information, and provides an output data register for CPU to read the effective physical address information and then complete the movement of the effective data. The embodiment of the invention realizes the query part of the relocation GC scheme through the loading component and the searching component, and reduces the participation of the CPU through the cooperative processing of the loading component and the searching components at the same time, thereby achieving the concurrent effect of the loading component, the searching component and the CPU and greatly improving the data relocation efficiency.

Description

Data query method, loading component, searching component and storage medium
Technical Field
The present invention relates to the field of storage data management technologies, and in particular, to a data query method, a loading component, a searching component, and a storage medium.
Background
The currently prevailing mobile GC (garbage collection ) scheme includes the following steps:
1. Searching for valid PAA (physical au address, physical address) information from a large number of mapping tables;
2. Reading data of a valid PAA position;
3. Writing a new block (block) to finish data relocation;
When step 1 is executed, the SSD (Solid STATE DISK or Solid STATE DRIVE) needs to find the reference relation with the block stripe to be recycled from a large number of mapping tables; for example, a 256-GB SSD typically maps logical pages of 4KB in size, and therefore its primary map size=256 GB/4KB is PAA size, where PAA size is typically 4Bytes, i.e. the address pointing to 4KB of user data, i.e. the primary map size is 256MB. Because the size of the primary mapping table is too large, when the data to be migrated needs to be found from the primary mapping table, the primary mapping table of 256MB needs to be searched by a CPU (centralprocessing unit ), which affects the performance of the CPU and has low migration efficiency.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: a data query method, a loading component, a searching component and a storage medium are provided, and data relocation efficiency is improved.
In order to solve the technical problems, the invention adopts the following technical scheme:
a data query method comprising the steps of:
receiving information of a block to be recovered and data to be searched sent by a loading component, wherein the data to be searched is primary mapping data which is found by the loading component from a secondary mapping table and corresponds to the information of the block to be recovered, the primary mapping data is data stored in the primary mapping table, the primary mapping table stores a mapping relation between a logical page address and a physical page address, and the secondary mapping table stores a mapping relation between a secondary storage address and a primary storage address of the primary mapping table;
Obtaining effective physical address information according to the data to be searched and the block information to be recovered;
storing all the effective physical address information into an output data register, wherein the output data register is used for completing the relocation of effective data after the CPU reads the effective physical address information.
In order to solve the technical problems, the invention adopts another technical scheme that:
a data query method comprising the steps of:
Receiving block information to be recovered, and finding an address to be loaded corresponding to the block information to be recovered from a secondary mapping table, wherein the address to be loaded is a primary storage address of a primary mapping table, the primary mapping table stores the mapping relation between a logical page address and a physical page address, and the secondary mapping table stores the mapping relation between the secondary storage address and the primary storage address of the primary mapping table;
Loading data to be searched from the address to be loaded, wherein the data to be searched is first-level mapping data stored in a first-level mapping table;
Distributing the data to be searched to a plurality of search components one by one according to preset capacity, wherein the data to be searched is used for providing effective physical address information for a CPU to read and move the effective data by the search components which are processed in parallel.
In order to solve the technical problems, the invention adopts another technical scheme that:
a search component comprising:
the input block register is used for receiving the information of the block to be recovered;
The input data register is used for receiving data to be searched sent by the loading component, the data to be searched is first-level mapping data which is found by the loading component from a second-level mapping table and corresponds to the block information to be recovered, the first-level mapping data is data stored in the first-level mapping table, the first-level mapping table stores the mapping relation between a logical page address and a physical page address, and the second-level mapping table stores the mapping relation between a second-level storage address and a first-level storage address of the first-level mapping table;
The first processor is used for obtaining effective physical address information according to the data to be searched and the block information to be recovered, and storing all the effective physical address information to an output data register;
The output data register is used for completing the relocation of the effective data after the CPU reads the effective physical address information.
In order to solve the technical problems, the invention adopts another technical scheme that:
A loading assembly, comprising:
The receiving module is used for receiving the block information to be recovered, finding out an address to be loaded corresponding to the block information to be recovered from a secondary mapping table, wherein the address to be loaded is a primary storage address of a primary mapping table, the primary mapping table stores the mapping relation between a logical page address and a physical page address, and the secondary mapping table stores the mapping relation between the secondary storage address and the primary storage address of the primary mapping table;
the loading module is used for loading data to be searched from the address to be loaded, wherein the data to be searched is first-level mapping data stored in a first-level mapping table;
the sending module is used for distributing the data to be searched to a plurality of searching components one by one according to preset capacity, and the searching components for the data to be searched for a plurality of parallel processing provide effective physical address information for the CPU to read and move the effective data.
In order to solve the technical problems, the invention adopts another technical scheme that:
a computer-readable storage medium having stored thereon a computer program having stored thereon the data query method described above.
In order to solve the technical problems, the invention adopts another technical scheme that:
A search component comprises a first memory, a first processor and a first computer program stored in the first memory and capable of running on the first processor, wherein the first processor realizes the data query method when executing the first computer program.
In order to solve the technical problems, the invention adopts another technical scheme that:
The loading assembly comprises a second memory, a second processor and a second computer program stored in the second memory and capable of running on the second processor, and is characterized in that the second processor realizes the data query method when executing the second computer program.
The invention has the beneficial effects that: the loading component finds the address to be loaded corresponding to the block to be recovered in the first-level mapping table from the second-level mapping table, loads first-level mapping data from the address to be loaded in the first-level mapping table as data to be searched, distributes the data to be searched to a plurality of searching components one by one according to preset capacity, processes the received data to be searched by the plurality of searching components concurrently to obtain all effective physical address information, and provides an output data register for CPU to read the effective physical address information and then finish the movement of the effective data. The query part of the mobile GC scheme is realized through the loading component and the searching component, so that the participation of a CPU is reduced, and the effect that the loading component and the searching component are integrated with the CPU is achieved; and simultaneously, one loading component and a plurality of searching components are cooperatively processed, so that each searching component in parallel processing only needs to complete preset capacity, and a concurrent effect can be achieved between the loading component and the searching component, thereby greatly improving the data relocation efficiency.
Drawings
FIG. 1 is a flow chart of a data query method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the overall structure of an SSD according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a data structure of a single physical address according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating the matching of a loading component and a search component according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the overall structure of a loader assembly according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating a process of obtaining an address to be loaded according to index information and a secondary mapping table according to an embodiment of the present invention;
Fig. 7 is a schematic diagram of a process of obtaining effective physical address information according to data to be searched and the block information to be recycled according to an embodiment of the present invention;
FIG. 8 is a flowchart of a data query method according to another embodiment of the present invention;
FIG. 9 is a schematic hardware structure of a search component according to another embodiment of the present invention;
FIG. 10 is a schematic diagram of a hardware configuration of a loading component according to another embodiment of the present invention;
FIG. 11 is a schematic software architecture of a search component according to another embodiment of the present invention;
FIG. 12 is a schematic diagram of a software architecture of a loading component according to another embodiment of the present invention.
Description of the reference numerals:
1. a search component; 11. an input block register; 12. an input data register; 13. a first processor; 14. an output data register; 15. a first memory; 2. loading the assembly; 21. a receiving module; 22. loading a module; 23. a transmitting module; 24. a second processor; 25. and a second memory.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1 to 7, an embodiment of the present invention provides a data query method, including the steps of:
receiving information of a block to be recovered and data to be searched sent by a loading component, wherein the data to be searched is primary mapping data which is found by the loading component from a secondary mapping table and corresponds to the information of the block to be recovered, the primary mapping data is data stored in the primary mapping table, the primary mapping table stores a mapping relation between a logical page address and a physical page address, and the secondary mapping table stores a mapping relation between a secondary storage address and a primary storage address of the primary mapping table;
Obtaining effective physical address information according to the data to be searched and the block information to be recovered;
storing all the effective physical address information into an output data register, wherein the output data register is used for completing the relocation of effective data after the CPU reads the effective physical address information.
From the above description, the beneficial effects of the invention are as follows: the loading component finds the address to be loaded corresponding to the block to be recovered in the first-level mapping table from the second-level mapping table, loads first-level mapping data from the address to be loaded in the first-level mapping table as data to be searched, distributes the data to be searched to a plurality of searching components one by one according to preset capacity, processes the received data to be searched by the plurality of searching components concurrently to obtain all effective physical address information, and provides an output data register for CPU to read the effective physical address information and then complete the moving of the effective data. The query part of the mobile GC scheme is realized through the loading component and the searching component, so that the participation of a CPU is reduced, and the effect that the loading component and the searching component are integrated with the CPU is achieved; and simultaneously, one loading component and a plurality of searching components are cooperatively processed, so that each searching component in parallel processing only needs to complete preset capacity, and a concurrent effect can be achieved between the loading component and the searching component, thereby greatly improving the data relocation efficiency.
Further, the obtaining effective physical address information according to the data to be searched and the block information to be recovered specifically includes the following steps:
acquiring the information of the blocks to be recovered and an input mask corresponding to the information of the blocks to be recovered;
performing bit and on each piece of physical address information in the data to be searched and the input mask to obtain block information of each piece of physical address information in the data to be searched;
Exclusive-or is carried out on the block information of each piece of physical address information in the data to be searched and the block information to be recovered;
And taking all physical address information with the exclusive OR result of 0 in the data to be searched as effective physical address information.
As can be seen from the above description, the block information of each physical address information in the data to be searched is obtained by bitwise and of the input mask corresponding to the block information to be recovered, and when the block information to be recovered and the block information of each physical address information in the data to be searched are equal, the exclusive or result of two equal values is 0, so if the exclusive or result of two block information is 0, it is indicated that the physical address information is on the block. The physical address information in the first mapping table indicates that there is a mapping, that is, the data in the physical address information in the first mapping table is valid data, so that all physical address information with the exclusive or result of 0 is used as valid physical address information, and thus the valid physical address information is quickly and accurately searched.
Further, after storing all the effective physical address information, the method further comprises the following steps:
Counting the quantity of all the effective physical address information to an output quantity register, wherein the output quantity register is used for CPU reading quantity.
From the above description, it can be seen that by counting the number of all effective physical address information, the data length can be known when the CPU invokes the data, so that a storage space with a proper size is allocated for the effective data to be migrated at this time.
Referring to fig. 2 to 8, another embodiment of the present invention provides a data query method, which includes the steps of:
Receiving block information to be recovered, and finding an address to be loaded corresponding to the block information to be recovered from a secondary mapping table, wherein the address to be loaded is a primary storage address of a primary mapping table, the primary mapping table stores the mapping relation between a logical page address and a physical page address, and the secondary mapping table stores the mapping relation between the secondary storage address and the primary storage address of the primary mapping table;
Loading data to be searched from the address to be loaded, wherein the data to be searched is first-level mapping data stored in a first-level mapping table;
Distributing the data to be searched to a plurality of search components one by one according to preset capacity, wherein the data to be searched is used for providing effective physical address information for a CPU to read and move the effective data by the search components which are processed in parallel.
From the above description, the beneficial effects of the invention are as follows: the loading component finds the address to be loaded corresponding to the block to be recovered in the first-level mapping table from the second-level mapping table, loads first-level mapping data from the address to be loaded in the first-level mapping table as data to be searched, distributes the data to be searched to a plurality of searching components one by one according to preset capacity, processes the received data to be searched by the plurality of searching components concurrently to obtain all effective physical address information, and provides an output data register for CPU to read the effective physical address information and then complete the moving of the effective data. The query part of the mobile GC scheme is realized through the loading component and the searching component, so that the participation of a CPU is reduced, and the effect that the loading component and the searching component are integrated with the CPU is achieved; and simultaneously, one loading component and a plurality of searching components are cooperatively processed, so that each searching component in parallel processing only needs to complete preset capacity, and a concurrent effect can be achieved between the loading component and the searching component, thereby greatly improving the data relocation efficiency.
Further, the finding the address to be loaded corresponding to the block information to be recovered from the secondary mapping table specifically includes the following steps:
and obtaining index information corresponding to the block information to be recovered, reading an address to be loaded on a corresponding bit of the secondary mapping table according to a bit with data of 1 in the index information, and storing a secondary mapping table item index referenced by each block according to the bit in the index information.
As is apparent from the above description, when information is written, the mapping relationship between the logical page address and the physical page address is written in the primary mapping table, the mapping relationship between the primary storage address and the secondary storage address is written in the secondary mapping table, and the written block is written in the index information corresponding to the written block, for example, the index information is written in 1 on the corresponding bit written in the secondary storage address, so that the primary mapping data corresponding to the block information to be recovered can be quickly found through the index information when searching is performed subsequently.
Another embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program having stored thereon the data query method of the above embodiment.
Referring to fig. 9, another embodiment of the present invention provides a search module 1, including:
the input block register 11 is used for receiving the block information to be recovered;
The input data register 12 is configured to receive data to be searched sent by a loading component, where the data to be searched is first-level mapping data that is found by the loading component 2 from a second-level mapping table and corresponds to the block information to be recovered, the first-level mapping data is data stored in the first-level mapping table, the first-level mapping table stores a mapping relationship between a logical page address and a physical page address, and the second-level mapping table stores a mapping relationship between a second-level storage address and a first-level storage address of the first-level mapping table;
the first processor 13 is configured to obtain effective physical address information according to the data to be searched and the block information to be recovered, and store all the effective physical address information into the output data register 14;
the output data register 14 is used for completing the relocation of the valid data after the CPU reads the valid physical address information.
With respect to the specific procedures and corresponding effects achieved by the input block register 11, the input data register 12, the first processor 13 and the output data register 14, reference may be made to the relevant descriptions in the data query methods of the embodiments of fig. 1 to 7 described above.
Referring to fig. 10, another embodiment of the present invention provides a loading assembly 2, including:
The receiving module 21 is configured to receive block information to be recovered, and find an address to be loaded corresponding to the block information to be recovered from a second-level mapping table, where the address to be loaded is a first-level storage address of a first-level mapping table, the first-level mapping table stores a mapping relationship between a logical page address and a physical page address, and the second-level mapping table stores a mapping relationship between the second-level storage address and the first-level storage address of the first-level mapping table;
The loading module 22 is configured to load data to be searched from the address to be loaded, where the data to be searched is first-level mapping data stored in a first-level mapping table;
The sending module 23 is configured to allocate the data to be searched to the plurality of search modules 1 one by one according to a preset capacity, where the search modules 1 for the plurality of parallel processing of the data to be searched provide effective physical address information for the CPU to read and move the effective data.
With respect to the specific procedures and corresponding effects implemented by the receiving module 21, the loading module 22 and the sending module 23, reference may be made to the relevant descriptions in the data query methods of the embodiments of fig. 2 to 8.
Another embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program having stored thereon the data query method described above.
With respect to the specific implementation procedure and corresponding effect of the data query method included in the computer program in the present embodiment, reference may be made to the description related to the data query method in the above-described embodiments (including the embodiments of fig. 1 to 7 and the embodiments of fig. 2 to 8).
Referring to fig. 11, another embodiment of the present invention provides a search module 1, which includes a first memory 15, a first processor 13, and a first computer program stored in the first memory 15 and capable of running on the first processor 13, wherein the first processor 13 implements the data query method according to the embodiments of fig. 1 to 7 when executing the first computer program.
With respect to the specific implementation procedure and corresponding effect of the data query method implemented by the first processor 13 in this embodiment, reference may be made to the description related to the data query method in the embodiment of fig. 1 to 7.
Referring to fig. 12, another embodiment of the present invention provides a loading component 2, which includes a second memory 25, a second processor 24, and a second computer program stored in the second memory 25 and capable of running on the second processor 24, wherein the second processor 24 implements the data query method according to the embodiments of fig. 2 to 8 when executing the second computer program.
With respect to the specific implementation procedure and corresponding effect of the data query method implemented by the second processor 24 in this embodiment, reference may be made to the related descriptions in the data query method in the embodiments of fig. 2 to 8.
The data query method and the corresponding loading component, searching component and storage medium are mainly applied to application scenes for searching effective physical address information in the moving type GC scheme, and are explained below with reference to specific application scenes:
According to the above, and referring to fig. 1 to 7, a first embodiment of the present invention is:
a data query method comprising the steps of:
S21, receiving information of a block to be recovered and data to be searched sent by a loading component, wherein the data to be searched is first-level mapping data corresponding to the information of the block to be recovered, which is found by the loading component from a second-level mapping table;
Specifically, in order to understand the present embodiment, the following description is first made on the implementation basis in the present embodiment: assuming that the SSD of 256GB is used in the present embodiment, the calculation formula of the primary mapping table is that the primary mapping table size=256 GB/4KB is the primary mapping table PAA size, and the primary mapping table PAA (physical au address, physical address) size in the above formula is generally 4Bytes, that is, the address pointing to the 4KB user data; thereby obtaining a first-level mapping table size of 256MB; since the size of the primary mapping table is too large to be resident in the sram (Static Random-Access Memory), the algorithm complexity is reduced by the secondary mapping table in this embodiment;
Where secondary map size=256 MB/4KB secondary map entry PAA size. The PAA size of the secondary mapping table entry in the above formula is typically 4Bytes, i.e. the storage address pointing to the 4KB primary mapping table; the size of the secondary mapping table calculated in this way is 256KB, namely 64K secondary mapping table entries are contained;
As shown in fig. 2, in this embodiment, the effective data in the block N needs to be recovered in a 256GB SSD, where the channel/cell/die/(particle) plane parameters in the SSD are 2/2/1/2, respectively. And the data length of each PAA is 32bits, the information contained in the 32bits is shown in fig. 3, wherein the block information is located between bits 16-24, and the input mask is 0x1ff0000.
In this embodiment, in order to distinguish between the mapping data and the storage addresses in different mapping tables, the data stored in the primary mapping table is collectively named as primary mapping data, the storage addresses of the primary mapping table are collectively named as primary storage addresses, and the storage addresses of the secondary mapping table are collectively named as secondary storage addresses, so that the mapping relationship between the logical page address and the physical page address is stored in the primary mapping table, and the mapping relationship between the secondary storage address and the primary storage address of the primary mapping table is stored in the secondary mapping table.
In this embodiment, the loading component uses the first-level mapping data corresponding to the block information to be recovered obtained by the index information and the second-level mapping table as the data to be searched, and the specific implementation process of obtaining the data to be searched by the loading component can look up the second embodiment, but it should be noted that in this embodiment, since the index information stores the index of the second-level mapping table item referenced by each block according to bits, the index information corresponding to the block information to be recovered can be quickly located to which of the first-level storage addresses corresponding to the second-level storage addresses in the second-level mapping table correspond to the block information to be recovered, so that the data to be searched can be quickly obtained. As shown in fig. 6, when the bit of the index information is 1, the primary storage address stored in the corresponding bit of the secondary mapping table is extracted, and the primary storage addresses paan, paa4 and paa are obtained as shown in fig. 6.
S22, obtaining effective physical address information according to the data to be searched and the block information to be recovered;
specifically, as shown in fig. 4, when the search component obtains the data to be searched with the preset capacity, searching the data to be searched is started, and as an example, each search component contains 4KB of data to be searched at this time, and when the data to be searched obtained by the loading data is greater than 4KB, the loading component allocates the data to be searched to a plurality of search components in idle states for concurrent processing. Of course, the preset capacity can be 8KB, and the like, and the built-in space of the search component is the search data of 8 KB.
For each search component, only the data to be searched in the storage space is needed to be searched. In the searching process, the searching component receives the block information to be recovered and obtains the corresponding input mask, wherein the input mask is the above-mentioned 0x1ff0000, and the original block information of the block N is 0x111, and the original block information of the block N should be configured as 0x1110000 to be used as the block information to be recovered.
As shown in fig. 5, the search component includes a Switch register Switch for starting a search process, an Input Block register Input Block for receiving the Block information to be reclaimed, an Input Data register Input Data for receiving the Data to be searched transmitted by the load component, an Input Mask register Input Mask for receiving an Input Mask corresponding to the Block information to be reclaimed, an Input number register InputCnt configured to have a preset capacity of 4KB, a first processor SEARCH ENGINE as processing Data, a Status register Status for reporting an idle state after the search is completed, a move Output Data register Output Data for completing the effective Data after the CPU reads the effective physical address information, and an Output number register Output Cnt for the CPU to read the number.
At this time, the searching component performs bit-wise and on each physical address information in the data to be searched and the input mask to obtain Block information of each physical address information in the data to be searched, and performs exclusive-or on the Block information of each physical address information in the data to be searched and the Block information to be recovered, i.e., ((PAA & input_mask)/(input_block) = 0). As shown in fig. 7, in the present embodiment, the final exclusive or result of the physical addresses PAA1 and PAA4 and the block information to be recovered 0x1110000 is 0, and then all the physical address information PAA1 and PAA4 with the exclusive or result of 0 in the data to be searched are used as the effective physical address information.
S23, storing all effective physical address information into an output data register, counting the quantity of all the effective physical address information into an output quantity register, wherein the output data register is used for completing the movement of effective data after the CPU reads the effective physical address information, and the output quantity register is used for the CPU to read the quantity.
In this embodiment, the number of the effective physical address information includes PAA1 and PAA4 is 2, so that the CPU does not participate in the query operation, and only needs to read the number and the effective physical address information from the output number register and the output data register respectively to complete the relocation of the effective data, that is, the query part of the relocation GC scheme is realized through the loading component and the searching component, the participation of the CPU is reduced, and the effect that the loading component and the searching component are concurrent with the CPU is achieved, so as to improve the data relocation efficiency.
In addition, when a block needs to be recovered, all blocks located on the same stripe are recovered, where all blocks located on the same stripe are collectively referred to as the block stripe, i.e. the block stripe, and at this time, the block information to be recovered may include a plurality of block information. It is understood that the block information to be recycled in the present embodiment is not limited to a single block information, but may be a plurality of block information, depending on how much block information needs to be recycled.
It should be noted that, for the present embodiment, the capacity and structure of the SSD, the data length and structure of each PAA, the block information to be recovered and the corresponding input mask are set for convenience of description, and in other equivalent embodiments, the capacity of the SSD is 128GB or the parameters of the channel/cell/die/(particle) plane are 2/3/1/2 or the block information to be recovered is 0x 010000, respectively, as long as the values are within the existing reasonable range.
According to the above, and referring to fig. 2 to 8, a second embodiment of the present invention is:
A data query method corresponds to the data query method in the first embodiment, in which the loading component is used as an execution body, specifically including the following steps:
s11, receiving block information to be recovered, and finding an address to be loaded corresponding to the block information to be recovered from a second-level mapping table, wherein the address to be loaded is a first-level storage address of a first-level mapping table;
Specifically, in this embodiment, when information is written, the mapping relationship between the logical page address and the physical page address is written in the primary mapping table, the mapping relationship between the primary storage address and the secondary storage address is written in the secondary mapping table, and the written block is written in the index information corresponding to the written block, for example, 1 is written in the corresponding bit written in the secondary storage address in the index information in fig. 6, so when the loading component needs to obtain the address to be loaded corresponding to the block information to be recovered, the loading component finds the corresponding bit on the secondary mapping table according to the bit 1 on the index information to directly extract the primary storage address, thereby realizing quick indexing, and meanwhile, it is not required to traverse which entries in the secondary mapping table are related to the block information to be recovered, and only needs to know which entries according to which bits in the index information corresponding to the block information to be recovered are 1.
S12, loading data to be searched from an address to be loaded, wherein the data to be searched is first-level mapping data stored in a first-level mapping table;
That is, in this embodiment, when the primary storage address is known, the data to be searched corresponding to the block information to be recovered may be loaded from the primary storage address, as shown in fig. 6, that is, the data to be searched stored on paan, paa4 and paa are loaded;
s13, distributing the data to be searched to a plurality of search components one by one according to the preset capacity, wherein the data to be searched is used for providing effective physical address information for the search components to read and move the effective data by the CPU.
Specifically, if the preset capacity is 4KB, the data to be searched may be divided into 4 parts of 4KB data to be searched and sent to four search components respectively, or the 4KB data to be searched may be allocated to two search components first, after the searching is completed, the remaining two parts are allocated according to the number of search components connected with the loading component, in principle, the data to be searched with the preset capacity is allocated to each search component in sequence, if the number of search components is relatively large, part of the search components do not participate in the search at this time, and if the number of search components is relatively small, multiple searches such as two rounds, three rounds and the like may need to be performed. However, in any case, the process of concurrent processing of the data to be searched with preset capacity by the plurality of search components is faster and more accurate than that of the process of completing searching of all data by a single search component, so that the data relocation efficiency is improved.
It should be noted that, in this embodiment, only whether the index information corresponding to each block is written is recorded, if a physical page address on the block is written, and then a new mapping is written, the index information corresponding to the block is 1 in bit, but in the first-level mapping table, the data on the physical page address information corresponding to the block is invalid data, that is, whether the physical page address exists in the first-level mapping table, so as to determine whether the data on the physical page address corresponding to each block is valid data.
Referring to fig. 9, a third embodiment of the present invention is a search module 1 corresponding to the data query method in the first embodiment, including:
the input block register 11 is used for receiving the block information to be recovered;
The input data register 12 is configured to receive data to be searched sent by the loading component, where the data to be searched is first-level mapping data that is found by the loading component 2 from a second-level mapping table and corresponds to the block information to be recovered, the first-level mapping data is data stored in the first-level mapping table, a mapping relationship between a logical page address and a physical page address is stored in the first-level mapping table, and a mapping relationship between a second-level storage address and a first-level storage address of the first-level mapping table is stored in the second-level mapping table;
the first processor 13 is configured to obtain effective physical address information according to the data to be searched and the block information to be recovered, and store all the effective physical address information into the output data register 14;
The output data register 14 is used for completing the relocation of the effective data after the CPU reads the effective physical address information.
Referring to fig. 10, a fourth embodiment of the present invention is a loading component 2 corresponding to the data query method in the first embodiment, including:
the receiving module 21 is configured to receive the block information to be recovered, find an address to be loaded corresponding to the block information to be recovered from the second mapping table, where the address to be loaded is a first-level storage address of the first mapping table, the first-level mapping table stores a mapping relationship between a logical page address and a physical page address, and the second mapping table stores a mapping relationship between the second-level storage address and a first-level storage address of the first mapping table;
The loading module 22 is configured to load data to be searched from an address to be loaded, where the data to be searched is first-level mapping data stored in the first-level mapping table;
The sending module 23 is configured to allocate data to be searched to the plurality of search modules 1 one by one according to a preset capacity, where the search modules 1 for which the data to be searched are used for a plurality of parallel processes provide effective physical address information for the CPU to read and move the effective data.
A fifth embodiment of the present invention is a computer-readable storage medium corresponding to the data query method in the first or second embodiment, on which a computer program is stored, the computer program storing the data query method in the first or second embodiment.
Referring to fig. 11, a search module 1 corresponding to the data query method in the first embodiment of the present invention includes a first memory 15, a first processor 13, and a first computer program stored in the first memory 15 and capable of running on the first processor 13, wherein the first processor 13 implements the data query method in the first embodiment of the present invention when executing the first computer program.
Referring to fig. 12, a seventh embodiment of the present invention is a loading component 2 corresponding to the data query method in the second embodiment, which includes a second memory 25, a second processor 24, and a second computer program stored in the second memory 25 and capable of running on the second processor 24, wherein the second processor 24 implements the data query method in the second embodiment when executing the second computer program.
In the seven embodiments provided in the present application, it should be understood that the disclosed methods, components and storage media may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple components or modules may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with respect to each other may be an indirect coupling or communication connection via some interfaces, devices or components or modules, which may be in electrical, mechanical, or other forms.
The components illustrated as separate components may or may not be physically separate, and components shown as components may or may not be physical modules, i.e., may be located in one place, or may be distributed over multiple network modules. Some or all of the components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each component may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
The integrated modules, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present invention is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all required for the present invention.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
In summary, according to the data query method, the loading component, the searching component and the storage medium provided by the invention, the loading component rapidly finds the address to be loaded corresponding to the block to be recovered in the primary mapping table through the secondary mapping table and the index information, the primary mapping data is loaded from the address to be loaded in the primary mapping table as the data to be searched, the data to be searched is distributed to the searching components according to the preset capacity, the searching components concurrently process the received data to be searched, the block information of each physical address information in the data to be searched is obtained through bit and by the input mask corresponding to the block information to be recovered, so that the effective physical address information is rapidly and accurately searched, and the output data register and the output quantity register are provided for completing the movement of the effective data after the CPU reads the effective physical address information. The query part of the mobile GC scheme is realized through the loading component and the searching component, so that the participation of a CPU is reduced, and the effect that the loading component and the searching component are integrated with the CPU is achieved; and simultaneously, one loading component and a plurality of searching components are cooperatively processed, so that each searching component in parallel processing only needs to complete preset capacity, and a concurrent effect can be achieved between the loading component and the searching component, thereby greatly improving the data relocation efficiency.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.

Claims (9)

1. A method of querying data, comprising the steps of:
Receiving information of a block to be recovered and data to be searched sent by a loading component, wherein the data to be searched is first-level mapping data corresponding to the information of the block to be recovered, which is obtained by the loading component according to index information and a second-level mapping table, the first-level mapping data is data stored in the first-level mapping table, the first-level mapping table stores a mapping relation between a logical page address and a physical page address, the second-level mapping table stores a mapping relation between a second-level storage address and the first-level storage address of the first-level mapping table, the index information stores a second-level mapping table item index quoted by each block according to bits, and the index information corresponding to the information of the block to be recovered is searched to locate the first-level storage address corresponding to the information of the block to be recovered on the second-level storage address in the second-level mapping table;
Obtaining effective physical address information according to the data to be searched and the block information to be recovered;
storing all the effective physical address information into an output data register, wherein the output data register is used for completing the relocation of effective data after the CPU reads the effective physical address information.
2. The method for querying data according to claim 1, wherein the obtaining effective physical address information according to the data to be searched and the block information to be retrieved specifically comprises the following steps:
acquiring the information of the blocks to be recovered and an input mask corresponding to the information of the blocks to be recovered;
performing bit and on each piece of physical address information in the data to be searched and the input mask to obtain block information of each piece of physical address information in the data to be searched;
Exclusive-or is carried out on the block information of each piece of physical address information in the data to be searched and the block information to be recovered;
And taking all physical address information with the exclusive OR result of 0 in the data to be searched as effective physical address information.
3. A data query method as claimed in claim 1, wherein said storing all said valid physical address information is followed by the steps of:
Counting the quantity of all the effective physical address information to an output quantity register, wherein the output quantity register is used for CPU reading quantity.
4. A method of querying data, comprising the steps of:
Receiving block information to be recovered, and finding an address to be loaded corresponding to the block information to be recovered from a secondary mapping table, wherein the address to be loaded is a primary storage address of a primary mapping table, the primary mapping table stores the mapping relation between a logical page address and a physical page address, and the secondary mapping table stores the mapping relation between the secondary storage address and the primary storage address of the primary mapping table;
Loading data to be searched from the address to be loaded, wherein the data to be searched is first-level mapping data stored in a first-level mapping table;
Distributing the data to be searched to a plurality of search components one by one according to preset capacity, wherein the data to be searched is used for providing effective physical address information for a CPU to read and move the effective data by the search components which are processed in parallel;
the finding the address to be loaded corresponding to the block information to be recovered from the secondary mapping table specifically includes the following steps:
and obtaining index information corresponding to the block information to be recovered, reading an address to be loaded on a corresponding bit of the secondary mapping table according to a bit with data of 1 in the index information, and storing a secondary mapping table item index referenced by each block according to the bit in the index information.
5. A search assembly, comprising:
the input block register is used for receiving the information of the block to be recovered;
The input data register is used for receiving data to be searched sent by the loading component, the data to be searched is first-level mapping data corresponding to the block information to be recovered, which is obtained by the loading component according to index information and a second-level mapping table, the first-level mapping data is data stored in the first-level mapping table, the first-level mapping table stores mapping relation between logical page addresses and physical page addresses, the second-level mapping table stores mapping relation between second-level storage addresses and first-level storage addresses of the first-level mapping table, the index information stores a second-level mapping table item index referenced by each block according to bits, and the index information corresponding to the block information to be recovered is searched to locate the first-level storage address corresponding to the block information to be recovered on the second-level storage address in the second-level mapping table;
The first processor is used for obtaining effective physical address information according to the data to be searched and the block information to be recovered, and storing all the effective physical address information to an output data register;
The output data register is used for completing the relocation of the effective data after the CPU reads the effective physical address information.
6. A loading assembly, comprising:
The receiving module is used for receiving the block information to be recovered, finding out an address to be loaded corresponding to the block information to be recovered from a secondary mapping table, wherein the address to be loaded is a primary storage address of a primary mapping table, the primary mapping table stores the mapping relation between a logical page address and a physical page address, and the secondary mapping table stores the mapping relation between the secondary storage address and the primary storage address of the primary mapping table;
the finding the address to be loaded corresponding to the block information to be recovered from the secondary mapping table specifically includes the following steps: acquiring index information corresponding to the block information to be recovered, reading an address to be loaded on a corresponding bit of the secondary mapping table according to a bit with data of 1 in the index information, and storing a secondary mapping table item index referenced by each block according to the bit in the index information;
the loading module is used for loading data to be searched from the address to be loaded, wherein the data to be searched is first-level mapping data stored in a first-level mapping table;
the sending module is used for distributing the data to be searched to a plurality of searching components one by one according to preset capacity, and the searching components for the data to be searched for a plurality of parallel processing provide effective physical address information for the CPU to read and move the effective data.
7. A computer-readable storage medium having stored thereon a computer program, characterized by: the computer program stores a data query method as claimed in any one of claims 1 to 4.
8. A search component comprising a first memory, a first processor and a first computer program stored on the first memory and executable on the first processor, wherein the first processor implements the data query method of any of claims 1-3 when executing the first computer program.
9. A loading assembly comprising a second memory, a second processor and a second computer program stored on the second memory and executable on the second processor, wherein the second processor implements the data query method of claim 4 when executing the second computer program.
CN202010337214.3A 2020-04-26 2020-04-26 Data query method, loading component, searching component and storage medium Active CN111459919B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010337214.3A CN111459919B (en) 2020-04-26 2020-04-26 Data query method, loading component, searching component and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010337214.3A CN111459919B (en) 2020-04-26 2020-04-26 Data query method, loading component, searching component and storage medium

Publications (2)

Publication Number Publication Date
CN111459919A CN111459919A (en) 2020-07-28
CN111459919B true CN111459919B (en) 2024-06-11

Family

ID=71681110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010337214.3A Active CN111459919B (en) 2020-04-26 2020-04-26 Data query method, loading component, searching component and storage medium

Country Status (1)

Country Link
CN (1) CN111459919B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100091B (en) * 2020-09-17 2024-06-11 深圳佰维存储科技股份有限公司 Two-level mapping table data mapping method and device, storage medium and electronic equipment
CN112486861B (en) * 2020-11-30 2024-05-14 深圳忆联信息***有限公司 Solid state disk mapping table data query method and device, computer equipment and storage medium
CN112835520A (en) * 2021-01-29 2021-05-25 深圳忆联信息***有限公司 Mapping table dynamic loading-based read request processing method and device
CN114625935A (en) * 2022-02-28 2022-06-14 深圳市世强元件网络有限公司 Scene search method and system
CN114595486B (en) * 2022-05-10 2022-08-05 深圳佰维存储科技股份有限公司 Zero data identification method and device, readable storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744798A (en) * 2013-12-17 2014-04-23 记忆科技(深圳)有限公司 Garbage recycling method of solid state discs
CN105243025A (en) * 2015-09-25 2016-01-13 联想(北京)有限公司 Mapping table forming and loading methods and electronic device
WO2017054737A1 (en) * 2015-09-30 2017-04-06 华为技术有限公司 Address mapping method and device based on mass solid-state storage
CN108415851A (en) * 2018-01-18 2018-08-17 珠海全志科技股份有限公司 A kind of method and apparatus for promoting flash memory device and starting speed

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744798A (en) * 2013-12-17 2014-04-23 记忆科技(深圳)有限公司 Garbage recycling method of solid state discs
CN105243025A (en) * 2015-09-25 2016-01-13 联想(北京)有限公司 Mapping table forming and loading methods and electronic device
WO2017054737A1 (en) * 2015-09-30 2017-04-06 华为技术有限公司 Address mapping method and device based on mass solid-state storage
CN108415851A (en) * 2018-01-18 2018-08-17 珠海全志科技股份有限公司 A kind of method and apparatus for promoting flash memory device and starting speed

Also Published As

Publication number Publication date
CN111459919A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN111459919B (en) Data query method, loading component, searching component and storage medium
CN108804350B (en) Memory access method and computer system
US11874815B2 (en) Key-value storage device and method of operating the same
CN102725752B (en) Method and device for processing dirty data
US10416900B2 (en) Technologies for addressing data in a memory
JP6147933B2 (en) Controller, flash memory device, method for identifying data block stability, and method for storing data in flash memory device
US11237980B2 (en) File page table management technology
US20100228914A1 (en) Data caching system and method for implementing large capacity cache
US7870122B2 (en) Self-tuning index for flash-based databases
CN111832065A (en) Software implemented using circuitry and method for key-value storage
CN105917303B (en) Controller, method for identifying stability of data block and storage system
CN113253926A (en) Memory internal index construction method for improving query and memory performance of novel memory
CN113835639B (en) I/O request processing method, device, equipment and readable storage medium
CN107590077B (en) Spark load memory access behavior tracking method and device
CN111831691A (en) Data reading and writing method and device, electronic equipment and storage medium
CN115934583B (en) Hierarchical caching method, device and system
CN115658588B (en) ID compression device and method of AXI bus
CN107765992B (en) Method and device for processing data
CN111651400B (en) Storage space access method and system with matching query index structure
CN115344201A (en) Data storage method, data query method and device
CN111796757B (en) Solid state disk cache region management method and device
CN113126908A (en) Storage device configured to support multi-streaming and method of operating the same
CN108139980A (en) For merging the method for storage page and memory pooling function
US12038852B2 (en) Partial logical-to-physical (L2P) address translation table for multiple namespaces
CN116383098B (en) Address indexing method and device, readable storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 518000 floors 1-3 and 4 of buildings 4 and 8, zone 2, Zhongguan honghualing Industrial South Zone, No. 1213 Liuxian Avenue, Pingshan community, Taoyuan Street, Nanshan District, Shenzhen, Guangdong

Applicant after: BIWIN STORAGE TECHNOLOGY Co.,Ltd.

Address before: 518000 1st, 2nd, 4th and 6th floors of No.4 factory building of tongfuyu industrial city, Taoyuan Street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: BIWIN STORAGE TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant