A command transmission method, apparatus, device and medium

By adding unique identifiers and transmission order to commands on the RDMA link, combined with multi-threading and counting functions, the problem of limited transmission speed of RDMA link IO queues is solved, and efficient command transmission is achieved.

CN116366700BActive Publication Date: 2025-12-19INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310330700.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2025-12-19
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

In existing technologies, the command transmission process of the RDMA link's IO queue is serial, which limits the command transmission speed and results in low performance when there is network latency.

Method used

By adding a unique identifier to each command, sending commands in a predetermined transmission order, and determining the transmission order of the next command based on the return result from the receiving end, an IO queue is created using a multi-threaded approach and a counting function is added to record the transmission time interval to determine command failure.

Benefits of technology

It improves the efficiency and performance of command transmission, reduces the number of times the return result is transmitted, and optimizes the command processing flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116366700B_ABST
    Figure CN116366700B_ABST
Patent Text Reader

Abstract

The application discloses a command transmission method and device, equipment and medium, and relates to the technical field of computers. The method comprises the following steps: acquiring commands, determining a transmission sequence; adding a unique identifier to each command according to the transmission sequence to obtain each target command, and sending each target command to a receiving end, so that the receiving end generates a return result after acquiring the target command; acquiring the return result and analyzing the return result; if the return result is successful, determining the transmission sequence of the next target command to be transmitted based on the transmission sequence corresponding to the last target command in the return result; determining the next target command to be transmitted according to the transmission sequence of the next target command to be transmitted, and sending the next target command to be transmitted to the receiving end, so that the receiving end processes the target command to be transmitted until all the target commands are processed. Through the above technical scheme, the performance of the command transmission can be improved, and the efficiency of the command transmission can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a command transmission method and device, equipment and medium. BACKGROUND

[0002] In the prior art, an RDMA (Remote-Direct Memory Access) link is divided into an admin management queue and multiple IO (Input / Output) queues. The admin queue is mainly used for transmitting management commands, and the IO queue is used for transmitting data. For each IO queue, the process of sending an IO command or data is serial. When the first command is transmitted to the receiving end, the receiving end receives and processes the command and then returns a status (referred to as the execution result of the command) to the sending end. After receiving the status of the command, the sending end sends the second command according to the result. The sending end is referred to as an initiator, and the receiving end is referred to as a target. Therefore, for a single IO queue, the speed of transmitting commands or data is limited by many factors. When the network has a delay, the sending time of the next command is greatly delayed, which ultimately leads to low performance.

[0003] As can be seen from the above, how to increase the performance of command transmission and improve the efficiency of command transmission is a problem to be solved in the field. SUMMARY

[0004] Therefore, the purpose of the present application is to provide a command transmission method, device, equipment and medium, which can increase the performance of command transmission and improve the efficiency of command transmission. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a command transmission method applied to a sending end, comprising:

[0006] obtaining a command to be transmitted, and determining a transmission order;

[0007] adding a unique identifier to each command according to the transmission order to obtain a target command, and sending each target command to a receiving end, so that the receiving end processes the target command after obtaining the target command and generates a return result;

[0008] obtaining the return result sent by the receiving end, and analyzing the return result, if the return result is successful, determining the next transmission order to be transmitted based on the transmission order corresponding to the last target command in the return result;

[0009] According to the transmission order of the next to-be-transmitted target command, the next to-be-transmitted target command is determined and sent to the receiving end, so that the receiving end processes the to-be-transmitted target command until all the target command processing is completed.

[0010] Optionally, before the to-be-transmitted command is obtained and the transmission order is determined, the method further comprises:

[0011] The Internet protocol address is called and network smoothness analysis is performed on the Internet protocol address. If the network is smooth, a connection request is obtained, a routing request is called, and the routing request is analyzed based on the connection request. If the routing is normal, connection resource information is obtained.

[0012] The connection command is called, and the connection resource information is used to establish a remote memory direct access connection relationship between the local and the receiving end based on the connection command.

[0013] Optionally, the connection command is called, and the connection resource information is used to establish a remote memory direct access connection relationship between the local and the receiving end based on the connection command, comprising:

