Storage resource dynamic allocation method and device, computer equipment and storage medium

By obtaining the storage load data of virtual functions to generate load prediction data, combined with the dynamic reserved space allocation strategy, the resource competition and performance fluctuations in a single input and output virtualization scenario are solved, and more efficient resource management and flash wear balance are achieved, improving service quality.

CN120371549AActive Publication Date: 2025-07-25SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD

Patent Information

Application Number
CN202510874699.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-07-25
Estimated Expiration
2045-06-27

AI Technical Summary

Technical Problem

In a single input and output virtualization scenario, the allocation of static reserved space on solid-state drives leads to resource competition, software monitoring delays and lack of prediction capabilities, resulting in performance fluctuations and unbalanced flash wear, affecting service quality.

Method used

By obtaining the storage load data of virtual functions, generating load prediction data, combining dynamic reserved space allocation strategies, adjusting the state of physical block resources in real time, building a real-time and predictive resource scheduling mechanism, and optimizing resource allocation and management.

Benefits of technology

It improves the dynamic scheduling efficiency of storage resources, enhances the system's ability to adapt to burst loads, reduces the delay jitter amplitude, and balances flash memory wear, and improves service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371549A_ABST
    Figure CN120371549A_ABST
Patent Text Reader

Abstract

The invention discloses a storage resource dynamic allocation method and device, computer equipment and a storage medium, and relates to the technical field of computers, and the method comprises the steps: obtaining storage load data of each virtual function, generating load prediction data, and achieving the self-adaptive adjustment of a physical block resource state in combination with a dynamic reserved space allocation strategy. A traditional static distribution and lagging monitoring mode is changed, and a resource scheduling mechanism with real-time performance and predictability is constructed. The problem of performance fluctuation caused by static reserved space distribution, software monitoring delay and prediction capability deficiency in a single-root input and output virtualization scene is solved, and the purposes of improving the dynamic scheduling efficiency of storage resources, enhancing the adaptive capacity of a system to burst loads, reducing the delay jitter amplitude and improving the performance of the system are achieved. And the wear of the flash memory is balanced through fine management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies, and particularly to a method and apparatus for dynamically allocating storage resources, a computer device, and a storage medium. Background Art

[0002] In cloud computing and edge computing, solid-state drives (SSDs) use single-root input / output virtualization technology to divide physical storage resources into multiple virtual functions, enabling virtual machines to directly access underlying hardware and reducing virtualization resource consumption. However, in this environment, there are three major problems in the management of SSD reserved space: garbage collection of high-load virtual functions preempts resources, leading to a soaring delay of low-priority virtual functions; a fixed reserved space ratio cannot adapt to sudden changes in the input / output operation rate and bandwidth requirements among virtual functions; uneven flash wear causes an increase in bad blocks, resulting in longer error correction delays and throughput fluctuations, and traditional management mechanisms are difficult to meet the strict requirements of cloud computing for service quality.

[0003] There are many deficiencies in the service quality management of existing technologies in the single-root input / output virtualization scenario: fixed reserved space allocation causes resource competition, resulting in large delay fluctuations for high-load virtual functions and delays exceeding the threshold for low-priority virtual functions; the software polling control method has a high monitoring delay and occupies central processing unit resources, making it impossible to respond to sudden loads in a timely manner; static service quality policies cannot adapt to changes in load types and do not consider the flash health status, affecting service quality; hardware acceleration monitoring lacks fine-grained management at the virtual function level and relies on preset rules, making it difficult to learn complex load patterns. Summary of the Invention

[0004] This application provides a method and apparatus for dynamically allocating storage resources, a computer device, and a storage medium, so as to at least solve the problem of performance fluctuations caused by static reserved space allocation, software monitoring delay, and lack of prediction ability in the single-root input / output virtualization scenario in related technologies.

[0005] This application provides a method for dynamically allocating storage resources, including: Obtaining storage load data collected by each virtual function; Generating load prediction data based on the storage load data, and determining a corresponding reserved space allocation strategy based on the load prediction data; Adjusting the resource status of physical blocks in the dynamic reserved space resource pool according to the reserved space allocation strategy to obtain an updated reserved space resource status.

[0006] This application also provides an apparatus for dynamically allocating storage resources, including: An obtaining module, configured to obtain storage load data collected by each virtual function; A generation module, configured to generate load prediction data based on stored load data, and determine a corresponding reserved space allocation policy based on the load prediction data; An adjustment module, configured to adjust the resource status of physical blocks in the dynamic reserved space resource pool according to the reserved space allocation policy, so as to obtain an updated reserved space resource status.

[0007] This application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above storage resource dynamic allocation methods when executing the computer program.

[0008] This application also provides a computer-readable storage medium, in which a computer program is stored, and wherein the computer program implements the steps of any of the above storage resource dynamic allocation methods when executed by a processor.

[0009] This application also provides a computer program product, including a computer program, and the computer program implements the steps of any of the above storage resource dynamic allocation methods when executed by a processor.

[0010] Through this application, since the virtual function storage load data is obtained in real time and prediction data is generated, and the adaptive adjustment of the physical block resource status is realized in combination with the dynamic reserved space allocation policy, the lag of traditional static reserved space allocation and software polling monitoring is changed, and a resource scheduling mechanism with both real-time and predictability is constructed. Therefore, it can solve the technical problems such as resource competition caused by static allocation in the single root input / output virtualization scenario, response lag caused by software monitoring delay, and load fluctuation caused by lack of prediction ability, and achieve the technical effects of improving the dynamic scheduling efficiency of storage resources, enhancing the system's adaptability to burst loads, reducing the delay jitter amplitude, and balancing flash wear through refined resource management. Description of the Drawings

[0011] In order to more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.

[0012] Figure 1 It is a schematic flowchart of a storage resource dynamic allocation method provided by an embodiment of the present application; Figure 2 It is a schematic architecture diagram of an SSD dynamic reserved space allocation module provided by an embodiment of the present application; Figure 3 It is a schematic architecture diagram of an NVMe SSD system provided by an embodiment of the present application; Figure 4 Schematic diagram of the link logic of the machine learning dynamic prediction module provided by the embodiment of the present application; Figure 5 Block diagram of the storage resource dynamic allocation device provided by the embodiment of the present application; Figure 6 Schematic diagram of the hardware structure of the computer device provided by the embodiment of the present application. Detailed implementation manners

[0013] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.

[0014] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0015] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0016] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the storage resource dynamic allocation method depends, the specific application environment architecture or specific hardware architecture is described herein.

[0017] An embodiment of the present application provides a storage resource dynamic allocation method, Figure 1 which is a flowchart of the storage resource dynamic allocation method according to the embodiment of the present invention, as Figure 1 shown, and the process includes the following steps: Step S101, obtain the storage load data collected by each virtual function.

[0018] It should be noted that the virtual function (VF) is a logical functional unit that can independently perform resource allocation and performance statistics in scenarios such as storage systems. Each virtual function can be regarded as an independent small storage entity, used to distinguish different storage usage scenarios or users, etc. Storage load data reflects the load situation of the storage system during operation, including dimensional information such as operation frequency, bandwidth, garbage collection frequency, and raw bit error rate, and is used for subsequent analysis of the storage system status, prediction of load, and optimization of resource allocation.

[0019] In the embodiment of the present application, the method for collecting storage load data includes: For collecting the operation frequency: Configure a dedicated hardware counter for each virtual function. When the input / output command corresponding to the virtual function is completed, the count value of the hardware counter is incremented. Since the number of operations per second needs to be obtained, use the 1ms timer inside the FPGA to trigger the latch of the current counter value at regular intervals. After latching, clear the counter, and then through conversion (the latched value corresponds to the number of operations within 1ms, multiplying by 1000 gives the number of operations per second), obtain the operation frequency of the virtual function.

