Method for managing IO write operation and storage device

By detecting the host's high-load write protection mode and data flow information to judge the IO write operation, the problem that the storage device cannot meet the VPG specifications in high-load video recording is solved, and the reliability and performance improvement of high-load video recording is achieved.

CN120508262AActive Publication Date: 2025-08-19CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510999534.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-08-19
Estimated Expiration
2045-07-21

AI Technical Summary

Technical Problem

Existing storage devices cannot effectively manage IO write operations during high-load video recording, resulting in the inability to meet the CFexpress Video Performance Guarantee (VPG) specification requirements of CFexpress memory cards, affecting recording performance and reliability.

Method used

By detecting whether the host is in high-load write protection mode, obtain data flow information of historical IO write operations, judge whether the IO write operations are sequential write operations, and update the data flow information according to location metadata to ensure that the writes comply with the VPG specification.

Benefits of technology

It realizes accurate management of IO write operations during high-load video recording, ensures dynamic consistency of data flow information, avoids random write operations, and improves recording reliability and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508262A_ABST
    Figure CN120508262A_ABST
Patent Text Reader

Abstract

The invention discloses a method for managing IO write operation and a storage device. The method comprises the steps that IO write operation issued by a host is received, and whether the host starts a high-load write protection mode or not is detected; if the high-load write protection mode is started, write management information of the high-load write protection mode is obtained, and the write management information comprises data flow information of historical IO write operation; judging whether the IO write operation is sequential write operation or not according to the data stream information; and if yes, updating the data stream information according to the position metadata of the IO write operation. According to the invention, the reliability and the write-in performance of the device during execution of high-load video recording can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer storage technology, and in particular to a method and storage device for managing IO write operations. Background Art

[0002] As demand for high-performance storage increases, users are placing higher demands on the performance and reliability of storage devices. This trend is particularly evident in the field of professional film and television production, which relies crucially on the ability of storage devices to withstand high-load video recording processes.

[0003] However, current storage device front-end modules (FEs) have limitations when processing I / O write commands. The FE is a key component of the storage device responsible for communication with the host and command processing. It ensures the correct execution of host requests through protocol processing and command distribution. Under existing management methods, the FE only performs basic validity checks on write commands, such as verifying that parameters such as the namespace identifier (NSID), physical region page (PRP), hash list (SGL), and logical block address (LBA) comply with existing protocols (such as the NVMe protocol).

[0004] Existing management methods fail to meet the CFexpress Video Performance Guarantee (VPG) specification for CFexpress memory cards. The VPG specification emphasizes the meticulous management of each I / O write operation to ensure the card can provide stable write speeds and avoid interruptions during high-load video recording. However, existing management methods fail to provide the necessary constraints for each valid or invalid I / O write operation, resulting in the memory card being unable to perform detailed legitimacy verification of each I / O write command and ensuring full compliance with the VPG specification.

[0005] Therefore, it is necessary to optimize and improve the management of IO write commands of the front-end module of the memory card to meet the requirements of the VPG specification and improve the performance and reliability in high-load video recording scenarios. Summary of the Invention

[0006] The technical problem to be solved by the present invention is to provide a method and a storage device for managing IO write operations, which can improve the reliability and write performance of the device when performing high-load video recording.

[0007] In order to solve the above technical problems, a technical solution adopted by the present invention is: A method for managing IO write operations, comprising: Receive an IO write operation from the host and detect whether the host has enabled high-load write protection mode; If enabled, obtain the write management information of the high-load write protection mode, wherein the write management information includes data flow information of historical IO write operations; Determining whether the IO write operation is a sequential write operation according to the data flow information; If so, the data stream information is updated according to the location metadata of the IO write operation.

[0008] In order to solve the above technical problems, another technical solution adopted by the present invention is: A storage device includes a storage chip and a control chip. The storage chip stores a computer program. When the computer program is executed by the control chip, the computer program implements the various steps in the above-mentioned method for managing IO write operations.

[0009] The beneficial effects of the present invention are as follows: first, by detecting whether the host has turned on the high-load write protection mode (VPG specification), it can actively identify whether the current system is in an operating state that requires special management. When the mode is turned on, by obtaining the write management information containing the data stream information, a decision basis is provided for the sequential judgment of subsequent write operations. The VPG specification requires that each IO write operation that writes the data stream information is a sequential write. Based on the data stream information, the historical write rules can be traced back. Therefore, by matching the current IO write operation with the data stream information, it can be accurately determined whether the current IO write operation is a sequential write. For sequential write operations, the dynamic consistency of the storage space management information is maintained by updating the data stream information corresponding to the location metadata in real time. The present invention can ensure that the data stream information read by the host in the high-load write protection mode is a sequential write operation, and there is no random write operation, so as to adapt to the video performance guarantee specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 A flowchart of a method for managing IO write operations provided by the present invention; Figure 2 Another flow chart of a method for managing IO write operations provided by the present invention; Figure 3 A schematic diagram of switching the VPG state provided by the present invention; Figure 4 A schematic diagram of an IO write operation without crossing regions provided by the present invention; Figure 5 A cross-region schematic diagram of an IO write operation provided by the present invention; Figure 6 A schematic diagram of a storage address for a random write operation provided by the present invention; Figure 7 A flowchart of a method for updating data stream information provided by the present invention; Figure 8A schematic diagram of a storage address for an IO write operation that satisfies allocation conditions provided by the present invention; Figure 9 A schematic diagram of a storage address of an IO write operation that meets the release condition provided by the present invention; Figure 10 A schematic diagram of a storage address for an IO write operation for cross-unit write provided by the present invention; Figure 11 A schematic diagram of a storage address for an IO write operation of the same unit provided by the present invention; Figure 12 A schematic structural diagram of a storage device provided by the present invention. DETAILED DESCRIPTION

[0011] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.

[0012] An embodiment of the present invention provides a method for managing IO write operations, including: Receive an IO write operation from the host and detect whether the host has enabled high-load write protection mode; If enabled, the write management information of the high-load write protection mode is obtained, wherein the write management information includes data flow information of historical IO write operations and random update information of random update commands; Determining whether the IO write operation is a sequential write operation according to the data flow information; If yes, updating the data stream information according to the location metadata of the IO write operation; Otherwise, the high-load write protection mode is temporarily disabled to reset the random update information.

[0013] As can be seen from the above description, the present invention has the following beneficial effects: First, by detecting whether the host has enabled high-load write protection mode (VPG specification), it can proactively identify whether the current system is in an operating state requiring special management. When this mode is enabled, write management information containing data stream information is obtained, providing a basis for determining the order of subsequent write operations. The VPG specification requires that each I / O write operation to the data stream information be sequential. Based on the data stream information, historical write patterns can be traced. Therefore, by matching the current I / O write operation with the data stream information, it is possible to accurately determine whether the current I / O write operation is sequential. For sequential write operations, the dynamic consistency of storage space management information is maintained by real-time updating of the data stream information corresponding to the location metadata. The present invention ensures that the data stream information read by the host in high-load write protection mode is sequential write operation, with no random write operations, to comply with video performance assurance specifications. The present invention forms a dynamic management mechanism for high-load write protection mode through a multi-level linkage of mode status detection, management information invocation, dynamic judgment logic, and feedback control mechanisms.

[0014] Furthermore, the write management information also includes random update information of the random update command; Before determining whether the IO write operation is a sequential write operation according to the data stream information, the method further includes: Detecting whether the location metadata of the IO write operation is completely located in the user area of the storage space; If so, detecting whether there is an authorized address in the random update information that matches the location metadata of the IO write operation; If it exists, there is no need to determine whether the IO write operation is a sequential write operation based on the data stream information, and the data is directly written based on the position metadata; If not, determining whether the IO write operation is a sequential write operation according to the data flow information; Otherwise, data is written according to the area type to which the location metadata belongs in the storage space.

[0015] From the above description, it can be seen that the data in the non-user area is not restricted by the VPG specification and can be written randomly. In the high-load write protection mode, only a small number of addresses are allowed to perform random write operations. These addresses are recorded in the random update information. Therefore, for operations in the user area, the random update information is combined to determine whether the IO write operation is a legal random write operation in the high-load write protection mode. If it is a legal random write operation, since the address information of the operation has been recorded in the random update information, it will not violate the mandatory requirements of the high-load write protection mode for sequential writes. Therefore, there is no need to update the data flow information, and the step of determining whether it is a sequential write operation can be skipped directly to complete the data writing directly. For operations in the non-user area, differentiated processing strategies are adopted according to the type of area to which they belong, ensuring normal writing in the non-user area. This step-by-step judgment mechanism achieves accurate interception of illegal random writes.

[0016] Further, determining whether the IO write operation is a sequential write operation according to the data flow information includes: Determine the termination logical address of the previous IO write operation according to the data flow information; Comparing the termination logical address with the location metadata of the IO write operation to see if they are the same; If they are the same, it is determined that the IO write operation is a sequential write operation; If they are not the same, it is determined that the IO write operation is an illegal random write operation, and the high-load write protection mode is temporarily disabled to reset the random update information.

[0017] As can be seen from the above description, the logic for judging random write operations as illegal comes from the VPG specification's mandatory requirement for sequential writes. The VPG specification requires that all IO operations except random update commands are sequential writes, which can effectively avoid performance degradation caused by random writes. The termination logical address of the previous write operation is obtained through data stream information, and it is compared with the location metadata of the current write operation for continuity: if the two are the same, it indicates that the current operation is a sequential write, which meets the requirements of the high-load write protection mode; if they are different, it is judged as an illegal random write operation, and the high-load write protection mode is turned off, causing the host to fall back to the traditional write mode. At the same time, the random update information is reset to complete the mode initialization, preventing illegal random write operations from being written into the random update information. This dual verification mechanism can accurately distinguish between legal and illegal operations, ensuring the stability of write performance in high-load scenarios.

[0018] Further, updating the data stream information according to the location metadata of the IO write operation includes: detecting, based on the data flow information, whether the location metadata of the IO write operation belongs to the target management type of the high-load write protection mode; If so, updating the location metadata to the data stream information according to the target management type to which the location metadata belongs; Otherwise, the high-load write protection mode is temporarily disabled to reset the random update information.

[0019] As can be seen from the above description, by detecting whether the location metadata of the IO write operation belongs to the target management type based on the data flow information, it is possible to screen out legal operations that comply with the preset management rules. When the detection result is that it belongs to the target management type, the location metadata is dynamically updated to the data flow information according to the update rules corresponding to the type to ensure the real-time validity of the data flow information. If the detection result does not belong to the target management type, the illegal operation that may cause data flow chaos is forced to be interrupted by temporarily turning off the high-load write protection mode and resetting the random update information, thereby maintaining the operational stability of the high-load write protection mode at the system level. This solution effectively solves the contradiction between data flow information maintenance and illegal operation blocking in high-concurrency scenarios through the combination of classification processing mechanism and abnormal interruption mechanism.

