A data transmission method, device, system, computer equipment and storage medium

By using data flow tags between the storage controller and the flow control unit for bandwidth management and dynamically adjusting the transmission rate, the problem of excessive power consumption of storage devices caused by traditional bandwidth allocation is solved, achieving lower operating costs and more flexible Bandwidth allocation.

CN118916312BActive Publication Date: 2025-01-24SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411406511.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-01-24
Estimated Expiration
2044-10-10

AI Technical Summary

Technical Problem

The traditional method of allocating bandwidth resources leads to excessive power consumption of storage devices, which may lead to abnormal overheating or even damage, and increase operating costs.

Method used

By achieving the matching and allocation of data stream labels between the storage controller and the flow control unit, the transmission rate of each data stream is dynamically adjusted to match the storage bandwidth requirements of each business or users.

Benefits of technology

It effectively reduces the power consumption of storage devices, avoids overheating and damage, reduces operating costs, and meets the storage bandwidth needs of different users or businesses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916312B_ABST
    Figure CN118916312B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of storage technology, and discloses a data transmission method, device, system, computer equipment and storage medium, which are applied to a storage controller; the method comprises: receiving a transmission command corresponding to a target service in a memory of a host, the transmission command being used to request the transmission of a target data stream of the target service between the host and a storage device; detecting whether the storage device has a flow control unit function turned on; in the case of turning on the flow control unit function, detecting whether the transmission command carries a target data stream label of the target data stream; if carried, determining a target flow control unit in at least one flow control unit, and forwarding the transmission command to the target flow control unit, the target flow control unit being used to control the target data stream to be transmitted between the host and the storage device at a preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target service. The present invention can solve the problem that too much bandwidth resources are allocated to the storage device, resulting in high power consumption of the storage device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to a data transmission method, device, system, computer equipment and storage medium. Background Art

[0002] With the development of big data and storage technology, the scenarios of read and write interaction between hosts and storage devices are becoming more and more complex. Especially when facing enterprise-level storage systems with different businesses or multi-user or multi-task environments in different scenarios, the host needs to allocate reasonable bandwidth resources to the storage device to support the read and write interaction between the host and the storage device.

[0003] In the traditional way of allocating bandwidth resources, the host usually tries to allocate enough bandwidth resources to storage resources to ensure that key tasks or key users obtain enough storage resources without affecting other tasks. This method will allocate too much bandwidth resources to storage devices, resulting in high power consumption of storage devices, abnormal overheating of storage devices, and even damage to storage devices, increasing operating costs. Summary of the invention

[0004] In view of this, the present invention provides a data transmission method, apparatus, system, computer equipment and storage medium to solve the problem that too much bandwidth resources are allocated to storage devices, resulting in high power consumption of storage devices, abnormal overheating of storage devices, and even damage to storage devices, thereby increasing operating costs.

[0005] In the first aspect, the present invention provides a data transmission method, which is applied to a storage controller, wherein the storage controller is connected to at least one flow control unit, and each flow control unit corresponds to a data flow label; the storage controller and at least one flow control unit are integrated in a storage device; the method includes: receiving a transmission command corresponding to a target service in a host's memory, the transmission command being used to request transmission of a target data flow of the target service between the host and the storage device; detecting whether the storage device has a flow control unit function enabled; when the flow control unit function is enabled, detecting whether the transmission command carries a target data flow label of the target data flow; if so, determining the target flow control unit in at least one preconfigured flow control unit, and forwarding the transmission command to the target flow control unit, the target flow control unit being used to obtain the target data flow in the host or the storage device, and controlling the target data flow to be transmitted between the host and the storage device at a preset transmission rate, wherein the preset transmission rate matches the storage bandwidth value required for the target service.

[0006] Based on the method of the first aspect above, after receiving the transmission command of the target service in the host memory, the flow control unit function can be turned on after detecting that the storage device has the target data flow label of the target data flow, and the transmission command can be forwarded to the corresponding flow control unit. Since the flow control unit can control the target data flow to be transmitted between the host and the storage device at a preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target service, the data flow corresponding to the data flow label can be distributed to the target flow control unit corresponding to the target service for data transmission, that is, a reasonable storage bandwidth value can be allocated to the target flow control unit of the storage device based on the target service, and the throughput of the target flow control unit to transmit data can be controlled to remain within a reasonable range, thereby reducing the power consumption of the storage device, avoiding abnormal overheating of the storage device, and even damaging the storage device, reducing operating costs, and meeting the needs of different users or services.

[0007] In an optional embodiment, at least one service to which all transmission commands in the host's memory belong is obtained; based on at least one flow control unit corresponding to at least one service configuration and a data flow label corresponding to each flow control unit, each flow control unit corresponds one-to-one to each service.

[0008] Based on the above method, a flow control unit corresponding to each service can be configured in the storage device according to the service corresponding to the transmission command in the host, so as to facilitate the subsequent determination of the preset transmission rate of the flow control unit based on the storage bandwidth value required for each service.

[0009] In an optional embodiment, before configuring at least one flow control unit corresponding to at least one business, the method also includes: receiving a first instruction issued by the host, detecting whether the storage device supports setting the flow control unit, and feeding back first information to the host, the first information being used to indicate that the storage device supports setting the flow control unit; receiving a second instruction issued by the host, detecting the type of flow control unit supported by the storage device, and feeding back second information to the host, the second information being used to indicate that the type of flow control unit supported by the storage device is a configuration-allowed type; receiving a third instruction issued by the host, enabling the storage controller's permission to set the flow control unit, and feeding back third information to the host, the third information being used to indicate that the permission has been enabled; receiving a fourth instruction issued by the host when the storage device supports setting the flow control unit, the type of flow control unit supported to be set is a configuration-allowed type, and the permission has been enabled, the fourth instruction being used to configure at least one flow control unit.

[0010] Based on the above method, the detection and configuration of the flow control unit can improve the reliability and security of the storage device when configuring at least one flow control unit, and facilitate the refined management of the flow control unit.

[0011] In an optional embodiment, the transmission command includes a first field and a second field, the first field is used to indicate the type of the transmission command; the second field is used to indicate the data flow label; detecting whether the storage device has a flow control unit function enabled, including: checking the first field and the second field to determine whether the first field and the second field comply with the storage protocol corresponding to the storage device; when the first field and the second field both comply with the storage protocol, determining that the storage device has a flow control unit function enabled; when the first field or the second field does not comply with the storage protocol, determining that the storage device has not enabled the flow control unit function.

[0012] Based on the above method, the first field and the second field in the transmission command can be checked to determine whether the transmission command complies with the storage protocol, thereby determining the legality of the transmission command, and determining whether the storage device enables the flow control unit function when both the first field and the second field comply with the storage protocol.

