Flash memory data processing method and system based on filling content mode diversity
Patent Information
- Application Number
- CN202510332548.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2045-03-20
AI Technical Summary
[0003]目前,在大文件数据存储领域,闪存设备已经能够进行大数据量文件的稳定存储,但在诸如视频编辑等强高频数据编辑需求场景中,编辑人员针对视频数据的快速且非线性的前端处理操作使得闪存控制器对闪存数据的快速寻址操作性能承压,可能出现延时甚至卡顿的情况,难以满足用户使用需求
[0007] As can be seen, in this embodiment of the application, compared with the existing data addressing mechanism of flash memory devices that does not distinguish the file type of the stored data, this application creatively introduces the concept of flash block grouping index into the original addressing mechanism to meet the low latency response requirements of specific file types of file data stored in flash memory devices under high-frequency nonlinear data operation scenarios. Specifically, it accurately identifies different usage scenario branches through multiple condition constraints and adapts to the use of dedicated addressing mechanisms to improve access efficiency while taking stability into account. This is conducive to improving the flexibility, stability, efficiency and scenario applicability of flash memory devices in data addressing processing.
Smart Images

Figure CN120295935B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of flash memory technology, specifically relating to a flash memory data processing method and system based on the diversity of filling content patterns. Background Technology
[0002] In the data addressing mechanism of the storage module of flash memory devices, the lookup from logical address to physical address is generally based on a mapping table, and then the addressing and related data operations are performed based on the queried physical address.
[0003] Currently, in the field of large file data storage, flash memory devices are already capable of stable storage of large amounts of data files. However, in scenarios with high-frequency data editing needs, such as video editing, the fast and non-linear front-end processing operations of editors on video data put pressure on the performance of flash memory controllers in fast addressing of flash memory data, which may result in delays or even stuttering, making it difficult to meet user needs. Summary of the Invention
[0004] This application discloses a flash memory data processing method and system based on the diversity of filling content patterns, in order to improve the flexibility, stability, efficiency and scenario applicability of flash memory devices in data addressing processing.
[0005] In a first aspect, this application provides a flash memory data processing method based on the diversity of filling content patterns, applied to a flash memory device, the method comprising: In response to a first operation instruction on first data of a first file stored in the flash memory device, it is determined that the file type of the first file is a preset file type; and, Determine whether the first operation instruction is the first operation after the first file is opened; If it is determined to be the first operation, then the first mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash physical address; and a first addressing operation is performed according to the first flash physical address; and the data operation indicated by the first operation instruction is performed on the first data that is addressed.
[0006] Secondly, this application provides a flash memory data processing system, including a host and a flash memory device, wherein the host is communicatively connected to the flash memory device, and the flash memory device is configured to perform the following operations: In response to a first operation instruction for first data of a first file stored in the flash memory device, it is determined that the file type of the first file is a preset file type; and it is determined whether the first operation instruction is the first operation after the first file is opened; If it is determined to be the first operation, then the first mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash physical address; and a first addressing operation is performed according to the first flash physical address; and the data operation indicated by the first operation instruction is performed on the first data that is addressed.
[0007] As can be seen, in this embodiment of the application, compared with the existing data addressing mechanism of flash memory devices that does not distinguish the file type of the stored data, this application creatively introduces the concept of flash block grouping index into the original addressing mechanism to meet the low latency response requirements of specific file types of file data stored in flash memory devices under high-frequency nonlinear data operation scenarios. Specifically, it accurately identifies different usage scenario branches through multiple condition constraints and adapts to the use of dedicated addressing mechanisms to improve access efficiency while taking stability into account. This is conducive to improving the flexibility, stability, efficiency and scenario applicability of flash memory devices in data addressing processing. Attached Figure Description
[0008] Figure 1 This is a schematic diagram of the structure of a flash memory device 1 provided in an embodiment of this application.
[0009] Figure 2 This is a schematic diagram of the first processing flow of a flash data processing method based on the diversity of filling content patterns provided in an embodiment of this application.
[0010] Figure 3 This is a schematic diagram of the second processing flow of the flash data processing method based on the diversity of filling content patterns provided in the embodiments of this application; Figure 4 This is a schematic diagram of a flash memory data processing system 100 provided in an embodiment of this application. Detailed Implementation
[0011] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0012] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0013] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0014] In the embodiments of this application, "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone; A and B exist simultaneously; B exists alone. Among them, A and B can be singular or plural.
[0015] In this embodiment, the symbol " / " can indicate that the preceding and following objects are in an "or" relationship. Alternatively, the symbol " / " can also represent a division sign, i.e., performing a division operation. For example, A / B can mean A divided by B.
[0016] In the embodiments of this application, "at least one item" or its similar expression refers to any combination of these items, including any combination of a single item or a plurality of items. "One or more" means one or more, while "multiple" means two or more. For example, "at least one item" of a, b, or c can represent the following seven cases: a, b, c; a and b; a and c; b and c; a, b, and c. Each of a, b, and c can be an element or a set containing one or more elements.
[0017] In the embodiments of this application, "equal to" can be used with "greater than" and is applicable to technical solutions used when "greater than" is used; it can also be used with "less than" and is applicable to technical solutions used when "less than" is used. When "equal to" is used with "greater than", it is not used with "less than"; when "equal to" is used with "less than", it is not used with "greater than".
[0018] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0019] Currently, in the field of video data storage and data processing, flash memory devices are already capable of stably storing large amounts of video files. However, in video editing scenarios, the fast and non-linear front-end processing operations performed by editors on video data put pressure on the real-time addressing requirements of flash memory controllers, making it difficult to meet user needs.
[0020] To address the aforementioned issues, this application provides a flash memory data processing method based on the diversity of filling content patterns. Addressing the low-latency response requirements of specific file types stored in flash memory devices under high-frequency nonlinear data operation scenarios, it creatively introduces a flash block grouping index concept into the existing addressing mechanism. Specifically, it accurately identifies different usage scenario branches through multiple conditional constraints and adapts to the use of a dedicated addressing mechanism to improve access efficiency while maintaining stability. This enhances the flexibility, stability, efficiency, and scenario applicability of flash memory devices in data addressing and processing.
[0021] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of a flash memory device 1 provided in an embodiment of this application. Figure 1 As shown, the flash memory device 1 includes the flash memory controller 10, the flash memory cache module 30, and the flash memory storage module. The flash memory controller 10 writes data to or reads data from the flash memory storage module through the flash memory cache module 30. The flash memory storage module includes flash memory blocks 51, and the flash memory blocks 51 include preset flash memory pages.
[0022] Among them, flash memory device 1 can communicate with the host and process various data operation instructions from the host to realize the data service needs of the front end. For example, in the video editing scenario, the user can control the host to read the video data of the video file stored in flash memory device 1 through the peripheral connected to the host, and can also control the host to read the original video data or write video editing data through various operations in the front-end editing interface.
[0023] like Figure 2 As shown in the schematic diagram, this application provides a flash memory data processing method based on the diversity of filling content patterns, which can be applied to, for example... Figure 1 The flash controller 10 of the flash memory device 1 shown herein includes the following steps: Step 201: In response to a first operation instruction for the first data of the first file stored in the flash memory device, the flash memory device determines that the file type of the first file is a preset file type; The first operation instruction can be, for example, a data read instruction, a data write instruction, a data delete instruction, etc., and is not limited to a single type here. The file type can be, for example, a video file, an image file, an audio file, a text file, etc., and is also not limited to a single type here.
[0024] Step 202: The flash memory device determines whether the first operation instruction is the first operation after the first file is opened; Taking video files as an example, after a user opens a video file, they will usually review it for a period of time before determining the operation strategy for the current video file, and the initial operation phase will generally not immediately enter a high-frequency non-explicit editing state.
[0025] Step 203: If it is determined that this is the first operation, then query the first mapping table according to the first logical address in the first operation instruction to obtain the corresponding first flash physical address; and perform a first addressing operation according to the first flash physical address; and perform the data operation indicated by the first operation instruction on the first addressed data.
[0026] The first mapping table stores the mapping relationship between logical addresses and flash physical addresses. The operating system architecture of the flash controller of the flash device has a dedicated Flash Translation Layer (FTL) to maintain the first mapping table. The logical address is the address used in the program or software. It is a relative address provided by the operating system or programming language to the user program to identify the location of related file data in memory, but it does not directly correspond to the actual storage location in physical memory. The physical address is the address of the actual data stored in the storage module of the flash device. It is the real location of the flash storage unit that stores the data and is used to support data read and write operations at the hardware level of the flash device.
[0027] Specifically, the first flash physical address may include the block number of the flash memory block of the flash memory storage module, the page number of the flash memory page, and the page offset of the flash memory cell used to locate the flash memory page. The complete expression is, for example, (block number, page number, offset within page).
[0028] In one possible example, such as Figure 3 As shown, the method further includes steps 204 to 208: Step 204: If it is determined that this is not the first operation, then obtain the second operation instruction that precedes and is adjacent to the first operation instruction; and, Step 205: Determine whether the interval between the first operation instruction and the second operation instruction is less than a preset time. The preset duration is a pre-set empirical value, such as 200 milliseconds or 500 milliseconds. The empirical value can be obtained by the developer's device, flash controller, or host from the flash memory log of the flash memory device, extracting multiple historical operation records for data such as video files from the flash memory log, and performing statistical analysis on multiple historical operation records to obtain the average interval duration of adjacent continuous data operations in high-frequency nonlinear data operation scenarios. This average interval duration is set as the aforementioned empirical value.
[0029] Step 206: If it is determined that the interval duration is less than the preset duration, then it is detected whether the first data and the second data operated by the second operation instruction are continuously stored data. In this possible example, detecting whether the first data and the second data operated by the second operation instruction are continuously stored data includes: determining an interval address distance based on the physical address information of the first data in the first operation instruction and the second physical address information of the second data in the second operation instruction; and detecting whether the first data and the second data are continuously stored data based on the comparison result of the interval address distance and the preset interval address distance.
[0030] The continuously stored data refers to the relationship between the logical address of the first data and the logical address of the second data being such that the interval address distance is less than a preset interval address distance, such as an adjacent address relationship or an adjacent flash page relationship. The preset interval address distance can be determined by the flash controller by obtaining the data size cached by the flash cache module in the storage caching strategy adopted by the current flash device. For example, if the flash device queries the caching strategy configuration information in the metadata and determines that the flash cache module can cache 3 flash pages of data each time in the data operation business state to improve the response speed in linear data operations, then the data size of these 3 flash pages can be determined as the preset interval address distance.
[0031] For example, in a flash memory device for video files, the flash cache module caches the data of 6 flash pages corresponding to 2 image frames in the cache block each time. The preset interval address distance is the sum of the storage space of these 6 flash pages.
[0032] As can be seen, in this example, because the judgment of continuous storage data fully considers the actual cache configuration of the flash memory cache module of the flash memory device, it can accurately identify data operation situations that exceed the effective cache data range, thereby improving the accuracy of condition recognition and the accuracy of processing flash memory data.
[0033] In one possible example, the method also includes: If it is determined that the interval duration is not less than the preset duration, then the first mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash physical address; and, the first addressing operation is performed according to the first flash physical address; and, the data operation indicated by the first operation instruction is performed on the first data that is addressed. If the data is detected to be the continuously stored data, the first data is addressed in the flash cache data associated with the second data; and the data operation indicated by the first operation instruction is performed on the addressed first data.
[0034] The flash cache data associated with the second data includes user cache data and mapping table cache data. Specifically, the flash device can first quickly query the first flash physical address of the first data from the cached mapping table cache data, and then directly query the first data carrying the body information or index information of the first flash physical address from the user cache data.
[0035] As can be seen in this example, when the interval is not less than the preset duration, the flash memory device has sufficient time to perform data read and write operations. In this case, it can directly call the first mapping table to perform address mapping lookup and addressing, improving the accuracy of scene recognition and the flexibility of processing. When the first data and the second data are stored consecutively, the flash memory device can quickly address the first data and complete the operation instructions based on the pre-stored flash cache data in the cache, improving the timeliness of the flash memory device in processing this branch of data tasks.
[0036] Step 207: If it is detected that the data is not the contiguous storage data, then query the second mapping table according to the first logical address in the first operation instruction to obtain the corresponding first flash block group index identifier and second flash physical address; In this system, the physical address indicated by the second flash memory physical address should be the same as the physical address indicated by the first flash memory physical address. Since the second flash memory physical address is constrained by the first flash block group index identifier, if the number of flash blocks in the flash block group is small (e.g., less than a preset number), the flash controller can directly locate the corresponding flash page based on the flash page number and then address the corresponding starting data position based on the page offset in the address. However, for a single flash block group containing a large number of flash blocks (e.g., more than a preset number), the flash controller can quickly locate the target flash block by querying the flash block group index identifier of the redundant area of the preset flash page based on the flash block number, and then further locate the target flash cell in the target flash page within the current target flash block based on the second flash memory physical address. Therefore, the expression of the second flash memory physical address in the second mapping table can be dynamically set by the flash controller during the creation stage based on the actual number of flash blocks contained in the flash block group, thereby better adapting to addressing efficiency under different flash block contents.
[0037] The preset flash page can be a flash page in the flash storage module that is preset for storing configuration information of the flash block (e.g., the first flash page of multiple flash pages contained in the flash block). The flash page can contain a data area and a redundancy area. The data area can be used to store the basic configuration information of the flash block, such as the block number of the flash block and the usage status of the flash block. The redundancy area is a reserved storage unit partition for storing special information.
[0038] Step 208: Perform a second addressing operation based on the first flash block group index identifier and the second flash physical address, wherein the redundant area of a preset flash page in the flash block storing the first file of the flash device is filled with the flash block group index identifier; and perform the data operation indicated by the first operation instruction on the addressed first data; and mark the unique usage status of the second mapping table within a preset time period.
[0039] The preset flash page of the flash block can be, for example, the first page among multiple flash pages of the flash block, which includes a data area and a redundancy area. The data area is specifically used to store the general configuration information of the flash block, and the redundancy area is used to store the first flash block group index identifier configured for the flash block.
[0040] The starting point of the preset time period is the time of executing the data operation indicated by the first operation instruction, and the ending point of the preset time period is determined based on the experience duration. This experience duration can be based on a pre-set time, such as determining the average duration of a single non-linear data operation event (such as a continuous and rapid selection operation of multiple non-contiguous video frames in a whole video file when searching for a target video frame) by statistically analyzing the operation records in the video editing scene, and determining the average duration as the experience duration.
[0041] The unique usage status identification information can be cached in a specific cache block of the flash memory cache module and read periodically by the flash memory controller. After identification, validity timing is performed, and the timing duration is the aforementioned empirical duration.
[0042] In this possible example, the step of performing the second addressing operation based on the first flash block grouping index identifier and the second flash physical address includes: querying the redundancy area of the preset flash page of the flash block of the flash device based on the first flash block grouping index identifier to obtain a plurality of candidate flash blocks whose flash block grouping index identifier matches the first flash block grouping index identifier; addressing the plurality of candidate flash blocks based on the second flash physical address to obtain the target flash cell of the target flash page of the target flash block where the first data is located.
[0043] As can be seen, in this example, the flash memory device can quickly locate multiple candidate flash memory blocks in the corresponding flash memory block group by using the first flash memory block group index identifier obtained by querying the second mapping table, and then use the second flash memory physical address to address multiple candidate flash memory blocks to obtain the target flash memory cell of the target flash memory page of the target flash memory block where the first data is located. Since it is no longer necessary to scan and query all flash memory blocks one by one, the addressing scan range is effectively reduced.
[0044] As can be seen, in this embodiment of the application, compared with the existing data addressing mechanism of flash memory devices that does not distinguish the file type of the stored data, this application creatively introduces the concept of flash block grouping index into the original addressing mechanism to meet the low latency response requirements of specific file types of file data stored in flash memory devices under high-frequency nonlinear data operation scenarios. Specifically, it accurately identifies different usage scenario branches through multiple condition constraints and adapts to the use of dedicated addressing mechanisms to improve access efficiency while taking stability into account. This is conducive to improving the flexibility, stability, efficiency and scenario applicability of flash memory devices in data addressing processing.
[0045] In one possible example, the method further includes: obtaining the file type of the first file to be written to the flash memory device; creating a flash block grouping index for the data storage blocks of the first file according to the file type to obtain a flash block grouping index identifier; updating the first mapping table according to the logical address of the data of the first file and the allocated flash physical address to obtain an updated first mapping table; adding the flash block grouping index identifier to the first mapping table to obtain a second mapping table; and filling the redundant area of the preset flash page storing the flash block of the first file with the flash block grouping index identifier.
[0046] The file type can be, for example, a video file, an image file, an audio file, a text file, etc.
[0047] As can be seen in this example, the flash memory device can create corresponding flash block group index identifiers specifically for files of different file types, and then update the original first mapping table of the flash memory device according to the logical address of the file data and the allocated flash physical address to obtain the updated first mapping table; and add the created flash block group index identifiers to the first mapping table to obtain the second mapping table; finally, fill the redundant area of the preset flash page of the flash block storing the first file with the flash block group index identifiers to support subsequent addressing operations. This can improve the flexibility and applicability of the flash memory device in constructing flash block group index identifiers.
[0048] In this possible example, adding the flash block group index identifier to the first mapping table to obtain the second mapping table includes: obtaining the correspondence between the flash block group index identifier and the flash physical address; adding the flash block group index identifier to the corresponding mapping table entry in the first mapping table according to the correspondence to obtain the second mapping table.
[0049] In general, the management system of flash memory devices allocates dedicated storage blocks for storing mapping table data. For example, the first mapping table can be configured in the first storage block, and the second mapping table data can be configured in the second storage block. The first storage block and the second storage block are different storage blocks.
[0050] In practice, after the second mapping table is created and stored in the second storage block, the flash controller creates a new flash block grouping index identifier. Then, it can first determine the specific flash cell in the second storage block for the mapping table entry, and then populate the data for that specific flash cell to complete the update operation of the second mapping table.
[0051] As can be seen in this example, the flash memory device is able to obtain the second mapping table by grouping the created flash memory blocks into index identifiers and adding them to the first mapping table.
[0052] In this possible example, the step of creating a flash block grouping index for the data storage blocks of the first file according to the file type to obtain the first flash block grouping index identifier includes: determining reference data units for grouping the flash blocks of the first file according to the file type; dividing the data storage blocks of the first file into multiple flash block groups according to the reference data units; creating a unique index identifier for each flash block group according to the data in each flash block group; and setting the unique index identifier as the flash block grouping index identifier of each flash block group.
[0053] The reference data unit can be, for example, an image dataset corresponding to a single video frame, a sound dataset corresponding to a single audio frame, or a text dataset corresponding to a single text page.
[0054] In this possible example, the specific implementation of the flash memory device creating a unique index identifier for each flash memory block group based on the data in each flash memory block group can be as follows: the flash memory device first performs an image feature extraction operation on each image dataset to obtain an image feature vector; then, the flash memory device uses a hash algorithm to convert the image feature vector into a fixed-length hash value; finally, the flash memory device sets the hash value as the first flash memory block group index identifier for each image frame dataset.
[0055] Common image feature extraction methods include content-based feature extraction, such as color histograms, texture features, and edge features. For example, in a landscape video, keyframes may contain distinctive landmarks, beautiful natural scenery, and other significant features. Specific algorithms analyze these keyframes to extract feature vectors that represent their unique content. These feature vectors serve as crucial evidence for generating a fast index identifier. Hash algorithms can map data of arbitrary length to a fixed-length hash value, ensuring uniqueness and irreversibility. Common hash algorithms include MD5 and SHA-256. Taking the SHA-256 algorithm as an example, the feature vectors of the keyframes are used as input, and complex mathematical operations are performed to generate a 256-bit hash value. This hash value acts like a "digital fingerprint" of the keyframe, uniquely identifying its feature information. The generated hash value is stored in a redundant area of a pre-defined flash memory page as a fast index identifier.
[0056] As can be seen in this example, the flash memory device can perform image feature extraction operations on each image dataset to obtain image feature vectors; then, the flash memory device uses a hash algorithm to convert the image feature vectors into fixed-length hash values; finally, the flash memory device sets the hash value as the first flash block group index identifier of each image frame dataset, thus making the index identifier of each flash block group unique, improving addressing accuracy and stability.
[0057] In this possible example, dividing the data storage block of the first file into multiple flash block groups according to the reference data unit includes: obtaining the data size of the reference data unit and the storage capacity of the flash block of the flash device; configuring a corresponding flash block group for each image frame dataset according to the data size, the storage capacity of the flash block, and the free flash block of the flash device.
[0058] For example, a 4K video file has a resolution of 4096×2160, with each pixel occupying 24 bits. The size of the image dataset for each video frame is 4096×2160×24bit=2103861248bit, approximately 262982656 bytes, or 25920KB. If the flash memory block size is 64KB, approximately 25920KB÷64KB=405 flash memory blocks are needed. Therefore, each flash memory block group contains 405 flash memory blocks. Based on this number, the free flash memory blocks of the flash memory device can be grouped, thus configuring a corresponding flash memory block group for each image dataset. Adjacent flash memory block groups do not contain the same flash memory blocks.
[0059] As can be seen in this example, the flash memory device can configure corresponding flash memory block groups for each image frame dataset based on the data size of the reference data unit and the storage capacity of the flash memory block of the flash memory device; then, based on the data size, the storage capacity of the flash memory block, and the free flash memory blocks of the flash memory device, the flash memory block configuration is reasonable and conflict-free, thus improving storage stability.
[0060] like Figure 4 As shown in the illustration, this application also provides a flash memory data processing system 100, which includes a host 2 and a flash memory device 1, wherein the host 2 is communicatively connected to the flash memory device 1. The flash memory device 1 is used to perform the following operations: In response to a first operation instruction for first data of a first file stored in the flash memory device, it is determined that the file type of the first file is a preset file type; and it is determined whether the first operation instruction is the first operation after the first file is opened; If it is determined to be the first operation, then the first mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash physical address; and, the first addressing operation is performed according to the first flash physical address; and, the data operation indicated by the first operation instruction is performed on the first data that is addressed. If it is determined that this is not the first operation, then a second operation instruction that precedes and is adjacent to the first operation instruction is obtained; and it is determined whether the interval between the first operation instruction and the second operation instruction is less than a preset time. If it is determined that the interval duration is less than the preset duration, then it is detected whether the first data and the second data operated by the second operation instruction are continuously stored data; If the data is not the continuously stored data, the second mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash block group index identifier and second flash physical address; and a second addressing operation is performed according to the first flash block group index identifier and the second flash physical address, wherein the redundant area of the preset flash page in the flash block storing the first file of the flash device is filled with the flash block group index identifier; and the data operation indicated by the first operation instruction is performed on the addressed first data; and the unique usage status of the second mapping table within a preset time period is marked.
[0061] In one possible example, the flash memory device is also used to perform the following operations: If it is determined that the interval duration is not less than the preset duration, then the first mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash physical address; and, the first addressing operation is performed according to the first flash physical address; and, the data operation indicated by the first operation instruction is performed on the first data that is addressed. If the data is detected to be the continuously stored data, the first data is addressed in the flash cache data associated with the second data; and the data operation indicated by the first operation instruction is performed on the addressed first data.
[0062] In one possible example, the flash memory device is also used to perform the following operations: Obtain the file type of the first file to be written to the flash memory device; Based on the file type, a flash block grouping index is created for the data storage blocks of the first file to obtain a flash block grouping index identifier; The first mapping table is updated based on the logical address of the data in the first file and the allocated flash physical address to obtain the updated first mapping table; Add the flash block group index identifier to the first mapping table to obtain the second mapping table; The flash block grouping index identifier is filled in the redundant area of the preset flash page of the flash block storing the first file.
[0063] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0064] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0065] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0066] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0067] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0068] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0069] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0070] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A flash memory data processing method based on the diversity of filling content patterns, characterized in that, Applied to flash memory devices, the method includes: In response to a first operation instruction for first data of a first file stored in the flash memory device, it is determined that the file type of the first file is a preset file type; and it is determined whether the first operation instruction is the first operation after the first file is opened; If it is determined to be the first operation, then the first mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash physical address; and, the first addressing operation is performed according to the first flash physical address; and, the data operation indicated by the first operation instruction is performed on the first data that is addressed. If it is determined that this is not the first operation, then a second operation instruction that precedes and is adjacent to the first operation instruction is obtained; and it is determined whether the interval between the first operation instruction and the second operation instruction is less than a preset time. If it is determined that the interval duration is less than the preset duration, then it is detected whether the first data and the second data operated by the second operation instruction are continuously stored data; If the data is not the continuously stored data, the second mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash block group index identifier and second flash physical address; and a second addressing operation is performed according to the first flash block group index identifier and the second flash physical address, wherein the redundant area of the preset flash page in the flash block storing the first file of the flash device is filled with the flash block group index identifier; and the data operation indicated by the first operation instruction is performed on the addressed first data; and the unique usage status of the second mapping table within a preset time period is marked. The second mapping table is generated by adding flash block group index identifiers to the first mapping table, including: obtaining the correspondence between flash block group index identifiers and flash physical addresses; and adding the flash block group index identifiers to the corresponding mapping table entries in the first mapping table according to the correspondence to obtain the second mapping table.
2. The method according to claim 1, characterized in that, The method further includes: If it is determined that the interval duration is not less than the preset duration, then the first mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash physical address; and, the first addressing operation is performed according to the first flash physical address; and, the data operation indicated by the first operation instruction is performed on the first data that is addressed. If the data is detected to be the continuously stored data, the first data is addressed in the flash cache data associated with the second data; and the data operation indicated by the first operation instruction is performed on the addressed first data.
3. The method according to claim 2, characterized in that, The method further includes: Obtain the file type of the first file to be written to the flash memory device; Based on the file type, a flash block grouping index is created for the data storage blocks of the first file to obtain a flash block grouping index identifier; The first mapping table is updated based on the logical address of the data in the first file and the allocated flash physical address to obtain the updated first mapping table; Add the flash block group index identifier to the first mapping table to obtain the second mapping table; The flash block grouping index identifier is filled in the redundant area of the preset flash page of the flash block storing the first file.
4. The method according to claim 3, characterized in that, The step of creating a flash block group index for the data storage blocks of the first file according to the file type to obtain a flash block group index identifier includes: The reference data units for grouping the flash memory blocks of the first file are determined according to the file type; The data storage area of the first file is divided into multiple flash memory block groups according to the reference data unit; A unique index identifier is created for each flash block group based on the data in each flash block group; Set the unique index identifier as the flash block group index identifier for each flash block group.
5. The method according to claim 4, characterized in that, The step of dividing the data storage block of the first file into multiple flash memory block groups according to the reference data unit includes: Obtain the data size of the reference data unit and the storage capacity of the flash memory block of the flash memory device; Based on the data size, the storage capacity of the flash memory blocks, and the available flash memory blocks of the flash memory device, configure corresponding flash memory block groups for each image frame dataset.
6. The method according to any one of claims 1-5, characterized in that, The step of performing the second addressing operation based on the first flash block group index identifier and the second flash physical address includes: Based on the first flash block grouping index identifier, query the redundant area of the preset flash page of the flash memory block of the flash memory device, and obtain multiple candidate flash blocks whose flash block grouping index identifier matches the first flash block grouping index identifier; The target flash cell of the target flash page of the target flash block where the first data is located is obtained by addressing the plurality of candidate flash blocks according to the second flash physical address.
7. A flash memory data processing system, characterized in that, It includes a host and a flash memory device, the host being communicatively connected to the flash memory device, wherein the flash memory device is configured to perform the following operations: In response to a first operation instruction for first data of a first file stored in the flash memory device, it is determined that the file type of the first file is a preset file type; and it is determined whether the first operation instruction is the first operation after the first file is opened; If it is determined to be the first operation, then the first mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash physical address; and, the first addressing operation is performed according to the first flash physical address; and, the data operation indicated by the first operation instruction is performed on the first data that is addressed. If it is determined that this is not the first operation, then a second operation instruction that precedes and is adjacent to the first operation instruction is obtained; and it is determined whether the interval between the first operation instruction and the second operation instruction is less than a preset time. If it is determined that the interval duration is less than the preset duration, then it is detected whether the first data and the second data operated by the second operation instruction are continuously stored data; If the data is not the continuously stored data, the second mapping table is queried according to the first logical address in the first operation instruction to obtain the corresponding first flash block group index identifier and second flash physical address; and a second addressing operation is performed according to the first flash block group index identifier and the second flash physical address, wherein the redundant area of the preset flash page in the flash block storing the first file of the flash device is filled with the flash block group index identifier; and the data operation indicated by the first operation instruction is performed on the addressed first data; and the unique usage status of the second mapping table within a preset time period is marked. The second mapping table is generated by adding flash block group index identifiers to the first mapping table, including: obtaining the correspondence between flash block group index identifiers and flash physical addresses; and adding the flash block group index identifiers to the corresponding mapping table entries in the first mapping table according to the correspondence to obtain the second mapping table.
Citation Information
Patent Citations
Solid-state drive device and data read-write method based on solid-state drive device
CN109992530A
Flash memory device, mapping apparatus and method forthe same
KR1020070037022A