Heterogeneous computing encrypted file processing method, program product and heterogeneous computing system
By inserting a transparent file system into the operating system and calling the FPGA for encryption operations in the write-back process, the resource occupation and poor performance problems caused by frequent hardware interactions in encrypted heterogeneous computing systems are solved, efficient encrypted file write-back is achieved, system performance is improved, and the FPGA aging rate is reduced.
Patent Information
- Application Number
- CN202510897189.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-30
AI Technical Summary
In encrypted heterogeneous computing systems, frequent encryption operations and disk write requests lead to increased system energy consumption and computing resource consumption, reducing system response speed and overall performance, and accelerating FPGA aging.
A transparent file system is inserted into the operating system to cache data to be processed and call the FPGA for encryption operations in the write-back process, reducing frequent hardware interactions and optimizing I/O operations through block processing and multi-computing unit parallel processing.
It achieves efficient write-back of encrypted files, reduces system energy consumption and computing resource consumption, slows down FPGA aging, improves system response speed and overall performance, and reduces maintenance costs.
Smart Images

Figure CN120408686B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular relates to an encrypted file processing method, program product and heterogeneous computing system for heterogeneous computing. Background Art
[0002] In traditional heterogeneous computing and storage systems, when data needs to be written to disk, it is typically sent directly to the disk for writing. However, in encrypted heterogeneous computing systems, data is encrypted before being written to disk. Related art methods encrypt data immediately after each update and write it directly to disk. This results in frequent encryption operations and disk write requests, increasing system energy and computing resource consumption, and reducing system response speed and overall performance. Summary of the Invention
[0003] This application aims to solve at least one of the technical problems existing in the related art. To this end, this application proposes a method, program product, and heterogeneous computing system for processing encrypted files using heterogeneous computing, which achieves efficient write-back operations on encrypted files and solves problems such as inefficient resource usage, poor system performance, and low data processing efficiency caused by frequent hardware interactions during heterogeneous computing encryption operations. It also reduces system energy consumption and computing resource consumption, slows down the aging of FPGAs (Field Programmable Gate Arrays), reduces system maintenance costs, and improves system response speed and overall performance.
[0004] In a first aspect, the present application provides a method for processing encrypted files in heterogeneous computing, which is applied to an operating system including a transparent file system; the method comprises:
[0005] When a write operation is received, the data to be processed is cached in a memory cache area in the transparent file system;
[0006] In the case of detecting that the operating system triggers a write-back process, calling a field programmable gate array to perform encryption operation on the data to be processed in the memory cache area;
[0007] The encrypted data to be processed is written into a disk storage device; the disk storage device is connected to the server host where the operating system is located.
[0008] According to the encrypted file processing method for heterogeneous computing provided in the embodiment of the present application, a transparent file system is inserted into the operating system. When a write-back operation is received, the data to be processed is cached in the memory cache area of the transparent file system. Then, when the write-back process is triggered, the FPGA is called in the transparent file system to encrypt the data to be processed, and the encrypted data is written to the disk. The cache allocation and write-back functions of the encrypted data are implemented in the transparent file system, and efficient write-back operations on encrypted files are achieved. This solves the problems of inefficient resource occupation, poor system performance, and low data processing efficiency caused by frequent hardware interactions during heterogeneous computing encryption operations, reduces system energy consumption and computing resource consumption, slows down the aging of the FPGA, reduces the maintenance cost of the system, and improves the response speed and overall performance of the system.
[0009] In an embodiment of the present application, a method for processing encrypted files in heterogeneous computing includes the field programmable gate array comprising a plurality of computing units; and calling the field programmable gate array to perform encryption operations on the data to be processed in the memory cache area, including:
[0010] Sending the data to be processed to a device memory corresponding to the field programmable gate array;
[0011] Based on the encryption parameters corresponding to the calculation units, each calculation unit is called to perform encryption operation on the data to be processed.
[0012] In an embodiment of the present application, the method for processing encrypted files using heterogeneous computing further includes, before calling each computing unit to perform encryption operations on the data to be processed based on encryption parameters corresponding to each computing unit:
[0013] Obtaining multiple work items in a work queue corresponding to the operating system;
[0014] Dividing the data to be processed into a plurality of data blocks, and allocating the data blocks to each of the work items; each of the data blocks includes at least a portion of the data to be processed;
[0015] Allocate a first target computing unit among the plurality of computing units to a target work item among the plurality of work items.
[0016] In an embodiment of the present application, the method for processing encrypted files using heterogeneous computing further includes, before calling each computing unit to perform encryption operations on the data to be processed based on encryption parameters corresponding to each computing unit:
[0017] Dividing the data to be processed into a plurality of data blocks; each of the data blocks includes at least a portion of the data to be processed;
[0018] When it is detected that a target data block among the multiple data blocks includes a newly written data page, the target data block is copied to a buffer array in a device memory corresponding to the field programmable gate array to perform an encryption operation on the target data block.
[0019] In an embodiment of the present application, a method for processing encrypted files in heterogeneous computing, wherein detecting that the operating system triggers a write-back process, includes:
[0020] When it is detected that the operating system meets at least one of multiple trigger conditions, it is determined that the operating system triggers the write-back process; the multiple trigger conditions include: the to-be-processed data is not written to the disk storage device within the target time threshold, the remaining memory capacity corresponding to the operating system is less than the target capacity threshold, and a data synchronization command is received.
[0021] In an embodiment of the present application, a method for processing encrypted files in heterogeneous computing, wherein the data to be processed is cached in a memory cache area in the transparent file system, includes:
[0022] Allocating a target buffer area for each data page in the data to be processed from the memory buffer area;
[0023] Each of the data pages is cached in a target cache area corresponding to the data page, and each of the target cache areas is inserted into a cache tree corresponding to the operating system.
[0024] In an embodiment of the present application, a method for processing encrypted files in heterogeneous computing is provided, wherein the operating system includes a virtual file system connected to the transparent file system; upon receiving a write operation, caching the data to be processed in a memory cache area in the transparent file system includes:
[0025] Upon receiving the write operation, sending the write operation to the virtual file system;
[0026] In a case where it is detected that the write operation corresponds to a target flag parameter, sending the write operation from the virtual file system to the transparent file system;
[0027] In response to the write operation, the data to be processed is cached in the memory cache area in the transparent file system.
[0028] In an embodiment of the present application, a method for processing encrypted files in heterogeneous computing, wherein the encrypted data to be processed is written to a disk storage device, includes:
[0029] A target writing function is called to write the encrypted data to be processed into the disk storage device; the target writing function corresponds to a target flag parameter.
[0030] In an embodiment of the present application, a method for processing encrypted files using heterogeneous computing includes a field programmable gate array (FPGA) comprising a plurality of computing units, each of which is configured to perform an encryption operation on at least a portion of the data to be processed; and writing the encrypted data to be processed to a disk storage device includes:
[0031] Based on the linked list arrangement order of the multiple computing units, at least part of the to-be-processed data encrypted by each computing unit is written into the disk storage device.
[0032] In an embodiment of the present application, the method for processing encrypted files in heterogeneous computing further comprises, after writing at least a portion of the to-be-processed data encrypted by each computing unit to the disk storage device based on the linked list arrangement order of the plurality of computing units, the method further comprising:
[0033] releasing a second target computing unit among the plurality of computing units; the second target computing unit being a computing unit corresponding to at least part of the data to be processed that has been written into the disk storage device;
[0034] Insert the second target computing unit into the target position in the linked list corresponding to the multiple computing units.
[0035] In a second aspect, the present application provides a computer program product, applied to an operating system, wherein the operating system includes a transparent file system; comprising:
[0036] A first processing module is configured to cache the data to be processed into a memory cache area in the transparent file system when a write operation is received;
[0037] A second processing module is configured to call a field programmable gate array to perform encryption operation on the data to be processed in the memory cache area when detecting that the operating system triggers a write-back process;
[0038] The third processing module is used to write the encrypted data to be processed into a disk storage device; the disk storage device is connected to the server host where the operating system is located.
[0039] According to the computer program product provided in the embodiment of the present application, a transparent file system is inserted into the operating system. When a write-back operation is received, the data to be processed is cached in the memory cache area of the transparent file system. Then, when the write-back process is triggered, the FPGA is called in the transparent file system to encrypt the data to be processed and write the encrypted data to the disk. The cache allocation and write-back functions of the encrypted data are implemented in the transparent file system, and efficient write-back operations on encrypted files are achieved. This solves the problems of inefficient resource occupation, poor system performance, and low data processing efficiency caused by frequent hardware interactions during heterogeneous computing encryption operations, reduces system energy consumption and computing resource consumption, slows down the aging of the FPGA, reduces the maintenance cost of the system, and improves the response speed and overall performance of the system.
[0040] In a third aspect, the present application provides a heterogeneous computing system, including:
[0041] An operating system, the operating system being deployed on a server host, and the operating system being deployed with a driver corresponding to a field programmable gate array;
[0042] A disk storage device connected to the server host;
[0043] An acceleration board is connected to the server host, and a driver corresponding to the field programmable gate array is used to call the acceleration board.
[0044] According to the heterogeneous computing system provided by the embodiment of the present application, a transparent file system is inserted into the operating system. When a write-back operation is received, the data to be processed is cached in the memory cache area of the transparent file system. Then, when the write-back process is triggered, the FPGA is called in the transparent file system to encrypt the data to be processed, and the encrypted data is written to the disk. The cache allocation and write-back functions of the encrypted data are implemented in the transparent file system, and efficient write-back operations on encrypted files are achieved. This solves the problems of inefficient resource occupation, poor system performance, and low data processing efficiency caused by frequent hardware interactions during heterogeneous computing encryption operations, reduces system energy consumption and computing resource consumption, slows down the aging of the FPGA, reduces the maintenance cost of the system, and improves the response speed and overall performance of the system.
[0045] In one embodiment of the present application, the heterogeneous computing system, the operating system includes:
[0046] An application layer, the application layer being used to receive write operations input by a user;
[0047] A kernel layer, wherein the kernel layer is connected to the application layer, and the kernel layer is configured with a transparent file system.
[0048] In a fourth aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the encrypted file processing method of heterogeneous computing as described in the first aspect above is implemented.
[0049] In a fifth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the encrypted file processing method of heterogeneous computing as described in the first aspect above.
[0050] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0051] By inserting a transparent file system into the operating system, when a write-back operation is received, the data to be processed is cached in the memory cache area of the transparent file system. Then, when the write-back process is triggered, the FPGA is called in the transparent file system to encrypt the data to be processed and write the encrypted data to the disk. The cache allocation and write-back functions of the encrypted data are implemented in the transparent file system, and efficient write-back operations on encrypted files are achieved. This solves the problems of inefficient resource occupation, poor system performance, and low data processing efficiency caused by frequent hardware interactions during heterogeneous computing encryption operations, reduces system energy consumption and computing resource consumption, slows down the aging of the FPGA, reduces the system maintenance cost, and improves the system response speed and overall performance.
[0052] Furthermore, by creating multiple computing units corresponding to the FPGA, each computing unit can process the corresponding work items separately, so that multiple computing units can process independent work items at the same time, thereby improving the parallel processing capability of the FPGA, improving the overall throughput and resource utilization, and improving work efficiency.
[0053] Furthermore, by dividing the data to be processed into blocks, when dirty data pages are detected in the target data block, the target data block is copied to the temporary cache array, and the encrypted data can be calculated in blocks, which balances performance and consistency in random write scenarios. By reducing the number of encryption times, optimizing I / O and simplifying management, the overall system efficiency is improved.
[0054] Furthermore, after the write operation enters the virtual file system through a system call, if it is detected that the write operation corresponds to the O_DIRECT flag, the write operation can execute the DIRECT IO (direct IO) non-cached process, and the write process can then enter the transparent file system, thereby caching and writing back the data based on the transparent file system, realizing the cache write function of the heterogeneous computing system, and ultimately achieving the improvement of transparent and efficient encryption and cache write-back operations of data files in the encrypted heterogeneous computing framework.
[0055] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0057] Figure 1 This is one of the flow charts of the method for processing encrypted files in heterogeneous computing provided in an embodiment of the present application;
[0058] Figure 2 This is the second flow chart of the method for processing encrypted files in heterogeneous computing provided by the embodiment of the present application;
[0059] Figure 3 This is the third flow chart of the method for processing encrypted files in heterogeneous computing provided in an embodiment of the present application;
[0060] Figure 4 is a schematic diagram of the structure of a heterogeneous computing system provided in an embodiment of the present application;
[0061] Figure 5 This is the fourth flow chart of the method for processing encrypted files in heterogeneous computing provided in an embodiment of the present application;
[0062] Figure 6 This is a schematic diagram of the structure of an encrypted file processing device for heterogeneous computing provided in an embodiment of the present application;
[0063] Figure 7 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0065] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0066] The following, in conjunction with the accompanying drawings, describes in detail the encrypted file processing method for heterogeneous computing, the computer program product, the electronic device, and the readable storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios.
[0067] The encrypted file processing method of heterogeneous computing can be applied to a terminal, and can be specifically executed by hardware or software in the terminal.
[0068] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer having a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer having a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).
[0069] In the following embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse, and a joystick.
[0070] The embodiment of the present application provides an encrypted file processing method for heterogeneous computing. The execution subject of the encrypted file processing method for heterogeneous computing can be an electronic device or a functional module or functional entity in the electronic device that can implement the encrypted file processing method for heterogeneous computing. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablets, computers, cameras and wearable devices. The encrypted file processing method for heterogeneous computing provided in the embodiment of the present application is explained below using an electronic device as an example of the execution subject.
[0071] like Figure 1 As shown, the encrypted file processing method of heterogeneous computing includes: step 110, step 120 and step 130.
[0072] It should be noted that the encrypted file processing method of heterogeneous computing can be applied to an operating system, the operating system can be deployed on a server host, and the operating system can be a Linux operating system, where Linux is a recursive abbreviation of Linux Is Not UniX, generally referring to GNU / Linux, which is a free-to-use and freely-disseminated Unix-like operating system. It is a multi-user, multi-tasking operating system that complies with POSIX (Portable Operating System Interface), supports multi-threading and multi-CPUs.
[0073] The operating system may include a transparent file system.
[0074] The transparent file system is designed with data caching and encrypted write-back functions.
[0075] like Figure 4 As shown, the operating system may include an application layer and a kernel layer, and the encrypted file processing method for heterogeneous computing provided in the embodiment of the present application may be applied to the kernel layer.
[0076] like Figure 3 As shown, the device layer may include an acceleration card corresponding to a disk and a field programmable gate array, and the device layer may be connected to a server host via a PCIe (peripheral component interconnect express) bus.
[0077] Step 110: When a write operation is received, the data to be processed is cached in a memory cache area in the transparent file system;
[0078] In this step, the write operation is an operation to modify or add data to a data carrier such as a storage device (such as a memory or a hard disk) or a database in a computer system.
[0079] The data to be processed is the original data content (such as text or binary stream) to be written to the disk, which has not yet been cached.
[0080] A memory cache is a temporary storage area in a computer's memory that is used to quickly store data.
[0081] For example, after the user performs a write operation at the application layer, the write operation process will enter the transparent file system, and cache space will be allocated for the entire file to be encrypted (data to be processed), that is, the data to be processed can be cached in the memory cache area in the transparent file system.
[0082] Step 120: When it is detected that the operating system triggers the write-back process, the field programmable gate array is called to perform encryption operation on the data to be processed in the memory cache area;
[0083] In this step, when the operating system triggers a write-back operation, the write-back operation can be started in the transparent file system, that is, hardware encryption operation can be performed and the encrypted data can be written back to the disk storage device.
[0084] Among them, the field programmable gate array can be called to perform encryption operations on the data to be processed.
[0085] A driver corresponding to the field programmable gate array may be deployed in the operating system and may be used to call a board device corresponding to the field programmable gate array to perform encryption operations on the data to be processed.
[0086] A field-programmable gate array (FPGA) is a chip with customizable hardware logic that can be programmed to implement specific algorithms (such as encryption and compression).
[0087] Field Programmable Gate Array supports hardware pipeline acceleration of encryption algorithms with less latency.
[0088] Step 130: Write the encrypted data to be processed into a disk storage device.
[0089] In this step, the disk storage device is connected to the server host where the operating system is located.
[0090] like Figure 4 As shown, the operating system can be installed on the server host, and the disk storage device can be connected to the server host.
[0091] The disk storage device can be connected to the server host via a PCIe bus.
[0092] After the data is encrypted by hardware acceleration modules such as FPGA, the FPGA can output ciphertext and verification information, etc., and then the ciphertext and verification information can be passed to the disk storage device through the storage stack.
[0093] Writing the encrypted data to be processed to a disk storage device enables P2P (peer-to-peer) data transmission between the FPGA and the disk.
[0094] During the research and development process, the inventors discovered that in the related art, in the traditional FPGA-based heterogeneous computing solution, the DIRECT IO non-cached write mode is adopted. The process is that after the application initiates a write operation, the FPGA needs to be used to encrypt the data, and then the data is returned to the operating system to continue the non-cached write process until it is written to the storage device. The method in the related art triggers the FPGA operation each time the data is encrypted. Frequent hardware interactions will cause hardware resources (such as PCIe bandwidth and FPGA computing power) to be inefficiently occupied, poor system performance and low data processing efficiency. Each write operation (even writing a very small piece of data) requires FPGA hardware encryption and data disk write operations. In scenarios such as high-frequency writing or random writing of small files, performance drops sharply, and the FPGA will accelerate aging due to continuous load, increasing the maintenance cost of the system.
[0095] In this application, if Figure 3 As shown in the figure, by inserting a transparent file system into the virtual file system and the underlying file system, transparent encryption operations can be achieved. Users can initiate write operations at the application layer and call the FPGA driver to perform encryption calculations without performing any additional operations.
[0096] Cache allocation and write-back functions are implemented in the transparent file system. When the operating system triggers the write-back process, FPGA encryption calculations and ciphertext data write operations are performed.
[0097] The transparent file system can intercept all write operations (encryption operations) and can be used for caching data and encrypted write-back.
[0098] According to the encrypted file processing method for heterogeneous computing provided in the embodiment of the present application, a transparent file system is inserted into the operating system. When a write-back operation is received, the data to be processed is cached in the memory cache area of the transparent file system. Then, when the write-back process is triggered, the FPGA is called in the transparent file system to encrypt the data to be processed, and the encrypted data is written to the disk. The cache allocation and write-back functions of the encrypted data are implemented in the transparent file system, and efficient write-back operations on encrypted files are achieved. This solves the problems of inefficient resource occupation, poor system performance, and low data processing efficiency caused by frequent hardware interactions during heterogeneous computing encryption operations, reduces system energy consumption and computing resource consumption, slows down the aging of the FPGA, reduces the maintenance cost of the system, and improves the response speed and overall performance of the system.
[0099] In some embodiments, calling a field programmable gate array to perform encryption operations on data to be processed in a memory buffer may include:
[0100] Sending the data to be processed to the device memory corresponding to the field programmable gate array;
[0101] Based on the encryption parameters corresponding to each computing unit, each computing unit is called to perform encryption operations on the data to be processed.
[0102] In this embodiment, the field-programmable gate array may include a plurality of computing units (CUs).
[0103] The number of multiple computing units can be determined based on the number of CU linked list nodes, wherein the value of the number of CU linked list nodes can be user-defined. For example, the number of CU linked list nodes can be set to 16, that is, the field editable gate array can be set to include 16 computing units.
[0104] When the encryption process is started, the write-back function of the transparent file system can call the FPGA driver interface to start FPGA data transfer. DMA (Direct Memory Access) can transfer the data block to the FPGA device memory through PCIe.
[0105] Each computing unit of the FPGA corresponds to encryption parameters, which include the location address of the encrypted data block in the device memory, the size of the encrypted data, and the storage address of the encryption result.
[0106] Each computing unit may perform encryption operations on the data to be processed corresponding to each computing unit based on the encryption parameters.
[0107] FPGA encryption IP can process data and generate ciphertext, and DMA can read the encryption result.
[0108] In some embodiments, before calling each computing unit to perform encryption operations on the data to be processed based on the encryption parameters corresponding to each computing unit, the method may further include:
[0109] Get multiple work items in the work queue corresponding to the operating system;
[0110] Divide the data to be processed into multiple data blocks and assign a data block to each work item;
[0111] Allocate a first target computing unit among the plurality of computing units to a target work item among the plurality of work items.
[0112] In this embodiment, Figure 5 As shown, a work queue can be created, and the work queue can include multiple work items (workers).
[0113] The data to be processed may be divided into multiple data blocks, each data block including at least part of the data to be processed, and the data size of each data block may be consistent. For example, the data to be processed may be divided into multiple data blocks of 256 KB each.
[0114] A corresponding data block may be allocated to each work item. For example, a work item may process a data block of 256 KB.
[0115] You can configure the work items in the work queue, get the CUid from the CU computing unit list, and assign a computing unit CU to each work item. Each work item can include encryption parameters corresponding to the data block. After starting the encryption process, you can configure encryption parameters for each computing unit.
[0116] The first target computing unit is any one of the multiple computing units, and the first target computing unit corresponds to the target work item.
[0117] A computing unit can correspond to a work item, and a work item can correspond to a data block.
[0118] According to the encrypted file processing method for heterogeneous computing provided in the embodiment of the present application, by creating multiple computing units corresponding to the FPGA, each computing unit processes the corresponding work items separately, so that multiple computing units can process independent work items simultaneously, thereby improving the parallel processing capability of the FPGA, improving the overall throughput and resource utilization, and improving work efficiency.
[0119] In some embodiments, before invoking each computing unit to perform encryption operations on the data to be processed based on the encryption parameters corresponding to each computing unit, the method may further include:
[0120] Dividing the data to be processed into a plurality of data blocks; each data block includes at least a portion of the data to be processed;
[0121] When it is detected that a target data block among the multiple data blocks includes a newly written data page, the target data block is copied to a buffer array in a device memory corresponding to the field programmable gate array to perform encryption operation on the target data block.
[0122] In this embodiment, the data to be processed may be divided into multiple data blocks, and the blocks are sent to the device memory of the FPGA.
[0123] For example, the data to be processed may be divided into multiple data blocks of 256 KB each, each of which includes multiple pages (data pages).
[0124] like Figure 5 As shown, for example, when a user modifies one page in a target data block, the target data block may be encrypted.
[0125] When the target data block is detected to include a newly written data page, that is, when a dirty page is detected in the target data block, the other pages in the target data block can be copied to a cache array (such as a temporary buffer array) in the device memory of the FPGA to perform block calculations on the encrypted data.
[0126] According to the encrypted file processing method of heterogeneous computing provided in the embodiment of the present application, the data to be processed is processed in blocks. When dirty data pages are detected in the target data block, the target data block is copied to a temporary cache array. The encrypted data can be calculated in blocks, and performance and consistency are balanced in random write scenarios. By reducing the number of encryption times, optimizing I / O and simplifying management, the overall system efficiency is improved.
[0127] In some embodiments, detecting that the operating system triggers a write-back process may include:
[0128] When it is detected that the operating system meets at least one of multiple trigger conditions, it is determined that the operating system triggers the write-back process; the multiple trigger conditions include: the pending data is not written to the disk storage device within the target time threshold, the remaining memory capacity corresponding to the operating system is less than the target capacity threshold, and a data synchronization command is received.
[0129] In this embodiment, the operating system may periodically check the age of dirty data through a kernel timer. For example, a target duration threshold may be set to 30 seconds. If there is data that has not been written to disk within 30 seconds, a write-back process may be triggered.
[0130] For example, the operating system can set a timer to trigger write-back at regular intervals, ensuring that data can be saved regularly even when no other conditions are triggered, thus avoiding data risks caused by long periods of non-writing.
[0131] The memory management subsystem can monitor the memory of the operating system and trigger the write-back process when the available memory (i.e., the remaining memory capacity) falls below the target capacity threshold.
[0132] When memory is insufficient, the system needs to release memory space and write dirty data pages back to disk, which can free up memory for other processes to use, helping to maintain system stability and performance and avoiding problems such as application crashes or system slowdowns caused by memory exhaustion.
[0133] When the user executes a data synchronization command (such as the sync command), the write-back process can be triggered and the data can be directly inserted into the write-back queue to ensure that the data is immediately written to the disk.
[0134] In the case of receiving a data synchronization command, the data may be immediately written to the disk in response to the data synchronization command.
[0135] According to the encrypted file processing method for heterogeneous computing provided in the embodiment of the present application, by setting multiple trigger conditions, when it is detected that the operating system meets at least one of the multiple trigger conditions, the operating system is determined to trigger the write-back process, thereby reducing the risk of data loss, meeting the persistence requirements of different scenarios, and balancing memory and disk resources, thereby improving overall efficiency.
[0136] like Figure 5 As shown, in some embodiments, caching the data to be processed into the memory cache area in the transparent file system may include:
[0137] Allocate a target buffer area for each data page in the data to be processed from the memory buffer area;
[0138] Each data page is cached in a target cache area corresponding to the data page, and each target cache area is inserted into a cache tree corresponding to the operating system.
[0139] In this embodiment, the transparent file system may allocate free cache pages (target cache area) from the memory pool, and copy each data page in the data to be processed to the target cache area.
[0140] The data pages may be allocated to a preset sub-area (target cache area) in the memory cache area according to characteristics such as access mode, size, type or association of the data pages.
[0141] The cached data pages can be organized into the global cache tree of the operating system according to a specific structure. Each node corresponds to a target cache area and records the metadata of the page (such as address, access time, and dirty flag).
[0142] According to the encrypted file processing method of heterogeneous computing provided in the embodiment of the present application, a target cache area is allocated to each data page in the data to be processed, and each data page is cached to its corresponding target cache area, and then inserted into the operating system cache tree. It supports multi-layer file system overlay, can adapt to load scenarios, and improves the scalability of the architecture.
[0143] like Figure 2 As shown, in some embodiments, upon receiving a write operation, caching the data to be processed into a memory cache area in the transparent file system may include:
[0144] In case of receiving a write operation, the write operation is sent to the virtual file system;
[0145] In case that it is detected that the write operation corresponds to the target flag parameter, the write operation is sent from the virtual file system to the transparent file system;
[0146] In response to a write operation, the data to be processed is cached in a memory cache area in the transparent file system.
[0147] In this embodiment, Figure 3 As shown, the kernel layer of the operating system includes a virtual file system, and the virtual file system is connected to the transparent file system.
[0148] The write operation of the application layer can enter the kernel layer of the operating system by calling the system call (such as the write() function). The system call first reaches the virtual file system, which is the entry point for the operating system to handle file operations. The virtual file system provides a unified interface, enabling the operating system to support multiple different file systems.
[0149] When receiving a write operation request, the virtual file system may check whether the target flag parameter is set. If the target flag parameter is set, the virtual file system will directly enter the DIRECT IO path.
[0150] The target flag parameter may be an O_DIRECT flag. The O_DIRECT flag is used to prompt the kernel layer to bypass the normal cache mechanism of the system and perform I / O operations directly. The data to be processed will not be cached in the page cache of the operating system, but will be processed by the transparent file system before being written to the disk.
[0151] The write operation can be sent from the virtual file system to the transparent file system. When the write operation process enters the transparent file system, a cache can be allocated for the entire encrypted file and these caches can be added to the cache tree of the operating system.
[0152] According to the encrypted file processing method for heterogeneous computing provided by the embodiment of the present application, after the write operation enters the virtual file system through a system call, when it is detected that the write operation corresponds to the O_DIRECT flag, the write operation can execute the DIRECT IO non-cached process, and the write process can then enter the transparent file system, thereby caching and writing back the data based on the transparent file system, realizing the cache write function of the heterogeneous computing system, and ultimately achieving the improvement of transparent and efficient encryption and cache write-back operations of data files in the encrypted heterogeneous computing framework.
[0153] In some embodiments, writing the encrypted data to be processed to a disk storage device may include:
[0154] Call the target write function to write the encrypted data to be processed to the disk storage device.
[0155] In this embodiment, the target write function corresponds to a target flag parameter (such as an O_DIRECT flag), which is a direct write method and can be written directly to the disk.
[0156] The target write function may be a Kernel_write function.
[0157] Calling the target write function can write the encrypted data directly to the disk storage device.
[0158] According to the encrypted file processing method for heterogeneous computing provided in the embodiment of the present application, by calling the target write function with a target flag parameter, the encrypted data is directly written to the disk storage device, thereby realizing P2P data transmission between the FPGA and the disk, reducing data latency, improving data throughput, and realizing end-to-end data encryption. It is suitable for confidential computing scenarios and has a wide range of applicable scenarios.
[0159] In some embodiments, writing the encrypted data to be processed to a disk storage device may include:
[0160] Based on the linked list arrangement order of the plurality of computing units, at least a portion of the to-be-processed data encrypted by each computing unit is written into the disk storage device.
[0161] In this embodiment, the field programmable gate array includes a plurality of computing units, each computing unit being used to perform encryption operations on at least a portion of the data to be processed. For example, each computing unit may be used to perform encryption operations on a block of data.
[0162] like Figure 5 As shown, based on the linked list arrangement order of multiple computing units, at least part of the encrypted data to be processed corresponding to each computing unit can be written to the disk storage device in turn, and the process is ended when it is determined that the last data block has been written to the disk.
[0163] Continue to refer Figure 5 In some embodiments, after writing at least a portion of the to-be-processed data encrypted by each computing unit to a disk storage device based on the linked list arrangement order of the plurality of computing units, the method may further include:
[0164] releasing a second target computing unit from the plurality of computing units;
[0165] Insert the second target computing unit into the target position in the linked list corresponding to the plurality of computing units.
[0166] In this embodiment, the second target computing unit is a computing unit corresponding to at least part of the to-be-processed data that has been written into the disk storage device.
[0167] When at least part of the to-be-processed data corresponding to the computing unit has been written into the disk storage device, the computing unit may be released and inserted into the target position in the CU linked list.
[0168] The target position may be the head or the tail, or other positions, which may be selected based on user needs and is not limited in this application.
[0169] In the actual implementation process, for example, the FPGA may be configured to include 16 computing units CU, and each computing unit CU may be capable of independently performing encryption calculations.
[0170] The CU linked list management of the computing unit is:
[0171] Initial linked list state: HEAD ->cu15 ->cu14 ->cu13 ->cu12 … ->cu2 ->cu1 ->cu0,
[0172] First iteration: HEAD ->cu0 ->cu15 ->cu14 ->cu13 … ->cu3 ->cu2 ->cu1,
[0173] Second iteration: HEAD ->cu1 ->cu0 ->cu15 ->cu14 … ->cu4 ->cu3 ->cu2,
[0174] The third iteration: HEAD ->cu2 ->cu2 ->cu0 ->cu15… ->cu5 ->cu4 ->cu3,
[0175] …
[0176] The above is the management of the computing unit CU linked list. First, a 16-node linked list is initialized. Each node represents the ID number of a computing unit CU. From the tail to the head of the linked list, they are cu0, cu1, cu2...cu15. During the first iteration, cu0 will be obtained from the tail of the linked list. When the calculation is completed, cu0 will be inserted into the head of the linked list. During the second iteration, cu1 will continue to be obtained from the tail of the linked list. When the calculation is completed, cu1 will be inserted into the head of the linked list. The operation is repeated in sequence. Each time a computing task is assigned, the ID of the cu node will be obtained from the tail of the linked list, thereby achieving the purpose of allocating and maintaining computing units.
[0177] According to the encrypted file processing method for heterogeneous computing provided in the embodiment of the present application, through the collaborative design of hardware linked list dynamic scheduling and FPGA acceleration, it is suitable for encryption scenarios that are sensitive to delay and computationally intensive, and provides high-performance and low-cost solutions for fields such as data centers, financial technology, and privacy computing.
[0178] In some embodiments, after inserting the second target computing unit into the target position in the linked list corresponding to the plurality of computing units, the method may further include:
[0179] When it is determined that there are data blocks that have not been written to the disk among the multiple data blocks, a computing unit is allocated to the data block that has not been written to the disk, so as to perform encryption calculations on the data blocks that have not been written to the disk based on the computing unit and write the data blocks that have not been written to the disk storage device until all the data blocks have been written to the disk storage device;
[0180] When it is determined that the plurality of data have been written into the disk storage device, the data encryption processing flow is terminated.
[0181] In this embodiment, Figure 5 As shown, after the data to be processed is divided into blocks, the data blocks can be encrypted and written to the disk in sequence. After the computing unit is released and reinserted into the linked list, it can be detected whether the last data block has been written to the disk.
[0182] If the last data block is not written to the disk, the process can return to the following steps: if it is detected that the target data block among the multiple data blocks includes a newly written data page, the target data block is copied to the cache array in the device memory corresponding to the field programmable gate array to perform encryption operation on the target data block; and the process continues to the next loop.
[0183] When the last data block is written to the disk, the data encryption process can be ended.
[0184] According to the encrypted file processing method of heterogeneous computing provided in the embodiment of the present application, when there are data blocks that have not been written to the disk in the data to be processed, the next cycle is continued to encrypt and write the data blocks that have not been written to the disk until all data blocks have been written to the disk, thereby ensuring data consistency.
[0185] The computer program product provided by the present application is described below. The computer program product described below and the encrypted file processing method of heterogeneous computing described above can be referenced to each other.
[0186] The embodiment of the present application provides an encrypted file processing method for heterogeneous computing, and the execution subject can be a computer program product. In the embodiment of the present application, the computer program product provided by the embodiment of the present application is described by taking the computer program product executing the encrypted file processing method for heterogeneous computing as an example.
[0187] An embodiment of the present application also provides a computer program product.
[0188] like Figure 6 As shown, the computer program product is applied to an operating system including a transparent file system; and includes: a first processing module 610 , a second processing module 620 and a third processing module 630 .
[0189] A first processing module 610 is configured to cache the data to be processed into a memory cache area in the transparent file system when a write operation is received;
[0190] The second processing module 620 is configured to call the field programmable gate array to perform encryption operations on the data to be processed in the memory cache area when detecting that the operating system triggers the write-back process;
[0191] The third processing module 630 is used to write the encrypted data to be processed into a disk storage device; the disk storage device is connected to the server host where the operating system is located.
[0192] According to the computer program product provided in the embodiment of the present application, a transparent file system is inserted into the operating system. When a write-back operation is received, the data to be processed is cached in the memory cache area of the transparent file system. Then, when the write-back process is triggered, the FPGA is called in the transparent file system to encrypt the data to be processed and write the encrypted data to the disk. The cache allocation and write-back functions of the encrypted data are implemented in the transparent file system, and efficient write-back operations on encrypted files are achieved. This solves the problems of inefficient resource occupation, poor system performance, and low data processing efficiency caused by frequent hardware interactions during heterogeneous computing encryption operations, reduces system energy consumption and computing resource consumption, slows down the aging of the FPGA, reduces the maintenance cost of the system, and improves the response speed and overall performance of the system.
[0193] In some embodiments, the field-editable gate array includes a plurality of computing units; the second processing module 620 may also be configured to:
[0194] Sending the data to be processed to the device memory corresponding to the field programmable gate array;
[0195] Based on the encryption parameters corresponding to each computing unit, each computing unit is called to perform encryption operations on the data to be processed.
[0196] In some embodiments, the computer program product may further include a fourth processing module configured to obtain a plurality of work items in a work queue corresponding to the operating system before invoking each computing unit to perform encryption operations on the data to be processed based on encryption parameters corresponding to each computing unit;
[0197] Dividing the data to be processed into a plurality of data blocks and allocating a data block to each work item; each data block includes at least a portion of the data to be processed;
[0198] Allocate a first target computing unit among the plurality of computing units to a target work item among the plurality of work items.
[0199] In some embodiments, the computer program product may further include a fifth processing module configured to divide the data to be processed into a plurality of data blocks before invoking each computing unit to perform an encryption operation on the data to be processed based on encryption parameters corresponding to each computing unit; each data block includes at least a portion of the data to be processed;
[0200] When it is detected that a target data block among the multiple data blocks includes a newly written data page, the target data block is copied to a buffer array in a device memory corresponding to the field programmable gate array to perform encryption operation on the target data block.
[0201] In some embodiments, the second processing module 620 may also be configured to:
[0202] When it is detected that the operating system meets at least one of multiple trigger conditions, it is determined that the operating system triggers the write-back process; the multiple trigger conditions include: the pending data is not written to the disk storage device within the target time threshold, the remaining memory capacity corresponding to the operating system is less than the target capacity threshold, and a data synchronization command is received.
[0203] In some embodiments, the first processing module 610 may also be configured to:
[0204] Allocate a target buffer area for each data page in the data to be processed from the memory buffer area;
[0205] Each data page is cached in a target cache area corresponding to the data page, and each target cache area is inserted into a cache tree corresponding to the operating system.
[0206] In some embodiments, the operating system includes a virtual file system, and the virtual file system is connected to the transparent file system; the first processing module 610 may also be used to:
[0207] In case of receiving a write operation, the write operation is sent to the virtual file system;
[0208] In case that it is detected that the write operation corresponds to the target flag parameter, the write operation is sent from the virtual file system to the transparent file system;
[0209] In response to a write operation, the data to be processed is cached in a memory cache area in the transparent file system.
[0210] In some embodiments, the third processing module 630 may also be configured to:
[0211] The target writing function is called to write the encrypted data to be processed into the disk storage device; the target writing function corresponds to a target flag parameter.
[0212] In some embodiments, the field programmable gate array includes multiple computing units, each of which is used to perform encryption operations on at least a portion of the data to be processed; the third processing module 630 may also be used to:
[0213] Based on the linked list arrangement order of the plurality of computing units, at least a portion of the to-be-processed data encrypted by each computing unit is written into the disk storage device.
[0214] In some embodiments, the computer program product may further include a sixth processing module configured to release a second target computing unit from the plurality of computing units after writing at least a portion of the encrypted data to be processed by each computing unit to the disk storage device based on the linked list arrangement order of the plurality of computing units; the second target computing unit being the computing unit corresponding to at least a portion of the data to be processed that has been written to the disk storage device;
[0215] Insert the second target computing unit into the target position in the linked list corresponding to the plurality of computing units.
[0216] The computer program product in the embodiments of the present application may be an electronic device or a component of an electronic device, such as an integrated circuit or chip. The electronic device may be a terminal or other device other than a terminal. For example, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA). It may also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine (ATM), or a self-service machine, etc., and the embodiments of the present application do not specifically limit this.
[0217] The computer program product in the embodiments of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
[0218] The computer program product provided in the embodiments of the present application can achieve Figures 1 to 5 To avoid repetition, the various processes implemented in the method embodiment are not described here.
[0219] In some embodiments, as Figure 7 As shown, an embodiment of the present application also provides an electronic device 700, including a processor 701, a memory 702, and a computer program stored in the memory 702 and executable on the processor 701. When the program is executed by the processor 701, each process of the embodiment of the encrypted file processing method of heterogeneous computing is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0220] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0221] like Figure 4 As shown, an embodiment of the present application also provides a heterogeneous computing system, including: an operating system, a disk storage device and an acceleration board.
[0222] In this embodiment, the operating system is deployed on the server host, and the operating system is deployed with a driver corresponding to the field programmable gate array.
[0223] The disk storage device can be connected to the server host through the PCIe bus.
[0224] The accelerator card can be connected to the server host through the PCIe bus, and the driver corresponding to the field programmable gate array is used to call the accelerator card.
[0225] The driver can also be used to configure and manage the accelerated computing device (i.e., acceleration board) corresponding to the FPGA.
[0226] The accelerator board can include: DEV_DMA-IP, encryption IP, memory controller and device memory.
[0227] DEV_DMA-IP is responsible for DMA data transmission on the PCIe bus.
[0228] Encryption IP is responsible for data encryption operations.
[0229] The memory controller manages the device's memory.
[0230] According to the heterogeneous computing system provided by the embodiment of the present application, a transparent file system is inserted into the operating system. When a write-back operation is received, the data to be processed is cached in the memory cache area of the transparent file system. Then, when the write-back process is triggered, the FPGA is called in the transparent file system to encrypt the data to be processed, and the encrypted data is written to the disk. The cache allocation and write-back functions of the encrypted data are implemented in the transparent file system, and efficient write-back operations on encrypted files are achieved. This solves the problems of inefficient resource occupation, poor system performance, and low data processing efficiency caused by frequent hardware interactions during heterogeneous computing encryption operations, reduces system energy consumption and computing resource consumption, slows down the aging of the FPGA, reduces the maintenance cost of the system, and improves the response speed and overall performance of the system.
[0231] In some embodiments, the operating system may include: an application layer and a kernel layer.
[0232] In this embodiment, the application layer is used to receive a write operation input by a user, and this operation is data encryption.
[0233] The kernel layer is connected to the application layer. The kernel layer is configured with a transparent file system, which can implement cache allocation and write-back functions within the kernel layer.
[0234] A write-back function can be implemented in a transparent file system. The main steps of the write-back function are: creating a computing unit CU linked list, creating a work queue, searching for blocks of data to be processed, configuring work items (assigning a computing unit to each work item), calling the FPGA driver to perform encryption calculations, and calling the target write function kernel_write to write the encrypted data directly to the disk storage device.
[0235] In this application, when the file system receives data that needs to be encrypted and stored, it does not immediately trigger the encryption operation and the process of writing to disk, but temporarily stores the data in the memory buffer of the operating system. The memory buffer has the advantage of fast reading and writing speeds, and can efficiently store data at this stage. For example, when the user executes the sync command in the command line, the write-back operation is triggered, and the system starts to execute the write-back process, that is, the data temporarily stored in the memory buffer is encrypted and written back to the disk in sequence according to the set rules and priorities. The encryption calculation is undertaken by the FPGA. By utilizing the parallel computing capability of the FPGA, it can quickly complete the encryption operation on batch data. After the data is encrypted, the encrypted data is formally written to the disk for persistent storage. This process realizes the organic combination of data caching, on-demand encryption and writing to disk, effectively reducing unnecessary encryption calculations and disk I / O operation frequency, and improving the performance of the encrypted heterogeneous computing system in the data storage link.
[0236] The heterogeneous computing system provided in this application can be applied to servers and acceleration boards, especially for computing-intensive tasks such as data security and encryption of large data files. It greatly improves the server's work efficiency and significantly reduces data transmission latency. It is suitable for fields with extremely high requirements for data security, such as government departments, financial institutions and other industries involving sensitive information processing. It can help these institutions not only improve the work efficiency of related businesses, but also ensure the security and compliance of data transmission, which can bring great economic benefits.
[0237] On the other hand, the present application also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it is implemented to perform the various processes of the embodiment of the encrypted file processing method of the above-mentioned heterogeneous computing, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0238] On the other hand, an embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned heterogeneous computing encryption file processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0239] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0240] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0241] Through the description of the above embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the relevant technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0242] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing encrypted files in heterogeneous computing, characterized in that: Applied to an operating system, the operating system includes a transparent file system; the method includes: When a write operation is received, the data to be processed is cached in a memory cache area in the transparent file system; In the case of detecting that the operating system triggers a write-back process, calling a field programmable gate array to perform encryption operation on the data to be processed in the memory cache area; Writing the encrypted data to be processed into a disk storage device; the disk storage device is connected to the server host where the operating system is located; The detecting that the operating system triggers the write-back process includes: determining that the operating system triggers a write-back process when detecting that the operating system satisfies at least one of a plurality of trigger conditions; the plurality of trigger conditions including: failure to write the to-be-processed data to the disk storage device within a target time threshold, remaining memory capacity corresponding to the operating system being less than a target capacity threshold, and receipt of a data synchronization command; The field programmable gate array includes a plurality of computing units, each of which is used to perform encryption operations on at least a portion of the data to be processed; and writing the encrypted data to be processed into a disk storage device includes: Based on the linked list arrangement order of the plurality of computing units, writing at least a portion of the to-be-processed data encrypted by each computing unit into the disk storage device; The memory buffer is a temporary storage area in the computer memory and is used for quickly storing data.
2. The method for processing encrypted files in heterogeneous computing according to claim 1, characterized in that: The field editable gate array includes a plurality of computing units; The calling of a field programmable gate array to perform encryption operation on the data to be processed in the memory cache area includes: Sending the data to be processed to a device memory corresponding to the field programmable gate array; Based on the encryption parameters corresponding to the calculation units, each calculation unit is called to perform encryption operation on the data to be processed.
3. The method for processing encrypted files in heterogeneous computing according to claim 2, characterized in that: Before calling each computing unit to perform encryption operation on the data to be processed based on the encryption parameters corresponding to each computing unit, the method further includes: Obtaining multiple work items in a work queue corresponding to the operating system; Dividing the data to be processed into a plurality of data blocks, and allocating the data blocks to each of the work items; each of the data blocks includes at least a portion of the data to be processed; Allocate a first target computing unit among the plurality of computing units to a target work item among the plurality of work items.
4. The method for processing encrypted files in heterogeneous computing according to claim 2, characterized in that: Before calling each computing unit to perform encryption operation on the data to be processed based on the encryption parameters corresponding to each computing unit, the method further includes: Dividing the data to be processed into a plurality of data blocks; each of the data blocks includes at least a portion of the data to be processed; When it is detected that a target data block among the multiple data blocks includes a newly written data page, the target data block is copied to a buffer array in a device memory corresponding to the field programmable gate array to perform an encryption operation on the target data block.
5. The method for processing encrypted files in heterogeneous computing according to any one of claims 1 to 4, characterized in that: The step of caching the data to be processed into a memory cache area in the transparent file system includes: Allocating a target buffer area for each data page in the data to be processed from the memory buffer area; Each of the data pages is cached in a target cache area corresponding to the data page, and each of the target cache areas is inserted into a cache tree corresponding to the operating system.
6. The method for processing encrypted files in heterogeneous computing according to any one of claims 1 to 4, characterized in that: The operating system includes a virtual file system connected to the transparent file system; and when a write operation is received, caching the data to be processed into a memory cache area in the transparent file system includes: Upon receiving the write operation, sending the write operation to the virtual file system; In a case where it is detected that the write operation corresponds to a target flag parameter, sending the write operation from the virtual file system to the transparent file system; In response to the write operation, the data to be processed is cached in the memory cache area in the transparent file system.
7. The method for processing encrypted files in heterogeneous computing according to any one of claims 1 to 4, characterized in that: Writing the encrypted data to be processed into a disk storage device includes: A target writing function is called to write the encrypted data to be processed into the disk storage device; the target writing function corresponds to a target flag parameter.
8. The method for processing encrypted files in heterogeneous computing according to claim 1, characterized in that: After writing at least a portion of the to-be-processed data encrypted by each computing unit into the disk storage device based on the linked list arrangement order of the plurality of computing units, the method further includes: releasing a second target computing unit among the plurality of computing units; the second target computing unit being a computing unit corresponding to at least part of the data to be processed that has been written into the disk storage device; Insert the second target computing unit into the target position in the linked list corresponding to the multiple computing units.
9. A computer program product, characterized in that Applied to an operating system, the operating system including a transparent file system; including: A first processing module is configured to cache the data to be processed into a memory cache area in the transparent file system when a write operation is received; A second processing module is configured to call a field programmable gate array to perform encryption operation on the data to be processed in the memory cache area when detecting that the operating system triggers a write-back process; A third processing module is configured to write the encrypted data to be processed into a disk storage device; the disk storage device is connected to the server host where the operating system is located; The second processing module is further configured to determine that the operating system triggers a write-back process when it is detected that the operating system satisfies at least one of a plurality of trigger conditions; the plurality of trigger conditions including: the to-be-processed data is not written to the disk storage device within a target time threshold, the remaining memory capacity corresponding to the operating system is less than a target capacity threshold, and a data synchronization command is received; The field programmable gate array includes a plurality of computing units, each of which is used to perform encryption operations on at least a portion of the data to be processed; the third processing module is further used to write at least a portion of the data to be processed encrypted by each computing unit to the disk storage device based on the order of arrangement of the linked list of the plurality of computing units; The memory buffer is a temporary storage area in the computer memory and is used for quickly storing data.
10. A heterogeneous computing system based on the encrypted file processing method of heterogeneous computing according to any one of claims 1 to 8, characterized in that: include: An operating system, the operating system being deployed on a server host, and the operating system being deployed with a driver corresponding to a field programmable gate array; A disk storage device connected to the server host; An acceleration board is connected to the server host, and a driver corresponding to the field programmable gate array is used to call the acceleration board.
11. The heterogeneous computing system according to claim 10, wherein: The operating system includes: An application layer, the application layer being used to receive write operations input by a user; A kernel layer, wherein the kernel layer is connected to the application layer, and the kernel layer is configured with a transparent file system.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the encrypted file processing method for heterogeneous computing according to any one of claims 1 to 8 is implemented.
13. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the encrypted file processing method of heterogeneous computing as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Transparent encryption and decryption computing system and method based on heterogeneous computing, equipment and medium
CN117349870A
Storage device, write-back method, and computer product
US20080052537A1