[0013] In an optional embodiment, when the flow control unit function is turned on, it is detected whether the transmission command carries the target data flow label of the target data flow; including: determining whether the second field is consistent with the field corresponding to the target data flow label; if consistent, it is determined that the transmission command carries the target data flow label.

[0014] Based on the above method, it can be determined whether the transmission command carries the target data flow label. If the transmission command carries the data flow label, it means that the target data flow carries the target data flow label, which facilitates the subsequent determination of the target flow control unit based on the target data flow label.

[0015] In an optional embodiment, if carried, the target flow control unit is determined in at least one preconfigured flow control unit, including: if carried, the target flow control unit is determined in at least one preconfigured flow control unit according to the target data flow label and a preset correspondence, and the preset correspondence is the correspondence between the target data flow label and the target flow control unit.

[0016] Based on the above method, the target flow control unit corresponding to the transmission command can be determined based on the correspondence between the target data flow label and the target flow control unit.

[0017] In an optional embodiment, the target flow control unit is provided with a token bucket; the method further includes: obtaining a storage bandwidth value required for the target business and a minimum memory page size of the storage device; determining a token capacity of the token bucket according to the storage bandwidth value and the minimum memory page size, the token capacity being the maximum number of tokens allowed to be accommodated by the token bucket, and the maximum number of tokens being used to control a preset transmission rate of a target data flow between a host and a storage device.

[0018] Based on the above method, the preset transmission rate of the data flow can be limited based on the token bucket to ensure that the preset transmission rate of the data transmission does not exceed the storage bandwidth value required by the target business, thereby preventing the storage device from being overloaded, especially under high load conditions, and avoiding performance degradation due to excessive instantaneous data traffic.

[0019] In a second aspect, the present invention provides a data transmission method, which is applied to a target flow control unit, and the target flow control unit is configured in a storage device, and the storage device also includes a storage controller; the method includes: receiving a transmission command forwarded from the storage controller, the transmission command is used to request the transmission of a target data stream of a target service between a host and a storage device, and the transmission command includes the data length of the target data stream; obtaining the target data stream; based on the data length, controlling the transmission of the target data stream between the host and the storage device at a preset transmission rate, and the preset transmission rate matches the storage bandwidth value required for the target service.

[0020] Based on the method of the second aspect above, after receiving the transmission command forwarded by the storage controller, the target data stream can be controlled to be transmitted between the host and the storage device according to the preset transmission rate based on the data length of the target data stream included in the transmission command. Since the flow control unit can control the target data stream to be transmitted between the host and the storage device according to the preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target business, the data stream corresponding to the data stream label can be distributed to the target flow control unit corresponding to the target business for data transmission, that is, a reasonable storage bandwidth value can be allocated to the target flow control unit of the storage device based on the target business, and the throughput of the target flow control unit to transmit data is controlled to remain in a reasonable range, thereby reducing the power consumption of the storage device, avoiding abnormal overheating of the storage device, and even damaging the storage device, thereby reducing operating costs and meeting the needs of different users or businesses.

[0021] In an optional embodiment, the target flow control unit is provided with a token bucket; based on the data length, the target data stream is controlled to be transmitted between the host and the storage device at a preset transmission rate, including: obtaining the number of tokens in the token bucket at the current moment, the number of tokens being less than or equal to the token capacity of the token bucket, the token capacity being the maximum number of tokens in the token bucket determined based on the storage bandwidth value required by the target business; determining the number of data blocks for storing the target data stream according to the data length and the minimum memory page size corresponding to the storage device; when the number of data blocks is less than or equal to the number of tokens, controlling the target data stream to be transmitted between the host and the storage device at a preset transmission rate; or, when the number of data blocks is greater than the number of tokens, waiting for a preset time length, and controlling the target data stream to be transmitted between the host and the storage device at a preset transmission rate, the preset time length being the time length used when the number of tokens is accumulated to the number of data blocks.

[0022] Based on the above method, the data transmission rate or data transmission throughput between the host and the storage device can be controlled by the number of tokens in the token bucket, thereby preventing the storage device from being overloaded, especially in high-load conditions, to avoid performance degradation caused by excessive instantaneous data traffic.

[0023] In an optional embodiment, when the number of data blocks is greater than the number of tokens, the difference between the number of data blocks and the number of tokens is determined; the product of the difference and the time required to accumulate each block of tokens is calculated to determine the preset time, and the time required to accumulate each block of tokens is the ratio of 1 to the token capacity.

[0024] Based on the above method, when the number of data blocks is greater than the number of tokens, that is, when the target data flow is too large, we can wait for the number of tokens in the token bucket to accumulate to equal the number of data blocks, and then control the target data flow to be transmitted between the host and the storage device according to the preset transmission rate.

[0025] In an optional embodiment, the storage device also includes a flash memory; when the transmission command is a write command, the transmission command also includes an original address of the target data stream in the host's memory and a target address in the flash memory of the storage device, and the transmission command is used to request that the target data stream stored in the host's memory be written to the flash memory; obtaining the target data stream includes: obtaining the target data stream from the host's memory based on the original address of the host's memory; based on the data length, controlling the target data stream to be transmitted between the host and the storage device at a preset transmission rate, including: based on the data length, writing the target data stream from the original address of the host's memory to the target address of the flash memory of the storage device at a preset transmission rate.

[0026] Based on the above method, when the transmission command is a write command, the target data stream can be obtained from the host's memory, and based on the data length, the target data stream is written from the original address of the host's memory to the target address of the flash memory of the storage device at a preset transmission rate.

[0027] In an optional embodiment, when the transmission command is a read command, the transmission command also includes the original address of the target data stream in the flash memory of the storage device and the target address in the memory of the host, and the transmission command is used to request to write the target data stream stored in the flash memory of the storage device to the memory of the host; obtaining the target data stream includes: based on the original address of the flash memory of the storage device, obtaining the target data stream from the flash memory of the storage device, based on the data length, controlling the transmission of the target data stream between the host and the storage device at a preset transmission rate, including: based on the data length, writing the target data stream from the original address of the flash memory of the storage device to the target address of the host's memory at a preset transmission rate.

[0028] Based on the above method, when the transmission command is a read command, the target data stream can be obtained from the flash memory of the storage device, and based on the data length, the target data stream is written from the original address of the flash memory of the storage device to the target address of the host's memory at a preset transmission rate.

[0029] In a third aspect, the present invention provides a data transmission method, applied to a host, the method comprising: sending a first instruction, a second instruction, a third instruction and a fourth instruction to a storage controller of a storage device, the first instruction being used to instruct the storage controller to detect whether the storage device supports setting a flow control unit; the second instruction being used to instruct the storage controller to detect the type of flow control unit supported by the storage device; the third instruction being used to enable the storage controller's permission to set a flow control unit; the fourth instruction being used to instruct the storage controller to set at least one flow control unit;

[0030] A transmission command corresponding to the target business is sent to the storage controller. The storage controller is used to receive the transmission command and forward the transmission command to a target flow control unit determined in at least one flow control unit. The target flow control unit is used to obtain the target data stream in the host or storage device, and control the target data stream to be transmitted between the host and the storage device at a preset transmission rate. The preset transmission rate matches the storage bandwidth value required by the target business.

[0031] Based on the third aspect above, the detection and configuration of the storage device can improve the reliability and security of the storage device when configuring at least one flow control unit, and facilitate the refined management of the flow control unit. Since the flow control unit can control the target data stream to be transmitted between the host and the storage device at a preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target business, the data stream corresponding to the data stream label can be distributed to the target flow control unit corresponding to the target business for data transmission, that is, a reasonable storage bandwidth value can be allocated to the target flow control unit of the storage device based on the target business, and the throughput of the target flow control unit to transmit data can be controlled to remain within a reasonable range, thereby reducing the power consumption of the storage device, avoiding abnormal overheating of the storage device, and even damaging the storage device, reducing operating costs, and meeting the needs of different users or businesses.

[0032] In a fourth aspect, the present invention provides a data transmission device, which is applied to a storage controller, wherein the storage controller is connected to at least one flow control unit, each of which corresponds to a data flow label; the storage controller and the at least one flow control unit are integrated in a storage device; the device comprises: a first transceiver module, which is used to receive a transmission command corresponding to a target service in a memory of a host, wherein the transmission command is used to request transmission of a target data flow of the target service between the host and the storage device; a first processing module, which is used to detect whether the storage device has a flow control unit function enabled; the first processing module is also used to detect whether the transmission command carries a target data flow label of the target data flow when the flow control unit function is enabled; the first processing module is also used to determine the target flow control unit in the preconfigured at least one flow control unit if it is carried, and forward the transmission command to the target flow control unit, wherein the target flow control unit is used to obtain the target data flow in the host or the storage device, and control the target data flow to be transmitted between the host and the storage device at a preset transmission rate, wherein the preset transmission rate matches the storage bandwidth value required by the target service.

[0033] In a fifth aspect, the present invention provides a data transmission device, applied to a target flow control unit, wherein the target flow control unit is configured in a storage device, and the storage device also includes a storage controller; the device includes: a second transceiver module, used to receive a transmission command forwarded from the storage controller, wherein the transmission command is used to request the transmission of a target data stream of a target service between a host and the storage device, and the transmission command includes the data length of the target data stream; the second transceiver module is used to obtain the target data stream; and a second processing module is used to control the transmission of the target data stream between the host and the storage device according to the preset transmission rate based on the data length, and the preset transmission rate matches the storage bandwidth value required for the target service.

[0034] In a sixth aspect, the present invention provides a data transmission device, applied to a host; the device includes: a third transceiver module, used to send a first instruction, a second instruction, a third instruction and a fourth instruction to a storage controller of a storage device, wherein the first instruction is used to instruct the storage controller to detect whether the storage device supports setting a flow control unit; the second instruction is used to instruct the storage controller to detect the type of the flow control unit supported by the storage device; the third instruction is used to enable the storage controller's permission to set the flow control unit; the fourth instruction is used to instruct the storage controller to set at least one flow control unit; the third transceiver module is also used to send a transmission command corresponding to a target service to the storage controller, the storage controller is used to receive the transmission command, and forward the transmission command to a target flow control unit determined in the at least one flow control unit, the target flow control unit is used to obtain the target data stream in the host or the storage device, and control the target data stream to be transmitted between the host and the storage device at a preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target service.

[0035] In the seventh aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data transmission method of the above-mentioned first aspect or any corresponding embodiment thereof, or executes the data transmission method of the above-mentioned second aspect or any corresponding embodiment thereof, or executes the data transmission method of the above-mentioned third aspect or any corresponding embodiment thereof by executing the computer instructions.

[0036] In an eighth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data transmission method of the first aspect or any corresponding embodiment thereof, or to execute the data transmission method of the second aspect or any corresponding embodiment thereof, or to execute the data transmission method of the third aspect or any corresponding embodiment thereof.

[0037] In a ninth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the data transmission method of the first aspect or any corresponding embodiment thereof, or to execute the data transmission method of the second aspect or any corresponding embodiment thereof, or to execute the data transmission method of the third aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 is a schematic diagram of interaction between a host and a storage device according to an embodiment of the present invention;

[0040] Figure 2 is a topological diagram of a data transmission system according to an embodiment of the present invention;

[0041] Figure 3 is a flow chart of a data transmission method according to an embodiment of the present invention;

[0042] Figure 4 is a flowchart of another data transmission method according to an embodiment of the present invention;

[0043] Figure 5 is a flow chart of another data transmission method according to an embodiment of the present invention;

[0044] Figure 6 is a structural block diagram of a data transmission device according to an embodiment of the present invention;

[0045] Figure 7 is a structural block diagram of another data transmission device according to an embodiment of the present invention;

[0046] Figure 8 is a structural block diagram of another data transmission device according to an embodiment of the present invention;

[0047] Fig. 9 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0049] The technical solution provided by the embodiment of the present invention is applied to the interaction scenario between the host and the storage device. Figure 1 As shown, Figure 1 Schematic diagram of the interaction between the host and the storage device according to an embodiment of the present invention. Figure 1In the Non-Volatile Memory Express (NVMe) protocol, the host and storage device read and write interaction methods are specified. When the host and storage device (for example, NVMe device) perform read and write interactions, the host completes the interaction with the storage device through the command queue located in the host memory. The command queue includes the Submission Queue (SQ) and the Completion Queue (CQ). The host needs to put the instruction (Submit Queue Entry, SQE) executed by the storage device into the SQ queue, and then notify the storage device to read the SQE instruction from the SQ queue. The storage controller inside the storage device reads the SQE instruction from the SQ queue of the host memory through the high-speed serial computer expansion bus standard (Peripheral Component Interconnect express, PCIe) message, and executes the instruction inside the storage device. Data is exchanged with the host memory through direct memory access (Direct Memory Access, DMA). The storage controller puts the completed instruction result CQE into the host's CQ queue through the PCIe message and notifies the host to complete a read and write interaction.