[0014] The connection command is called and sent to the receiving end, so that the receiving end responds to the connection command after obtaining the connection command. If the response is successful, information representing that the remote memory direct access connection relationship between the local and the receiving end is successfully established is generated and sent to the local.

[0015] Optionally, the to-be-transmitted command is obtained and the transmission order is determined, comprising:

[0016] Based on the remote memory direct access connection relationship and in a multi-threaded manner, an IO queue is created, and a counting function is added to the IO queue.

[0017] The to-be-transmitted command is obtained, the command is sent to the IO queue, and the transmission order of the command is determined according to the counting function.

[0018] Optionally, after the target commands are sent to the receiving end, the method further comprises:

[0019] The sending time is recorded, and it is judged whether the time interval between the current time and the sending time is greater than a preset response threshold. If the time interval between the current time and the sending time is greater than the preset response threshold, it is defaulted that the sending of each target command fails, and a command re-sending operation is performed.

[0020] Optionally, the sending each of the target commands to the receiving end so that the receiving end processes the target commands after obtaining the target commands and generates a return result, comprises:

[0021] sending each of the target commands to the receiving end so that the receiving end processes the target commands after obtaining the target commands, and generating a to-be-sent return result if all the target commands are processed successfully;

[0022] determining a transmission order corresponding to a last target command, adding the transmission order corresponding to the last target command to the to-be-sent return result to obtain a return result.

[0023] Optionally, the analyzing the return result further comprises:

[0024] if the return result is a failure, determining a transmission order corresponding to a target command that fails to be processed based on the return result;

[0025] taking the transmission order corresponding to the target command that fails to be processed as a next to-be-transmitted transmission order, and taking the target command that fails to be processed as a next to-be-transmitted target command, and then repeating the above operations until all the target commands are processed.

[0026] In a second aspect, the present application discloses a command transmission device, comprising:

[0027] a transmission order determination module configured to obtain to-be-transmitted commands and determine a transmission order;

[0028] a target command sending module configured to add a unique identifier to each of the commands according to the transmission order to obtain target commands, and send each of the target commands to a receiving end so that the receiving end processes the target commands after obtaining the target commands and generates a return result;

[0029] a return result obtaining module configured to obtain the return result sent by the receiving end, analyze the return result, and determine a next to-be-transmitted transmission order based on a transmission order corresponding to a last target command in the return result if the return result is a success;

[0030] a target command processing module configured to determine a next to-be-transmitted target command according to the next to-be-transmitted transmission order, send the next to-be-transmitted target command to the receiving end so that the receiving end processes the to-be-transmitted target command, and repeat the above operations until all the target commands are processed.

[0031] In a third aspect, the present application discloses an electronic device, comprising:

[0032] Memory, used to store computer programs;

[0033] A processor is used to execute the computer program to implement the aforementioned command transmission method.

[0034] Fourthly, this application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed command transmission method.

[0035] As can be seen, this application provides a command transmission method, including obtaining commands to be transmitted and determining the transmission order; adding a unique identifier to each command according to the transmission order to obtain each target command, and sending each target command to a receiving end, so that the receiving end can process the target commands after obtaining them and generate a return result; obtaining the return result sent by the receiving end and parsing the return result; if the return result is successful, determining the next transmission order based on the transmission order corresponding to the last target command in the return result; determining the next target command to be transmitted according to the next transmission order, and sending the next target command to be transmitted to the receiving end, so that the receiving end can process the target command to be transmitted until all target commands have been processed. This application improves the performance and efficiency of command transmission by transmitting commands sequentially to the receiving end, with each command carrying a unique identifier. The receiving end processes the commands and generates a return result. The sending end receives the return result and decides whether to retransmit from a certain command or continue sending the next group of commands until all commands have been processed. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0037] Figure 1 This is a flowchart of a command transmission method disclosed in this application;

[0038] Figure 2 This is a flowchart of a command transmission method disclosed in this application;

[0039] Figure 3 This is a schematic diagram of the structure of a command transmission device disclosed in this application;

[0040] Figure 4 An electronic device structure diagram is provided for the present application. DETAILED DESCRIPTION

