Control data interaction method and device, computer program product, equipment and medium

By analyzing the data range indication information of submitting queue entries, accurately transmitting the target data that the host is actually concerned about, solving the problem of inefficient data interaction in the NVMe protocol and achieving efficient utilization of link bandwidth and memory resources.

CN120029963AActive Publication Date: 2025-05-23SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510503581.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-05-23
Estimated Expiration
2045-04-22

AI Technical Summary

Technical Problem

In the NVMe protocol, some commands need to transmit fixed-sized structured data, but the host usually only focuses on a few digital fields, which leads to the double waste of underlying link bandwidth resources and host memory resources. Especially in embedded scenarios, the host needs to interact with multiple storage devices at the same time, resulting in extremely low data interaction efficiency.

Method used

By parsing the first field of the submission queue entry issued by the host, the operation command type is determined, and when the operation command type is a control command, the second field of the submission queue entry is parsed to obtain data range indication information. According to the data range indication information, control commands are executed to realize the transmission of target data between the storage device and the target memory of the host, and to generate the execution result.

Benefits of technology

It significantly improves the utilization rate of the underlying link bandwidth, ensures that the allocated memory size matches the actual data transmitted, and improves the data interaction efficiency between the storage device and the host.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029963A_ABST
    Figure CN120029963A_ABST
Patent Text Reader

Abstract

The invention discloses a control data interaction method and device, a computer program product, equipment and a medium, is applied to storage equipment, relates to the technical field of computers, and comprises the steps of analyzing a first field of a submission queue entry issued by a host, and determining an operation command type; when the type of the operation command is a control command, analyzing a second field of the submission queue entry to obtain data range indication information; the data range indication information represents range information of the target data in the control data; executing the control command according to the data range indication information, realizing transmission of the target data between the storage device and the target memory of the host, and generating an execution result; the target memory is allocated by the host based on the data range indication information; and returning the completion queue entry containing the execution result to the host. According to the invention, the utilization rate of the bandwidth of the underlying link is improved, the distributed memory size is ensured to be consistent with the actual transmission data volume, and the data interaction efficiency between the storage device and the host is 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 technology, and in particular to a method, device, computer program product, equipment and medium for controlling data interaction. Background Art

[0002] NVMe (Non-Volatile Memory Express) storage devices support two types of commands: Administrative Commands and Input / Output Commands. The former are used for device control, and the latter are used for user data access. Figure 1 This is an example of communication between the host and the NVMe storage device. Some Admin control commands can control the device through the interaction of SQE (Submission Queue Entry) and CQE (Completion Queue Entry). Some Admin control commands require additional transmission of control data in addition to SQE and CQE. For details, see Figure 2 As shown, Figure 2 It is a data interaction flow chart of the host, storage device and controller. The host applies for a fixed-size space in the memory according to the command type, fills the physical area page field with the first address of the memory, and then puts the SQE into the submission queue; after the NVMe device reads the SQE, it moves the control data of the specified size through direct memory access, generates a completion queue entry after completion, and interrupts to notify the host.

[0003] In the NVMe protocol, some commands need to transmit structured data of a fixed size, but the host usually only pays attention to a few fields, resulting in a double waste of underlying link bandwidth resources and host memory resources. Especially in embedded scenarios, the host needs to interact with multiple storage devices at the same time. A single concurrent interaction not only requires a large amount of memory, but also a large amount of redundant data seriously occupies the link bandwidth during frequent data transmission, resulting in extremely low efficiency of data interaction between storage devices and hosts. Summary of the invention

[0004] In view of this, the object of the present invention is to provide a method, apparatus, computer program product, device and medium for controlling data interaction, which can improve the utilization rate of the underlying link bandwidth, ensure that the allocated memory size is consistent with the actual amount of transmitted data, and improve the data interaction efficiency between the storage device and the host. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a method for controlling data interaction, which is applied to a storage device, comprising:

[0006] Parse the first field of the submission queue entry sent by the host to determine the operation command type;

[0007] When the operation command type is a control command, the second field of the submission queue entry is parsed to obtain data range indication information; wherein the data range indication information indicates the range information of the target data in the control data, and the control data is a data set that assists in completing the control command;

[0008] Executing a control command according to the data range indication information to achieve the transmission of target data between the storage device and the target memory of the host, and generating an execution result; wherein the target memory is pre-allocated by the host based on the data range indication information;

[0009] Returns a completion queue entry containing the results of the execution to the host.

[0010] Optionally, the second field includes a transmission mode field and an address range field, and the data range indication information includes a transmission mode parameter and an address range parameter; wherein the transmission mode field corresponds to the transmission mode parameter, and the address range field corresponds to the address range parameter.

[0011] Optionally, the transmission mode parameter includes full transmission or partial transmission, and the address range parameter includes offset information and length information.

[0012] Optionally, executing a control command according to the data range indication information to achieve transmission of target data between the storage device and the target memory of the host includes:

[0013] If the transmission mode parameter in the data range indication information is full transmission, the entire content of the control data is determined as the target data, and the control command is executed to realize the transmission of the target data between the storage device and the target memory of the host.

[0014] Optionally, executing a control command according to the data range indication information to achieve transmission of target data between the storage device and the target memory of the host includes:

[0015] If the transmission mode parameter in the data range indication information is partial transmission, the starting position of the target data is determined according to the offset information in the address range parameter, and the ending position of the target data is determined according to the length information in the address range parameter;

[0016] The target data is determined from the control data according to the starting position and the ending position, and the control command is executed to realize the transmission of the target data between the storage device and the target memory of the host.

