Neural network-based op dynamic allocation method and solid state disk

By introducing a pre-stored lightweight neural network model and LBA segment frequency map into the solid-state drive (SSD), the OP allocation strategy is dynamically adjusted, which solves the performance problem of SSD under complex loads and achieves efficient OP management and lifespan extension.

CN122152231APending Publication Date: 2026-06-05YEESTOR MICROELECTRONICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YEESTOR MICROELECTRONICS CO LTD
Filing Date
2026-02-09
Publication Date
2026-06-05

Smart Images

  • Figure CN122152231A_ABST
    Figure CN122152231A_ABST
Patent Text Reader

Abstract

The application discloses a neural network-based OP dynamic allocation method, which comprises the following steps: monitoring the online write request of a host in real time, obtaining LBA characteristic data that can reflect the write habit of a user, and constructing an LBA segment frequency graph; the LBA segment frequency graph comprises at least two dimensions, the first dimension represents an LBA segment interval, and the second dimension represents the write frequency within a unit data amount; the LBA segment frequency graph is input into a target neural network model, the target neural network model outputs OP optimization parameters according to the input frequency graph characteristics; and an FTL dynamically adjusts the OP allocation strategy of a solid state disk according to the OP optimization parameters. The neural network-based OP dynamic allocation method of the application introduces a pre-stored, offline trained target neural network model, and uses a two-dimensional or three-dimensional LBA segment frequency graph as input, so as to take into account the high determinacy requirement of the solid state disk and the functional requirement of intelligently dynamically allocating OP, and realize the precise and dynamic adjustment of the OP allocation strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of memory technology, and in particular to a method for dynamic OP allocation based on neural networks and a solid-state drive. Background Technology

[0002] The performance and lifespan of a solid-state drive (SSD) largely depend on the efficiency of its flash translation layer (FTL) in managing reserved space (OP). A well-designed OP allocation strategy can effectively reduce garbage collection overhead and lower write amplification, thereby increasing throughput and extending device lifespan.

[0003] Currently, the industry mainly relies on static or dynamic OP allocation strategies based on simple thresholds. Among them, static strategies set a fixed ratio at the factory, which cannot adapt to the complex and variable write loads in real-world applications (such as mixed scenarios of random database read / write and sequential video stream write), often leading to a sharp drop in performance during periods of intensive random writes or wasting storage space during sequential writes. Dynamic strategies based on simple rules (such as making small adjustments based on recent write volume) offer some improvement, but their adjustments are lagging and have a single dimension, making it impossible to learn from the spatiotemporal patterns of write requests and make forward-looking optimizations.

[0004] In recent years, artificial intelligence technologies such as neural networks have provided new ideas for system optimization. However, directly applying them to SSD FTL management, especially the core OP allocation decision, still faces fundamental challenges. First, the "black box" nature of neural networks conflicts with the stringent requirements of industrial-grade storage devices for behavioral determinism and high reliability. Second, there is a contradiction between the complex computation required for model training and the limited embedded resources of the SSD controller. Furthermore, there is a lack of a method to effectively characterize raw write requests as features strongly correlated with SSD physical processes (such as garbage collection costs), leading to a disconnect between model optimization objectives and actual hardware performance. Summary of the Invention

[0005] This application provides a neural network-based dynamic OP allocation method. By introducing a pre-stored, offline-trained target neural network model and using a two-dimensional or three-dimensional LBA segment frequency map that is easy for the neural network model to "understand and distinguish" as input, it can take into account both the high deterministic requirements of solid-state drives and the functional requirements of intelligent dynamic OP allocation, and achieve precise and dynamic adjustment of OP allocation strategy.

[0006] The technical solution to the above problems in this application is: providing a dynamic OP allocation method based on a neural network. The method is based on a target neural network model pre-stored in the solid-state drive after offline training. The method includes: real-time monitoring of the host's online write requests, obtaining LBA feature data that reflects the user's write habits, and constructing an LBA segment frequency map; the LBA segment frequency map includes at least two dimensions, where the first dimension represents the LBA segment interval and the second dimension represents the write frequency per unit data volume; inputting the LBA segment frequency map into the target neural network model, the target neural network model outputs OP optimization parameters according to the input frequency map features; and the FTL dynamically adjusts the OP allocation strategy of the solid-state drive according to the OP optimization parameters.

[0007] In some embodiments, the LBA segment frequency map also includes a third dimension, which represents the relative time order of write requests.

[0008] In some embodiments, the step of constructing the LBA segment frequency map includes: monitoring the spatiotemporal variation characteristics of the LBA distribution of the online write requests within multiple consecutive unit data volume periods; determining a threshold for evaluating the spatiotemporal variation characteristics based on the available computing resources and / or memory resources of the solid-state drive controller; comparing the spatiotemporal variation characteristics with the threshold, and adaptively selecting to construct a two-dimensional or three-dimensional LBA segment frequency map for the current statistical window based on the comparison result.