[0050] As described in the background technology, during the interaction between the storage device and the host, the host needs to allocate sufficient bandwidth resources to the storage device. In an enterprise-level storage system facing a multi-user or multi-task environment, the system administrator may need to allocate different bandwidth resource quotas to different tasks or different users. This method will allocate too much bandwidth resources to the storage device, resulting in high power consumption of the storage device, abnormal overheating of the storage device, or even damage to the storage device, increasing operating costs.

[0051] In order to solve the above technical problems, the present invention provides a data transmission method, which can label each data stream on the host, so that the storage controller can distinguish the data streams of different services or different users, and distribute them to the corresponding flow control units, and perform bandwidth management on different data streams. Reasonable bandwidth resources can be allocated to the flow control units corresponding to different services or different users in the storage device, avoiding the problems of high power consumption of the storage device, abnormal overheating of the storage device, and even damage to the storage device.

[0052] Below Figure 2 The method provided by the embodiment of the present invention is described by taking the data transmission system 20 as an example. Figure 2 It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solution provided in this application.

[0053] like Figure 2 As shown, Figure 2 is a topological diagram of a data transmission system according to an embodiment of the present invention. Figure 2 In the embodiment, the data transmission system 20 may include a storage device 201 and a host 202 .

[0054] The storage device 201 includes a storage controller 2011 , a first flow control unit 2012 , a second flow control unit 2013 , and a flash memory 2014 . The host 202 includes a memory 2021 .

[0055] In an embodiment of the present invention, the storage device 201 may be any type of storage device, for example, the storage device may be an NVMe device, a solid-state drive, a hybrid hard drive, a memory card, etc.

[0056] In an embodiment of the present invention, the storage controller 2011 may be a main controller of the storage device 201, and a functional module for processing NVMe commands.

[0057] In the embodiment of the present invention, the first flow control unit 2012 or the second flow control unit 2013 is a component of the storage device 201 for managing and controlling data flow. The flow control unit is used to ensure that the data flow is transmitted in a predetermined manner, avoid congestion, and optimize resource utilization. The storage controller 2011 is connected to the first flow control unit 2012 or the second flow control unit 2013.

[0058] The flow control unit includes an instruction parsing module, a token bucket module and a DMA module. Among them, the instruction parsing module is used to parse the transmission command. The token bucket module is used to determine the token generation frequency and token capacity corresponding to the flow control unit. The token generation frequency and token capacity are determined by the storage bandwidth value required by the target business. The DMA module is used to transmit data streams.

[0059] In the embodiment of the present invention, the flash memory 2014 may be a flash storage medium.

[0060] In the embodiment of the present invention, the host 202 may be a computer system that can execute applications and communicate with other devices on the network. For example, the host may be a server, a workstation, a laptop, a desktop computer, a mobile device (such as a smart phone and a tablet computer), or any other device that can access the network and participate in network communications.

[0061] In the embodiment of the present invention, the memory 2011 may be a volatile memory installed in a computer host for storing currently running programs and data streams.

[0062] Figure 2 The data transmission system 20 shown is only used as an example and is not used to limit the technical solution of the present application. Those skilled in the art should understand that in the specific implementation process, the data transmission system 20 can also include more flow control units without limitation.

[0063] According to an embodiment of the present invention, a data transmission method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0064] In this embodiment, a data transmission method is provided, which can be used for the above-mentioned storage controller. Figure 3 is a flow chart of a data transmission method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0065] S301: Receive a transmission command corresponding to a target service in a memory of a host.

[0066] The transmission command is used to request the target data stream of the target service to be transmitted between the host and the storage device. The transmission command includes the data length of the target data stream. The transmission command may be an SQE command. The transmission command includes a first field and a second field.

[0067] The first field may be a DTYPE field in the SQE command. The first field is used to indicate the type of the transmission command. The type of the transmission command includes a read command type and a write command type.

[0068] The second field may be a DSPEC field in the SQE command. The second field is used to indicate a data stream label.

[0069] In the embodiment of the present invention, one target service may correspond to multiple transmission commands.

[0070] Exemplarily, a storage controller Controller of the storage device reads a transmission command corresponding to the target service from an SQ queue of the host memory.

[0071] S302: Detect whether the flow control unit function of the storage device is enabled.

[0072] In some optional embodiments, the storage controller checks the first field and the second field to determine whether the first field and the second field comply with the storage protocol corresponding to the storage device; when both the first field and the second field comply with the storage protocol, it is determined that the storage device has enabled the flow control unit function; when the first field or the second field does not comply with the storage protocol, it is determined that the storage device has not enabled the flow control unit function.

[0073] Among them, the storage protocol can be a protocol corresponding to the storage device, for example, the storage protocol is the NVMe protocol.

[0074] In one example, the storage controller reads the values ​​of the first field and the second field; according to the NVMe protocol, determines whether the value of the first field is within the legal value range of the first field; if yes, determines that the first field complies with the storage protocol corresponding to the storage device; if no, determines that the first field does not comply with the storage protocol corresponding to the storage device. According to the value of the first field, determines the verification rule of the second field; and based on the verification rule, determines whether the value of the second field complies with the verification rule; if yes, determines that the second field complies with the storage protocol corresponding to the storage device; if no, determines that the second field complies with the storage protocol corresponding to the storage device.

[0075] S303: When the flow control unit function is enabled, detect whether the transmission command carries a target data flow label of the target data flow.

[0076] In some optional implementations, the storage controller determines whether the second field is consistent with the field corresponding to the target data flow label; if consistent, it is determined that the transfer command carries the target data flow label.

[0077] It is understandable that if there is inconsistency, the storage controller determines that the transmission command does not carry the target data flow label. The storage controller will uniformly process the data flow corresponding to the transmission command that does not carry the target data flow label and no longer forward it to the flow control unit.

[0078] S304: If carried, determine a target flow control unit in at least one pre-configured flow control unit, and forward the transmission command to the target flow control unit.

[0079] The target flow control unit is used to obtain the target data flow in the host or the storage device, and control the target data flow to be transmitted between the host and the storage device at a preset transmission rate.

[0080] The preset transmission rate matches the storage bandwidth value required by the target business. The preset transmission rate is less than or equal to the storage bandwidth value required by the target business.

[0081] In the embodiment of the present invention, each flow control unit corresponds to a data flow label. Different flow control units are used to process data flows of different services or different users. Each flow control unit corresponds to each service one by one.

[0082] In one example, if carried, the storage controller determines the target flow control unit from at least one preconfigured flow control unit based on the target data flow label and the preset correspondence.

[0083] Among them, the preset corresponding relationship is the corresponding relationship between the target data flow label and the target flow control unit.

