CN113641604B - Data transmission method and system - Google Patents

Data transmission method and system Download PDF

Info

Publication number
CN113641604B
CN113641604B CN202110808876.9A CN202110808876A CN113641604B CN 113641604 B CN113641604 B CN 113641604B CN 202110808876 A CN202110808876 A CN 202110808876A CN 113641604 B CN113641604 B CN 113641604B
Authority
CN
China
Prior art keywords
server
client
memory blocks
data
available memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110808876.9A
Other languages
Chinese (zh)
Other versions
CN113641604A (en
Inventor
马龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202110808876.9A priority Critical patent/CN113641604B/en
Publication of CN113641604A publication Critical patent/CN113641604A/en
Application granted granted Critical
Publication of CN113641604B publication Critical patent/CN113641604B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal

Abstract

The invention discloses a data transmission method and a system, wherein the method comprises the following steps: generating a memory space at a server side, and acquiring the head address of an available memory block of a client side and the number of the available memory blocks based on the memory space; judging the length of data to be transmitted by a client, writing data into a memory space based on a judging result, respectively updating the head addresses of the available memory blocks and the number of the available memory blocks of the client and the memory space, and sending a writing completion signal; after receiving the writing completion signal, the server side reads data from the memory space, and after finishing data reading, updates the head address of the available memory blocks in the memory space, the number of the available memory blocks and sends a reading completion signal again; after receiving the reading completion signal, the client updates the head address of the available memory block and the number of the available memory blocks of the client again. By the scheme of the invention, the processing efficiency of the writing thread is improved, repeated application and release of system resources are greatly reduced, and occupied memory is reduced.

Description

Data transmission method and system
Technical Field
The present invention relates to the field of data transmission, and in particular, to a data transmission method and system.
Background
RDMA (Remote Direct Memory Access) technology can directly transfer data into the memory area of a computer through a network, thereby eliminating external memory copying and text exchange operations, freeing up memory bandwidth and CPU cycles, and effectively improving the performance of an application system. RDMA has three data transfer modes: a transmit/receive mode, a write mode, and a read mode. Every time data is transmitted through RDMA, a new memory space is occupied, so that the RDMA occupies large memory, and the processing speed of the data is reduced.
Disclosure of Invention
In view of this, the invention provides a data transmission method and system, which solve the problems of large occupied memory and slow data processing speed when writing and transmitting data based on RDMA, and complete continuous data transmission by repeatedly using a limited memory block, thereby improving the processing efficiency of a writing thread, greatly reducing repeated application and release of system resources and reducing occupied memory.
Based on the above objects, an aspect of the embodiments of the present invention provides a data transmission method, which specifically includes the following steps:
responding to the establishment of network communication connection between a client and a server, generating a memory space comprising a preset number of memory blocks with equal length at the server, and acquiring the head address of the available memory blocks of the client and the number of the available memory blocks based on attribute information of the memory space;
responding to the writing request received by the client to the server, judging the length of data to be transmitted by the client, writing the data into the memory space of the server based on the judging result, respectively updating the head addresses of the available memory blocks and the number of the available memory blocks of the memory spaces of the client and the server, and sending a writing completion signal to the server after the data writing is completed;
responding to the write-in completion signal sent by the client side received by the server side, reading the data from the memory space, and after the data reading is completed, updating the head address of the available memory blocks of the memory space of the server side, the number of the available memory blocks and sending a read completion signal to the client side again;
and in response to the client receiving the reading completion signal sent by the server, updating the head address of the available memory block of the client and the number of the available memory blocks again.
In some embodiments, the responding to the client establishing the network communication connection with the server comprises:
a network communication connection is established between the client and the server in response to RDMA-based. In some embodiments, determining, by the client, a length of data to be transmitted includes:
and judging whether the length of the data to be transmitted is smaller than or equal to the number of available memory blocks of the client and the length of the memory blocks by the client.
In some embodiments, writing the data to the memory space of the server based on the determination result includes:
if the length of the data to be transmitted is smaller than or equal to the number of available memory blocks of the client multiplied by the length of the memory blocks, writing the data into n memory blocks in the memory space of the server, wherein n is the minimum positive integer which enables the length of the data to be smaller than or equal to n multiplied by the length of the memory blocks;
if the length of the data to be transmitted is larger than the number of the available memory blocks of the client side multiplied by the length of the memory blocks, writing the data with the number of the available memory blocks multiplied by the length of the memory blocks into the memory space of the server side, and waiting for the next data transmission of the rest data.
In some embodiments, updating the head addresses of the available memory blocks and the number of the available memory blocks in the memory spaces of the client and the server, respectively, includes:
updating the head addresses of available memory blocks of the memory spaces of the client and the server to the addresses of the n plus 1 memory block of the memory space;
and updating the number of the available memory blocks of the memory spaces of the client and the server to be the number of the available memory blocks of the memory space minus n.
In some embodiments, after the data transmission is completed, sending a write completion signal to the server, including:
after the data transmission is completed, receiving a signal that the data sent by the completion queue is successfully written into the server;
and sending a writing completion signal to the server according to the received signal of successfully writing the data into the server.
In some embodiments, updating the head address of the available memory block and the number of the available memory blocks in the memory space of the server again includes:
updating the first address of the available memory block of the memory space of the server to the address of the first memory block of the memory space;
and updating the number of the available memory blocks of the memory space of the server to be the number of the updated available memory blocks of the memory space plus n.
In some embodiments, updating the first address of the available memory block and the number of available memory blocks of the next data transmission of the client again includes:
and updating the head address of the available memory block and the number of the available memory blocks of the next data transmission of the client to the head address of the available memory block and the number of the available memory blocks of the memory space of the server after the updating again.
In some embodiments, the method further comprises:
and returning to the step of judging the length of the data to be transmitted by the client in response to the write request received by the client to the server, writing the data into the memory space of the server based on the judging result, respectively updating the head addresses of the available memory blocks and the number of the available memory blocks of the memory spaces of the client and the server, and sending a write completion signal to the server after the data writing is completed.
According to another aspect of the embodiment of the present invention, there is also provided a data transmission system, including:
the generation module is configured to respond to the establishment of network communication connection between the client and the server, generate a memory space comprising a preset number of memory blocks with equal length at the server, and acquire the head address of the available memory blocks of the client and the number of the available memory blocks based on attribute information of the memory space;
the writing module is configured to respond to a writing request received by the client to the server, judge the length of data to be transmitted by the client, write the data into the memory space of the server based on a judging result, respectively update the head addresses of available memory blocks and the number of the available memory blocks of the memory spaces of the client and the server, and send a writing completion signal to the server after the data writing is completed;
the read module is configured to respond to the write-in completion signal sent by the client side and receive the data from the memory space, and after the data is read, update the head address of the available memory blocks in the memory space of the server side, the number of the available memory blocks and send a read completion signal to the client side again;
and the updating module is configured to respond to the reading completion signal sent by the server side received by the client side and update the head address of the available memory blocks and the number of the available memory blocks of the client side again.
In some embodiments, the responding to the client establishing the network communication connection with the server comprises:
a network communication connection is established between the client and the server in response to RDMA-based.
In some embodiments, determining, by the client, a length of data to be transmitted includes:
and judging whether the length of the data to be transmitted is smaller than or equal to the number of available memory blocks of the client and the length of the memory blocks by the client.
In some embodiments, writing the data to the memory space of the server based on the determination result includes:
if the length of the data to be transmitted is smaller than or equal to the number of available memory blocks of the client multiplied by the length of the memory blocks, writing the data into n memory blocks in the memory space of the server, wherein n is the minimum positive integer which enables the length of the data to be smaller than or equal to n multiplied by the length of the memory blocks;
if the length of the data to be transmitted is larger than the number of the available memory blocks of the client side multiplied by the length of the memory blocks, writing the data with the number of the available memory blocks multiplied by the length of the memory blocks into the memory space of the server side, and waiting for the next data transmission of the rest data.
In some embodiments, updating the head addresses of the available memory blocks and the number of the available memory blocks in the memory spaces of the client and the server, respectively, includes:
updating the head addresses of available memory blocks of the memory spaces of the client and the server to the addresses of the n plus 1 memory block of the memory space;
and updating the number of the available memory blocks of the memory spaces of the client and the server to be the number of the available memory blocks of the memory space minus n.
In some embodiments, after the data transmission is completed, sending a write completion signal to the server, including:
after the data transmission is completed, receiving a signal that the data sent by the completion queue is successfully written into the server;
and sending a writing completion signal to the server according to the received signal of successfully writing the data into the server.
In some embodiments, updating the head address of the available memory block and the number of the available memory blocks in the memory space of the server again includes:
updating the first address of the available memory block of the memory space of the server to the address of the first memory block of the memory space;
and updating the number of the available memory blocks of the memory space of the server to be the number of the updated available memory blocks of the memory space plus n.
In some embodiments, updating the first address of the available memory block and the number of available memory blocks of the next data transmission of the client again includes:
and updating the head address of the available memory block and the number of the available memory blocks of the next data transmission of the client to the head address of the available memory block and the number of the available memory blocks of the memory space of the server after the updating again.
In some embodiments, the system further comprises:
and the return module is configured to respond to the data writing transmission again, return the step of judging the length of the data to be transmitted by the client in response to the writing request received by the client to the server, writing the data into the memory space of the server based on the judging result, respectively updating the head addresses of the available memory blocks and the number of the available memory blocks in the memory space of the client and the server, and sending a writing completion signal to the server after the data writing is completed.
The invention has the following beneficial technical effects: the data continuous transmission is completed by repeatedly using a limited memory block, so that the processing efficiency of a write thread is improved, the repeated application and release of system resources are greatly reduced, and the occupied memory is reduced.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block diagram of an embodiment of a data transmission method according to the present invention;
fig. 2 is a schematic diagram of an embodiment of a data transmission system according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention will be described in further detail with reference to the accompanying drawings.
It should be noted that, in the embodiments of the present invention, all the expressions "first" and "second" are used to distinguish two entities with the same name but different entities or different parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present invention, and the following embodiments are not described one by one.
Based on the above object, a first aspect of the embodiments of the present invention proposes an embodiment of a data transmission method. As shown in fig. 1, it includes the steps of:
step S101, a network communication connection is established between a client and a server, a memory space comprising a preset number of memory blocks with equal length is generated at the server, and the head address of the available memory blocks of the client and the number of the available memory blocks are obtained based on attribute information of the memory space;
step S103, responding to the writing request received by the client to the server, judging the length of data to be transmitted by the client, writing the data into the memory space of the server based on the judging result, respectively updating the head addresses of the available memory blocks and the number of the available memory blocks in the memory space of the client and the server, and sending a writing completion signal to the server after the data writing is completed;
step 105, responding to the write-in completion signal sent by the client side received by the server side, reading the data from the memory space, and after the data reading is completed, updating the head address of the available memory blocks in the memory space of the server side, the number of the available memory blocks and sending a read completion signal to the client side again;
step S107, in response to the client receiving the read completion signal sent by the server, the head address of the available memory block and the number of the available memory blocks of the client are updated again.
Specifically, in response to the establishment of network communication connection between the client and the server, allocating N blocks of continuous memory spaces with equal length L at the server, and transmitting the first memory address addr of the memory space and the number N of the memory blocks to the client; after receiving addr and N values sent by a server, a client updates a head address Dest of an available memory block of the client and the number AvailableNum of the available memory blocks; in response to a write request received by a client to a server, when the client starts to write data transmission to the server, the client judges the length of the data to be transmitted, writes the data into the memory space of the server based on the judging result, respectively updates the head addresses of available memory blocks of the client and the server and the number of the available memory blocks, wherein the head addresses of the updated available memory blocks of the client and the server are the head addresses of the available memory blocks of the next server, the number of the updated available memory blocks of the client and the server is equal to the number of the data to be transmitted, and sends a write completion signal to the server after the data writing is completed; responding to a write-in completion signal sent by a client side, reading data from a memory space, updating the head address of an available memory block of the server side and the number of the available memory blocks again after the data is read, and sending a read-in completion signal to the client side, wherein the head address of the available memory block of the server side is the address of the head memory block of the memory space, and the number of the available memory blocks is all the memory blocks of the memory space; and in response to the client receiving the reading completion signal sent by the server, updating the head address of the available memory block and the number of the available memory blocks of the client into the head address of the available memory block and the number of the available memory block of the memory space of the server at the moment again.
According to the scheme provided by the invention, the data continuous transmission is completed by repeatedly using a limited memory block, so that the processing efficiency of a write thread is improved, the repeated application and release of system resources are greatly reduced, and the occupied memory is reduced.
In some embodiments, the responding to the client establishing the network communication connection with the server comprises:
a network communication connection is established between the client and the server in response to RDMA-based.
In some embodiments, determining, by the client, a length of data to be transmitted includes:
and judging whether the length of the data to be transmitted is smaller than or equal to the number of available memory blocks of the client and the length of the memory blocks by the client.
Specifically, the length Len of data to be transmitted each time is max avilablenum.
In some embodiments, writing the data to the memory space of the server based on the determination result includes:
if the length of the data to be transmitted is smaller than or equal to the number of available memory blocks of the client multiplied by the length of the memory blocks, writing the data into n memory blocks in the memory space of the server, wherein n is the minimum positive integer which enables the length of the data to be smaller than or equal to n multiplied by the length of the memory blocks;
if the length of the data to be transmitted is larger than the number of the available memory blocks of the client side multiplied by the length of the memory blocks, writing the data with the number of the available memory blocks multiplied by the length of the memory blocks into the memory space of the server side, and waiting for the next data transmission of the rest data.
In some embodiments, updating the head addresses of the available memory blocks and the number of the available memory blocks in the memory spaces of the client and the server, respectively, includes:
updating the head addresses of available memory blocks of the memory spaces of the client and the server to the addresses of the n plus 1 memory block of the memory space;
and updating the number of the available memory blocks of the memory spaces of the client and the server to be the number of the available memory blocks of the memory space minus n.
Specifically, according to various embodiments of the present invention, if the length Len of data to be transmitted is equal to or less than AvailableNum (the number of available memory blocks multiplied by the length of the memory blocks), data is written into n consecutive memory blocks starting from addr at the far end, where n is the smallest positive integer that makes Len equal to or less than n×l, the head address of the available memory block of the update client is the address of the n+1th memory block of the memory space of the server, and the number of available memory blocks of the memory space of the update server is AvailableNum (availablenum=availablenum-n).
In some embodiments, after the data transmission is completed, sending a write completion signal to the server, including:
after the data transmission is completed, receiving a signal that the data sent by the completion queue is successfully written into the server;
and sending a writing completion signal to the server according to the received signal of successfully writing the data into the server.
Specifically, when the client side successfully performs the write data transmission based on the RDMA protocol and receives n blocks of data from the completion queue CQ to be successfully written into the server side, the server side is notified that the data writing of n memory blocks has been completed through the send/receive of the RDMA protocol.
In some embodiments, updating the head address of the available memory block and the number of the available memory blocks in the memory space of the server again includes:
updating the first address of the available memory block of the memory space of the server to the address of the first memory block of the memory space;
and updating the number of the available memory blocks of the memory space of the server to be the number of the updated available memory blocks of the memory space plus n.
In some embodiments, updating the first address of the available memory block and the number of available memory blocks of the next data transmission of the client again includes:
and updating the head address of the available memory block and the number of the available memory blocks of the next data transmission of the client to the head address of the available memory block and the number of the available memory blocks of the memory space of the server after the updating again.
In some embodiments, the method further comprises:
and returning to the step of judging the length of the data to be transmitted by the client in response to the write request received by the client to the server, writing the data into the memory space of the server based on the judging result, respectively updating the head addresses of the available memory blocks and the number of the available memory blocks of the memory spaces of the client and the server, and sending a write completion signal to the server after the data writing is completed.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 2, an embodiment of the present invention further provides a data transmission system, including:
the generating module 110 is configured to respond to the establishment of network communication connection between a client and a server, generate a memory space comprising a preset number of memory blocks with equal length at the server, and acquire a head address of an available memory block of the client and the number of the available memory blocks based on attribute information of the memory space;
the writing module 120 is configured to respond to a writing request received by the client to the server, judge the length of data to be transmitted by the client, write the data into the memory space of the server based on the judging result, respectively update the head addresses of the available memory blocks and the number of the available memory blocks in the memory space of the client and the server, and send a writing completion signal to the server after the data writing is completed;
a reading module 130, where the reading module 130 is configured to respond to the write completion signal sent by the client received by the server, read the data from the memory space, and after the data is read, update the head address of the available memory blocks in the memory space of the server, the number of the available memory blocks, and send a read completion signal to the client again;
and the updating module 140 is configured to update the head address of the available memory block and the number of the available memory blocks of the client again in response to the client receiving the read completion signal sent by the server.
In some embodiments, the responding to the client establishing the network communication connection with the server comprises:
a network communication connection is established between the client and the server in response to RDMA-based.
In some embodiments, determining, by the client, a length of data to be transmitted includes:
and judging whether the length of the data to be transmitted is smaller than or equal to the number of available memory blocks of the client and the length of the memory blocks by the client.
In some embodiments, writing the data to the memory space of the server based on the determination result includes:
if the length of the data to be transmitted is smaller than or equal to the number of available memory blocks of the client multiplied by the length of the memory blocks, writing the data into n memory blocks in the memory space of the server, wherein n is the minimum positive integer which enables the length of the data to be smaller than or equal to n multiplied by the length of the memory blocks;
if the length of the data to be transmitted is larger than the number of the available memory blocks of the client side multiplied by the length of the memory blocks, writing the data with the number of the available memory blocks multiplied by the length of the memory blocks into the memory space of the server side, and waiting for the next data transmission of the rest data.
In some embodiments, updating the head addresses of the available memory blocks and the number of the available memory blocks in the memory spaces of the client and the server, respectively, includes:
updating the head addresses of available memory blocks of the memory spaces of the client and the server to the addresses of the n plus 1 memory block of the memory space;
and updating the number of the available memory blocks of the memory spaces of the client and the server to be the number of the available memory blocks of the memory space minus n.
In some embodiments, after the data transmission is completed, sending a write completion signal to the server, including:
after the data transmission is completed, receiving a signal that the data sent by the completion queue is successfully written into the server;
and sending a writing completion signal to the server according to the received signal of successfully writing the data into the server.
In some embodiments, updating the head address of the available memory block and the number of the available memory blocks in the memory space of the server again includes:
updating the first address of the available memory block of the memory space of the server to the address of the first memory block of the memory space;
and updating the number of the available memory blocks of the memory space of the server to be the number of the updated available memory blocks of the memory space plus n.
In some embodiments, updating the first address of the available memory block and the number of available memory blocks of the next data transmission of the client again includes:
and updating the head address of the available memory block and the number of the available memory blocks of the next data transmission of the client to the head address of the available memory block and the number of the available memory blocks of the memory space of the server after the updating again.
In some embodiments, the system further comprises:
and the return module is configured to respond to the data writing transmission again, return the step of judging the length of the data to be transmitted by the client in response to the writing request received by the client to the server, writing the data into the memory space of the server based on the judging result, respectively updating the head addresses of the available memory blocks and the number of the available memory blocks in the memory space of the client and the server, and sending a writing completion signal to the server after the data writing is completed.
Based on the same inventive concept, according to another aspect of the present invention, there is also provided a computer device, including a processor and a memory, in which a computer program is stored which can be run on the processor, the processor executing the steps of the method as above.
Based on the same inventive concept, according to another aspect of the present invention, there is also provided a computer-readable storage medium storing a computer program which when executed by a processor performs the above method.
Finally, it should be noted that, as will be appreciated by those skilled in the art, all or part of the procedures in implementing the methods of the embodiments described above may be implemented by a computer program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, and the program may include the procedures of the embodiments of the methods described above when executed. The storage medium of the program may be a magnetic disk, an optical disk, a read-only memory (ROM), a random-access memory (RAM), or the like. The computer program embodiments described above may achieve the same or similar effects as any of the method embodiments described above.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The foregoing embodiment of the present invention has been disclosed with reference to the number of embodiments for the purpose of description only, and does not represent the advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will appreciate that: the above discussion of any embodiment is merely exemplary and is not intended to imply that the scope of the disclosure of embodiments of the invention, including the claims, is limited to such examples; combinations of features of the above embodiments or in different embodiments are also possible within the idea of an embodiment of the invention, and many other variations of the different aspects of the embodiments of the invention as described above exist, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. of the embodiments should be included in the protection scope of the embodiments of the present invention.

Claims (10)

1. A data transmission method, comprising:
responding to the establishment of network communication connection between a client and a server, generating a memory space comprising a preset number of memory blocks with equal length at the server, and acquiring the head address of the available memory blocks of the client and the number of the available memory blocks based on attribute information of the memory space;
responding to the writing request received by the client to the server, judging the length of data to be transmitted by the client, writing the data into the memory space of the server based on the judging result, respectively updating the head addresses of the available memory blocks and the number of the available memory blocks of the memory spaces of the client and the server, and sending a writing completion signal to the server after the data writing is completed;
responding to the write-in completion signal sent by the client side received by the server side, reading the data from the memory space, and after the data reading is completed, updating the head address of the available memory blocks of the memory space of the server side, the number of the available memory blocks and sending a read completion signal to the client side again;
and in response to the client receiving the reading completion signal sent by the server, updating the head address of the available memory block of the client and the number of the available memory blocks again.
2. The method of claim 1, wherein responding to the client establishing a network communication connection with the server comprises:
a network communication connection is established between the client and the server in response to RDMA-based.
3. The method of claim 1, wherein determining, by the client, the length of data to be transmitted comprises:
and judging whether the length of the data to be transmitted is smaller than or equal to the number of available memory blocks of the client and the length of the memory blocks by the client.
4. The method of claim 1, wherein writing the data to the memory space of the server based on the determination result comprises:
if the length of the data to be transmitted is smaller than or equal to the number of available memory blocks of the client multiplied by the length of the memory blocks, writing the data into n memory blocks in the memory space of the server, wherein n is the minimum positive integer which enables the length of the data to be smaller than or equal to n multiplied by the length of the memory blocks;
if the length of the data to be transmitted is larger than the number of the available memory blocks of the client side multiplied by the length of the memory blocks, writing the data with the number of the available memory blocks multiplied by the length of the memory blocks into the memory space of the server side, and waiting for the next data transmission of the rest data.
5. The method of claim 4, wherein updating the head addresses of the available memory blocks and the number of available memory blocks of the memory space of the client and the server, respectively, comprises:
updating the head addresses of available memory blocks of the memory spaces of the client and the server to the addresses of the n plus 1 memory block of the memory space;
and updating the number of the available memory blocks of the memory spaces of the client and the server to be the number of the available memory blocks of the memory space minus n.
6. The method of claim 1, wherein after the data transmission is completed, sending a write completion signal to the server comprises:
after the data transmission is completed, receiving a signal that the data sent by the completion queue is successfully written into the server;
and sending a writing completion signal to the server according to the received signal of successfully writing the data into the server.
7. The method of claim 4, wherein updating the head address of the available memory block of the memory space of the server and the number of available memory blocks again comprises:
updating the first address of the available memory block of the memory space of the server to the address of the first memory block of the memory space;
and updating the number of the available memory blocks of the memory space of the server to be the number of the updated available memory blocks of the memory space plus n.
8. The method of claim 1, wherein updating the head address of the available memory block and the number of available memory blocks for the next data transmission by the client comprises:
and updating the head address of the available memory block and the number of the available memory blocks of the next data transmission of the client to the head address of the available memory block and the number of the available memory blocks of the memory space of the server after the updating again.
9. The method as recited in claim 1, further comprising:
and returning to the step of judging the length of the data to be transmitted by the client in response to the write request received by the client to the server, writing the data into the memory space of the server based on the judging result, respectively updating the head addresses of the available memory blocks and the number of the available memory blocks of the memory spaces of the client and the server, and sending a write completion signal to the server after the data writing is completed.
10. A data transmission system, comprising:
the generation module is configured to respond to the establishment of network communication connection between the client and the server, generate a memory space comprising a preset number of memory blocks with equal length at the server, and acquire the head address of the available memory blocks of the client and the number of the available memory blocks based on attribute information of the memory space;
the writing module is configured to respond to a writing request received by the client to the server, judge the length of data to be transmitted by the client, write the data into the memory space of the server based on a judging result, respectively update the head addresses of available memory blocks and the number of the available memory blocks of the memory spaces of the client and the server, and send a writing completion signal to the server after the data writing is completed;
the read module is configured to respond to the write-in completion signal sent by the client side and receive the data from the memory space, and after the data is read, update the head address of the available memory blocks in the memory space of the server side, the number of the available memory blocks and send a read completion signal to the client side again;
and the updating module is configured to respond to the reading completion signal sent by the server side received by the client side and update the head address of the available memory blocks and the number of the available memory blocks of the client side again.
CN202110808876.9A 2021-07-16 2021-07-16 Data transmission method and system Active CN113641604B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110808876.9A CN113641604B (en) 2021-07-16 2021-07-16 Data transmission method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110808876.9A CN113641604B (en) 2021-07-16 2021-07-16 Data transmission method and system

Publications (2)

Publication Number Publication Date
CN113641604A CN113641604A (en) 2021-11-12
CN113641604B true CN113641604B (en) 2024-02-02

Family

ID=78417753

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110808876.9A Active CN113641604B (en) 2021-07-16 2021-07-16 Data transmission method and system

Country Status (1)

Country Link
CN (1) CN113641604B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117215995B (en) * 2023-11-08 2024-02-06 苏州元脑智能科技有限公司 Remote direct memory access method, distributed storage system and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016122607A1 (en) * 2015-01-30 2016-08-04 Hewlett Packard Enterprise Development Lp Dedicated memory server
CN106210041A (en) * 2016-07-05 2016-12-07 杭州华为数字技术有限公司 A kind of method for writing data and server end network interface card
CN106657365A (en) * 2016-12-30 2017-05-10 清华大学 High concurrent data transmission method based on RDMA (Remote Direct Memory Access)
CN107463447A (en) * 2017-08-21 2017-12-12 中国人民解放军国防科技大学 B + tree management method based on remote direct nonvolatile memory access
CN110419034A (en) * 2017-04-14 2019-11-05 华为技术有限公司 A kind of data access method and device
CN110650182A (en) * 2019-08-30 2020-01-03 深圳壹账通智能科技有限公司 Network caching method and device, computer equipment and storage medium
CN112667416A (en) * 2020-12-25 2021-04-16 华中科技大学 RDMA (remote direct memory Access) -based communication method of nonvolatile memory system and server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10613992B2 (en) * 2018-03-13 2020-04-07 Tsinghua University Systems and methods for remote procedure call

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016122607A1 (en) * 2015-01-30 2016-08-04 Hewlett Packard Enterprise Development Lp Dedicated memory server
CN106210041A (en) * 2016-07-05 2016-12-07 杭州华为数字技术有限公司 A kind of method for writing data and server end network interface card
CN106657365A (en) * 2016-12-30 2017-05-10 清华大学 High concurrent data transmission method based on RDMA (Remote Direct Memory Access)
CN110419034A (en) * 2017-04-14 2019-11-05 华为技术有限公司 A kind of data access method and device
CN107463447A (en) * 2017-08-21 2017-12-12 中国人民解放军国防科技大学 B + tree management method based on remote direct nonvolatile memory access
CN110650182A (en) * 2019-08-30 2020-01-03 深圳壹账通智能科技有限公司 Network caching method and device, computer equipment and storage medium
CN112667416A (en) * 2020-12-25 2021-04-16 华中科技大学 RDMA (remote direct memory Access) -based communication method of nonvolatile memory system and server

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
RF-RPC: Remote Fetching RPC Paradigm for RDMA-Enabled Network;Yongwei Wu;《RF-RPC: Remote Fetching RPC Paradigm for RDMA-Enabled Network》;全文 *
一种基于Radix树的数据库前端缓存;熊慕舟;;华中科技大学学报(自然科学版)(第S2期);全文 *
在云间可重构的分布式存储;崔忠强;左德承;张展;;系统工程理论与实践(第S2期);全文 *
基于RDMA的RapidIO用户态通信接口实现;冀映辉;张建东;蔡炜;蔡惠智;;计算机科学(第06期);全文 *

Also Published As

Publication number Publication date
CN113641604A (en) 2021-11-12

Similar Documents

Publication Publication Date Title
US9832275B2 (en) Message processing method, device and system for internet of things
US10116746B2 (en) Data storage method and network interface card
EP3547715A1 (en) Method and apparatus for reducing continuous-wakeup delay of bluetooth loudspeaker, and bluetooth loudspeaker
JP2009516273A (en) Data synchronization processing method, client, server, and data synchronization system between client and server
JP4452690B2 (en) Electronic device, control method thereof, host device and control method thereof
CN107992271B (en) Data pre-reading method, device, equipment and computer readable storage medium
CN113641604B (en) Data transmission method and system
WO2017032152A1 (en) Method for writing data into storage device and storage device
CN113157465B (en) Message sending method and device based on pointer linked list
CN113596010B (en) Data processing method, device, node equipment and computer storage medium
CN116204487A (en) Remote data access method and device
CN114500633A (en) Data forwarding method, related device, program product and data transmission system
CN113238856B (en) RDMA-based memory management method and device
CN107579929B (en) Method, system and related device for setting reliable connection communication queue pair
CN111400213B (en) Method, device and system for transmitting data
CN111404842B (en) Data transmission method, device and computer storage medium
CN107241788A (en) The power consumption control method and device of wearable device
CN114615355B (en) Message processing method and message analysis module
CN110740138A (en) Data transmission method and device
CN113347115B (en) Message processing method and device, electronic equipment and medium
CN115495406A (en) Message transmission method, device, equipment and storage medium based on PCIe
CN111163100B (en) Data structure, communication method, device, storage medium and equipment
CN111930510A (en) Electronic device and data processing method
CN106776815B (en) RDMA friendly SPARQ L query method based on multi-mode switching
CN107241404B (en) Method, device and system for receiving and transmitting messages

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant