File transfer method, electronic device and computer-readable storage medium

Through data block-level locking and copy operations between the DPU accelerator card and the host, the problem of low virtual machine image file transmission efficiency is solved, efficient data transmission is achieved, and memory resources are saved.

WO2024174892A1PCT designated stage expired Publication Date: 2024-08-29ZTE CORP
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/076258
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-23
Filing Date
2024-02-06
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

In the management offloading and IO offloading scenarios of the cloud platform, the transmission efficiency of virtual machine image files is low, resulting in increased memory overhead between the DPU accelerator card and the host, requiring double memory copies and page cache space.

Method used

By implementing data block-level locking and copying operations between the DPU accelerator card and the host, notification messages are used to coordinate the transmission of data blocks, avoiding the allocation of user-mode cache space and memory copying, and directly copying data between page caches.

Benefits of technology

It improves data transmission efficiency, saves memory resources, reduces memory copy operations, and improves overall performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024076258_29082024_PF_FP_ABST
    Figure CN2024076258_29082024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a file transfer method, an electronic device and a computer-readable storage medium. The file transfer method comprises: receiving a file upload request, and opening a file to be uploaded; locking the i-th data block in said file into a page cache of a DPU accelerator card, i being an integer greater than or equal to 1; sending a first notification message to a host, the first notification message being used for notifying the host to perform file upload; receiving an input-output virtual address corresponding to the i-th data block sent by the host, and, according to the input-output virtual address corresponding to the i-th data block and the block size of the i-th data block, copying the i-th data block locked in the page cache of the DPU accelerator card into a page cache of the host; when the i-th data block is the last data block in said file, closing said file; and sending a second notification message to the host, the second notification message being used for notifying the host to close a first target file.
Need to check novelty before this filing date? Find Prior Art

Description

File transmission method, electronic device, and computer-readable storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application No. 202310199039.X filed on February 23, 2023, the contents of which are incorporated herein by reference in their entirety. Technical Field

[0003] The embodiments of the present application relate to the field of communication technology, and in particular to a file transmission method, an electronic device, and a computer-readable storage medium. Background Art

[0004] In cloud platform scenarios where management and input / output (IO) offloads are performed by a Data Processing Unit (DPU) accelerator card, in order to fully utilize the server's local disk, it is necessary to support saving virtual machine image files on the server's host's local disk. A common practice is to encapsulate upload and download commands on the data channel between the host and the DPU accelerator card. However, since virtual machine image files are generally very large, ranging in size from a few gigabytes to hundreds of gigabytes, the relevant solutions for uploading or downloading virtual machine image files between the DPU accelerator card and the host require double memory consumption, including double page cache and double user cache space, which increases memory overhead. In addition, a memory copy is required, resulting in low data transmission efficiency.

[0005] Public content

[0006] In a first aspect, an embodiment of the present application provides a file transfer method, which is applied to a DPU accelerator card, including: receiving a file upload request, opening the file to be uploaded; locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card; i is an integer greater than or equal to 1; sending a first notification message to the host; the first notification message is used to notify the host to upload the file; receiving the input and output virtual addresses corresponding to the i-th data block sent by the host, and copying the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the input and output virtual addresses corresponding to the i-th data block and the block size of the i-th data block; when the i-th data block is the last data block in the file to be uploaded, closing the file to be uploaded; sending a second notification message to the host; the second notification message is used to notify the host to close the first target file.

[0007] In a second aspect, an embodiment of the present application provides a file transfer method, which is applied to a host, including: receiving a first notification message sent by a data processor DPU accelerator card; the first notification message is used to notify the host to upload a file; creating a first target file, expanding the storage space of the first target file on the local disk of the host, and locking the i-th data block to be uploaded in the first target file after the storage space is expanded in the page cache of the host; i is an integer greater than or equal to 1; translating the second physical address corresponding to the i-th data block to be uploaded into the input and output virtual address corresponding to the i-th data block to be uploaded, and sending the input and output virtual address corresponding to the i-th data block to be uploaded to the DPU accelerator card; when the i-th data block to be uploaded is the last data block to be uploaded, receiving a second notification message sent by the DPU accelerator card, and closing the target file; the second notification message is used to notify the host to close the target file.

[0008] In a third aspect, an embodiment of the present application provides a file transfer method, which is applied to a DPU accelerator card, including: receiving a file download request, creating a second target file; expanding the storage space of the second target file on the local disk of the DPU accelerator card, and locking the jth data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card; j is an integer greater than or equal to 1; sending a third notification message to the host; the third notification message is used to notify the host to download the file; receiving the input and output virtual addresses corresponding to the jth data block to be downloaded sent by the host, and copying the jth data block to be downloaded locked in the page cache of the host to the page cache of the DPU accelerator card according to the input and output virtual addresses corresponding to the jth data block to be downloaded and the block size of the jth data block to be downloaded; when the jth data block to be downloaded is the last data block to be downloaded, closing the second target file; sending a fourth notification message to the host; the fourth notification message is used to notify the host to close the file to be downloaded.

[0009] In a fourth aspect, an embodiment of the present application provides a file transfer method, which is applied to a host, including: receiving a third notification message sent by a data processor DPU accelerator card, opening the file to be downloaded; the third notification message is used to notify the host to download the file; locking the j-th data block in the file to be downloaded in the page cache of the host; j is an integer greater than or equal to 1; translating the fourth physical address corresponding to the j-th data block into the input and output virtual address corresponding to the j-th data block, and sending the input and output virtual address corresponding to the j-th data block to the DPU accelerator card; when the j-th data block is the last data block in the file to be downloaded, receiving a fourth notification message sent by the DPU accelerator card, and closing the file to be downloaded; the fourth notification message is used to notify the host to close the file to be downloaded.

[0010] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: at least one first processor; a first memory, wherein at least one first computer program is stored on the first memory, and when the at least one first computer program is executed by the at least one first processor, the following steps are implemented: receiving a file upload request, opening the file to be uploaded; locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card; i is an integer greater than or equal to 1; sending a first notification message to the host; the first notification message is used to notify the host to upload the file; receiving the input and output virtual address corresponding to the i-th data block sent by the host; the electronic device also includes: a first memory direct access DMA engine, configured to copy the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the input and output virtual address corresponding to the i-th data block and the block size of the i-th data block; when the at least one first computer program is executed by the at least one first processor, the following steps are also implemented: when the i-th data block is the last data block in the file to be uploaded, closing the file to be uploaded; sending a second notification message to the host; the second notification message is used to notify the host to close the first target file.

