File access method and device, storage medium and electronic equipment

Through the collaborative work of the user state library and IOMMU, file operations are directly executed on the access device, solving the problem of slow file access and achieving efficient file access and secure data processing.

CN119292691APending Publication Date: 2025-01-10CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411302075.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the prior art, file access involves multiple software processing processes such as system call interface, virtual file system layer, and file system layer, resulting in a high overhead of kernel software I/O stack in the operating system and reducing file access speed.

Method used

Receive file operation requests through user state library, send them to the access device, and use IOMMU to translate the virtual block address into logical block address. The access device performs file operations based on the logical block address, avoiding the kernel file system processing file operation requests, and reducing the kernel software's Data processing tasks.

Benefits of technology

It reduces the overhead of kernel software I/O stack during file access, improves file access efficiency and speed, and enhances the security of data access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292691A_ABST
    Figure CN119292691A_ABST
Patent Text Reader

Abstract

The invention discloses a file access method and device, a storage medium and electronic equipment, and relates to the technical field of computers.The file access method comprises the steps that firstly, in response to a file operation request received by a user mode library, the user mode library is called to send the file operation request to access equipment; the access device is called to send a translation request to an IOMMU, the translation request comprises a virtual block address (VBA) corresponding to the file operation request, and the IOMMU is used for translating the VBA into an LBA and sending the LBA to the access device; and calling the access device, determining a target file corresponding to the file operation request according to the LBA, and executing an operation corresponding to the file operation request on the target file. According to the method, a kernel file system does not need to be called to process the file operation request, so that the data processing task of the kernel file system is reduced, the kernel software I / O stack operation overhead during file access is further reduced, and the file access efficiency and the file access speed are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a file access method, device, storage medium and electronic device. Background Art

[0002] The file access process refers to the process by which the operating system processes the read and write operations of user programs on the file system, realizing the information interaction between the application program or kernel component in the operating system and the hardware device.

[0003] At present, file access in related technologies involves multiple software processing flows such as system call interface, virtual file system layer, file system layer, etc., which leads to high overhead of kernel software input / output (I / O) stack in the operating system and reduces file access speed. Summary of the invention

[0004] In view of this, the present application provides a file access method, device, storage medium and electronic device, the main purpose of which is to improve the current related technical file access involving multiple software processing flows such as system call interface, virtual file system layer, file system layer, etc., which leads to high kernel software I / O stack overhead in the operating system and reduces the technical problem of file access speed.

[0005] In a first aspect, the present application provides a file access method, comprising:

[0006] In response to the user state library receiving the file operation request, calling the user state library to send the file operation request to the access device;

[0007] Calling the access device to send a translation request to the IOMMU, the translation request including a virtual block address VBA corresponding to the file operation request, the IOMMU being used to translate the VBA into an LBA, and sending the LBA to the access device;

[0008] The access device is called to determine a target file corresponding to the file operation request according to the LBA, and to perform an operation corresponding to the file operation request on the target file.

[0009] In a second aspect, the present application provides a file access device, comprising:

[0010] an acquisition module, configured to, in response to a user state library receiving a file operation request, call the user state library to send the file operation request to an access device;

[0011] An input module is configured to call the access device to send a translation request to the IOMMU, wherein the translation request includes a virtual block address VBA corresponding to the file operation request, and the IOMMU is used to translate the VBA into an LBA and send the LBA to the access device;

[0012] The acquisition module is configured to call the access device, determine the target file corresponding to the file operation request according to the LBA, and perform the operation corresponding to the file operation request on the target file.

[0013] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the file access method described in the first aspect.

[0014] In a fourth aspect, the present application provides an electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the file access method described in the first aspect when executing the computer program.

[0015] In a fifth aspect, the present application provides a computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the file access method described in the first aspect.

[0016] By means of the above technical scheme, the present application provides a file access method, device, storage medium and electronic device, first responding to the user state library receiving the file operation request, calling the user state library to send the file operation request to the access device; then calling the access device to send a translation request to the IOMMU, the translation request includes the virtual block address VBA corresponding to the file operation request, the IOMMU is used to translate the VBA into LBA, and send the LBA to the access device; finally calling the access device, determining the target file corresponding to the file operation request according to the LBA, and performing the operation corresponding to the file operation request on the target file. In this way, the user state library can be applied to receive the file operation request, and the file operation request can be sent to the access device, and the IOMMU can be used to translate the VBA corresponding to the file operation request into LBA, and then calling the access device to determine the target file according to the LBA, and perform the operation corresponding to the file operation request on the target file, without calling the kernel file system to process the file operation request, reducing the data processing task of the kernel file system, thereby reducing the kernel software I / O stack running overhead during file access, and improving file access efficiency and file access speed.

[0017] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] Figure 1 A schematic diagram of a process flow of a file access method provided by an embodiment of the present application is shown;

[0021] Figure 2 A schematic diagram of an example process provided by an embodiment of the present application is shown;

[0022] Figure 3 A schematic diagram of the structure of a file access device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0023] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0024] In order to improve the current related technical file access involves multiple software processing processes such as system call interface, virtual file system layer, file system layer, etc., resulting in high kernel software I / O stack overhead in the operating system, which reduces the file access speed. This embodiment provides a file access method, such as Figure 1 As shown, the method includes:

[0025] Step 101: In response to a user state library receiving a file operation request, the user state library is called to send the file operation request to an access device.

[0026] In a specific application scenario, the user state library can be used to intercept file operation requests of various applications. File operation requests may include but are not limited to virtual addresses corresponding to file data, such as read requests, write requests, etc. Access devices may include but are not limited to solid state drives (SSDs), etc. Exemplarily, an application in user space may issue a file operation request. When the user state library intercepts the file operation request, the file operation request is sent to the access device to perform the specific operation corresponding to the file operation request. There is no need to call the kernel file system to process the file operation request, which reduces the data processing tasks of the kernel file system and improves the file access efficiency.

[0027] Step 102: Call the access device to send a translation request to the IOMMU, where the translation request includes a virtual block address VBA corresponding to the file operation request. The IOMMU is used to translate the VBA into an LBA and send the LBA to the access device.

[0028] In specific application scenarios, the Input–Output Memory Management Unit (IOMMU) is a hardware component that can be used to map the virtual block address (VBA) of the data block to be accessed to a logical block address (LBA) to obtain the address of the file to be accessed in the access device, ensure data consistency when the device accesses the memory, and can be used to check whether the application corresponding to the file operation request has the authority to access the data corresponding to the logical block address, thereby improving the security of the file access process.

[0029] Exemplarily, the Linux kernel can provide support for IOMMU by loading the corresponding kernel module to enable the IOMMU function, and use IOMMU to implement VBA to LBA mapping, eliminating the need for the kernel file system to perform address mapping, reducing the kernel file system's data processing flow, and thereby improving file access efficiency.

[0030] Step 103: call the access device, determine the target file corresponding to the file operation request according to the LBA, and perform the operation corresponding to the file operation request on the target file.

[0031] In a specific application scenario, the access device can receive the LBA sent by the IOMMU. The LBA can be used to locate the location of the data. When the application initiates a file operation request, the access device can determine the target file corresponding to the request based on the LBA, determine the specific location of the target file on the access device, and perform the corresponding file operation.

[0032] Compared with the current prior art, this embodiment first responds to the user state library receiving the file operation request, calls the user state library to send the file operation request to the access device; then calls the access device to send a translation request to the IOMMU, the translation request includes the virtual block address VBA corresponding to the file operation request, and the IOMMU is used to translate the VBA into LBA and send the LBA to the access device; finally, calls the access device, determines the target file corresponding to the file operation request according to the LBA, and performs the operation corresponding to the file operation request on the target file. In this way, the user state library can be applied to receive the file operation request, and send the file operation request to the access device, and then use the IOMMU to translate the VBA corresponding to the file operation request into LBA, and then calls the access device to determine the target file according to the LBA, and performs the operation corresponding to the file operation request on the target file, without calling the kernel file system to process the file operation request, reducing the data processing task of the kernel file system, thereby reducing the kernel software I / O stack operation overhead during file access, and improving file access efficiency and file access speed.