[0009] In some embodiments, the target neural network model is obtained through an offline training step, which includes: acquiring multiple sets of historical write request data, dividing the multiple sets of historical write request data into a training set and a validation set; constructing a corresponding LBA segment frequency map as training input based on the data in the training set, and labeling the optimal OP allocation policy parameters as training labels for each LBA frequency map; performing supervised training on an initial neural network model with the training input and training labels, iteratively updating the model parameters with the objective of minimizing the loss function between the prediction policy parameters and the training labels; until the model parameters converge, the target neural network model is obtained.

[0010] In some embodiments, the offline training step further includes: during the iterative update of model parameters, evaluating the current model using a validation set at multiple different training stages to obtain corresponding performance metrics; when the performance metrics reach the historical best, saving the current set of model parameters as a checkpoint; and after training is completed, determining the model parameters corresponding to the checkpoint with the best performance as the final weight parameters of the target neural network model.

[0011] In some embodiments, the offline training step further includes storing the final weight parameters in the non-volatile storage area of ​​the solid-state drive controller as a backup initial parameter set for model recovery or incremental learning.

[0012] In some embodiments, the target neural network model includes: at least one input layer for receiving an LBA segment frequency map; at least one hidden layer using a non-linear activation function for performing a non-linear transformation on the input features; and at least one output layer for outputting one or more OP optimization parameters; wherein the OP optimization parameters are used to instruct the FTL to dynamically adjust the allocation strategy of write OP and / or garbage collection OP.

[0013] In some embodiments, the step of supervised training of an initial neural network model includes: importing the training input of the current batch into the initial neural network model, processing it sequentially through an input layer, at least one hidden layer, and an output layer to obtain corresponding prediction policy parameters; calculating the loss function value between the prediction policy parameters and the corresponding training labels, and calculating the gradient of the loss function with respect to the parameters of each layer of the model from the output layer to the input layer based on the chain rule; and updating the parameters of each layer of the model along the negative gradient direction according to the calculated gradient to minimize the loss function.

[0014] In some embodiments, the method further includes a step of training a target neural network model online, the steps of which include: collecting online write requests and OP optimization parameters corresponding to each online write request output by the neural network model, monitoring and recording the operating performance of the solid-state drive under the corresponding OP optimization parameters; and using the online write requests to train the target neural network model online with the goal of optimizing the operating performance of the solid-state drive, so as to adjust and update the target neural network model.

[0015] In some embodiments, the write mode corresponding to the user's writing habits includes at least one of the following: a random write mode with high spatial locality and high temporal locality; a sequential write mode with low spatial locality; and a mixed write mode with a specific hot and cold data distribution pattern.

[0016] This application also provides a solid-state drive (SSD) including a flash memory medium and a flash memory controller. The flash memory controller is coupled to the flash memory medium and pre-stores a computer program. The flash memory controller is configured to execute the computer program to implement any of the methods described above.

[0017] The beneficial effects of this application are: 1. By introducing a pre-stored, offline-trained lightweight neural network model and limiting it to outputting OP optimization parameters without participating in real-time control flow, the problem of additional computational overhead, performance jitter, and reliability risks caused by deploying artificial intelligence models in resource-constrained embedded environments is fundamentally solved.

[0018] 2. This application transforms the original Logical Block Address (LBA) sequence into a two-dimensional LBA segment frequency map that simultaneously represents the spatial locality of writes (first dimension) and the access frequency per unit data volume (second dimension), or into a three-dimensional LBA segment frequency map that also includes temporal locality (third dimension). This allows the neural network model to "understand and distinguish" the essential differences between different application loads (such as random small file updates and sequential large file writes), thereby generating differentiated and refined OP optimization parameters for each specific write mode. This fundamentally overcomes the rigidity problem of static or simple rule-based strategies and achieves optimal global performance.

[0019] 3. The neural network model in this application has undergone thorough offline training and verification. Optimal parameters are saved using a "checkpoint" mechanism and pre-stored on the hard drive, ensuring that the device possesses stable and reliable baseline intelligence upon leaving the factory, thus meeting deterministic requirements. Furthermore, by using continuously monitored actual operating performance (such as write amplification factor) as feedback signals and establishing rigorous verification and rollback mechanisms (such as restoring backup parameters from non-volatile memory), online learning becomes a controlled and secure process. This design effectively reconciles the flexibility of intelligent algorithms with the stringent reliability requirements of embedded systems.

[0020] 4. The online fine-tuning mechanism based on operational feedback enables the model not only to adapt to general write patterns but also to continuously learn and adapt to the unique habits of specific users of the device over time, achieving long-term benefits of "getting better with use." Simultaneously, the entire solution design fully considers the resource constraints of the SSD controller. Offline training is completed in the cloud or on a server, while online inference and fine-tuning are both lightweight calculations triggered when the system is idle, avoiding interference with real-time I / O performance and achieving a balance between intelligence and efficiency. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the present application and, together with the description, serve to explain the principles of the present application. In these drawings, similar reference numerals are used to denote similar elements. The drawings described below are some embodiments of the present application, but not all embodiments. Other drawings can be obtained from these drawings by those skilled in the art without inventive effort.

[0022] Figure 1 A flowchart illustrating a neural network-based dynamic allocation method for operations (OPs) provided in this application embodiment; Figure 2 A flowchart illustrating the steps and methods for constructing an LBA segment frequency map provided in this application embodiment; Figure 3 A flowchart illustrating the offline training steps of the target network model provided in this application embodiment; Figure 4 A flowchart illustrating the online training steps of the target network model provided in this application embodiment. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0024] It should be noted that, unless otherwise specified, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device schematic diagram or the order in the flowchart.

[0025] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and are not limited in number; for example, a first object can be one or more.

[0026] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application.

[0027] In the industrial-grade solid-state drive market, static or semi-static operation allocation schemes are commonly used. The fundamental reason for this is not that the technical team "cannot think of" or "cannot make" a more intelligent dynamic solution, but rather that it is determined by the core requirements of industrial-grade scenarios, stringent constraints, and a complete business logic.

[0028] The most critical reason is that neural networks are "black boxes," and their outputs are uncertain. The same input may fluctuate slightly due to model state, quantization errors, etc., causing the operating parameters to drift. Such unpredictable slight changes are an intolerable risk for industrial customers, and can directly lead to products failing certification or being included in the procurement list.

[0029] Static or semi-static OP allocation strategies, on the other hand, do not involve uncertainty; the impact of OP size on the read / write performance and latency of the solid-state drive (SSD) under any load is predictable and modelable, which fundamentally meets the cornerstone requirements of functional safety certification and service level agreements.

[0030] In addition, industrial-grade solid-state drives also have stability requirements in terms of certification and verification costs, fault diagnosis and maintenance, supply chain and long-term supply.

[0031] Meanwhile, achieving reliable dynamic intelligence on the controller of a solid-state drive remains quite difficult; the computing power and power consumption budget of the controller chip are limited, and it is mainly used to ensure low latency and high reliability of the I / O path. Running complex neural networks (especially training) will crowd out these critical resources and may introduce unpredictable performance jitter or additional power consumption, which runs counter to the industrial-grade goal.

[0032] In the industrial market for solid-state drives, due to the extreme requirements for determinism, reliability, and maintainability, as well as the full lifecycle challenges faced by dynamic intelligence in engineering, customers are often forced to adopt suboptimal static or semi-static solutions for a long time, rather than making proactive choices. This constitutes a long-standing and unresolved technical contradiction.

[0033] Addressing the current situation where existing industrial-grade solid-state drives (SSDs) are often forced to adopt static or semi-static operation and maintenance (OP) allocation strategies, this application provides a neural network-based dynamic OP allocation method. The method aims to balance the deterministic requirements of industrial-grade SSDs with the intelligent dynamic adjustment capabilities of neural network models, and incorporates a systematic design in data acquisition and model training. The technical concept includes: introducing a pre-stored, offline-trained lightweight neural network model; introducing online learning optimization, verification, and rollback mechanisms to prevent overfitting and reduce trial-and-error costs; and ensuring that the neural network model only outputs OP optimization parameters and does not participate in real-time control flow, with the FTL (Field-Time Flow) generating the corresponding OP allocation strategy based on these parameters. This approach finds a new balance between deterministic requirements and intelligent dynamic allocation, fundamentally solving the problems of additional computational overhead, performance fluctuations, and reliability risks associated with deploying artificial intelligence models in resource-constrained embedded environments, and meeting the dynamic adjustment requirements of industrial-grade SSD OP allocation strategies.

[0034] Please see Figure 1 This application provides an embodiment of a neural network-based dynamic operation allocation method. This method is based on a target neural network model pre-stored in a solid-state drive after offline training. The entire method includes: S1: Monitor the host's online write requests in real time, obtain LBA feature data that reflects the user's writing habits, and construct an LBA segment frequency map; the LBA segment frequency map includes at least two dimensions, where the first dimension represents the LBA segment interval and the second dimension represents the write frequency per unit data volume.

[0035] S2: Input the LBA segment frequency map into the target neural network model, and the target neural network model outputs OP optimization parameters based on the input frequency map features.

[0036] S3: FTL dynamically adjusts the OP allocation strategy of the solid-state drive based on the OP optimization parameters.

[0037] Specifically, in step S1, the FTL layer of the flash memory controller intercepts each host write request command in real time and parses two parameters from the command: logical block start address (LBA_start: the logical sector number where this write begins) and write length (Size: the number of consecutive sectors to be written in this request).

[0038] Subsequently, in order to achieve efficient and well-defined statistics on the massive LBA space, this embodiment divides the entire user-addressable LBA space into N consecutive LBA segments (N is a preset fixed value, N≤256). The specific value of this segment is matched with the design of the input layer of the subsequent target neural network model to balance computational complexity and feature granularity.

[0039] Furthermore, the size of each LBA segment does not have to be exactly the same.

[0040] In some embodiments, the size of the LBA segment can be roughly aligned with the physical structure of the solid-state drive flash media (such as erase block size, parallel cell size) or the address range of a typical workload. For example, the first 5% of the LBA address space can be reserved for smaller segments to finely monitor write hotspots in the metadata area; while the remaining 95% of the space is divided into larger segments. Regardless of how the segment size is set, the total number of segments is ultimately ensured to remain constant at the preset N.