[0017] Optionally, the control data interaction method further includes:

[0018] If the value of the transmission mode field is a first value, the transmission mode parameter is determined to be full transmission; if the value of the transmission mode field is a second value, the transmission mode parameter is determined to be partial transmission.

[0019] Optionally, the control data interaction method further includes:

[0020] Based on the non-volatile memory host controller interface specification protocol, the first value is configured as 0 and the second value is configured as 1.

[0021] Optionally, when the value of the transfer mode field is a first value, the target memory is a statically allocated size defined based on the non-volatile memory host controller interface specification protocol; when the value of the transfer mode field is a second value, the target memory is a dynamically allocated size obtained based on the address range parameter.

[0022] Optionally, executing a control command according to the data range indication information to achieve transmission of target data between the storage device and the target memory of the host includes:

[0023] When the control command indicates that the storage device transmits data to the host, the target data is determined from the locally stored control data according to the data range indication information;

[0024] Transfer the target data to the host's target memory.

[0025] Optionally, when the control command represents that the storage device transmits data to the host, the control command includes a status feedback command and a data reporting command; wherein the status feedback command is used to provide status information of the storage device, and the data reporting command is used to transmit operating data of the storage device.

[0026] Optionally, executing a control command according to the data range indication information to achieve transmission of target data between the storage device and the target memory of the host includes:

[0027] When the control command indicates that the host transmits data to the storage device, the target data is determined from the control data in the target memory according to the data range indication information;

[0028] The target data is transferred to a preset storage area of ​​the storage device.

[0029] Optionally, when the control command represents that the host transmits data to the storage device, the control command includes a status management command and a parameter configuration command; wherein the status management command is used to regulate the working status of the storage device, and the parameter configuration command is used to set the functional parameters of the storage device.

[0030] Optionally, the storage device includes a disk array card and a plurality of solid-state hard disks mounted on the disk array card.

[0031] Optionally, the control data interaction method further includes:

[0032] When there are multiple control commands at the same time, the priority score of each control command is determined based on the operation urgency and data timeliness of each control command;

[0033] The actual execution order of each control command is determined according to the initial order of the submission queue entries of the control commands in the submission queue and the priority scores of the control commands.

[0034] In a second aspect, the present application discloses a control data interaction method, which is applied to a host, comprising:

[0035] Generate a submission queue entry; wherein the first field of the submission queue entry includes the operation command type, when the operation command type is a control command, the second field of the submission queue entry includes data range indication information, the data range indication information indicates the range information of the target data in the control data, and the control data is a data set that assists in completing the control command;

[0036] Pre-allocate the target memory based on the data range indication information;

[0037] Sending the submission queue entry to the storage device so that the storage device executes the control command according to the data range indication information, realizes the transmission of the target data between the storage device and the target memory of the host, and generates an execution result;

[0038] Receive the completion queue entry containing the execution result returned by the storage device.

[0039] In a third aspect, the present application discloses a control data interaction device, which is applied to a storage device, comprising:

[0040] A field parsing module, used to parse the first field of the submission queue entry sent by the host to determine the operation command type;

[0041] A range determination module, used for parsing the second field of the submission queue entry to obtain data range indication information when the operation command type is a control command; wherein the data range indication information indicates the range information of the target data in the control data, and the control data is a data set that assists in completing the control command;

[0042] A command execution module, used to execute a control command according to the data range indication information, realize the transmission of target data between the storage device and the target memory of the host, and generate an execution result; wherein the target memory is pre-allocated by the host based on the data range indication information;

[0043] The result returning module is used to return the completion queue entry containing the execution result to the host.

[0044] In a fourth aspect, the present application discloses a control data interaction device, which is applied to a host, comprising:

[0045] An entry generation module is used to generate a submission queue entry; wherein the first field of the submission queue entry includes the operation command type, and when the operation command type is a control command, the second field of the submission queue entry includes data range indication information, the data range indication information indicates the range information of the target data in the control data, and the control data is a data set that assists in completing the control command;

[0046] A memory allocation module, used for pre-allocating target memory based on data range indication information;

[0047] An entry delivery module is used to deliver the submission queue entry to the storage device, so that the storage device executes the control command according to the data range indication information, realizes the transmission of the target data between the storage device and the target memory of the host, and generates an execution result;

[0048] The result receiving module is used to receive the completion queue entry containing the execution result returned by the storage device.

[0049] In a fifth aspect, the present application discloses a computer program product, including a computer program / instruction, which implements the steps of the aforementioned control data interaction method when executed by a processor.

[0050] In a sixth aspect, the present application discloses an electronic device, including:

[0051] Memory, used to store computer programs;

[0052] The processor is used to execute a computer program to implement the aforementioned disclosed control data interaction method.

[0053] In a seventh aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the control data interaction method disclosed above is implemented.

[0054] It can be seen that the present application proposes a control data interaction method, which is applied to a storage device, including: parsing the first field of a submission queue entry issued by the host to determine the type of operation command; when the operation command type is a control command, parsing the second field of the submission queue entry to obtain data range indication information; wherein the data range indication information represents the range information of the target data in the control data, and the control data is a data set that assists in completing the control command; executing the control command according to the data range indication information to realize the transmission of the target data between the storage device and the target memory of the host, and generating an execution result; wherein the target memory is pre-allocated by the host based on the data range indication information; and returning the completion queue entry containing the execution result to the host.

