Descriptor Scheduling Method, Flash Memory Controller and Storage Medium of Flash Memory Controller

By generating task scheduling encoding for each descriptor, dynamically controlling the concurrency amount and scheduling order of NAND, the problem of difficulty in taking into account power consumption and performance in the prior art is solved, and the operation efficiency of NAND flash memory is improved.

CN120122896BActive Publication Date: 2025-07-22ARTMEM TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510623666.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-07-22
Estimated Expiration
2045-05-15

AI Technical Summary

Technical Problem

The prior art is difficult to improve operational efficiency while taking into account the power consumption and performance indicators of NAND flash memory, especially when multiple commands need to be executed in a certain order or high concurrency amount, resulting in poor power consumption and performance.

Method used

By generating task scheduling encoding for each pending initial descriptor, generating task scheduling encoding based on power consumption indicators, performance indicators and initial descriptors, judging concurrency processing capabilities, and processing descriptors in parallel in the task scheduling queue, dynamically controlling the concurrency amount and scheduling order of NAND.

Benefits of technology

While taking into account both power consumption and performance, the operation efficiency of NAND flash memory is improved, and the parallel processing capabilities of NAND are fully utilized to avoid resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120122896B_ABST
    Figure CN120122896B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a descriptor scheduling method, a flash memory controller, and a storage medium for a flash memory controller, belonging to the technical field of memory. The method includes generating task scheduling codes corresponding one by one to the initial descriptors according to power consumption indicators, performance indicators, and each initial descriptor; combining the task scheduling codes and the corresponding initial descriptors to obtain cache descriptors and storing them in a preset descriptor queue; within a task scheduling cycle, traversing each cache descriptor in the descriptor queue and respectively comparing the task scheduling codes in the traversed cache descriptors with the task scheduling codes of each execution descriptor in a preset task scheduling queue; when the result of the comparison indicates that the traversed cache descriptor and the execution descriptor in the task scheduling queue can both be processed in parallel, pushing it into the task scheduling queue. The embodiment of the present application can improve the operation efficiency of the flash memory while taking into account both the power consumption indicator and the performance indicator of the flash memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of memory, and in particular, to a descriptor scheduling method for a flash controller, a flash controller, and a storage medium. Background Art

[0002] In the technical field of memory, after a command is sent to an operation unit in NAND, NAND will have an RB time, and no operation can be performed on the same operation unit (object) during this RB time. If waiting for the RB time to expire would waste a lot of time. Therefore, in related technologies, operations on NAND are packaged into a descriptor and distributed and scheduled by a flash controller. For example, when the flash controller determines that a LUN in NAND is in the RB state, the flash controller can send a command to another LUN and periodically check whether the RB state of each LUN has ended, so as to make full use of the RB time. However, in actual applications, there are problems that multiple issued commands need to be executed in a certain order or a high concurrency is adopted, resulting in poor power consumption indicators and / or performance indicators of NAND. Therefore, in related technologies, it is difficult to balance the power consumption indicators, performance indicators, and operation efficiency of descriptors of NAND. Summary of the Invention

[0003] The main objective of the embodiments of this application is to propose a descriptor scheduling method for a flash controller, a flash controller, and a storage medium, which can improve the operation efficiency of NAND while balancing the power consumption indicators and performance indicators of NAND.

[0004] To achieve the above objective, a first aspect of the embodiments of this application proposes a descriptor scheduling method for a flash controller, the method including: obtaining a plurality of initial descriptors to be processed, and power consumption indicators and performance indicators of a flash memory connected to the flash controller; generating task scheduling codes corresponding one-to-one to the initial descriptors according to the power consumption indicators, the performance indicators, and each of the initial descriptors; combining the task scheduling codes and the corresponding initial descriptors to obtain cache descriptors corresponding one-to-one to the initial descriptors and storing them in a preset descriptor queue; during a task scheduling period, traversing each cache descriptor in the descriptor queue and respectively comparing and processing the task scheduling code in the traversed cache descriptor with the task scheduling codes of each execution descriptor in a preset task scheduling queue; when the result of the comparison and processing indicates that the traversed cache descriptor and the execution descriptors in the task scheduling queue can all be processed in parallel, taking out the traversed cache descriptor from the descriptor queue and pushing it into the task scheduling queue.

[0005] To achieve the above object, a second aspect of the embodiments of the present application provides a flash memory controller, including a reading module, a caching module, a scheduling module, and a parsing module. The reading module is configured to obtain a plurality of initial descriptors to be processed, as well as the power consumption index and performance index of the flash memory connected to the flash memory controller; the caching module is configured to generate a task scheduling code corresponding to each of the initial descriptors according to the power consumption index, the performance index, and each of the initial descriptors, and combine the task scheduling code and the corresponding initial descriptor to obtain a cache descriptor corresponding to each of the initial descriptors and store it in a preset descriptor queue; the scheduling module is configured to, within a task scheduling period, traverse each cache descriptor in the descriptor queue and respectively compare the task scheduling code in the traversed cache descriptor with the task scheduling codes of each execution descriptor in a preset task scheduling queue; the parsing module is configured to, when the result of the comparison process indicates that the traversed cache descriptor and the execution descriptor in the task scheduling queue can be processed in parallel, take out the traversed cache descriptor from the descriptor queue and push it into the task scheduling queue.

[0006] To achieve the above object, a third aspect of the embodiments of the present application provides a flash memory controller. The flash memory controller includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the descriptor scheduling method of the flash memory controller described in the first aspect above.