[0041] Next, a global write quantity accumulator (W_total) is introduced; whenever a write command is processed, the write length (Size) corresponding to the write command is added to the global write quantity accumulator (W_total).

[0042] A preset unit data volume statistics window (Q, for example, Q=128GB, in sector units) is used to compare the global write volume accumulator (W_total) and the unit data volume statistics window (Q) in real time. When W_total≥Q, it means that the data of a complete statistics window has been accumulated, and the following actions are immediately triggered: a. For each LBA segment (i), calculate its write frequency F[i] within this window.

[0043] b. Arrange the N values ​​from F[0] to F[N-1] in order to form a one-dimensional vector. This vector is the core data of the two-dimensional LBA segment frequency map, where: The first dimension (row) is represented by index i (0 to N-1), which represents different LBA segment intervals.

[0044] The second dimension (value) is the value of each F[i], which is the write frequency within a unit of data volume (Q).

[0045] c. After completing the data counting for the current statistics window, clear W_total to prepare for the counting of the next statistics window.

[0046] In addition, if a three-dimensional frequency map containing temporal locality is required, a historical frequency vector queue must be maintained. Each time the frequency map is generated, not only is the current vector F_current output, but it is also stored in a first-in-first-out queue of a fixed length (e.g., L=5).

[0047] Once the queue is full, the latest L frequency vectors are stacked in chronological order to form an N x L matrix. At this point, the first dimension represents the LBA segment interval (N), the second dimension represents the frequency value within a unit of data, and the third dimension represents the relative chronological order (L), i.e., the most recent L statistical windows.

[0048] This step S1 is triggered by a "unit data volume window" rather than a fixed time window, making the frequency statistics strongly correlated with the physical wear and garbage collection activity of the SSD (because wear depends on the amount of data written, not time). At the same time, its real-time, incremental computational overhead is extremely low, involving only addition, comparison, and zeroing operations, making it perfectly suited for resource-constrained embedded environments and providing stable and well-defined inputs for subsequent real-time and efficient inference of neural networks.

[0049] Please see Figure 2 In some embodiments, the step of constructing the LBA band frequency map includes: S11: Monitor the spatiotemporal variation characteristics of the LBA distribution of the online write requests within multiple consecutive unit data volume periods. S12: Based on the available computing resources and / or memory resources of the flash memory controller, determine the threshold for evaluating the spatiotemporal variation characteristics; S13: Compare the spatiotemporal variation features with the threshold, and adaptively select to construct a two-dimensional or three-dimensional LBA segment frequency map for the current statistical window based on the comparison result.

[0050] Specifically, the selection of whether to construct a two-dimensional or three-dimensional LBA segment frequency map is automatically completed by an adaptive decision-making mechanism embedded in the flash memory controller. The core logic of this mechanism lies in dynamically evaluating the temporal locality of the write load and weighing its potential optimization benefits against the additional computational and storage overhead required.

[0051] Specifically, this adaptive mechanism operates continuously: after accumulating data for a statistical window and generating the current two-dimensional frequency vector, the flash controller triggers a lightweight evaluation. The evaluation quantifies the rate and regularity of change in the write pattern over time by calculating metrics such as the offset of the write hotspot center between consecutive windows and the similarity of the frequency vector sequence. A preset threshold is determined based on the available computing resources of the flash controller, the characteristics of the flash media, and the target optimization performance. If these metrics consistently exceed the preset threshold, it indicates that the load has significant dynamic characteristics that can be modeled over time. In this case, the flash controller automatically activates the three-dimensional frequency map construction mode, merging the current vector into the historical queue to capture spatiotemporal patterns. Conversely, if the metrics show that the write hotspot remains stable over time, the efficient two-dimensional frequency map mode continues to be used to avoid unnecessary resource consumption. Furthermore, this mechanism is always linked to the flash controller's resource manager. Even in three-dimensional mode, if the flash controller's CPU or memory utilization is too high, the historical queue length will be automatically reduced or temporarily downgraded to two-dimensional mode to ensure the absolute priority of core FTL functions. This achieves intelligent optimization while ensuring the overall stability and reliability of the solid-state drive's operation.

[0052] In addition, the core principle for setting preset thresholds is that the thresholds should be able to effectively distinguish between normal changes caused by random fluctuations and significant changes that represent persistent pattern migration.

[0053] One way to determine the threshold is to run a benchmark program covering typical loads before the SSD leaves the factory or during initial configuration, recording the distribution of the evaluation metrics (such as hotspot offsets) during this process. The threshold is then set to the high percentile of this distribution (e.g., the 95th percentile), so that only the largest and most significant offsets trigger a dimensionality upgrade.

[0054] Another approach is more dynamic: the flash controller initially uses a relatively lenient threshold, continuously observing the actual optimization benefits after mode switching during operation (such as the percentage decrease in write amplification after OP adjustment), and using this feedback to dynamically fine-tune the threshold. This allows the entire mechanism to adapt to the unique writing habits of the end user. In configurations with limited hardware resources, the threshold can be actively increased to suppress the frequency of mode switching and ensure the stability of the flash controller; while in high-end models with ample resources, the threshold can be lowered to capture more subtle dynamic modes and pursue ultimate performance.