[0020] Furthermore, the data flow information includes an allocated old flow identifier and an unallocated new flow identifier; The target management types include resource allocation management, resource recovery management, full update management and incremental update management; Detecting, according to the data flow information, whether the location metadata of the IO write operation belongs to the target management type of the high-load write protection mode includes: verifying, based on the data flow information, whether the location metadata satisfies an allocation condition for the new flow identifier, and if so, determining that the location metadata belongs to resource allocation management; If the allocation condition is not met, verifying whether the location metadata meets the release condition of the old flow identifier according to the data flow information, and if the release condition is met, determining that the location metadata belongs to resource recycling management; If the release condition is not met, verifying whether the location metadata is written across units based on the data stream information; if it is written across units, determining that the location metadata belongs to full update management; If it is not a cross-unit write, verify whether the location metadata is written in the same unit according to the data stream information; if it is written in the same unit, determine that the location metadata belongs to incremental update management; If it is not written into the same unit, it is determined that the location metadata does not belong to the target management type.

[0021] As can be seen from the above description, the first step is to determine whether it belongs to resource allocation management by verifying the allocation conditions of the new stream identifier, so as to determine the operation that requires allocating new resources; when the allocation conditions are not met, the release conditions of the old stream identifier are verified to determine whether it belongs to resource recycling management, so as to determine the operation that requires releasing resources; for situations that do not meet the first two conditions, the cross-unit write characteristics are detected to determine whether it belongs to full update management, so as to identify operations involving multiple allocation units; if it is not a cross-unit write, the same-unit write characteristics are further detected to determine whether it belongs to incremental update management, so as to identify operations within the same allocation unit; finally, the elimination method is used to determine abnormal operations that do not belong to any management type. This progressive classification detection mechanism achieves accurate classification of complex write scenarios, ensuring the accuracy and completeness of data flow information updates.

[0022] Further, updating the location metadata to the data stream information according to the target management type to which the location metadata belongs includes: If the location metadata belongs to resource allocation management, obtaining a new flow identifier and binding the location metadata to the new flow identifier; If the location metadata belongs to resource recycling management, obtaining an old flow identifier of the allocated unit to which the location metadata currently belongs, and releasing all data bound to the old flow identifier; If the location metadata belongs to full update management, obtaining the old stream identifier of the allocated unit to which the location metadata currently belongs, and binding the location metadata to the old stream identifier; If the location metadata belongs to incremental update management, the old stream identifier of the allocated unit to which the location metadata currently belongs is obtained, and part of the location metadata is bound to the old stream identifier.

[0023] From the above description, it can be seen that actively obtaining new stream identifiers and establishing binding relationships for resource allocation management scenarios can effectively isolate different batches of write operations and avoid random writes interfering with allocated units. Due to the limited number of stream identifiers, in resource recycling management, by unbinding the data of the old stream identifiers, the stream identifiers can be released in time to maintain continuous write performance and avoid write failures caused by lack of stream identifiers. For full update scenarios, the old stream identifiers are re-binded to ensure timely updates of identifiers when large blocks of data are written; and only part of the metadata is bound during incremental updates, thus achieving a balance between fine-grained data updates and identifier management. This identifier operation strategy based on differentiated management types can timely update the data stream for each legal write protection operation, thereby ensuring the legitimacy of the data stream and adapting to the video performance assurance specifications.

[0024] Furthermore, verifying whether the location metadata satisfies a condition for allocating a new stream identifier according to the data stream information includes: determining unallocated cells within the user area based on the data flow information; Detecting whether the location metadata of the IO write operation is completely located in the unallocated unit and whether there is an unallocated new stream identifier in the data stream information; If so, determining that the position metadata satisfies the allocation conditions for a new stream identifier; Otherwise, it is determined that the position metadata does not meet the allocation condition of the new stream identifier.

[0025] As can be seen from the above description, first, the unallocated units in the user area are located based on the data flow information to ensure that the target address of the IO write operation belongs to the unoccupied storage space, thereby avoiding resource conflicts. Secondly, by detecting whether there are unallocated new stream identifiers in the data flow information, allocation failures caused by exhaustion of identifier resources are prevented. Allocation operations are only allowed when the location metadata is completely located in the unallocated unit and there are new identifiers available. This collaborative verification mechanism effectively maintains the validity of the identifier resource pool, eliminates interference from cross-region writes, and establishes pre-constraints for resource allocation. The two together constitute the safety boundary of resource allocation under high-load mode.

[0026] Furthermore, verifying whether the location metadata satisfies a release condition of the old stream identifier according to the data stream information includes: determining, based on the data stream information, a remaining space of an allocated unit to which the location metadata currently belongs, and detecting whether a target space occupied by the location metadata is equal to the remaining space; If so, determining that the position metadata satisfies a release condition for the old stream identifier; Otherwise, it is determined that the position metadata meets the release condition of the old stream identifier.

[0027] As can be seen from the above description, the remaining space data of the allocated unit is obtained through data flow information. The target space occupied by the current IO write operation is compared with the remaining space. When the two are equal, it indicates that the unit space has been completely filled after the current IO write operation is completed. At this time, the release condition of the old flow identifier is triggered to ensure the timely and accurate recovery of resources. If it is detected that the target space does not fully occupy the remaining space, the current resource allocation state is maintained to avoid the accidental release of storage resources in use. This mechanism realizes the refined management and efficient utilization of storage space resources.