[0011] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: receiving a file upload request, opening the file to be uploaded; locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card; i is an integer greater than or equal to 1; sending a first notification message to the host; the first notification message is used to notify the host to upload the file; receiving the input and output virtual addresses corresponding to the i-th data block sent by the host; when the i-th data block is the last data block in the file to be uploaded, closing the file to be uploaded; sending a second notification message to the host; the second notification message is used to notify the host to close the first target file.

[0012] In a seventh aspect, an embodiment of the present application provides an electronic device, comprising: at least one second processor; a second memory, wherein at least one second computer program is stored on the second memory, and when the at least one second computer program is executed by the at least one second processor, the following steps are implemented: receiving a file download request, creating a second target file; expanding the storage space of the second target file on the local disk of the DPU accelerator card, and locking the jth data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card; j is an integer greater than or equal to 1; sending a third notification message to the host; the third notification message is used to notify the host to download the file; receiving the third notification message sent by the host The electronic device further comprises: a second memory direct access DMA engine, configured to copy the jth data block to be downloaded locked in the page cache of the host to the page cache of the DPU accelerator card according to the input and output virtual address corresponding to the jth data block to be downloaded and the block size of the jth data block to be downloaded; when the at least one second computer program is executed by the at least one second processor, the following steps are further implemented: when the jth data block to be downloaded is the last data block to be downloaded, closing the second target file; sending a fourth notification message to the host; the fourth notification message is used to notify the host to close the file to be downloaded.

[0013] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: receiving a file download request, creating a second target file; expanding the storage space of the second target file on the local disk of the DPU accelerator card, and locking the j-th data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card; j is an integer greater than or equal to 1; sending a third notification message to the host; the third notification message is used to notify the host to download the file; receiving the input and output virtual addresses corresponding to the j-th data block to be downloaded sent by the host; when the j-th data block to be downloaded is the last data block to be downloaded, closing the second target file; sending a fourth notification message to the host; the fourth notification message is used to notify the host to close the file to be downloaded.

[0014] In a ninth aspect, an embodiment of the present application provides an electronic device comprising: at least one third processor; and a third memory, wherein at least one third computer program is stored in the third memory, and when the at least one third computer program is executed by the at least one third processor, the above-mentioned file transfer method is implemented.

[0015] In a tenth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned file transfer method is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] FIG1 is a schematic diagram of an application scenario of transmitting a virtual machine image file between a host and a DPU accelerator card according to an embodiment of the present application;

[0017] FIG2 is a flowchart of a file transfer method applied to a DPU accelerator card according to an embodiment of the present application;

[0018] FIG3 is a flowchart of a file transfer method applied to a host according to an embodiment of the present application;

[0019] FIG4 is a flowchart of a file transmission method applied to a DPU accelerator card according to an embodiment of the present application;

[0020] FIG5 is a flowchart of a file transfer method applied to a host according to an embodiment of the present application;

[0021] FIG6 is a block diagram of an electronic device according to an embodiment of the present application;

[0022] FIG7 is a block diagram of an electronic device according to an embodiment of the present application;

[0023] FIG8 is a block diagram of the electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the technical solution of the present application, the file transmission method, electronic device, and computer-readable storage medium provided by the present application are described in detail below with reference to the accompanying drawings.

[0025] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms, and the present application should not be construed as limited to the embodiments set forth herein. These embodiments are provided to make this application more thorough and complete and to enable those skilled in the art to fully understand the scope of this application.

[0026] In the absence of conflict, the various embodiments of the present application and the various features therein may be combined with each other.

[0027] As used herein, the term "and / or" includes any and all combinations of at least one of the associated listed items.

[0028] The terms used herein are used only to describe specific embodiments and do not limit this application. As used herein, the singular forms "a", "an" and "the" also include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, it specifies the presence of the features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of at least one other feature, whole, step, operation, element, component and / or group thereof.

[0029] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this application, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined as such herein.

[0030] In some application scenarios, it is necessary to transfer virtual machine image files between the DPU accelerator card and the host. As shown in Figure 1, in a cloud platform scenario with management offload and IO offload, when the virtual disk of the virtual machine uses the virtual image on the host's local disk as backend storage, the virtual machine image file needs to be transferred between the host and the DPU accelerator card. When creating a virtual machine, the virtual machine image file needs to be uploaded from the control node to host 1 via the DPU accelerator card. When migrating a locally mirrored virtual machine, the virtual machine image file needs to be downloaded from host 1 to DPU accelerator card 1, then transferred from DPU accelerator card 1 to DPU accelerator card 2, and finally uploaded from DPU accelerator card 2 to host 2.

[0031] Although the file transfer method provided in the embodiment of the present application is proposed based on the problems existing in the uploading and downloading processes of virtual machine image files, the file transfer method provided in the embodiment of the present application is also applicable to other files that need to be transferred between the host and the DPU accelerator card.

[0032] FIG2 is a flowchart of a file transfer method applied to a DPU accelerator card provided in an embodiment of the present application.

[0033] In a first aspect, referring to FIG. 2 , an embodiment of the present application provides a file transfer method, which is applied to a DPU accelerator card and includes steps 200 to 203 .

[0034] Step 200: Receive a file upload request, open the file to be uploaded, and lock the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card; i is an integer greater than or equal to 1.

[0035] In some embodiments, the file to be uploaded is sliced ​​into at least two data blocks according to the maximum size of the data blocks that can be moved at one time. For example, if the maximum size of the data blocks that can be moved at one time is A, then the size of the i-th data block should be less than or equal to A.

[0036] In some embodiments, locking the i-th data block in the page cache of the DPU accelerator card means moving the i-th data block from the local disk of the DPU accelerator card to the page cache of the DPU accelerator card, and prohibiting the page cache of the DPU accelerator card and the local disk of the DPU accelerator card from exchanging.

[0037] In some embodiments, locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card includes: mapping the i-th data block to the user-state address space of the DPU accelerator card to obtain a first virtual address of the i-th data block in the user-state address space of the DPU accelerator card; translating the first virtual address into a first physical address of the memory of the DPU accelerator card; and locking the local disk space of the DPU accelerator card corresponding to the first physical address in the page cache of the DPU accelerator card.

[0038] In some implementations, the local disk space of the DPU accelerator card corresponding to the first physical address is the storage space of the i-th data block in the local disk of the DPU accelerator card.

[0039] In some implementations, the i-th data block may be mapped to the user-state address space of the DPU accelerator card through the mmap function to obtain a first virtual address of the i-th data block in the user-state address space of the DPU accelerator card.

[0040] In some implementations, the local disk space of the DPU accelerator card corresponding to the first physical address may be locked in the page cache of the DPU accelerator card through the get_user_pages function family.

[0041] Step 201: Send a first notification message to a host; the first notification message is used to notify the host to upload a file.

[0042] In some implementations, the first notification message includes at least: the name and size of the file to be uploaded.

[0043] Step 202: Receive the input / output virtual address (IOVA) corresponding to the i-th data block sent by the host, and copy the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host based on the IOVA corresponding to the i-th data block and the block size of the i-th data block.

[0044] In some embodiments, copying the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the IOVA corresponding to the i-th data block and the block size of the i-th data block includes: copying the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the first physical address, the IOVA corresponding to the i-th data block, and the block size of the i-th data block.

[0045] Step 203: When the i-th data block is the last data block in the file to be uploaded, close the file to be uploaded; and send a second notification message to the host; the second notification message is used to notify the host to close the first target file.

[0046] In some embodiments, the file transfer method further includes: when the i-th data block is not the last data block in the file to be uploaded, adding 1 to i and continuing to lock the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card.

[0047] The file transfer method applied to the DPU accelerator card provided in the embodiment of the present application locks the data blocks in the file to be uploaded into the page cache of the DPU accelerator card, and copies the data blocks in the page cache of the DPU accelerator card to the page cache of the host, thereby uploading the file to be uploaded from the DPU accelerator card to the host. During the upload process, there is no need to allocate user-state cache space, which saves memory resources and does not require memory copying, thereby improving data transmission efficiency.

[0048] FIG3 is a flowchart of a file transfer method applied to a host provided in an embodiment of the present application.

[0049] In a second aspect, referring to FIG. 3 , an embodiment of the present application provides a file transmission method, which is applied to a host and includes steps 300 to 303 .

[0050] Step 300: Receive a first notification message sent by a data processor (DPU) accelerator card; the first notification message is used to notify a host to upload a file.

[0051] In some implementations, the first notification message includes at least: the name and size of the file to be uploaded.

[0052] Step 301, create a first target file, expand the storage space of the first target file on the local disk of the host, and lock the i-th data block to be uploaded in the first target file after the storage space is expanded in the page cache of the host; i is an integer greater than or equal to 1.

[0053] In some embodiments, the storage space of the first target file on the host's local disk can be expanded to a storage space equal to the size of the file to be uploaded. Thus, each time i is incremented by 1, the process should begin with the step of locking the i-th data block to be uploaded in the host's page cache in the first target file after the expanded storage space.

[0054] In some embodiments, the storage space of the first target file on the host's local disk can be expanded based on the current storage space to the sum of the current storage space and the storage space of the i-th data block to be uploaded. Thus, each time i is incremented by 1, the process should begin again with the step of expanding the storage space of the first target file on the host's local disk.

[0055] In some implementations, the ftruncate function may be used to expand the storage space of the first target file on the local disk of the host.

[0056] In some embodiments, locking the i-th data block to be uploaded in the first target file after the storage space is expanded in the page cache of the host includes: mapping the i-th data block to be uploaded to the user-state address space of the host, obtaining a second virtual address of the i-th data block to be uploaded in the user-state address space of the host; translating the second virtual address into a second physical address of the host's memory; and locking the local disk space of the host corresponding to the second physical address in the page cache of the host.

[0057] In some implementations, the local disk space of the host corresponding to the second physical address is the storage space of the i-th data block to be uploaded in the local disk of the host.

[0058] In some embodiments, the i-th data block to be uploaded may be mapped to the user-mode address space of the host through the mmap function to obtain the second virtual address of the i-th data block to be uploaded in the user-mode address space of the host.

[0059] In some implementations, the local disk space of the host corresponding to the second physical address may be locked in the page cache of the host through the get_user_pages function family.

[0060] Step 302: Translate the second physical address corresponding to the i-th data block to be uploaded into the IOVA corresponding to the i-th data block to be uploaded, and send the IOVA corresponding to the i-th data block to be uploaded to the DPU accelerator card.

[0061] Step 303: When the i-th data block to be uploaded is the last data block to be uploaded, a second notification message sent by the DPU accelerator card is received, and the target file is closed; the second notification message is used to notify the host to close the target file.

[0062] In some embodiments, the file transfer method further includes: when the i-th data block to be uploaded is not the last data block to be uploaded, i is increased by 1, and the step of locking the i-th data block to be uploaded in the first target file after the storage space is expanded in the page cache of the host is continued.

[0063] In some embodiments, the file transfer method further includes: when the i-th data block to be uploaded is not the last data block to be uploaded, adding 1 to i and continuing to expand the storage space of the first target file on the local disk of the host.

[0064] The file transfer method applied to the host provided by the embodiment of the present application expands the storage space of the created first target file on the local disk of the host, locks the data blocks to be uploaded in the first target file after the storage space is expanded in the page cache of the host, and sends the input and output virtual addresses corresponding to the data blocks to be uploaded to the DPU accelerator card to upload the file to be uploaded from the DPU accelerator card to the host. During the upload process, there is no need to allocate user-state cache space, which saves memory resources and does not require memory copying, thereby improving data transmission efficiency.

[0065] FIG4 is a flowchart of a file transfer method applied to a DPU accelerator card provided in an embodiment of the present application.

[0066] In a third aspect, referring to FIG. 4 , an embodiment of the present application provides a file transfer method, which is applied to a data processor DPU accelerator card, including steps 400 to 403 .

[0067] Step 400: Receive a file download request and create a second target file; expand the storage space of the second target file on the local disk of the DPU accelerator card, and lock the jth data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card; j is an integer greater than or equal to 1.

[0068] In some embodiments, after receiving the file download request, the file transfer method further includes: obtaining the name and size of the file to be downloaded from the host; correspondingly, expanding the storage space of the second target file on the local disk of the DPU accelerator card includes: expanding the storage space of the second target file on the local disk of the DPU accelerator card according to the size of the file to be downloaded.

[0069] In some embodiments, obtaining the name and size of the file to be downloaded from the host includes: sending a query request to the host, the query request being used to query the name and size of the file to be downloaded; and receiving the name and size of the file to be downloaded sent by the host.

[0070] In some implementations, the ftruncate function may be used to expand the storage space of the second target file on the local disk of the DPU accelerator card.

[0071] In some implementations, the storage space for the second target file on the local disk of the DPU accelerator card can be expanded to a storage space equal to the size of the file to be downloaded. Thus, after each increment of j by 1, the process should begin with the step of locking the jth data block to be downloaded from the second target file after the expanded storage space into the page cache of the DPU accelerator card.

[0072] In some implementations, the storage space for the second target file on the local disk of the DPU accelerator card can be expanded based on the current storage space to the sum of the current storage space and the storage space of the jth data block to be downloaded. Thus, each time j is incremented by 1, the process should begin again with the step of expanding the storage space for the second target file on the local disk of the DPU accelerator card.