[0033] To further illustrate the specific implementation process of the method of this embodiment, optionally, in response to the user state library receiving the file operation request, before calling the user state library to send the file operation request to the access device, the method of this embodiment may also include: allocating a direct memory access (DMA) buffer, the DMA buffer is used to execute the data interaction process of the file operation request; setting a file table, the file table is used to store the mapping relationship between VBA and LBA.

[0034] As a possible implementation, a user state library (Slib) can be added, and a system call file_map can be added in Slib to create a VBA to LBA mapping for the process. The kernel maps the file to the process address space and returns the virtual block address. Exemplarily, the user state process can actively initiate a request. After the process successfully creates a VBA to LBA mapping, the VBA is determined by the kernel's memory management, that is, a block of memory is allocated to the system, and subsequent file reading and writing is achieved by reading and writing VBA.

[0035] As a possible implementation, Slib can be used to provide an initialization interface, allocate direct memory access DMA buffer, and set a file table. Exemplarily, Slib allocates memory during initialization, which can be used for DMA data transmission, and file read and write operations can be performed based on DMA. The allocated DMA memory can be used for data interaction, and the hardware device can directly access the DMA memory without the intervention of the CPU, thereby improving the efficiency of data transmission. In a specific application scenario, the file table can be used to store the correspondence table of the LBA mapped from the VBA to the target file, ensuring the correct reading and writing of data.

[0036] Optionally, step 101 may specifically include: in response to the user state library receiving the file operation request, calling the kernel driver to set a queue associated with the access device, where the queue is used to store the file operation request.

[0037] For example, the initialization interface provided by Slib can be applied to set up a queue associated with an access device, where the access device can be a disk. The corresponding queue is called to store file operation requests (such as I / O requests) to be processed by the disk, so that the disk can receive file operation requests, or data, or instructions from the queue, and process the file operation requests stored in the queue in sequence.

[0038] Further optionally, calling a kernel driver to set a queue associated with the access device may specifically include: obtaining a PASID corresponding to the file operation request; and calling the kernel driver to associate the PASID with the queue.

[0039] As a possible implementation, Slib requests the kernel driver to create a new queue and map it to the user space. After receiving the request (a request to create a new queue), the kernel driver will create a new queue and register it on the device. When registering, the driver can associate a process address space ID (PASID) with each queue, and when executing a file operation request in the queue, obtain the PASID corresponding to the process that sent the file operation request, so as to find the page table corresponding to the process during the subsequent VBA translation of the file operation request, thereby avoiding page table search errors and affecting the processing efficiency of the file operation request.

[0040] Optionally, step 101 may further specifically include: calling a user state library to send a file mapping request to the kernel; in response to the kernel receiving the file mapping request, calling the kernel to set a file table entry in a file table, and attaching the file table entry to the kernel's process page table.

[0041] As a possible implementation, before performing specific read and write operations on the target file, the target file needs to be opened. In this scenario, when Slib intercepts a file open request (Open request), it can forward the Open request to the kernel and issue a file mapping request (file_map request) at the same time, so that the kernel sets the VBA to LBA mapping, thereby determining the VBA carried by subsequent file read and write requests through the file map when the file is opened. Accordingly, the kernel can attach the file table entry (file table entry) to the process page table during the file_map period. After successfully completing the file file_map, Slib can provide an initialization interface to be initialized, and then Slib can directly issue I / O requests from the user space to perform subsequent operations.

[0042] Among them, the process page table can be a mapping table maintained by the system for each process, corresponding to the virtual address and the physical address; the storage content in the file table entry (File Table Entry, FTE) may include but is not limited to LBA, device ID (DevID), and special bits (File Table-FT), among which DevID can be used to identify the device containing the file to ensure that malicious processes do not use VBA to access files on another device, and special bits can be used to distinguish between ordinary page table entries (Page Table Entry, PTE) and file table entries (File Table Entry).

[0043] Optionally, after calling the access device to send a translation request to the IOMMU, the method also includes: in response to the IOMMU receiving the translation request, calling the IOMMU to determine a target page table corresponding to the translation request from the process page table; determining a target entry corresponding to the VBA in the target page table, and obtaining the LBA corresponding to the VBA according to the target entry.

[0044] As a possible implementation, after the IOMMU receives the translation request, it can translate the input / output virtual address (IO Virtual Address, IOVA) of the DMA buffer, then translate the VBA into LBA, and perform a read / write permission check. Exemplarily, when the access device receives a VBA request from the user space, the access device can issue a translation request to the IOMMU. After the IOMMU receives the translation request, the IOMMU can determine the target page table corresponding to the translation request from the process page table, and then traverse the target page table corresponding to the translation request to access the relevant file table entry, find the target file table entry corresponding to the VBA in the translation request, and obtain the LBA corresponding to the VBA according to the entry data in the target file table entry.

[0045] Among them, the translation request may include but is not limited to VBA, operation (read / write), I / O size, and PASID associated with the queue where the request arrives, wherein the queue where the request arrives may be allocated by the disk driver; the target page table may be the process page table corresponding to the translation request, and the target entry may be the file table entry corresponding to the VBA of the translation request in the target page table.

[0046] As a possible implementation, through shared virtual memory (SVM), IOMMU uses PASID to traverse the page table of the process and uses additional file table entries to translate VBA into LBA. Specifically, IOMMU can translate the content entry of special bits in the file table entry as LBA and only use it for block address translation. IOMMU also compares the DevID in the file table entry with the requester ID in the translation request to ensure that the process accesses the file on the correct device, thereby improving the security of the device access process.

[0047] Optionally, the method of this embodiment may further specifically include: obtaining user permissions corresponding to the file operation request and file permissions of the target file; and calling IOMMU to determine the operation permissions of the file operation request according to the user permissions and file permissions.

[0048] As a possible implementation method, during the translation process of VBA, the user permissions corresponding to the file operation request and the file permissions of the target file can be obtained; the IOMMU is called to determine the operation permissions of the file operation request based on the user permissions and file permissions. If the user permissions do not match the file permissions, the target file cannot be accessed. If the user permissions match the file permissions, the target file can be accessed and the corresponding operation can be performed. Through this permission check method, the IOMMU can ensure that the operation permissions of the file operation request are satisfied, thereby ensuring the security of data access. Correspondingly, after the IOMMU successfully translates VBA into LBA, the IOMMU can send the LBA to the access device, so that the access device determines the target file and continues to process the file operation request. In this way, the device is shared without affecting security, while providing low-latency access capabilities.

[0049] For example, Figure 2 As shown, an I / O architecture is shown, and the detailed process is as follows:

[0050] 1. All file operations that modify file system metadata can be handled by the kernel, such as Open() and append(). File system metadata only exists in the kernel and is not shared with user space libraries or devices, avoiding the complexity involved in maintaining metadata consistency between multiple layers. Use the newly added file_map system call to create a VBA to LBA mapping for the process. Specifically, the actual storage area of ​​the file on the disk can be found based on the file metadata, and then the file is mapped to the process address space and returned to VBA.

[0051] 2. The kernel creates a file table: a file table entry that maps a single file. A file table entry is a special page table entry that can be used to store LBAs instead of page frame numbers. The kernel can attach these file table entries to the address space of the process during file_map.

[0052] 3. The user-mode library Slib can be used to intercept file operation requests (I / O requests) sent by applications, such as the data read operation Read() and the data write operation Write(), and then send the file operation request to the access device. During the file opening period corresponding to the file operation request, the kernel can map the file content to the application address space. Specifically, queues can be used to submit file operation requests to devices, and drivers in the kernel space can be called for device management. Queues are created at the disk driver layer, and I / O requests can be sent to these queues. The disk driver maintains the queues and polls them to obtain the completion status. Correspondingly, the Slib library can also be used to track information about open files, such as flags, offsets, sizes, and starting VBAs, to manage file information and ensure data consistency. It can also track the list of partial writes in progress. The DMA buffer (DirectMemory Access Buffer, DMABUFF) can be used to temporarily store data during DMA operations to ensure the consistency and integrity of data transmission and improve data transmission efficiency.

[0053] 4. The SSD communicates with the IOMMU. The IOMMU can be used to translate the VBA in the incoming request (translation request) and perform permission checks. After the SSD receives the translated LBA, the SSD can complete the I / O request normally. Specifically, the Input / Output Translation Lookaside Buffer (IOTLB) can be used to accelerate the address translation process in the I / O operation, and together with the IOMMU, the address translation and protection functions are realized when the peripheral accesses the memory.

