Storage device processing method, host device, storage device and system
By dividing the storage blocks of the storage device into multiple resource pools and using characteristic types for data management, the problem of low data processing efficiency of the storage device is solved and the effect of improving data processing efficiency is achieved.
Patent Information
- Application Number
- CN202110984080.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-25
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-08-25
AI Technical Summary
Existing storage devices have low efficiency in data processing, especially in data storage, reading and retrieval operations. The processing efficiency is not high when large amounts of data need to be retrieved.
Divide the storage blocks of the storage device into multiple resource pools, each resource pool corresponding to a feature type, respond to the preset processing command, and use the resource pool corresponding to the feature type to be processed to perform preset processing on the data to be processed.
By separately managing and processing data of different characteristic types, the amount of data queries is reduced and the processing efficiency of the storage device is improved.
Smart Images

Figure CN113835622B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a storage device processing method, a host device, a storage device, and a storage device processing system. Background Art
[0002] With the rapid development and widespread application of computer technologies such as artificial intelligence, the Internet, cloud computing, and the Internet of Things, data has exploded, and users have higher and higher requirements for data storage, and the demand for faster and more convenient storage devices is also increasing. For example, solid state drives (SSDs) have the advantages of high performance, low power consumption, small size, large capacity, better stability and reliability, and are therefore widely used.
[0003] At present, the development of artificial intelligence mainly relies on the improvement of computer performance and the advancement of algorithms, but it is also inseparable from the storage and retrieval of data. In the process of processing data using storage devices, such as storing, reading, retrieving and other processing operations on data, a large amount of data needs to be retrieved, and the data processing efficiency is low. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a storage device processing method, a host device, a storage device and a system, which can improve the processing efficiency of the storage device.
[0005] In order to solve the above problems, the first aspect of the present application provides a processing method for a storage device, the method comprising: dividing the storage blocks in the storage device into multiple resource pools, wherein each resource pool corresponds to a feature type; in response to a preset processing command, using the resource pool corresponding to the feature type to be processed, performing preset processing on the data to be processed, wherein the feature type to be processed is the feature type of the data to be processed.
[0006] In order to solve the above-mentioned problem, the second aspect of the present application provides a processing method for a storage device, the method comprising: a host device reads a function definition field of the storage device; using the function definition field, determining whether the storage device supports a preset function; if the storage device supports the preset function, sending a preset processing command to the storage device, so that the storage device utilizes a resource pool corresponding to the characteristic type of the data to be processed to perform preset processing on the data to be processed.
[0007] In order to solve the above problems, the third aspect of the present application provides a host device, which includes a memory and a processor coupled to each other, the memory stores program data, and the processor is used to execute the program data to implement any step in the processing method of the above storage device.
[0008] In order to solve the above-mentioned problem, the fourth aspect of the present application provides a storage device, which stores program data that can be executed by a processor, and the program data is used to implement any step in the processing method of the above-mentioned storage device.
[0009] In order to solve the above-mentioned problem, the fourth aspect of the present application provides a processing system for a storage device, which includes a storage device and a host device, the storage device is used to implement any step in the processing method of the above-mentioned storage device, and the host device is used to implement any step in the processing method of the above-mentioned storage device.
[0010] The above scheme divides the storage blocks in the storage device into multiple resource pools, wherein each resource pool corresponds to a characteristic type, and in response to a preset processing command, the resource pool corresponding to the characteristic type to be processed is used to perform preset processing on the data to be processed, wherein the characteristic type to be processed is the characteristic type of the data to be processed. Therefore, by allocating resource pools for storage to data of different characteristic types, data of different characteristic types can be managed separately through different resource pools, and then in response to the preset processing command, the resource pool corresponding to the characteristic type to be processed is used to perform preset processing on the data to be processed, wherein the characteristic type to be processed is the characteristic type of the data to be processed. In the process of performing preset processing on the data to be processed, the amount of data queries can be reduced, the query efficiency can be improved, and thus the data processing efficiency of the storage device can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in this application, the following briefly introduces the drawings required in the description of the embodiments. Obviously, the drawings described below are only some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0012] Figure 1 It is a structural diagram of the first embodiment of the storage device processing system of the present application;
[0013] Figure 2 is a flowchart of a first embodiment of a processing method for a storage device of the present application;
[0014] Figure 3 It is a structural diagram of an embodiment of a resource pool in a storage device of the present application;
[0015] Figure 4 This application Figure 2 A flow chart of an embodiment of step 1 before step S21;
[0016] Figure 5 This application Figure 2 A schematic diagram of a flow chart of an embodiment of step S22;
[0017] Figure 6 It is a schematic diagram of an embodiment of a resource pool address mapping table of the present application;
[0018] Figure 7 is a flowchart of a second embodiment of a processing method for a storage device of the present application;
[0019] Figure 8 is a structural schematic diagram of a first embodiment of a processing device of a storage device of the present application;
[0020] Fig. 9 is a structural schematic diagram of a second embodiment of a processing device of a storage device of the present application;
[0021] Fig.10 is a structural schematic diagram of a third embodiment of a processing device of a storage device of the present application;
[0022] Fig.11 is a structural schematic diagram of a fourth embodiment of a processing device of a storage device of the present application;
[0023] Fig.12 is a structural schematic diagram of a second embodiment of a processing system for a storage device of the present application;
[0024] Fig.13 It is a structural schematic diagram of an embodiment of a host device of the present application;
[0025] Fig.14 It is a structural diagram of an embodiment of a storage device of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] The terms "first" and "second" in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0028] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0029] The present application provides the following embodiments, and each embodiment is described in detail below.
[0030] See also Figure 1 , Figure 1 It is a structural diagram of the first embodiment of the storage device processing system of the present application. The storage device processing system may include a host device 11 and a storage device 12. In the intelligent storage of artificial intelligence, the host device 11 and the storage device 12 can communicate with each other. Based on the communication protocol between the host device 11 and the storage device 12, the host device 11 can send a processing command to the storage device 12, and the storage device 12 performs corresponding processing operations according to the received processing command. Among them, the host device 11 can be a computer device, such as a computer, a laptop computer, an intelligent terminal, etc., and the present application does not limit this. The storage device 12 can be a solid-state hard disk, a mobile hard disk, a flash memory card, a mechanical hard disk, an optical disk, etc., and the present application does not limit this. The specific processing process of the host device 11 and the storage device 12 can refer to the following embodiments, which are not limited here.
[0031] See also Figure 2 , Figure 2 1 is a flow chart of a first embodiment of a processing method for a storage device of the present application. The method may include the following steps:
[0032] S21: Divide storage blocks in the storage device into multiple resource pools, where each resource pool corresponds to a feature type.
[0033] The storage device may be a solid state disk (SSD), a mobile hard disk, a flash memory card, a mechanical hard disk, an optical disk, etc., and this application does not limit this. Taking the storage device as a solid state disk as an example, the storage device may be an NVME solid state disk, a SATA solid state disk, etc., and this application is not limited thereto.
[0034] The storage device can manage storage blocks, such as the management of flash physical blocks in a solid-state drive. The storage blocks in the storage device can be divided into different resource pools according to different feature types, so that each feature type of data to be processed corresponds to a separate resource pool, and the feature values of the data to be processed can be stored in the resource pool. This application does not limit the feature types, feature values, etc. of the resource pool.
[0035] In some embodiments, the storage device further includes a system block and a function block, and the function block may be an SLC cache function block. The main function of the SLC cache is to write data into the SLC cache first after the SSD receives a write command, and then move the data to the TLC flash memory when the remaining space in the SLC cache reaches a threshold. In addition to the system block and the function block in the storage device, the remaining storage blocks in the storage device may be divided into multiple resource pools according to feature types, wherein each resource pool corresponds to one feature type.
[0036] See also Figure 3 , the storage blocks of the storage device can be divided into multiple resource pools according to the feature type, and the feature type may include Type1, Type2, ..., Type n, for example, Type1 indicates that the feature type is a car, and Type2 indicates that the feature type is a face, etc., and this application does not limit this. The resource pool corresponding to each feature type Type1, Type2, ..., Type n can be expressed as Pool1, Pool2, ..., Pool n, and each resource pool Pool1, Pool2, ..., Pool n can include multiple storage blocks, for example, resource pool Pool1 can include storage blocks Block_11, Block_12, Block_13, etc., resource pool Pool2 can include storage blocks Block_21, Block_22, Block_23, etc., resource pool Pool3 can include storage blocks Block_31, Block_32, Block_33, etc., and resource pool Pool n can include storage blocks Block_n1, Block_n2, Block_n3, etc. The storage blocks can be divided into resource pools according to specific application scenarios, and this application does not limit this.
[0037] In addition, the storage device further includes a free pool Free Pool, which includes free blocks that do not store data. For example, the free pool Free Pool may include free blocks Block_f1, Block_f2, Block_f3, etc., which is not limited in the present application.
[0038] S22: In response to a preset processing command, perform preset processing on the data to be processed using a resource pool corresponding to the feature type to be processed, wherein the feature type to be processed is a feature type of the data to be processed.
[0039] The storage device can receive a preset processing command sent by the host device, and in response to the preset processing command, use a resource pool corresponding to the feature type to be processed to perform preset processing on the data to be processed, wherein the feature type to be processed is a feature type of the data to be processed. The preset processing command includes: at least one of a storage command, a query command, a read command, a delete command, and a retrieval command. Taking the preset named storage command as an example, in response to the storage command, the resource pool corresponding to the feature type of the data to be processed is used to store the data to be processed in the resource pool.
[0040] In this embodiment, the storage blocks in the storage device are divided into multiple resource pools, wherein each resource pool corresponds to a characteristic type, and in response to a preset processing command, the resource pool corresponding to the characteristic type to be processed is used to perform preset processing on the data to be processed, wherein the characteristic type to be processed is the characteristic type of the data to be processed. Therefore, by allocating resource pools for storage to data of different characteristic types, data of different characteristic types can be managed separately through different resource pools, and then in response to the preset processing command, the resource pool corresponding to the characteristic type to be processed is used to perform preset processing on the data to be processed, wherein the characteristic type to be processed is the characteristic type of the data to be processed. In the process of performing preset processing on the data to be processed, the amount of data queries can be reduced, the query efficiency can be improved, and thus the data processing efficiency of the storage device can be improved.
[0041] In some embodiments, see Figure 4 Before dividing the storage blocks in the storage device into a plurality of resource pools in step S21, the following steps may also be included:
[0042] S31: Writing a first character or a second character into a function definition field in a storage device, wherein the first character indicates that the storage device has a preset function, and the second character indicates that the storage device does not have a preset function.
[0043] The preset function may be an intelligent acceleration function, and the first character or the second character may be written in the function definition field in the storage device, wherein the first character indicates that the storage device has the preset function, and the second character indicates that the storage device does not have the preset function. For example, if the storage device is a solid-state drive, the function definition field in the Identify function of the solid-state drive may be used, and the function definition field may be, for example, fields 129-159 of the manufacturer's custom fields. Taking field 129 as an example, the first character "1" may be written in field 129 to indicate that the solid-state drive has the intelligent acceleration function, and the second character "0" may be written to indicate that the solid-state drive does not have the intelligent acceleration function.
[0044] In some embodiments, the Identify function of the solid-state drive can be utilized. During the initialization phase of the solid-state drive, by writing a first character or a second character in a function definition field in the solid-state drive, it is determined whether the solid-state drive has a preset function, that is, whether it has an intelligent acceleration function.
[0045] S32: Writing the communication protocol of the preset processing command into the communication protocol field in the storage device, wherein the preset processing command includes at least one of a storage command, a query command, a read command, a delete command, and a retrieval command, and the communication protocol includes communication instructions corresponding to different preset processing commands.
[0046] The communication protocol of the preset processing command can be written into the communication protocol field in the storage device. The communication protocol includes communication instructions corresponding to different preset processing commands, and the communication protocol can be a communication protocol between the host device and the storage device, so that the host device can send the corresponding preset processing command to the storage device according to the communication instructions corresponding to different preset processing commands, and the storage device performs processing according to the processing defined by the communication instructions corresponding to the preset processing command in the communication protocol.
[0047] The preset processing command includes: at least one of a storage command, a query command, a read command, a delete command, and a search command. For example, the communication instruction field FA is used to define a storage command, the communication instruction field FB is used to define a query command, the communication instruction field FC is used to define a read command, the communication instruction field FD is used to define a delete command, and the communication instruction field FE is used to define a search command.
[0048] For example, the communication instruction field FA is used to define a storage command. The communication protocol defined by the communication instruction field FA can be described as follows: the incoming parameters include at least the feature type and feature value of the data to be processed, and return success or failure. If successful, the index value of the feature value in the resource pool of the feature type is returned. The feature value may include the content of the data to be processed, the storage location of the data to be processed, etc.
[0049] For example, the query command is defined using the communication instruction field FB. The communication protocol defined by the communication instruction field FB can be described as follows: the incoming parameter contains at least the characteristic type of the data to be processed. Return failure or success. If successful, the total number of information of the index value of the resource pool corresponding to the characteristic type and the remaining storage space in the free pool are returned. The remaining storage space can be in sectors.
[0050] For example, the communication instruction field FC is used to define a read command. The communication protocol defined by the communication instruction field FC can be described as follows: the incoming parameters at least include the feature type of the data to be processed and the index value of the data to be processed. Return failure or success. If successful, return the feature value corresponding to the data to be processed, where the feature value may include the content of the data to be processed, the storage location of the data to be processed, etc.
[0051] For example, the communication instruction field FD is used to define a search command. The communication protocol defined by the communication instruction field FD can be described as follows: the input parameter at least includes the feature type and the feature value to be searched. Return failure or success. If successful, all matching index values and feature values in the storage device are returned, wherein the feature value may include the content of the data to be processed, the storage location of the data to be processed, etc.
[0052] For example, the communication instruction field FE is used to define a delete command, and the communication protocol defined by the communication instruction field FE can be described as follows: the incoming parameter at least includes the feature type and index value of the data to be processed, and returns failure or success.
[0053] In this embodiment, a first character or a second character is written into a function definition field in the storage device, wherein the first character indicates that the storage device has a preset function, and the second character indicates that the storage device does not have the preset function, so that whether the storage device has the preset function can be determined by reading the first character or the second character of the function definition field in the storage device; in addition, by writing a communication protocol of a preset processing command into a communication protocol field in the storage device, the communication protocol includes communication instructions corresponding to different preset processing commands, so that the host device and the storage device can communicate based on the communication protocol, and execute the corresponding preset processing command based on the communication instruction.
[0054] In some embodiments, see Figure 5 In step S22, using a resource pool corresponding to the feature type to be processed, the data to be processed is processed by preset processing, which may include at least one of the following steps:
[0055] S221: In response to the storage command, write the data to be processed into a resource pool corresponding to the feature type to be processed, and update the address mapping table of the resource pool to be written.
[0056] When the storage device receives a preset processing command which is a storage command, in response to the storage command, it finds a resource pool corresponding to the feature type to be processed according to the data to be processed, and the feature type to be processed is the feature type corresponding to the data to be processed. For example, if the stored data to be processed is a car picture, then the resource pool corresponding to the feature type "car" can be found. After finding the resource pool corresponding to the feature type, the data to be processed is written into the resource pool corresponding to the feature type to be processed, and writing can be started from the current write position of the storage block in the resource pool, wherein the current write position of the storage block is the current write position of the storage block in the resource pool that is not full of data. After the data to be processed is written into the resource pool, the current write position of the storage block in the resource pool is updated, and the address mapping table of the storage block in the current resource pool is updated.
[0057] In some implementations, an address mapping table of the resource pool may be maintained based on the data storage conditions of the storage blocks in the resource pool, and the address mapping table stores the mapping relationship between the index value and the physical address of the storage block in the resource pool. Figure 6 , Figure 6 This is a diagram of an embodiment of the resource pool address mapping table of the present application. In the address mapping table, the index value Idx of the storage block in the resource pool has a mapping relationship with the physical address Addr, each index value Idx can correspond to a physical address Addr, and the physical address of each storage block corresponds to the characteristic value of the data to be processed.
[0058] The address mapping table may be stored in a memory or flash memory of the storage device. In some embodiments, the address mapping table may be stored in the memory of the storage device. If the address mapping table stored in the memory of the storage device accumulates to a preset storage amount, or the storage time of the address mapping table stored in the memory accumulates to a preset time, the address mapping table is stored in the flash memory. The storage method of the storage device of the present application for the address mapping table can maintain the performance of the storage device.
[0059] In some implementations, based on the data storage situation of the storage blocks in the resource pool, the relevant information of each storage block in the resource pool is maintained, wherein the relevant information of the storage block includes: at least one of the information of the included storage blocks, the information of the used storage blocks, the index value of the storage blocks, and the write information of the storage blocks. The information of the included storage blocks may include the channel of the storage block, CE (Chip Enable, chip select signal), the block number of the storage block, the number of erases and writes, and other information. In addition, the write information of the storage block may include the write position of the current storage block, the offset information of the current write position in the storage block, and other information, which is not limited in the present application.
[0060] In some implementations, if the storage block in the resource pool is full, a new free block in the free pool can be added to the current resource pool and the resource pool information can be updated. The relevant information of the storage block of the resource pool, the address mapping table corresponding to the resource pool and other information can be updated.
[0061] In some embodiments, in order to maintain the continuous use of the storage device, garbage collection can be performed on the resource pools in the storage device. If the available space of the free blocks in the free pool is less than the preset space threshold, garbage collection can be triggered, and garbage collection can be performed on each resource pool separately. In the process of garbage collection for each resource pool, each resource pool performs garbage collection independently, so that the data of each resource pool does not intersect, and the feature types corresponding to the storage blocks in each resource pool are guaranteed to be consistent. The storage device can sense the content of the stored data through the feature type and determine the invalid data in the resource pool, so that when garbage collection is performed on the resource pool, data will not be moved blindly, thereby improving the efficiency of garbage collection.
[0062] S222: In response to the query command, obtain the total number of index values of storage blocks in the resource pool corresponding to the feature type to be processed, and / or obtain storage space information of space blocks in the free pool.
[0063] When the storage device receives a preset processing command as a query instruction, in response to the query instruction, the storage device finds a resource pool corresponding to the feature type to be processed according to the data to be processed, the feature type to be processed is the feature type corresponding to the data to be processed, and the query instruction may be to query the storage information of the resource pool. The total number of index values of the storage blocks in the resource pool corresponding to the feature type to be processed is obtained, and in addition, the storage space information of the space blocks in the free pool may also be obtained.
[0064] S223: In response to the read command, the physical address corresponding to the index value of the data to be processed is searched in the address mapping table of the resource pool corresponding to the feature type to be processed, and based on the physical address, the feature value of the data to be processed is read from the resource pool corresponding to the feature type to be processed.
[0065] When the storage device receives a preset processing command as a read instruction, in response to the read instruction, the storage device finds a resource pool corresponding to the feature type to be processed according to the data to be processed, wherein the feature type to be processed is the feature type corresponding to the data to be processed. The address mapping table is searched according to the index value of the data to be processed, and the physical address corresponding to the index value of the data to be processed is searched in the address mapping table of the resource pool corresponding to the feature type to be processed, and based on the physical address, the feature value of the data to be processed corresponding to the physical address is read from the resource pool corresponding to the feature type to be processed. The feature value includes at least one of the content of the data to be processed and the storage location of the data to be processed.
[0066] S224: In response to the delete command, the mapping relationship between the index value of the data to be processed and the physical address is searched in the address mapping table of the resource pool corresponding to the feature type to be processed, and the found mapping relationship is marked as invalid.
[0067] When the storage device receives a preset processing command that is a delete instruction, in response to the delete instruction, the storage device finds a resource pool corresponding to the feature type to be processed according to the data to be processed, wherein the feature type to be processed is the feature type corresponding to the data to be processed. The address mapping table is searched according to the index value of the data to be processed, and the mapping relationship between the index value of the data to be processed and the physical address is searched in the address mapping table of the resource pool corresponding to the feature type to be processed, and the found mapping relationship is marked as invalid, that is, the mapping relationship between the index value Idx of the data to be processed and the physical address Addr in the address mapping table is deleted.
[0068] S225: In response to the search command, determine the physical address in the address mapping table of the resource pool corresponding to the feature type to be processed, read the feature value corresponding to each determined physical address, and return the index value corresponding to the feature value matching the data to be processed.
[0069] When the storage device receives a preset processing command as a retrieval instruction, in response to the retrieval instruction, the storage device finds the resource pool corresponding to the feature type to be processed according to the data to be processed, wherein the feature type to be processed is the feature type corresponding to the data to be processed. The address mapping table corresponding to the resource pool is found, thereby finding the mapping relationship between the physical address and the index value in the address mapping table, finding the mapping relationship between the valid physical address and the index value in all address mapping tables in the resource pool, determining the physical address in the address mapping table of the resource pool corresponding to the feature type to be processed, reading the feature value corresponding to each determined physical address, comparing the data to be processed with the feature value, thereby determining the matching feature value, and returning the index values corresponding to all the feature values matching the data to be processed.
[0070] The present application does not limit the execution order of the above steps S221 to S225. In addition, in step S22, according to the received preset processing command, steps S221 to S225 are executed accordingly. Step S22 may include any step from step S221 to step S225, and the present application does not limit this.
[0071] In some embodiments, see Figure 7 , Figure 7 1 is a flow chart of a second embodiment of a processing method for a storage device of the present application. The method may include the following steps:
[0072] S41: The host device reads the function definition field of the storage device.
[0073] A first character or a second character is written into the function definition field in the storage device, wherein the first character indicates that the storage device has a preset function, and the second character indicates that the storage device does not have the preset function.
[0074] During the process of identifying the storage device, the host device may read the function definition field of the storage device, and determine whether the storage device has a preset function by reading the first character or the second character of the function definition field.
[0075] S42: Determine whether the storage device supports the preset function by using the function definition field.
[0076] Among them, the preset function can be an intelligent acceleration function. If the first character is read in the function definition field of the storage device, it is determined that the storage device has the preset function; if the second character is read in the function definition field of the storage device, it is determined that the storage device does not have the preset function.
[0077] If the storage device supports the preset function, step S43 is executed.
[0078] If the storage device does not support the preset function, step S44 is executed.
[0079] S43: Sending a preset processing command to the storage device, so that the storage device uses a resource pool corresponding to the characteristic type of the data to be processed to perform preset processing on the data to be processed.
[0080] The communication protocol field in the storage device is written with the communication protocol of the preset processing command, wherein the preset processing command includes at least one of a storage command, a query command, a read command, a delete command, and a retrieval command, and the communication protocol includes communication instructions corresponding to different preset processing commands.
[0081] Based on the communication protocol between the host device and the storage device, the host device can send a preset processing command to the storage device, so that the storage device uses a resource pool corresponding to the feature type of the data to be processed to perform preset processing on the data to be processed. The preset processing command may include the data to be processed, the feature type corresponding to the data to be processed, the feature value corresponding to the data to be processed, etc., and this application does not limit this.
[0082] In some embodiments, before sending a preset processing command to the storage device, the host device may also identify the feature type of the data to be processed, classify the feature type of the data to be processed, and determine the feature type and feature value corresponding to the data to be processed; wherein the feature value includes at least one of the content of the data to be processed and the storage location of the data to be processed. For example, if the data to be processed is a picture of a car, then the feature type may be determined to be a car, and the feature value may be information about the car, such as color features, vehicle model features, a picture of the car, etc. In addition, the feature value may also be the storage location of the picture of the car, so that the picture of the car can be accessed through the storage location.
[0083] In this step, without adding hardware, the function of a small database is implemented on the storage device side. The host device side only needs to classify the data to be processed and send a preset execution to the storage device so that the storage device processes the data to be processed. There is no need to manage the resource pool, that is, the database, and there is no software and hardware overhead for database operations, which can improve the host device's processing efficiency of the data on the storage device.
[0084] The specific implementation of steps S41 to S43 of this embodiment can refer to the implementation process of the above embodiment, and will not be repeated here.
[0085] S44: Send a database creation instruction to the storage device.
[0086] After the host device determines that the storage device does not support the preset function, it can send a command to the storage device to create a database, and use the database to maintain information such as the storage location and characteristic values of the data to be processed, so that when the data stored in the storage device needs to be processed, the stored data can be processed by operating the database. This process can be processed with reference to the use of ordinary solid-state hard drives, and this application does not limit this.
[0087] In this embodiment, the host device can determine whether the storage device supports the preset function by reading the function definition field of the storage device. If the storage device supports the preset function, a preset processing command is sent to the storage device. Since a set of communication protocols is formulated between the host device and the storage device, the host device integrates and classifies the data to be processed by classifying the characteristic types of the data to be processed and determining the characteristic values. The storage device stores the data to be processed organized by the host device separately according to the resource pool corresponding to the characteristic type. The storage device uses the resource pool corresponding to the characteristic type of the data to be processed. When performing preset processing on the data to be processed, the resource pool corresponding to the characteristic type can be searched separately, which can improve efficiency. If the storage device does not support the preset function, a database creation instruction can also be sent to the storage device. The host device can better adapt to the storage device in processing the data to be processed. Overall, the efficiency of the storage device in processing data can be improved.
[0088] For the above embodiment, the present application provides a processing device for a storage device. Figure 8 , Figure 8 1 is a schematic diagram of the structure of the first embodiment of the processing device of the storage device of the present application. The processing device 50 of the storage device includes a classification module 51 and a processing module 52, wherein the classification module 51 and the processing module 52 are connected.
[0089] The classification module 51 is used to divide the storage blocks in the storage device into multiple resource pools, wherein each resource pool corresponds to a characteristic type.
[0090] The processing module 52 is used to respond to a preset processing command and perform preset processing on the data to be processed using a resource pool corresponding to the feature type to be processed, wherein the feature type to be processed is a feature type of the data to be processed.
[0091] The specific implementation of this embodiment can refer to the implementation process of the above embodiment, which will not be repeated here.
[0092] In some embodiments, see Fig. 9 , Fig. 9 1 is a schematic diagram of the structure of the second embodiment of the processing device of the storage device of the present application. The processing device 50 of the storage device further includes a definition module 53, wherein the classification module 51, the processing module 52 and the definition module 53 are connected.
[0093] The definition module 53 is used to write a first character or a second character in a function definition field in the storage device, wherein the first character indicates that the storage device has a preset function, and the second character indicates that the storage device does not have the preset function; and / or, to write a communication protocol of a preset processing command in a communication protocol field in the storage device; wherein the preset processing command includes: at least one of a storage command, a query command, a read command, a delete command, and a retrieval command, and the communication protocol contains communication instructions corresponding to different preset processing commands.
[0094] In some implementations, the processing module 52 is used to perform preset processing on the data to be processed using a resource pool corresponding to the feature type to be processed, including at least one of the following steps:
[0095] The processing module 52 is used to write the to-be-processed data into a resource pool corresponding to the to-be-processed feature type in response to the storage command, and update the address mapping table of the written resource pool.
[0096] If the storage blocks in the resource pool are full, the free blocks in the free pool are added to the resource pool, and the information of the resource pool is updated.
[0097] If the available space of the free blocks in the free pool is less than a preset space threshold, garbage collection is performed on each resource pool respectively.
[0098] The processing module 52 is used to obtain the total number of index values of storage blocks in the resource pool corresponding to the feature type to be processed and / or obtain storage space information of space blocks in the free pool in response to the query command.
[0099] The processing module 52 is used to respond to the read command, find the physical address corresponding to the index value of the data to be processed in the address mapping table of the resource pool corresponding to the feature type to be processed, and read the feature value of the data to be processed from the resource pool corresponding to the feature type to be processed based on the physical address.
[0100] The processing module 52 is used for searching the mapping relationship between the index value of the data to be processed and the physical address in the address mapping table of the resource pool corresponding to the feature type to be processed in response to the delete command, and marking the found mapping relationship as invalid.
[0101] The processing module 52 is used to respond to the search command, determine the physical address in the address mapping table of the resource pool corresponding to the feature type to be processed, read the feature value corresponding to each determined physical address, and return the index value corresponding to the feature value matching the data to be processed.
[0102] In some implementations, the processing module 52 is further used to maintain an address mapping table of the resource pool based on the data storage status of the storage blocks in the resource pool, wherein the address mapping table stores a mapping relationship between the index value and the physical address of the storage block in the resource pool; wherein the address mapping table is stored in the memory or flash memory of the storage device. If the address mapping table stored in the memory reaches a preset storage amount or the storage time reaches a preset time, the address mapping table is stored in the flash memory.
[0103] In some embodiments, the processing module 52 is also used to maintain relevant information of each storage block in the resource pool based on the data storage status of the storage blocks in the resource pool, wherein the relevant information of the storage blocks includes: information of the included storage blocks, information of the used storage blocks, index values of the storage blocks, and at least one of write information of the storage blocks.
[0104] The specific implementation of this embodiment can refer to the implementation process of the above embodiment, which will not be repeated here.
[0105] In some embodiments, see Fig.10 , Fig.10 1 is a schematic diagram of the structure of the third embodiment of the processing device of the storage device of the present application. The processing device 60 of the storage device includes a reading module 61, a command module 62 and a creation module 63, wherein the reading module 61, the command module 62 and the creation module 63 are connected.
[0106] The reading module 61 is used by the host device to read the function definition field of the storage device; and to determine whether the storage device supports the preset function by using the function definition field.
[0107] The command module 62 is used to send a preset processing command to the storage device when the reading module 61 determines that the storage device supports the preset function, so that the storage device uses a resource pool corresponding to the characteristic type of the data to be processed to perform preset processing on the data to be processed.
[0108] The creation module 63 is used to send a database creation instruction to the storage device when the reading module 61 determines that the storage device does not support the preset function.
[0109] In some embodiments, see Fig.11 , Fig.11 1 is a schematic diagram of the structure of the fourth embodiment of the processing device of the storage device of the present application. The processing device 60 of the storage device may also include a classification module 64, which is used to classify the data to be processed and determine the feature type and feature value corresponding to the data to be processed; wherein the feature value includes at least one of the content of the data to be processed and the storage location of the data to be processed.
[0110] The specific implementation of this embodiment can refer to the implementation process of the above embodiment, which will not be repeated here.
[0111] For the above embodiments, the present application provides a processing system for a storage device. Fig.12 , Fig.12 1 is a schematic diagram of the structure of the second embodiment of the processing system of the storage device of the present application. The processing system 70 of the storage device includes a storage device 71 and a host device 72. The storage device 71 is used to implement the steps of any one of the first and second embodiments of the processing method of the storage device, and the host device 72 is used to implement the steps of any one of the first and third embodiments of the processing method of the storage device.
[0112] The specific implementation of this embodiment can refer to the implementation process of the above embodiment, which will not be repeated here.
[0113] For the above embodiment, the present application provides a host device, see Fig.13 , Fig.13 1 is a schematic diagram of the structure of an embodiment of a host device of the present application. The host device 80 includes a memory 81 and a processor 82, wherein the memory 81 and the processor 82 are coupled to each other, the memory 81 stores program data, and the processor 82 is used to execute the program data to implement the steps of any one of the methods in the first embodiment and the second embodiment of the processing method of the storage device.
[0114] In this embodiment, the processor 82 may also be referred to as a CPU (Central Processing Unit). The processor 82 may be an integrated circuit chip having signal processing capabilities. The processor 82 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor 82 may also be any conventional processor, etc.
[0115] The specific implementation of this embodiment can refer to the implementation process of the above embodiment, which will not be repeated here.
[0116] For the above embodiment, the present application also proposes a storage device, see Fig.14 , Fig.14 The storage device 90 stores program data 91 that can be run by a processor, and the program data can be executed by the processor to implement the steps of any one of the first and third embodiments of the processing method of the storage device.
[0117] The specific implementation of this embodiment can refer to the implementation process of the above embodiment, which will not be repeated here.
[0118] The storage device 90 of this embodiment can be a medium that can store program data, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or it can also be a server that stores the program data. The server can send the stored program data to other devices for execution, or it can also execute the stored program data by itself.
[0119] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage device, which is a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of each implementation method of the present application.
[0123] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.
[0124] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A processing method for a storage device, characterized in that: The method comprises: The storage blocks in the storage device are divided into a plurality of resource pools, wherein each of the resource pools corresponds to a characteristic type, and the resource pool is used to store characteristic values of the data to be processed; the characteristic value at least includes at least one of the content of the data to be processed and the storage location of the data to be processed, and the characteristic type indicates the type of the data to be processed; the characteristic type and characteristic value of the data to be processed are read by the host device through the function definition field of the storage device to determine whether the storage device supports a preset function, and if the storage device supports the preset function, the characteristic type of the data to be processed is identified to classify and determine the data to be processed; the preset function is an intelligent acceleration function; In response to a preset processing command sent by the host device, using the resource pool corresponding to the feature type to be processed, the preset processing is performed on the data to be processed, wherein the feature type to be processed is a feature type of the data to be processed; Based on the data storage status of the storage blocks in the resource pool, an address mapping table of the resource pool is maintained, wherein the address mapping table stores a mapping relationship between index values and physical addresses of the storage blocks in the resource pool.
2. The method according to claim 1, characterized in that Before dividing the storage blocks in the storage device into a plurality of resource pools, the method includes: Writing a first character or a second character into the function definition field in the storage device, wherein the first character indicates that the storage device has the preset function, and the second character indicates that the storage device does not have the preset function; and / or, The communication protocol of the preset processing command is written into the communication protocol field in the storage device; wherein the preset processing command includes: at least one of a storage command, a query command, a read command, a delete command, and a retrieval command, and the communication protocol contains communication instructions corresponding to different preset processing commands.
3. The method according to claim 1, characterized in that The method of using the resource pool corresponding to the feature type to be processed to perform preset processing on the data to be processed includes at least one of the following steps: In response to a storage command, the to-be-processed data is written into a resource pool corresponding to the to-be-processed feature type, and an address mapping table of the written resource pool is updated; In response to the query command, obtaining the total number of index values of storage blocks in the resource pool corresponding to the feature type to be processed, and / or obtaining storage space information of space blocks in the free pool; In response to a read command, searching the address mapping table of the resource pool corresponding to the feature type to be processed for a physical address corresponding to the index value of the data to be processed, and reading the feature value of the data to be processed from the resource pool corresponding to the feature type to be processed based on the physical address; In response to the delete command, searching the address mapping table of the resource pool corresponding to the feature type to be processed for a mapping relationship between the index value of the data to be processed and the physical address, and marking the found mapping relationship as invalid; In response to a retrieval command, the physical address in the address mapping table of the resource pool corresponding to the feature type to be processed is determined, the feature value corresponding to each determined physical address is read, and the index value corresponding to the feature value matching the data to be processed is returned.
4. The method according to claim 1, characterized in that: The address mapping table is stored in the memory or flash memory of the storage device.
5. The method according to claim 4, characterized in that The method further comprises: If the address mapping table stored in the memory reaches a preset storage amount or the storage time reaches a preset time, the address mapping table is stored in the flash memory.
6. The method according to claim 1, characterized in that The method further comprises: Based on the data storage situation of the storage blocks in the resource pool, maintain relevant information of each storage block in the resource pool, wherein the relevant information of the storage blocks includes: information of included storage blocks, information of used storage blocks, index values of the storage blocks, and at least one of write information of the storage blocks.
7. The method according to claim 1, characterized in that The method further comprises: If the storage blocks in the resource pool are full, free blocks in the free pool are added to the resource pool, and information of the resource pool is updated.
8. The method according to claim 7, characterized in that The method further comprises: If the available space of the free blocks in the free pool is less than a preset space threshold, garbage collection is performed on each of the resource pools respectively.
9. A method for processing a storage device, characterized in that: The method comprises: The host device reads the function definition field of the storage device; Determine whether the storage device supports a preset function by using the function definition field, wherein the preset function is a smart acceleration function; If the storage device supports the preset function, the feature type of the data to be processed is identified to classify the data to be processed, and the feature type and feature value corresponding to the data to be processed are determined; wherein the feature value includes at least one of the content of the data to be processed and the storage location of the data to be processed, and the feature type indicates the type of the data to be processed; Sending a preset processing command to the storage device so that the storage device uses a resource pool corresponding to the characteristic type of the data to be processed to perform preset processing on the data to be processed; and maintaining an address mapping table of the resource pool based on the data storage status of the storage blocks in the resource pool, wherein the address mapping table stores a mapping relationship between index values and physical addresses of the storage blocks in the resource pool; The storage blocks in the storage device are divided into a plurality of resource pools, each of the resource pools corresponds to a characteristic type, and the resource pools are used to store characteristic values of data to be processed.
10. The method according to claim 9, characterized in that The method further comprises: If the storage device does not support the preset function, a database creation instruction is sent to the storage device.
11. A host device, characterized in that: The invention comprises a memory and a processor coupled to each other, wherein the memory stores program data, and the processor is used to execute the program data to implement the steps of the method according to any one of claims 9 to 10.
12. A storage device, characterized in that: The storage device stores program data that can be executed by a processor, and the program data is used to implement the steps of the method according to any one of claims 1 to 8.
13. A processing system for a storage device, characterized in that: The method comprises: a storage device and a host device, wherein the storage device is used to implement the steps of the method described in any one of claims 1 to 8, and the host device is used to implement the steps of the method described in any one of claims 9 to 10.