[0028] Furthermore, verifying whether the location metadata is cross-unit written according to the data stream information includes: determining, based on the data stream information, an allocated unit to which the position metadata currently belongs; determining an unallocated unit that is logically located one position after the allocated unit; detecting whether the location metadata is partially located within the unallocated unit; If yes, determining that the location metadata is written across units; Otherwise, it is determined that the position metadata is not cross-unit write.

[0029] As can be seen from the above description, the currently allocated unit is first located based on data stream information to determine its physical boundaries. Secondly, the spatial continuity between adjacent units is established by determining the next unallocated unit. Finally, the continuity characteristics of the write operation are determined by detecting whether the location metadata crosses the boundary between two units. This detection mechanism, based on the logical order of units, can effectively distinguish between full and incremental updates, avoiding resource allocation errors caused by cross-unit writes.

[0030] Furthermore, verifying whether the location metadata is written in the same unit according to the data stream information includes: determining, based on the data stream information, an allocated unit to which the position metadata currently belongs; detecting whether the location metadata is completely located within the allocated unit; If so, determining that the position metadata is written in the same unit; Otherwise, it is determined that the position metadata is not written in the same unit.

[0031] As can be seen from the above description, by obtaining the status of the currently allocated unit in real time based on data flow information and then checking whether the location metadata is completely within the allocated unit, it is possible to accurately distinguish between same-unit writes and cross-unit writes. If it is detected that the write is completely within the allocated unit, it is determined to be a same-unit write. This achieves precise classification of write types and provides accurate basis for subsequent updates to data flow information, effectively supporting performance assurance requirements under high load conditions at the storage space management level.

[0032] Furthermore, before detecting whether the location metadata of the IO write operation is completely located in the user area of the storage space, the method further includes: determining a current state of the high-load write protection mode; If the high-load write protection mode is in the enabled state, detecting whether the location metadata of the IO write operation is completely located in the user area of the storage space; If the high-load write protection mode is in a temporarily stopped state, the unallocated units of the user area are determined according to the data flow information, and it is detected whether the IO write operation is sequentially written in the unallocated units. If not, the high-load write protection mode is turned off to reset the write management information.

[0033] As can be seen from the above description, when high-load write protection mode is enabled, I / O write operations are strictly restricted to sequential writes, and high-load write protection mode is forcibly disabled to clear random update information. This effectively prevents random writes from interfering with video recording performance, thereby ensuring the continuity and high throughput of high-load video recording. When high-load write protection mode is temporarily paused, only sequential writes to unallocated locations are allowed. This prevents illegal writes from interfering with recorded data or pre-allocated stream information during the pause period, ensuring data continuity when high-load write protection mode is resumed.

[0034] Furthermore, writing data according to the area type to which the location metadata belongs in the storage space includes: detecting whether the location metadata is completely located within the system area of the storage space; If so, verify the legitimacy of the IO write operation according to standard protocol parameters, and if the verification passes, write the data according to the location metadata; Otherwise, data is written according to the location metadata, and the location metadata is marked as abnormal data.

[0035] As can be seen from the above description, by prioritizing detection of IO write operations within the system area, the writing of critical system data is ensured to be unrestricted by the high-load write protection mode, directly following the standard protocol, and improving the flexibility and compatibility of storage management. For write operations that cross the system area and user area, abnormal data is marked for subsequent processing, avoiding data confusion or status conflicts caused by boundary writes and enhancing the system's fault tolerance. Data within the system area is subject to verification of the legitimacy of IO write operations to prevent the execution of illegal commands, while ensuring that the user area is still subject to the high-load write protection mode, balancing high performance and data security.

[0036] Another embodiment of the present invention provides a storage device including a storage chip and a control chip. The storage chip stores a computer program. When the computer program is executed by the control chip, the computer program implements the steps in the above-mentioned method for managing IO write operations.

[0037] As can be seen from the above description, the beneficial effects of the present invention are: first, by detecting whether the host has turned on the high-load write protection mode (VPG specification), it can actively identify whether the current system is in an operating state that requires special management. When the mode is turned on, by obtaining the write management information containing the data stream information, a decision basis is provided for the sequential judgment of subsequent write operations. The VPG specification requires that each IO write operation that writes the data stream information is a sequential write. Based on the data stream information, the historical write rules can be traced back. Therefore, by matching the current IO write operation with the data stream information, it can be accurately determined whether the current IO write operation is a sequential write. For sequential write operations, the dynamic consistency of the storage space management information is maintained by updating the data stream information corresponding to the location metadata in real time. The present invention can ensure that the data stream information read by the host in the high-load write protection mode is a sequential write operation, and there is no random write operation, so as to adapt to the video performance guarantee specification.

[0038] The method and storage device for managing IO write operations of the present invention can be applied to video capture devices, which can improve the reliability and write performance of the device when performing high-load video recording. The following is an explanation of the specific implementation methods: Please refer to Figures 1 to 6 , embodiment 1 of the present invention is: like Figure 1 As shown, a method for managing IO write operations includes the following steps: S1. Receive an IO write operation sent by the host and detect whether the host has enabled high-load write protection mode. If enabled, execute S2.

[0039] Enabling high-load write protection mode on the host also means enabling high-load video recording. During high-load video recording, every I / O write operation must meet the VPG specification. The VPG specification requires that every I / O write operation issued by the host be sequential, with no illegal random writes (which constitute illegal access). This is because the sequential write performance of storage devices far exceeds random write performance, effectively ensuring high write performance for the entire storage space. Under the VPG specification, if an I / O write operation is considered an illegal random write, high-load video recording must be disabled to fall back to traditional write mode.

[0040] S2. Acquire write management information of the high-load write protection mode, where the write management information includes data stream information (VPG_Stream_Info) of historical IO write operations and random update information (VPG_random_update_info) of random update commands (Random Update).