[0041] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0042] In the prior art, an RDMA (Remote-Direct Memory Access) link is divided into one admin management queue and multiple IO (Input / Output) queues. The admin queue is mainly used to transmit management commands, and the IO queue is used to transmit data. For each IO queue, the process of sending an IO command or data is serial. When the first command is transmitted to the receiving end, the receiving end receives and processes the command and then returns a status (referred to as the execution result of the command) of the command to the sending end. The sending end receives the status of the command and then sends the second command according to the result. The sending end is referred to as an initiator, and the receiving end is referred to as a target. Therefore, for a single IO queue, the speed of transmitting a command or data is limited by many factors. When the network has a delay, the sending time of the next command is greatly delayed, and finally the performance is not high. As can be seen from the above, how to increase the performance of command transmission and improve the efficiency of command transmission is a problem to be solved in the field.

[0043] Referring to Figure 1 The embodiments of the present application disclose a command transmission method, which can specifically include:

[0044] Step S11: Obtain a command to be transmitted, and determine a transmission sequence.

[0045] In the embodiment, before obtaining the command to be transmitted, the Internet protocol address is invoked and the Internet protocol address is parsed for network smoothness. If the network is smooth, the connection request is obtained, the routing request is invoked, and the routing request is parsed based on the connection request. If the routing is normal, the connection resource information is obtained. The connection command is invoked, the connection command is used to establish the remote memory direct access connection relationship between the local and the receiving end based on the connection resource information. Specifically, the connection command is invoked, and the connection command is sent to the receiving end, so that the receiving end responds to the connection command after obtaining the connection command. If the response is successful, information indicating that the remote memory direct access connection relationship between the local and the receiving end is successfully established is generated, and the information is sent to the local.

[0046] In the embodiment, the IO queue is created in a multi-threaded manner based on the remote memory direct access connection relationship, and the counting function is added to the IO queue. Then, the command to be transmitted is obtained, the command is sent to the IO queue, and the transmission order of the command is determined according to the counting function.

[0047] Specifically, first, an admin queue (connection) is created, and the connection mode depends on the specific RDMA API (0Application Programming Interface, application programming interface) and CM (Connection Management, connection management) event. The initiator initiates to set the target ip to be connected, and initiates to establish the connection. After the admin queue is created, IO queues are created in turn, and the number of IO queues is defined according to the upper layer protocol, for example, 8 IO queues. The sending end initiates the connection step: first, rdma_resolve_addr (Internet Protocol Address, Internet Protocol Address) is called to resolve the IP address, and the RDMA_CM_EVNET_ADDR_RESOLVED event (connection request) will be received under the condition that the network is smooth. If the network is not smooth, the RDMA_CM_EVNET_ADDR_ERROR event will be received. Then, after receiving the RDMA_CM_EVNET_ADDR_RESOLVED event, rdma_resolve_route (route request) is called to resolve the route request, and the RDMA_CM_EVNET_ROUTE_RESOLVED event represents that the route is normal. Otherwise, the RDMA_CM_EVNET_ROUTE_ERROR event will be received, and the connection resource information required for creating the queue is created by calling the rdma_create_cq, rdma_create_qp and other API interfaces, and then rdma_connect (connection command) is called to initiate the connection request. After the initiator initiates rdma_connect, the target receives the connection request, and the processing steps are as follows: the target receives the RDMA_CM_EVENT_CONNECT_REQUEST event, and then the target creates the required resources by calling the rdma_create_cq, rdma_create_qp and other API interfaces, and the target calls rdma_accept to respond to the connection request of the initiator. After the above steps are completed, the target and the initiator will receive the RDMA_CM_EVNET_ESTABLISHED event (information for indicating that the remote memory direct access connection relationship between the local and the receiving end is successfully established), and thus a CM connection is established. According to the above connection establishment steps, the admin connection and the IO connection are established. Different IO queues can send command data on different threads to achieve concurrency, and the more the number of threads, the more the CPU consumption.The transmission efficiency of the single IO queue is still limited. The following scheme is designed for the single IO queue to improve the performance. First, a CID attribute is created on the IO queue to count the current transmitted commands. The count value can be set to 0 to 4095.

[0048] Step S12: A unique identifier is added to each command according to the transmission order to obtain each target command, and each target command is sent to the receiving end, so that the receiving end processes the target command after obtaining the target command and generates a return result.

