Firmware hard disk data access method and device, computer equipment and storage medium

By integrating the timestamp function at the firmware level of solid-state drives, the problems of time stamp information loss and inconsistency in traditional methods are solved, the time consistency and accuracy of data are achieved, and the efficiency and reliability of data management and application are improved.

CN120386492AActive Publication Date: 2025-07-29INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional methods of adding timestamps at the operating system or application level lead to the loss, inconsistency or inaccuracy of timestamp information, affecting data migration, backup or interaction time-related attributes between different systems, affecting the effective use of data and the normal operation of business.

Method used

The timestamp function is integrated into the firmware level of the solid state drive and deeply bound to the configuration parameters of the namespace, so that the timestamp information is generated synchronously when data is written and stored in the same storage unit.

Benefits of technology

It enhances the time consistency of the entire life cycle of data, reduces the complexity of system software, and improves the real-time and accuracy of data in key business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386492A_ABST
    Figure CN120386492A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware hard disk data access method and device, computer equipment and a storage medium, and relates to the technical field of data processing.The firmware hard disk data access method comprises the steps that an access instruction sent by a host is received, and a target namespace is determined based on the instruction; by obtaining configuration parameters of a timestamp function in a target namespace, the timestamp function is integrated to a solid state disk layer, and tight binding of timestamp information and data in a storage unit is achieved; and identifying and preparing to-be-processed data based on the configuration parameters, and finally executing corresponding processing operation according to the access instruction. The problems that in the related technology, timestamp information is lost and inaccurate due to the fact that a timestamp is added to an operating system or an application program layer, data migration backup or interaction time related attributes between different systems cannot be accurately reflected, and effective utilization of data and normal operation of services are affected are solved. The technical effects of enhancing the data time consistency, reducing the system complexity and improving the efficiency and reliability of data management and application are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data processing, and particularly to a method and device for accessing firmware hard disk data, a computer device, and a storage medium. Background Art

[0002] With the development of information technology, the storage and management of data have become increasingly important. Among many data storage devices, solid-state drives (NVMe SSDs) are widely used in various computer systems and mobile devices due to their advantages such as fast read and write speeds and strong earthquake resistance. However, during the use of data, it is often necessary to know time-related information such as the generation time and modification time of the data for operations such as data management, analysis, and traceability.

[0003] The traditional method is to add timestamp information to data at the operating system or application level, but this method has some obvious drawbacks. On the one hand, since the timestamp information is stored and managed separately from the data, it is easy to lose or be inconsistent with the timestamp information during data migration, backup, or interaction between different systems, resulting in the inability to accurately reflect the time-related attributes of the data and affecting the effective utilization of the data. On the other hand, in scenarios with extremely high requirements for data timeliness and accuracy, such as financial transaction data records and industrial automation data collection, adding timestamps at the operating system or application level has a delay, which will lead to inaccurate timestamps and thus affect the normal operation of the business and the accuracy of decision-making. Summary of the Invention

[0004] The present application provides a method and device for accessing firmware hard disk data, a computer device, and a storage medium to at least solve the problems of loss, inconsistency, or inaccuracy of timestamp information caused by adding timestamps at the operating system or application level in related technologies, and the inability to accurately reflect time-related attributes during data migration, backup, or interaction between different systems, which affects the effective utilization of data and the normal operation of the business.

[0005] The present application provides a method for accessing firmware hard disk data, which is applied to a solid-state drive and includes: Receiving an access instruction sent by a host, and determining a target namespace according to the access instruction; Obtaining configuration parameters of the timestamp function in the target namespace, and determining the data to be processed corresponding to the access instruction based on the configuration parameters; Performing a corresponding processing operation on the data to be processed according to the access instruction.

[0006] The present application also provides a device for accessing firmware hard disk data, which is applied to a solid-state drive and includes: A receiving module, configured to receive an access instruction sent by a host, and determine a target namespace according to the access instruction; An acquisition module, configured to acquire configuration parameters of a timestamp function in a target namespace, and determine data to be processed corresponding to an access instruction based on the configuration parameters; An execution module, configured to perform corresponding processing operations on the data to be processed according to the access instruction.

[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 firmware hard disk data access methods when executing the computer program.

[0008] This application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above firmware hard disk data access methods are implemented.

[0009] This application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any of the above firmware hard disk data access methods are implemented.

[0010] Through this application, since the timestamp function is integrated into the firmware layer of the solid-state drive and deeply bound to the configuration parameters of the namespace, the timestamp information can be synchronously generated and stored in the same storage unit when data is written. Therefore, problems such as migration loss, system inconsistency caused by separate storage of data and timestamps in the traditional software layer timestamp scheme, and delay errors caused by adding timestamps at the application layer can be solved, achieving the technical effects of enhancing the time consistency of the entire data life cycle, reducing the complexity of system software, and improving the real-time performance and accuracy of data in key business scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] To more clearly illustrate the embodiments of this application, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0012] Figure 1 It is a schematic flowchart of a firmware hard disk data access method provided by an embodiment of this application; Figure 2 It is a schematic diagram of the operation logic of the host and the solid-state drive timestamp function provided by an embodiment of this application; Figure 3 It is a schematic flowchart of namespace creation in a solid-state drive provided by an embodiment of this application; Figure 4 It is a schematic flowchart of timestamp generation and append in a solid-state drive provided by an embodiment of this application; Figure 5Block diagram of a firmware hard disk data access device provided by an embodiment of the present application; Figure 6 Schematic diagram of the hardware structure of a computer device provided by an 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 in 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 "include", "comprise" 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] An embodiment of the present application provides a firmware hard disk data access method, which is applied to a solid-state hard disk. Figure 1 It is a flowchart of a firmware hard disk data access method according to an embodiment of the present invention. As Figure 1 shown, the process includes the following steps: Step S101: Receive an access instruction sent by the host, and determine a target namespace according to the access instruction.

[0017] It should be noted that the namespace is the core logical unit for the solid-state drive to achieve multi-user isolation and refined management. By dividing the physical flash memory into independently addressable virtual storage pools, each namespace can be configured with independent capacity, performance QoS, and data life cycle policies. In an NVMe SSD, the namespace usually follows the NVMe protocol specification, achieves global unique addressing through a 64-bit namespace identifier, and supports dynamic creation / destruction operations. When the host initiates an access instruction, the SSD firmware quickly locates the metadata area of the target namespace (including the LBA mapping table, timestamp configuration parameters, etc.) by parsing the NSID field in the NVMe command structure and combining with the internal hash index table. This process is usually completed within microseconds to ensure low-latency response in high-concurrency scenarios. In addition, the namespace mechanism also supports storage tiering strategies - for example, allocating SLC caches for critical business namespaces and enabling compression algorithms for cold data spaces - to maximize flash utilization and read / write performance.

[0018] In the embodiment of the present application, the solid-state drive first receives an access instruction sent by the host. Among them, the access instruction can be different types such as a data write instruction or a data read instruction. Then, the solid-state drive parses out the namespace identifier from the access instruction, and this namespace identifier can uniquely determine a target namespace. After that, the solid-state drive matches the parsed namespace identifier with all the namespaces created in the system. The namespaces created in the system are created previously by receiving namespace creation requests and according to corresponding rules, and these namespaces all have their own unique identifiers. Through this matching, the solid-state drive can determine the target namespace pointed to by the access instruction, that is, clarify which specific namespace the host wants to access, thereby laying a foundation for subsequent data processing operations within this namespace.

[0019] As Figure 2 shown, the operation logic of the host and the solid-state drive related to the timestamp function: On the host side, when creating a namespace, it can specify whether to enable the timestamp function, can customize parameter settings to return data with or without a timestamp, can also query the function status, and decide whether to allocate extended space for the storage unit based on whether the returned data needs to carry a timestamp; on the solid-state drive side, if it contains corresponding preset parameters, it creates a namespace with the timestamp function, and if the parameter is that the storage unit does not expand space, it creates one without it. At the same time, it can receive the timestamp function parameters and read / write instructions from the upper-layer storage system, and determine whether the returned data carries a timestamp according to the parameters.

[0020] Step S102, obtain the configuration parameters of the timestamp function in the target namespace, and determine the data to be processed corresponding to the access instruction based on the configuration parameters.

[0021] In an embodiment of the present application, the solid-state drive first obtains the configuration parameters of the timestamp function from the determined target namespace. These configuration parameters are set when the namespace is created, including the timestamp function parameter and the timestamp unit parameter. Then, the solid-state drive extracts the timestamp function parameter and the timestamp unit parameter from the obtained configuration parameters. Next, a judgment is made according to the value of the timestamp function parameter. If the timestamp function parameter is in the enabled state, that is, the first preset parameter, the user data corresponding to the access instruction is obtained, and at the same time, the target timestamp is calculated based on the timestamp unit parameter. Then, the user data and the target timestamp are fused together to obtain the data to be processed. If the timestamp function parameter is in the disabled state, that is, the second preset parameter, or there is no timestamp function parameter, the solid-state drive directly obtains the user data corresponding to the access instruction and uses it as the data to be processed. When calculating the target timestamp, the solid-state drive first obtains the current CPU timing parameter, calculates the initial timestamp according to this parameter, and then adjusts the initial timestamp based on the timestamp unit information to finally obtain the target timestamp. Through such a series of operations, the solid-state drive can accurately determine the data to be processed corresponding to the access instruction, preparing for subsequent processing operations on the data according to the access instruction.

[0022] Step S103, perform a corresponding processing operation on the data to be processed according to the access instruction.

[0023] In an embodiment of the present application, the solid-state drive first determines the type of the received access instruction. If the access instruction is a data write instruction, the solid-state drive stores the user data in the to-be-processed data into the corresponding storage unit determined according to the logical block address format of the target namespace. At the same time, since the to-be-processed data also includes the target timestamp, the target timestamp is stored in the extended space corresponding to the storage unit. This extended space is allocated based on the timestamp unit parameter when creating the namespace with the timestamp function. If the access instruction is a data read instruction, the solid-state drive directly sends the to-be-processed data to the host. The to-be-processed data can be only user data or data that combines user data and the target timestamp, depending on the configuration of the timestamp function in the target namespace. By performing corresponding operations according to different access instruction types in this way, accurate processing of the data is achieved.

[0024] In an embodiment of the present application, before receiving the access instruction sent by the host, the method further includes: Step S201, receive a namespace creation request, where the namespace creation request includes a timestamp function parameter and a timestamp unit parameter.

[0025] In an embodiment of the present application, the solid-state drive receives a namespace creation request from an upper-layer storage system, and this request contains two important parameters, namely a timestamp function parameter and a timestamp unit parameter. The timestamp function parameter is used to control whether the timestamp function is enabled for the namespace, and the user can set the value of this parameter according to actual needs. The timestamp unit parameter is used to specify the unit of the timestamp, and the user can select any one of units such as milliseconds, seconds, minutes, hours, etc. After receiving this namespace creation request containing the timestamp function parameter and the timestamp unit parameter, the solid-state drive saves these parameters, providing a basis for subsequent namespace creation and timestamp-related processing operations. By receiving the namespace creation request, the solid-state drive can flexibly create a namespace that meets the requirements according to the specific needs of the user, laying a foundation for subsequent data storage and management work.

[0026] Step S202, if the timestamp function parameter is the first preset parameter, create a namespace including the timestamp function, allocate corresponding extended space for each storage unit in the namespace according to the timestamp unit parameter, and use the timestamp function parameter and the timestamp unit parameter as the configuration parameters of the namespace.

[0027] In an embodiment of the present application, the solid-state drive first determines whether the received timestamp function parameter is the first preset parameter (such as 1). If so, it starts to create a namespace including the timestamp function. Then, it determines the size of the extended space that needs to be allocated for each storage unit according to the timestamp unit parameter. If the timestamp unit parameter is the first level, allocate an extended space with a first preset length in each storage unit. If the timestamp unit parameter is the second level, allocate an extended space with a second preset length. Finally, save the timestamp function parameter and the timestamp unit parameter as the configuration parameters of this namespace, so that when data is written later, the timestamp can be recorded and stored according to these configuration parameters. In this way, the flexible configuration of the namespace timestamp function and the reasonable allocation of the extended space are achieved.

[0028] Step S203, if the timestamp function parameter is the second preset parameter, create a namespace without the timestamp function, and use the timestamp function parameter as the configuration parameter of the namespace.

[0029] In an embodiment of the present application, the solid-state drive first determines whether the received timestamp function parameter is a second preset parameter (such as 0). If so, it starts to create a namespace that does not include the timestamp function. Since this namespace does not support the timestamp function, there is no need to allocate additional extended space for the storage unit to store timestamp information. Finally, the timestamp function parameter is saved as the configuration parameter of this namespace, so that when processing access instructions subsequently, it can be determined whether this namespace supports the timestamp function according to this parameter. In this way, the function of flexibly creating different types of namespaces according to user needs is realized.

[0030] The method provided by the embodiment of the present application receives a namespace creation request including a timestamp function parameter and a unit parameter before receiving an access instruction, and creates a namespace with a corresponding function, allocates extended space, and saves configuration parameters according to the parameter values, realizing the flexible configuration of the namespace timestamp function by the user, and further supporting multi-user storage isolation and refined management, and improving the resource adaptability of the solid-state drive in different business scenarios.