[0073] In some embodiments, locking the jth data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card includes: mapping the jth data block to be downloaded to the user-state address space of the DPU accelerator card to obtain a third virtual address of the jth data block to be downloaded in the user-state address space of the DPU accelerator card; translating the third virtual address into a third physical address of the memory of the DPU accelerator card; and locking the local disk space of the DPU accelerator card corresponding to the third physical address in the page cache of the DPU accelerator card.

[0074] In some implementations, the local disk space of the DPU accelerator card corresponding to the third physical address is the storage space of the j-th data block to be downloaded in the local disk of the DPU accelerator card.

[0075] In some implementations, the jth data block to be downloaded may be mapped to the user-state address space of the DPU accelerator card through the mmap function to obtain a third virtual address of the jth data block to be downloaded in the user-state address space of the DPU accelerator card.

[0076] In some implementations, the local disk space of the DPU accelerator card corresponding to the third physical address may be locked in the page cache of the DPU accelerator card through the get_user_pages function family.

[0077] Step 401: Send a third notification message to the host; the third notification message is used to notify the host to download the file.

[0078] Step 402: Receive the IOVA corresponding to the j-th data block to be downloaded from the host, and copy the j-th data block to be downloaded locked in the page cache of the host to the page cache of the DPU accelerator card based on the IOVA corresponding to the j-th data block to be downloaded and the block size of the j-th data block to be downloaded.

[0079] In some embodiments, copying the jth data block to be downloaded, which is locked in the page cache of the host, to the page cache of the DPU accelerator card according to the IOVA corresponding to the jth data block to be downloaded and the block size of the jth data block to be downloaded, includes: copying the jth data block to be downloaded, which is locked in the page cache of the host, to the page cache of the DPU accelerator card according to the third physical address, the IOVA corresponding to the jth data block to be downloaded, and the block size of the jth data block to be downloaded.

[0080] Step 403: When the jth data block to be downloaded is the last data block to be downloaded, close the second target file; and send a fourth notification message to the host; the fourth notification message is used to notify the host to close the file to be downloaded.

[0081] In some embodiments, the file transfer method further includes: when the j-th data block to be downloaded is not the last data block to be downloaded, adding 1 to j, and continuing to execute the step of locking the j-th data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card.

[0082] In some embodiments, the file transfer method further includes: when the j-th data block to be downloaded is not the last data block to be downloaded, adding 1 to j and continuing to expand the storage space of the second target file on the local disk of the DPU accelerator card.

[0083] The file transfer method applied to the DPU accelerator card provided in the embodiment of the present application expands the storage space of the created second target file on the local disk of the DPU accelerator card, locks the data blocks to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card, and copies the data blocks to be downloaded in the page cache of the host to the page cache of the DPU accelerator card, thereby downloading the file to be downloaded from the host to the DPU accelerator card. During the download process, there is no need to allocate user-state cache space, which saves memory resources and does not require memory copying, thereby improving data transmission efficiency.

[0084] FIG5 is a flowchart of a file transfer method applied to a host provided in an embodiment of the present application.

[0085] In a fourth aspect, referring to FIG. 5 , an embodiment of the present application provides a file transfer method, which is applied to a host and includes steps 500 to 503 .

[0086] Step 500: Receive a third notification message sent by a data processor (DPU) accelerator card and open the file to be downloaded. The third notification message is used to notify the host to download the file.

[0087] Step 501: Lock the jth data block in the file to be downloaded in the page cache of the host; j is an integer greater than or equal to 1.

[0088] In some implementations, the file to be downloaded is sliced ​​into at least two data blocks according to the maximum size of the data blocks that can be moved at one time. For example, if the maximum size of the data blocks that can be moved at one time is A, then the size of the jth data block should be less than or equal to A.

[0089] In some embodiments, locking the jth data block in the host's page cache refers to moving the jth data block from the host's local disk to the host's page cache and prohibiting the host's page cache from exchanging with the host's local disk.

[0090] In some embodiments, locking the jth data block in the file to be downloaded in the host's page cache includes: mapping the jth data block to the host's user-state address space to obtain a fourth virtual address of the jth data block in the host's user-state address space; translating the fourth virtual address into a fourth physical address of the host's memory; and locking the host's local disk space corresponding to the fourth physical address in the host's page cache.

[0091] In some implementations, the local disk space of the host corresponding to the fourth physical address is also the storage space of the j-th data block in the local disk of the host.

[0092] In some implementations, the jth data block may be mapped to the user-mode address space of the host through the mmap function to obtain a fourth virtual address of the jth data block in the user-mode address space of the host.

[0093] In some implementations, the local disk space of the host corresponding to the fourth physical address may be locked in the page cache of the host through the get_user_pages function family.

[0094] Step 502: Translate the fourth physical address corresponding to the j-th data block into the IOVA corresponding to the j-th data block, and send the IOVA corresponding to the j-th data block to the DPU accelerator card.

[0095] Step 503: When the jth data block is the last data block in the file to be downloaded, a fourth notification message sent by the DPU accelerator card is received, and the file to be downloaded is closed; the fourth notification message is used to notify the host to close the file to be downloaded.

[0096] In some embodiments, the file transfer method further includes: if the jth data block is not the last data block of the file to be downloaded, adding 1 to j and continuing to lock the jth data block of the file to be downloaded in the page cache of the host.

[0097] The file transfer method applied to the host provided in the embodiment of the present application locks the data blocks in the file to be downloaded in the page cache of the host, and sends the input and output virtual addresses corresponding to the data blocks to the DPU accelerator card, thereby downloading the file to be downloaded from the host to the DPU accelerator card. During the download process, there is no need to allocate user-mode cache space, which saves memory resources and does not require memory copying, thereby improving data transmission efficiency.

[0098] In the fifth aspect, referring to Figure 6, an embodiment of the present application provides an electronic device, including: at least one first processor 601; a first memory 602, on which at least one first computer program is stored. When the at least one first computer program is executed by the at least one first processor 601, the following steps are implemented: receiving a file upload request, opening the file to be uploaded; locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card; i is an integer greater than or equal to 1; sending a first notification message to the host; the first notification message is used to notify the host to upload the file; receiving the input and output virtual addresses corresponding to the i-th data block sent by the host.

[0099] The electronic device also includes: a first direct memory access (DMA) engine 603, configured to copy the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the input and output virtual addresses corresponding to the i-th data block and the block size of the i-th data block.

[0100] When at least one first computer program is executed by at least one first processor 601, the following steps are also implemented: when the i-th data block is the last data block in the file to be uploaded, closing the file to be uploaded; sending a second notification message to the host; the second notification message is used to notify the host to close the first target file.