[0007] To achieve the above object, a fourth aspect of the embodiments of the present application provides a computer-readable storage medium. The storage medium stores a computer program. When the computer program is executed by a processor, it implements the descriptor scheduling method of the flash memory controller described in any item of the first aspect.

[0008] The descriptor scheduling method, flash memory controller, and storage medium provided by the present application generate a corresponding task scheduling code for each initial descriptor to be processed, and based on the task scheduling code of each initial descriptor to be processed and the task scheduling code of the execution descriptor, determine whether the initial descriptor to be processed and the execution descriptor can be processed concurrently. The concurrent judgment efficiency is higher. At the same time, by generating task scheduling codes based on the power consumption index, performance index, and each initial descriptor itself, the concurrent amount of NAND and the scheduling order of each initial descriptor can be dynamically controlled. Therefore, the embodiments of the present application can improve the operation efficiency of NAND while taking into account the power consumption index and performance index of NAND. Description of the Drawings

[0009] Figure 1 is a schematic diagram of the modules of the flash memory controller provided by the embodiments of the present application;

[0010] Figure 2 It is a partial structural schematic diagram of a terminal device to which the flash memory controller provided by an embodiment of the present application is applied;

[0011] Figure 3 It is a flowchart schematic diagram of a descriptor scheduling method for a flash memory controller provided by an embodiment of the present application;

[0012] Figure 4 It is a scheduling flowchart schematic diagram of an embodiment of the descriptor scheduling method for a flash memory controller provided by an embodiment of the present application;

[0013] Figure 5a It is a scheduling timing schematic diagram without scheduling in an embodiment of the descriptor scheduling method for a flash memory controller provided by an embodiment of the present application;

[0014] Figure 5b It is a scheduling timing schematic diagram for performing CE-level scheduling in an embodiment of the descriptor scheduling method for a flash memory controller provided by an embodiment of the present application;

[0015] Figure 5c It is a scheduling timing schematic diagram for performing hybrid scheduling in an embodiment of the descriptor scheduling method for a flash memory controller provided by an embodiment of the present application;

[0016] Figure 6 It is a structural schematic diagram of the hardware structure corresponding to the descriptor scheduling method for a flash memory controller provided by an embodiment of the present application. Detailed implementation manners

[0017] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0018] It should be noted that although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from the module division in the device or the order in the flowchart. Terms such as "first" and "second" in the specification, claims and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0020] First, several nouns involved in the present application are analyzed:

[0021] The RB time, which is also the busy time of the device, is the abbreviation of "Read / Busy".

[0022] PLANE, which is also the packet layer, is composed of hundreds or even thousands of Blocks. Each PLANE has a separate cache queue for managing commands with different priorities. The design of PLANE enables the flash memory to fully utilize the advantages of parallelism and achieve a doubling of performance.

[0023] LUN, which is also the Logical Unit Number, is simply referred to as the logical unit number; A LUN is the smallest independent unit in the flash memory that can execute commands and report its own status, and can also be called a Die. A LUN can have one or more PLANEs.

[0024] CE, which is also the Chip Enable, is simply referred to as the chip enable; CE is the enable signal that controls the flash memory chip. Each Target is controlled by a CE pin, and multiple LUNs on one Target share a CE signal.

[0025] In the field of memory technology, when a command is sent to an operation unit in a NAND, the NAND will have an RB time, and no operation can be performed on the same operation unit during this RB time. If waiting for the RB time blindly, a lot of time will be wasted. Therefore, in the related art, operations on the NAND are packaged into a descriptor and distributed and scheduled by a flash controller. For example, when the flash controller determines that a LUN of the NAND is in the RB state, the flash controller can send a command to another LUN and periodically check whether the RB state of each LUN ends, so as to make full use of the RB time. However, in practical applications, since the commands issued within a period of time can be operations on different LUNs or operations on different PLANEs, there is a need to execute multiple issued operations in a certain order or multiple operations are executed in parallel simultaneously, resulting in a high concurrency volume. As a result, the power consumption index and / or performance index of the NAND are poor, such as a decrease in read / write performance or an increase in power consumption. Exemplarily, for 6 operations with execution sequence requirements, they are operation 1 (read CE0 LUN0 PLANE0), operation 2 (read CE0 LUN0 PLANE 1), operation 3 (set feature, configure the warmup cycle of CE0 LUN0 to 3), operation 4 (read CE0 LUN1 PLANE 2), operation 5 (read CE0 LUN0 PLANE 2), and operation 6 (read CE0 LUN0 PLANE 3) in sequence. When operations 1 to 6 are all configured in a descriptor chain, when operation 1 is executed, operations 2 to 6 can all be executed in parallel. As a result, during actual operation, operations 1, 2, 4, 5, and 6 are executed in parallel, and finally operation 3 is executed. However, the execution of operation 3 will affect the content to be read by operations 5 and 6. Therefore, if the order of concurrent processing is not restricted, the actual operation result will be different from the expectation. Similarly, if there is no scheduling at all, each operation will be executed serially. However, the NAND actually supports concurrent operations at the PLANE level. Therefore, this method does not fully utilize the performance of the flash memory, resulting in low operation efficiency of the NAND. Similarly, in some other embodiments, even if multiple operations can be executed in parallel simultaneously, when the concurrency is high, the power consumption is higher, the temperature is also higher, and the read / write speed will correspondingly decrease. Therefore, it is difficult for the prior art to schedule descriptors to balance the power consumption index, performance index, and operation efficiency of the descriptors of the NAND. Based on this, the present application proposes a descriptor scheduling method for a flash controller, a flash controller, and a storage medium, which can improve the operation efficiency of the NAND while balancing the power consumption index and performance index of the NAND.