[0041] In some embodiments, in the VPG specification, the size of the write data sent by the host each time is fixed. This predefined unit is called an Allocation Unit (AU), which is the minimum data block size for each IO write operation in the VPG mode. Therefore, in the VPG mode, the storage space of the entire disk is divided into multiple AUs of the same size. Among them, the AUs in the storage space are divided into allocated units (Opened AUs) and unallocated units (Unopened AUs). Within a single AU, as long as new IO data is written from the starting address of the current AU, it is assumed that the current AU has been allocated (i.e., Opened); or, when the host sends a Random Update command, and the logical block address of the Random Update command is within a certain AU address range, it is assumed that the AU has been allocated (i.e., Opened).

[0042] VPG_Stream_Info stores the stream identifier (Stream ID) for each opened AU. Each Stream ID is associated with the corresponding opened AU's starting logical block address (SLBA) and the number of logical block addresses (LBA Cnt) to which data has been written within the opened AU. Once AU information is stored in VPG_Stream_Info, it indicates that the current AU has been opened. The number of Stream IDs is limited; once all Stream IDs are used, no new AUs can be opened. VPG_random_update_info stores the SLBA and access type specified by the Random Update command.

[0043] like Figure 2 As shown, specifically, before S3, the method further includes S301-S306: S301 , determining the current state of the high-load write protection mode. If the high-load write protection mode is in the start-up state, executing S303 ; if the high-load write protection mode is in the temporary stop state, executing S302 .

[0044] The host's VPG status can be divided into three types: Normal State (normal state), Enable State (start-up state) and Suspend State (temporary stop state). Among them, Normal State means that the host has not turned on the high-load write protection mode (VPG management). In this state, the VPG-related write management information will be reset. Enable State means that the host has turned on the high-load write protection mode and is in the start-up state, that is, video recording is turned on. In this state, the VPG-related write management information can be updated. Suspend State means that the host has turned on the high-load write protection mode, but is in the temporary stop state, that is, video recording is paused. In this state, other VPG-related management information needs to be saved. Figure 3 As shown, the host is in the Initial State when it is turned off. When it is turned on, the host can be set to any of the above-mentioned Normal State, Enable State, and Suspend State. For example, if the host starts video recording in the Normal State, it switches to the Enable State. If the host pauses video recording in the Enable State, it switches to the Suspend State. Conversely, if the host resumes video recording in the Suspend State, it switches to the Enable State. If the host terminates video recording in the Enable State or there is illegal access, it switches to the Normal State. If the host terminates video recording in the Suspend State or there is illegal access, it also switches to the Normal State.

[0045] S302: Determine the unallocated units of the user area according to the data stream information, and detect whether the IO write operation performs sequential writing in the unallocated units; if not, disable the high-load write protection mode to reset the write management information.

[0046] In an optional embodiment, as Figure 3 As shown in the figure, when the host is in the VPG Suspend State, as long as the IO write operation is a sequential write in the Unopened AU, that is, the SLBA of the IO write operation is equal to the SLBA of the Unopened AU, the IO write operation can pass the VPG specification certification. If the IO write operation is not a sequential write, then the IO write operation is an illegal access and it is necessary to disable the high-load write protection mode, switch to the Normal State, and reset all information in VPG_Stream_Info and VPG_random_upadte_info.

[0047] S303: Detect whether the location metadata of the IO write operation is completely located in the user area of the storage space. If so, execute S304; otherwise, execute S306.

[0048] In some embodiments, the location metadata includes the starting logical block address (SLBA) and logical block number (NLB) used by the IO write operation to write data. The ending logical block address used to write data can be expressed as SLBA + NLB. The NLB of the IO write operation is stored in the LBA Cnt field of the Stream ID.

[0049] In an optional implementation, S303 specifically includes: detecting whether the SLBA and SLBA+NLB of the IO write operation are both located in the user area (User Area); if so, executing S304.

[0050] S304: Detect whether there is an update address in the random update information that matches the location metadata of the IO write operation. If so, execute S305; if not, execute S3.

[0051] In an optional implementation, S304 specifically includes: detecting whether the SLBA recorded in VPG_random_upadte_info is the same as the SLBA of the IO write operation, and if so, executing S305.

[0052] S305: No need to execute S3, and directly write data according to the location metadata.

[0053] S306: Write data according to the area type to which the location metadata belongs in the storage space.

[0054] Among them, S306 includes S3061-S3063: S3061. Detect whether the location metadata is completely located in the system area of the storage space. If so, execute S3062; otherwise, execute S3063.

[0055] In an optional embodiment, as Figure 4 As shown, S3061 specifically includes: detecting whether the SLBA and SLBA+NLB of the IO write operation are both located in the system area (System Area), and if so, executing S3062. Figure 5 As shown, if it is detected that the SLBA of the IO write operation is located in the System Area, and the SLBA+NLB of the IO write operation is not located in the System Area, S3063 is executed.

[0056] It should be noted that the entire storage space is divided into multiple AUs, and the system area only occupies the address space of the first N AUs in the storage space starting from LBA = 0, where N is an integer greater than or equal to 0. Data in the system area is not subject to VPG specification management and can be written randomly.

[0057] S3062: Verify the legitimacy of the IO write operation according to standard protocol parameters. If the verification passes, write data according to the location metadata.

[0058] In an optional embodiment, standard protocol parameters are obtained from the NVMe protocol, and the legitimacy of parameters such as the namespace identifier (NSID), physical region page (PRP), hash list (SGL), and logical block address (LBA) of the IO write operation is verified based on the standard protocol parameters.