[0054] In this embodiment, the permission check can be offloaded to the hardware to ensure that the process can only access data with appropriate permissions, thereby ensuring performance while ensuring security. Through file mapping, IOMMU address translation and permission checking, and metadata kernel processing, metadata passes through the kernel I / O stack, and other data does not pass through the kernel I / O stack, thereby ensuring low latency for data access and ensuring the security of data access, thereby providing low-latency access capabilities while sharing devices without affecting security.

[0055] Compared with the current existing technology, this embodiment can use the user state library to receive file operation requests in this way, and send the file operation request to the access device, and then use IOMMU to translate the VBA corresponding to the file operation request into LBA, and then call the access device to determine the target file according to the LBA, and perform the operation corresponding to the file operation request on the target file, without calling the kernel file system to process the file operation request, reducing the data processing task of the kernel file system, thereby reducing the kernel software I / O stack running overhead during file access, and improving file access efficiency and file access speed. In addition, this embodiment creates a file table to store the corresponding relationship between VBA mapping to the LBA of the target file, ensuring that malicious processes will not use VBA to access files on another device, and checking whether the permissions are met, further improving the security of data access, and realizing that low-latency access capabilities are provided while sharing devices without affecting security, thereby improving file access efficiency.

[0056] Further, as Figure 1 The specific implementation of the method shown in the embodiment provides a file access device, such as Figure 3 As shown, the device includes: a receiving module 31 and a calling module 32.

[0057] The receiving module 31 is configured to, in response to the user state library receiving the file operation request, call the user state library to send the file operation request to the access device;

[0058] The calling module 32 is configured to call the access device to send a translation request to the IOMMU, where the translation request includes a virtual block address VBA corresponding to the file operation request, and the IOMMU is used to translate the VBA into an LBA and send the LBA to the access device;

[0059] The calling module 32 is configured to call the access device, determine the target file corresponding to the file operation request according to the LBA, and perform the operation corresponding to the file operation request on the target file.

[0060] In some examples of this embodiment, the receiving module 31 is further configured to allocate a DMA buffer, which is used to execute the data interaction process of the file operation request; and set a file table, which is used to store the mapping relationship between VBA and LBA.

[0061] In some examples of this embodiment, the receiving module 31 is specifically configured to call the kernel driver to set a queue associated with the access device in response to the user state library receiving the file operation request, and the queue is used to store the file operation request.

[0062] In some examples of this embodiment, the receiving module 31 is specifically configured to obtain a PASID corresponding to the file operation request; and call a kernel driver to associate the PASID with a queue.

[0063] In some examples of this embodiment, the calling module 32 is specifically configured to call the user state library to send a file mapping request to the kernel; in response to the kernel receiving the file mapping request, the kernel is called to set a file table entry in the file table, and the file table entry is attached to the kernel's process page table.

[0064] In some examples of this embodiment, the calling module 32 is further configured to call the IOMMU to determine a target page table corresponding to the translation request from the process page table in response to the IOMMU receiving the translation request;

[0065] Determine the target entry corresponding to the VBA in the target page table, and obtain the LBA corresponding to the VBA according to the target entry.

[0066] In some examples of this embodiment, the calling module 32 is specifically configured to obtain the user permissions corresponding to the file operation request and the file permissions of the target file; and call the IOMMU to determine the operation permissions of the file operation request according to the user permissions and the file permissions.

[0067] It should be noted that for other corresponding descriptions of the functional units involved in the file access device provided in this embodiment, please refer to Figure 1 The corresponding description in will not be repeated here.

[0068] Based on the above Figure 1 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 1 The method shown.

[0069] Based on the above Figure 1 The method shown in the embodiment also provides a computer program product, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 The method shown.

[0070] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the method of the implementation scenario of the present application.

[0071] Based on the above Figure 1 The method shown, and Figure 3In order to achieve the above-mentioned purpose, the embodiment of the present application also provides an electronic device, such as a personal computer, a server, a laptop computer, a smart phone, an intelligent robot or other intelligent terminal, which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 The method shown.