[0055] Before the solid-state drive leaves the factory, the final weight parameters of the target neural network model have been obtained through offline training. Therefore, the target neural network model based on the final weight parameters can be saved to the read-only memory or protected flash area of ​​the solid-state drive's flash controller. During the initialization phase of the flash controller, a resident memory inference engine is formed.

[0056] Therefore, after the LBA segment frequency map is constructed, the flash memory controller can input the generated LBA frequency map data into the target neural network model pre-stored in the non-volatile memory area for forward inference; the input layer of the target neural network model is designed to match the dimension of the frequency map to receive the data.

[0057] The frequency map features are then subjected to nonlinear transformation and high-level abstraction through one or more hidden layers of the target neural network model. These hidden layers employ nonlinear activation functions such as ReLU (Rectified Linear Unit) and Sigmoid activation function to extract deep and complex patterns of the write load in the spatial and temporal dimensions.

[0058] Finally, the model's output layer outputs one or more OP optimization parameters based on the learned patterns.

[0059] In some embodiments, the output layer may generate two explicit parameters: one is the write OP pool size parameter, used to suggest the proportion of extra space reserved for write operations; the other is the garbage collection OP pool sensitivity parameter, used to suggest the reserved space for the garbage collection process or to regulate its triggering enthusiasm. For example, the model may output a specific combination of parameters, which constitutes the core decision basis for driving the FTL to dynamically adjust its allocation strategy.

[0060] The FTL (Flash Translation Layer) firmware module receives and parses OP optimization parameters from the neural network model in real time, dynamically adjusting the physical space management strategy of the SSD accordingly. This adjustment is primarily reflected in two core aspects: First, dynamic write OP management. Based on the write pool size recommendations in the parameters, FTL dynamically adjusts the global mapping table and allocates a corresponding proportion of blank physical blocks as a dedicated write buffer pool. This efficiently absorbs random write loads, reduces direct impact on data blocks, thereby reducing write amplification and improving instantaneous write bandwidth. Second, an adaptive garbage collection strategy. FTL incorporates the garbage collection sensitivity recommendations in the parameters into its garbage collection algorithm. By adjusting the threshold for the number of blank blocks that trigger garbage collection and selecting data migration strategies, it balances the efficiency of garbage collection with the real-time response performance of the flash controller. For example, when the model determines that the current write pressure is high, its output parameters guide FTL to adopt a more aggressive, speed-prioritized garbage collection mode; while under lighter loads, the parameters guide FTL to switch to a garbage collection mode that focuses more on long-term wear leveling.

[0061] Through the aforementioned dynamic adjustment mechanism based on real-time perception and decision-making using neural networks, solid-state drives (SSDs) can precisely match their internal storage resource allocation strategy with the characteristics of the actual external workload. This allows the flash memory controller to intelligently optimize resources, whether facing continuous high-pressure random writes or drastically changing mixed loads, thereby maintaining a low write amplification factor, stable tail latency of write requests, and helping to extend the overall lifespan of the flash memory media during long-term operation.

[0062] Please see Figure 3 In some embodiments, the target neural network model is obtained through an offline training step, which includes: S21: Obtain multiple sets of historical write request data, and divide the multiple sets of historical write request data into a training set and a validation set; S22: Based on the data in the training set, construct the corresponding LBA segment frequency map as training input, and label each LBA frequency map with the optimal OP allocation strategy parameters as training labels. S23: Using the training input and training labels, supervise the training of an initial neural network model, and iteratively update the model parameters with the goal of minimizing the loss function between the prediction policy parameters and the training labels. S24: Until the model parameters converge, the target neural network model is obtained.

[0063] Specifically, multiple sets of historical write request data are first collected from a large number of deployed solid-state drives to form the raw dataset.

[0064] The dataset is then randomly divided into non-overlapping training and validation sets according to a preset ratio, for example, a 7:3 ratio. Based on the divided training set data, corresponding LBA segment frequency map samples are generated using the same method as the online construction, serving as training input. Simultaneously, the storage expert system or high-precision simulator reverse-engineers the optimal OP allocation strategy parameters based on the optimal hard drive performance (such as the lowest write amplification factor and the most stable latency) corresponding to each set of data, and uses these parameters as training labels that strictly correspond to the training input, thus forming a complete supervised learning sample pair.

[0065] At the start of training, an initial neural network model with a specific number of layers, nodes, and non-linear activation functions is initialized. The training process is iterative. In each iteration, a small batch of training inputs is extracted from the training set, and forward propagation is performed to obtain the policy parameters predicted by the model. Next, the loss function value (e.g., mean squared error) between these predicted parameters and the true training labels is calculated. Then, the gradient of the loss function with respect to the weights of each layer of the model is calculated using the backpropagation algorithm and the chain rule. Finally, an optimization algorithm such as stochastic gradient descent or its variants (e.g., Adam) is used to update all weight parameters of the model according to the gradient direction to gradually minimize the loss function. This iterative process continues until the loss function value of the model on the training set tends to stabilize, reaching a convergent state.

[0066] Throughout the training iterations, the flash controller synchronously monitors and evaluates model performance using the validation set.