[0084] In some optional implementations, the storage controller obtains at least one service to which all transmission commands in the host's memory belong; and configures at least one corresponding flow control unit and a data flow label corresponding to each flow control unit according to the at least one service configuration.

[0085] In some optional embodiments, before configuring at least one flow control unit corresponding to at least one business, the storage controller receives a first instruction issued by the host, detects whether the storage device supports setting the flow control unit, and feeds back the first information to the host; receives a second instruction issued by the host, detects the type of flow control unit supported by the storage device, and feeds back the second information to the host; receives a third instruction issued by the host, enables the storage controller's permission to set the flow control unit, and feeds back the third information to the host; and receives a fourth instruction issued by the host when the storage device supports setting the flow control unit, the type of flow control unit supported is a configuration-allowed type, and the permission is enabled.

[0086] Among them, the fourth instruction is used to configure at least one flow control unit.

[0087] In an embodiment of the present invention, the first instruction may be an Identify Controller instruction. The Identify Controller instruction is used to query whether the storage device supports the feature of the directive, that is, to detect whether the storage device supports setting the flow control unit. The first information is used to indicate that the storage device supports setting the flow control unit. For example, the first information may be determined based on bit 5 of the OACS field of the Identify Controller data structure being set to 1, which indicates that the directive feature is supported, that is, the storage device supports setting the flow control unit.

[0088] In an embodiment of the present invention, the second instruction may be an identify directive receive instruction. The identify directive receive instruction is used to obtain the directive type supported by the storage device, that is, to detect the type of flow control unit supported by the storage device. The second information is used to indicate that the type of flow control unit supported by the storage device is an allowed configuration type. For example, the second information may be a directive instruction of the stream type supported by the storage device, that is, the type of flow control unit supported by the storage device is an allowed configuration type.

[0089] In the embodiment of the present invention, the third instruction may be an identify directive send instruction. The identify directive send instruction is used to enable the flow control function of the storage controller Controller, that is, to enable the permission of the storage controller to set the flow control unit. The third information is used to indicate that the permission has been enabled.

[0090] In the embodiment of the present invention, the fourth instruction may be a stream directive send instruction. The stream directive send instruction enables the storage controller to configure a flow control unit and specifies a data flow label of the flow control unit.

[0091] In some optional implementations, the target flow control unit is provided with a token bucket. The storage controller obtains the storage bandwidth value required by the target service and the minimum memory page size of the storage device; and determines the token capacity of the token bucket according to the storage bandwidth value and the minimum memory page size.

[0092] The token capacity is the maximum number of tokens that the token bucket is allowed to accommodate, and the maximum number of tokens is used to control the preset transmission rate of the target data flow between the host and the storage device.

[0093] Based on the above methods S301 to S304, after obtaining the transmission command of the target service in the host memory, the flow control unit function can be turned on after detecting that the storage device has a target data flow label of the target data flow, and the transmission command can be forwarded to the corresponding flow control unit. Since the flow control unit can control the target data flow to be transmitted between the host and the storage device at a preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target service, the data flow corresponding to the data flow label can be distributed to the target flow control unit corresponding to the target service for data transmission, that is, a reasonable storage bandwidth value can be allocated to the target flow control unit of the storage device based on the target service, and the throughput of the target flow control unit to transmit data can be controlled to remain within a reasonable range, thereby reducing the power consumption of the storage device, avoiding abnormal overheating of the storage device, and even damaging the storage device, reducing operating costs, and meeting the needs of different users or services.

[0094] In this embodiment, a data transmission method is provided, which can be used in the above-mentioned flow control unit. Figure 4 is a flowchart of another data transmission method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:

[0095] S401: Receive a transmission command forwarded from a storage controller.

[0096] In one example, when the transfer command is a write command, the transfer command also includes the original address of the target data stream in the host's memory and the target address in the flash memory of the storage device. The transfer command is used to request to write the target data stream stored in the host's memory to the flash memory.

[0097] In one example, when the transfer command is a read command, the transfer command also includes the original address of the target data stream in the flash memory of the storage device and the target address in the host's memory. The transfer command is used to request that the target data stream stored in the flash memory of the storage device be written to the host's memory.

[0098] S402: Acquire target data stream.

[0099] S403: Based on the data length, control the target data stream to be transmitted between the host and the storage device at a preset transmission rate.

[0100] The preset transmission rate matches the storage bandwidth value required by the target service.

[0101] In some optional embodiments, the target flow control unit obtains the number of tokens in the token bucket at the current moment, and determines the number of data blocks for storing the target data stream according to the data length and the minimum memory page size corresponding to the storage device; when the number of data blocks is less than or equal to the number of tokens, the target data stream is controlled to be transmitted between the host and the storage device at a preset transmission rate; or, when the number of data blocks is greater than the number of tokens, waits for a preset period of time and controls the target data stream to be transmitted between the host and the storage device at a preset transmission rate.

[0102] The preset duration is the duration used when the number of tokens is accumulated to the number of data blocks.

[0103] In the embodiment of the present invention, the number of tokens is less than or equal to the token capacity of the token bucket.

[0104] In the embodiment of the present invention, the minimum memory page may be the minimum unit of the storage device, for example, the minimum memory page is 4k.

[0105] In the embodiment of the present invention, taking the storage bandwidth value as 1M and the minimum memory page as 4k as an example, the token capacity of the token bucket is 256 (1M / 4k).

[0106] In some optional embodiments, when the number of data blocks is greater than the number of tokens, the target flow control unit determines the difference between the number of data blocks and the number of tokens; calculates the product of the difference and the time required to accumulate each block of tokens to determine a preset time, and the time required to accumulate each block of tokens is the ratio of 1 to the token capacity.

[0107] In some optional embodiments, when the transmission command is a write command, the target flow control unit obtains the target data stream from the host's memory based on the original address of the host's memory; based on the data length, writes the target data stream from the original address of the host's memory to the target address of the flash memory of the storage device at a preset transmission rate.

[0108] In some optional embodiments, when the transmission command is a read command, the target flow control unit obtains the target data stream from the flash memory of the storage device based on the original address of the flash memory of the storage device; based on the data length, writes the target data stream from the original address of the flash memory of the storage device to the target address of the host's memory at a preset transmission rate.

[0109] Based on the above S401 to S403, after receiving the transmission command forwarded by the storage controller, the target flow control unit can control the target data stream to be transmitted between the host and the storage device at a preset transmission rate based on the data length of the target data stream included in the transmission command. Since the flow control unit can control the target data stream to be transmitted between the host and the storage device at the preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target business, the data stream corresponding to the data stream label can be distributed to the target flow control unit corresponding to the target business for data transmission, that is, a reasonable storage bandwidth value can be allocated to the target flow control unit of the storage device based on the target business, and the throughput of the target flow control unit to transmit data is controlled to remain in a reasonable range, thereby reducing the power consumption of the storage device, avoiding abnormal overheating of the storage device, and even damaging the storage device, thereby reducing operating costs and meeting the needs of different users or businesses.

[0110] In this embodiment, a data transmission method is provided, which can be used for the above-mentioned host. Figure 5 is a flow chart of another data transmission method according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:

[0111] S501: Send a first instruction, a second instruction, a third instruction, and a fourth instruction to a storage controller of a storage device.

[0112] Specifically include:

[0113] S5011: Send a first instruction to a storage controller of a storage device.

[0114] The first instruction is used to instruct the storage controller to detect whether the storage device supports setting the flow control unit.

[0115] S5012: Receive first information fed back by the storage controller.

[0116] The first information is used to indicate that the storage device supports setting the flow control unit.

[0117] S5013: Send a second instruction to the storage controller.

[0118] The second instruction is used to instruct the storage controller to detect the type of flow control unit supported by the storage device.

[0119] S5014: Receive second information fed back by the storage controller.

[0120] The second information is used to indicate that the type of flow control unit supported by the storage device is an allowed configuration type.

[0121] S5015: Send a third instruction to the storage controller, where the third instruction is used to enable the storage controller's permission to set the flow control unit.

[0122] S5016: Receive third information fed back by the storage controller, where the third information is used to instruct the storage controller to enable permission to set the flow control unit.

[0123] S5017: When the storage device supports setting a flow control unit, the type of the flow control unit supported for setting is a configuration-allowed type, and the permission is enabled, send a fourth instruction to the storage controller.

[0124] S502: Send a transfer command corresponding to the target service to the storage controller.

[0125] Based on the above S501 to S502, the host detects and configures the storage device, which can improve the reliability and security of the storage device when configuring at least one flow control unit, and facilitates the refined management of the flow control unit. Since the flow control unit can control the target data stream to be transmitted between the host and the storage device at a preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target business, the data stream corresponding to the data stream label can be distributed to the target flow control unit corresponding to the target business for data transmission, that is, a reasonable storage bandwidth value can be allocated to the target flow control unit of the storage device based on the target business, and the throughput of the target flow control unit to transmit data is controlled to remain within a reasonable range, thereby reducing the power consumption of the storage device, avoiding abnormal overheating of the storage device, and even damaging the storage device, reducing operating costs, and meeting the needs of different users or businesses.

[0126] In this embodiment, a data transmission system is also provided. The data transmission system includes a host and a storage device. The storage device includes a storage controller and a target flow control unit.

[0127] The host is used to send the first instruction, the second instruction, the third instruction and the fourth instruction to the storage controller of the storage device, and send the transmission command corresponding to the target service to the storage controller.

[0128] The storage controller is used to receive the transmission command corresponding to the target service in the host's memory, and detect whether the storage device has enabled the flow control unit function; when the flow control unit function is enabled, detect whether the transmission command carries the target data flow label of the target data flow; if so, determine the target flow control unit in at least one pre-configured flow control unit, and forward the transmission command to the target flow control unit.

[0129] The target flow control unit is used to receive the transmission command forwarded from the storage controller and obtain the target data stream; based on the data length, the target data stream is controlled to be transmitted between the host and the storage device according to the preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target business.

[0130] The above specific implementation process can refer to the above S301 to S304, S401 to S403, S501 to S502, and will not be described in detail.

[0131] In this embodiment, a data transmission device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0132] This embodiment provides a data transmission device, such as Figure 6 As shown, Figure 6 1 is a structural block diagram of a data transmission device according to an embodiment of the present invention; the device is applied to a storage controller, the storage controller is connected to at least one flow control unit, and each flow control unit corresponds to a data flow label; the storage controller and at least one flow control unit are integrated in a storage device; the device includes:

[0133] The first transceiver module 601 is used to receive a transmission command corresponding to a target service in a memory of a host, where the transmission command is used to request transmission of a target data stream of the target service between the host and a storage device;

[0134] The first processing module 602 is used to detect whether the storage device has enabled the flow control unit function;

[0135] The first processing module 602 is further used to detect whether the transmission command carries a target data flow label of the target data flow when the flow control unit function is enabled;

[0136] The first processing module 602 is also used to determine a target flow control unit in at least one preconfigured flow control unit, and forward a transmission command to the target flow control unit, if carried. The target flow control unit is used to obtain a target data stream in a host or a storage device, and control the target data stream to be transmitted between the host and the storage device at a preset transmission rate. The preset transmission rate matches the storage bandwidth value required by the target business.

[0137] In some optional embodiments, the first transceiver module 601 is also used to obtain at least one service to which all transmission commands in the host's memory belong; the first processing module 602 is also used to configure at least one flow control unit corresponding to at least one service and a data flow label corresponding to each flow control unit, and each flow control unit corresponds one-to-one to each service.

[0138] In some optional implementations, the first processing module 602 is specifically used to receive a first instruction sent by the host, detect whether the storage device supports setting the flow control unit, and feedback first information to the host, where the first information is used to indicate that the storage device supports setting the flow control unit.

[0139] The first processing module 602 is also specifically used to receive a second instruction sent by the host, detect the type of flow control unit supported by the storage device, and feedback second information to the host, where the second information is used to indicate that the type of flow control unit supported by the storage device is an allowed configuration type.

[0140] The first processing module 602 is further specifically used to receive a third instruction sent by the host, enable the storage controller's permission to set the flow control unit, and feedback third information to the host, where the third information is used to indicate that the permission has been enabled.

[0141] The first processing module 602 is also specifically used to receive a fourth instruction sent by the host when the storage device supports setting the flow control unit, the type of the flow control unit supported for setting is a configuration-allowed type, and the permission is enabled, and the fourth instruction is used to configure at least one flow control unit.

[0142] In some optional embodiments, the transmission command includes a first field and a second field, the first field is used to indicate the type of the transmission command; the second field is used to indicate the data flow label; the first processing module 602 is also specifically used to check the first field and the second field to determine whether the first field and the second field comply with the storage protocol corresponding to the storage device; the first processing module 602 is also specifically used to determine that the storage device has enabled the flow control unit function when both the first field and the second field comply with the storage protocol; the first processing module 602 is also specifically used to determine that the storage device has not enabled the flow control unit function when the first field or the second field does not comply with the storage protocol.

[0143] In some optional implementations, the first processing module 602 is further specifically used to determine whether the second field is consistent with the field corresponding to the target data stream label; the first processing module 602 is further specifically used to determine that the transmission command carries the target data stream label if they are consistent.