[0055] Beneficial effect: In the control data interaction method proposed in the present application, the storage device first parses the first field of the submission queue entry issued by the host to determine the type of operation command. When the command is identified as a control command, the second field is further parsed to obtain data range indication information. The data range indication information accurately defines the position and range of the target data in the control data set, so that the host can pre-allocate a target memory with a precisely matched size based on this information. Subsequently, the storage device realizes the precise transmission of the target data between the storage device and the target memory pre-allocated by the host according to the data range indication information, and generates the corresponding execution result after the transmission is completed. In other words, the host will embed the data range indication information when constructing the control command, and apply for a target memory with a size matching the data range indication information accordingly. After receiving the command, the storage device can accurately locate the target data actually required by the host in the control data by parsing the data range indication information, and realize the transmission of the target data between the storage device and the target memory of the host. Compared with the existing solutions that require the transmission of complete data structures and the allocation of fixed large memory, the present application uses a precise data range indication mechanism to only transmit the target data that the host is actually concerned about. This not only significantly improves the utilization rate of the underlying link bandwidth, but also achieves optimal allocation of memory resources, significantly improving the data interaction efficiency between the storage device and the host. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0057] Figure 1 An architecture diagram of interaction between a host and a controller of an NVMe storage device;

[0058] Figure 2 A flow chart of data interaction between a host, a storage device and a controller;

[0059] Figure 3 A flow chart of a control data interaction method for a device side disclosed in this application;

[0060] Figure 4 A schematic diagram of an address range field structure disclosed in this application;

[0061] Figure 5 A specific control data interaction method process for a device side disclosed in this application;

[0062] Figure 6 Another specific control data interaction method process for a device side disclosed in this application;

[0063] Figure 7 A schematic diagram of interaction between a host and an NVMe device for transmitting data disclosed in the present application;

[0064] Figure 8 It is a schematic diagram of the interaction between a traditional host and an NVMe device for transmitting data;

[0065] Fig. 9 A flow chart of a control data interaction method for a host side disclosed in the present application;

[0066] Fig.10 This is a schematic diagram of the structure of a control data interaction device for a device side disclosed in the present application;

[0067] Fig.11 This is a schematic diagram of the structure of a control data interaction device for a host side disclosed in the present application;

[0068] Fig.12 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0069] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0070] In the NVMe protocol, some commands need to transmit structured data of a fixed size, but the host usually only pays attention to a few fields, resulting in a double waste of underlying link bandwidth resources and host memory resources. Especially in embedded scenarios, the host needs to interact with multiple storage devices at the same time. A single concurrent interaction not only requires a large amount of memory, but also a large amount of redundant data seriously occupies the link bandwidth during frequent data transmission, resulting in extremely low efficiency of data interaction between storage devices and hosts.

[0071] To this end, an embodiment of the present application proposes a control data interaction solution that can improve the utilization rate of the underlying link bandwidth, ensure that the allocated memory size is consistent with the actual amount of transmitted data, and improve the data interaction efficiency between the storage device and the host.

[0072] The present application discloses a method for controlling data interaction. Figure 3 As shown, the method includes:

[0073] Step S11: parse the first field of the submission queue entry sent by the host to determine the operation command type.

[0074] In this embodiment, the submission queue entry sent by the host includes multiple fields. Among them, the first field is used to identify the type of operation command. By parsing the first field, the storage device can identify the type of operation command requested by the host this time. The types of operation commands are divided into IO commands and control commands. IO commands are used to perform input and output operations, such as reading disk data or writing file contents. Control commands are used to configure and manage storage devices, such as setting the working mode of the device or adjusting the parameters of the device.

[0075] Step S12: When the operation command type is a control command, parse the second field of the submission queue entry to obtain data range indication information; wherein the data range indication information indicates the range information of the target data in the control data, and the control data is a data set that assists in completing the control command.

[0076] In this embodiment, when the operation command type is a control command, the second word of the submission queue entry is parsed to obtain data range indication information, wherein the data range indication information indicates the range information of the target data in the control data. Specifically, the second field includes a transmission mode field and an address range field, and the data range indication information includes a transmission mode parameter and an address range parameter; the transmission mode field corresponds to the transmission mode parameter, and the address range field corresponds to the address range parameter. The transmission mode parameter includes full transmission or partial transmission, and the address range parameter includes offset information and length information. Figure 4 This is a diagram of the address range field in NVMe. This field has a total of 8 bits, which are divided into two parts: offset: occupies the upper 5 bits (bits 3-7), indicating the offset of the control data. Its unit is 128 bytes, and the actual offset is equal to the value of offset multiplied by 128. For example, if the offset value is 3, the offset is 3×128=384 bytes. length: occupies the lower 3 bits (bits 0-2), indicating how many bytes are obtained starting from the offset specified by offset. The number of bytes obtained is equal to 2 to the length power. For example, if the length is 2, the number of bytes transmitted is Bytes; length is 7, the number of bytes transmitted is Bytes. It should be noted that since the offset field is represented by 5 bits, its value range determines that it can index up to 3968. The length field is represented by 3 bits, and its maximum value is 7 (corresponding to binary 111), which can transmit 128 bytes. The offset index range plus the maximum transmittable length bytes can just completely cover the size of 4096 bytes of control command data, ensuring the effective positioning and transmission of control command data.