[0059] S3063. Write data according to the location metadata, and mark the location metadata as abnormal data.

[0060] S3. Determine whether the IO write operation is a sequential write operation according to the data flow information. If so, execute S4.

[0061] Specifically, S3 includes S31-S34: S31. Determine the termination logical address of the previous IO write operation according to the data flow information.

[0062] S32: Compare the termination logical address with the location metadata of the IO write operation to see if they are the same.

[0063] S33: If they are the same, determine that the IO write operation is a sequential write operation.

[0064] S34: If they are not the same, it is determined that the IO write operation is an illegal random write operation, and the high-load write protection mode is temporarily disabled to reset the random update information.

[0065] In an optional embodiment, as Figure 6 As shown in the figure, if the location metadata of the current IO write operation falls within a certain Opened AU, but the number of logical block addresses of the current Opened AU that have written data is X, then if the SLBA of the current IO write operation is equal to X, it means that the current IO write operation is a sequential write operation. If the SLBA of the current IO write operation is not equal to X, it means that the current IO write operation is an illegal random write operation.

[0066] It should be noted that temporarily disabling the high-load write protection mode means switching to the Normal State state, resetting the random update information, and then switching to the Enable State state again.

[0067] S4. Update the data stream information according to the location metadata of the IO write operation.

[0068] Please refer to Figures 7 to 11 , the second embodiment of the present invention is: A method for managing IO write operations, which differs from the first embodiment in that: a specific implementation of S4 is provided.

[0069] like Figure 7 As shown, specifically, S4 includes S41-S43: S41. Detect, based on the data flow information, whether the location metadata of the IO write operation belongs to the target management type of the high-load write protection mode. If so, execute S42; otherwise, execute S43.

[0070] S42: Update the location metadata to the data stream information according to the target management type to which the location metadata belongs.

[0071] The data flow information includes an allocated old flow identifier and an unallocated new flow identifier, and the target management type includes resource allocation management, resource recycling management, full update management, and incremental update management.

[0072] Specifically, S41 includes S411-S414: S411. Verify whether the location metadata meets the allocation conditions of the new stream identifier based on the data stream information. If the allocation conditions are met, determine that the location metadata belongs to resource allocation management and execute S421; if the allocation conditions are not met, execute S412.

[0073] In an optional implementation, S411 includes S4111-S4112: S4111. Determine unallocated units in the user area according to the data flow information.

[0074] S4112. Detect whether the location metadata of the IO write operation is completely located in the unallocated unit and whether there is an unallocated new stream identifier in the data stream information. If so, determine that the location metadata meets the allocation conditions of the new stream identifier.

[0075] In a specific application scenario, such as Figure 8As shown, the SLBA and NLB of the current IO write operation are compared with the SLBA and LBA Cnt of all Opened AUs in VPG_Stream_Info. If the SLBA and NLB of this IO write operation do not fall within any Opened AU area, and the SLBA of the current IO write operation is the same as the SLBA of an Unopened AU, and there is an unassigned Stream ID, then the conditions for allocating a new stream identifier are met.

[0076] S412. Verify whether the location metadata meets the release condition of the old stream identifier based on the data stream information. If the release condition is met, determine that the location metadata belongs to resource recycling management and execute S422; if the release condition is not met, execute S413.

[0077] In an optional implementation, S412 includes S4121: S4121. Determine the remaining space of the allocated unit to which the location metadata currently belongs based on the data stream information, and detect whether the target space occupied by the location metadata is equal to the remaining space. If so, determine that the location metadata meets the release condition of the old stream identifier.

[0078] In a specific application scenario, such as Figure 9 As shown, the SLBA and NLB of the current IO write operation are compared with the SLBA and LBA Cnt bound to all stream IDs in VPG_Stream_Info to determine whether the current IO write operation will fully write the current open AU. That is, the location metadata of the current IO write operation satisfies the following relationship: SLBA of the current IO write operation = SLBA of the stream ID in VPG_Stream_Info + LBA Cnt, and SLBA + NLB of the current IO write operation = SLBA of the stream ID in VPG_Stream_Info + allocation unit size (AU Size).

[0079] S413. Verify whether the location metadata is written across units based on the data flow information. If it is written across units, determine that the location metadata belongs to full update management and execute S423; if it is not written across units, execute S414.

[0080] In an optional implementation, S413 includes S4131-S4133: S4131. Determine, based on the data stream information, the allocated unit to which the location metadata currently belongs.

[0081] S4132. Determine an unallocated unit that is one position after the allocated unit in logical order.

[0082] S4133. Detect whether the location metadata is partially located within the unallocated unit. If so, determine that the location metadata is a cross-unit write.

[0083] In a specific application scenario, such as Figure 10 As shown, the SLBA and NLB of the current IO write operation are respectively compared with the SLBA and LBA Cnt of each Opened AU in the VPG_Stream_Info to determine whether the current IO write operation writes from the Opened AU to which the current Stream ID belongs into the next logically consecutive Unopened AU. That is, the location metadata of the current IO write operation satisfies the following relationships: the SLBA of the current IO write operation = the SLBA of the VPG_Stream_Info + the LBA Cnt of the VPG_Stream_Info, and the SLBA + NLB of the current IO write operation > the SLBA of the VPG_Stream_Info + the AU Size, and the SLBA + NLB of the current IO write operation < the SLBA of the VPG_Stream_Info + the AU Size + the AU Size.