[0101] In some embodiments, the file to be uploaded is sliced ​​into at least two data blocks according to the maximum size of the data blocks that can be moved at one time. For example, if the maximum size of the data blocks that can be moved at one time is A, then the size of the i-th data block should be less than or equal to A.

[0102] In some embodiments, locking the i-th data block in the page cache of the DPU accelerator card means moving the i-th data block from the local disk of the DPU accelerator card to the page cache of the DPU accelerator card, and prohibiting the page cache of the DPU accelerator card and the local disk of the DPU accelerator card from exchanging.

[0103] In some embodiments, when at least one first computer program is executed by at least one first processor 601, the following method is specifically used to lock the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card: map the i-th data block to the user-state address space of the DPU accelerator card to obtain the first virtual address of the i-th data block in the user-state address space of the DPU accelerator card; translate the first virtual address into a first physical address of the memory of the DPU accelerator card; and lock the local disk space of the DPU accelerator card corresponding to the first physical address in the page cache of the DPU accelerator card.

[0104] In some implementations, the local disk space of the DPU accelerator card corresponding to the first physical address is the storage space of the i-th data block in the local disk of the DPU accelerator card.

[0105] In some implementations, the i-th data block may be mapped to the user-state address space of the DPU accelerator card through the mmap function to obtain a first virtual address of the i-th data block in the user-state address space of the DPU accelerator card.

[0106] In some implementations, the local disk space of the DPU accelerator card corresponding to the first physical address may be locked in the page cache of the DPU accelerator card through the get_user_pages function family.

[0107] In some implementations, the first notification message includes at least: the name and size of the file to be uploaded.

[0108] In some embodiments, when at least one first computer program is executed by at least one first processor 601, the following method is specifically used to copy the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the IOVA corresponding to the i-th data block and the block size of the i-th data block: the i-th data block locked in the page cache of the DPU accelerator card is copied to the page cache of the host according to the first physical address, the IOVA corresponding to the i-th data block, and the block size of the i-th data block.

[0109] In some embodiments, when at least one first computer program is executed by at least one first processor 601, the following steps are also implemented: when the i-th data block is not the last data block in the file to be uploaded, i is incremented by 1, and the step of locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card is continued.

[0110] In some embodiments, the electronic device further includes: at least one first I / O interface 604 connected between the first processor 601 , the first memory 602 and the first DMA engine 603 , and configured to implement information interaction among the first processor 601 , the first memory 602 and the first DMA engine 603 .

[0111] The first processor 601 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the first memory 602 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the first I / O interface (read-write interface) 604 is connected between the first processor 601, the first memory 602 and the first DMA engine 603, and can realize information interaction between the first processor 601, the first memory 602, and the first DMA engine 603, including but not limited to a data bus (Bus), etc.

[0112] In some implementations, the first processor 601 , the first memory 602 , the first DMA engine 603 , and the first I / O interface 604 are connected to each other via a first bus 605 , and further connected to other components of the computing device.

[0113] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the following steps when executed by a processor: receiving a file upload request, opening the file to be uploaded; locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card; i is an integer greater than or equal to 1; sending a first notification message to the host; the first notification message is used to notify the host to upload the file; receiving the input and output virtual addresses corresponding to the i-th data block sent by the host; when the i-th data block is the last data block in the file to be uploaded, closing the file to be uploaded; sending a second notification message to the host; the second notification message is used to notify the host to close the first target file.

[0114] In some embodiments, the file to be uploaded is sliced ​​into at least two data blocks according to the maximum size of the data blocks that can be moved at one time. For example, if the maximum size of the data blocks that can be moved at one time is A, then the size of the i-th data block should be less than or equal to A.

[0115] In some embodiments, locking the i-th data block in the page cache of the DPU accelerator card means moving the i-th data block from the local disk of the DPU accelerator card to the page cache of the DPU accelerator card, and prohibiting the page cache of the DPU accelerator card and the local disk of the DPU accelerator card from exchanging.

[0116] In some embodiments, when the computer program is executed by the processor, the following method is specifically used to lock the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card: map the i-th data block to the user-state address space of the DPU accelerator card to obtain the first virtual address of the i-th data block in the user-state address space of the DPU accelerator card; translate the first virtual address into a first physical address of the memory of the DPU accelerator card; and lock the local disk space of the DPU accelerator card corresponding to the first physical address in the page cache of the DPU accelerator card.

[0117] In some implementations, the local disk space of the DPU accelerator card corresponding to the first physical address is the storage space of the i-th data block in the local disk of the DPU accelerator card.

[0118] In some implementations, the i-th data block may be mapped to the user-state address space of the DPU accelerator card through the mmap function to obtain a first virtual address of the i-th data block in the user-state address space of the DPU accelerator card.

[0119] In some implementations, the local disk space of the DPU accelerator card corresponding to the first physical address may be locked in the page cache of the DPU accelerator card through the get_user_pages function family.

[0120] In some implementations, the first notification message includes at least: the name and size of the file to be uploaded.

[0121] In some embodiments, when the computer program is executed by the processor, the following method is specifically used to copy the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the IOVA corresponding to the i-th data block and the block size of the i-th data block: the i-th data block locked in the page cache of the DPU accelerator card is copied to the page cache of the host according to the first physical address, the IOVA corresponding to the i-th data block, and the block size of the i-th data block.

[0122] In some embodiments, when the computer program is executed by the processor, it further implements: when the i-th data block is not the last data block in the file to be uploaded, i is incremented by 1, and the step of locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card is continued.

[0123] In the seventh aspect, referring to Figure 7, an embodiment of the present application provides an electronic device, including: at least one second processor 701; a second memory 702, and at least one second computer program is stored on the second memory 702. When the at least one second computer program is executed by the at least one second processor 701, the following steps are implemented: receiving a file download request and creating a second target file; expanding the storage space of the second target file on the local disk of the DPU accelerator card, and locking the j-th data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card; j is an integer greater than or equal to 1; sending a third notification message to the host; the third notification message is used to notify the host to download the file; receiving the input and output virtual addresses corresponding to the j-th data block to be downloaded sent by the host.

[0124] The electronic device also includes: a second memory direct access DMA engine 703, configured to copy the jth data block to be downloaded locked in the page cache of the host to the page cache of the DPU accelerator card according to the input and output virtual addresses corresponding to the jth data block to be downloaded and the block size of the jth data block to be downloaded.

[0125] When at least one second computer program is executed by at least one second processor 701, the following steps are also implemented: when the j-th data block to be downloaded is the last data block to be downloaded, closing the second target file; sending a fourth notification message to the host; the fourth notification message is used to notify the host to close the file to be downloaded.