[0144] In some optional embodiments, the first processing module 602 is also specifically used to determine the target flow control unit in at least one pre-configured flow control unit according to the target data flow label and a preset correspondence, and the preset correspondence is the correspondence between the target data flow label and the target flow control unit.

[0145] In some optional embodiments, the target flow control unit is provided with a token bucket; the first transceiver module 601 is also used to obtain the storage bandwidth value required for the target business and the minimum memory page size of the storage device; the first processing module 602 is also specifically used to determine the token capacity of the token bucket according to the storage bandwidth value and the minimum memory page size, the token capacity being the maximum number of tokens that the token bucket is allowed to accommodate, and the maximum number of tokens is used to control the preset transmission rate of the target data flow between the host and the storage device.

[0146] This embodiment provides a data transmission device, such as Figure 7 As shown, Figure 7 is a structural block diagram of another data transmission device according to an embodiment of the present invention; applied to a target flow control unit, the target flow control unit is configured in a storage device, and the storage device also includes a storage controller; the device includes:

[0147] The second transceiver module 701 is used to receive a transmission command forwarded from the storage controller, the transmission command is used to request the transmission of a target data stream of a target service between the host and the storage device, and the transmission command includes a data length of the target data stream;

[0148] The second transceiver module 701 is used to obtain the target data stream;

[0149] The second processing module 702 is used to control the target data stream to be transmitted between the host and the storage device according to a preset transmission rate based on the data length, and the preset transmission rate matches the storage bandwidth value required by the target service.

[0150] In some optional implementations, the target flow control unit is provided with a token bucket; the second processing module 702 is specifically used to obtain the number of tokens in the token bucket at the current moment, the number of tokens is less than or equal to the token capacity of the token bucket, and the token capacity is the maximum number of tokens in the token bucket determined based on the storage bandwidth value required by the target service;

[0151] The second processing module 702 is further specifically used to determine the number of data blocks storing the target data stream according to the data length and the minimum memory page size corresponding to the storage device;

[0152] The second processing module 702 is further specifically configured to control the target data stream to be transmitted between the host and the storage device according to a preset transmission rate when the number of data blocks is less than or equal to the number of tokens;

[0153] Alternatively, the second processing module 702 is also specifically used to wait for a preset time period when the number of data blocks is greater than the number of tokens, and control the transmission of the target data stream between the host and the storage device according to a preset transmission rate, and the preset time period is the time period used when the number of tokens is accumulated to the number of data blocks.

[0154] In some optional embodiments, the second processing module 702 is also used to determine the difference between the number of data blocks and the number of tokens when the number of data blocks is greater than the number of tokens; the second processing module 702 is also used to calculate the product of the difference and the time required to accumulate each block of tokens, and determine the preset time, where the time required to accumulate each block of tokens is the ratio of 1 to the token capacity.

[0155] In some optional implementations, the storage device further includes a flash memory; when the transmission command is a write command, the transmission command further includes an original address of the target data stream in the host's memory and a target address in the flash memory of the storage device; the transmission command is used to request that the target data stream stored in the host's memory be written into the flash memory. The second transceiver module 701 is further specifically used to obtain the target data stream from the host's memory based on the original address of the host's memory; the second processing module 702 is further specifically used to write the target data stream from the original address of the host's memory to the target address of the flash memory of the storage device based on the data length and at a preset transmission rate.

[0156] In some optional embodiments, when the transmission command is a read command, the transmission command also includes the original address of the target data stream in the flash memory of the storage device and the target address in the memory of the host, and the transmission command is used to request to write the target data stream stored in the flash memory of the storage device to the memory of the host; the second transceiver module 701 is also specifically used to obtain the target data stream from the flash memory of the storage device based on the original address of the flash memory of the storage device; the processing module 702 is also specifically used to write the target data stream from the original address of the flash memory of the storage device to the target address of the host's memory according to a preset transmission rate based on the data length.

[0157] This embodiment provides a data transmission device, such as Figure 8 As shown, Figure 8 It is a structural block diagram of another data transmission device according to an embodiment of the present invention; applied to a host, the device includes: a third transceiver module 801, used to send a first instruction, a second instruction, a third instruction and a fourth instruction to a storage controller of a storage device, the first instruction is used to instruct the storage controller to detect whether the storage device supports setting a flow control unit; the second instruction is used to instruct the storage controller to detect the type of flow control unit supported by the storage device; the third instruction is used to enable the storage controller's permission to set a flow control unit; the fourth instruction is used to instruct the storage controller to set at least one flow control unit.

[0158] The third transceiver module 801 is also used to send a transmission command corresponding to the target service to the storage controller. The storage controller is used to receive the transmission command and forward the transmission command to a target flow control unit determined in at least one flow control unit. The target flow control unit is used to obtain a target data stream in a host or a storage device, and control the target data stream to be transmitted between the host and the storage device at a preset transmission rate. The preset transmission rate matches the storage bandwidth value required by the target service.

[0159] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0160] The data transmission device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0161] The embodiment of the present invention also provides a computer device having the above Figure 6 , Figure 7 or Figure 8 The data transmission device shown.

[0162] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 9 As shown, the computer device includes: one or more processors 10, a memory 40, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.

[0163] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0164] The memory 40 stores instructions executable by at least one processor 10 so as to enable at least one processor 10 to implement the method shown in the above embodiment.

[0165] The memory 40 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 40 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 40 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

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

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

[0168] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in 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 storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above 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. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0169] Part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

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

Claims

1. A data transmission method, characterized in that: Applied to a storage controller, the storage controller is connected to at least one flow control unit, each of the flow control units corresponds to a data flow label; The storage controller and the at least one flow control unit are integrated in a storage device; the method comprises: Obtain at least one service to which all transmission commands in the host's memory belong; According to the at least one flow control unit corresponding to the at least one service configuration and the data flow label corresponding to each flow control unit, each flow control unit corresponds to each service one by one; receiving a transmission command corresponding to a target service in a memory of a host, wherein the transmission command is used to request transmission of a target data stream of the target service between the host and the storage device; Detecting whether the storage device has a flow control unit function enabled; When the flow control unit function is enabled, detecting whether the transmission command carries a target data flow label of the target data flow; If it is carried, a target flow control unit is determined in the at least one pre-configured flow control unit, and the transmission command is forwarded to the target flow control unit, the target flow control unit is used to obtain the target data stream in the host or the storage device, and control the target data stream to be transmitted between the host and the storage device at a preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target service; Before configuring the at least one flow control unit corresponding to the at least one service, the method further includes: receiving a first instruction sent by the host, detecting whether the storage device supports setting a flow control unit, and feeding back first information to the host, where the first information is used to indicate that the storage device supports setting a flow control unit; receiving a second instruction sent by the host, detecting the type of the flow control unit supported by the storage device, and feeding back second information to the host, wherein the second information is used to indicate that the type of the flow control unit supported by the storage device is a configuration-allowed type; receiving a third instruction sent by the host, enabling the permission of the storage controller to set the flow control unit, and feeding back third information to the host, wherein the third information is used to indicate that the permission has been enabled; When the storage device supports setting a flow control unit, the type of the flow control unit supported for setting is the allowed configuration type, and the permission is enabled, a fourth instruction sent by the host is received, and the fourth instruction is used to configure the at least one flow control unit.