[0077] In this embodiment, the control data is a structured data set that assists in completing the control command. Among them, structured means that the data is organized according to specific rules and formats, which is convenient for storage, reading and parsing. For example, in the control command for setting the working mode of the device, the control data contains specific mode configuration information in a structured form, such as specific parameter codes corresponding to different working modes, and each parameter is arranged in a fixed order and data type; in the control command for starting / stopping a service, the control data carries the relevant identification (such as a unique number, name code, etc.) and operation parameters (start / stop conditions, priority, etc.) of the service in a structured manner; in the control command for querying the operating status of the device, the control data contains the real-time temperature of the device, the read and write error count (classified by error type) and the remaining available storage space (measured in bytes or specific capacity units) and other information in a structured manner; in the control command for obtaining device performance statistics, the control data carries the read and write throughput per unit time (distinguishing between read and write throughput), the average response time (accurate to the specified time accuracy) and the number of I / O operations (subdivided by operation type) and other parameters in a structured manner.

[0078] Step S13: Execute the control command according to the data range indication information to realize the transmission of the target data between the storage device and the target memory of the host, and generate an execution result; wherein the target memory is pre-allocated by the host based on the data range indication information.

[0079] In this embodiment, the control command is executed according to the data range indication information to realize the transmission of the target data between the storage device and the target memory of the host, and generate the execution result; wherein, the target memory is pre-allocated by the host based on the data range indication information. That is, the host will embed the data range indication information when constructing the control command, and apply for the target memory whose size matches the data range indication information accordingly. After receiving the command, the storage device can accurately locate the target data actually needed by the host in the control data by parsing the data range indication information, and realize the transmission of the target data between the storage device and the target memory of the host. In this way, through the accurate data range indication mechanism, only the target data that the host actually pays attention to is transmitted, which not only significantly improves the utilization rate of the underlying link bandwidth, but also realizes the optimal configuration of memory resources, and significantly improves the data interaction efficiency between the storage device and the host.

[0080] In a specific implementation, when the control command represents that the storage device transmits data to the host, the target data is determined from the locally stored control data according to the data range indication information, and the target data is transmitted to the target memory of the host. Specifically, when the control command represents that the storage device transmits data to the host, the control command includes a status feedback command and a data reporting command; wherein the status feedback command is used to provide status information of the storage device, and the data reporting command is used to transmit the operation data of the storage device.

[0081] For example, the host periodically sends status feedback commands to the storage device in order to understand the health status of a certain hard disk in the array. Based on the data range indication information, the storage device accurately locates the number of bad sectors, power-on time, temperature and other key status information of the hard disk from the locally stored control data as the target data, and transmits it to the target memory specified by the host. In order to optimize the allocation of storage resources, the host sends a data reporting command to the storage device, requiring the storage device to report the read and write access frequency of files in a specific folder. Based on the data range indication information, the storage device extracts relevant operating data from the control data as the target data and transmits it to the target memory. In this way, the storage device accurately transmits the target data on demand, reduces the amount of invalid data transmission, avoids irrelevant data occupying the host memory, and improves the efficiency of data interaction.

[0082] In another specific implementation, when the control command represents that the host transmits data to the storage device, the target data is determined from the control data in the target memory according to the data range indication information, and the target data is transmitted to a preset storage area of ​​the storage device. When the control command represents that the host transmits data to the storage device, the control command includes a state management command and a parameter configuration command; wherein the state management command is used to control the working state of the storage device, and the parameter configuration command is used to set the functional parameters of the storage device.

[0083] For example, in the status management command scenario, when the storage cluster load in the data center is unbalanced, the host sends a status management command to a storage device with an overload. Based on the data range indication information, the host determines the control parameters such as adjusting the cache allocation ratio from the target memory as the target data, and transmits it to the preset storage area of ​​the storage device. In the parameter configuration command scenario, when the enterprise needs to enable the tiered storage function of the storage device, the host sends a parameter configuration command, finds the policy parameters of the tiered storage (such as hot data storage level, cold data migration threshold, etc.) from the target memory as the target data, and transmits it to the storage device. In this way, the host accurately transmits the target data to the storage device on demand, reducing the amount of invalid data transmission, avoiding irrelevant data occupying the memory of the storage device, and improving the efficiency of data interaction.

[0084] Step S14: Return the completion queue entry containing the execution result to the host.

[0085] In this embodiment, when the storage device successfully executes the control command, a completion queue entry containing the execution result is generated. The completion queue entry records the execution result of the control command, such as the status mark of whether the command execution is successful, the error code generated during the execution process (if the execution fails), and other related data. After generating the completion queue entry, the storage device returns the completion queue entry to the host through the established communication link. After receiving the completion queue entry, the host will perform subsequent processing based on the information in the completion queue entry. For example, if it is a success mark, the host will continue to issue other related commands to further operate the storage device; if it is a failure mark, the host will start the corresponding fault handling process according to the error code, notify the administrator or try to resend the command, etc.

[0086] In addition, the storage device in this embodiment includes a disk array card (Redundant Arrays of Independent Disks, RAID) and multiple solid-state disks (SSD) attached to the disk array card. Since the present application can accurately transmit target data to the storage device on demand, it avoids irrelevant data occupying the memory of the storage device. Therefore, the RAID card can control multiple SSD hard disks attached concurrently with limited memory space, speed up the response speed of the RAID card, and improve the operation efficiency of the device.

[0087] In addition, when there are multiple control commands at the same time, the priority score of each control command is determined based on the operation urgency and data timeliness of each control command, and the actual execution order of each control command is determined according to the initial order of the submission queue entries of the control commands in the submission queue and the priority score of the control commands. For example, the operation urgency can be divided into three levels: high (such as equipment failure recovery, key configuration update), medium (such as periodic status query), and low (such as log collection). The urgency score corresponding to the high operation urgency command is 3, the urgency score corresponding to the medium operation urgency command is 1, and the urgency score corresponding to the low operation urgency command is 0. Further, data timeliness includes high real-time requirements and low real-time requirements. For data with high real-time requirements, the data timeliness coefficient is 3, and for data with low real-time requirements, the data timeliness coefficient is 1. Further, priority score = urgency score × data timeliness coefficient. The initial order is adjusted according to the calculated priority score, so that the storage device can give priority to high-priority commands, thereby improving data processing efficiency.

[0088] Based on the above content, it can be seen that the present application abandons the traditional method of transmitting fixed control data each time. The host can specify a specific part of the transmission control data as needed. In this way, the present application can effectively reduce the amount of redundant data transmission on the link between the host and the storage device, while avoiding occupying too much host memory for transmitting unnecessary data, and realizing efficient utilization of link bandwidth and host memory resources.

[0089] It can be seen that the present application proposes a control data interaction method, which is applied to a storage device, including: parsing the first field of a submission queue entry issued by the host to determine the type of operation command; when the operation command type is a control command, parsing the second field of the submission queue entry to obtain data range indication information; wherein the data range indication information represents the range information of the target data in the control data, and the control data is a data set that assists in completing the control command; executing the control command according to the data range indication information to realize the transmission of the target data between the storage device and the target memory of the host, and generating an execution result; wherein the target memory is pre-allocated by the host based on the data range indication information; and returning the completion queue entry containing the execution result to the host.

[0090] Beneficial effect: In the control data interaction method proposed in the present application, the storage device first parses the first field of the submission queue entry issued by the host to determine the type of operation command. When the command is identified as a control command, the second field is further parsed to obtain data range indication information. The data range indication information accurately defines the position and range of the target data in the control data set, so that the host can pre-allocate a target memory with a precisely matched size based on this information. Subsequently, the storage device realizes the precise transmission of the target data between the storage device and the target memory pre-allocated by the host according to the data range indication information, and generates the corresponding execution result after the transmission is completed. In other words, the host will embed the data range indication information when constructing the control command, and apply for a target memory with a size matching the data range indication information accordingly. After receiving the command, the storage device can accurately locate the target data actually required by the host in the control data by parsing the data range indication information, and realize the transmission of the target data between the storage device and the target memory of the host. Compared with the existing solutions that require the transmission of complete data structures and the allocation of fixed large memory, the present application uses a precise data range indication mechanism to only transmit the target data that the host is actually concerned about. This not only significantly improves the utilization rate of the underlying link bandwidth, but also achieves optimal allocation of memory resources, significantly improving the data interaction efficiency between the storage device and the host.

[0091] In this embodiment, CW0 (Command Data Word 0), CDW2, CDW3, CDW4, and CDW5 are reserved fields of SQE, CDW0 occupies 0-3 bytes, CDW2-CDW5 occupy 8-23 bytes, and CW0 is used as the transmission mode field in the second field to indicate whether to transmit full data or partial data, and CDW2-CDW5 are used as the address range field in the second field. After receiving SQE, the NVMe device reads CDW0. If the value of CDW0 is the first value, it indicates that all control data is transmitted. If the value of CDW0 is the second value, it indicates that part of the control data is transmitted, and reads CDW2-CDW5, and then obtains the data range indication information according to the encoding of each byte of CDW2-CDW5, and then obtains the target data from all the control data. The following is a specific explanation:

[0092] The embodiment of the present application discloses a specific control data interaction method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Figure 5 As shown, specifically including:

[0093] Step S13a: If the transmission mode parameter in the data range indication information is full transmission, the entire content of the control data is determined as the target data, and the control command is executed to realize the transmission of the target data between the storage device and the target memory of the host.

[0094] In this embodiment, if the transmission mode parameter in the data range indication information is full transmission, the entire content of the control data is determined as the target data, and the control command is executed to realize the transmission of the target data between the storage device and the target memory of the host. Specifically, based on the non-volatile memory host controller interface specification protocol, the first value is configured to 0, that is, if the value of CDW0 is 0, the entire content of the control data is determined as the target data. In addition, if the value of CDW0 is 0, the target memory is a statically allocated size defined based on the non-volatile memory host controller interface specification protocol, that is, the target memory is applied for according to the complete size of the control data defined by the NVMe protocol. And execute the control command to read the full amount of control data from the host memory, or write the full amount of control data to the host memory.

[0095] The embodiment of the present application discloses a specific control data interaction method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Figure 6 As shown, specifically including:

[0096] Step S13b1: If the transmission mode parameter in the data range indication information is partial transmission, the starting position of the target data is determined according to the offset information in the address range parameter, and the ending position of the target data is determined according to the length information in the address range parameter.

[0097] Step S13b2: Determine the target data from the control data according to the starting position and the ending position, and execute the control command to realize the transmission of the target data between the storage device and the target memory of the host.

[0098] In this embodiment, if the transmission mode parameter in the data range indication information is partial transmission, the starting position of the target data is determined according to the offset information in the address range parameter, and the ending position of the target data is determined according to the length information in the address range parameter. Further, the target data is determined from the control data according to the starting position and the ending position, and the control command is executed to realize the transmission of the target data between the storage device and the target memory of the host. Specifically, based on the non-volatile memory host controller interface specification protocol, the second value is configured to 1. In this way, if the value of CDW0 is 1, each byte in CDW2, CDW3, CDW4 and CDW5 is parsed to obtain the data range indication information, and according to the offset information and length information indicated by it, the target data is read out from the host memory, or the target data is written to the host memory. In addition, if the value of CDW0 is 1, the target memory is a dynamically allocated size obtained based on the address range parameter. In this way, the optimal configuration of memory resources is achieved.

[0099] Figure 7 This is a schematic diagram of interaction between a host and an NVMe device transmitting data disclosed in this application. Figure 8 A schematic diagram of the interaction between a traditional host and an NVMe device for transmitting data.

[0100] In the traditional solution, the total control data of the NVMe device is 4096 bytes, which is divided into multiple fields such as field0 to field4095. These fields each carry specific information. Taking the management instruction set of the storage device as an example, different fields may correspond to the device's configuration parameters, status identification, operation commands, etc. When the host only needs to use the data of the two fields field1 and field4095, according to the traditional NVMe protocol rules, it is still necessary to apply for 4096 bytes of memory space. This is because the traditional protocol stipulates that data is transmitted and stored in a fixed size. Even if only part of the field data is actually required, memory must be reserved for the full amount of data. In addition, in terms of link transmission, 4096 bytes of data must also be transmitted between the host and the NVMe device. This mechanism has many disadvantages. On the one hand, a large amount of unused data occupies memory space, reducing memory utilization, especially in embedded systems with limited memory resources or multi-task concurrent scenarios, which will lead to a reduction in the memory that can be allocated to other programs, affecting the overall performance of the system. On the other hand, when the link bandwidth is limited, transmitting redundant data will occupy valuable bandwidth resources, increase data transmission delay, reduce data transmission efficiency, and cause the system response time to become longer.

[0101] In the present application, when the host only uses the two fields field1 and field4095, since the data volume of these two fields is only 2 bytes, the host only needs to apply for 2 bytes of memory on demand. This strategy effectively avoids memory waste, improves the utilization efficiency of memory resources, enables the host to allocate memory to different tasks more reasonably, and enhances the performance of the system during multi-tasking. In link transmission, the present application only transmits 2 bytes of actual required data. Compared with traditional solutions, the amount of data transmission is greatly reduced and the link load is reduced. Specifically, the present application effectively solves the problems of memory waste and low link bandwidth utilization in traditional solutions by allocating memory on demand and accurately transmitting data, improves the efficiency of data interaction between the host and the NVMe device, and thus optimizes the performance of the entire storage system.

[0102] Furthermore, the present application proposes to build an intelligent data range prediction mechanism on the host side. By using machine learning algorithms, historical data interaction records are deeply analyzed. Specifically, the mechanism learns the host's usage patterns of control data in different operating scenarios and at different time points. For example, during the daily business peak, the host may frequently request data in certain specific fields for business processing; while during non-peak hours, the requested data fields may be different. By learning these patterns, the mechanism can predict the data range that the host may need in advance before the host initiates a control command.

[0103] Correspondingly, the embodiment of the present application also discloses a control data interaction method, which is applied to the host, see Fig. 9 As shown, the method includes:

[0104] Step S21: Generate a submission queue entry; wherein the first field of the submission queue entry contains the operation command type. When the operation command type is a control command, the second field of the submission queue entry contains data range indication information. The data range indication information indicates the range information of the target data in the control data. The control data is a data set that assists in completing the control command.

[0105] Step S22: pre-allocate target memory based on the data range indication information.

[0106] Step S23: Send the submission queue entry to the storage device, so that the storage device executes the control command according to the data range indication information, realizes the transmission of the target data between the storage device and the target memory of the host, and generates an execution result.

[0107] Step S24: receiving a completion queue entry containing the execution result returned by the storage device.

[0108] This embodiment discloses a control data interaction method applied to a host. The method first generates a submission queue entry. When the operation command type is a control command, the second field in the entry contains information indicating the range of the target data in the control data. Then, the target memory is pre-allocated based on the data range indication information, and then the submission queue entry is sent to the storage device, so that the storage device executes the control command according to the data range indication, realizes the transmission of the target data between the storage device and the host target memory and generates the execution result. Finally, the host receives the completion queue entry containing the execution result returned by the storage device.

[0109] In this way, the host specifies the data range indication information, and the target memory is pre-allocated based on the data range indication information. When the operation command type is a control command, the data range indication information is placed in the second field of the submission queue entry. The submission queue entry containing the data range indication information is then sent to the storage device. The storage device executes the control command based on this information to achieve the transmission of target data between the local and host target memory. In this process, the host avoids the transmission of unnecessary data by accurately specifying the data range, significantly improving the utilization rate of the underlying link bandwidth, and optimizing the configuration of the host's own memory resources, thereby improving the efficiency of data interaction between the storage device and the host.

[0110] Correspondingly, the embodiment of the present application also discloses a control data interaction device, which is applied to a storage device, see Fig.10 As shown, the device comprises:

[0111] A field parsing module 11 is used to parse the first field of the submission queue entry sent by the host to determine the operation command type;

[0112] A range determination module 12 is used to parse the second field of the submission queue entry to obtain data range indication information when the operation command type is a control command; wherein the data range indication information represents the range information of the target data in the control data, and the control data is a data set that assists in completing the control command;

[0113] The command execution module 13 is used to execute the control command according to the data range indication information, realize the transmission of the target data between the storage device and the target memory of the host, and generate an execution result; wherein the target memory is pre-allocated by the host based on the data range indication information;

[0114] The result returning module 14 is used to return the completion queue entry containing the execution result to the host.