[0126] In some embodiments, when at least one second computer program is executed by at least one second processor 701, the following steps are further implemented: obtaining the name and size of the file to be downloaded from the host; accordingly, when at least one second computer program is executed by at least one second processor 701, the storage space of the second target file on the local disk of the DPU accelerator card is expanded in the following manner: the storage space of the second target file on the local disk of the DPU accelerator card is expanded according to the size of the file to be downloaded.

[0127] In some embodiments, when at least one second computer program is executed by at least one second processor 701, the name and size of the file to be downloaded are obtained from the host in the following manner: a query request is sent to the host, where the query request is used to query the name and size of the file to be downloaded; and the name and size of the file to be downloaded sent by the host are received.

[0128] In some implementations, the ftruncate function may be used to expand the storage space of the second target file on the local disk of the DPU accelerator card.

[0129] In some implementations, the storage space for the second target file on the local disk of the DPU accelerator card can be expanded to a storage space equal to the size of the file to be downloaded. Thus, after each increment of j by 1, the process should begin with the step of locking the jth data block to be downloaded from the second target file after the expanded storage space into the page cache of the DPU accelerator card.

[0130] In some implementations, the storage space for the second target file on the local disk of the DPU accelerator card can be expanded based on the current storage space to the sum of the current storage space and the storage space of the jth data block to be downloaded. Thus, each time j is incremented by 1, the process should begin again with the step of expanding the storage space for the second target file on the local disk of the DPU accelerator card.

[0131] In some embodiments, when at least one second computer program is executed by at least one second processor 701, the following method is specifically used to lock the j-th data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card: map the j-th data block to be downloaded to the user-state address space of the DPU accelerator card to obtain a third virtual address of the j-th data block to be downloaded in the user-state address space of the DPU accelerator card; translate the third virtual address into a third physical address of the memory of the DPU accelerator card; and lock the local disk space of the DPU accelerator card corresponding to the third physical address in the page cache of the DPU accelerator card.

[0132] In some implementations, the local disk space of the DPU accelerator card corresponding to the third physical address is the storage space of the j-th data block to be downloaded in the local disk of the DPU accelerator card.

[0133] In some implementations, the jth data block to be downloaded may be mapped to the user-state address space of the DPU accelerator card through the mmap function to obtain a third virtual address of the jth data block to be downloaded in the user-state address space of the DPU accelerator card.

[0134] In some implementations, the local disk space of the DPU accelerator card corresponding to the third physical address may be locked in the page cache of the DPU accelerator card through the get_user_pages function family.

[0135] In some embodiments, when at least one second computer program is executed by at least one second processor 701, the following method is specifically used to copy the jth data block to be downloaded locked in the page cache of the host to the page cache of the DPU accelerator card according to the IOVA corresponding to the jth data block to be downloaded and the block size of the jth data block to be downloaded: according to the third physical address, the IOVA corresponding to the jth data block to be downloaded and the block size of the jth data block to be downloaded, the jth data block to be downloaded locked in the page cache of the host is copied to the page cache of the DPU accelerator card.

[0136] In some embodiments, when at least one second computer program is executed by at least one second processor 701, the following is further implemented: when the j-th data block to be downloaded is not the last data block to be downloaded, j is increased by 1, and the step of locking the j-th data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card is continued.

[0137] In some embodiments, when at least one second computer program is executed by at least one second processor 701, it further implements: when the j-th data block to be downloaded is not the last data block to be downloaded, j is increased by 1, and the step of expanding the storage space of the second target file on the local disk of the DPU accelerator card is continued.

[0138] In some embodiments, the electronic device further includes: at least one second I / O interface 704 connected between the second processor 701 , the second memory 702 and the second DMA engine 703 , and configured to implement information interaction among the second processor 701 , the second memory 702 and the second DMA engine 703 .

[0139] The second processor 701 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the second memory 702 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the second I / O interface (read-write interface) 704 is connected between the second processor 701, the second memory 702 and the second DMA engine 703, and can realize information interaction between the second processor 701, the second memory 702, and the second DMA engine 703, including but not limited to a data bus (Bus), etc.

[0140] In some implementations, the second processor 701 , the second memory 702 , the second DMA engine 703 , and the second I / O interface 704 are interconnected via a second bus 705 , and further connected to other components of the computing device.

[0141] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the following steps when executed by a processor: receiving a file download request and creating a second target file; expanding the storage space of the second target file on the local disk of the DPU accelerator card, and locking the j-th data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card; j is an integer greater than or equal to 1; sending a third notification message to the host; the third notification message is used to notify the host to download the file; receiving the input and output virtual addresses corresponding to the j-th data block to be downloaded sent by the host; when the j-th data block to be downloaded is the last data block to be downloaded, closing the second target file; sending a fourth notification message to the host; the fourth notification message is used to notify the host to close the file to be downloaded.

[0142] In some embodiments, when the computer program is executed by the processor, it further implements: obtaining the name and size of the file to be downloaded from the host; accordingly, when the computer program is executed by the processor, the storage space of the second target file on the local disk of the DPU accelerator card is expanded in the following manner: the storage space of the second target file on the local disk of the DPU accelerator card is expanded according to the size of the file to be downloaded.

[0143] In some embodiments, when the computer program is executed by the processor, the name and size of the file to be downloaded are obtained from the host in the following manner: a query request is sent to the host, where the query request is used to query the name and size of the file to be downloaded; and the name and size of the file to be downloaded sent by the host are received.

[0144] In some implementations, the ftruncate function may be used to expand the storage space of the second target file on the local disk of the DPU accelerator card.

[0145] In some implementations, the storage space for the second target file on the local disk of the DPU accelerator card can be expanded to a storage space equal to the size of the file to be downloaded. Thus, after each increment of j by 1, the process should begin with the step of locking the jth data block to be downloaded from the second target file after the expanded storage space into the page cache of the DPU accelerator card.

[0146] In some implementations, the storage space for the second target file on the local disk of the DPU accelerator card can be expanded based on the current storage space to the sum of the current storage space and the storage space of the jth data block to be downloaded. Thus, each time j is incremented by 1, the process should begin again with the step of expanding the storage space for the second target file on the local disk of the DPU accelerator card.

[0147] In some embodiments, when the computer program is executed by the processor, the following method is specifically used to lock the j-th data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card: map the j-th data block to be downloaded to the user-state address space of the DPU accelerator card to obtain a third virtual address of the j-th data block to be downloaded in the user-state address space of the DPU accelerator card; translate the third virtual address into a third physical address of the memory of the DPU accelerator card; and lock the local disk space of the DPU accelerator card corresponding to the third physical address in the page cache of the DPU accelerator card.

[0148] In some implementations, the local disk space of the DPU accelerator card corresponding to the third physical address is, that is, the storage space of the j-th data block in the local disk of the DPU accelerator card.