[0049] Step S13: The return result sent by the receiving end is obtained, and the return result is parsed. If the return result is successful, the next transmission order to be transmitted is determined based on the transmission order corresponding to the last target command in the return result.

[0050] In this embodiment, if the return result is a failure, the transmission order corresponding to the target command that fails to be processed is determined based on the return result, then the transmission order corresponding to the target command that fails to be processed is used as the next transmission order to be transmitted, and the target command that fails to be processed is used as the next target command to be transmitted, then the above operation is repeated until all the target commands are processed.

[0051] Step S14: The next target command to be transmitted is determined according to the next transmission order to be transmitted, and the next target command to be transmitted is sent to the receiving end, so that the receiving end processes the target command to be transmitted until all the target commands are processed.

[0052] In the embodiment, a command to be transmitted is acquired, and a transmission sequence is determined. A unique identifier is added to each command according to the transmission sequence, to obtain each target command. Each target command is sent to a receiving end, so that the receiving end processes the target command after acquiring the target command, and generates a return result. The return result sent by the receiving end is acquired, and the return result is parsed. If the return result is successful, the transmission sequence corresponding to the last target command in the return result is determined as the next transmission sequence to be transmitted. The next target command to be transmitted is determined according to the next transmission sequence to be transmitted, and the next target command to be transmitted is sent to the receiving end, so that the receiving end processes the target command to be transmitted. The above process is repeated until all target commands are processed. The application transmits commands to the receiving end one by one, and each command carries a unique identifier. The receiving end processes the command, and then generates a return result. The sending end receives the return result, and decides whether to retransmit a command or continue to send the next group of commands according to the return result, until all commands are processed. The performance of command transmission is improved, and the efficiency of command transmission is improved.

[0053] Referring to Figure 2 The embodiment of the application discloses a command transmission method, which can specifically include the following steps:

[0054] Step S21: acquiring a command to be transmitted, and determining a transmission sequence.

[0055] Step S22: adding a unique identifier to each command according to the transmission sequence, to obtain each target command, and sending each target command to a receiving end, so that the receiving end processes the target command after acquiring the target command. If all target commands are successfully processed, a return result to be sent is generated, and the transmission sequence corresponding to the last target command is determined. The transmission sequence corresponding to the last target command is added to the return result to be sent, to obtain a return result.

[0056] In the embodiment, after each target command is sent to the receiving end, the sending time is recorded, and it is judged whether the time interval between the current time and the sending time is greater than a preset response threshold. If the time interval between the current time and the sending time is greater than the preset response threshold, it is determined that each target command is sent unsuccessfully, and a command retransmission operation is performed.

[0057] In this embodiment, the initiator sends commands can send five consecutive commands to the target (each command occupies a cid count, such as the first five commands correspond to cid: 0, 1, 2, 3, 4), start a timer. The purpose of the timer is to send commands to the target if the target does not respond to the status, wait for the timer to time out after the timer expires, consider the command sending failure, and resend the command group. After the target receives the command and starts processing, the continuous 5 commands are processed, and if all 5 commands are correctly processed, the status structure is filled, the result is set to success, the cid is set to the last command cid (cid is set to 4), and the status is sent to the initiator. After the initiator receives the status, the result is success, which indicates that the command sending is successful, and the cid is 4. Then send the next group of commands with cid 5, 6, 7, 8, 9 to the target for processing. If the target fails when processing the command with cid 8, the result of the status is set to fail, and the cid is set to 8. Send the status to the initiator. After the initiator receives the status, the result is fail, and the cid is 8, which indicates that the command with cid 8 fails. The initiator sends the next group of commands starting from the command with cid 8, and sends the commands with cid 8, 9, 10, 11, 12 to the target. According to the above manner, all commands are processed, and if the cid count is 4095, the counting is restarted from 0. According to the above manner, five consecutive commands are sent to the target for processing, and the target returns the status only once after processing. In this way, the number of status transmissions can be greatly reduced, thereby improving transmission efficiency and achieving the purpose of improving performance.

[0058] Step S23: Obtain the return result sent by the receiving end, and analyze the return result. If the return result is success, the next transmission order to be transmitted is determined based on the transmission order corresponding to the last target command in the return result.