[0067] Specifically, after each complete training cycle (i.e., traversing the training set once), or after every fixed number of iterations, or after every fixed or variable time interval, the current model is used to perform forward inference on all samples in the validation set, and its overall performance metrics (such as prediction accuracy or error) on the entire validation set are calculated. The flash controller continuously tracks the historical best value of this performance metric, and when the metric reaches a new historical best, the current set of weight parameters of the model is completely saved as a checkpoint file.

[0068] When training ends due to convergence, the flash controller does not directly use the model parameters from the last iteration. Instead, it selects the set of parameters that has the best performance on the validation set from all the saved checkpoints and determines them as the weights of the final target neural network model.

[0069] This mechanism aims to prevent the model from overfitting the training data and ensure that it has the best generalization ability.

[0070] Finally, the target neural network model trained and selected through this process is solidified into a binary file and burned into the non-volatile memory of the flash memory controller for online deployment.

[0071] In some embodiments, the target neural network model includes: at least one input layer for receiving the LBA segment frequency map; at least one hidden layer using a non-linear activation function for performing a non-linear transformation on the input features; and at least one output layer for outputting one or more OP optimization parameters; wherein the OP optimization parameters are used to instruct the FTL to dynamically adjust the allocation strategy of write OP and / or garbage collection OP.

[0072] Specifically, the node dimension of the input layer strictly corresponds to the dimension of the LBA segment frequency map. When the input is a two-dimensional frequency map (an N-dimensional vector representing the writing frequency of each LBA segment within the current unit data volume), the input layer is set to N neurons, and each neuron receives the frequency value of an LBA segment. If the input is a three-dimensional frequency map containing a time series (an L×N matrix, where L represents the number of consecutive unit data volume periods), the input layer can be designed to have L×N neurons, or the matrix can be first converted into a one-dimensional long vector through a flattening operation before being input.

[0073] Each hidden layer consists of several neurons, with full connectivity between layers. Each neuron performs a weighted summation of all its received inputs and applies a non-linear activation function, such as ReLU (Rectified Linear Unit) or the Sigmoid function, to introduce non-linear expressive power. This allows the model to learn and fit the complex, non-linear mapping from LBA frequency patterns to optimal operating parameters. The number of hidden layers and the number of neurons per layer are configurable hyperparameters that can be designed to balance model complexity with the computational power of the flash controller.

[0074] The output layer is configured to output two independent OP optimization parameters with clear physical meaning. The first parameter is the write OP weight coefficient, which is a value between 0 and 1, used to indicate how the FTL should dynamically adjust the proportion of space reserved to directly respond to host writes. The second parameter is the garbage collection OP sensitivity coefficient, which is also a standardized value, used to indicate the triggering positivity of the FTL's internal garbage collection mechanism and space reservation strategy.

[0075] Through training, the model can precisely match the output parameters to the write load characteristics reflected in the input frequency map. Specifically, when the input frequency map exhibits a random write pattern with high spatial and temporal locality (e.g., frequent updates of small amounts of metadata or database indexes by the operating system), the model tends to output higher write OP weight coefficients and higher garbage collection sensitivity coefficients, guiding the FTL to reserve sufficient buffer space and maintain an active garbage collection state to cope with intensive random updates. When the input reflects a continuous sequential write pattern with low spatial locality (e.g., continuous large file writing or video recording), the model outputs lower coefficients, instructing the FTL to reduce the OP reservation ratio, allocate more physical space directly to sequential data streams, and slow down the garbage collection frequency. For mixed write patterns with specific hot and cold data distribution patterns (common in multi-tasking application environments where hot and cold data regions coexist), the model can output dynamically balanced parameters, suggesting temporarily increasing OP resources in the high-frequency LBA segment corresponding to hot regions, and suggesting releasing resources in the low-frequency segment, thereby achieving refined spatial strategy adjustments that match the hot and cold characteristics of the data.

[0076] The model's ability to recognize the current write pattern does not stem from a pre-set rule base or conditional judgments, but rather from the intelligence that naturally emerges from the complex nonlinear mapping function formed after training on massive amounts of data. As a multi-layered feature processor, the model's recognition process begins with deep feature analysis of the input LBA segment frequency map. The frequency map itself is a highly condensed statistical projection of write behavior in the logical address space and time dimension. As this data flows through multiple hidden layers of the model, each layer performs a progressive feature abstraction and transformation through a nonlinear activation function: shallow neurons first capture basic statistical features, such as the entropy, number of peaks, and intensity of the entire frequency vector, which directly correspond to the strength of the spatial locality of the write request; if the input includes a time dimension, deep neurons further correlate and compare these spatial features in the time series, thereby extracting temporal locality patterns such as hotspot stability, periodicity, or migration trends. Through hierarchical progressive computation, the entire network ultimately fuses and transforms the original frequency map numerical sequence into a series of high-dimensional, abstract pattern representations.

[0077] This mapping from specific statistical features to abstract pattern representations is entirely ingrained into the model's weight parameters through offline supervised learning. During training, the model is exposed to massive amounts of labeled samples, each containing optimal operating parameters (OPs) determined by expert systems or high-fidelity simulations for a specific frequency map pattern. Through repeated forward inference and backpropagation, the model continuously adjusts its millions of connection weights, with the sole goal of making its output infinitely close to these optimal labels. This process essentially forces the model to spontaneously learn and memorize the complex correspondence between various frequency map feature patterns (such as the high spatiotemporal locality of sharp peaks and stable sequences, the sequential flow represented by flat and high-value vectors, or the mixed hot and cold distribution of high and low frequency bands) and the optimal OP parameter combinations. Therefore, when deployed online, the forward computation completed instantly by the model in the face of real-time frequency map input is essentially performing a "pattern recognition" and "policy retrieval" based on all its learned knowledge, from features to decisions. It is not looking for a label, but finding the parameter point in the continuous solution space that best matches the current input features. This point corresponds to the optimal dynamic OP allocation strategy adapted to the current write mode that has been "identified".

[0078] In some embodiments, the offline training step further includes storing the final weight parameters in the non-volatile storage area of ​​the flash controller as a backup initial parameter set for model recovery or incremental learning.

[0079] Specifically, to ensure that solid-state drives can maintain basic performance and reliability under any extreme or abnormal write load, the flash controller has a pre-defined, fully validated, and safe range of OP allocation policy values ​​for different physical flash memory configurations and durability levels. This range defines the upper and lower limits of the write OP ratio and the recycling sensitivity coefficient, forming a reliable operating range.

[0080] During operation, when the actual allocation strategy value (such as the proportion of reserved physical blocks) corresponding to the OP optimization parameters output by the target neural network model based on the real-time LBA frequency map and calculated by FTL conversion exceeds this safety range, the flash controller will immediately trigger the safety protection mechanism; the core logic of this mechanism is not simply to trim the parameters, but to perform an intelligent decision switch.

[0081] Specifically, when the actual allocation strategy value (such as the proportion of reserved physical blocks) after FTL conversion calculation exceeds this safety range, the flash controller will determine that the inference result of the current model under a specific load has deviated from the optimal or safe track, thereby automatically suspending the use of the dynamic parameters output this time and immediately enabling the backup initial parameter set; after enabling the backup parameters, FTL will allocate resources according to the safety policy indicated by this set of parameters, thereby ensuring that the hard drive immediately returns to a known safe operating state with good performance and wear balance.

[0082] This set of backup parameters is usually derived from a stable and conservative model checkpoint or a set of fixed empirical values ​​saved before the hard drive of this model leaves the factory after offline training and optimization for various typical benchmark loads.

[0083] At the same time, the flash memory controller will record the abnormal frequency map samples that triggered the safety switch, the original output parameters of the model, and the corresponding load information into a specific non-volatile log area. This log data will be used as important training data for incremental learning or version updates of the target neural network model when the hard drive is idle or after being recycled by professional tools, in order to optimize the model in future versions and keep its output intelligently within a range that is both safe and efficient.

[0084] Please see Figure 4 In some embodiments, the method further includes a step of training the target neural network model online, the step comprising: S31: Collect the online write requests and the corresponding OP optimization parameters output by the neural network model, and monitor and record the operating performance of the solid-state drive under the corresponding OP optimization parameters; S32: With the goal of optimizing the operating performance of the solid-state drive, the target neural network model is trained online using the online write request, so as to adjust and update the target neural network model.

[0085] Specifically, after the solid-state drive is put into actual use, its flash memory controller can further perform online training steps on the target neural network model to achieve continuous optimization and personalized adaptation of the model.

[0086] This process occurs silently in the background, and its core lies in forming a closed loop of "perception-decision-feedback-learning". Specifically, a dedicated data collection module within the flash memory controller works continuously: it not only records the LBA frequency map corresponding to each batch of online write requests, but also associates and records the OP optimization parameters output by the target neural network model based on this frequency map, and sends this set of parameters to the FTL for execution.

[0087] Subsequently, a performance monitoring module within the flash controller precisely measures and records key performance indicators of the solid-state drive during the period when this set of parameters is in effect, such as changes in write amplification factor (WAF), average and tail write latency, and the actual overhead and efficiency of garbage collection operations. This associated data (input frequency plot, model output parameters, and final performance results) is securely stored as a complete set of training samples in a dedicated non-volatile area on the flash media.

[0088] Online training itself does not continuously consume resources, but is triggered by a set of intelligent scheduling strategies; for example, the training task will only be activated when the accumulated number of samples reaches a preset batch size and the controller detects that it is in an idle or low-power state.

[0089] The training process takes place in a protected, isolated computing environment within the controller. It is essentially a lightweight incremental learning or fine-tuning process. Its direct goal is to optimize the previously recorded performance metrics (such as minimizing the long-term average WAF). It uses newly collected batches of samples to train the current model for one or more rounds of iteration. Moreover, to prevent performance fluctuations or "forgetting" old knowledge after the model is updated, the training process usually adopts a conservative learning rate and may mix new samples with a portion of previously stored typical samples for training.