[0020] For collecting the bandwidth and garbage collection frequency: The bandwidth is monitored through the data bus. Embed a lightweight DMA controller in the FPGA to count the amount of data transmitted (in bytes) of the read / write data stream of each virtual function within a 1ms time window, and then convert the data volume into a bandwidth value in Gbps. The garbage collection frequency is to use the FPGA pin to connect to the garbage collection start signal line of the flash translation layer, and use the edge detection circuit of the FPGA to count the number of trigger times of the garbage collection trigger signal within a 1ms window, and this number is the garbage collection frequency (times / ms).

[0021] For collecting the raw bit error rate: Before LDPC decoding, capture the raw data of the NAND page (including ECC parity bits), and at the same time obtain the error correction data after LDPC decoding. Compare these two types of data, count the number of bit errors, and then calculate the raw bit error rate (RBER).

[0022] Step S102, generate load prediction data according to the storage load data, and determine the corresponding reserved space allocation strategy based on the load prediction data.

[0023] It should be noted that the load prediction data is data obtained by inferring the future load situation of the storage system (such as the change trend of operation frequency, bandwidth, etc.), and is used to predict the storage resource requirements. The reserved space allocation strategy (OP allocation strategy) is a plan to adjust the physical block resource allocation in the dynamic reserved space resource pool based on the load prediction result to adapt to the change of storage load.

[0024] In the embodiment of the present application, the specific process of generating load prediction data includes: obtaining the historical storage load data and the corresponding historical state value of the previous time step; combining the storage load data with the historical storage load data to obtain a state control parameter; using the state control parameter to perform a fusion calculation on the storage load data and the historical state value to obtain the current state value; determining the corresponding load prediction data based on the current state value. The specific process of determining the corresponding reserved space allocation strategy based on the load prediction data includes: constructing a state space based on the load prediction data and a preset load type; selecting an allocation ratio adjustment action that matches the state space from the preset action space, executing the allocation ratio adjustment action to obtain feedback information; converting the feedback information into a policy optimization signal, and using the policy optimization signal to iteratively update the allocation ratio adjustment action until the feedback information meets the preset conditions to obtain the reserved space allocation strategy.

[0025] Step S103, adjust the resource status of the physical blocks in the dynamic reserved space resource pool according to the reserved space allocation strategy to obtain the updated reserved space resource status.

[0026] It should be noted that the dynamic reserved space resource pool includes a global resource pool and independent resource pools corresponding to each virtual function (VF). The global resource pool is used to uniformly manage the physical block resources of the storage system, and a global status mapping table is set to record the status identifiers (idle or allocated) of the physical blocks; the independent resource pools corresponding to the virtual functions allocate resources from the global resource pool, and a resource allocation linked list is provided to record the capacity information of each physical block under this virtual function. Adjusting the resource status is based on the reserved space allocation strategy to change the allocation status of the physical blocks in the dynamic reserved space resource pool, such as allocating the idle blocks in the global resource pool to the virtual function, or releasing the blocks no longer needed by the virtual function back to the global resource pool.

[0027] In the embodiment of the present application, adjusting the resource status of the physical blocks in the dynamic reserved space resource pool according to the reserved space allocation strategy to obtain the updated reserved space resource status, the specific process includes: determining the amount of reserved space resources to be released according to the reserved space allocation strategy; determining the number of physical blocks according to the amount of reserved space resources to be released; querying for continuous idle physical blocks that meet the number of physical blocks in the global status mapping table, and using the continuous idle physical blocks as the target physical blocks; if there are no continuous idle physical blocks that meet the number of physical blocks, allocate multiple non - continuous idle physical blocks according to the number of physical blocks, and use the non - continuous idle physical blocks as the target physical blocks; removing the capacity information of the target physical blocks from the resource allocation linked list, and marking the target physical blocks as the allocated state in the global status mapping table.

[0028] In the embodiments of the present application, the stored load data includes data of multiple preset load types. The preset load types include operation frequency type, bandwidth type, garbage collection frequency type, and bit error rate type. The method for collecting the stored load data includes the following steps A1 - A4: Step A1: Configure a hardware counter for each virtual function, use the hardware counter to increment the count value when the input / output command is completed, and convert the count value into an operation frequency.

[0029] Specifically, the hardware counter is a 32 - bit hardware counting device exclusively configured for each virtual function, and is used to count the number of operations related to the virtual function. Input / output command (I / O command): Read, write, and other operation instructions performed on the virtual function in the storage system, and there will be corresponding feedback when the command is completed. Operation frequency (IOPS): That is, the number of input / output operations per second, reflecting the operation busy degree of the virtual function.

[0030] For each virtual function (VF), at the hardware level (such as in a hardware environment like FPGA), allocate an independent 32 - bit hardware counter for it. This counter serves as the basic hardware unit for specifically counting the number of operations of this virtual function. When the input / output (I / O) command corresponding to the virtual function is completed (for example, when the read command or write command is executed and the completion signal is passed back to the completion queue CQ), the count value of the hardware counter will automatically increment to record this I / O operation. Use the 1ms timer inside the FPGA. When the timer reaches 1ms, it triggers the action of latching the counter value, locks and saves the count value recorded by the current counter, and then clears the counter to count the number of operations in the next 1ms. Since the latched value is the number of I / O operations completed by the virtual function within 1ms, multiply it by 1000 (1 second contains 1000 1ms), and the obtained value after conversion is the number of I / O operations completed by this virtual function per second, that is, the operation frequency (IOPS). In this way, by configuring an exclusive hardware counter for each virtual function, using the completion event of the I / O command to trigger counting, and combining timer latching and conversion, the collection of the operation frequency of the virtual function is realized.

[0031] Step A2: Monitor the amount of transmitted data and the number of trigger times of the garbage collection trigger signal within the time window, convert the amount of transmitted data into a bandwidth value, and use the number of trigger times as the garbage collection frequency.

[0032] Specifically, a time window refers to a pre-set continuous time interval for data collection, which is 1 ms in this article and serves as the time standard for counting the amount of transmitted data and the number of garbage collection triggers. The amount of transmitted data is the number of bytes transmitted through the data bus when the virtual function (VF) performs read / write operations within the time window. The garbage collection trigger signal is a signal sent by the flash translation layer (FTL) to trigger the garbage collection (GC) operation, indicating that garbage collection processing is required for the storage cells. The bandwidth value is an indicator for measuring the data transmission rate, reflecting the number of data bits transmitted per unit time. The garbage collection frequency is the number of times the garbage collection trigger signal is triggered per unit time (i.e., the time window, which is 1 ms here), reflecting the frequency of the garbage collection operation.

[0033] On the one hand, a lightweight DMA (Direct Memory Access) controller is embedded in the hardware environment (such as FPGA), and it is used to monitor the read / write data streams of each virtual function (VF). Within the set 1 ms time window, the number of bytes of the read / write data of the virtual function flowing through the data bus is counted, which is the amount of transmitted data. According to the formula "bandwidth = amount of data × 8 (converted to bits) / 1 ms", the counted number of bytes is converted into a bandwidth value in Gbps.