2. The method according to claim 1, characterized in that The transmission command includes a first field and a second field, wherein the first field is used to indicate the type of the transmission command; and the second field is used to indicate the data stream label; The detecting whether the storage device has enabled the flow control unit function includes: Verify the first field and the second field to determine whether the first field and the second field comply with a storage protocol corresponding to the storage device; When both the first field and the second field comply with the storage protocol, determining that the storage device enables the flow control unit function; When the first field or the second field does not comply with the storage protocol, it is determined that the storage device does not enable the flow control unit function.

3. The method according to claim 2, characterized in that The step of detecting whether the transmission command carries the target data flow label of the target data flow when the flow control unit function is enabled comprises: Determining whether the second field is consistent with the field corresponding to the target data stream label; If they are consistent, it is determined that the transmission command carries the target data flow label.

4. The method according to claim 3, characterized in that If the target flow control unit is carried, determining the target flow control unit in the at least one pre-configured flow control unit includes: If carried, the target flow control unit is determined in the at least one pre-configured flow control unit according to the target data flow label and a preset corresponding relationship, and the preset corresponding relationship is the corresponding relationship between the target data flow label and the target flow control unit.

5. The method according to claim 4, characterized in that The target flow control unit is provided with a token bucket; the method further comprises: Acquire the storage bandwidth value required by the target service and the minimum memory page size of the storage device; The token capacity of the token bucket is determined according to the storage bandwidth value and the minimum memory page size. The token capacity is the maximum number of tokens that the token bucket is allowed to accommodate. The maximum number of tokens is used to control the preset transmission rate of the target data flow between the host and the storage device.

6. A data transmission system, characterized in that: The data transmission system includes a host and a storage device, wherein the storage device includes a storage controller and a target flow control unit; The host is used to store multiple transmission commands, and send a first instruction, a second instruction, a third instruction and a fourth instruction to a storage controller of a storage device, wherein the first instruction is used to instruct the storage controller to detect whether the storage device supports setting a flow control unit; the second instruction is used to instruct the storage controller to detect the type of the flow control unit supported by the storage device; the third instruction is used to enable the storage controller to set the flow control unit; the fourth instruction is used to instruct the storage controller to set at least one flow control unit; The host is further used to send a transmission command corresponding to the target service to the storage controller, the storage controller is used to receive the transmission command and forward the transmission command to a target flow control unit determined in the at least one flow control unit, the target flow control unit is used to obtain a target data stream in the host or the storage device, and control the target data stream to be transmitted between the host and the storage device at a preset transmission rate, and the preset transmission rate matches the storage bandwidth value required by the target service; The storage controller is used to obtain a transmission command corresponding to the target service in the memory of the host, and execute the data transmission method according to any one of claims 1 to 5; The target flow control unit is used to receive a transmission command forwarded from the storage controller, the transmission command is used to request the transmission of a target data stream of a target service between the host and the storage device, the transmission command includes the data length of the target data stream; obtain the target data stream; based on the data length, control the target data stream to be transmitted between the host and the storage device at a preset transmission rate, the preset transmission rate matches the storage bandwidth value required by the target service.

7. A data transmission device, characterized in that: Applied to a storage controller, the storage controller is connected to at least one flow control unit, each of the flow control units corresponds to a data flow label; The storage controller and the at least one flow control unit are integrated in a storage device; the apparatus comprises: The first transceiver module is further used to obtain at least one service to which all transmission commands in the memory of the host belong; A first processing module, configured to configure, according to the at least one service, the at least one flow control unit corresponding to the at least one service and the data flow label corresponding to each flow control unit, wherein each flow control unit corresponds to each service in a one-to-one manner; The first transceiver module is used to receive a transmission command corresponding to a target service in a memory of a host, wherein the transmission command is used to request transmission of a target data stream of the target service between the host and the storage device; The first processing module is used to detect whether the flow control unit function of the storage device is enabled; The first processing module is further configured to detect whether the transmission command carries a target data flow label of the target data flow when the flow control unit function is enabled; The first processing module is further configured to, if carried, determine a target flow control unit in the at least one pre-configured flow control unit, and forward the transmission command to the target flow control unit, wherein the target flow control unit is configured to obtain the target data stream in the host or the storage device, and control the target data stream to be transmitted between the host and the storage device at a preset transmission rate, wherein the preset transmission rate matches a storage bandwidth value required by the target service; The first transceiver module is further configured to obtain at least one service to which all transmission commands in the memory of the host belong before configuring the at least one flow control unit corresponding to the at least one service; The first processing module is further configured to configure, according to the at least one service, the at least one flow control unit corresponding to the at least one service and the data flow label corresponding to each flow control unit, wherein each flow control unit corresponds to each service in a one-to-one manner; The first transceiver module is further used to receive a first instruction sent by the host, detect whether the storage device supports setting the flow control unit, and feed back first information to the host, where the first information is used to indicate that the storage device supports setting the flow control unit; The first transceiver module is further used to receive a second instruction sent by the host, detect the type of the flow control unit supported by the storage device, and feed back second information to the host, where the second information is used to indicate that the type of the flow control unit supported by the storage device is a configuration-allowed type; The first transceiver module is further used to receive a third instruction sent by the host, enable the storage controller's permission to set the flow control unit, and feed back third information to the host, where the third information is used to indicate that the permission has been enabled; The first transceiver module is also used to receive a fourth instruction issued by the host when the storage device supports the setting of a flow control unit, the type of the flow control unit supported for setting is the allowed configuration type, and the permission is enabled, and the fourth instruction is used to configure the at least one flow control unit.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data transmission method according to any one of claims 1 to 5 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data transmission method according to any one of claims 1 to 5.

10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the data transmission method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Read-write current limiting method, system and device, computer equipment and storage medium

    CN116915412A

  • System and method for dynamically adjusting memory performance

    US20120179883A1