[0149] In some implementations, the jth data block may be mapped to the user-mode address space of the DPU accelerator card through the mmap function to obtain a third virtual address of the jth data block in the user-mode address space of the DPU accelerator card.

[0150] In some implementations, the local disk space of the DPU accelerator card corresponding to the third physical address may be locked in the page cache of the DPU accelerator card through the get_user_pages function family.

[0151] In some embodiments, when the computer program is executed by the processor, the following method is specifically used to copy the jth data block to be downloaded, which is locked in the page cache of the host, to the page cache of the DPU accelerator card according to the IOVA corresponding to the jth data block to be downloaded and the block size of the jth data block to be downloaded: according to the third physical address, the IOVA corresponding to the jth data block to be downloaded, and the block size of the jth data block to be downloaded, the jth data block to be downloaded, which is locked in the page cache of the host, is copied to the page cache of the DPU accelerator card.

[0152] In some embodiments, when the computer program is executed by the processor, it also implements: when the j-th data block to be downloaded is not the last data block to be downloaded, j is increased by 1, and the step of locking the j-th data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card is continued.

[0153] In some embodiments, when the computer program is executed by the processor, it also implements: when the j-th data block to be downloaded is not the last data block to be downloaded, j is increased by 1, and the step of expanding the storage space of the second target file on the local disk of the DPU accelerator card is continued.

[0154] In the ninth aspect, referring to Figure 8, an embodiment of the present application provides an electronic device, including: at least one third processor 801; a third memory 802, on which at least one third computer program is stored. When the at least one third computer program is executed by the at least one third processor 801, the above-mentioned file transfer method is implemented.

[0155] In some embodiments, the electronic device further includes: at least one third I / O interface 803 connected between the third processor 801 and the third memory 802 , and configured to implement information interaction between the third processor 801 and the third memory 802 .

[0156] The third processor 801 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the third memory 802 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the third I / O interface (read-write interface) 803 is connected between the third processor 801 and the third memory 802, and can realize information interaction between the third processor 801 and the third memory 802, including but not limited to a data bus (Bus), etc.

[0157] In some implementations, the third processor 801 , the third memory 802 , and the third I / O interface 803 are connected to each other via a third bus 804 , and further connected to other components of the computing device.

[0158] In a tenth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned file transfer method is implemented.

[0159] It will be appreciated by those skilled in the art that all or some of the steps in the method disclosed above, and the functional modules / units in the device can be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor (such as a central processing unit, a digital signal processor, or a microprocessor), or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those skilled in the art, communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0160] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the present application as set forth in the appended claims.

Claims

1. A file transfer method, applied to a data processor DPU accelerator card, comprising: Receive a file upload request and open the file to be uploaded; Locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card; wherein i is an integer greater than or equal to 1; Sending a first notification message to the host; wherein the first notification message is used to notify the host to upload a file; receiving an input / output virtual address corresponding to the ith data block sent by the host, and copying the ith data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the input / output virtual address corresponding to the ith data block and the block size of the ith data block; and When the i-th data block is the last data block in the file to be uploaded, close the file to be uploaded; send a second notification message to the host; wherein the second notification message is used to notify the host to close the first target file.

2. The file transmission method according to claim 1, further comprising: In the case that the i-th data block is not the last data block in the file to be uploaded, i is incremented by 1, and the step of locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card is continued.

3. The file transmission method according to claim 1 or 2, wherein: The step of locking the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card includes: Mapping the i-th data block to the user state address space of the DPU accelerator card to obtain a first virtual address of the i-th data block in the user state address space of the DPU accelerator card; Translate the first virtual address into a first physical address of the memory of the DPU accelerator card; Locking the local disk space of the DPU accelerator card corresponding to the first physical address in the page cache of the DPU accelerator card; The step of copying the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the input / output virtual address corresponding to the i-th data block and the block size of the i-th data block includes: copying the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the first physical address, the input / output virtual address corresponding to the i-th data block and the block size of the i-th data block.

4. The file transmission method according to claim 1 or 2, wherein: The first notification message includes at least: the name and size of the file to be uploaded.

5. A file transfer method, applied to a host, comprising: Receive a first notification message sent by a data processor DPU accelerator card; wherein the first notification message is used to notify the host to upload a file; Creating a first target file, expanding the storage space of the first target file on the local disk of the host, and locking the i-th data block to be uploaded in the first target file after the storage space is expanded in the page cache of the host; wherein i is an integer greater than or equal to 1; Translate the second physical address corresponding to the i-th data block to be uploaded into the input / output virtual address corresponding to the i-th data block to be uploaded, and send the input / output virtual address corresponding to the i-th data block to be uploaded to the DPU accelerator card; When the i-th data block to be uploaded is the last data block to be uploaded, a second notification message sent by the DPU acceleration card is received, and the target file is closed; wherein the second notification message is used to notify the host to close the target file.

6. The file transmission method according to claim 5, further comprising: When the i-th data block to be uploaded is not the last data block to be uploaded, i is increased by 1, and the i-th data block to be uploaded in the first target file after the storage space is expanded is continuously locked in the page cache of the host.

7. The file transmission method according to claim 5 or 6, wherein: The step of locking the i-th data block to be uploaded in the first target file after the storage space is expanded in the page cache of the host comprises: Mapping the i-th data block to be uploaded to the user state address space of the host to obtain a second virtual address of the i-th data block to be uploaded in the user state address space of the host; translating the second virtual address into a second physical address of the memory of the host; The local disk space of the host corresponding to the second physical address is locked in the page cache of the host.

8. The file transmission method according to claim 5 or 6, wherein: The first notification message includes at least: the name and size of the file to be uploaded.

9. A file transfer method, applied to a data processor DPU accelerator card, comprising: Receiving a file download request, creating a second target file; Expanding the storage space of the second target file on the local disk of the DPU accelerator card, and locking the jth data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card; wherein j is an integer greater than or equal to 1; Sending a third notification message to the host; wherein the third notification message is used to notify the host to download the file; Receive the input and output virtual addresses corresponding to the j-th data block to be downloaded from the host, and The block size of the j-th data block to be downloaded is locked in the page cache of the host and the j-th data block to be downloaded is copied to the page cache of the DPU accelerator card; When the j-th data block to be downloaded is the last data block to be downloaded, close the second target file; send a fourth notification message to the host; wherein the fourth notification message is used to notify the host to close the file to be downloaded.

10. The file transmission method according to claim 9, further comprising: In the case that the j-th data block to be downloaded is not the last data block to be downloaded, j is increased by 1, and the j-th data block to be downloaded in the second target file after the storage space is expanded is continuously locked in the page cache of the DPU acceleration card.