[0034] On the other hand, the GC start signal line of the flash translation layer (FTL) is connected through the FPGA pins, and the edge detection circuit of the FPGA is used to detect the edge change of the garbage collection trigger signal generated by the GC start signal line within the 1 ms time window. Each time a valid edge is detected (representing one garbage collection trigger), it is counted once. The number of triggers counted within this time window (1 ms) is the garbage collection frequency (unit: times / ms). In this way, by monitoring the amount of transmitted data through the DMA controller and converting the bandwidth, and using pin connection and edge detection to count the number of garbage collection triggers, the acquisition of the bandwidth value and the garbage collection frequency is completed.

[0035] Step A3: Obtain the original data before channel decoding and the error-corrected data after channel decoding, and calculate the corresponding original bit error rate according to the original data and the error-corrected data.

[0036] Specifically, the original data before channel decoding is the original data stored in the NAND flash memory that has not been processed by low-density parity-check (LDPC) decoding, including user data and ECC check bits, and may contain bit errors generated during transmission or storage. The error-corrected data after channel decoding is the data obtained by correcting bit errors using an error correction algorithm after the original data has been processed by LDPC decoding. The original bit error rate (RBER) is an indicator for measuring the proportion of the number of bit errors in the original data to the total number of bits, and is used to evaluate the reliability of the storage medium and the quality of data transmission.

[0037] First, before LDPC decoding processing, capture the raw data of the NAND page through a hardware interface (such as the interaction interface between the FPGA and the LDPC decoding module). This data includes the information stored by the user and the ECC check bits for error detection and correction. After the LDPC decoding is completed, obtain the output data after error correction processing, that is, the error-corrected data after channel decoding.

[0038] Secondly, compare the raw data with the error-corrected data bit by bit, and count the number of bit positions where the two are inconsistent, that is, the number of error bits. Determine the total number of bits of the raw data (including all bits of the user data and the ECC check bits). Use the following formula to calculate and obtain the corresponding raw bit error rate value: RBER = number of error bits / total number of bits, where RBER is the raw bit error rate; the number of error bits is the number of bit positions where the raw data and the error-corrected data are inconsistent; the total number of bits is the total number of bits including the user data and the ECC check bits.

[0039] Step A4, construct storage load data using the operating frequency, bandwidth value, garbage collection frequency, and raw bit error rate.

[0040] Preliminarily summarize the obtained data such as the operating frequency, bandwidth value, garbage collection frequency, and raw bit error rate for each virtual function unit to form a set of raw data containing various dimensional indicators. This set of raw data is the storage load data.

[0041] In the embodiment of the present application, when the storage load data collected by each virtual function is obtained and the hardware acceleration engine is used to perform real-time feature enhancement processing on the storage load data, specifically: the hardware acceleration engine is integrated in the FPGA and includes a tensor accelerator and a real-time filtering module. First, input the raw data such as the operating frequency, bandwidth, GC frequency, and RBER into the tensor accelerator, and perform cross-dimensional weighted fusion through the hardware multiplier array in the FPGA. The weight matrix is dynamically updated by the online learning module according to different load scenarios. For example, the weight ratio of the operating frequency is automatically increased for high IOPS scenarios; then, perform band-pass filtering on the fused data through the finite impulse response filter bank configured in the FPGA. The cut-off frequency of the filtering is dynamically adjusted according to the physical characteristics of the NAND flash memory. For example, when it is detected that the flash memory is severely worn, the cut-off frequency of the high-frequency noise is automatically reduced to suppress the random error introduced by the storage medium fluctuation; finally, use the hardware-implemented principal component analysis dimensionality reduction algorithm to accelerate the eigenvalue decomposition through the look-up table in the FPGA, and compress the 4-dimensional raw data into a 2-dimensional key feature vector. One dimension represents the load intensity, which is positively correlated with IOPS and bandwidth, and the other dimension represents the storage health, which is negatively correlated with RBER and GC frequency, thereby completing the real-time feature enhancement processing of the storage load data and obtaining the compressed load feature data.

[0042] In the embodiments of the present application, generating a load prediction value according to the stored load data includes the following steps B1 - B4: Step B1, obtaining the historical storage load data of the previous time step and the corresponding historical state value.

[0043] Specifically, the previous time step refers to the previous time interval of the current time point (for example, if the current processing moment is t, the previous time step is t - 1), which is used to define the time range of the historical data. The historical storage load data refers to the storage load data collected and processed by the storage system in the previous time step, including multi - dimensional indicators such as operation frequency, bandwidth value, garbage collection frequency, and original bit error rate. The historical state value is the hidden state ( ) and the memory cell state ( ) generated by the long short - term memory network (LSTM) when processing data in the previous time step, which is used to transmit temporal dependence information.

[0044] Step B2, combining the storage load data with the historical storage load data to obtain a state control parameter.

[0045] Specifically, the state control parameter includes: the new information retention ratio coefficient, the historical information forgetting ratio coefficient, and the candidate memory value. Among them, the new information retention ratio coefficient corresponds to the output value of the input gate of the long short - term memory network (LSTM), which is used to control the inflow ratio of the current new information, and its value range is [0, 1]. The historical information forgetting ratio coefficient corresponds to the output value of the forgetting gate of the long short - term memory network, which is used to control the forgetting ratio of the historical information, and its value range is [0, 1]. The candidate memory value corresponds to the output value of the candidate memory unit of the long short - term memory network, which is used to generate the memory information to be updated.

[0046] First, the current storage load data (such as [IOPS_t, bandwidth_t, GC frequency_t, RBER_t]) and the historical storage load data (such as [IOPS_{t - 1}, bandwidth_{t - 1}, GC frequency_{t - 1}, RBER_{t - 1}]) are concatenated into an 8 - dimensional input vector .

[0047] Second, the input vector and the historical state value are respectively multiplied by the input gate weight matrix through matrix multiplication, and then processed by the Sigmoid activation function to obtain the output value of the input gate (i.e., the new information retention ratio coefficient), and the formula is:

[0048] Among them, is the new information retention ratio coefficient; is the Sigmoid activation function; is the input gate weight matrix; is the historical state value; is the input vector; is the input gate bias term. The closer it is to 1, the higher the proportion of historical information retained.

[0049] Input vector and the historical state value are respectively multiplied by the forget gate weight matrix through the Sigmoid activation function to obtain the forget gate output value (i.e., the historical information forgetting proportion coefficient), and the formula is:

[0050] where, is the historical information forgetting proportion coefficient; is the Sigmoid activation function; is the forget gate weight matrix; is the historical state value; is the input vector; is the forget gate bias term. The closer it is to 0, the higher the proportion of historical information forgotten.

[0051] Input vector and the historical state value are respectively multiplied by the candidate memory cell weight matrix through the Tanh activation function to obtain the candidate memory value , which is used for the update of the subsequent memory cell, and the formula is:

[0052] where, is the candidate memory value; is the Tanh activation function; is the candidate memory cell weight matrix; is the historical state value; is the input vector; is the candidate memory cell bias term.

[0053] Finally, after combining the current storage load data and the historical storage load data, through the matrix operation and activation function processing of the LSTM gating mechanism, a new information retention proportion coefficient, a historical information forgetting proportion coefficient, and a candidate memory value are generated as state control parameters for controlling the flow of information.

[0054] Step B3: Use the state control parameters to perform a fusion calculation on the storage load data and the historical state value to obtain the current state value.

[0055] Specifically, the current state value is the state of the memory cell updated after fusing the current and historical information and the hidden state , which serves as the output state of the LSTM at the current time step.

[0056] First, the historical information forgetting ratio coefficient is used to weight the historical memory cell state to determine the degree of retention of historical information: . The new information retention ratio coefficient is used to weight the candidate memory value to determine the inflow of current new information: . The above two parts are added together to obtain the updated memory cell state , and the formula is:

[0057] where is the updated memory cell state; is the historical information forgetting ratio coefficient; is the historical memory cell state; is the new information retention ratio coefficient; is the candidate memory value; is the element-wise multiplication.

[0058] This process realizes the selective forgetting of historical memories and the selective storage of new information through the coordinated action of the forgetting gate and the input gate.

[0059] Secondly, the output gate coefficient is obtained by the matrix multiplication of the input vector and the historical hidden state with the output gate weight matrix respectively, combined with the Sigmoid activation function, and is used to control the output ratio of the memory cell state , and the formula is:

[0060] where is the output gate coefficient; is the Sigmoid activation function; is the output gate weight matrix; is the historical state value; is the input vector; is the output gate bias term.

[0061] Finally, for the updated memory cell state Apply the Tanh activation function, map it to the interval [-1, 1], and then multiply it by the output gate coefficient to obtain the current hidden state , and the formula is:

[0062] where, is the current hidden state; is the output gate coefficient; is the element-wise multiplication; is the Tanh activation function; is the updated memory cell state.

[0063] The current hidden state and the updated memory cell state are both current state values, which contain both the temporal characteristics of the current load data and the dependency relationships of the historical states.

[0064] Step B4, determine the corresponding load prediction data based on the current state value.

[0065] It should be noted that the current state value is the current hidden state updated by the long short-term memory network (LSTM) at the current time step and the updated memory cell state. It integrates the temporal characteristics of the current and historical stored load data. The load prediction data is the prediction result of the stored load for a future period (such as 10 ms) output by the LSTM model after processing the current state value, including predicted values of metrics such as the operation frequency (IOPS), bandwidth value, garbage collection frequency, etc.

[0066] Specifically, first, the hidden state in the current state value already contains the temporal dependency characteristics of the stored load data (such as the change trend of the operation frequency, the bandwidth fluctuation pattern, etc.), and directly use as the input of the output layer of the LSTM model without additional feature extraction. Second, the output layer of the LSTM model is a fully connected layer, and its weight matrix and the hidden state Perform matrix multiplication and then process it through a linear activation function (or select an appropriate activation function according to the prediction target, such as ReLU) to obtain the predicted values of each load index. If it is necessary to predict the load data for multiple time steps (such as the next 10 ms), a recursive prediction method can be adopted: use the predicted value of the current time step as one of the input features for the next time step, combine it with the new storage load data, and then input it into the LSTM again to iteratively generate the predicted values for subsequent time steps. For example, first predict the load after 1 ms, and then combine this predicted value with the current state to predict the load after 2 ms until the 10-ms prediction sequence is completed. Through the above steps, the LSTM model utilizes the temporal features contained in the current state value, calculates through the output layer to generate future load prediction data, and provides data support for formulating subsequent reserved space allocation strategies.

[0067] In the embodiments of the present application, determining a corresponding reserved space allocation strategy based on the load prediction data includes the following steps C1 - C3: Step C1, construct a state space based on the load prediction data and a preset load type.

[0068] Specifically, the state space is a multi-dimensional vector space used to describe the current state of the storage system in a deep reinforcement learning network (DQN), including load prediction data, real-time state parameters, etc., as the input of the decision-making model. The process includes: First, obtain the predicted values of the load for the next 10 ms generated by the LSTM model. For example: the predicted operation frequency, bandwidth, and garbage collection frequency, which reflect the future load trend of the storage system. Obtain the raw bit error rate (RBER) in real time from the hardware monitoring engine. This parameter is used to evaluate the reliability of the storage medium and is a key real-time indicator of the state space.

[0069] Secondly, convert the preset load types (operation frequency type, bandwidth type, recovery frequency type, bit error rate type) into numerical encodings. For example, according to the load characteristics, divide the operation frequency type into "high", "medium", and "low", and encode them as 3, 2, and 1 respectively to form the load type encoding.

[0070] Concatenate the load prediction data, the raw bit error rate, and the load type encoding into a state space vector , and the specific form is as follows:

[0071] This vector integrates future load prediction, the current storage state, and load feature classification, constituting the input state space of the deep reinforcement learning model, with a dimension of 8 (taking the example parameters).

[0072] Step C2, select an allocation ratio adjustment action that matches the state space from the preset action space, execute the allocation ratio adjustment action, and obtain feedback information.

[0073] It should be noted that the preset action space is a set of adjustment actions for the pre - defined reserved space allocation ratio (OP allocation ratio), including a series of discrete adjustment steps (such as ±2%, ±5%, etc.), which are used to represent the adjustment methods for the reserved space resource allocation ratio of virtual functions (VF). The allocation ratio adjustment action is a specific adjustment operation selected from the preset action space. For example, increasing the reserved space allocation ratio of a certain virtual function (VF) by 2% or decreasing it by 5% is used to change the physical block allocation status of the dynamic reserved space resource pool. The feedback information is the real - time metrics related to the reserved space allocation effect returned after executing the allocation ratio adjustment action, including the standard deviation of latency, the utilization rate of reserved space resources, the stability of quality of service (QoS), etc., which are used to evaluate the effectiveness of the action.

[0074] Specifically, first, input the state - space vector into the pre - trained DQN network. The network outputs the Q - value (i.e., action value) corresponding to each action. The Q - value reflects the expected long - term reward for executing the action in the state space Select an action from the preset action space: Select the action with the maximum Q - value with a certain probability (using the existing optimal strategy). For example, select the allocation ratio adjustment action that maximizes the Q - value (such as +2%).

[0075] Secondly, according to the selected action , determine the adjustment direction (expansion or contraction) and ratio of the reserved space resource allocation. For example, if the action is “+2%”, then allocate physical block resources equivalent to 2% of its current capacity from the global reserved space resource pool to the independent resource pool of the target virtual function. Through the management mechanism of the dynamic reserved space resource pool, perform the allocation or release of physical blocks: If it is an expansion, select the target physical block from the free blocks of the global resource pool, and update the global state mapping table and the resource allocation linked list of the virtual function. If it is a contraction, release some physical blocks in the independent resource pool corresponding to the virtual function to the global resource pool and merge continuous free blocks to reduce fragmentation.

[0076] Finally, after the action is executed, the hardware monitoring engine collects new storage load data (IOPS, bandwidth, garbage collection frequency, RBER) in real - time, and calculates metrics such as the standard deviation of latency and the utilization rate of reserved space resources (OP resource utilization rate).

[0077] According to the preset reward function (such as , where is the feedback information, is the weight coefficient for balancing latency stability and capacity efficiency), is used as the feedback information for evaluating the action effect.

[0078] Step C3: Convert the feedback information into a policy optimization signal, and use the policy optimization signal to iteratively update the allocation ratio adjustment action until the feedback information meets the preset conditions, thereby obtaining the reserved space allocation policy.

[0079] Specifically, the policy optimization signal is a signal generated from the feedback information and used to update the parameters of the deep reinforcement learning (DQN) model, usually manifested as the error term of the Q value. The preset condition is a pre-set termination iteration criterion. For example, the feedback information (reward value) fluctuates less than the threshold for N consecutive rounds, or the delay standard deviation is lower than the QoS requirement.

[0080] First, based on the state space and the allocation ratio adjustment action the obtained feedback information , and the next state , the deep reinforcement learning network approximates the optimal policy through the Q function:

[0081] where is the optimal Q value; is the Q value corresponding to the action executed in the state space ; is the state space; is the allocation ratio adjustment action; is the Sigmoid activation function; is the feedback information; is the discount factor (such as 0.99); is in the next state space , traverse all possible actions , and select the allocation policy that can maximize the Q value, which reflects the prediction of the optimal value of the future state.