[0084] S414. Verify whether the location metadata is a same-unit write according to the data stream information. If it is a same-unit write, determine that the location metadata belongs to incremental update management and execute S424; if it is not a same-unit write, determine that the location metadata does not belong to the target management type.

[0085] It should be noted that the above S411 - S414 are sequential judgments step by step. Therefore, the IO write operations that do not belong to the target management type in S414 refer to the IO write operations that do not meet the allocation condition, do not meet the release condition, are not cross-unit writes, and are not same-unit writes. As long as the IO write operation meets any one of the allocation condition, release condition, cross-unit write, and same-unit write, it belongs to the IO write operation of the target management type.

[0086] In an optional implementation manner, S414 includes S4141 - S4142: S4141. Determine the allocated unit to which the location metadata currently belongs according to the data stream information.

[0087] S4142. Detect whether the location metadata is completely located within the allocated unit. If so, determine that the location metadata is a same-unit write.

[0088] In a specific application scenario, such as Figure 11As shown, the SLBA and NLB of the current IO write operation are compared with the SLBA and LBA Cnt of each Opened AU in VPG_Stream_Info to determine whether the current IO write operation is sequentially written to the same Opened AU. In other words, the location metadata of the current IO write operation satisfies the following relationship: SLBA of the current IO write operation = SLBA in VPG_Stream_Info + LBA Cnt.

[0089] Specifically, S42 includes S421-S424: S421: If the location metadata belongs to resource allocation management, obtain a new flow identifier and bind the location metadata to the new flow identifier.

[0090] In a specific application scenario, the SLBA and NLB of the current IO write operation are saved in a new stream identifier Stream ID.

[0091] S422: If the location metadata belongs to resource recycling management, obtain the old flow identifier of the allocated unit to which the location metadata currently belongs, and release all data bound to the old flow identifier.

[0092] In a specific application scenario, all AU information bound to the current Stream ID is released.

[0093] S423: If the location metadata belongs to full update management, obtain the old stream identifier of the allocated unit to which the location metadata currently belongs, and bind the location metadata to the old stream identifier.

[0094] In a specific application scenario, the AU information bound to the current Stream ID is updated to the SLBA and LBA Cnt of the unallocated unit to which the data is to be written in the current IO write operation.

[0095] S424: If the location metadata belongs to incremental update management, obtain the old stream identifier of the allocated unit to which the location metadata currently belongs, and bind part of the location metadata to the old stream identifier.

[0096] In a specific application scenario, the LBA Cnt in the AU information bound to the current Stream ID is updated to the LBA Cnt after the data is written by the current IO write operation.

[0097] S43: Temporarily disable the high-load write protection mode to reset the random update information.

[0098] Please refer to Figure 12 , the third embodiment of the present invention is: A storage device 100 includes a storage chip 101 and a control chip 102. The storage chip stores a computer program. When the computer program is executed by the control chip 102, the computer program implements the steps of the method for managing IO write operations in embodiment 1 or embodiment 2.

[0099] In summary, the present invention provides a method and storage device for managing I / O write operations. This method implements I / O write operation management in high-load write protection mode (VPG specification). Through a multi-level linkage mechanism, it ensures high-performance sequential writes in high-load scenarios such as video recording. Its core lies in dynamically detecting host status and combining data flow information with the coordinated management of random update commands to accurately distinguish between sequential writes and illegal random writes. For sequential writes, data flow consistency is maintained by updating location metadata in real time. For illegal random writes, protection mode is forcibly disabled and random update information is reset to ensure write compliance. The present invention employs a classification processing mechanism to differentiate operations based on target types, such as resource allocation / reclamation and full / incremental updates. Fine-grained resource management is achieved through dynamic binding of stream identifiers. Furthermore, a zone verification mechanism is introduced to implement differentiated write policies for system and user zones, balancing system flexibility and data security. This technology significantly improves the throughput stability of storage systems under high-load conditions, effectively avoiding performance jitter caused by random writes, and fully complies with video performance assurance specifications. Furthermore, through exception marking and state reset mechanisms, the system's fault tolerance is enhanced, providing a reliable storage management solution for high-performance continuous data write scenarios.

[0100] In the above embodiments provided in the present application, it should be understood that the disclosed methods, devices, computer-readable storage media, and electronic devices can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple components or modules can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or components or modules, which can be electrical, mechanical or other forms.

[0101] The components described as separate parts may or may not be physically separate, and the components shown as components may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of these components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0102] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing module, or each component may exist physically separately, or two or more modules may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or software functional modules.

[0103] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0104] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0105] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0106] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for managing IO write operations, characterized in that: include: Receive an IO write operation from the host and detect whether the host has enabled high-load write protection mode; If enabled, obtain the write management information of the high-load write protection mode, wherein the write management information includes data flow information of historical IO write operations; Determining whether the IO write operation is a sequential write operation according to the data flow information; If so, the data stream information is updated according to the location metadata of the IO write operation.

2. The method for managing IO write operations according to claim 1, wherein: The write management information also includes random update information of the random update command; Before determining whether the IO write operation is a sequential write operation according to the data stream information, the method further includes: Detecting whether the location metadata of the IO write operation is completely located in the user area of the storage space; If so, detecting whether there is an update address in the random update information that matches the location metadata of the IO write operation; If it exists, there is no need to determine whether the IO write operation is a sequential write operation based on the data stream information, and the data is directly written based on the position metadata; If not, determining whether the IO write operation is a sequential write operation according to the data flow information; Otherwise, data is written according to the area type to which the location metadata belongs in the storage space.