[0031] In an embodiment of the present application, corresponding extended space is allocated to each storage unit in the namespace according to the timestamp unit parameter, including: if the timestamp unit parameter is of the first level, extended space with a first preset length is allocated to each storage unit; or, if the timestamp unit parameter is of the second level, extended space with a second preset length is allocated to each storage unit.

[0032] Specifically, when creating a namespace that includes the timestamp function, it is necessary to allocate corresponding extended space to each storage unit according to the timestamp unit parameter: when a namespace creation request is received and the timestamp function parameter is in the enabled state, the timestamp unit parameter is first parsed. If this parameter is set to the first level (such as millisecond level or second level), extended space with a first preset length, usually 8 bytes, is allocated to each storage unit for storing high-precision timestamps; if the timestamp unit parameter is set to the second level (such as minute level, hour level), extended space with a second preset length, usually 4 bytes, is allocated for storing low-precision timestamps. This allocation process occurs in the namespace initialization stage. By predefining an extended area with a fixed length in the storage unit, space is provided for timestamp recording when subsequent data is written. After the allocation is completed, the mapping relationship between the timestamp unit parameter and the extended space length is saved as the configuration parameter of the namespace to ensure that the corresponding space can be accurately read and used during subsequent data operations.

[0033] As an example, such as Figure 3As shown, the host sends a namespace creation request to the solid-state drive (SSD firmware), carrying parameter A (timestamp function parameter) and parameter B (timestamp unit parameter), and requests to create a namespace (NAMESPACE_1). After receiving the request, the solid-state drive (SSD firmware) determines that parameter A (timestamp function parameter) is the first preset parameter (enabling the timestamp function), then creates a namespace (NAMESPACE_1) with the timestamp function, and allocates corresponding extended space for each storage unit in the namespace according to parameter B (timestamp unit parameter) (for example, if parameter B is the first level, allocate the first preset length of extended space), and at the same time takes parameter A and parameter B (timestamp function parameter and timestamp unit parameter) as the configuration parameters of the namespace (NAMESPACE_1).

[0034] The method provided by the embodiment of the present application realizes the refined management of storage resources by allocating different lengths of extended space for storage units based on the level of the timestamp unit parameter (such as high-precision or low-precision level), while meeting the timestamp accuracy requirements of different services, avoiding resource waste caused by fixed-length extended space, and improving the utilization rate of flash memory space.

[0035] In the embodiment of the present application, determining the data to be processed corresponding to the access instruction based on the configuration parameters includes the following steps A1 - A3: Step A1, extract the timestamp function parameter and the timestamp unit parameter from the configuration parameters.

[0036] Specifically, after determining the target namespace, the solid-state drive operates on the configuration parameters already saved in the target namespace. These configuration parameters are set and saved according to the custom parameters passed by the user through the management interface or specific commands when creating the namespace. The solid-state drive extracts the timestamp function parameter specifically used to indicate whether the timestamp function is enabled and the timestamp unit parameter used to specify the timestamp recording unit from the storage area of the configuration parameters, providing the necessary data basis for subsequent operations such as judging the timestamp function status and calculating the target timestamp, so as to determine the data to be processed corresponding to the access instruction.

[0037] Step A2, if the timestamp function parameter is the first preset parameter, obtain the user data corresponding to the access instruction, and calculate the target timestamp according to the timestamp unit parameter; fuse the user data and the target timestamp to obtain the data to be processed.

[0038] Specifically, the solid-state drive first determines whether the timestamp function parameter is the first preset parameter. If so, it extracts the user data from the access instruction. Then, according to the timestamp unit parameter, it obtains the current CPU timing parameter and performs calculations to get the initial timestamp, and then adjusts the initial timestamp based on the timestamp unit information to obtain the target timestamp. Finally, it fuses the user data and the calculated target timestamp to form the data to be processed. In this way, the function of adding timestamp information to the user data is realized when the timestamp function is enabled.

[0039] Step A3, if the timestamp function parameter is the second preset parameter or there is no timestamp function parameter, obtain the user data corresponding to the access instruction and use the user data as the data to be processed.

[0040] Specifically, when the timestamp function parameter is the second preset parameter or there is no timestamp function parameter, obtain the user data corresponding to the access instruction and use it as the data to be processed: First, the solid-state drive extracts the timestamp function parameter from the configuration parameters of the target namespace and determines whether it is the second preset parameter (i.e., the timestamp function is in the off state), or whether the parameter does not exist (indicating that the namespace is not configured with the timestamp function). If either of the above conditions is met, the solid-state drive directly obtains the user data from the access instruction, and no additional calculation of the timestamp is required in this process. Since this namespace does not support the timestamp function and the storage unit is not allocated with extended space for recording timestamps, the obtained user data does not need to be fused with the timestamp and can be directly used as the data to be processed for subsequent operations such as writing to the storage unit according to the access instruction or reading and sending to the host.