11. The file transmission method according to claim 9 or 10, wherein: The step of locking the jth data block to be downloaded in the second target file after the storage space is expanded in the page cache of the DPU accelerator card comprises: Mapping the j-th data block to be downloaded to the user state address space of the DPU accelerator card to obtain a third virtual address of the j-th data block to be downloaded in the user state address space of the DPU accelerator card; Translate the third virtual address into a third physical address of the memory of the DPU accelerator card; Locking the local disk space of the DPU accelerator card corresponding to the third physical address in the page cache of the DPU accelerator card; and The copying of the jth data block to be downloaded locked in the page cache of the host to the page cache of the DPU accelerator card according to the input-output virtual address corresponding to the jth data block to be downloaded and the block size of the jth data block to be downloaded includes: copying the jth data block to be downloaded locked in the page cache of the host to the page cache of the DPU accelerator card according to the third physical address, the input-output virtual address corresponding to the jth data block to be downloaded and the block size of the jth data block to be downloaded.

12. The file transmission method according to claim 9 or 10, further comprising: After receiving the file download request, obtaining the name and size of the file to be downloaded from the host; The expanding the storage space of the second target file on the local disk of the DPU accelerator card includes: expanding the storage space of the second target file on the local disk of the DPU accelerator card according to the size of the file to be downloaded.

13. A file transfer method, applied to a host, comprising: Receive a third notification message sent by a data processor DPU acceleration card, and open the file to be downloaded; wherein the third notification message is used to notify the host to download the file; Locking the jth data block in the file to be downloaded in the page cache of the host; wherein j is an integer greater than or equal to 1; Translate the fourth physical address corresponding to the j-th data block into the j-th data block The corresponding input and output virtual addresses are sent to the DPU accelerator card; When the j-th data block is the last data block in the file to be downloaded, a fourth notification message sent by the DPU acceleration card is received, and the file to be downloaded is closed; wherein the fourth notification message is used to notify the host to close the file to be downloaded.

14. The file transmission method according to claim 13, further comprising: In the case that the j-th data block is not the last data block of the file to be downloaded, j is increased by 1, and the step of locking the j-th data block in the file to be downloaded in the page cache of the host is continued.

15. The file transmission method according to claim 13 or 14, wherein: The step of locking the jth data block in the file to be downloaded in the page cache of the host comprises: Mapping the j-th data block to the user state address space of the host to obtain a fourth virtual address of the j-th data block in the user state address space of the host; and The fourth virtual address is translated into a fourth physical address of the memory of the host; and the local disk space of the host corresponding to the fourth physical address is locked in the page cache of the host.

16. An electronic device, comprising: at least one first processor; A first memory, wherein at least one first computer program is stored in the first memory, and when the at least one first computer program is executed by the at least one first processor, the following steps are implemented: Upon receiving a file upload request, the file to be uploaded is opened; the i-th data block in the file to be uploaded is locked in the page cache of the DPU accelerator card; wherein i is an integer greater than or equal to 1; Sending a first notification message to the host; wherein the first notification message is used to notify the host to upload a file; Receiving an input / output virtual address corresponding to the i-th data block sent by the host; The electronic device further comprises: a first memory direct access DMA engine configured to copy the i-th data block locked in the page cache of the DPU accelerator card to the page cache of the host according to the input and output virtual address corresponding to the i-th data block and the block size of the i-th data block; When the at least one first computer program is executed by the at least one first processor, the following steps are also implemented: When the i-th data block is the last data block in the file to be uploaded, close the file to be uploaded; send a second notification message to the host; wherein the second notification message is used to notify the host to close the first target file.

17. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented: Receive a file upload request, open the file to be uploaded; lock the i-th data block in the file to be uploaded in the page cache of the DPU accelerator card; wherein, i is an integer greater than or equal to 1; Sending a first notification message to the host; wherein the first notification message is used to notify the host to upload a file; Receiving an input / output virtual address corresponding to the i-th data block sent by the host; When the i-th data block is the last data block in the file to be uploaded, close the file to be uploaded; send a second notification message to the host; wherein the second notification message is used to notify the host to close the first target file.

18. An electronic device, comprising: at least one second processor; A second memory, wherein at least one second computer program is stored in the second memory, and when the at least one second computer program is executed by the at least one second processor, the following steps are implemented: Upon receiving a file download request, a second target file is created; the storage space of the second target file on the local disk of the DPU accelerator card is expanded, and the jth data block to be downloaded in the second target file after the storage space is expanded is locked in the page cache of the DPU accelerator card; wherein j is an integer greater than or equal to 1; Sending a third notification message to the host; wherein the third notification message is used to notify the host to download the file; Receiving the input and output virtual addresses corresponding to the j-th data block to be downloaded sent by the host; The electronic device further comprises: a second memory direct access DMA engine configured to copy the jth data block to be downloaded locked in the page cache of the host to the page cache of the DPU accelerator card according to the input and output virtual addresses corresponding to the jth data block to be downloaded and the block size of the jth data block to be downloaded; When the at least one second computer program is executed by the at least one second processor, the following steps are also implemented: When the j-th data block to be downloaded is the last data block to be downloaded, close the second target file; send a fourth notification message to the host; wherein the fourth notification message is used to notify the host to close the file to be downloaded.

19. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented: receiving a file download request, creating a second target file; and placing the second target file in The storage space on the local disk of the DPU acceleration card is expanded, and the j-th data block to be downloaded in the second target file after the storage space is expanded is locked in the page cache of the DPU acceleration card; wherein, j is an integer greater than or equal to 1; Sending a third notification message to the host; wherein the third notification message is used to notify the host to download the file; Receiving the input and output virtual addresses corresponding to the j-th data block to be downloaded sent by the host; When the j-th data block to be downloaded is the last data block to be downloaded, close the second target file; send a fourth notification message to the host; wherein the fourth notification message is used to notify the host to close the file to be downloaded.

20. An electronic device, comprising: at least one third processor; A third memory, wherein at least one third computer program is stored in the third memory, and when the at least one third computer program is executed by the at least one third processor, the file transfer method described in any one of claims 5 to 8 or the file transfer method described in any one of claims 13 to 15 is implemented.

21. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the file transmission method described in any one of claims 5 to 8, or the file transmission method described in any one of claims 13 to 15.

Citation Information

Patent Citations

  • File data caching method, server and terminal

    CN107818111A

  • Data acceleration operation processing method and device and computer readable storage medium

    CN111813713A

  • Memory scheduling method and device and computer readable storage medium

    CN112131009A

  • Two-phase eviction process for file handle caches

    US20120323872A1

  • Distributed VFS with shared page cache

    US20220027327A1