[0026] The descriptor scheduling method for a flash controller, the flash controller, and the storage medium provided by the embodiments of the present application will be specifically described through the following embodiments. First, the descriptor scheduling method for the flash controller in the embodiments of the present application will be described.

[0027] The flash memory controller of the present application can be used in numerous general-purpose or special-purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on. The initial descriptor scheduling method of the present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0028] Refer to the following Figure 1 As shown, the flash memory controller provided according to an embodiment of the present application includes:

[0029] A reading module 100, configured to obtain a plurality of initial descriptors to be processed, as well as the power consumption index and performance index of the flash memory connected to the flash memory controller;

[0030] A caching module 200, configured to generate task scheduling codes corresponding to the initial descriptors one by one according to the power consumption index, performance index, and each initial descriptor; and combine the task scheduling codes and the corresponding initial descriptors to obtain cache descriptors corresponding to the initial descriptors one by one and store them in a preset descriptor queue;

[0031] A scheduling module 300, configured to, within a task scheduling period, traverse each cache descriptor in the descriptor queue and respectively compare the task scheduling code in the traversed cache descriptor with the task scheduling codes of each execution descriptor in a preset task scheduling queue;

[0032] An analysis module 400, configured to, when the result of the comparison process indicates that the traversed cache descriptor and the execution descriptor in the task scheduling queue can both be processed in parallel, take out the traversed cache descriptor from the descriptor queue and push it into the task scheduling queue.

[0033] The initial descriptors to be processed are received from the processor of the terminal; each initial descriptor corresponds to a read / write operation command for one of the flash memories connected to the flash memory controller, the performance index characterizes the read / write speed of the flash memory; the power consumption index characterizes the power consumption of the flash memory, where, in some embodiments, the read / write speed can be obtained from the performance monitoring metrics of NAND, and the power consumption can be characterized by temperature.

[0034] The task scheduling encoding is used to record the scheduling method of the descriptor and the operation object parameters under the scheduling method (the operation object parameters such as LUN information, CE information, PLANE information, etc., to indicate which object is being operated on). The scheduling method characterizes the scheduling types supported by the flash memory (i.e., NAND in the following text). In some embodiments, the scheduling methods include three types: CE-level scheduling, hybrid scheduling, and serial scheduling.

[0035] Since the task scheduling encoding is generated based on performance metrics, power consumption metrics, and the content of each initial descriptor itself, the task scheduling encoding can take into account the execution order requirements between the initial descriptors, and can also take into account the performance and power consumption of the flash memory.

[0036] Each execution descriptor stored in the task scheduling queue is a descriptor that can be executed in parallel. The scheduling period is the period when the flash memory controller calls the available descriptors for execution. Therefore, by selecting, in each scheduling period, a descriptor that can be processed in parallel with the currently executing execution descriptor, multiple descriptors can be executed in parallel, thereby making full use of the inherent performance of the NAND.

[0037] When the result of the comparison process indicates that there is an execution descriptor in the task scheduling queue that needs to be processed serially with the traversed cache descriptor, the traversal of the descriptor queue is stopped, and scheduling is performed after waiting for the execution descriptor in the task scheduling queue to complete execution.

[0038] When the task scheduling queue is empty, the first cache descriptor taken out from the descriptor queue is directly placed into the task scheduling queue.

[0039] Exemplarily, referring to Figure 2 as shown, referring to Figure 2 the terminal device shown, a descriptor reader, a flash memory controller, and a NAND are provided on the terminal device. Among them, the flash memory controller is provided with a descriptor queue, a task scheduler, a task parser, and a task scheduling queue. The processor of the terminal device converts the operation command for the NAND into an initial descriptor and stores it in the descriptor reader. The processor of the flash memory controller sequentially reads multiple initial descriptors to be processed from the descriptor reader, and generates a task scheduling encoding corresponding to each initial descriptor according to the performance, power consumption of the NAND, and the multiple read initial descriptors. The task scheduling encoding and the corresponding initial descriptor are combined to obtain a cache descriptor and stored in the descriptor queue. The task scheduler sequentially reads the cache descriptor from the descriptor queue in each scheduler, and compares the task scheduling encoding in the cache descriptor read each time with the task scheduling encoding of the execution descriptor in the task scheduling queue, so as to determine whether to execute the currently read cache descriptor in parallel. The task parser controls the NAND to execute based on the execution descriptor in the task scheduling queue.

[0040] The following is a reference to Figure 3 As shown, according to the descriptor scheduling method of the flash memory controller provided by the embodiments of the present application, the method includes:

[0041] Step S100: Obtain a plurality of initial descriptors to be processed, as well as the power consumption index and performance index of the flash memory connected to the flash memory controller;

[0042] Step S200: Generate task scheduling codes corresponding one-to-one to the initial descriptors according to the power consumption index, performance index, and each initial descriptor;

[0043] Step S300: Combine the task scheduling codes and the corresponding initial descriptors to obtain cache descriptors corresponding one-to-one to the initial descriptors and save them in a preset descriptor queue;