[0090] After completing a round of training and validation, the newly generated model parameters will be used as an incremental update package to safely replace some weights in the original model in an atomic manner. Throughout the process, the system always retains the previous stable version of the model as a backup. If a key performance indicator is detected to deteriorate after the update, the system will automatically roll back to the previous version to ensure the absolute safety of online learning. Through this mechanism, the target neural network model can gradually adapt to the unique writing habits of its deployment environment, realizing the evolution from general intelligence to individual optimization, thereby continuously improving storage efficiency and reliability throughout the product's entire lifecycle.

[0091] This complete closed-loop mechanism, encompassing real-time monitoring, boundary violation detection, security switching, and post-event learning, fundamentally enhances the robustness and practicality of AI-based storage management systems, enabling them to fully leverage their intelligent optimization potential while maintaining a solid operational safety baseline.

[0092] Furthermore, embodiments of this application also propose a solid-state drive (SSD) comprising a flash memory medium and a flash memory controller. The flash memory controller is coupled to the flash memory medium and pre-stores a computer program. The flash memory controller is configured to execute the computer program to implement the method described at any end of the above embodiments. For example, the SSD can be: an enterprise-grade SSD for data centers targeting high-performance computing and core business applications; a storage server SSD for cold, warm, and hot data tiering on large internet platforms; or a high-reliability SSD applied to extreme environments such as industrial computing and vehicle data recording.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above, which are not provided in detail for the sake of brevity; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for dynamic allocation of operations (OPs) based on neural networks, characterized in that, The method is based on a target neural network model that has been trained offline and pre-stored in a solid-state drive. The method includes: Real-time monitoring of online write requests on the host, acquisition of LBA characteristic data reflecting user write habits, and construction of LBA segment frequency map; The LBA segment frequency graph includes at least two dimensions, where the first dimension represents the LBA segment interval and the second dimension represents the write frequency per unit data volume. The LBA segment frequency map is input into the target neural network model, and the target neural network model outputs OP optimization parameters based on the characteristics of the input frequency map. FTL dynamically adjusts the OP allocation strategy of the solid-state drive based on the OP optimization parameters.

2. The method as described in claim 1, characterized in that, The LBA segment frequency map also includes a third dimension, which represents the relative time order of write requests.

3. The method as described in claim 2, characterized in that, The steps for constructing the LBA segment frequency map include: Within multiple consecutive unit data volume periods, monitor the spatiotemporal variation characteristics of the LBA distribution of the online write requests; Based on the available computing and / or memory resources of the solid-state drive controller, a threshold for evaluating the spatiotemporal variation characteristics is determined; The spatiotemporal variation features are compared with the threshold, and based on the comparison results, a two-dimensional or three-dimensional LBA segment frequency map is adaptively selected and constructed for the current statistical window.

4. The method as described in claim 1, characterized in that, The target neural network model is obtained through an offline training step, which includes: Obtain multiple sets of historical write request data, and divide the multiple sets of historical write request data into a training set and a validation set; Based on the data in the training set, a corresponding LBA segment frequency map is constructed as the training input, and the optimal OP allocation strategy parameters are labeled for each LBA frequency map as training labels. Using the training input and training labels, supervised training is performed on an initial neural network model, with the goal of minimizing the loss function between the prediction policy parameters and the training labels, and the model parameters are iteratively updated. The target neural network model is obtained by continuing until the model parameters converge.

5. The method as described in claim 4, characterized in that, The offline training step also includes: During the iterative update of model parameters, the current model is evaluated using the validation set at multiple different training stages to obtain corresponding performance metrics. When the performance metric reaches its historical best, the current set of model parameters is saved as a checkpoint. After training is completed, the model parameters corresponding to the checkpoint with the best performance are determined as the final weight parameters of the target neural network model.

6. The method as described in claim 5, characterized in that, The offline training step also includes: The final weight parameters are stored in the non-volatile storage area of ​​the solid-state drive controller as a backup initial parameter set for model recovery or incremental learning.

7. The method as described in claim 1, characterized in that, The target neural network model includes: At least one input layer for receiving the LBA band frequency map; At least one hidden layer uses a non-linear activation function to perform a non-linear transformation on the input features; At least one output layer is provided for outputting one or more OP optimization parameters; wherein the OP optimization parameters are used to instruct the FTL to dynamically adjust the allocation strategy of write OP and / or garbage collection OP.

8. The method as described in claim 1, characterized in that, The method further includes a step of training the target neural network model online, the step comprising: Collect the online write request data and the OP optimization parameters corresponding to each online write request output by the neural network model, monitor and record the operating performance of the solid-state drive under the corresponding OP optimization parameters; With the goal of optimizing the operating performance of the solid-state drive, the online write request data is used to train the target neural network model online, so as to adjust and update the target neural network model.

9. The method as described in claim 1, characterized in that, The write modes corresponding to user writing habits include at least one of the following: Random write modes with high spatial locality and high temporal locality; A sequential write mode with low spatial locality; A hybrid write mode with specific hot and cold data distribution patterns.

10. A solid-state drive, characterized in that, include: Flash memory media; A flash memory controller coupled to the flash memory medium and pre-stored with a computer program, the flash memory controller being configured to execute the computer program to implement the method of any one of claims 1-9.