[0041] The method provided by the embodiment of the present application realizes the dynamic adaptation of the data processing flow by extracting the timestamp function parameter and the unit parameter in the configuration parameters, and determining whether to fuse the user data with the target timestamp to generate the data to be processed based on the timestamp function parameter. When the timestamp function is enabled, it automatically attaches the time attribute to the data, and when it is disabled, it directly processes the original data, which not only ensures the traceability of the data but also avoids the overhead of invalid calculations.

[0042] In the embodiment of the present application, calculating the target timestamp according to the timestamp unit parameter includes: obtaining the current CPU timing parameter and calculating the initial timestamp according to the CPU timing parameter; adjusting the initial timestamp based on the timestamp unit information to obtain the target timestamp.

[0043] Specifically, first, obtain the current CPU timing parameters, which include the current CPU tick count (TICK count) and the CPU frequency. Second, obtain the host timestamp and the initial CPU tick count (initial TICK count) recorded when the driver is loaded. Then, calculate the initial timestamp based on these parameters. The calculation formula is: Initial timestamp = Host timestamp + 1000 × [(CPU tick count - Initial CPU tick count) ÷ CPU frequency]. This formula converts the CPU timing into a time increment through the ratio of the difference in CPU tick counts to the frequency, and then adds it to the initial host timestamp to obtain an initial timestamp accurate to the millisecond level.

[0044] As an example, in an actual application scenario, assume that the solid-state drive is loaded at 10:00:00 on January 1, 2001. The host timestamp recorded at this time is 1686976800000 milliseconds, and the initial CPU tick count is 100000000. Given that the CPU frequency is 2.5 GHz (i.e., 2500000000 ticks per second), when a write command is received, the current CPU tick count is 100002500. By calculating the ratio of the tick difference (2500) to the frequency, the CPU running time is obtained as 0.000001 seconds, which is converted to 1 millisecond and then added to the initial host timestamp. Finally, the initial timestamp accurate to the millisecond level is 1686976800001 milliseconds, corresponding to the actual time of 10:00:00.001 on January 1, 2001.

[0045] The method provided in the embodiments of this application calculates the initial timestamp by obtaining the CPU timing parameters and adjusts it in combination with the timestamp unit information to obtain the target timestamp, achieving the precise matching of the timestamp accuracy and the unit parameters, ensuring the consistency and accuracy of the timestamp records in different namespaces, and providing a reliable time dimension basis for data life cycle management.

[0046] In the embodiments of this application, corresponding processing operations are performed on the data to be processed according to the access instruction, including: if the access instruction is a data write instruction, store the user data in the to-be-processed data into the corresponding storage unit, and store the target timestamp in the to-be-processed data into the extended space corresponding to the storage unit; or, if the access instruction is a data read instruction, send the to-be-processed data to the host.

[0047] Specifically, when the solid-state drive receives an access instruction, it will perform different operations according to the instruction type: For a data write instruction, first store the user data in the to-be-processed data into the corresponding storage unit (the size of the storage unit is determined by the LBA format of the namespace, usually 512 bytes or 4096 bytes). If the to-be-processed data contains a target timestamp (i.e., the target namespace enables the timestamp function), then store the timestamp in the corresponding extended space of the storage unit (the size of the extended space is determined by the timestamp unit parameter set when creating the namespace. For example, the millisecond-level unit corresponds to 8 bytes, and the minute-level unit corresponds to 4 bytes). For a data read instruction, directly send the to-be-processed data to the host. Before sending, it will determine whether the data contains a timestamp based on the status of the custom FeatureID (such as 0xcf) - the host can set the FeatureID parameter through the setfeature command (when the parameter is 1, it contains a timestamp; when it is 0, it does not), or query the current status through the getfeature command. If it contains a timestamp, the upper-layer storage system needs to allocate additional space in the buffer assigned for the read operation to save the timestamp.

[0048] As an example, as Figure 4 shown, the process starts with the solid-state drive driver loading. After the loading is completed, the solid-state drive receives the host timestamp; then records the initial CPU tick count (SET_CPU_TICK). After that, the host performs a data write operation to a certain logical block address of the namespace. At this time, the solid-state drive records the current CPU tick count (CURRENT_TICK). Subsequently, calculate the initial timestamp (in ms), and the formula is initial timestamp = host timestamp + 1000×[(CPU tick count - initial CPU tick count)÷CPU frequency]. Then convert the initial timestamp to the unit set by the timestamp unit parameter to obtain the target timestamp. Finally, append the target timestamp after the user data, and the occupied space is determined by the timestamp unit parameter. The process ends here.