[0082] Monitor the feedback information after each iteration in real time (for example, the delay standard deviation drops from 80 μs to 45 μs, and the reward value increases from -0.8 to -0.2). When the delay standard deviation is lower than the threshold of the QoS requirement (such as 50 μs) for N consecutive rounds (such as N = 50), or the fluctuation range of the reward value is less than the preset threshold (such as 10%) within M consecutive rounds (such as M = 10), stop the iteration. The policy corresponding to the current Q value (such as preferentially allocating +2% resources to virtual functions with high IOPS loads) is the final reserved space allocation policy.

[0083] In the embodiments of the present application, the dynamic reserved space resource pool includes a global resource pool and independent resource pools corresponding to each virtual function; a global status mapping table is set in the global resource pool, where the global status mapping table is used to record the status identifiers of physical blocks; a resource allocation linked list is set in the independent resource pool corresponding to the virtual function, and the resource allocation linked list is used to record the capacity information of each physical block in the independent resource pool.

[0084] Specifically, the structural composition of the dynamic reserved space resource pool (dynamic OP resource pool): Global resource pool: As the total pool for resource allocation, 15% - 35% of the physical capacity is divided as the global resource pool during system initialization. Its physical blocks may be discontinuous due to bad block replacement or wear leveling. The global resource pool manages the status of all physical blocks through the global status mapping table (idle block bitmap).

[0085] Independent resource pool corresponding to the virtual function: Each virtual function has an independent resource pool, and its resources are dynamically allocated from the global resource pool. For example, when a virtual function needs to expand, it applies for physical blocks from the global resource pool; when it needs to shrink, it releases the physical blocks back to the global resource pool.

[0086] Implementation of the global status mapping table: Adopt the Bitmap data structure, where each bit corresponds to a physical block. For example, if the global resource pool contains 1024 physical blocks, the bitmap is 1024 bits (128 bytes). During initialization, all physical blocks are marked as "0" (idle) in the bitmap; when a physical block is allocated to the VF, the corresponding bit is set to "1"; after release, the bit is reset to "0". If the released block is continuous with adjacent idle blocks, the bitmap will merge and mark a larger continuous idle space.

[0087] Implementation of the resource allocation linked list: Each virtual function maintains a linked list (such as the OP BlockNode linked list), and the linked list nodes store the physical block information allocated to the virtual function, including: the starting address of the physical block (LBA or PBA), the number of continuous blocks, and a pointer to the next node. When the global resource pool allocates physical blocks to the virtual function, the allocated block information (starting address, length) is inserted at the end of the linked list; when releasing a block, the corresponding node is removed from the linked list, and the global status mapping table is updated.

[0088] In the embodiments of the present application, the resource status of the physical blocks in the dynamic reserved space resource pool is adjusted according to the reserved space allocation strategy to obtain the updated reserved space resource status, including the following steps D1 - D3: Step D1, determine the amount of reserved space resources to be released according to the reserved space allocation strategy.

[0089] Specifically, first, extract the adjustment instructions for the target virtual function from the reserved space allocation policy to clarify the adjustment type (such as capacity reduction) and the adjustment ratio (such as -5%). For example, if the policy indicates that the reserved space allocation ratio of a certain virtual function needs to be reduced by 5%, it is necessary to calculate the currently occupied resource amount of this virtual function and the corresponding release ratio. Secondly, calculate the current resource occupancy: traverse the resource allocation linked list of the target virtual function, and accumulate the number of continuous blocks of all nodes to obtain the total number of physical blocks currently allocated to this virtual function. For example, if the resource allocation linked list of the virtual function contains two nodes with continuous block numbers of 10 and 15 respectively, the currently occupied number of physical blocks is 25. Finally, determine the amount of resources to be released: calculate the number of physical blocks to be released based on the adjustment ratio and the current resource occupancy. For example, if the current occupancy is 25 and the adjustment ratio is -5%, the number of blocks to be released is 25 × 5% = 1.25, which is rounded up to 2 blocks (or rounded up according to the minimum allocation unit specified by the policy, such as 1 block).

[0090] Step D2, select the target physical blocks from the global status mapping table based on the amount of reserved space resources to be released.

[0091] In the embodiment of the present application, selecting the target physical blocks from the resource allocation linked list of the virtual function based on the amount of reserved space resources to be released includes: determining the number of physical blocks according to the amount of reserved space resources to be released; querying for continuous free physical blocks that meet the number of physical blocks in the global status mapping table, and using the continuous free physical blocks as the target physical blocks.

[0092] Specifically, according to the amount of reserved space resources to be released, determine the number of physical blocks that need to be selected from the global resource pool, traverse the bitmap of the global status mapping table in the order of physical block addresses, and check each bit for free blocks with a bit value of "0". When N or more consecutive "0" bits are continuously found, record the start address and the number of these consecutive blocks. For example, if two consecutive free blocks with addresses 100 - 101 are found in the bitmap, then select these two blocks as the target physical blocks. If consecutive blocks that meet the number are found, mark these blocks as "1" (allocated) in the bitmap, and record the start address and length.

[0093] Step D3, remove the capacity information of the target physical blocks from the resource allocation linked list, and mark the target physical blocks as the allocated state in the global status mapping table.

[0094] Specifically, if the reserved space allocation policy is to release resources (such as virtual function capacity reduction), delete the nodes corresponding to the physical blocks to be released from the resource allocation linked list of the target virtual function. For example, to release two non - consecutive blocks with addresses 50 and 200, it is necessary to find the nodes with the corresponding start addresses in the linked list and remove them.

[0095] If the policy is to allocate resources (such as virtual function expansion), the starting address, length, and other information of the selected target physical blocks (continuous or discontinuous) are inserted into the tail of the resource allocation linked list of the virtual function. For example, allocate a continuous block with addresses 100 - 102, create a new node with a length of 3 and add it to the linked list.

[0096] When releasing resources, the bit corresponding to the physical block in the global status mapping table is marked from "1" (allocated) to "0" (idle). If the released block is continuous with adjacent idle blocks, the adjacent "0" bits are merged to mark a larger continuous idle space (for example, after releasing the block at address 200, if addresses 199 and 201 are both idle, they are merged and marked as a continuous idle area from 199 to 201). When allocating resources, the bit of the target physical block in the global status mapping table is marked from "0" to "1", indicating that the resources have been allocated to the virtual function.

[0097] In the embodiment of the present application, the method further includes: if there are no continuous idle physical blocks that meet the number of physical blocks, allocate multiple discontinuous idle physical blocks according to the number of physical blocks, and use the discontinuous idle physical blocks as the target physical blocks.

[0098] Specifically, if after querying the global free block bitmap, there is no continuous idle area that meets the required number of physical blocks, the system will execute the discontinuous block allocation process: First, traverse the bitmap to find multiple scattered idle physical blocks. By scanning the "0" bits (representing free blocks) in the bitmap, collect a sufficient number of discontinuous idle blocks (total number of blocks ≥ requirement N); Then, record the physical starting address and the length of each single block (usually 1 block) of each discontinuous block, and combine the information of these blocks into an allocation unit in sequence; Finally, insert the node containing the starting address, length, and other information of the discontinuous blocks into the tail of the reservation space (OP) allocation linked list of this virtual function (VF), and mark the corresponding bits of these blocks as "1" (allocated state) in the global free block bitmap, thereby completing the allocation of discontinuous idle physical blocks and ensuring that the reservation space expansion requirement of the virtual function (VF) is met.

