A NAS access method and system for FPGA control storage device

By using virtualized file operation interface components and the FUSE architecture, network-attached storage access for FPGA-controlled storage devices is realized, solving the problem that traditional kernel file systems cannot directly manage storage devices, and improving user access convenience and data management efficiency.

CN117992420BActive Publication Date: 2026-07-24HANGZHOU EBOYLAMP ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU EBOYLAMP ELECTRONICS CO LTD
Filing Date
2024-01-09
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Traditional kernel file systems cannot directly manage storage devices, leading to complex interactions between FPGAs and processors, making it impossible to share storage device files via network protocols, and causing inconvenience for users.

Method used

It adopts a virtualized file operation interface component, which is divided into a service component and a client component. It generates a user-space file system based on the FUSE architecture and realizes file sharing access through a preset network protocol.

Benefits of technology

This invention enables FPGA-controlled storage devices to provide file services as NAS devices, improving the convenience of data management and access, and simplifying file management in embedded systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117992420B_ABST
    Figure CN117992420B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification discloses a NAS access method and system for FPGA control storage device. The NAS access method for FPGA control storage device comprises setting a virtual file operation interface component; generating an executable program of a user state file system through the virtual file operation interface component in a FUSE architecture; adding the executable program to an operating system node of an embedded system to complete mounting of the user state file system; based on a preset network protocol, opening file sharing access of the operating system node mounted with the user state file system, and based on a received file sharing access request initiated by a client, performing file NAS access of the FPGA controlled storage device by the client. The embodiment of the present specification realizes network attached storage access to the storage device controlled by the FPGA, and data management and access are more convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this specification relate to the technical field of embedded operating system file management, and particularly to a NAS access method and system for an FPGA-controlled storage device. Background Art

[0002] In the field of embedded storage, an FPGA is a programmable logic device. Currently, FPGAs are often used to manage and control the storage operations of storage devices (such as solid-state drives SSDs, etc.) to improve data acquisition and storage performance. However, there are a large number of customized processing logics in the interaction between the FPGA and the processor. The traditional kernel file system cannot directly mount and manage the storage device. It can only control the interaction between the FPGA and the solid-state drive through application software, and cannot open shared access to the files in the storage device through network protocols. As a result, when a client host wants to access the files in the storage device, it can only be accessed through the corresponding client software, which is not convenient for users to quickly access and manage the storage device, resulting in a decrease in the accessibility of the storage device. Summary of the Invention

[0003] Embodiments of this specification provide a NAS access method and system for an FPGA-controlled storage device, and the technical solutions are as follows:

[0004] In a first aspect, embodiments of this specification provide a NAS access method for an FPGA-controlled storage device, which is applied to an embedded system and includes: setting a virtualized file operation interface component, where the virtualized file operation interface component includes a service component called in a storage control software process and a client component called in a user-space file system process based on the FUSE architecture; based on the FUSE architecture, generating an executable program of the user-space file system through the virtualized file operation interface component in the FUSE architecture; adding the executable program to the operating system node of the embedded system to complete the mounting of the user-space file system; based on a preset network protocol, opening file sharing access to the operating system node with the user-space file system mounted, and performing NAS access to the files of the storage device controlled by the FPGA by the client based on the received file sharing access request initiated by the client.

[0005] Secondly, embodiments of this specification provide a NAS access system for FPGA-controlled storage devices, including a client and an embedded system, with a communication connection between the client and the embedded system. The client is used to initiate a file sharing access request to the embedded system. The embedded system is used to: set up a virtualized file operation interface component, which includes a service component called by the storage control software process and a client component called by the user-mode file system process based on the FUSE architecture; generate an executable program for the user-mode file system through the virtualized file operation interface component in the FUSE architecture; add the executable program to the operating system node of the embedded system to complete the mounting of the user-mode file system; enable file sharing access on the operating system node with the mounted user-mode file system based on a preset network protocol, and perform NAS file access for the storage device controlled by the FPGA based on the received file sharing access request initiated by the client.

[0006] The beneficial effects of the technical solutions provided in some embodiments of this specification include at least the following:

[0007] This specification's embodiments include a virtualized file operation interface component, which is divided into a service component and a client component. This decouples the storage control software from the user-space file system under the FUSE architecture, resulting in strong versatility and maintainability. This specification's embodiments implement file management of storage units in FPGA-controlled storage devices based on FUSE technology. It enables network-attached storage access to FPGA-controlled storage devices, allowing them to provide file services as NAS devices and be accessed from client hosts via file sharing protocols, facilitating data management and access. Attached Figure Description

[0008] To more clearly illustrate the technical solutions in the embodiments of this specification, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0009] Figure 1 This is a schematic diagram illustrating an application scenario of a NAS access system for FPGA-controlled storage devices, as provided in this manual.

[0010] Figure 2 This is a flowchart illustrating a NAS access method for FPGA-controlled storage devices provided in this manual.

[0011] Figure 3 This is a schematic diagram of the virtualized file operation interface provided in this manual.

[0012] Figure 4 This is a flowchart illustrating the file directory access process provided in this manual.

[0013] Figure 5 This is a flowchart illustrating the file reading process provided in this manual.

[0014] Figure 6 This is a flowchart illustrating the file writing process provided in this manual. Detailed Implementation

[0015] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings.

[0016] The terms "first," "second," etc., in the description, claims, and accompanying drawings are used to distinguish different objects and not to describe a particular order. Furthermore, the term "comprising" and any variations thereof are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0017] Before describing the technical solution of this invention, a brief explanation of the relevant technical terms will be provided:

[0018] NAS (Network Attached Storage): A storage device connected to a computer network. Network Attached Storage provides file sharing services and consists of hardware devices and an operating system. Clients can access files on the NAS via network protocols (NFS, CIFS, FTP, etc.).

[0019] FPGA (Field Programmable Gate Array): A programmable logic device that can be programmed to implement the functions of various digital circuits. In embedded systems, solid-state drives (SSDs) are directly connected to the FPGA, and the FPGA chip controls and manages the SSD to improve its performance and reliability, and further enables high-speed data storage under the control of the processor.

[0020] The FUSE (Filesystem in Userspace) architecture is a software interface that allows non-privileged userspace programs to create and manage file systems. It includes core components such as the userspace library (libfuse), the FUSE kernel module, and file system interfaces. The userspace library (libfuse) provides the APIs needed by developers, allowing them to write userspace file system modules. The FUSE kernel module forwards file system operations within the operating system. It allows userspace file system modules to interact with kernel space and handles file system operations within the kernel. The file system interface provides a set of standard file system interfaces, enabling developers to perform file and directory operations such as reading, writing, creating, and deleting.

[0021] PCIe (Peripheral Component Interconnect Express): A high-speed serial bus standard for connecting expansion cards and other external devices. The PCIe bus is typically used in expansion slots on motherboards to connect external devices such as graphics cards, network cards, storage controllers, and sound cards.

[0022] Before this specification describes in detail the NAS access method for FPGA-controlled storage devices in conjunction with one or more embodiments, it first introduces the application scenarios of this NAS access method for FPGA-controlled storage devices.

[0023] Please see Figure 1 , Figure 1 This is a schematic diagram of a NAS access system 100 for FPGA-controlled storage devices provided in an embodiment of the present invention. The NAS access system 100 for FPGA-controlled storage devices may include a NAS access device 110 for FPGA-controlled storage devices and a client 120, etc. The NAS access device 110 and the client 120 are connected in communication. The client 120 is an electronic device that initiates a file sharing access request to the NAS access device 110 for FPGA-controlled storage devices. This electronic device can be a terminal or other device. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, or personal computer (PC), etc.

[0024] Specifically, the NAS access device 110 for FPGA-controlled storage devices can be integrated into an electronic device, such as a server. The server can be a single server or a server cluster consisting of multiple servers. In some embodiments, the NAS access device for FPGA-controlled storage devices can also be integrated into multiple electronic devices; for example, the NAS access device for FPGA-controlled storage devices can be integrated into multiple servers, with multiple servers implementing the NAS access method for FPGA-controlled storage devices of this application.

[0025] In the embodiments of this specification, the NAS access device 110 for FPGA-controlled storage devices may include an embedded system. The embedded system may be equipped with a virtualized file operation interface component, which includes a service component called by the storage control software process and a client component called by the user-mode file system process based on the FUSE architecture. Based on the FUSE architecture, an executable program for the user-mode file system is generated through the virtualized file operation interface component in the FUSE architecture. The executable program is added to the operating system node of the embedded system to complete the mounting of the user-mode file system. Based on a preset network protocol, file sharing access is enabled on the operating system node with the mounted user-mode file system, and based on the file sharing access request initiated by the received client, the client performs file NAS access to the storage device controlled by the FPGA.

[0026] It should be noted that, Figure 1 The schematic diagram of a NAS access system for FPGA-controlled storage devices shown is merely an example. The NAS access system and scenario for FPGA-controlled storage devices described in this embodiment are for the purpose of more clearly illustrating the technical solutions of this embodiment and do not constitute a limitation on the technical solutions provided by this embodiment. As those skilled in the art will know, with the evolution of NAS access systems for FPGA-controlled storage devices and the emergence of new scenarios, the technical solutions provided by this embodiment are also applicable to similar technical problems.

[0027] Please see Figure 2 , Figure 2 This is a flowchart illustrating a NAS access method for FPGA-controlled storage devices provided in an embodiment of the present invention. This NAS access method for FPGA-controlled storage devices can be implemented by... Figure 1 The embedded system of the NAS access device 110 for FPGA-controlled storage devices shown is executed. This NAS access method for FPGA-controlled storage devices may include at least the following steps:

[0028] 200. Configure the virtualization file operation interface component, which includes the service component called by the storage control software process and the client component called by the user-space file system process based on the FUSE architecture;

[0029] 210. Based on the FUSE architecture, generate executable programs for user-space file systems through virtualized file operation interface components within the FUSE architecture;

[0030] 220. Add the executable program to the operating system node of the embedded system to complete the mounting of the user-mode file system;

[0031] 230. Based on a preset network protocol, enable file sharing access on the operating system node with the user-mode file system mounted, and perform NAS file access on the storage device controlled by the FPGA based on the file sharing access request initiated by the client.

[0032] In this embodiment, the embedded system may include an embedded recording board, an operating system, etc. The embedded recording board may include at least an embedded CPU chip, DDR (Double Data Rate) memory, an FPGA chip, and a storage device. The storage device includes storage units, such as SATA SSDs, which are directly mounted on the FPGA. The embedded CPU chip exchanges data with the FPGA via a PCIe bus, and the CPU communicates with external devices via a gigabit network or a 10-gigabit network.

[0033] The embedded system runs on an operating system with storage control software. This software enables the management of addresses and files in the storage units via the FPGA, and allows virtualized file operation interfaces to call service components to execute I / O requests such as opening, reading, writing, closing, deleting, and directory reading.

[0034] The storage control software process is a specific execution instance of the storage control software; that is, a software process running in the operating system that handles tasks such as storage resource management based on the storage control software. The storage control software process can start when the operating system boots up.

[0035] The operating system can be an embedded Linux system, providing the most basic software runtime environment and featuring a FUSE architecture. The FUSE architecture can include a user-space file system based on FUSE. This user-space file system is used by client components to implement virtualized file operation interfaces corresponding to the storage control software. These client components handle and respond to I / O requests such as opening, reading, writing, closing, deleting, and directory reading, while also managing file nodes and mounting the file system to a specified system path using the `mount` command. `mount` is a command used to mount a file system to a specified path. Once the file system is mounted, its contents can be accessed and displayed in the specified path.

[0036] User-space file systems can be file systems that run in user space rather than kernel space. User-space file systems allow user-space applications to access files and storage devices through file system interfaces without requiring privileged access or direct support from the operating system kernel. User-space file systems can exist as libraries or processes, and they can communicate with the kernel-level virtual file system layer through interfaces provided by the operating system to implement file system functionality.

[0037] The user-mode file system process is a file system process that runs in user space and is responsible for handling file system requests and operations in user space. The user-mode file system process runs in the user space of the operating system, not the kernel space. It can be started by the system initialization script or the startup script after user login, or it can be automatically started as a startup service when the operating system boots.

[0038] The embedded system also supports file sharing services, including those supporting FTP, CIFS, or NFS protocols, which share the mounted file paths, enabling the user host corresponding to the client to communicate with the embedded recording board via gigabit or 10-gigabit networks. The user host can be a terminal running Linux or Windows.

[0039] In this embodiment, the FTP protocol is a standard protocol used for file transfer over computer networks. It allows users to transfer files between clients and servers and supports both anonymous and authenticated access. FTP can be accessed and operated via command line or dedicated FTP client software.

[0040] In this embodiment, CIFS is a protocol used to share files and printers over a computer network. It is an extension of the SMB (Server Message Block) protocol used to share files and resources between Windows and other operating systems. CIFS allows for network-based access to folders, printers, and other resources.

[0041] In this embodiment, the NFS protocol is a protocol used for sharing files and storage resources over computer networks. It allows file sharing between different operating systems and provides a transparent way to access remote file systems. NFS is commonly used for file sharing between UNIX and UNIX-like systems, allowing client systems to access files and directories on a server over a network.

[0042] For example, in this embodiment, DDR address space can be reserved for DMA shared memory blocks. Then, a virtualized file operation interface component is implemented on the embedded recording board. This component manages the storage unit files. Next, based on the FUSE architecture, the aforementioned file operation interface component is used to implement a user-mode file system, which is then mounted onto the operating system node. The corresponding user host on the client side maps the shared mount point to a network drive for access and management via SMB, NFS, or FTP protocols. In this embodiment, the mount point of the embedded recording board's user-mode file system can be shared via SMB, NFS, or FTP. The user host uses the corresponding CIFS, NFS, or FTP protocols to map the remote directory to the local network drive, enabling the management and access of data in the embedded recording board's storage units.

[0043] This embodiment sets up a virtualized file operation interface component, which is divided into a service component and a client component. This decouples the business software (storage control software) from the user-space file system under the FUSE architecture, resulting in strong versatility and maintainability. This embodiment, based on FUSE technology, implements file management of storage units in FPGA-controlled storage devices. It enables network-attached storage access to FPGA-controlled storage devices, allowing them to provide file services as NAS devices and be accessed from client hosts via file sharing protocols, facilitating data management and access.

[0044] In some embodiments, the FUSE architecture includes a FUSE component corresponding to the operating system embedded in the system. The FUSE component includes a FUSE kernel module and a FUSE user-mode library interface. The method further includes:

[0045] The FPGA performs data transfer between the dual-data-rate random access memory on the processor and the storage device based on direct memory access. During the data transfer, the page parameter sizes corresponding to the FUSE kernel module and the FUSE user-mode library interface are adjusted to match the data size of a single direct memory access transfer.

[0046] In this embodiment, the page size in the FUSE kernel module and libfuse interface (i.e., the FUSE user-mode library interface) implementation can be adjusted and recompiled. This embodiment can obtain the FUSE component corresponding to the operating system kernel on the embedded recording board. The FUSE component may include the FUSE kernel module and libfuse interface, etc. To improve I / O efficiency and enable the FPGA to achieve high-speed data transfer between the CPU's DDR and memory units based on direct memory access (DMA), the page parameter size in the kernel module and libfuse interface implementation can be modified to the size of a single DMA operation.

[0047] In some embodiments, a NAS access method for FPGA-controlled storage devices may further include: reserving dual data rate memory in the operating system based on a memory space reservation method, wherein the reserved dual data rate memory is a direct memory access shared memory block; mapping the memory space corresponding to the direct memory access shared memory block to a virtual address space, so that different user processes can operate the memory space corresponding to the direct memory access shared memory block by accessing the virtual address.

[0048] In this embodiment, the operating system can reserve DDR address space (i.e., dual data rate memory) as DMA shared memory block (i.e., direct memory access shared memory block), and then complete the DDR address memory reservation according to the memory space reservation method commonly used by the operating system, and use the reserved memory to obtain virtual addresses through the mmap function for use in different processes.

[0049] In some embodiments, please refer to Figure 3 , Figure 3 A schematic diagram of the virtualized file operation interface is shown. For example... Figure 3As shown, the service component and the client component communicate and interact; that is, the service component and the client component can communicate via network control, and both the service component and the client component can exchange data with the DMA shared memory block. The service component is called by the storage control software process, controls the storage device through the FPGA, divides the data management of the storage device into directory units and data units, and abstracts and encapsulates the directory units and data units in a file operation interface. The service component supports network request and response communication. The client component is called by the user-space file system process of the kernel module, parses the received kernel module instructions, and completes communication and interaction with the service component. The client component provides operation interfaces such as directory management, file reading, and file writing.

[0050] In some embodiments, file sharing access requests include directory access requests, and client-side file NAS access to the FPGA-controlled storage device includes a file directory access process. See also Figure 4 , Figure 4 A flowchart illustrating the file directory access process is shown. For example... Figure 4 As shown, the file directory access process includes:

[0051] 400. The client initiates a directory access request, views the file directory through the remote mapped cloud drive, and sends the directory access request to the FUSE component corresponding to the operating system on the embedded system through the sharing protocol. The FUSE component is used to send directory access IO requests to the user space file system through the FUSE kernel module.

[0052] 410. The user-space file system receives directory access I / O requests from the FUSE kernel module through the user-space library;

[0053] 420. The user-mode file system process parses directory access requests through the file operation interface library and forwards the parsing results corresponding to the directory access requests to the storage control software process.

[0054] 430. Based on the parsing results corresponding to the directory access request, the storage control software process obtains the directory data through the directory unit and returns the directory data to the user-mode file system process through the interface provided by the file operation interface library.

[0055] 440. The user-space file system process parses the directory data and fills the parsed directory data into the file system directory nodes;

[0056] 450. The user-space file system sends I / O response requests to the operating system's virtual file system layer through the user-space library and updates the user-space file system directory;

[0057] 460. The client obtains the file directory of the user-space file system through the sharing protocol.

[0058] In this embodiment, a directory access request can be a request initiated by a client to obtain information such as the directory structure, file list, or metadata of a specific file in the file system. A directory access I / O request can be a lower-level operation of the directory access request; it is the embedded system's response and execution of the directory access request. That is, a directory access I / O request corresponds to the actual operations and data interactions required by the directory access request. An I / O response request is a response request sent by the user-space file system to the operating system's virtual file system layer after processing input or output operations.

[0059] In this embodiment, the client can initiate file sharing access, and the user host can view the file directory through a remotely mapped network drive. For example, the client sends a directory access request to the Linux kernel on the embedded recording board via a sharing protocol. The user-space file system receives the directory access I / O request from the FUSE kernel module in the Linux kernel through the libfuse library. The user-space file system process parses the directory access request through the file operation interface library and forwards it to the corresponding storage control software process for I / O request processing. The storage control software process can obtain directory data through directory units and return the directory data to the user-space file system process through the file operation interface library interface. The user-space file system process parses the directory data and populates it into the file system directory nodes. The user-space file system feeds back the I / O response request to the virtual file system layer of the operating system (e.g., the Linux kernel VFS layer) through the libfuse library and updates the mounted user-space file system directory. The user host obtains the file directory of the user-space file system through the sharing protocol.

[0060] In some embodiments, the file sharing access request includes a file read request, and the client's file NAS access to the FPGA-controlled storage device includes a file read process for the first file data. See also Figure 5 , Figure 5 A flowchart illustrating the file reading process is shown. For example... Figure 5 As shown, the file reading process includes:

[0061] 500. The client initiates a file read request and sends the file read request to the FUSE component corresponding to the operating system on the embedded system through the sharing protocol. The FUSE component is used to send the file read I / O request to the user space file system through the FUSE kernel module.

[0062] 510. The user-space file system receives file read I / O requests from the FUSE kernel module through the user-space library;

[0063] 520. The user-space file system process parses file read I / O requests through the file operation interface library and sends the parsing results corresponding to the file read I / O requests to the storage control software process;

[0064] 530. The storage control software process obtains the read data request from the parsing result corresponding to the file read IO request and inputs the read data request into the data unit;

[0065] 540. The data unit calculates the file address of the storage unit based on the read data request and sends the command to the FPGA via the PCIe bus;

[0066] 550. The FPGA sends a read I / O request to the direct memory access shared memory block based on the command via direct memory access. The file read management unit in the user-mode file system process uses the address of the direct memory access shared memory block as the file data cache.

[0067] 560. The user-space file system sends an I / O read response request to the virtual file system layer of the operating system through the user space library. The virtual file system layer obtains the first file data based on the I / O read response request, and the first file data is in a readable state.

[0068] 570. The client reads the first file data from the mapped cloud drive according to the file length in the file read request through the sharing protocol.

[0069] In this embodiment, a file read request can be a request initiated by the client, specifically a request to read first file data from a storage device controlled by the FPGA. A file read I / O request can be a lower-level operation of the file read request, representing the embedded system's response and execution of the file read request; that is, the file read I / O request corresponds to the actual operations and data interaction required for the file read request. An I / O read response request can be a response request sent by the user-space file system to the operating system after completing the file read operation. This response can include the result of the read operation, such as the read data or the status information of the read operation.

[0070] In this embodiment, the client can read the first file data from the storage device controlled by the FPGA. The client initiates file sharing access, and the user host reads the specified file from the mapped network drive. For example, the client sends a request to the Linux kernel on the embedded recording board via a sharing protocol. The user-space file system receives the IO request from the fuse module in the Linux kernel through the libfuse library. The user-space file system process parses the file read IO request through the file operation interface library and forwards it to the storage control software process for IO request processing. The storage control software process can process the read data request by inputting it to the data management unit. The data management unit calculates the file address of the storage unit based on the current file IO request (i.e., the read data request), and sends the file data and obtains the command to the FPGA via the PCIe bus. The FPGA sends a read IO request to the DMA shared memory block of the CPU's DDR reserved address via DMA. The user-space file system process file read management unit directly uses the address of the DMA shared memory block as a file data cache. Then, the user-space file system process prepares the data structure to respond to the file read IO request, that is, the user-space file system process has prepared the data to be read and can pass it to other system components to satisfy the file read IO request. The user-space file system uses the libfuse library to send I / O response requests back to the Linux kernel VFS layer, ensuring the file data is ready and readable. The user host then retrieves the file data based on the file length specified in the file read request using the sharing protocol.

[0071] The file address of the storage unit can be the address of the first file data on the storage device. A read I / O request can be a request for a single read operation on the storage device. For example, a read I / O request can be a request to read a block of data from the storage device and transfer it to a DMA shared memory block in the CPU memory. A read I / O request can include reading a block of data from the storage device, such as a data block. A read I / O request can be transferred by the FPGA to a shared memory block in the CPU memory via DMA. The user-mode file system process file read management unit directly uses the address of this DMA shared memory block and treats it as a file data cache so that subsequent file read operations can directly access the data in this memory block.

[0072] In some embodiments, the file sharing access request includes a file write request, and the client's file NAS access to the FPGA-controlled storage device includes a file writing process for second file data. See also Figure 6 , Figure 6 A flowchart illustrating the file writing process is shown. For example... Figure 6 As shown, the file writing process includes:

[0073] 600. The client initiates a file write request, drags and drops the file to the specified path of the mapped cloud drive or writes the file to the specified path of the mapped cloud drive. The file write request is sent to the FUSE component corresponding to the operating system on the embedded system through the sharing protocol. The FUSE component is used to send the file write IO request to the user space file system through the FUSE kernel module.

[0074] 610. The user-space file system receives file write I / O requests from the FUSE kernel module based on the user-space library. File write I / O requests include write data requests and data input requests.

[0075] 620. The user-space file system process parses file write I / O requests through the file operation interface library and sends the parsing results corresponding to the file write I / O requests to the storage control software process;

[0076] 630. User-space file system processes obtain data input address and length based on file write I / O requests;

[0077] 640. The storage control software process inputs write data requests into the data management unit;

[0078] 650. The user-mode file system process writes the data input address and length to the direct memory access shared memory block and notifies the data management unit in the storage control software process of the written data input address and length.

[0079] 660. The data management unit calculates the file address of the storage unit based on the write data request and sends a command to the FPGA via the PCIe bus;

[0080] 670. Based on commands, the FPGA sends the second file data in the direct memory access shared memory block to the storage unit according to a single write IO request via direct memory access, thereby completing the update of file attributes in the storage control software process;

[0081] 680. The user-space file system sends an IO write response request to the operating system's virtual file system layer through the user-space library to complete the file writing process of the second file data.

[0082] In this embodiment, a file write request can be a request initiated by the client, specifically a request from the client to write second file data into the storage device controlled by the FPGA. A file write I / O request can be a lower-level operation of the file write request, representing the embedded system's response and execution of the file write request; that is, the file write I / O request corresponds to the actual operations and data interactions required for the file write request. An I / O write response request can be a response request sent by the user-space file system to the operating system after completing the file write operation. This response can include the result of the write operation, such as whether the write was successful and the status information of the write operation.

[0083] In this embodiment, the client can write second file data to the storage device controlled by the FPGA. The client initiates file sharing access, and the user host drags and drops the file to a specified path on the mapped network drive or writes the file to a specified path on the mapped network drive. For example, the client can send the request to the Linux kernel on the embedded recording board through a sharing protocol. The user-space file system receives file write I / O requests from the FUSE kernel module in the Linux kernel through the libfuse library, including write data requests and data inputs. The user-space file system process parses the file write I / O requests through the file operation interface library and forwards them to the storage control software process for I / O request processing. The user-space file system process manages the acquired data input address and length. The storage control software process performs control processing by inputting the write data request to the data management unit. The user-space file system process writes the acquired data input address and length to the address in the DMA shared memory block and informs the data management unit in the storage control software process of the written data input address and length. The data management unit calculates the file address of the storage unit based on the write data request, issues the second file data via PCIe, and receives a command from the FPGA. Based on a single write I / O request, the FPGA moves the data from the DMA shared memory block at the specified address to the storage unit via DMA, completing the file attribute update in the storage control software process. Next, the storage control software process responds to the current write request and sends the response to the file write management module in the user-mode file system process.

[0084] Next, the user-space file system process prepares the data structure to respond to the file write I / O request. The user-space file system uses the libfuse library to send the I / O write response request back to the Linux kernel VFS layer. Once the file data is written, the file writing process for the second file data is complete.

[0085] This embodiment improves the I / O efficiency of file data access between the FPGA and CPU by adjusting the page size in the FUSE kernel module and libfuse interface implementation. Simultaneously, it utilizes reserved DMA shared memory blocks to achieve zero-copy file data in the file system. Furthermore, this embodiment includes a virtualized file operation interface component, which is divided into a service component and a client component. This decouples business software (such as storage control software) from the user-space file system under the FUSE architecture, resulting in strong versatility and maintainability. This embodiment, based on FUSE technology, implements file management of storage units in FPGA-controlled storage devices. It enables network-attached storage access to FPGA-controlled storage devices, allowing them to provide file services as NAS devices and be accessed from client hosts via file sharing protocols, facilitating convenient data management and access.

[0086] This embodiment enables embedded application developers to manage files on storage devices such as SSDs controlled by FPGAs without needing to understand the mechanisms of traditional kernel file systems or pay attention to the complex internal design of sharing protocols. It overcomes the shortcoming of not being able to share storage files via network protocols because the kernel file system cannot directly mount and manage storage devices such as SSDs. It enables NAS access to data in storage devices from the client host and improves the accessibility of data in embedded recording boards.

[0087] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0088] In addition, this specification also provides a NAS access system for FPGA-controlled storage devices.

[0089] In this embodiment, the NAS access system for FPGA-controlled storage devices may include at least a client and an embedded system, with a communication connection between them. The client is used to initiate file sharing access requests to the embedded system. The embedded system is used to: set up a virtualized file operation interface component, which includes service components called in the storage control software process and client components called in the user-mode file system process based on the FUSE architecture; generate an executable program for the user-mode file system through the virtualized file operation interface component in the FUSE architecture; add the executable program to the operating system node of the embedded system to complete the mounting of the user-mode file system; enable file sharing access on the operating system node with the mounted user-mode file system based on a preset network protocol, and perform NAS file access for the storage device controlled by the FPGA based on the received file sharing access request initiated by the client.

[0090] In some embodiments, the FUSE architecture includes a FUSE component corresponding to the operating system mounted on the embedded system. The FUSE component includes a FUSE kernel module and a FUSE user-mode library interface. The embedded system is also used to: perform data transfer between the dual data rate random access memory on the processor and the storage device via the FPGA based on direct memory access. During the data transfer, the page parameter sizes corresponding to the FUSE kernel module and the FUSE user-mode library interface are adjusted to match the data size of a single direct memory access transfer.

[0091] In some embodiments, the embedded system is further configured to: reserve dual data rate memory in the operating system based on a memory space reservation method, wherein the reserved dual data rate memory is a direct memory access shared memory block; and map the memory space corresponding to the direct memory access shared memory block to a virtual address space so that different user processes can operate the memory space corresponding to the direct memory access shared memory block by accessing the virtual address.

[0092] In some embodiments, the service component and the client component communicate and interact. The service component is called by the storage control software process, controls the storage device through the FPGA, divides the data management of the storage device into directory units and data units, and abstracts and encapsulates the directory units and data units in the form of file operation interfaces. The service component supports network request and response communication. The client component is called by the user-space file system process of the kernel module, parses the received kernel module instructions, and completes communication and interaction with the service component. The client component provides operation interfaces such as directory management, file reading, and file writing.

[0093] In some embodiments, the file sharing access request includes a directory access request. Client access to the FPGA-controlled storage device's file NAS includes a file directory access process, which includes: the client initiating a directory access request, viewing the file directory via a remote mapped cloud drive, and sending the directory access request to the FUSE component corresponding to the operating system on the embedded system via a sharing protocol. The FUSE component is used to send a directory access I / O request to the user-space file system through the FUSE kernel module. The user-space file system receives the directory access I / O request from the FUSE kernel module through a user-space library. The user-space file system process parses the directory access request through a file operation interface library and forwards the parsing result to the storage control software process. Based on the parsing result, the storage control software process obtains directory data through a directory unit and returns the directory data to the user-space file system process through an interface provided by the file operation interface library. The user-space file system process parses the directory data and fills the parsed directory data into the file system directory node. The user-space file system sends an I / O response request to the operating system's virtual file system layer through the user-space library and updates the user-space file system directory. The client obtains the file directory of the user-space file system through the sharing protocol.

[0094] In some embodiments, the file sharing access request includes a file read request. Client access to the FPGA-controlled storage device's file NAS includes a file read process for first file data. The file read process includes: the client initiating a file read request and sending it to the FUSE component corresponding to the operating system on the embedded system via a sharing protocol; the FUSE component sending a file read I / O request to the user-space file system via the FUSE kernel module; the user-space file system receiving the file read I / O request from the FUSE kernel module via a user-space library; the user-space file system process parsing the file read I / O request via a file operation interface library and sending the parsing result to the storage control software process; and the storage control software process obtaining the file read I / O request. The parsing result of the I / O request corresponds to the read data request, and the read data request is input into the data unit; the data unit calculates the file address of the storage unit according to the read data request, and sends a command to the FPGA through the PCIe bus; the FPGA sends a read I / O request to the direct memory access shared memory block according to the command through direct memory access, and the file read management unit in the user-mode file system process uses the address of the direct memory access shared memory block as the file data cache; the user-mode file system sends an I / O read response request to the virtual file system layer of the operating system through the user space library, and the virtual file system layer obtains the first file data based on the I / O read response request, and the first file data is in a readable state; the client reads the first file data from the mapped network drive according to the file length in the file read request through the sharing protocol.

[0095] In some embodiments, the file sharing access request includes a file write request. Client access to the FPGA-controlled storage device's file NAS includes a second file data write process. The file write process includes: the client initiating a file write request, dragging and dropping a file to or writing a file to a specified path on the mapped network drive; sending the file write request to the FUSE component corresponding to the operating system running on the embedded system via a sharing protocol; the FUSE component sending a file write I / O request to the user-space file system via the FUSE kernel module; the user-space file system receiving the file write I / O request from the FUSE kernel module based on a user-space library; the file write I / O request including write data requests and data input requests; and the user-space file system process parsing the file write I / O request through a file operation interface library and sending the parsing result corresponding to the file write I / O request to the storage device. The storage control software process controls the data flow. The user-space file system process obtains the data input address and length based on the file write I / O request. The storage control software process inputs the write data request to the data management unit. The user-space file system process writes the data input address and length to the direct memory access shared memory block and notifies the data management unit in the storage control software process of the written data input address and length. The data management unit calculates the file address of the storage unit based on the write data request and sends a command to the FPGA via the PCIe bus. Based on the command, the FPGA sends the second file data from the direct memory access shared memory block to the storage unit according to a single write I / O request, completing the file attribute update in the storage control software process. The user-space file system sends an I / O write response request to the operating system's virtual file system layer through the user space library, completing the file writing process of the second file data.

[0096] Based on the NAS access system for FPGA-controlled storage devices described in several embodiments of this specification, it can be seen that the embodiments of this specification include a virtualized file operation interface component. This virtualized file operation interface component is divided into a service component and a client component, thereby decoupling the business software (such as storage control software) from the user-space file system under the FUSE architecture, resulting in strong versatility and maintainability. The embodiments of this specification implement file management of storage units in FPGA-controlled storage devices based on FUSE technology, enabling network-attached storage access to FPGA-controlled storage devices. This allows the devices to provide file services as NAS devices and can be accessed from the client host via file sharing protocols, facilitating data management and access.

[0097] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the NAS access system embodiment for FPGA-controlled storage devices is described simply because it is fundamentally similar to the NAS access method embodiment for FPGA-controlled storage devices; relevant parts can be referred to the description of the method embodiment.

[0098] The above embodiments are merely preferred embodiments described in this specification and are not intended to limit the scope of this specification. Any modifications and improvements made by those skilled in the art to the technical solutions of this specification without departing from the spirit of this specification should fall within the protection scope defined by the claims of this specification.

Claims

1. A NAS access method for FPGA-controlled storage devices, applied in an embedded system, comprising: Configure a virtualization file operation interface component, which includes a service component called by the storage control software process and a client component called by the user-mode file system process based on the FUSE architecture; Based on the FUSE architecture, an executable program for a user-space file system is generated through the virtualization file operation interface component in the FUSE architecture; The executable program is added to the operating system node of the embedded system to complete the mounting of the user-mode file system; Based on a preset network protocol, the operating system node with the user-mode file system mounted is enabled to share files, and based on the file sharing access request initiated by the client, the client performs file NAS access to the storage device controlled by the FPGA. The FUSE architecture includes the FUSE component corresponding to the operating system mounted on the embedded system. The FUSE component includes a FUSE kernel module and a FUSE user-mode library interface. The method further includes: Data transfer between the dual data rate random access memory on the processor and the storage device is performed via the FPGA using direct memory access. During the data transfer process, the page parameter sizes corresponding to the FUSE kernel module and the FUSE user-mode library interface are adjusted to match the data size of a single direct memory access transfer. The method further includes: Based on the memory space reservation method, dual data rate memory is reserved in the operating system, and the reserved dual data rate memory is a direct memory access shared memory block; The memory space corresponding to the direct memory access shared memory block is mapped to the virtual address space, so that different user processes can operate the memory space corresponding to the direct memory access shared memory block by accessing the virtual address. The service component communicates and interacts with the client component. The service component is used by the storage control software process to control the storage device through the FPGA, so as to divide the data management of the storage device into directory units and data units, and to abstract and encapsulate the directory units and the data units in the form of file operation interface. The service component supports network request and response communication. The client component is invoked by the user-mode file system process of the kernel module. It parses the received kernel module instructions and completes communication and interaction with the service component. The client component provides interfaces for directory management, file reading, and file writing operations.

2. The method according to claim 1, wherein the file sharing access request includes a directory access request, and the client's access to the FPGA-controlled storage device's file NAS includes a file directory access process, the file directory access process including: The client initiates a directory access request, views the file directory through the remote mapped cloud drive, and sends the directory access request to the FUSE component corresponding to the operating system on the embedded system through the sharing protocol. The FUSE component is used to send directory access I / O requests to the user-space file system through the FUSE kernel module. The user-space file system receives directory access I / O requests from the FUSE kernel module through the user-space library; The user-mode file system process parses the directory access request through the file operation interface library and forwards the parsing result corresponding to the directory access request to the storage control software process. The storage control software process obtains directory data through the directory unit based on the parsing result corresponding to the directory access request, and returns the directory data to the user-mode file system process through the interface provided by the file operation interface library. The user-mode file system process parses the directory data and fills the parsed directory data into the file system directory nodes; The user-space file system sends I / O response requests to the virtual file system layer of the operating system through the user-space library and updates the user-space file system directory; The client obtains the file directory of the user-space file system through a sharing protocol.

3. The method according to claim 1, wherein the file sharing access request includes a file read request, and the client's NAS access to the storage device controlled by the FPGA includes a file read process of the first file data, the file read process including: The client initiates a file read request and sends the file read request to the FUSE component corresponding to the operating system on the embedded system through a sharing protocol. The FUSE component is used to send file read I / O requests to the user-space file system through the FUSE kernel module. The user-space file system receives file read I / O requests from the FUSE kernel module through the user-space library; The user-space file system process parses the file read I / O request through the file operation interface library and sends the parsing result corresponding to the file read I / O request to the storage control software process. The storage control software process obtains the read data request from the parsing result corresponding to the file read IO request, and inputs the read data request into the data unit; The data unit calculates the file address of the storage unit according to the read data request and sends a command to the FPGA via the PCIe bus. The FPGA sends a read I / O request to the direct memory access shared memory block via direct memory access based on the command. The file read management unit in the user-mode file system process uses the address of the direct memory access shared memory block as a file data cache. The user-space file system sends an IO read response request to the virtual file system layer of the operating system through the user space library. The virtual file system layer obtains the first file data based on the IO read response request, and the first file data is in a readable state. The client reads the first file data from the mapped cloud drive according to the file length in the file read request via a sharing protocol.

4. The method according to claim 1, wherein the file sharing access request includes a file write request, and the client's access to the file NAS of the storage device controlled by the FPGA includes a file write process for the second file data, the file write process including: The client initiates a file write request, drags and drops the file to the specified path of the mapped cloud drive or writes the file to the specified path of the mapped cloud drive, and sends the file write request to the FUSE component corresponding to the operating system on the embedded system through the sharing protocol. The FUSE component is used to send the file write IO request to the user space file system through the FUSE kernel module. The user-space file system receives file write I / O requests from the FUSE kernel module based on the user-space library. The file write I / O requests include write data requests and data input requests. The user-space file system process parses file write I / O requests through the file operation interface library and sends the parsing results corresponding to the file write I / O requests to the storage control software process. The user-space file system process obtains the data input address and length based on the file write I / O request; The storage control software process inputs write data requests to the data management unit; The user-mode file system process writes the data input address and length into the direct memory access shared memory block, and notifies the data management unit in the storage control software process of the written data input address and length. The data management unit calculates the file address of the storage unit based on the write data request and sends a command to the FPGA via the PCIe bus. Based on the command, the FPGA sends the second file data in the direct memory access shared memory block to the storage unit through a single write IO request via direct memory access, thereby completing the update of file attributes in the storage control software process; The user-space file system sends an IO write response request to the virtual file system layer of the operating system through the user-space library to complete the file writing process of the second file data.

5. A NAS access system for FPGA-controlled storage devices, used to execute the NAS access method according to any one of claims 1 to 4, the system comprising a client and an embedded system, wherein the client and the embedded system are communicatively connected; the client is used to initiate a file sharing access request to the embedded system; The embedded system is used for: Configure a virtualization file operation interface component, which includes a service component called by the storage control software process and a client component called by the user-mode file system process based on the FUSE architecture; Based on the FUSE architecture, an executable program for a user-space file system is generated through the virtualization file operation interface component in the FUSE architecture; The executable program is added to the operating system node of the embedded system to complete the mounting of the user-mode file system; Based on a preset network protocol, the operating system node with the user-mode file system is enabled to share files, and based on the file sharing access request initiated by the client, the client performs file NAS access to the storage device controlled by the FPGA.