[0049] The method provided by the embodiments of this application performs differential operations on the to-be-processed data according to the access instruction type (write or read) (store data and timestamp to the corresponding space when writing, directly send data when reading), realizes the efficient execution and integrity guarantee of data operations, ensures the accurate recording and transmission of timestamp information during the data transfer process, and improves the reliability of the storage system.

[0050] In the embodiments of this application, the method further includes the following steps B1 - B3: Step B1, receive the status query instruction sent by the host, and determine the target namespace according to the status query instruction.

[0051] Specifically, first, the solid-state drive receives a status query instruction from the host, which is used to obtain the timestamp function status information of a specified namespace. Then, the solid-state drive parses the instruction content and extracts relevant information from the instruction to identify the target namespace. This information can include specific identifiers or attribute descriptions of the namespace. Next, based on the extracted information, the solid-state drive performs a matching search among the numerous created namespaces to accurately locate the target namespace, preparing for subsequent acquisition of the timestamp function configuration parameters of this namespace, determining its function status, and feeding it back to the host. Through the operations of receiving, parsing, and searching the instruction, the accurate identification of the target namespace is achieved throughout the process.

[0052] Step B2: Obtain the configuration parameters of the timestamp function in the target namespace.

[0053] Specifically, after determining the target namespace, the solid-state drive searches for the configuration parameter storage area associated with this target namespace in its storage system. These configuration parameters are set and saved during the creation of the namespace and include timestamp function parameters and timestamp unit parameters. The timestamp function parameter is used to indicate whether the timestamp function is enabled for this namespace. Its value is set as the first preset parameter (indicating enabled) or the second preset parameter (indicating disabled) by the user through a specific management interface or command during the creation of the namespace. The timestamp unit parameter is selected by the user from units such as milliseconds, seconds, minutes, hours, etc., and is used to determine the space occupied by the timestamp and the way to adjust the accuracy of the timestamp. The solid-state drive extracts the configuration parameters related to the timestamp function in its entirety by reading the data in this storage area, providing the necessary data support for subsequent determination of the function status of the timestamp function. The entire acquisition process is based on the parameter setting mechanism during the creation of the namespace to ensure that the required configuration information can be accurately read.

[0054] Step B3: Determine the function status of the timestamp function according to the timestamp function parameter in the configuration parameters and feed back the function status to the host.

[0055] Specifically, the solid-state drive first reads the configuration parameters of the target namespace, with a focus on the timestamp function parameter among them. This parameter is set by the user through the management interface or a specific command when creating the namespace, and is used to control the enabling or disabling of the timestamp function. If the timestamp function parameter is the first preset parameter, it indicates that the timestamp function of the namespace is enabled, that is, a timestamp will be automatically appended when data is written; if it is the second preset parameter, it means that the timestamp function is in the off state and no timestamp will be added when data is written. After determining the status of the timestamp function, the solid-state drive encapsulates this status information and then feeds back this status information to the host through the data transmission channel, enabling the host to obtain the current status of the timestamp function of the target namespace for subsequent data management and operations.

[0056] The method provided by the embodiment of the present application realizes the status synchronization mechanism between the host and the solid-state drive by receiving the host status query instruction and feeding back the timestamp function status of the target namespace, enabling the upper-layer system to grasp the configuration of the storage resources in real time, providing data support for dynamically adjusting the service strategy and monitoring the storage status, and improving the manageability and interactivity of the system.

[0057] In the embodiment of the present application, the method further includes: dynamically adjusting the timestamp accuracy and the allocation of the extended space based on characteristic parameters such as the access frequency, update period, and number of erase / write cycles of the target namespace. Specifically, an optimization strategy is determined through a preset characteristic-accuracy mapping model, and when the fluctuation of the access characteristics exceeds the threshold, the timestamp unit reconfiguration and the dynamic adjustment and data processing of the extended space of the storage unit are executed to adaptively optimize the utilization rate of the storage resources and ensure data consistency.

[0058] Specifically, the dynamic adjustment mechanism of the timestamp accuracy based on the data access characteristics: During the data read / write process, the solid-state drive collects in real time characteristic parameters such as the access frequency, data update period, and number of erase / write cycles of the target namespace. When the fluctuation of these parameters exceeds the preset threshold in multiple consecutive statistical periods, an optimization strategy is triggered based on the pre-established characteristic-accuracy mapping model. If the access characteristics indicate frequent data updates, the timestamp accuracy is increased and the corresponding extended space is allocated; if the access characteristics show a low data update frequency, the timestamp accuracy is decreased and the redundant extended space is released.

[0059] During the adjustment process, the system temporarily locks the write operation of the namespace, records the incomplete data through the transaction log, reallocates or releases the extended space of the storage unit, and performs corresponding precision conversion processing on the timestamp data. After the adjustment is completed, the system updates information such as the timestamp unit and the extended space status in the namespace metadata area and sends a notification command to the host to synchronize the latest configuration parameters.

[0060] By constructing a dynamic adjustment mechanism for timestamp accuracy based on data access characteristics in a solid-state drive, the system can collect multi-dimensional characteristic parameters of the namespace in real time. When it detects that the parameter fluctuation exceeds the preset threshold, it automatically triggers an optimization strategy to dynamically adjust the timestamp accuracy and extended space allocation. This mechanism realizes the maximization of storage resource utilization by intelligently identifying data access patterns (such as high-frequency updates or low-frequency cold data) and matching corresponding timestamp configurations (high accuracy / high space occupancy or low accuracy / low space occupancy). It not only avoids space waste caused by static configuration but also improves the effectiveness of timestamp records through adaptive adjustment. At the same time, measures such as write operation locking, transaction log guarantee, and data consistency verification adopted during the adjustment process ensure the reliability of data processing, while the metadata synchronization and host notification mechanism maintain the configuration coordination of the upper and lower layers of the system. This mechanism ultimately provides a more efficient timestamp management solution for enterprise-level storage applications with an intelligent resource optimization strategy, significantly improving the flexibility, scalability, and overall performance of the storage system.

[0061] 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.

[0062] The embodiment of the present application also provides a firmware hard disk data access device, which is applied to a solid-state drive, as Figure 5 shown, including: A receiving module 51, configured to receive an access instruction sent by a host and determine a target namespace according to the access instruction; An obtaining module 52, configured to obtain configuration parameters of the timestamp function in the target namespace and determine the data to be processed corresponding to the access instruction based on the configuration parameters; An execution module 53, configured to execute a corresponding processing operation on the data to be processed according to the access instruction.

[0063] Furthermore, the device further includes: a creating module, configured to receive a namespace creation request, where the namespace creation request includes a timestamp function parameter and a timestamp unit parameter; if the timestamp function parameter is a first preset parameter, create a namespace including the timestamp function, allocate corresponding extended space for each storage unit in the namespace according to the timestamp unit parameter, and use the timestamp function parameter and the timestamp unit parameter as the configuration parameters of the namespace; or, if the timestamp function parameter is a second preset parameter, create a namespace without the timestamp function and use the timestamp function parameter as the configuration parameter of the namespace.

[0064] Furthermore, the creating module further includes: a first allocation sub-module and a second allocation sub-module; The first allocation sub-module is used to allocate an extended space with a first preset length in each storage unit if the time stamp unit parameter is at the first level; The second allocation sub-module is used to allocate an extended space with a second preset length in each storage unit if the time stamp unit parameter is at the second level.

[0065] Furthermore, the acquisition module 52 further includes: an extraction sub-module, a first determination sub-module, and a second determination sub-module; The extraction sub-module is used to extract the time stamp function parameter and the time stamp unit parameter in the configuration parameter; The first determination sub-module is used to obtain the user data corresponding to the access instruction if the time stamp function parameter is a first preset parameter, and calculate the target time stamp according to the time stamp unit parameter; fuse the user data and the target time stamp to obtain the data to be processed; The second determination sub-module is used to obtain the user data corresponding to the access instruction if the time stamp function parameter is a second preset parameter or there is no time stamp function parameter, and use the user data as the data to be processed.

[0066] Furthermore, the first determination sub-module further includes: an acquisition unit and an adjustment unit; The acquisition unit acquires the current CPU timing parameter and calculates the initial time stamp according to the CPU timing parameter; The adjustment unit adjusts the initial time stamp based on the time stamp unit information to obtain the target time stamp.

[0067] Furthermore, the execution module 53 is used to store the user data in the data to be processed into the corresponding storage unit and store the target time stamp in the data to be processed into the extended space corresponding to the storage unit if the access instruction is a data write instruction; or, if the access instruction is a data read instruction, send the data to be processed to the host.