[0099] In the embodiment of the present application, the method further includes: obtaining the modification frequency of each data block in the independent resource pool; identifying the target data blocks with a modification frequency less than the preset frequency threshold; using the data in the target data blocks as cold data and migrating the cold data to the global resource pool.

[0100] Specifically, through the performance counter and data bus monitoring module of the hardware monitoring engine, the read and write operation counts of each data block in the independent resource pool (i.e., the virtual function (VF) independent reservation space resource pool) are recorded in real time. Specifically, the hardware counter of each virtual function (VF) increments when the data block is modified (when the write operation completes and returns to the CQ). The 1ms timer inside the FPGA triggers the latch and clearing of the counter value. By counting the number of modifications within a unit time (such as the number of modifications per second), the modification frequency of each data block can be obtained.

[0101] Compare the obtained modification frequencies of each data block with a preset threshold (such as 1 time / second). If the modification frequency of a certain data block is lower than this threshold, it is determined as a "cold data block". For example, if the preset threshold is 1 time / second, and the average modification frequency of a certain data block is less than 1 time / second in multiple consecutive statistical periods (such as 10 1ms windows), it is marked as a target data block and included in the cold data migration candidate set.

[0102] Next, locate the physical address of the target data block and read its data content; then, search for free physical blocks in the global reservation space resource pool (global OP resource pool) (determined by the global free block bitmap). If there are consecutive free blocks, they are preferentially allocated; otherwise, non - consecutive blocks are allocated; finally, write the cold data to the target block in the global pool, update the allocation linked list of the virtual function (VF) independent reservation space resource pool (remove the information of the migrated block) and the global bitmap (mark the newly allocated block as allocated), and at the same time update the mapping from the logical address to the global pool physical address in the FTL to complete the cold data migration.

[0103] In the embodiment of the present application, before constructing the storage load data using the operation frequency, bandwidth value, garbage collection frequency, and original bit error rate, the method further includes: performing a sliding window average calculation on the operation frequency, bandwidth value, garbage collection frequency, and original bit error rate to obtain initial storage load data; identifying outliers in the storage load data and performing a filtering operation on the outliers in the storage load data to obtain the storage load data.

[0104] Specifically, after the hardware monitoring engine collects each index data in real time, a sliding average filtering algorithm with a window length of 10 is used for processing: for the operation frequency (IOPS), bandwidth value, and garbage collection (GC) frequency, with a sampling period of 1ms, the sum of the sampling values at the current moment and the previous 9 cycles is averaged to obtain a smoothed value; for the original bit error rate (RBER), the number of bit errors is obtained when the LDPC decoding is completed and triggers an interrupt. Similarly, the average value is calculated based on the statistical values of the last 10 interrupts, and finally, the initial storage load data including IOPS, bandwidth, GC frequency, and RBER is generated to reduce the impact of short - term fluctuations on the data.

[0105] Identifying outliers based on the 3σ principle: First, calculate the mean and standard deviation of each metric (such as IOPS) in the initial storage load data. If a metric value exceeds the mean plus 3 times the standard deviation (sudden increase anomaly) or is lower than the mean minus 3 times the standard deviation (sudden decrease anomaly), it is determined as an outlier. For the identified outliers, replace them with the mean of adjacent periods or directly remove them, and then supplement the missing values through linear interpolation. Finally, obtain the filtered storage load data to ensure the stability and reliability of the time series data input into the machine learning model.

[0106] In the embodiment of the present application, the method for determining the reserved space allocation policy further includes: inputting the storage load data into a pre-trained target machine learning model to obtain the reserved space allocation policy; Among them, the training method of the target machine learning model includes the following steps E1 - E4: Step E1, obtain storage load data samples and corresponding status value samples.

[0107] Specifically, continuously collect multi-dimensional storage load data (such as IOPS, bandwidth, GC frequency, RBER) through a hardware monitoring engine, and perform sliding window averaging and outlier filtering processing at a 1ms cycle. At the same time, record the system status value corresponding to each data sampling moment (such as the reserved space allocation ratio of each virtual function, QoS metrics, NAND wear status, etc.). Organize multiple groups of historical collected time series data (such as 1000 consecutive sampling points) and their corresponding status values into a training sample set, where the storage load data is used as input features and the status values are used as supervision signals for subsequent model training.

[0108] Step E2, pre-train the initial long short-term memory network layer using the storage load data samples and corresponding status value samples to obtain the target long short-term memory network; Specifically, adopt an offline pre-training method, and input the storage load data samples (such as IOPS, bandwidth time series) into the initial LSTM network. The network processes the time series dependence relationship through the gating mechanism (input gate, forget gate, output gate) to predict the load trend in the next 10ms. During the training process, use the mean square error (MSE) as the loss function to minimize the deviation between the predicted value and the actual observed value. The formula of the loss function is:

[0109] Among them, is the loss value; is the number of samples participating in calculating the loss; is the true value; is the predicted value.

[0110] The network weights are iteratively optimized through Stochastic Gradient Descent (SGD). After multiple rounds of training (such as 1000 Epochs), a target LSTM network that can accurately capture the variation law of storage load is obtained, and its output is the predicted value of future load.

[0111] Step E3: Obtain the sample of predicted values output by the pre-trained long short-term memory network, and use the sample of predicted values to pre-train the initial deep reinforcement learning layer to obtain the target deep reinforcement learning layer. Specifically, fix the parameters of the pre-trained LSTM network, combine the predicted load values output by it with features such as real-time RBER and load type encoding into a state vector, and input it into the initial DQN network. DQN learns the optimal reservation space allocation strategy through Q-value iteration. The state space includes predicted load, RBER, etc., and the action space is the adjustment step of the reservation space (OP) (such as ±2%). The experience replay mechanism is adopted to randomly sample state-action pairs from historical interaction data, and update the network parameters by minimizing the Q-value error (the mean square error between the current Q-value and the target Q-value). After multiple rounds of training (such as 5000 Episodes), DQN learns to dynamically adjust the reservation space (OP) allocation based on the predicted load, and obtain the target deep reinforcement learning layer.

[0112] Step E4: Combine the target long short-term memory network and the target deep reinforcement learning layer to obtain the pre-trained target machine learning model.

[0113] Connect the trained LSTM network and DQN network in series to form an LSTM-RL joint model: the LSTM layer receives historical load data and outputs the predicted value of future load; the DQN layer combines the predicted value with state features such as real-time RBER and outputs the optimal reservation space allocation action (OP allocation action). In the online learning stage, the model receives new data every 1 minute, and fine-tunes the parameters of LSTM and DQN through incremental learning to adapt to load changes. Through hardware co-acceleration (such as NPU for inference), real-time decision-making on dynamic reservation space allocation for virtual functions (VF) is achieved, improving the QoS stability of the system.

[0114] As an example, during the actual training process, the system first collects storage load data such as the IOPS, bandwidth, GC frequency, and RBER of each virtual function at a cycle of 1 ms through the hardware monitoring engine. At the same time, it records status values such as the reserved space allocation ratio and NAND wear status at each sampling moment, thereby obtaining multiple groups of storage load data samples and their corresponding status value samples. Then, these samples are input into the initial long short-term memory network layer, and multiple rounds of iterative training are performed with the mean squared error as the loss function to optimize the network weights, obtaining a target long short-term memory network that can accurately predict future load trends. Next, the future 10-ms load prediction value samples output by the target long short-term memory network are combined with real-time data such as RBER and input into the initial deep reinforcement learning layer. The experience replay mechanism and Q-value iteration are used to update the network parameters, and a target deep reinforcement learning layer that can output the optimal reserved space allocation action is trained. Finally, the target long short-term memory network and the target deep reinforcement learning layer are combined to construct a pre-trained target machine learning model for subsequent dynamic reserved space resource allocation based on load prediction.

