A task processing method and system for storage chip
By improving the B-tree mapping table and node splitting strategy, combined with write task priority allocation and flash memory particle usage monitoring, the problems of memory chip write amplification and high concurrent task delays are solved, and the read and write efficiency and lifespan of the memory chip are improved.
Patent Information
- Application Number
- CN202410979483.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-22
AI Technical Summary
Existing memory chips have low read and write efficiency and short lifespan due to the write amplification phenomenon when processing tasks, and the delay rate is high when performing high concurrent tasks. Frequent task writing increases the wear and tear of the memory chip.
An improved B-tree mapping table is used to access the cache in a cascading manner, and a multi-trigger condition node splitting strategy based on storage device attributes is designed, combined with write task priority allocation and flash memory particle usage monitoring, to optimize the data storage structure and task scheduling.
It reduces the write amplification phenomenon, improves the read and write rate and the durability of the storage device, optimizes the data read and write path, extends the service life of the memory chip, and improves the response speed and efficiency of the system.
Smart Images

Figure CN118502683B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a task processing method and system for a storage chip. Background Art
[0002] Memory chips are semiconductor memory devices used to store data in electronic devices. These chips can be non-volatile, such as NAND flash memory, or volatile, such as DRAM (dynamic random access memory). When talking about the task processing methods of memory chips, we mainly focus on the process of reading and writing data.
[0003] With the advancement of technology, NAND flash memory has become the core component of solid-state drives (SSDs). SSDs are fast and are currently the most commonly used storage. The basic structure includes interfaces, storage chip controllers, DRAM cache, firmware, multiple flash memory particles, power management circuits, and printed circuit boards. Compared with traditional hard disk drives (HDDs), they have faster read and write speeds, lower power consumption, and higher shock resistance.
[0004] However, although the storage chip of the solid-state drive has better performance, its inherent properties lead to a more serious write amplification problem. That is, since the erase and write operations of flash memory usually involve larger block-level operations, even if only a small amount of data is modified, the entire data block needs to be erased and rewritten. This write amplification phenomenon will cause additional write operations, consume more write cycles, and reduce the read and write efficiency and life of the SSD. In addition, existing storage chips often execute sequential tasks directly when processing tasks, resulting in low task processing efficiency and high latency when dealing with high-concurrency tasks. Frequent task writing will further increase the impact of write amplification on the life of the storage chip. Summary of the invention
[0005] In order to solve the problem of write amplification existing in the prior art due to its inherent properties, that is, since the erase and write operations of flash memory usually involve larger block-level operations, even if only a small amount of data is modified, the entire data block needs to be erased and rewritten. This write amplification phenomenon will lead to additional write operations, consume more write cycles, and reduce the read and write efficiency and life of the SSD. In addition, the existing storage chips often execute sequential tasks directly when performing task processing, resulting in low task processing efficiency, a high delay rate when dealing with high-concurrency tasks, and frequent task writing will further increase the impact of write amplification on the life of the storage chip. The present invention provides a task processing method and system for a storage chip.
[0006] The technical solution provided by the embodiment of the present invention is as follows:
[0007] First aspect
[0008] An embodiment of the present invention provides a task processing method for a storage chip, comprising:
[0009] S1: construct an improved B-tree mapping table between logical addresses and physical addresses, wherein the improved B-tree mapping table is connected to the cache in a cascade manner and has a node splitting strategy with multiple trigger conditions designed based on storage device attributes, wherein the storage device attributes include a single page size of a flash memory particle, a current write delay of a node, a current load of a node, and a current load of a storage device;
[0010] S2: receiving tasks to be processed, where the tasks to be processed include read tasks and write tasks;
[0011] S3: If the task to be processed is a read task, go to S9; otherwise, go to S4;
[0012] S4: According to the improved B-tree mapping table, the write task is temporarily stored in the cache area;
[0013] S5: According to the data packet size and acceptable delay of the writing task, the writing task is prioritized in combination with Amdahl's law to generate a writing task priority queue;
[0014] S6: Obtain the usage count of each flash memory particle;
[0015] S7: In the case of improving the node splitting strategy triggered by the B-tree mapping table, the write task priority queue is combined to schedule the write tasks of the cache area with the goal of equalizing the number of times the flash memory particles are used;
[0016] S8: Update and improve the B-tree mapping table based on the scheduling result;
[0017] S9: Execute the reading task according to the improved B-tree mapping table.
[0018] Second aspect
[0019] An embodiment of the present invention provides a task processing system for a storage chip, comprising:
[0020] processor;
[0021] A memory having computer-readable instructions stored thereon, which, when executed by a processor, implements the task processing method of the memory chip of the first aspect.
[0022] The third aspect
[0023] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the task processing method of the storage chip according to the first aspect is implemented.
[0024] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0025] In the present invention, an improved B-tree mapping table with a node splitting strategy is connected to a cache in a cascade manner, so that tasks can be merged and temporarily stored in the cache, thereby reducing the write amplification phenomenon caused by frequent writing, and effectively utilizing the fast response characteristics of the cache to process high-frequency access data, thereby improving the read and write rates. At the same time, a multi-trigger condition node splitting strategy designed based on storage device attributes can dynamically adjust the data storage structure, so that node splitting is constrained, and frequent node operations are avoided, thereby further reducing the write amplification phenomenon, reducing the wear of storage chips, optimizing the data read and write path, and reducing the burden on storage devices. In addition, tasks are prioritized in combination with acceptable delays of data packet size and processing time, ensuring that high-priority tasks can be quickly processed, thereby improving the response speed and efficiency of the system, and being able to effectively process high-concurrency tasks. In addition, by monitoring the number of times flash memory particles are used before writing, and adjusting the write tasks according to the priority queue, the wear of flash memory particles is balanced, the uneven wear of storage chips is further reduced, and the life of the device is extended. The low latency and high efficiency characteristics of data processing can be enhanced, and the common delay problems in high-concurrency processing tasks are effectively dealt with, which not only improves the user experience, but also extends the service life of the hardware device. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0027] Figure 1 A schematic flow chart of a task processing method of a memory chip provided by an embodiment of the present invention;
[0028] Figure 2 A schematic diagram of the structure of an improved B-tree mapping table provided by an embodiment of the present invention;
[0029] Figure 3 A schematic diagram of the structure of a task processing system of a storage chip provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0031] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0032] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.
[0033] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.
[0034] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0035] Reference Manual Attached Figure 1 , shows a flow chart of a task processing method of a storage chip provided by an embodiment of the present invention.
[0036] Reference Manual Attached Figure 2 , shows a schematic structural diagram of an improved B-tree mapping table provided in an embodiment of the present invention.
[0037] Figure 2 The specific structure of the solid-state drive storage chip is shown in the figure. The basic structure includes an interface, a storage chip controller, a DRAM cache, and N flash memory particles. The number of flash memory particles varies according to different specifications. The improved B-tree mapping table is connected to the DRAM cache in a cascade manner.
[0038] An embodiment of the present invention provides a task processing method for a storage chip, which can be implemented by a task processing device for the storage chip, and the task processing device for the storage chip can be a terminal or a server. The processing flow of the task processing method for the storage chip may include the following steps:
[0039] S1: Construct an improved B-tree mapping table between logical addresses and physical addresses.
[0040] Among them, the improved B-tree mapping table is connected to the cache in a cascade manner, and has a node splitting strategy with multiple trigger conditions designed based on storage device attributes, wherein the storage device attributes include the single page size of flash memory particles, the current write delay of the node, the current load of the node and the current load of the storage device.
[0041] Among them, the cascade method describes a situation in which elements or operations are connected or interacted with each other in a sequential or chained manner. The cascade method can effectively buffer and optimize the data processing process, as well as reduce the direct pressure on the back-end storage system, allowing the system to temporarily store a large number of write requests in memory, reducing direct access to persistent storage, thereby reducing disk I / O operations and write amplification. In addition, by batch processing and aggregating write operations in memory, the efficiency and response speed of data processing can be significantly improved. The cascade structure also provides the system with stronger concurrent processing capabilities, allowing more write operations to be executed in parallel without slowing down system performance, so that the entire data storage system can still maintain efficient operation when facing high loads. By introducing cascaded memory nodes, the improved B-tree structure effectively optimizes the data processing process and is suitable for high-concurrency and write-intensive application environments.
[0042] It should be noted that the improved B-tree mapping table constructed adopts a cascaded access cache strategy, which effectively optimizes the mapping relationship between logical addresses and physical addresses. This structure takes into account the specific properties of the storage device, such as the single page size of the flash memory particles, the current write delay of the node, and the current load of the node and the storage device, to design a node splitting strategy with multiple trigger conditions. Through such a design, the mapping table can trigger splitting when the node capacity reaches the threshold, the write delay exceeds the standard, or the load is too high, thereby optimizing data storage and access efficiency. This method not only improves data access speed and reduces access delay, but also significantly enhances the scalability and flexibility of the system, so that the data storage structure can more efficiently adapt to changing storage needs and environmental conditions. This cascaded cache access method is particularly suitable for high-concurrency and data-intensive application scenarios, and can effectively reduce the overall load of the system and improve the performance of the storage system.
[0043] In a possible implementation, the node splitting strategy is specifically as follows:
[0044] ;
[0045] in, M represents the node capacity threshold, C Indicates the maximum storage capacity of the node. O Represents non-task overhead, i.e., non-data and non-pointer overhead, D Indicates the average length of data to be stored. b Indicates the pointer length, Indicates rounding down, granularity indicates the size of a single page of flash memory particles, Indicates the current load of the IO port. Indicates the optimal load of the IO port. T represents the time delay threshold, Indicates the basic latency of the storage device. Indicates device write latency, thresholdlatency Indicates the maximum acceptable delay of the device. e represents the exponential function, Indicates the current load of the storage device. normal level Indicates that the storage device is under normal load. n Indicates the current capacity of the node. Indicates the node splitting time interval, Indicates the current capacity of the node n The node key-value pair distribution entropy value used to evaluate node unevenness is as follows: represents the entropy threshold, represents the node splitting strategy, Represents a logical AND operation.
[0046] It should be noted that those skilled in the art can set the size of the entropy value threshold according to actual needs, and the present invention is not limited here.
[0047] Among them, the basic latency of the storage device represents the minimum response time of the storage device under ideal or optimal conditions. It is a baseline value used to reflect the time required for the device to respond to a write request without additional load or under optimal performance conditions. This basic latency is determined by multiple factors, including the physical characteristics of the storage medium, the design of the device, and the configuration of the system.
[0048] in, represents the actual available storage space of the node after removing the overhead, and is the space required to store a single key-value pair (including data and pointers to child nodes), It represents the base number of key-value pairs that a node can accommodate without external load. In this way, we can ensure that each node is effectively utilizing its storage capacity without wasting storage by exceeding the actual available space.
[0049] Among them, the node capacity threshold takes into account the current system load and dynamically adjusts the node capacity. When the system's I / O load exceeds the optimal level, this value will increase to allow the node to accommodate more key-value pairs, thereby reducing the performance loss caused by frequent node splits.
[0050] Specifically, if a node's data update has been a considerable amount of time since the last split (exceeding the set time delay threshold), and the data distribution entropy value of the node exceeds the set threshold, indicating that the data distribution is sufficiently uneven, the node split is particularly necessary. This entropy-based splitting strategy has significant advantages: First, it helps maintain the uniform distribution of data in the B-tree, which not only improves the efficiency of query operations and avoids overloaded nodes becoming performance bottlenecks, but also improves the storage efficiency of the entire tree, because evenly distributed data can more effectively utilize node space and reduce waste. Secondly, even data distribution reduces the difficulty and cost of subsequent maintenance and optimization of the B-tree, because the expected effect of each operation is more consistent, reducing abnormal processing caused by extremely uneven data.
[0051] In summary, by using entropy as one of the triggering conditions for node splitting, we not only improve the efficiency of B-tree operations, but also enhance its adaptability and stability to dynamically changing data environments, making the B-tree structure more robust and able to efficiently handle large-scale and highly concurrent data requests. This approach ensures the efficiency and reliability of B-trees in complex data environments, and is an indispensable part of databases and other applications that require efficient data indexing.
[0052] S2: Receive tasks to be processed.
[0053] The tasks to be processed include read tasks and write tasks.
[0054] S3: If the task to be processed is a read task, go to S9; otherwise, go to S4.
[0055] S4: According to the improved B-tree mapping table, the write task is temporarily stored in the cache area.
[0056] Among them, the B-tree mapping table is a method of organizing and mapping key-value pairs using the B-tree data structure, which is widely used in databases and file systems to achieve efficient data access. In the B-tree mapping table, each node can store multiple keys and pointers to other nodes, ensuring the balance of the tree, so that insertion, deletion, and search operations can be completed in logarithmic time. This structure is particularly suitable for processing large amounts of data because its hierarchical index system reduces disk I / O operations and improves performance. In storage devices, such as solid-state drives (SSDs), B-tree mapping tables are often used to effectively map logical block addresses to physical block addresses to optimize wear leveling and data management efficiency.
[0057] In a possible implementation, S4 specifically includes:
[0058] S401: accepting a writing task.
[0059] S402: Merge the write tasks into the cache area one by one, and update the improved B-tree mapping table.
[0060] S403: persistently storing the updated improved B-tree mapping table in the flash memory particles.
[0061] It should be noted that this process not only optimizes the efficiency of data writing, reduces direct access to physical storage through cache merging and batch processing, but also ensures data security and recovery capabilities through persistence. The use of improved B-tree mapping tables improves the speed and accuracy of data access, enabling the system to handle high-concurrency write operations more efficiently while maintaining the integrity and stability of the data structure.
[0062] S5: According to the data packet size and acceptable delay of the writing task, the writing task is prioritized in combination with Amdahl's law to generate a writing task priority queue.
[0063] Among them, the packet size reflects the resource requirements of the task. Large packets may require more computing resources or memory. The acceptable delay in processing time refers to the maximum time that can be tolerated to complete the task. For urgent tasks, this time will be set shorter. Amdahl's law is used to evaluate the maximum performance improvement that can be brought by parallel processing. It shows that even if more processing units are added, there is a theoretical upper limit to the speed of task execution, especially for tasks with limited parallelization. The advantage of combining these factors to allocate task priorities is that it can dynamically optimize resource allocation according to the specific needs and urgency of the task, ensuring that tasks with high resource requirements and time sensitivity can be processed first, thereby improving the overall efficiency and response speed of the system. This method is particularly suitable for processing multi-tasks and high-concurrency environments. It can effectively avoid resource waste and ensure that key tasks are completed on time. At the same time, it improves the system's adaptability to different workloads and performance stability.
[0064] It should be noted that Amdahl's law is used to evaluate the performance improvement potential in parallel computing. It indicates that the improvement of system performance is limited by the parts of the system that cannot be parallelized. In this solution, Amdahl's law is used to analyze and optimize the processing of write tasks. Specifically, it is to reasonably allocate task priorities by evaluating the parts of each task that can be processed in parallel and must be processed serially. In S5, according to the packet size of the write task and the acceptable processing time delay, the system decomposes the task into a part that can be processed in parallel and a serial part, and then generates a priority queue accordingly. This allocation method can maximize the parallel efficiency of task processing and give priority to those key tasks that affect the overall performance of the system, thereby ensuring that the tasks are completed on time while improving the throughput and efficiency of the overall system. In this way, the system can arrange the order of task execution more intelligently, reduce the overall completion time, and improve the response speed and user experience.
[0065] In a possible implementation, S5 specifically includes:
[0066] S501: Obtain the data packet size and acceptable delay of the processing time of the write task.
[0067] S502: Calculating the speedup ratio of parallel processing of write tasks using Amdahl's law S :
[0068] ;
[0069] in, Indicates i The packet size of the written data, k represents the sensitivity constant reflecting parallel processing, N Indicates the number of IO channels of the storage device. Indicates that in a given i The ratio of write tasks that can be executed in parallel when the data packet size of the write data is , Indicates that the processing time is subject to an acceptable delay.
[0070] S503: Calculating the average queue length in the storage device based on the data packet size of the write task L :
[0071] ;
[0072] in, Indicates the packet size is The arrival rate, represents the standard arrival rate of fixed data size, W Indicates the average waiting time of write tasks in the storage device.
[0073] S504: Calculate the first i Write task priority for each write task :
[0074] .
[0075] S505: Generate a write task priority queue based on the write task priority of each write task.
[0076] It should be noted that in multi-tasking and high-concurrency storage systems, the priority of tasks is calculated by using the speedup ratio and the inverse of the queue length. The speedup ratio evaluates the benefits of task parallel processing, allowing the system to identify which tasks can benefit most from parallelization, thereby maximizing the efficiency of the processing unit. At the same time, by considering the inverse of the queue length, the priority is dynamically adjusted to ensure that when system resources are tight, those tasks that can be completed quickly can be processed first, thereby reducing the overall waiting time and improving the response speed. The priority allocation strategy combines the processing efficiency of the task with the current load of the system to achieve scientific scheduling of task processing priorities. This method is particularly suitable for environments that require rapid processing of large amounts of data, and can significantly improve the throughput of task processing and the overall performance of the system. It also helps prevent resource waste by ensuring that high-priority tasks quickly obtain resources while avoiding performance bottlenecks caused by system overload. The implementation of this strategy can make the system more stable and predictable, improving the user's service experience and the system's operational efficiency.
[0077] S6: Obtain the usage count of each flash memory particle.
[0078] The usage count refers to the cumulative number of write or erase operations on each flash block or particle. Each flash block can only withstand a limited number of write and erase operations, and this limit is determined by the durability of the physical media. Monitoring these usage counts is critical to maintaining the health of storage devices because it helps ensure data integrity and maximize the life of the storage media. By understanding which particles are approaching their life limits, the storage system's control software can implement wear leveling measures in a timely manner, writing new data to particles with less wear, thereby evenly distributing wear and extending the overall life of the SSD. In addition, understanding the usage count also enables system administrators to predict the failure time of storage devices and take necessary backup and replacement measures in advance to avoid data loss and system interruption.
[0079] In a possible implementation, the usage count of each flash memory particle is obtained by using a Magician tool, an SSD Toolbox tool, a CrystalDiskInfo tool, or an HD Tune tool.
[0080] In a possible implementation manner, after S6, the method further includes:
[0081] When the number of times the flash memory particles are used exceeds the preset number of times, an early warning is issued.
[0082] It should be noted that if one or more flash memory particles are severely worn, that is, the number of uses exceeds the preset number of times, it will cause data loss or performance degradation. Therefore, timely warning can ensure the user's data security.
[0083] It should be noted that those skilled in the art can set the preset number of times of use according to actual needs, and the present invention does not limit this. Specifically, the preset number of times of use is generally related to the product parameters of the storage device.
[0084] S7: In the case of improving the node splitting strategy triggered by the B-tree mapping table, the write task priority queue is combined to schedule the write tasks of the cache area with the goal of evenly equalizing the number of times the flash memory particles are used.
[0085] Specifically, when the system's improved B-tree mapping table triggers a node splitting strategy, this indicates that some nodes need to split to maintain the balance of the tree because the amount of stored data reaches or exceeds a predetermined threshold. This situation usually occurs in data-intensive or high-concurrency write environments. The system will take this opportunity to reconsider the physical storage location of the data to optimize storage efficiency and response speed. The system will first select tasks from the write task priority queue, which sorts the priorities of tasks based on the urgency of the task, the size of the data, and the expected processing time. On this basis, the scheduling algorithm further considers the number of times each flash memory particle is used, and gives priority to those particles that are used less frequently for data writing. The core of this strategy is to balance the wear of each particle as much as possible to avoid accelerated failure of some particles due to excessive use.
[0086] This scheduling method ensures that each flash memory particle in the storage device is used evenly by balancing wear, thereby significantly extending the overall life of the storage device. At the same time, intelligent data location arrangement can significantly reduce data addressing time and access latency, which plays a key role in improving data access speed and overall system responsiveness. In addition, by preventing excessive burden on any single particle, the reliability and stability of the system are enhanced, reducing sudden failures caused by uneven wear. This highly optimized scheduling mechanism can also effectively manage resources and avoid resource waste, especially in high-concurrency environments, where a large number of parallel write tasks can be effectively handled without sacrificing performance. Overall, this strategy not only improves the efficiency of data processing, but also ensures data security and the long-term operation efficiency of the storage system.
[0087] In a possible implementation, S7 specifically includes:
[0088] S701: Calculate the wear score of each flash memory particle related to the number of times used:
[0089] ;
[0090] in, Indicates flash memory particles x The wear score, Indicates flash memory particles x The number of times it is used.
[0091] S702: Calculate the locality score of each flash memory particle relative to the expected physical location of the write task:
[0092] ;
[0093] in, Indicates flash memory particles x Physical location Relative to writing tasks d Desired physical location The locality score of , exp represents the exponential function, D represents a data set that is accessed together with the write task, Indicates flash memory particles x Physical location With the task i The location of the flash memory chip The distance between It means taking the minimum function value x ;
[0094] S703: Perform multi-layer screening based on the wear score and the locality score to obtain target flash memory particles;
[0095] In a possible implementation manner, S703 specifically includes:
[0096] S703A: Select a set of flash memory particles with a wear score greater than a preset wear score :
[0097] ;
[0098] in, indicating the preset wear score;
[0099] It should be noted that those skilled in the art can set the size of the preset wear score according to actual needs, and the present invention is not limited here.
[0100] S703B: Select the target flash memory particle from the set of flash memory particles according to the locality score. :
[0101] ;
[0102] Specifically, first, a set of flash memory particles with a wear score higher than a set threshold is screened out to ensure that the selected particles have a low usage frequency, thereby extending their service life. Then, the optimal particle is selected from this set based on the locality score for data writing. This screening process optimizes the storage location of data, ensuring that data is written to the particles with the best physical location and the least wear, improving the efficiency and reliability of the storage system, while reducing the risk of excessive use of particles, and effectively extending the overall life of the storage device.
[0103] S704: Execute the write tasks in the target flash memory particles in sequence according to the write task priority queue.
[0104] Specifically, first, the wear score of each flash memory particle is calculated. The score is based on the number of times the particle is used and reflects the degree of wear of the particle. A lower number of uses means that the particle is less worn, so it has a higher remaining life and is suitable for taking on more write tasks. Subsequently, the locality score of each flash memory particle relative to the expected physical location of the write task is calculated, and an exponential decay function is used to quantify the impact of physical distance on data access speed, so as to ensure that the storage location of the data is highly consistent with the access mode, thereby reducing access delay and improving efficiency. In S703, the system will perform multi-layer screening based on these two scores, and select flash memory particles that have both sufficient remaining life and can provide the best data locality as target particles. Such a selection strategy can balance wear and optimize data access performance. Finally, according to the previously determined priority queue, the system will execute the write task in the selected target flash memory particles in sequence. This phased arrangement can ensure that high-priority tasks are processed quickly while utilizing the optimal storage location determined in the previous step.
[0105] The whole process not only extends the life of the storage device by balancing the wear of each particle, but also significantly improves the system's response speed and processing efficiency through intelligent data location arrangement. In addition, this method improves the reliability and stability of the system and reduces the risk of failure caused by excessive wear of particles. Through this scheduling strategy that comprehensively considers wear and locality, the storage system can more efficiently respond to high-concurrency write requirements and ensure the continuity and efficiency of data processing.
[0106] S8: Update and improve the B-tree mapping table based on the scheduling result.
[0107] S9: Execute the reading task according to the improved B-tree mapping table.
[0108] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0109] In the present invention, an improved B-tree mapping table with a node splitting strategy is connected to a cache in a cascade manner, so that tasks can be merged and temporarily stored in the cache, thereby reducing the write amplification phenomenon caused by frequent writing, and effectively utilizing the fast response characteristics of the cache to process high-frequency access data, thereby improving the read and write rates. At the same time, a multi-trigger condition node splitting strategy designed based on storage device attributes can dynamically adjust the data storage structure, so that node splitting is constrained, and frequent node operations are avoided, thereby further reducing the write amplification phenomenon, reducing the wear of storage chips, optimizing the data read and write path, and reducing the burden on storage devices. In addition, tasks are prioritized in combination with acceptable delays of data packet size and processing time, ensuring that high-priority tasks can be quickly processed, thereby improving the response speed and efficiency of the system, and being able to effectively process high-concurrency tasks. In addition, by monitoring the number of times flash memory particles are used before writing, and adjusting the write tasks according to the priority queue, the wear of flash memory particles is balanced, the uneven wear of storage chips is further reduced, and the life of the device is extended. The low latency and high efficiency characteristics of data processing can be enhanced, and the common delay problems in high-concurrency processing tasks are effectively dealt with, which not only improves the user experience, but also extends the service life of the hardware device.
[0110] Reference Manual Attached Figure 3 , showing a schematic structural diagram of a task processing system of a storage chip provided by the present invention.
[0111] The present invention further provides a task processing system 20 for a memory chip, which is applied to the task processing method for the above-mentioned memory chip, comprising:
[0112] Processor 201.
[0113] The memory 202 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 201, the task processing method of the memory chip in the method embodiment is implemented.
[0114] The task processing system 20 of the memory chip provided by the present invention can execute the task processing method of the memory chip described above and achieve the same or similar technical effects. To avoid repetition, the present invention will not go into details.
[0115] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0116] In the present invention, an improved B-tree mapping table with a node splitting strategy is connected to a cache in a cascade manner, so that tasks can be merged and temporarily stored in the cache, thereby reducing the write amplification phenomenon caused by frequent writing, and effectively utilizing the fast response characteristics of the cache to process high-frequency access data, thereby improving the read and write rates. At the same time, a multi-trigger condition node splitting strategy designed based on storage device attributes can dynamically adjust the data storage structure, so that node splitting is constrained, and frequent node operations are avoided, thereby further reducing the write amplification phenomenon, reducing the wear of storage chips, optimizing the data read and write path, and reducing the burden on storage devices. In addition, tasks are prioritized in combination with acceptable delays of data packet size and processing time, ensuring that high-priority tasks can be quickly processed, thereby improving the response speed and efficiency of the system, and being able to effectively process high-concurrency tasks. In addition, by monitoring the number of times flash memory particles are used before writing, and adjusting the write tasks according to the priority queue, the wear of flash memory particles is balanced, the uneven wear of storage chips is further reduced, and the life of the device is extended. The low latency and high efficiency characteristics of data processing can be enhanced, and the common delay problems in high-concurrency processing tasks are effectively dealt with, which not only improves the user experience, but also extends the service life of the hardware device.
[0117] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0118] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0119] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0120] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0121] In the present invention, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0122] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0123] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0124] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0125] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the 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 device, 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, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0126] 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 solution of this embodiment.
[0127] In addition, each functional unit in each embodiment of the present invention 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.
[0128] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0129] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the task processing method of the storage chip as described in the method embodiment.
[0130] A computer-readable storage medium provided by the present invention can implement the steps and effects of the task processing method of the storage chip of the above method embodiment. To avoid repetition, the present invention will not go into details.
[0131] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0132] In the present invention, an improved B-tree mapping table with a node splitting strategy is connected to a cache in a cascade manner, so that tasks can be merged and temporarily stored in the cache, thereby reducing the write amplification phenomenon caused by frequent writing, and effectively utilizing the fast response characteristics of the cache to process high-frequency access data, thereby improving the read and write rates. At the same time, a multi-trigger condition node splitting strategy designed based on storage device attributes can dynamically adjust the data storage structure, so that node splitting is constrained, and frequent node operations are avoided, thereby further reducing the write amplification phenomenon, reducing the wear of storage chips, optimizing the data read and write path, and reducing the burden on storage devices. In addition, tasks are prioritized in combination with acceptable delays of data packet size and processing time, ensuring that high-priority tasks can be quickly processed, thereby improving the response speed and efficiency of the system, and being able to effectively process high-concurrency tasks. In addition, by monitoring the number of times flash memory particles are used before writing, and adjusting the write tasks according to the priority queue, the wear of flash memory particles is balanced, the uneven wear of storage chips is further reduced, and the life of the device is extended. The low latency and high efficiency characteristics of data processing can be enhanced, and the common delay problems in high-concurrency processing tasks are effectively dealt with, which not only improves the user experience, but also extends the service life of the hardware device.
[0133] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0134] There are a few points to note:
[0135] (1) The drawings of the embodiments of the present invention only involve structures related to the embodiments of the present invention. Other structures may refer to conventional designs.
[0136] (2) For the sake of clarity, in the drawings used to describe the embodiments of the present invention, the thickness of layers or regions is exaggerated or reduced, that is, these drawings are not drawn according to the actual scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element or there may be intermediate elements.
[0137] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to obtain new embodiments.
[0138] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A task processing method for a storage chip, characterized in that: include: S1: constructing an improved B-tree mapping table between a logical address and a physical address, wherein the improved B-tree mapping table is connected to a cache in a cascade manner and has a node splitting strategy with multiple trigger conditions designed based on storage device attributes, wherein the storage device attributes include a single page size of a flash memory particle, a current write delay of a node, a current load of a node, and a current load of a storage device; S2: receiving tasks to be processed, wherein the tasks to be processed include read tasks and write tasks; S3: If the task to be processed is a read task, proceed to S9; otherwise, proceed to S4; S4: According to the improved B-tree mapping table, temporarily storing the write task in a cache area; S5: according to the data packet size and acceptable delay of the processing time of the write task, the priority of the write task is assigned in combination with Amdahl's law, and a write task priority queue is generated; S6: Obtain the usage count of each flash memory particle; S7: When the node splitting strategy is triggered by the improved B-tree mapping table, the write task of the cache area is scheduled in combination with the write task priority queue with the goal of evenly equalizing the number of times the flash memory particles are used; S8: updating the improved B-tree mapping table based on the scheduling result; S9: Execute the reading task according to the improved B-tree mapping table.
2. The task processing method of the memory chip according to claim 1, characterized in that: The node splitting strategy is specifically as follows: , Among them, M represents the node capacity threshold, C represents the maximum storage capacity of the node, represents the non-task overhead, that is, the overhead other than data and pointers, D represents the average length of the data to be stored, b represents the pointer length, represents rounding down, and granularity represents the single-page size of the flash memory particle, represents the current load of the port, represents the optimal load of the port, represents the time delay threshold, represents the basic delay of the storage device, represents the device write delay, represents the maximum acceptable delay of the device, e represents the exponential function, represents the current load of the storage device, represents the normal load of the storage device, n represents the current capacity of the node, represents the node splitting time interval, represents at the current capacity of the node n the distribution entropy value of the node key-value pair used to evaluate the node non-uniformity, represents the entropy value threshold, represents the node splitting strategy, represents the logical AND operation.
3. The task processing method of the memory chip according to claim 1, characterized in that: The S4 specifically includes: S401: accepting the writing task; S402: merging the write tasks into the cache area one by one, and updating the improved B-tree mapping table; S403: persistently storing the updated improved B-tree mapping table in the flash memory particles.
4. The task processing method of a memory chip according to claim 1, characterized in that: The S5 specifically includes: S501: Obtain the data packet size and acceptable delay of the processing time of the write task; S502: Calculating the speedup ratio of parallel processing of the write task by Amdahl's law S : , in, Indicates i The packet size of the written data, k represents the sensitivity constant reflecting parallel processing, N Indicates the number of IO channels of the storage device. Indicates that in a given i The ratio of write tasks that can be executed in parallel when the data packet size of the write data is , Indicates that delays in the processing time are acceptable; S503: Calculating the average queue length in the storage device based on the data packet size of the write task L : , in, Indicates the packet size is The arrival rate, represents the standard arrival rate of fixed data size, W Indicates the average waiting time of a write task in the storage device; S504: Calculate the first i Write task priority for each write task : , S505: Generate the write task priority queue based on the write task priority of each write task.
5. The task processing method of the memory chip according to claim 1, characterized in that: Use Magician, SSDToolbox, CrystalDiskInfo, or HD Tune to obtain the usage count of each flash memory particle.
6. The task processing method of a memory chip according to claim 1, characterized in that: After S6, the method further includes: When the usage times of the flash memory particles exceed the preset usage times, an early warning is issued.
7. The task processing method of a memory chip according to claim 1, characterized in that: The S7 specifically includes: S701: Calculate the wear score of each flash memory particle related to the number of times used: , in, Indicates flash memory particles x The wear score, Indicates flash memory particles x The number of times it is used; S702: Calculate the locality score of each flash memory particle relative to the expected physical location of the write task: , in, Indicates flash memory particles x Physical location Relative to writing tasks d Desired physical location The locality score of , exp represents the exponential function, D represents a data set that is accessed together with the write task, Indicates flash memory particles x Physical location With the task i The location of the flash memory chip The distance between It means taking the minimum function value x ; S703: Perform multi-layer screening based on the wear score and the locality score to obtain target flash memory particles; S704: Execute the write tasks in the target flash memory particles in sequence according to the write task priority queue.
8. The task processing method of the memory chip according to claim 7, characterized in that: The S703 specifically includes: S703A: Select a set of flash memory particles with a wear score greater than a preset wear score : , in, indicating the preset wear score; S703B: Select the target flash memory particle from the set of flash memory particles according to the locality score. : 。 9. A task processing system for a storage chip, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the task processing method of the memory chip according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the task processing method of the storage chip according to any one of claims 1 to 8 is implemented.