[0044] Step S400: During the task scheduling period, traverse each cache descriptor in the descriptor queue and compare the task scheduling codes in the traversed cache descriptors with the task scheduling codes of each execution descriptor in the preset task scheduling queue respectively;

[0045] Step S500: When the result of the comparison process indicates that the traversed cache descriptor and the execution descriptor in the task scheduling queue can be processed in parallel, take out the traversed cache descriptor from the descriptor queue and push it into the task scheduling queue.

[0046] Therefore, by generating corresponding task scheduling codes for each initial descriptor to be processed, and based on the task scheduling codes of each initial descriptor to be processed and the task scheduling codes of the execution descriptors, it is determined whether the initial descriptor to be processed and the execution descriptor can be processed concurrently, and the concurrent judgment efficiency is higher. At the same time, by generating task scheduling codes based on the power consumption index, performance index, and each initial descriptor itself, the concurrent amount of NAND and the scheduling order of each initial descriptor can be dynamically controlled. Therefore, the embodiments of the present application can improve the operation efficiency of NAND while taking into account the power consumption index and performance index of NAND.

[0047] When the result of the comparison process indicates that the traversed cache descriptor and the execution descriptor cannot be processed in parallel, the traversal of the descriptor queue will be stopped during the current scheduling period.

[0048] It can be understood that the power consumption index and performance index can be used to determine the maximum concurrent amount allowed for the parallel processing of NAND, and the execution parameters carried in the initial descriptor limit the execution order that should be satisfied between any two initial descriptors. Therefore, the task scheduling codes determined based on the power consumption index, performance index, and initial descriptors can improve the operation efficiency of NAND while taking into account the power consumption index and performance index of NAND.

[0049] In some embodiments, the task scheduling encoding consists of four parts, namely the operation level field, the CE field, the LUN field, and the PLANE field. Taking the task scheduling encoding as a 9-bit encoding as an example, where each bit of the task scheduling encoding is bit[0]~bit[8], bit[0] is the operation level field, indicating the scheduling type of the operation in NAND. For example, when bit[0]=1 and the remaining bits are neither all 0 nor all 1, it indicates that the scheduling method is hybrid scheduling; when bit[0]=0 and the remaining bits are neither all 0 nor all 1, it indicates that the operation is CE scheduling. bit[2:1] is the CE field, indicating the CE number of the operation, that is, which CE will issue the operation. The numbering starts from 0. bit[4:3] is the LUN field, indicating the LUN number of the operation, that is, which LUN will issue the operation. The numbering starts from 0. bit[8:5] is the PLANE field, indicating the PLANE number of the operation, that is, which PLANE the operation object is. When the scheduling method is CE scheduling, this field is filled with 0. When the scheduling method is hybrid scheduling, the numbering starts from 0. When the scheduling method is serial scheduling, all bits are set to all 0 or 1. At this time, it is possible to quickly determine whether the initial descriptor is allowed to be executed in parallel by comparing the content filled in the task scheduling encoding of the initial descriptor with the content in the task scheduling code of the executed descriptor. Exemplarily, for example, four read operations are respectively operation 1 (read CE0 LUN0 PLANE 0), operation 2 (read CE0 LUN0 PLANE 1), operation 3 (read CE0 LUN0 PLANE 2), and operation 4 (read CE0 LUN0 PLANE 3). When the task scheduling encodings are respectively configured as 2B’000000000, 2B’000100000, 2B’001000000, 2B’001100000, the four read operations are parallel at this time, but the power consumption is relatively high. When the task scheduling encodings are respectively configured as 2B’000000000, 2B’000000000, 2B’000000000, 2B’000000000, then when operation 1 is executed, operations 2~4 will wait, and when operation 2 is executed, operations 3~4 will wait, so that the four operations are executed serially. When the task scheduling encodings are respectively configured as 2B’000000000, 2B’000000000, 2B’001000000, 2B’001100000, the first three operations are executed serially, but when the third operation is executed, the third and fourth operations can be executed in parallel.

[0050] It can be understood that according to the power consumption index, the performance index, and each initial descriptor, task scheduling encodings corresponding one-to-one to the initial descriptors are generated, including:

[0051] Determine the available concurrency of scheduling according to the power consumption index, the performance index, and the hardware parameters of the flash memory connected to the flash memory controller;

[0052] Determine the first scheduling type of each initial descriptor according to the schedulable available concurrency.

[0053] Extract the CE information, LUN information, and PLANE information from each initial descriptor.

[0054] Generate task scheduling codes corresponding one-to-one with the initial descriptors according to the first scheduling type, the corresponding CE information, LUN information, and PLANE information.

[0055] The hardware parameters can be the model, or the maximum power consumption, the minimum read / write speed, etc. configured. Based on the power consumption index, performance index, and hardware parameters, the available schedulable concurrency can be determined. Based on the descriptor queue, the number of descriptors scheduled in parallel within the scheduled period where the cache descriptor to be generated is located (i.e., the parallel scheduling occupancy) can be determined. Therefore, based on the available schedulable concurrency and the parallel scheduling occupancy corresponding to the cache descriptor to be generated, the schedulable available concurrency can be determined. In some embodiments, a variable can be set to record the parallel scheduling occupancy, and the parallel scheduling occupancy is updated each time a cache descriptor is stored in the descriptor queue, so that the parallel scheduling occupancy can represent the number of descriptors scheduled in parallel within the scheduled period where the cache descriptor to be generated is located.

[0056] The schedulable available concurrency represents the number of descriptors that NAND can execute in parallel at the current moment.

[0057] The CE information indicates the CE number for which the descriptor operates and which CE will issue it. The LUN information indicates the LUN number for which the descriptor operates and which LUN will issue it; the PLANE information indicates the PLANE number for which the descriptor operates and indicates which PLANE is the object of the operation.

[0058] When the schedulable available concurrency is 0 (i.e., concurrent scheduling is not supported), the task scheduling code of the current cache descriptor is set to all 0s or all 1s. At this time, the first scheduling type is serial scheduling. Among them, when there is a CE-level scheduling among the cache descriptors to be executed before the current cache descriptor, each character of the task scheduling code is set to the value corresponding to the CE-level scheduling (for example, if the CE-level operation is represented by 0, it is set to all 0s). When there is only a PLANE-level operation in the cache descriptors to be executed before, each character of the task scheduling code can be set to the value corresponding to the PLANE-level operation (for example, if the PLANE-level operation is represented by 1, it is set to all 1s). After the cache descriptor is cached in the descriptor queue, the corresponding parallel scheduling occupancy is updated to the initial value and recalculated.

[0059] The embodiments of the present application do not limit how to determine the first scheduling type. For example, if the descriptor is a LUN-level operation, the first scheduling type can be CE-level scheduling or serial scheduling, where serial scheduling means that the available concurrency for scheduling is 0. If the initial descriptor is a PLANE-level operation, the first scheduling type can be any one of CE-level scheduling, serial scheduling, and hybrid scheduling. When the available concurrency for scheduling is non-zero, CE-level scheduling, hybrid scheduling, or serial scheduling can be selected according to the service priority of the initial descriptor, NAND hardware resources, performance, and the execution order requirements with the previous descriptor. For example, if the current initial descriptor is a set command and there is a sequence between it and the cache descriptors that have been determined to allow parallel execution within the same scheduling period, the first scheduling type is set to serial scheduling. When there is no sequence requirement and the current hardware resources can satisfy adding a CE-level concurrent scheduling, the first scheduling type can be set to CE-level scheduling. If the current hardware resources do not satisfy adding a CE-level concurrent scheduling, the first scheduling type can be set to hybrid scheduling. Those skilled in the art can selectively set according to the actual situation. The scheduling combination type in the task scheduling queue can be identified by setting a scheduling type identifier, making the determination of the first scheduling type simpler.

[0060] It can be understood that according to the first scheduling type, the corresponding CE information, LUN information, and PLANE information, task scheduling codes corresponding to the initial descriptors are generated, including:

[0061] When the first scheduling type is CE-level scheduling, the operation level field of the initial scheduling code of the corresponding initial descriptor is set to the first value, and the fields in the initial scheduling code corresponding to the first scheduling type, CE information, and LUN information are filled respectively to obtain task scheduling codes corresponding to the initial descriptors one by one;

[0062] When the first scheduling type is hybrid scheduling, the operation level field of the initial scheduling code of the corresponding initial descriptor is set to the second value, and the fields in the initial scheduling code of the initial descriptor corresponding to the corresponding first scheduling type, CE information, LUN information, and PLANE information are filled respectively to obtain task scheduling codes corresponding to the initial descriptors one by one;

[0063] When the first scheduling type is serial scheduling, all bits of the initial scheduling code of the corresponding initial descriptor are set to 0 or 1.

[0064] By setting the hybrid scheduling method, LUN-level operations and PLANE-level operations can be scheduled simultaneously in the current task scheduling queue, so that the PLANE-level operations supported by NAND can be fully utilized, and the equal RB time can be fully utilized.

[0065] The serial scheduling indicates that the cache descriptor needs to wait for the previous cache descriptor to complete execution before it can be executed. Whether it is set to all 0s or all 1s can be determined according to the type of operation executed in the task scheduling queue. It can also be set directly, and the embodiments of the present application do not limit this.

[0066] It can be understood that according to the power consumption index, performance index, and hardware parameters of the flash memory connected to the flash memory controller, the available concurrent scheduling quantity is determined, including:

[0067] According to the hardware parameters, the read / write performance index curve and the power consumption index curve are determined;

[0068] According to the read / write performance index and the read / write performance index curve, the first remaining concurrent quantity is determined;

[0069] According to the power consumption index and the power consumption index curve, the second remaining concurrent quantity is determined;

[0070] According to the first remaining concurrent quantity and the second remaining concurrent quantity, the available concurrent scheduling quantity is determined.

[0071] It can be understood that according to the available concurrent scheduling quantity, the first scheduling type of each initial descriptor is determined, including:

[0072] According to the data of each description field in each initial descriptor, the supported second scheduling type is determined;

[0073] According to the second scheduling type, the scheduling quantity corresponding to the second scheduling type one by one is determined;

[0074] Each initial descriptor is allocated a scheduling type according to the scheduling quantity and the available concurrent scheduling quantity, and the first scheduling type of each initial descriptor is determined.

[0075] In some embodiments, the first remaining concurrent quantity and the second remaining concurrent quantity can be weighted and calculated to obtain the available concurrent scheduling quantity. At this time, by jointly judging from two dimensions, the accuracy of the available concurrent scheduling quantity can be improved.

[0076] In some embodiments, the power consumption can be determined through a temperature monitoring module. At this time, the power consumption index curve corresponds to the temperature index curve. The read / write performance index curve and the power consumption index curve can be determined through simulation data. The read / write performance index curve represents the relationship between read / write performance and the concurrent quantity, and the power consumption index curve represents the relationship between power consumption and the concurrent quantity.

