US-12625644-B2 - Method and apparatus for transferring data, heterogeneous platform, device, and medium
Abstract
A method for transferring data includes: storing to-be-transferred data to a self-mounted memory, uploading data information of the to-be-transferred data to a system on chip, so that the system on chip packages the data information through a network file system protocol to obtain a network file system protocol packet, obtaining the network file system protocol packet returned by the system on chip, and adding to-be-transferred data to the network file system protocol packet to obtain a target data packet; and sending the target data packet to a corresponding storage server.
Inventors
- Wei Liu
- Yaming Xu
- Wei Guo
- Ziwei Deng
- Can Zhang
Assignees
- IEIT SYSTEMS CO., LTD.
Dates
- Publication Date
- 20260512
- Application Date
- 20240228
- Priority Date
- 20230619
Claims (20)
- 1 . A method for transferring data, applied to a programmable logic device, comprising: storing to-be-transferred data to a self-mounted memory; uploading data information of the to-be-transferred data to a system on chip, so that the system on chip packages the data information through a network file system protocol to obtain a network file system protocol packet; obtaining the network file system protocol packet returned by the system on chip, and adding the to-be-transferred data to the network file system protocol packet to obtain a target data packet; and sending the target data packet to a corresponding storage server.
- 2 . The method for transferring data according to claim 1 , wherein the adding the to-be-transferred data to the network file system protocol packet to obtain a target data packet comprises: replacing the data information in the network file system protocol packet with the to-be-transferred data to obtain the target data packet.
- 3 . The method for transferring data according to claim 1 , wherein the uploading data information of the to-be-transferred data to a system on chip comprises: detecting a data volume of the to-be-transferred data in the memory; and in response to that the data volume reaches a preset threshold, uploading the data information of the to-be-transferred data to the system on chip.
- 4 . The method for transferring data according to claim 1 , wherein the uploading data information of the to-be-transferred data to a system on chip comprises: uploading a storage address and a data length of the to-be-transferred data in the memory to the system on chip, so that the system on chip packages the data information based on the storage address and the data length through the network file system protocol to obtain the network file system protocol packet.
- 5 . The method for transferring data according to claim 4 , wherein an address used by the system on chip when packaging is an address in a pre-requested internal memory, and the data information is filled in from that address.
- 6 . The method for transferring data according to claim 5 , wherein the address length of the pre-requested internal memory is consistent with that of the memory.
- 7 . The method for transferring data according to claim 6 , wherein the address used by the system on chip when packaging is an address corresponding to the storage address.
- 8 . The method for transferring data according to claim 1 , wherein the system on chip packages the data information in a user mode through the network file system protocol.
- 9 . The method for transferring data according to claim 1 , wherein the system on chip packages the data information in a user mode over a plurality of threads for a plurality of storage servers in parallel through the network file system protocol.
- 10 . The method for transferring data according to claim 1 , wherein the storing to-be-transferred data to a self-mounted memory comprises: parsing raw data based on a target protocol corresponding to the raw data to obtain the to-be-transferred data; and storing the to-be-transferred data to the self-mounted memory.
- 11 . The method for transferring data according to claim 10 , wherein the parsing raw data based on a target protocol corresponding to the raw data to obtain the to-be-transferred data comprises: recognizing the target protocol corresponding to the raw data; filtering a preset protocol processing logic corresponding to the target protocol from a plurality of preset protocol processing logics; and parsing the raw data based on the filtered preset protocol processing logic to obtain the to-be-transferred data.
- 12 . The method for transferring data according to claim 1 , wherein the uploading data information of the to-be-transferred data to a system on chip comprises: packaging the data information of the to-be-transferred data through a user datagram protocol to obtain a data information packet; and uploading the data information packet to the system on chip.
- 13 . The method for transferring data according to claim 1 , wherein the sending the target data packet to a corresponding storage server comprises: sending the target data packet to the corresponding storage server through an optical port.
- 14 . An electronic device, comprising a memory and a processor, wherein the memory is configured to store a computer program; and the processor is configured to execute the computer program to implement the method for transferring data according to claim 1 .
- 15 . A non-transitory computer-readable storage medium for storing a computer program that, when executed by a processor, implements the method for transferring data according to claim 1 .
- 16 . A method for transferring data, applied to a system on chip, comprising: obtaining data information of to-be-transferred data uploaded by a programmable logic device, wherein the to-be-transferred data is stored to a memory mounted on the programmable logic device; packaging the data information through a network file system protocol to obtain a network file system protocol packet; and returning the network file system protocol packet to the programmable logic device, so that the programmable logic device adds the to-be-transferred data to the network file system protocol packet to obtain a target data packet, and sends the target data packet to a corresponding storage server.
- 17 . The method for transferring data according to claim 16 , further comprising: requesting an internal memory, wherein the address length of the internal memory is consistent with that of the memory.
- 18 . The method for transferring data according to claim 17 , wherein the packaging the data information through a network file system protocol to obtain a network file system protocol packet comprises: packaging the data information based on an address in the internal memory through the network file system protocol to obtain the network file system protocol packet.
- 19 . The method for transferring data according to claim 16 , wherein the packaging the data information through a network file system protocol to obtain a network file system protocol packet comprises: packaging the data information in a user mode through the network file system protocol to obtain the network file system protocol packet.
- 20 . A heterogeneous platform, comprising a programmable logic device and a system on chip, wherein the programmable logic device comprises a first memory and a first processor, and the system on chip comprises a second memory and a second processor; and the first memory is configured to perform the method for transferring data, the method comprises: storing to-be-transferred data to a self-mounted memory; uploading data information of the to-be-transferred data to a system on chip, so that the system on chip packages the data information through a network file system protocol to obtain a network file system protocol packet; obtaining the network file system protocol packet returned by the system on chip, and adding the to-be-transferred data to the network file system protocol packet to obtain a target data packet; and sending the target data packet to a corresponding storage server; and the second processor is configured to perform the method for transferring data, the method comprises: obtaining data information of to-be-transferred data uploaded by a programmable logic device, wherein the to-be-transferred data is stored to a memory mounted on the programmable logic device; packaging the data information through a network file system protocol to obtain a network file system protocol packet; and returning the network file system protocol packet to the programmable logic device, so that the programmable logic device adds the to-be-transferred data to the network file system protocol packet to obtain a target data packet, and sends the target data packet to a corresponding storage server.
Description
CROSS-REFERENCE TO RELATED APPLICATION This disclosure claims the priority of the Chinese Patent application filed on Jun. 19, 2023 before the CNIPA, China National Intellectual Property Administration with the application number of 202310721744.1, and the title of “METHOD AND APPARATUS FOR TRANSFERRING DATA, HETEROGENEOUS PLATFORM, DEVICE, AND MEDIUM”, which is incorporated herein in its entirety by reference. FIELD The present disclosure relates to the technical field of storage and, more particularly, to a method and apparatus for transferring data, a heterogeneous platform, a device, and a medium. BACKGROUND In industrial and measurement scenarios, large-scale raw data usually need to be stored in a distributed server. These raw data usually have private protocols, while the distributed storage server usually employs a Network File System (NFS) protocol. As a result, devices that generate the raw data cannot directly store the data into the distributed storage server. At present, the usual practice is to transfer the data through a transfer device. The transfer device includes a Field Programmable Gate Array (FPGA) device, a transfer server, and a network card, wherein an application program of the transfer server needs to read data to the server, and then the data are written into a mounted directory through file programming, accompanied by mass data replication, system protocol stack calling, and other processing. These processes often require a lot of time and Central Processing Unit (CPU) resources. SUMMARY In view of this, the objective of the present disclosure is to provide a method and apparatus for transferring data, a heterogeneous platform, a device, and a medium, which may improve the efficiency of data transfer and reduce the consumption of CPU resources and hardware costs. Specific solutions are as follows: In a first aspect, the present disclosure discloses a method for transferring data, applied to a programmable logic device, including: storing to-be-transferred data to a self-mounted memory;uploading data information of the to-be-transferred data to a system on chip, so that the system on chip packages the data information through a network file system protocol to obtain a network file system protocol packet;obtaining the network file system protocol packet returned by the system on chip, and adding the to-be-transferred data to the network file system protocol packet to obtain a target data packet; andsending the target data packet to a corresponding storage server. In some embodiments, adding the to-be-transferred data to the network file system protocol packet to obtain a target data packet includes: replacing the data information in the network file system protocol packet with the to-be-transferred data to obtain the target data packet. In some embodiments, uploading data information of the to-be-transferred data to a system on chip includes: detecting a data volume of the to-be-transferred data in the memory; andin response to that the data volume reaches a preset threshold, uploading the data information of the to-be-transferred data to the system on chip. In some embodiments, uploading data information of the to-be-transferred data to a system on chip includes: uploading a storage address and a data length of the to-be-transferred data in the memory to the system on chip, so that the system on chip packages the data information based on the storage address and the data length through the network file system protocol to obtain the network file system protocol packet. In some embodiments, an address used by the system on chip when packaging is an address in a pre-requested internal memory, and the data information is filled in from that address. In some embodiments, the address length of the pre-requested internal memory is consistent with that of the memory. In some embodiments, the address used by the system on chip when packaging is an address corresponding to the storage address. In some embodiments, the system on chip packages the data information in a user mode through the network file system protocol. In some embodiments, the system on chip packages the data information in a user mode over a plurality of threads for a plurality of storage servers in parallel through the network file system protocol. In some embodiments, storing to-be-transferred data to a self-mounted memory includes: parsing raw data based on a target protocol corresponding to the raw data to obtain the to-be-transferred data; andstoring the to-be-transferred data to the self-mounted memory. In some embodiments, parsing raw data based on a target protocol corresponding to the raw data to obtain the to-be-transferred data includes: recognizing the target protocol corresponding to the raw data;filtering a preset protocol processing logic corresponding to the target protocol from a plurality of preset protocol processing logics; andparsing the raw data based on the filtered preset protocol processing logic to