[0059] Step S24: Determine the next target command to be transmitted according to the next transmission order to be transmitted, and send the next target command to be transmitted to the receiving end, so that the receiving end processes the target command to be transmitted until all the target commands are processed.

[0060] The present application defines a field for recording the command id in the command structure when transmitting the command, noted as CID (Command index, the above-mentioned unique identifier), for recording the current command is the first command transmitted. When the receiving end replies the status of the command, the CID is also returned to the sending end. After the sending end receives the returned CID, it indicates that the command corresponding to the CID is correctly processed. The resources of the command corresponding to the CID can be released. In this way, a specified number of commands can be continuously transmitted, for example, 5 commands can be continuously transmitted to the receiving end. When processing the continuous commands, the receiving end does not need to reply the status after processing each command, but only needs to reply the status of the last command after processing the 5 commands. If the receiving end fails when processing a command in the middle, for example, when processing the third command, it needs to reply the status of the third command to the sending end. After receiving the status, the sending end can judge the CID in the status and the result of the status is success or failure. For example, if the CID is the CID of the last command and the result is success, it can prove that the 5 continuous commands are all correctly processed. If the result of the status is failure, the CID is checked, for example, the CID is 3, which indicates that the processing fails from the third command. The sending end will start retransmission from the third command next time and continuously transmit 5 commands to the receiving end from the third command.

[0061] In the embodiment, a command to be transmitted is acquired, and a transmission sequence is determined; a unique identifier is added to each of the commands according to the transmission sequence to obtain target commands, and each of the target commands is sent to a receiving end, so that the receiving end processes the target commands after acquiring the target commands and generates a return result; the return result sent by the receiving end is acquired, and the return result is parsed; if the return result is successful, a next transmission sequence to be transmitted is determined based on a transmission sequence corresponding to a last target command in the return result; a next target command to be transmitted is determined according to the next transmission sequence to be transmitted, and the next target command to be transmitted is sent to the receiving end, so that the receiving end processes the target command to be transmitted, until all the target commands are processed. The application transmits commands to the receiving end one by one, and each command carries a unique identifier. The receiving end processes the commands, and then generates a return result. The sending end receives the return result, and decides whether to retransmit a command or continue to send a next group of commands according to the return result, until all the commands are processed. The application can increase the performance of command transmission and improve the efficiency of command transmission.

[0062] Referring to Figure 3 As shown in the figure, the embodiment of the application discloses a command transmission device, which can specifically include:

[0063] A transmission sequence determination module 11 is configured to acquire a command to be transmitted, and determine a transmission sequence.

[0064] A target command sending module 12 is configured to add a unique identifier to each of the commands according to the transmission sequence to obtain target commands, and send each of the target commands to a receiving end, so that the receiving end processes the target commands after acquiring the target commands and generates a return result.

[0065] A return result acquisition module 13 is configured to acquire the return result sent by the receiving end, and parse the return result; if the return result is successful, a next transmission sequence to be transmitted is determined based on a transmission sequence corresponding to a last target command in the return result.

[0066] A target command processing module 14 is configured to determine a next target command to be transmitted according to the next transmission sequence to be transmitted, send the next target command to be transmitted to the receiving end, so that the receiving end processes the target command to be transmitted, until all the target commands are processed.

[0067] In the embodiment, commands to be transmitted are acquired, and a transmission sequence is determined; a unique identifier is added to each command according to the transmission sequence to obtain target commands, and each target command is sent to a receiving end, so that the receiving end processes the target commands after acquiring the target commands and generates a return result; the return result sent by the receiving end is acquired, and the return result is parsed; if the return result is successful, the next transmission sequence to be transmitted is determined based on the transmission sequence corresponding to the last target command in the return result; the next target command to be transmitted is determined according to the next transmission sequence to be transmitted, and the next target command to be transmitted is sent to the receiving end, so that the receiving end processes the target command to be transmitted until all the target commands are processed. The application transmits commands to the receiving end one by one, and each command carries a unique identifier. The receiving end processes the commands and then generates a return result, and the sending end receives the return result, decides whether to retransmit from a certain command or continue to send the next group of commands according to the return result, until all the commands are processed, which can increase the performance of command transmission and improve the efficiency of command transmission.

[0068] In some specific embodiments, the transmission sequence determination module 11 can specifically include:

[0069] An Internet protocol address calling module is configured to call an Internet protocol address, perform network smoothness analysis on the Internet protocol address, acquire a connection request if the network is smooth, call a routing request, analyze the routing request based on the connection request, acquire connection resource information if the routing is normal, and call a connection command.

[0070] A connection command calling module is configured to call a connection command, establish a remote memory direct access connection relationship between a local device and the receiving end based on the connection command and the connection resource information.

[0071] In some specific embodiments, the transmission sequence determination module 11 can specifically include:

[0072] A connection command sending module is configured to call a connection command, send the connection command to the receiving end, so that the receiving end responds to the connection command after acquiring the connection command, generate information indicating that the remote memory direct access connection relationship between the local device and the receiving end is successfully established if the response is successful, and send the information to the local device.

[0073] In some specific embodiments, the transmission sequence determination module 11 can specifically include:

[0074] The counting function adding module is configured to create an IO queue based on the remote memory direct access connection relationship and in a multi-thread mode, and add a counting function to the IO queue;

[0075] The transmission order determining module is configured to acquire the commands to be transmitted, send the commands to the IO queue, and determine the transmission order of the commands according to the counting function.

[0076] In some specific embodiments, the target command sending module 12 can specifically include:

[0077] The sending time recording module is configured to record the sending time, determine whether the time interval between the current time and the sending time is greater than a preset response threshold, and if the time interval between the current time and the sending time is greater than the preset response threshold, it is determined that the sending of each target command fails, and a command re-sending operation is performed.

[0078] In some specific embodiments, the target command sending module 12 can specifically include:

[0079] The return result generating module is configured to send each target command to a receiving end, so that the receiving end processes the target command after acquiring the target command, and generates a to-be-sent return result if all the target commands are successfully processed.

[0080] The return result determining module is configured to determine the transmission order corresponding to the last target command, add the transmission order corresponding to the last target command to the to-be-sent return result, and obtain a return result.

[0081] In some specific embodiments, the return result obtaining module 13 can specifically include:

[0082] The failed target command determining module is configured to determine the transmission order corresponding to the target command that fails in processing based on the return result if the return result is a failure.

[0083] The re-transmission module is configured to take the transmission order corresponding to the target command that fails in processing as the next transmission order to be transmitted, take the target command that fails in processing as the next target command to be transmitted, and then repeat the above operations until all the target commands are processed.

[0084] Figure 4A structural schematic diagram of an electronic device is provided in the embodiments of the present application. The electronic device 20 can specifically include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is configured to store a computer program, the computer program is loaded and executed by the processor 21 to implement the related steps in the command transmission method performed by the electronic device disclosed in any of the foregoing embodiments.

[0085] In the embodiments, the power supply 23 is configured to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited specifically herein; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited specifically herein.

[0086] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, and the resources stored thereon include an operating system 221, a computer program 222 and data 223, etc., and the storage mode can be temporary storage or permanent storage.

[0087] The operating system 221 is configured to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the processor 21 on the data 223 in the memory 22, and the operating system 221 can be Windows, Unix, Linux, etc. The computer program 222 can further include computer programs for completing other specific work in addition to the computer programs for completing the command transmission method performed by the electronic device 20 disclosed in any of the foregoing embodiments. The data 223 can include data transmitted by external devices received by the command transmission device, and can also include data collected by the input / output interface 25 itself, etc.

[0088] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of the two. The software module can 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 technical field.

[0089] Further, the embodiment of the present application further discloses a computer readable storage medium, the storage medium stores a computer program, the computer program is loaded and executed by a processor, and the steps of the command transmission method disclosed by any of the foregoing embodiments are implemented.