[0115] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0116] It can be seen that the present application proposes a control data interaction device, which is applied to a storage device, including: a field parsing module 11, which is used to parse the first field of the submission queue entry issued by the host to determine the type of operation command; a range determination module 12, which is used to parse the second field of the submission queue entry when the operation command type is a control command to obtain data range indication information; wherein the data range indication information represents the range information of the target data in the control data, and the control data is a data set that assists in completing the control command; a command execution module 13, which is used to execute the control command according to the data range indication information, realize the transmission of the target data between the storage device and the target memory of the host, and generate an execution result; wherein the target memory is pre-allocated by the host based on the data range indication information; a result return module 14, which is used to return the completion queue entry containing the execution result to the host.

[0117] Beneficial effect: In the control data interaction method proposed in the present application, the storage device first parses the first field of the submission queue entry issued by the host to determine the type of operation command. When the command is identified as a control command, the second field is further parsed to obtain data range indication information. The data range indication information accurately defines the position and range of the target data in the control data set, so that the host can pre-allocate a target memory with a precisely matched size based on this information. Subsequently, the storage device realizes the precise transmission of the target data between the storage device and the target memory pre-allocated by the host according to the data range indication information, and generates the corresponding execution result after the transmission is completed. In other words, the host will embed the data range indication information when constructing the control command, and apply for a target memory with a size matching the data range indication information accordingly. After receiving the command, the storage device can accurately locate the target data actually required by the host in the control data by parsing the data range indication information, and realize the transmission of the target data between the storage device and the target memory of the host. Compared with the existing solutions that require the transmission of complete data structures and the allocation of fixed large memory, the present application uses a precise data range indication mechanism to only transmit the target data that the host is actually concerned about. This not only significantly improves the utilization rate of the underlying link bandwidth, but also achieves optimal allocation of memory resources, significantly improving the data interaction efficiency between the storage device and the host.

[0118] Correspondingly, the embodiment of the present application also discloses a control data interaction device, which is applied to a host, see Fig.11 As shown, the device comprises:

[0119] An entry generation module 21 is used to generate a submission queue entry; wherein the first field of the submission queue entry contains the operation command type, and when the operation command type is a control command, the second field of the submission queue entry contains data range indication information, and the data range indication information indicates the range information of the target data in the control data, and the control data is a data set that assists in completing the control command;

[0120] A memory allocation module 22, configured to pre-allocate a target memory based on the data range indication information;

[0121] An entry sending module 23 is used to send the submission queue entry to the storage device, so that the storage device executes the control command according to the data range indication information, realizes the transmission of the target data between the storage device and the target memory of the host, and generates an execution result;

[0122] The result receiving module 24 is used to receive the completion queue entry containing the execution result returned by the storage device.

[0123] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0124] Furthermore, an embodiment of the present application also provides a computer program product, including a computer program / instruction, which implements the steps of the aforementioned control data interaction method when executed by a processor.

[0125] Furthermore, an embodiment of the present application also provides an electronic device. Fig.12 This is a structural diagram of an electronic device 30 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0126] Fig.12 A schematic diagram of the structure of an electronic device 30 provided in an embodiment of the present application. The electronic device 30 may specifically include: at least one processor 31, at least one memory 32, a display screen 33, an input / output interface 34, a communication interface 35, a power supply 36, and a communication bus 37. The memory 32 is used to store a computer program, which is loaded and executed by the processor 31 to implement the relevant steps in the control data interaction method disclosed in any of the aforementioned embodiments. In addition, the electronic device 30 in this embodiment may specifically be an electronic computer.

[0127] In this embodiment, the power supply 36 is used to provide working voltage for each hardware device on the electronic device 30; the communication interface 35 can create a data transmission channel between the electronic device 30 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 34 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0128] In addition, the memory 32, as a carrier for storing resources, may be a read-only memory, a random access memory, a disk or an optical disk, etc., and the resources stored thereon may include a computer program 321, and the storage method may be temporary storage or permanent storage. In addition to including a computer program that can be used to complete the control data interaction method executed by the electronic device 30 disclosed in any of the aforementioned embodiments, the computer program 321 may further include a computer program that can be used to complete other specific tasks.

[0129] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the control data interaction method disclosed above is implemented.

[0130] For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.

[0131] The various embodiments in this application are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0132] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0133] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0134] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the above elements.

[0135] The above is a detailed introduction to a control data interaction method, device, computer program product, equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, it can be seen that the content of this specification should not be understood as a limitation on the present application.

Claims

1. A control data interaction method, characterized in that: Applicable to storage devices, including: Parse the first field of the submission queue entry sent by the host to determine the operation command type; When the operation command type is a control command, parsing the second field of the submission queue entry to obtain data range indication information; wherein the data range indication information represents range information of the target data in the control data, and the control data is a data set that assists in completing the control command; Executing the control command according to the data range indication information, realizing the transmission of the target data between the storage device and the target memory of the host, and generating an execution result; wherein the target memory is pre-allocated by the host based on the data range indication information; A completion queue entry containing the execution result is returned to the host.

2. The control data interaction method according to claim 1, characterized in that: The second field includes a transmission mode field and an address range field, and the data range indication information includes a transmission mode parameter and an address range parameter; wherein the transmission mode field corresponds to the transmission mode parameter, and the address range field corresponds to the address range parameter.

3. The control data interaction method according to claim 2, characterized in that: The transmission mode parameters include full transmission or partial transmission, and the address range parameters include offset information and length information.

4. The control data interaction method according to claim 3, characterized in that: The executing the control command according to the data range indication information to realize the transmission of the target data between the storage device and the target memory of the host includes: If the transmission mode parameter in the data range indication information is the full transfer, the entire content of the control data is determined as the target data, and the control command is executed to achieve the transmission of the target data between the storage device and the target memory of the host.