[0115] In the embodiment of the present application, as Figure 2 shown, the architecture of the SSD dynamic reserved space allocation module includes four core sub-modules, and each sub-module collaborates to complete the intelligent allocation of reserved space and resource regulation: Hardware monitoring engine: As the basic unit for data collection, it collects storage load data such as the operation frequency (IOPS), bandwidth, garbage collection (GC) frequency, and raw bit error rate (RBER) of each virtual function (VF) in real time through exclusive hardware counters, DMA controllers, pin connections, and data capture before LDPC decoding, providing the original basis for subsequent analysis and decision-making.

[0116] Machine learning dynamic prediction: Integrates a joint model (LSTM-DQN) pre-trained offline and fine-tuned online, receives the storage load data collected by the hardware monitoring engine, uses LSTM to mine time series dependence features to predict future loads, and then learns the optimal reserved space allocation strategy through DQN to output dynamic adjustment instructions.

[0117] Dynamic reserved space resource pool: A logical structure composed of a global resource pool and independent resource pools for each virtual function VF. The global resource pool manages the physical block status through a global status mapping table (idle block bitmap); the independent resource pool for the virtual function relies on a resource allocation linked list to record block capacity information, supporting the dynamic allocation and recycling of resources.

[0118] Resource scheduling execution module: Based on the reserved space allocation strategy dynamically predicted by machine learning, it operates the physical block status of the dynamic reserved space resource pool. This includes selecting the target physical block from the global resource pool, updating the resource allocation linked list and the global status mapping table, completing scheduling actions such as resource expansion / contraction, cold data migration, and realizing dynamic adaptation of reserved space resources.

[0119] The dynamic reserved space allocation solution of the embodiment of the present application is implemented based on the NVMeSSD system architecture. Figure 3 As shown in the figure, each component works together to support intelligent control of reserved space in multi-virtual function (VF) scenarios. The architecture interaction logic is as follows: Upper-layer interaction: Multiple virtual functions (VF_1~VF_N) and host physical functions (HOST_PF) are connected to NVMeSSD through the virtual machine manager (VMM) and the PCIe bus to implement storage request delivery and data interaction.

[0120] Hardware monitoring and data collection: The FPGA hardware monitoring engine configures a dedicated monitoring unit for each virtual function VF (such as VF_1 corresponds to "Counter 0" and "Configuration Page 0", etc.), and collects storage load data such as IOPS, bandwidth, and RBER through state machines, timers, and error counters. The DMA module is responsible for data transmission between the virtual function VF and the namespace (NS_1~NS_N), opening up the load data collection channel.

[0121] Storage core and load processing: The flash translation layer (FTL) manages the logical-physical address mapping of the storage medium, and operations such as garbage collection (GC) trigger changes in load data; the "NAND data and management unit" integrates the LSTM-DQN joint model, receives load data such as IOPS, bandwidth, RBER, etc., trains and outputs reserved space adjustment strategies.

[0122] Resource scheduling and execution: The resource scheduling module operates the reserved space resource pool (dynamic reserved space resource pool) according to the reserved space adjustment strategy, allocates / reclaims physical blocks for the independent resource pools (VF_OP_1~VF_OP_N) of each virtual function (VF), and realizes dynamic adaptation of reserved space resources by updating the resource allocation linked list and the global status mapping table.

[0123] In the embodiments of the present application, Figure 4As shown in the figure, the logic of each link for the machine learning dynamic prediction module to implement the intelligent generation of the reserved space allocation strategy is as follows: The hardware monitoring engine collects multi-dimensional storage load data (IOPS, bandwidth, GC frequency, RBER). After data preprocessing (standardization to eliminate dimension differences and sliding window to extract time series features), combined with the host load label (such as random write / sequential read and other service modes), it is input into the LSTM prediction module to mine time series dependencies, and the predicted values of future IOPS and bandwidth are output; the predicted values are used as state inputs and passed into the DQN policy decision module to learn and generate reserved space allocation adjustment actions; finally, the resource scheduling execution module implements the policy, completes the reserved space adjustment and cold data migration, and realizes the dynamic adaptation of storage resources.

[0124] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0125] The embodiment of the present application also provides a storage resource dynamic allocation device, as Figure 5 shown, the device includes: An acquisition module 51, configured to acquire the storage load data collected by each virtual function; A generation module 52, configured to generate load prediction data according to the storage load data, and determine the corresponding reserved space allocation strategy based on the load prediction data; An adjustment module 53, configured to adjust the resource state of the physical blocks in the dynamic reserved space resource pool according to the reserved space allocation strategy to obtain the updated reserved space resource state.

[0126] Further, the device further includes: an acquisition module, configured to configure a hardware counter for each virtual function, increment the count value when the input / output command is completed by using the hardware counter, and convert the count value into an operation frequency; monitor the transmission data volume and the trigger times of the garbage collection trigger signal within the monitoring time window, and convert the transmission data volume into a bandwidth value, and use the trigger times as the garbage collection frequency; acquire the original data before channel decoding and the error correction data after channel decoding, and calculate the corresponding original bit error rate according to the original data and the error correction data; construct the storage load data by using the operation frequency, bandwidth value, garbage collection frequency, and original bit error rate.

[0127] Further, the generation module 52 further includes: a first processing sub-module and a second processing sub-module; The first processing sub-module is used to obtain the historical storage load data and the corresponding historical state value at the previous time step; combine the storage load data with the historical storage load data to obtain a state control parameter; perform a fusion calculation on the storage load data and the historical state value using the state control parameter to obtain the current state value; and determine the corresponding load prediction data based on the current state value.

[0128] The second processing sub-module is used to construct a state space based on the load prediction data and a preset load type; select an allocation ratio adjustment action that matches the state space from a preset action space, execute the allocation ratio adjustment action to obtain feedback information; convert the feedback information into a policy optimization signal, and use the policy optimization signal to iteratively update the allocation ratio adjustment action until the feedback information meets a preset condition to obtain a reserved space allocation policy.

[0129] Further, the adjustment module 53 includes a third processing sub-module, a fourth processing sub-module, and a fifth processing sub-module; The third processing sub-module is used to determine the amount of reserved space resources to be released according to the reserved space allocation policy; The fourth processing sub-module is used to select a target physical block from a global state mapping table based on the amount of reserved space resources to be released; The fifth processing sub-module is used to remove the capacity information of the target physical block from the resource allocation linked list and mark the target physical block as an allocated state in the global state mapping table.

[0130] Further, the adjustment module 53 further includes a sixth processing sub-module; The sixth processing sub-module is used to allocate multiple non-contiguous free physical blocks according to the number of physical blocks if there are no contiguous free physical blocks that meet the number of physical blocks, and use the non-contiguous free physical blocks as the target physical blocks.

[0131] Further, the device further includes: a migration module, which is used to obtain the modification frequency of each data block in the independent resource pool; identify the target data block with a modification frequency less than a preset frequency threshold; use the data in the target data block as cold data, and migrate the cold data to the global resource pool.

[0132] Further, the device further includes: a preprocessing module, which is used to perform a sliding window average calculation on the operation frequency, bandwidth value, garbage collection frequency, and original bit error rate to obtain initial storage load data; identify the outliers in the storage load data, and perform a filtering operation on the outliers in the storage load data to obtain the storage load data.