3. The method for managing IO write operations according to claim 2, wherein: Determining whether the IO write operation is a sequential write operation according to the data flow information includes: Determine the termination logical address of the previous IO write operation according to the data flow information; Comparing the termination logical address with the location metadata of the IO write operation to see if they are the same; If they are the same, it is determined that the IO write operation is a sequential write operation; If they are not the same, it is determined that the IO write operation is an illegal random write operation, and the high-load write protection mode is temporarily disabled to reset the random update information.

4. The method for managing IO write operations according to claim 2, wherein: Updating the data stream information according to the location metadata of the IO write operation includes: detecting, based on the data flow information, whether the location metadata of the IO write operation belongs to the target management type of the high-load write protection mode; If so, updating the location metadata to the data stream information according to the target management type to which the location metadata belongs; Otherwise, the high-load write protection mode is temporarily disabled to reset the random update information.

5. The method for managing IO write operations according to claim 4, wherein: The data flow information includes an allocated old flow identifier and an unallocated new flow identifier; The target management types include resource allocation management, resource recovery management, full update management and incremental update management; Detecting, according to the data flow information, whether the location metadata of the IO write operation belongs to the target management type of the high-load write protection mode includes: verifying, based on the data flow information, whether the location metadata satisfies an allocation condition for the new flow identifier, and if so, determining that the location metadata belongs to resource allocation management; If the allocation condition is not met, verifying whether the location metadata meets the release condition of the old flow identifier according to the data flow information, and if the release condition is met, determining that the location metadata belongs to resource recycling management; If the release condition is not met, verifying whether the location metadata is written across units based on the data stream information; if it is written across units, determining that the location metadata belongs to full update management; If it is not a cross-unit write, verify whether the location metadata is written in the same unit according to the data stream information; if it is written in the same unit, determine that the location metadata belongs to incremental update management; If it is not written into the same unit, it is determined that the location metadata does not belong to the target management type.

6. The method for managing IO write operations according to claim 5, wherein: Updating the location metadata to the data stream information according to the target management type to which the location metadata belongs includes: If the location metadata belongs to resource allocation management, obtaining a new flow identifier and binding the location metadata to the new flow identifier; If the location metadata belongs to resource recycling management, obtaining an old flow identifier of the allocated unit to which the location metadata currently belongs, and releasing all data bound to the old flow identifier; If the location metadata belongs to full update management, obtaining the old stream identifier of the allocated unit to which the location metadata currently belongs, and binding the location metadata to the old stream identifier; If the location metadata belongs to incremental update management, the old stream identifier of the allocated unit to which the location metadata currently belongs is obtained, and part of the location metadata is bound to the old stream identifier.

7. The method for managing IO write operations according to claim 5, wherein: Verifying whether the location metadata satisfies the allocation condition of the new stream identifier according to the data stream information includes: determining unallocated cells within the user area based on the data flow information; Detecting whether the location metadata of the IO write operation is completely located in the unallocated unit and whether there is an unallocated new stream identifier in the data stream information; If so, it is determined that the position metadata meets the allocation condition of the new stream identifier.

8. The method for managing IO write operations according to claim 5, wherein: Verifying whether the location metadata satisfies a release condition of the old stream identifier according to the data stream information includes: determining, based on the data stream information, a remaining space of an allocated unit to which the location metadata currently belongs, and detecting whether a target space occupied by the location metadata is equal to the remaining space; If so, it is determined that the position metadata meets the release condition of the old stream identifier.

9. The method for managing IO write operations according to claim 5, wherein: Verifying whether the location metadata is cross-unit write according to the data stream information includes: determining, based on the data stream information, an allocated unit to which the position metadata currently belongs; determining an unallocated unit that is logically located one position after the allocated unit; detecting whether the location metadata is partially located within the unallocated unit; If so, it is determined that the location metadata is written across units.

10. The method for managing IO write operations according to claim 5, wherein: Verifying whether the location metadata is written to the same unit according to the data stream information includes: determining, based on the data stream information, an allocated unit to which the position metadata currently belongs; detecting whether the location metadata is completely located within the allocated unit; If so, it is determined that the position metadata is written in the same unit.

11. The method for managing IO write operations according to claim 2, wherein: Before detecting whether the location metadata of the IO write operation is completely located in the user area of the storage space, the method further includes: determining a current state of the high-load write protection mode; If the high-load write protection mode is in the enabled state, detecting whether the location metadata of the IO write operation is completely located in the user area of the storage space; If the high-load write protection mode is in a temporarily stopped state, the unallocated units of the user area are determined according to the data flow information, and it is detected whether the IO write operation is sequentially written in the unallocated units. If not, the high-load write protection mode is turned off to reset the write management information.

12. The method for managing IO write operations according to claim 2, wherein: Writing data according to the area type to which the location metadata belongs in the storage space includes: detecting whether the location metadata is completely located within the system area of the storage space; If so, verify the legitimacy of the IO write operation according to standard protocol parameters, and if the verification passes, write the data according to the location metadata; Otherwise, data is written according to the location metadata, and the location metadata is marked as abnormal data.

13. A storage device comprising a storage chip and a control chip, wherein the storage chip stores a computer program, wherein: When the computer program is executed by the control chip, the steps of the method for managing IO write operations according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Block device thin-provisioning method for log mapping

    CN104035729A

  • File storage method and device, equipment and medium

    CN112307263A

  • Data processing method, storage system, device, storage medium and program product

    CN119718215A

  • Data read-write request processing method, electronic equipment, storage medium and program product

    CN120233958A

  • Device and method for processing video signal

    JP2006195134A