[0072] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0073] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.

[0074] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.

[0075] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware. By applying the technical solution of this embodiment, first, in response to the user state library receiving a file operation request, the user state library is called to send the file operation request to the access device; then the access device is called to send a translation request to the IOMMU, the translation request includes the virtual block address VBA corresponding to the file operation request, and the IOMMU is used to translate the VBA into LBA and send the LBA to the access device; finally, the access device is called to determine the target file corresponding to the file operation request according to the LBA, and perform the operation corresponding to the file operation request on the target file.

[0076] In this way, the user state library can be applied to receive file operation requests, and the file operation requests can be sent to the access device, and then the VBA corresponding to the file operation request can be translated into LBA by using IOMMU, and then the access device is called to determine the target file according to the LBA, and the operation corresponding to the file operation request is performed on the target file, without calling the kernel file system to process the file operation request, thereby reducing the data processing tasks of the kernel file system, thereby reducing the kernel software I / O stack operating overhead during file access, and improving file access efficiency and file access speed. In addition, this embodiment creates a file table to store the corresponding relationship between VBA mapping to the LBA of the target file, ensuring that a malicious process will not use VBA to access files on another device, and checking whether the permissions are met, further improving the security of data access, and realizing that low-latency access capabilities are provided while sharing devices without affecting security, thereby improving file access efficiency.

[0077] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0078] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.

Claims

1. A file access method, characterized in that: include: In response to the user state library receiving the file operation request, calling the user state library to send the file operation request to the access device; Calling the access device to send a translation request to an input / output memory management unit IOMMU, wherein the translation request includes a virtual block address VBA corresponding to the file operation request, and the IOMMU is used to translate the VBA into a logical block address LBA and send the LBA to the access device; The access device is called to determine a target file corresponding to the file operation request according to the LBA, and to perform an operation corresponding to the file operation request on the target file.

2. The method according to claim 1, characterized in that In response to the user state library receiving the file operation request, calling the user state library to send the file operation request to the access device includes: In response to the user state library receiving the file operation request, a kernel driver is called to set a queue associated with the access device, where the queue is used to store the file operation request.

3. The method according to claim 2, characterized in that The calling of the kernel driver to set a queue associated with the access device includes: Obtaining a process address space identifier PASID corresponding to the file operation request; The kernel driver is called to associate the PASID with the queue.

4. The method according to claim 1, characterized in that Before, in response to the user state library receiving the file operation request, calling the user state library to send the file operation request to the access device, the method further includes: Allocating a direct memory access DMA buffer, wherein the DMA buffer is used to execute a data interaction process of the file operation request; A file table is set, where the file table is used to store a mapping relationship between the VBA and the LBA.

5. The method according to claim 4, characterized in that After the user state library receives the file operation request in response, the method further includes: Calling the user state library to send a file mapping request to the kernel; In response to the kernel receiving the file mapping request, the kernel is called to set a file table entry in the file table and append the file table entry to a process page table of the kernel.

6. The method according to claim 5, characterized in that After calling the access device to send a translation request to the IOMMU, the method further includes: In response to the IOMMU receiving the translation request, calling the IOMMU to determine a target page table corresponding to the translation request from the process page table; Determine a target entry corresponding to the VBA in the target page table, and obtain the LBA corresponding to the VBA according to the target entry.

7. The method according to claim 1, characterized in that The method further comprises: Obtaining the user permissions corresponding to the file operation request and the file permissions of the target file; The IOMMU is called to determine the operation permission of the file operation request according to the user permission and the file permission.

8. A file access device, characterized in that: include: A receiving module, configured to, in response to a user state library receiving a file operation request, call the user state library to send the file operation request to an access device; A calling module is configured to call the access device to send a translation request to the IOMMU, wherein the translation request includes a virtual block address VBA corresponding to the file operation request, and the IOMMU is used to translate the VBA into an LBA and send the LBA to the access device; The calling module is configured to call the access device, determine the target file corresponding to the file operation request according to the LBA, and perform the operation corresponding to the file operation request on the target file.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product having a computer program stored thereon, characterized in that: When the computer program product is executed by a processor, the method according to any one of claims 1 to 7 is implemented.