5. The control data interaction method according to claim 3, characterized in that: The executing the control command according to the data range indication information to realize the transmission of the target data between the storage device and the target memory of the host includes: If the transmission mode parameter in the data range indication information is the partial transmission, the starting position of the target data is determined according to the offset information in the address range parameter, and the ending position of the target data is determined according to the length information in the address range parameter; The target data is determined from the control data according to the starting position and the ending position, and the control command is executed to achieve the transmission of the target data between the storage device and the target memory of the host.

6. The control data interaction method according to claim 3, characterized in that: Also includes: If the value of the transmission mode field is a first value, the transmission mode parameter is determined to be the full transmission; if the value of the transmission mode field is a second value, the transmission mode parameter is determined to be the partial transmission.

7. The control data interaction method according to claim 6, characterized in that: Also includes: Based on a non-volatile memory host controller interface specification protocol, the first value is configured as 0 and the second value is configured as 1.

8. The control data interaction method according to claim 6, characterized in that: When the value of the transmission mode field is the first value, the target memory is a statically allocated size defined based on the non-volatile memory host controller interface specification protocol; when the value of the transmission mode field is the second value, the target memory is a dynamically allocated size obtained based on the address range parameter.

9. The control data interaction method according to claim 1, characterized in that: The executing the control command according to the data range indication information to realize the transmission of the target data between the storage device and the target memory of the host includes: When the control command indicates that the storage device transmits data to the host, determining the target data from the control data stored locally according to the data range indication information; The target data is transferred to the target memory of the host.

10. The control data interaction method according to claim 9, characterized in that: When the control command represents that the storage device transmits data to the host, the control command includes a status feedback command and a data reporting command; wherein the status feedback command is used to provide status information of the storage device, and the data reporting command is used to transmit operating data of the storage device.

11. The control data interaction method according to claim 1, characterized in that: The executing the control command according to the data range indication information to realize the transmission of the target data between the storage device and the target memory of the host includes: When the control command indicates that the host transmits data to the storage device, determining the target data from the control data in the target memory according to the data range indication information; The target data is transferred to a preset storage area of ​​the storage device.

12. The control data interaction method according to claim 11, characterized in that: When the control command represents that the host transmits data to the storage device, the control command includes a status management command and a parameter configuration command; wherein the status management command is used to regulate the working status of the storage device, and the parameter configuration command is used to set the functional parameters of the storage device.

13. The control data interaction method according to claim 1, characterized in that: The storage device includes a disk array card and a plurality of solid state hard disks hung on the disk array card.

14. The control data interaction method according to any one of claims 1 to 13, characterized in that: Also includes: When there are multiple control commands at the same time, the priority score of each control command is determined based on the operation urgency and data timeliness of each control command; The actual execution order of each of the control commands is determined according to the initial order of the submission queue entries of the control commands in the submission queue and the priority scores of the control commands.

15. A control data interaction method, characterized in that: Applied to the host, including: Generate a submission queue entry; wherein the first field of the submission queue entry includes the operation command type, and when the operation command type is a control command, the second field of the submission queue entry includes data range indication information, the data range indication information indicates the range information of the target data in the control data, and the control data is a data set that assists in completing the control command; Pre-allocating a target memory based on the data range indication information; Sending the submission queue entry to the storage device so that the storage device executes the control command according to the data range indication information, realizes the transmission of the target data between the storage device and the target memory of the host, and generates an execution result; Receive a completion queue entry containing the execution result returned by the storage device.

16. A control data interaction device, characterized in that: Applicable to storage devices, including: A field parsing module, used to parse the first field of the submission queue entry sent by the host to determine the operation command type; a range determination module, configured to parse the second field of the submission queue entry to obtain data range indication information when the operation command type is a control command; wherein the data range indication information indicates range information of the target data in the control data, and the control data is a data set that assists in completing the control command; a command execution module, configured to execute the control command according to the data range indication information, realize the transmission of the target data between the storage device and the target memory of the host, and generate an execution result; wherein the target memory is pre-allocated by the host based on the data range indication information; The result returning module is used to return the completion queue entry containing the execution result to the host.

17. A control data interaction device, characterized in that: Applied to the host, including: An entry generation module is used to generate a submission queue entry; wherein the first field of the submission queue entry includes an operation command type, and when the operation command type is a control command, the second field of the submission queue entry includes data range indication information, and the data range indication information indicates the range information of the target data in the control data, and the control data is a data set that assists in completing the control command; A memory allocation module, used for pre-allocating a target memory based on the data range indication information; An entry sending module, used for sending the submission queue entry to the storage device, so that the storage device executes the control command according to the data range indication information, realizes the transmission of the target data between the storage device and the target memory of the host, and generates an execution result; The result receiving module is used to receive the completion queue entry containing the execution result returned by the storage device.

18. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the control data interaction method according to any one of claims 1 to 15 are implemented.

19. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the control data interaction method according to any one of claims 1 to 15.

20. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the control data interaction method according to any one of claims 1 to 15 is implemented.

Citation Information

Patent Citations

  • Key value storage method, device and method

    CN106469198A

  • Data access method, device and equipment and computer readable storage medium

    CN115168259A

  • Storage device and method and electronic equipment

    CN117337425A

  • Code coverage rate data exporting method and device, equipment and medium

    CN119149429A

  • Disk array card configuration method and device, equipment, medium and product

    CN119225654A