[0133] Further, the device further includes: an input module, which is used to input the storage load data into a pre-trained target machine learning model to obtain a reserved space allocation policy.

[0134] Further, the apparatus further includes: a training module, configured to obtain storage load data samples and corresponding status value samples; pre-train an initial long short-term memory network layer by using the storage load data samples and the corresponding status value samples to obtain a target long short-term memory network; obtain predicted value samples output by the pre-trained long short-term memory network, and pre-train an initial deep reinforcement learning layer by using the predicted value samples to obtain a target deep reinforcement learning layer; combine the target long short-term memory network and the target deep reinforcement learning layer to obtain a pre-trained target machine learning model.

[0135] An embodiment of the present application further provides an electronic device, as Figure 6 shown, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above embodiments of the storage resource dynamic allocation method.

[0136] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above embodiments of the storage resource dynamic allocation method when running.

[0137] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc, and other media that can store computer programs.

[0138] An embodiment of the present application further provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the storage resource dynamic allocation method are implemented.

[0139] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the storage resource dynamic allocation method are implemented.

[0140] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered as exceeding the scope of this application.

[0141] The above has introduced in detail the method, apparatus, computer device, and storage medium for dynamically allocating storage resources provided by this application. Specific examples are used herein to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for dynamically allocating storage resources, characterized in that Including: Obtain the storage load data collected by each virtual function; Generate load prediction data based on the storage load data, and determine the corresponding reserved space allocation strategy based on the load prediction data; Adjust the resource status of the physical blocks in the dynamic reserved space resource pool according to the reserved space allocation strategy to obtain the updated reserved space resource status.

2. The dynamic storage resource allocation method according to claim 1, wherein The storage load data includes data of multiple preset load types, and the preset load types include operation frequency type, bandwidth type, recycling frequency type, and bit error rate type. The acquisition method of the storage load data includes: Configure a hardware counter for each virtual function, use the hardware counter to increment the count value when the input / output command is completed, and convert the count value into an operation frequency; Monitor the amount of transmitted data and the number of trigger times of the garbage collection trigger signal within the time window, convert the amount of transmitted data into a bandwidth value, and use the number of trigger times as the garbage collection frequency; Obtain the original data before channel decoding and the error-corrected data after channel decoding, and calculate the corresponding original bit error rate according to the original data and the error-corrected data; Construct storage load data using the operation frequency, the bandwidth value, the garbage collection frequency, and the original bit error rate.

3. The method for dynamically allocating storage resources according to claim 1, wherein The generating of the load prediction value according to the storage load data includes: Obtain the historical storage load data and the corresponding historical state value of the previous time step; Combine the storage load data with the historical storage load data to obtain a state control parameter; Perform a fusion calculation on the storage load data and the historical state value using the state control parameter to obtain the current state value; Determine the corresponding load prediction data based on the current state value.

4. The storage resource dynamic allocation method according to claim 1, characterized in that, The determining of the corresponding reserved space allocation strategy based on the load prediction data includes: Construct a state space based on the load prediction data and the preset load types; Select an allocation ratio adjustment action that matches the state space from the preset action space, execute the allocation ratio adjustment action, and obtain feedback information; Convert the feedback information into a policy optimization signal, and use the policy optimization signal to iteratively update the allocation ratio adjustment action until the feedback information meets the preset conditions to obtain the reserved space allocation strategy.

5. The dynamic storage resource allocation method according to claim 1, wherein The dynamic reserved space resource pool includes a global resource pool and independent resource pools corresponding to each virtual function; A global state mapping table is set in the global resource pool, where the global state mapping table is used to record the state identifiers of the physical blocks; A resource allocation linked list is set in the independent resource pool corresponding to the virtual function, and the resource allocation linked list is used to record the capacity information of each physical block in the independent resource pool.

6. The dynamic allocation method of storage resources according to claim 5, characterized in that The adjusting of the resource status of the physical blocks in the dynamic reserved space resource pool according to the reserved space allocation strategy to obtain the updated reserved space resource status includes: Determine the amount of reserved space resources to be released according to the reserved space allocation strategy; Select target physical blocks from the global state mapping table based on the amount of reserved space resources to be released; Remove the capacity information of the target physical block from the resource allocation linked list, and mark the target physical block as an allocated state in the global status mapping table.

7. The method for dynamically allocating storage resources according to claim 6, wherein The selecting of the target physical block from the resource allocation linked list of the virtual function based on the reserved space resource amount to be released includes: Determine the number of physical blocks according to the reserved space resource amount to be released; Query consecutive free physical blocks that meet the number of physical blocks in the global status mapping table, and use the consecutive free physical blocks as the target physical blocks.

8. The storage resource dynamic allocation method according to claim 7, wherein The method further includes: If there are no consecutive free physical blocks that meet the number of physical blocks, allocate multiple non-consecutive free physical blocks according to the number of physical blocks, and use the non-consecutive free physical blocks as the target physical blocks.

9. The dynamic storage resource allocation method according to claim 5, wherein The method further includes: Obtain the modification frequency of each data block in the independent resource pool; Identify target data blocks whose modification frequency is less than a preset frequency threshold; Use the data in the target data blocks as cold data, and migrate the cold data to the global resource pool.

10. The storage resource dynamic allocation method according to claim 2, characterized in that, Before constructing the storage load data using the operation frequency, the bandwidth value, the garbage collection frequency, and the original bit error rate, the method further includes: Perform a sliding window average calculation on the operation frequency, the bandwidth value, the garbage collection frequency, and the original bit error rate to obtain initial storage load data; Identify outliers in the storage load data, and perform a filtering operation on the outliers in the storage load data to obtain storage load data.

11. The dynamic storage resource allocation method according to claim 1, characterized in that The method for determining the reserved space allocation policy further includes: Input the storage load data into a pre-trained target machine learning model to obtain a reserved space allocation policy; Wherein, the training method of the target machine learning model includes: Obtain storage load data samples and corresponding status value samples; Pre-train an initial long short-term memory network layer using the storage load data samples and the corresponding status value samples to obtain a target long short-term memory network; Obtain prediction value samples output by the pre-trained long short-term memory network, and pre-train an initial deep reinforcement learning layer using the prediction value samples to obtain a target deep reinforcement learning layer; Combine the target long short-term memory network and the target deep reinforcement learning layer to obtain a pre-trained target machine learning model.

12. A storage resource dynamic allocation device, characterized in that, Includes: An acquisition module, configured to acquire storage load data collected by each virtual function; A generation module, configured to generate load prediction data according to the storage load data, and determine a corresponding reserved space allocation policy based on the load prediction data; An adjustment module, configured to adjust the resource status of physical blocks in the dynamic reserved space resource pool according to the reserved space allocation policy to obtain an updated reserved space resource status.

13. An electronic device, characterized in that, Includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the storage resource dynamic allocation method according to any one of claims 1 to 11 when executing the computer program.

14. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein when the computer program is executed by a processor, the steps of the storage resource dynamic allocation method according to any one of claims 1 to 11 are implemented.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the steps of the storage resource dynamic allocation method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Storage system

    CN104965677A

  • PCIe device resource dynamic allocation method and system

    CN115562798A

  • Real-time hierarchical distribution method for power cloud resources of digital power grid

    CN119603304A

  • Dynamic monitoring and early warning method for storage space of data center

    CN120045421A

  • Intelligent scheduling and backup recovery system for cloud storage resources

    CN120104341A

Cited By

  • Solid state disk power consumption optimization method and system based on load prediction

    CN120610668A