[0077] It can be understood that the task scheduling code in the traversed cache descriptor is compared with the task scheduling codes of each execution descriptor in the preset task scheduling queue respectively, including:

[0078] The first execution descriptor in the task scheduling queue is used as the initial descriptor to be compared;

[0079] Perform an exclusive OR operation on the task scheduling encoding in the traversed cache descriptor and the task scheduling encoding of the initial descriptor to be compared to obtain a decision scheduling encoding;

[0080] When each field of the decision scheduling encoding indicates operations on different operation objects, take the next un-traversed execution descriptor in the task scheduling queue as the initial descriptor to be compared, and jump to the step of performing an exclusive OR operation on the task scheduling encoding in the traversed cache descriptor and the task scheduling encoding of the initial descriptor to be compared;

[0081] When each field of the decision scheduling encoding indicates operations on the same operation object, stop comparing the task scheduling encoding in the traversed cache descriptor with the task scheduling encodings of each execution descriptor in the preset task scheduling queue.

[0082] Exemplarily, taking the operation objects including LUN-level operation objects and PLANE-level operation objects as an example, refer to Figure 4 As shown, for each initial descriptor to be compared, the steps are as follows:

[0083] S1. Obtain the task scheduling encoding of the execution descriptor that has not participated in the comparison in the task scheduling queue;

[0084] S2. Perform an exclusive OR operation on the task scheduling encoding of the initial descriptor to be compared and the task scheduling encoding of the retrieved execution descriptor, and obtain the decision scheduling encoding after the exclusive OR operation.

[0085] S3. Determine whether bit[0] of the task scheduling encoding after the exclusive OR operation is 0? Otherwise, jump to S4, if yes, jump to S5; where bit[0] of the task scheduling encoding after the exclusive OR operation being 1 indicates that the command corresponding to the initial descriptor to be compared is a command of a different level from the currently executed execution descriptor. Bit[0] of the task scheduling encoding after the exclusive OR operation being 0 indicates that the command corresponding to the initial descriptor to be compared and the currently executed execution descriptor are commands of the same level.

[0086] S4. Determine whether the CE field related information, that is, bit[4:1] = 0? If bit[4:1] is 0, it indicates an operation on the same CE / LUN, then the current initial descriptor is not executed, and the comparison process of this initial descriptor to be compared is exited. If bit[4:1] is not 0, it indicates an operation on different CE / LUNs, that is, different operation objects, then the current initial descriptor can be executed; and jump to S6.

[0087] S5. Determine whether the PLANE-related information, i.e., bit[8:1]=0? If bit[8:1] is 0, the current initial descriptor cannot be executed, and the comparison process of the initial descriptor to be compared is exited. If bit[8:1] is 1, i.e., the operation objects are different, the current initial descriptor can be executed, and jump to S6.

[0088] S6: Determine whether there are uncompared execution descriptors in the task scheduling queue. If so, jump to S6; otherwise, put the initial descriptor to be compared into the task scheduling queue. That is, the initial descriptor to be compared and each execution descriptor in the execution queue can be executed in parallel only when the comparison results are all parallel executable.

[0089] After the initial descriptor to be compared is pushed into the task scheduling queue, the next initial descriptor to be compared is taken out from the descriptor queue until the initial descriptor to be compared does not meet the conditions for parallel execution or the scheduling period ends.

[0090] It can be understood that the operations of the same operation are determined through the following steps:

[0091] When the value of the operation level field of the decision scheduling code is 1, determine whether it is an operation on the same operation object according to the CE field and LUN field of the decision scheduling code;

[0092] When the value of the operation level field of the decision scheduling code is 0, determine whether it is an operation on the same operation object according to the fields other than the operation level field in the decision scheduling code.

[0093] Exemplarily, taking there are two cache descriptors in the descriptor queue and two execution descriptors in the task scheduling queue as an example, where the execution descriptors in the task scheduling queue are shown in Table 1 below:

[0094]

[0095] Table 1

[0096] The task number of the first initial descriptor is 0, and it is a PLANE-level operation on CE0, LUN0, PLNAE1. The task number of the second initial descriptor is 1, and it is a LUN-level operation on CE0 LUN0. The task scheduling number of the first initial descriptor is: 000000001. Assume that the task scheduling code of the second initial descriptor is 000000000. Then refer to Figure 2 and Figure 4As shown, the task scheduler first takes 000000001 and performs an exclusive OR operation with the task scheduling code (i.e., 000000010) of the first descriptor in the task scheduling queue, obtaining 000000011. Since bit[0]=1, it indicates that the two descriptors are operations at different levels. Then, looking at bit[4:1]=1, it shows that the operation objects are not the same CE\LUN, and the comparison passes. Next, 000000001 is exclusive ORed with the task scheduling code of the second execution descriptor in the task scheduling queue, and the result of the exclusive OR is 000100000. Since bit[0]=0, it indicates that the two descriptors are operations at the same level. Then, comparing bit[8:1]=00010000, it shows that they are different operation objects, and this also passes. Therefore, the cache descriptor corresponding to the initial descriptor 000000001 can be pushed into the task parser for execution. At this time, the task scheduling queue is as shown in Table 2 below:

[0097]

[0098] Table 2