[0068] Furthermore, the device further includes: a feedback module, which is used to receive the status query instruction sent by the host, and determine the target namespace according to the status query instruction; acquire the configuration parameter of the time stamp function in the target namespace; determine the function status of the time stamp function according to the time stamp function parameter in the configuration parameter, and feedback the function status to the host.

[0069] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of a computer device provided by an optional embodiment of the present invention, as Figure 6As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system).

[0070] The processor 10 can be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above hardware chip can be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above programmable logic device can be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.

[0071] Among them, the memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.

[0072] The memory 20 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device presented by a kind of landing page of a small program, etc. In addition, the memory 20 can include high-speed random access memory and can also include non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 can optionally include a memory remotely set relative to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0073] The memory 20 can include volatile memory, such as random access memory; the memory can also include non-volatile memory, such as flash memory, a hard disk, or a solid-state drive; the memory 20 can also include a combination of the above types of memory.

[0074] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0075] Embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored as such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0076] Although embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for accessing firmware hard disk data, applied to a solid state drive, characterized in that Including: Receiving an access instruction sent by a host, and determining a target namespace according to the access instruction; Obtaining configuration parameters of the timestamp function in the target namespace, and determining data to be processed corresponding to the access instruction based on the configuration parameters; Performing a corresponding processing operation on the data to be processed according to the access instruction.

2. The method according to claim 1, wherein Before receiving the access instruction sent by the host, the method further includes: Receiving a namespace creation request, where the namespace creation request includes a timestamp function parameter and a timestamp unit parameter; If the timestamp function parameter is a first preset parameter, creating a namespace including the timestamp function, allocating a corresponding extended space for each storage unit in the namespace according to the timestamp unit parameter, and using the timestamp function parameter and the timestamp unit parameter as configuration parameters of the namespace; or, if the timestamp function parameter is a second preset parameter, creating a namespace without the timestamp function, and using the timestamp function parameter as the configuration parameter of the namespace.

3. The method according to claim 2, wherein The allocating a corresponding extended space for each storage unit in the namespace according to the timestamp unit parameter includes: If the timestamp unit parameter is of a first level, allocating an extended space of a first preset length in each storage unit; Or, if the timestamp unit parameter is of a second level, allocating an extended space of a second preset length in each storage unit.

4. The method according to claim 1, wherein The determining the data to be processed corresponding to the access instruction based on the configuration parameters includes: Extracting the timestamp function parameter and the timestamp unit parameter in the configuration parameters; If the timestamp function parameter is a first preset parameter, obtaining user data corresponding to the access instruction, and calculating a target timestamp according to the timestamp unit parameter; fusing the user data and the target timestamp to obtain the data to be processed; Or, if the timestamp function parameter is a second preset parameter or there is no timestamp function parameter, obtaining user data corresponding to the access instruction, and using the user data as the data to be processed.

5. The method according to claim 4, characterized in that The calculating the target timestamp according to the timestamp unit parameter includes: Obtaining current CPU timing parameters, and calculating an initial timestamp according to the CPU timing parameters; Adjusting the initial timestamp based on the timestamp unit information to obtain the target timestamp.

6. The method according to claim 1, wherein The performing a corresponding processing operation on the data to be processed according to the access instruction includes: If the access instruction is a data write instruction, storing the user data in the to-be-processed data into a corresponding storage unit, and storing the target timestamp in the to-be-processed data into the extended space corresponding to the storage unit; or, if the access instruction is a data read instruction, sending the to-be-processed data to the host.

7. The method according to claim 1, wherein The method further includes: Receiving a status query instruction sent by the host, and determining a target namespace according to the status query instruction; Obtaining configuration parameters of the timestamp function in the target namespace; Determine the functional status of the timestamp function according to the timestamp function parameter in the configuration parameter, and feedback the functional status to the host.

8. A firmware hard disk data access device, applied to a solid state drive, characterized in that, Including: A receiving module, configured to receive an access instruction sent by a host, and determine a target namespace according to the access instruction; An obtaining module, configured to obtain configuration parameters of the timestamp function in the target namespace, and determine data to be processed corresponding to the access instruction based on the configuration parameters; An execution module, configured to perform a corresponding processing operation on the data to be processed according to the access instruction.

9. 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 firmware hard disk data access method according to any one of claims 1 to 7 are implemented.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the steps of the firmware hard disk data access method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Apparatus and method for providing quality of service over a virtual interface for solid-state storage

    CN110851075A

  • Cloud storage distributed file system

    CN112236758A

  • Multi-namespace data management method and system

    CN116450536A

  • Storage array system and storage access method

    CN119396331A

  • Cache management method, storage array controller, device, equipment and medium

    CN119536650A