[0090] Finally, it should be noted that in this document, the terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0091] The above describes in detail the command transmission method, device, equipment and storage medium provided by the present application. The principles and implementation manners of the present application are described by applying specific examples in this document. The above description of the embodiments is only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range will be changed; in view of the above, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A command transmission method, characterized in that, Applied to the sending end, including: Obtain the commands to be transmitted and determine the transmission order; Each command is assigned a unique identifier according to the transmission order to obtain each target command. A target command group is formed by combining multiple consecutive target commands of a preset number and sent to the receiving end. After the receiving end obtains the target command group, it processes the target command group and generates a return result. The unique identifier is a CID, which is used to record the transmission order of the commands. The receiving end obtains the return result sent by the receiving end and parses the return result. If the return result is successful, then based on the unique identifier of the last target command in the target command group in the return result, a series of consecutive target commands starting from the next target command after the unique identifier of the target command form a next target command group and send it to the receiving end so that the receiving end can process the next target command group until all commands are processed. After parsing the returned result, the method further includes: if the returned result is a failure, then based on the unique identifier of the target command that failed to process in the returned result, a set number of consecutive target commands starting from that target command are formed into a retransmission target command group and resent to the receiving end.

2. The command transmission method according to claim 1, characterized in that, Before obtaining the command to be transmitted and determining the transmission order, the process also includes: Call the Internet Protocol address and perform network connectivity resolution on the Internet Protocol address. If the network is accessible, obtain the connection request, call the routing request, and parse the routing request based on the connection request. If the routing is normal, obtain the connection resource information. Invoke a connection command, and based on the connection command and the connection resource information, establish a direct remote memory access connection between the local machine and the receiving end.

3. The command transmission method according to claim 2, characterized in that, The invocation of the connection command, based on the connection command and utilizing the connection resource information, establishes a direct remote memory access connection between the local machine and the receiving end, including: A connection command is invoked and sent to the receiving end, so that the receiving end can respond to the connection command after receiving it. If the response is successful, information is generated to indicate that the remote memory direct access connection relationship between the local machine and the receiving end has been successfully established, and the information is sent to the local machine.

4. The command transmission method according to claim 2, characterized in that, The step of acquiring the command to be transmitted and determining the transmission order includes: Based on the remote memory direct access connection relationship, an IO queue is created using a multi-threaded approach, and a counting function is added to the IO queue; The command to be transmitted is obtained, the command is sent to the IO queue, and the transmission order of the command is determined according to the counting function.

5. The command transmission method according to claim 1, characterized in that, After sending a target command group consisting of a predetermined number of consecutive target commands to the receiving end, the method further includes: Record the sending time, determine whether the time interval between the current time and the sending time is greater than a preset response threshold, and if the time interval between the current time and the sending time is greater than the preset response threshold, then the sending of each target command is assumed to have failed, and the command resending operation is executed.

6. The command transmission method according to claim 1, characterized in that, The step of sending a target command group, consisting of a predetermined number of consecutive target commands, to the receiving end allows the receiving end to process the target command group and generate a return result, including: Each of the target command groups is sent to the receiving end so that the receiving end can process the target command group after obtaining it. If all the target commands in the target command group are processed successfully, a return result to be sent is generated. The transmission order corresponding to the last target command is determined, and the transmission order corresponding to the last target command is added to the return result to be sent to obtain the return result.

7. A command transmission device, characterized in that, include: The transmission order determination module is used to acquire the commands to be transmitted and determine the transmission order. The target command sending module is used to add a unique identifier to each of the commands according to the transmission order to obtain each target command, and to send a target command group consisting of a preset number of consecutive target commands to the receiving end, so that the receiving end can process the target command group after obtaining it and generate a return result. The unique identifier, CID, is used to record the transmission order of commands; The return result acquisition module is used to acquire the return result sent by the receiving end and parse the return result. If the return result is successful, then based on the unique identifier of the last target command in the target command group in the return result, a series of consecutive target commands starting from the next target command after the unique identifier of the target command form a next target command group and send it to the receiving end so that the receiving end can process the next target command group until all commands are processed. After parsing the returned result, the method further includes: if the returned result is a failure, then based on the unique identifier of the target command that failed to process in the returned result, a set number of consecutive target commands starting from that target command are formed into a retransmission target command group and resent to the receiving end.

8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the command transmission method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the command transmission method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Inter memory double-controller scsi command synchronization mechanism

    CN105183568A

  • Command processing method and device

    CN111522511A

  • Self-calibration method, self-calibration device, readable storage medium and electronic equipment

    CN112526972A