[0099] Then the task scheduler takes the task scheduling code of the current second initial descriptor: 000000000 and compares it with the execution descriptors in the task scheduling queue respectively. First, performing an exclusive OR with the first task scheduling code gives: 000000010. Since bit[0]=0, it indicates that the two initial descriptors are operations at the same level. Then, comparing bit[8:1]=00000001, it shows that they are different operation objects, and the comparison passes. Next, taking the exclusive OR of 000000000 with the second execution descriptor in the task scheduling queue gives: 000100001. Since bit[0]=1, it indicates that the two initial descriptors are operations at different levels. Then, looking at bit[4:1]=0, it shows that the operation objects are the same object, and the comparison fails. The initial descriptor corresponding to 000000000 needs to continue waiting in the descriptor queue.

[0100] Exemplarily, referring to Figures 5a to 5c , suppose there are three initial descriptors, namely CE1 LUN0 PLANE0, CE0LUN 0 PLANE1, and CE0 LUN0 PLANE0.

[0101] As Figure 5a shown, when the task scheduling codes generated by the three initial descriptors are all 0 or all 1, that is, when there is no scheduling, at this time, the three initial descriptors are executed serially.

[0102] As Figure 5bAs shown, when the task scheduling encodings generated by the three initial descriptors are all CE-level scheduling, at this time, only CE1 LUN0 PLANE0 and CE0 LUN 0 PLANE1 execute in parallel, and CE0 LUN0 PLANE0 needs to wait for CE0 LUN 0PLANE1 to complete execution.

[0103] As Figure 5c shown, when the scheduling types of CE1 LUN0 PLANE0 and CE0 LUN 0 PLANE1 are CE-level scheduling and CE0 LUN0 PLANE0 is hybrid scheduling, at this time, CE1 LUN0 PLANE0, CE0 LUN 0 PLANE1, and CE0 LUN0PLANE0 can execute in parallel.

[0104] The embodiment of the present application also provides a flash memory controller, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the descriptor scheduling method of the above flash memory controller. The flash memory controller can be any intelligent terminal including a tablet computer, an in-vehicle computer, etc.

[0105] Please refer to Figure 6 , Figure 6 which schematically shows the hardware structure of a flash memory controller in another embodiment. The flash memory controller includes:

[0106] A processor 601, which can be implemented by a general-purpose CPU (Central Processing Unit, central processor), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present application;

[0107] A memory 602, which can be a NAND flash. The relevant program codes are stored in the memory 602, and the processor 601 is used to call and execute the descriptor scheduling method of the flash memory controller in the embodiment of the present application;

[0108] An input / output interface 603, which is used to implement information input and output;

[0109] A communication interface 604, which is used to implement communication interaction between this device and other devices. It can implement communication through a wired method (such as USB, network cable, etc.) or through a wireless method (such as mobile network, WIFI, Bluetooth, etc.);

[0110] A bus 605, which transmits information between various components of the device (such as the processor 601, the memory 602, the input / output interface 603, and the communication interface 604);

[0111] Among them, the processor 601, the memory 602, the input / output interface 603, and the communication interface 604 are communicatively connected to each other inside the device through the bus 605.

[0112] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium is a computer-readable storage medium. This storage medium stores a computer program. When the computer program is executed by the processor, it implements the descriptor scheduling method of the above flash memory controller.

[0113] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0114] The embodiments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art will know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0115] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.

[0116] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof.

[0118] In the description of this application and the above-mentioned drawings, terms such as "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0119] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects and indicates that three relationships can exist. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or its similar expression means any combination of these items, including any combination of single items (ones) or plural items (ones). For example, at least one (one) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0120] In several embodiments provided by this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above-mentioned division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in electrical, mechanical or other forms.

[0121] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0122] In addition, in each embodiment of the present application, each functional unit may be integrated into a processing unit, may exist physically alone for each unit, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present application. The foregoing storage medium includes: various media that can store programs such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0124] The preferred embodiments of the embodiments of the present application have been described above with reference to the accompanying drawings, which does not limit the scope of rights of the embodiments of the present application. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of rights of the embodiments of the present application.

Claims

1. A descriptor scheduling method for a flash memory controller, characterized in that, The method includes: Obtaining a plurality of initial descriptors to be processed, as well as the power consumption index and performance index of the flash memory connected to the flash memory controller; Generating a task scheduling code corresponding to each of the initial descriptors according to the power consumption index, the performance index, and each of the initial descriptors; Combining the task scheduling code and the corresponding initial descriptor to obtain a cache descriptor corresponding to each of the initial descriptors and storing it in a preset descriptor queue; During a task scheduling cycle, traversing each cache descriptor in the descriptor queue and respectively comparing the task scheduling code in the traversed cache descriptor with the task scheduling codes of each execution descriptor in a preset task scheduling queue; When the result of the comparison processing indicates that the traversed cache descriptor and the execution descriptor in the task scheduling queue can be processed in parallel, taking out the traversed cache descriptor from the descriptor queue and pushing it into the task scheduling queue; Wherein, the generating a task scheduling code corresponding to each of the initial descriptors according to the power consumption index, the performance index, and each of the initial descriptors includes: Determining the available scheduling concurrency according to the power consumption index, the performance index, and the hardware parameters of the flash memory; Determining the first scheduling type of each of the initial descriptors according to the available scheduling concurrency; Extracting chip enable (CE) information, logical unit number (LUN) information, and plane layer (PLANE) information from each of the initial descriptors; When the first scheduling type is CE-level scheduling, setting the operation level field of the initial scheduling code of the corresponding initial descriptor to a first value, and filling the fields corresponding to the CE information and the LUN information in the initial scheduling code respectively to obtain a task scheduling code corresponding to each of the initial descriptors; When the first scheduling type is hybrid scheduling, setting the operation level field of the initial scheduling code of the corresponding initial descriptor to a second value, and filling the fields corresponding to the CE information, the LUN information, and the PLANE information in the initial scheduling code respectively to obtain a task scheduling code corresponding to each of the initial descriptors; When the first scheduling type is serial scheduling, setting each bit of the initial scheduling code of the corresponding initial descriptor to 0 or 1.

2. The descriptor scheduling method of the flash memory controller according to claim 1, characterized in that The determining the available scheduling concurrency according to the power consumption index, the performance index, and the hardware parameters of the flash memory includes: Determining a read / write performance index curve and a power consumption index curve according to the hardware parameters; Determining a first remaining concurrency according to the read / write performance index and the read / write performance index curve; Determining a second remaining concurrency according to the power consumption index and the power consumption index curve; Determining the available scheduling concurrency according to the first remaining concurrency and the second remaining concurrency.

3. The descriptor scheduling method of the flash memory controller according to claim 2, wherein The determining the first scheduling type of each of the initial descriptors according to the available scheduling concurrency includes: Determining a supported second scheduling type according to the data of each description field in each of the initial descriptors; Determine the scheduling quantity corresponding one-to-one to the second scheduling type according to the second scheduling type; Allocate the scheduling type for each of the initial descriptors according to the scheduling quantity and the available concurrent scheduling quantity, and determine the first scheduling type of each of the initial descriptors.

4. The descriptor scheduling method of the flash memory controller according to claim 1, wherein Compare the task scheduling code in the traversed cache descriptor with the task scheduling codes of each execution descriptor in a preset task scheduling queue respectively, including: Take the first execution descriptor in the task scheduling queue as the initial descriptor to be compared; Perform exclusive OR processing on the task scheduling code in the traversed cache descriptor and the task scheduling code of the initial descriptor to be compared to obtain a decision scheduling code; When each field of the decision scheduling code indicates operations on different operation objects, take the next un-traversed execution descriptor in the task scheduling queue as the initial descriptor to be compared, and jump to the step of performing exclusive OR processing on the task scheduling code in the traversed cache descriptor and the task scheduling code of the initial descriptor to be compared; When each field of the decision scheduling code indicates operations on the same operation object, stop comparing the task scheduling code in the traversed cache descriptor with the task scheduling codes of each execution descriptor in the preset task scheduling queue.

5. The descriptor scheduling method of the flash memory controller according to claim 4, characterized in that, The operations on the same operation object are determined through the following steps: When the value of the operation level field of the decision scheduling code is 1, determine whether it is an operation on the same operation object according to the CE field and the LUN field of the decision scheduling code; When the value of the operation level field of the decision scheduling code is 0, determine whether it is an operation on the same operation object according to the fields other than the operation level field in the decision scheduling code.

6. A flash memory controller, characterized in that, Including: A reading module, configured to obtain a plurality of initial descriptors to be processed, as well as the power consumption index and performance index of a flash memory connected to the flash memory controller; A caching module, configured to generate a task scheduling code corresponding one-to-one to the initial descriptor according to the power consumption index, the performance index, and each of the initial descriptors; And combine the task scheduling code and the corresponding initial descriptor to obtain a cache descriptor corresponding one-to-one to the initial descriptor and store it in a preset descriptor queue; A scheduling module, configured to traverse each cache descriptor in the descriptor queue during a task scheduling period and compare the task scheduling code in the traversed cache descriptor with the task scheduling codes of each execution descriptor in a preset task scheduling queue respectively; An analysis module, configured to, when the result of the comparison process indicates that the traversed cache descriptor and the execution descriptor in the task scheduling queue can be processed in parallel, take out the traversed cache descriptor from the descriptor queue and push it into the task scheduling queue; Wherein, the generating a task scheduling code corresponding one-to-one to the initial descriptor according to the power consumption index, the performance index, and each of the initial descriptors includes: Determine the available concurrent scheduling quantity according to the power consumption index, the performance index, and the hardware parameters of the flash memory; Determine the first scheduling type of each of the initial descriptors according to the available concurrent scheduling amount; Extract chip enable (CE) information, logical unit number (LUN) information, and packet layer (PLANE) information from each of the initial descriptors; When the first scheduling type is CE-level scheduling, set the operation level field of the initial scheduling code of the corresponding initial descriptor to a first value, and fill the fields in the initial scheduling code corresponding to the CE information and the LUN information respectively to obtain a task scheduling code corresponding to each initial descriptor one by one; When the first scheduling type is hybrid scheduling, set the operation level field of the initial scheduling code of the corresponding initial descriptor to a second value, and fill the fields in the initial scheduling code corresponding to the CE information, the LUN information, and the PLANE information respectively to obtain a task scheduling code corresponding to each initial descriptor one by one; When the first scheduling type is serial scheduling, set each bit of the initial scheduling code of the corresponding initial descriptor to 0 or 1.

7. A flash memory controller, characterized in that, The flash memory controller includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the descriptor scheduling method of the flash memory controller described in any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the descriptor scheduling method of the flash memory controller described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Flash memory controller and method thereof for accessing flash memory particles

    CN116185892A

  • Concurrent processing method of operation request, flash memory device and storage medium

    CN119960677A