File access method and system, electronic device, and machine-readable storage medium

By introducing a file system client framework with shared memory space into the secure container, the memory and virtualization overhead issues when the secure container accesses the file system are resolved, achieving high-efficiency file I/O performance and access efficiency.

WO2024230779A1PCT designated stage expired Publication Date: 2024-11-14CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD

Patent Information

Application Number
PCT/CN2024/091976
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-11
Filing Date
2024-05-09
Publication Date
2024-11-14

AI Technical Summary

Technical Problem

When secure containers access files in the file system, existing technologies suffer from significant memory and virtualization overhead, especially when multiple secure containers need to access the same file. This requires deploying separate file system clients and reserving private data caches, leading to resource waste and performance degradation.

Method used

A file system client framework is adopted, which deploys an agent service program in the host user space and a file access service program in the guest kernel space. It provides a shared memory space, where the agent service program copies file data to the shared memory space, and the file access service program directly obtains data from the shared memory space, reducing direct interaction with the file system server.

Benefits of technology

By using a shared memory space design, memory overhead and virtualization overhead are reduced, file I/O performance and access efficiency are improved, and memory resource usage is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024091976_14112024_PF_FP_ABST
    Figure CN2024091976_14112024_PF_FP_ABST
Patent Text Reader

Abstract

One or more embodiments of the present description provide a file access method and system, an electronic device, and a machine-readable storage medium. The method is applied to a file system client corresponding to a secure container running on a guest. The file system client comprises a proxy service program deployed in a host user space and a file access service program deployed in a guest kernel space. The method comprises: loading a shared memory space between the proxy service program and the file access service program for a target secure container; the proxy service program copying, to the shared memory space, file data in a file system proxied by the proxy service program; and in response to an access request of the target secure container for target file data, the file access service program corresponding to the target secure container obtaining the target file data from the shared memory space.
Need to check novelty before this filing date? Find Prior Art

Description

File access method, system, electronic device and machine-readable storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 11, 2023, with application number CN 202310532937.2 and invention name “A file access method, system, electronic device and machine-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] One or more embodiments of the present specification relate to the field of secure container technology, and in particular, to a file access method, system, electronic device, and machine-readable storage medium. Background Art

[0003] Cloud file services based on distributed file system protocols allow file data to be accessed and shared over the network, with high flexibility.

[0004] When a secure container needs to access file data stored in a file, it is usually necessary to first deploy a file system client on the client where the secure container is located, and reserve a private data cache for the file system client. Furthermore, the file system client can obtain files in the file system from the file system server through various communication protocols and file system protocols, and write the obtained files to the private data cache reserved for the file system client. If multiple secure containers deployed on multiple clients need to access the same file in the file system, it is usually necessary to deploy a file system client on each client where the secure container is located, and reserve a private data cache for each file system client.

[0005] It can be seen that in the related technology, when the secure container accesses files in the file system, there are problems of large memory overhead and large virtualization overhead.

[0006] Summary of the Invention

[0007] The present application provides a file access method, which is applied to a file system client corresponding to a secure container running on a client; the file system client includes a proxy service program deployed in the host user space and a file access service program deployed in the client kernel space; the method includes: loading a shared memory space between the proxy service program and the file access service program for a target secure container; the proxy service program copies file data in the file system it represents to the shared memory space; in response to an access request from the target secure container for target file data, the file access service program corresponding to the target secure container obtains the target file data from the shared memory space.

[0008] The present application also provides a file access system, which includes a file system client corresponding to a secure container running on a client; the file system client includes a proxy service program deployed in the host user space and a file access service program deployed in the client kernel space; the file system client is used to implement the above method.

[0009] The present application also provides an electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via a bus; the memory stores machine-readable instructions, and the processor executes the above method by calling the machine-readable instructions.

[0010] The present application also provides a machine-readable storage medium, which stores machine-readable instructions. When the machine-readable instructions are called and executed by a processor, the above method is implemented.

[0011] Through the above embodiments, on the one hand, by providing a shared memory space for the proxy service program and the file access service program, and loading the shared memory space for the secure container, the file access service program corresponding to the secure container can directly obtain the file data that needs to be accessed from the shared memory space without reserving a private data cache for each secure container, thereby reducing memory overhead and achieving higher file I / O performance with fewer memory resources in a virtualized environment.

[0012] On the other hand, since the proxy service program can copy file data in the file system to the shared memory space, the file access service program can directly obtain file data from the shared memory space. Therefore, the file access service program does not need to go through complex communication protocols to directly interact with the file system server, thereby reducing the virtualization overhead in the file access process.

[0013] On the other hand, in response to the target security container's access request for the target file data, the file access service program corresponding to the target security container can obtain the target file data from the shared memory space; since the file access service program can use memory read and write instructions to access file data instead of system functions such as file reading and writing, the efficiency of the security container in accessing file data is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0015] FIG1 is a schematic diagram of the architecture of a file access system shown in an exemplary embodiment;

[0016] FIG2 is a schematic diagram of the architecture of another file access system according to an exemplary embodiment;

[0017] FIG3 is a flow chart of a file access method shown in an exemplary embodiment;

[0018] FIG4 is a schematic diagram of a shared memory space shown in an exemplary embodiment;

[0019] FIG5 is a schematic diagram showing an object addressing method based on a layout index according to an exemplary embodiment;

[0020] FIG6 is a schematic diagram of a copy-on-write mechanism according to an exemplary embodiment;

[0021] FIG7 is a schematic diagram showing memory resource allocation according to an exemplary embodiment;

[0022] FIG8 is a schematic structural diagram of an electronic device in which a file access device is located, according to an exemplary embodiment;

[0023] FIG9 is a block diagram showing a file access device according to an exemplary embodiment. DETAILED DESCRIPTION

[0024] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative work should fall within the scope of protection of this specification.

[0025] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0026] With the advent of the cloud-native era, more and more users are starting to use containers. Containers are a kernel virtualization technology of an operating system that can be used to isolate processes.

[0027] Traditional containers, such as runc containers, are based on operating system virtualization technology. They can use the host operating system and share the host kernel with other processes running on the host. Through system resource management components (such as cgroups) and the namespace mechanism, system resources can be allocated to each process and each process can be isolated.

[0028] A secure container, based on hardware virtualization technology, can use the operating system of a lightweight virtual machine (VM) running on the host machine; for example, a lightweight VM can be a microVM. Because each VM can have an independent guest kernel, the secure container running in each VM can use the kernel of that VM, eliminating the need to share the host kernel with other processes running on the host. Therefore, compared to traditional containers, secure containers provide better isolation and greater security.

[0029] Cloud file services based on distributed file system protocols enable file data to be accessed and shared over the network, offering high flexibility. Because cloud file services can separate storage from computing, they can also be referred to as storage services, though this specification does not specifically limit this. For example, cloud file services may specifically include, but are not limited to, file services based on NFS (Network File System), HDFS (Hadoop Distributed File System), and the like.

[0030] When a secure container needs to access file data stored in a file, it is usually necessary to first deploy a file system client on the client where the secure container is located and reserve a private data cache for the file system client; further, the file system client can obtain files in the file system from the file system server through various communication protocols and file system protocols, and write the obtained files to the private data cache reserved for the file system client.

[0031] Among them, if multiple security containers deployed in multiple clients need to access the same file in the file system, it is usually necessary to deploy file system clients separately on the clients where each security container is located, and reserve a private data cache for each file system client; further, each file system client can obtain files in the file system from the file system server separately, and write the obtained files into the private data cache reserved for each file system client.

[0032] For example, please refer to Figure 1, which is a schematic diagram of the architecture of a file access system shown in an exemplary embodiment. As shown in Figure 1, the secure container Guest Instance 0 and the secure container Guest Instance 1 can run on different clients carried by the host machine, and can use the client kernel where they are located. In order to access files in the file system, a file system client (Guest FS client) can be deployed for the secure container Guest Instance 0 and the secure container Guest Instance 1 respectively, and a private data cache (data cache) can be reserved for each file system client. Furthermore, each file system client can obtain files in the file system from a distributed file system server (distributed file system server) via the network and write the obtained files into a private data cache (data cache). Furthermore, the file system client (Guest FS client) can provide file data stored in the private data cache (data cache) to the application (Application) running in the secure container. In addition, the secure container can also include a virtualized NIC (virtualized NIC) for communicating with the distributed file system server (distributed file system server), which will not be described in detail here.

[0033] It can be seen that in the embodiments of the related technology shown above, on the one hand, the memory overhead is large due to the need to reserve a private data cache for each file system client; and if multiple security containers access the same file in the file system, multiple file copies of the file need to be written into the private data cache reserved for each file system client, which also causes a waste of memory resources.

[0034] On the other hand, although secure containers have better isolation and security than traditional containers, they also need to go through more complex communication protocols when accessing files in the file system, resulting in higher virtualization overhead.

[0035] In view of this, this specification aims to propose a new file system client framework designed for secure containers, which can achieve higher file data I / O performance with less memory resources in a virtualized environment.

[0036] The new file system client proposed in this specification can include a proxy service program deployed in the user space of a host machine and a file access service program deployed in the kernel space of a client machine. Furthermore, the host machine equipped with the client machine can provide a shared memory space for the proxy service program and the file access service program. The shared memory space can be considered a virtual storage device. The proxy service program can act as a proxy for the file system and copy file data of one or more files in the file system to the shared memory space.

[0037] When the file system client is started or each secure container is started, the shared memory space can be loaded separately for each secure container that may need to access files in the file system.

[0038] When the target security container needs to access a file in the file system, in response to the target security container's access request for the target file data, the file access service program corresponding to the target security container can obtain the target file data from the shared memory space.

[0039] The target secure container can be any secure container running on any client computer on the host computer. The target file data refers to at least a portion of the file data stored in a file system that the secure container needs to access. The file system can be a distributed remote file system or a local file system of the host computer, and this specification does not specifically limit this.

[0040] For example, please refer to Figure 2, which is a schematic diagram of the architecture of another file access system shown in an exemplary embodiment. As shown in Figure 2, the secure container Guest Instance 2 and the secure container Guest Instance 3 can be respectively run on different clients carried by the host machine, and can use the client kernel where they are located. The file system client corresponding to the secure container can include a proxy service program (as shown in Figure 2, the FS client module in host user space) and a file access service program deployed in the client kernel space (as shown in Figure 2, the FS client module in guest kernel); wherein, a file access service program can be deployed separately for each secure container; and each file access service program corresponding to each secure container can communicate with the same proxy service program.

[0041] It should be noted that, as shown in Figure 2, when deploying a file system client for a secure container, there is no need to reserve a private data cache for each secure container. It is only necessary to provide shared memory space (shared memory) for the proxy service program and the file access service program, and load the shared memory space between the proxy service program and the file access service program for each secure container separately. This allows the file access service programs corresponding to each secure container to access file data through the shared memory space.

[0042] As shown in Figure 2, the proxy service program can act as a proxy for the file system, access the distributed file system server through the network, obtain file data in the file system from the file system server, and copy the obtained file data to the shared memory space; that is, for the host machine, the shared memory space can be regarded as a memory-mapped file, and the memory-mapped file can be shared by processes running on the client. Furthermore, assuming that the target secure container is the secure container Guest Instance 2, in response to the secure container Guest Instance 2's access request for the target file data, the file access service program corresponding to the secure container Guest Instance 2 (that is, the FS client module in the guest kernel deployed in Guest Instance 2 in Figure 2) can obtain the target file data from the shared memory space.

[0043] It can be seen that in the technical solution in this specification, on the one hand, by providing a shared memory space for the proxy service program and the file access service program, and loading the shared memory space for the secure container, the file access service program corresponding to the secure container can directly obtain the file data that needs to be accessed from the shared memory space without reserving a private data cache for each secure container, thereby reducing memory overhead and achieving higher file I / O performance with fewer memory resources in a virtualized environment.

[0044] On the other hand, since the proxy service program can copy file data in the file system to the shared memory space, the file access service program can directly obtain file data from the shared memory space. Therefore, the file access service program does not need to go through complex communication protocols to directly interact with the file system server, thereby reducing the virtualization overhead in the file access process.

[0045] On the other hand, in response to the target security container's access request for the target file data, the file access service program corresponding to the target security container can obtain the target file data from the shared memory space; since the file access service program can use memory read and write instructions to access file data instead of system functions such as file reading and writing, the efficiency of the security container in accessing file data is improved.

[0046] The present application is described below through specific embodiments and in combination with specific application scenarios.

[0047] Please refer to Figure 3, which is a flowchart of a file access method according to an exemplary embodiment. The file access method can be applied to the file system client shown in Figure 2; the file system client can include a proxy service program deployed in the user space of the host machine and a file access service program deployed in the kernel space of the client machine.

[0048] The host machine may be a bare metal server or other physical device. The client machine may be a lightweight virtual machine installed on the host machine. The proxy service program may be a thread or process running on the host machine. The file access service program may be a thread or process running on the client machine.

[0049] As shown in FIG3 , the file access method may perform the following steps:

[0050] Step 302: Load the shared memory space between the proxy service program and the file access service program for the target secure container.

[0051] For example, referring to Figure 2, secure container Guest Instance 2 and secure container Guest Instance 3 can each run on a different client machine hosted by a host machine. The host machine can provide shared memory between the proxy service program and the file access service program. In response to the target secure container Guest Instance 2 being started, or in response to the file system client being started, the shared memory can be loaded for the target secure container Guest Instance 2.

[0052] In step 302, the shared memory space may also be referred to as shared memory, shared memory window, etc., which is not specifically limited in this specification. The shared memory space is an addressable space that can be shared by a host machine and multiple virtual machines hosted by the host machine.

[0053] In one embodiment shown, in response to the file system client being started, a virtual address space corresponding to the shared memory space can be allocated to the proxy service program, and a shared physical address space corresponding to the shared memory space can be applied for the proxy service program, and the applied shared physical address space can be mapped to the virtual address space allocated to the proxy service program to load the shared memory space for the proxy service program.

[0054] In this case, in response to the target secure container being started or the file system client being started, the shared memory space between the proxy service program and the file access service program for loading the target secure container may specifically include: allocating a private virtual address space corresponding to the shared memory space to the file access program corresponding to the target secure container; mapping the shared physical address space corresponding to the shared memory space applied for by the proxy service program to the private virtual address space allocated to the file access program corresponding to the target secure container, so as to complete the loading of the shared memory space for the target secure container.

[0055] Step 304: The proxy service program copies the file data in the proxy file system to the shared memory space.

[0056] For example, referring to Figure 2, the proxy service program (i.e., the FS client module in host user space in Figure 2) can act as a proxy for the file system and access the distributed file system server through RPC (Remote Procedure Call). The proxy service program can obtain file data from the file system at a preset period or based on actual file access needs, and copy the obtained file data to the shared memory space.

[0057] For another example, the proxy service program may first access the file system server through RPC, store the files obtained from the file system server in the local file system, and then copy the file data in the files stored in the local file system to the shared memory space.

[0058] Among them, in step 304, the proxy service program copies the file data in the file system it proxies to the shared memory space, which may specifically include: the proxy service program writes the file data in the file system it proxies to the shared physical address space corresponding to the shared memory space, and maps the file data written to the shared physical address space to the virtual address space allocated to the proxy service program, and maps the file data written to the shared physical address space to the private virtual address space allocated to the file access service program corresponding to each secure container.

[0059] In addition, because the shared memory space has limited memory capacity, as shown in Figure 2 , a cache layer can be deployed in the host machine for the file system client. The cache layer can include a data cache for storing file data that has been replaced from the shared memory space due to insufficient space. The cache layer can also be used to manage file leases, refresh and invalidate locally cached file data, etc. The cache layer can be stacked on the host machine's local file system or on the client of a remote file system, and this specification does not impose any special restrictions on this.

[0060] In addition, as shown in Figure 2, the host can also deploy a protocol layer for the file system client, allowing the file system client to comply with NFS, HDFS, or other file system protocols. The host can also deploy a user-space pooled connection control layer for the file system client to achieve high-performance elastic networking.

[0061] In one embodiment shown, the shared memory space is used not only to cache file data but also to cache index data corresponding to the written file data.

[0062] During implementation, the proxy service program copies the file data in the file system it proxies to the shared memory space, which may specifically include: the proxy service program copies the file data in the file system it proxies to the first memory address space in the shared memory space; wherein, the first memory address space is used to store file data shared by the file access service program and the proxy service program; the proxy service program stores the layout index corresponding to the file data copied to the first memory address space in the shared memory space; wherein, the layout index is used to indicate the index node of the file data corresponding thereto, and is used to indicate the file offset of the file data corresponding thereto; the file offset is the offset of the corresponding file data in the file where it is located.

[0063] For example, referring to Figure 4, which is a schematic diagram of a shared memory space according to an exemplary embodiment, as shown in Figure 4, the proxy service program can copy file data from the file system to a shared data region in the shared memory space; the proxy service program can also store a layout index corresponding to the file data copied to the shared data region in a shared index region in the shared memory space.

[0064] The file data stored in the shared data area may be managed by a page cache mechanism of the operating system, that is, the file data may be written into a memory page in the shared data area.

[0065] For example, as shown in FIG4 , the proxy service program can copy file data to memory page PG0 in the page array in the shared data region, and can store the layout index PG_info0 corresponding to the file data copied to memory page PG0 in the PG_info array in the shared index region. In addition, the value of the version identifier ver0 in the version array in the shared index region can also be updated. It should be noted that the array length of the PG_info array in the shared index region is the same as the number of memory pages in the shared data region, and is also the same as the array length of the version array in the shared index region, and the slots are one-to-one corresponding. Each slot in the PG_info array can contain the inode identifier of the corresponding page and the file offset of the file data in the corresponding page. In other words, the PG_info array can be used as a fixed-size hash table.

[0066] In some possible embodiments, since shared memory page management requires the use of memory management mechanisms provided by the operating system kernel, a 64-byte struct page is typically reserved for each 4KB page to manage the corresponding page. However, in the technical solution of this specification, since the layout index corresponding to the file data in the shared data area does not participate in the operating system's management of memory pages, there is no need to reserve space occupied by metadata (i.e., struct pages) for each memory page in the shared data area, thereby further conserving memory resources.

[0067] Step 306: In response to the access request of the target security container for the target file data, the file access service program corresponding to the target security container obtains the target file data from the shared memory space.

[0068] For example, after the shared memory space (shared memory) is loaded for the target secure container Guest Instance 2, and the proxy service program (FS client module in host user space) copies the target file data in the file system to the shared memory space, in response to the target secure container Guest Instance 2's access request for the target file data, the file access service program (FS client module in guest kernel) corresponding to the target secure container Guest Instance 2 can obtain the target file data from the shared memory space, and then provide the obtained target file data to the application (Application) running in the target secure container Guest Instance 2.

[0069] It should be noted that in the embodiment shown above, the application (Application) running in the target secure container Guest Instance 2 can directly copy the target file data obtained by the file access service program (FS client module in guest kernel) from the shared memory space, and the file access service program (FS client module in guest kernel) does not need to cache the target file data obtained from the shared memory space.

[0070] In one embodiment shown, since the memory capacity of the shared memory space is limited and the file system can store massive amounts of file data, the proxy service program can only copy part of the file data to the shared memory space, and the file data that the target secure container actually needs to access may not have been copied to the shared memory space.

[0071] In this case, in response to the target security container's access request for the target file data, the file access service program corresponding to the target security container obtains the target file data from the shared memory space, which may specifically include: in response to the target security container's access request for the target file data, the file access service program corresponding to the target security container searches for the target file data in the shared memory space; if the file access service program corresponding to the target security container finds the target file data in the shared memory space, the file access service program corresponding to the target security container reads the target file data from the shared memory space.

[0072] Wherein, in step 306, the access request may be used to perform a read operation on the target file data.

[0073] For example, referring to FIG2 , in response to the target security container Guest Instance 2's access request for the target file data, the file access service program corresponding to the target security container Guest Instance 2 (i.e., the FS client module in guest kernel deployed in Guest Instance 2 in FIG2 ) can search for the target file data in the shared memory space; if the file access service program finds the target file data in the shared memory space, the file access service program can read the target file data from the shared memory space.

[0074] In this case, in response to the target security container's access request for the target file data, the file access service program corresponding to the target security container obtains the target file data from the shared memory space, which may also specifically include: if the file access service program corresponding to the target security container does not find the target file data in the shared memory space, the file access service program corresponding to the target security container sends an access request for the target file data to the proxy service program; in response to the access request, the proxy service program obtains the target file data from the file system and copies the obtained target file data to the shared memory space; the file access service program corresponding to the target security container reads the target file data from the shared memory space.

[0075] For example, referring to Figure 2, assume that the target file data is specifically a page with an inode identifier of 10 and a file offset of 8192; in response to the target security container Guest Instance 2's access request for the target file data, the file access service program corresponding to the target security container Guest Instance 2 (that is, the FS client module in guest kernel deployed in Guest Instance 2 in Figure 2) can search for the target file data in the shared memory space; if the file access service program does not find the target file data in the shared memory space, the file access service program corresponding to the target security container Guest Instance 2 can send an access request RPC-0 for the target file data to the proxy service program (that is, the FS client module in host user space in Figure 2); in response to the access request RPC-0, the proxy service program can send a request to the file system server (distributed file system server) sends an access request RPC-1 for the target file data, obtains the target file where the target file data is located from the file system server, and copies the target file data in the obtained target file to the shared data area included in the shared memory space according to the file offset. The address offset of the target file data in the shared memory space can be 16384; further, after receiving the response message of the access request RPC-0, the file access service program corresponding to the target security container Guest Instance 2 can re-search the target file data in the shared memory space, and can read the target file data from the offset 16384.

[0076] It should be noted that, in the embodiment shown above, since the file data in the shared memory space can be shared by the secure containers running in the host machine and multiple clients, and each secure container can separately manage the private virtual address space allocated to it, therefore, after determining the address offset of the target file data in the shared memory space, the file access service program corresponding to the target secure container can calculate the virtual address of the target file data mapped to the private virtual address space allocated to the secure container based on the base address of the target secure container and the address offset.

[0077] For example, please refer to Figure 5, which is a schematic diagram of an object addressing based on a layout index shown in an exemplary embodiment. As shown in Figure 5, the base addresses of the secure container Guest Instance 2, the secure container Guest Instance 3, and the host machine HOST are 0xffff2000, 0xffff6000, and 0x7fff0000, respectively. In response to the target secure container Guest Instance 2's access request for the target file data, the file access service program corresponding to the target secure container Guest Instance 2 finds the address offset of the target file data in the shared memory space as offset (such as 16384). Then, the file access service program corresponding to the target secure container Guest Instance 2 can determine that the virtual address of the target file data mapped in the private virtual address space of the target secure container Guest Instance 2 is (0xffff2000+offset).

[0078] In one embodiment shown, the access request may carry a target layout index corresponding to the target file data. In this case, in response to the target security container's access request for the target file data, the file access service program corresponding to the target security container obtains the target file data from the shared memory space. Specifically, this may include: in response to the target security container's access request for the target file data, the file access service program corresponding to the target security container calculates a hash value of the target layout index, modulo the hash value, and determines the target memory address of the target file data in the first memory address space based on the modulo value; determines whether the layout index corresponding to the target memory address stored in the shared memory space is consistent with the target layout index; if the layout index corresponding to the target memory address is consistent with the target layout index, the file access service program corresponding to the target security container reads the target file data from the first memory address space based on the target memory address.

[0079] For example, assume that the target file data is specifically the file data in the target page with inode identifier 10 and file offset 8192; in response to the access request of the target security container Guest Instance 2 for the target file data, the file access service program corresponding to the target security container Guest Instance 2 can calculate the hash value of the target layout index, perform modulo (mod) on the calculated hash value, and determine that the target page is memory page PG100 in the page array according to the modulo value, and can determine that the layout index corresponding to the memory page PG100 is PG_info100 in the PG_info array; further, if it is determined that the inode identifier contained in the layout index PG_info100 is 10 and the file offset is 8192, which are consistent with the target layout index, then the file access service program corresponding to the target security container Guest Instance 2 can read the target file data in the memory page PG100 from the shared data area.

[0080] In one embodiment, to ensure the security of file data cached in the shared memory space and prevent it from being tampered with by malicious container instances, only the host is allowed to modify the file data in the shared data area. Secure containers can modify copies of the file data based on a log write mechanism, and the host merges the modifications made by each secure container to the file data in the shared data area. This embodiment, based on the inherent characteristics of the log write mechanism, can also reduce the memory overhead associated with file data modification operations.

[0081] In this case, as shown in Figure 2, the shared memory space may also include a private write log region allocated for the secure container. In step 306, if the access request initiated by the target secure container is used to perform a write operation on the target file data, the method may further include: the file access service program corresponding to the target secure container copies the found target file data to a second memory address space in the shared memory space; wherein the second memory address space is a memory address space allocated to the target secure container in the shared memory space for performing a write log operation on the target file data; the file access service program corresponding to the target secure container performs a write log operation on the target file data copied to the second memory address space to obtain the target file data modified by the target secure container; the proxy service program updates the target file data stored in the first memory address space based on the target file data modified by the target secure container stored in the second memory address space.

[0082] For example, please refer to FIG6 , which is a schematic diagram of a log writing mechanism according to an exemplary embodiment. As shown in Figure 6, the file data cached in the shared data area of ​​the shared memory space can be mapped to the private virtual address space of the secure container Guest Instance 2 and the private virtual address space of the secure container Guest Instance 3 respectively; if the target secure container Guest Instance 2 requests to perform a write operation on the target file data cached in the shared data area, a private write log area can be allocated to the target secure container Guest Instance 2 in the shared memory space first, and the target file data cached in the shared data area can be copied to the write log area, so that the target secure container Guest Instance 2 can perform a write operation on the target file data in its own private write log area to obtain the target file data modified by the target secure container Guest Instance 2; further, a ring queue can be used to store the file data modified by the target secure container Guest Instance 2 in the write log area, and the proxy service program can check the status of the ring queue and update the target file data stored in the shared data area according to the target file data modified by the target secure container Guest Instance 2, that is, the proxy service program can merge the modified content of the target secure container for the target file data into the shared data area. For the specific implementation of the log writing mechanism, please refer to the relevant technology and will not be described in detail here.

[0083] Specifically, modifying the file data in the shared data area may include updating page content and replacing pages.

[0084] In some possible embodiments, in addition to storing file data and index data, the shared memory space may also store usage identifiers and version identifiers corresponding to the file data. The usage identifier may be used to indicate whether the corresponding file data is currently being written, and the version identifier may be used to indicate the number of times the corresponding file data has been modified by each secure container.

[0085] For example, as shown in FIG4 , the shared memory space may further include a usage tracking region, which may be used to record access by a secure container to file data cached in each memory page in the shared data area. If a secure container accesses file data cached in memory page PG0, the value of the usage identifier use0 corresponding to memory page PG0 may be updated from 0 to 1. The shared index region of the shared memory space may further include a version identifier array, which may be used to record version identifiers corresponding one-to-one to each memory page in the shared data area.

[0086] In this case, the method may further include: in response to the target file data being subjected to a log write operation, updating the usage identifier corresponding to the target file data from a first value to a second value; wherein the usage mark is the first value, used to indicate that the corresponding file data is not being subjected to a log write operation; the usage mark is the second value, used to indicate that the corresponding file data is being subjected to a log write operation; in response to the proxy service program completing the update of the target file data stored in the first memory address space, updating the usage identifier corresponding to the target file data from the second value to the first value, and updating the version identifier corresponding to the target file data.

[0087] For example, in response to the file access service program corresponding to the target security container Guest Instance 2 performing a log operation on the file data cached in the memory page PG0, the value of the usage identifier use0 corresponding to the memory page PG0 can be updated from 0 to 1 to indicate that the corresponding target file data is being written; in response to the proxy service program completing the update of the data cached in the memory page PG0 in the shared data area, the value of the usage identifier use0 can be updated from 1 to 0 to indicate that the corresponding target file data has been updated and is not being written, and the value of the version identifier ver0 corresponding to the memory page PG0 can be increased by 1.

[0088] In one possible example, the version identifier may be a 4-byte field, the highest bit in the field may be used as a flag bit PENDING, and the flag bit PENDING may be used as a usage identifier, thereby further saving memory resources.

[0089] In other possible embodiments, if the access request is used to perform a read operation on the target file data, the version identifier corresponding to the target file data can be obtained respectively before and after the read operation on the target file data; if they are consistent, it means that the target file data has not been modified during the read operation, and the latest version of the target file data is obtained; if they are inconsistent, it means that the target file data has been modified during the read operation, and the read operation on the target file data needs to be performed again to obtain the latest version of the target file data.

[0090] In this case, the method may also include: in response to the file access service program corresponding to the target security container finding the target file data in the shared memory space, obtaining the version identifier corresponding to the target file data from the shared memory space; in response to the file access service program corresponding to the target security container completing reading the target file data from the shared memory space, obtaining the version identifier corresponding to the target file data from the shared memory space again, and determining whether the version identifier obtained again is consistent with the version identifier obtained previously; if inconsistent, the file access service program corresponding to the target security container re-reads the target file data from the shared memory space.

[0091] For example, in response to the file access service program corresponding to the target security container Guest Instance 2 finding the target file data in the shared memory space, the version identifier "n" corresponding to the target file data can be obtained from the shared memory space; in response to the file access service program corresponding to the target security container Guest Instance 2 completing reading the target file data from the shared memory space, the version identifier "n" corresponding to the target file data can be obtained again from the shared memory space; since the version identifier obtained again is consistent with the version identifier obtained previously, it means that the file access service program corresponding to the target security container Guest Instance 2 has obtained the latest version of the target file data from the shared memory space.

[0092] For another example, in response to the file access service program corresponding to the target security container Guest Instance 2 finding the target file data in the shared memory space, the version identifier "n" corresponding to the target file data can be obtained from the shared memory space; during the read operation, the security container Guest Instance3 performs a write operation on the target file data with version identifier "n", resulting in the version identifier corresponding to the target file data being updated to "n+1"; in response to the file access service program corresponding to the target security container Guest Instance 2 completing the reading of the target file data from the shared memory space, the version identifier "n+1" corresponding to the target file data can be obtained again from the shared memory space; since the version identifier obtained again is inconsistent with the version identifier obtained previously, it means that the file access service program corresponding to the target security container Guest Instance 2 does not obtain the latest version of the target file data from the shared memory space, so the file access service program corresponding to the target security container Guest Instance 2 needs to re-read the target file data from the shared memory space to obtain the latest version of the target file data.

[0093] In addition, in one possible example, in order to avoid the need to re-acquire the target file data from the shared memory space, the file access service program can first determine whether the target file data is being written based on the usage identifier corresponding to the target file data. If so, the read operation on the target file data is temporarily not performed.

[0094] For example, assuming that the security container Guest Instance3 is performing a write operation on the target file data, the value of the flag bit PENDING corresponding to the target file data is updated from 0 to 1; in response to the file access service program corresponding to the target security container Guest Instance2 finding the target file data in the shared memory space, the value of the flag bit PENDING corresponding to the target file data can be obtained from the shared memory space as 1, then the file access service program corresponding to the target security container Guest Instance2 can temporarily not perform a read operation on the target file data until the value of the flag bit PENDING corresponding to the target file data is updated from 1 to 0.

[0095] It should be noted that in the embodiments shown above, in order to avoid complex reasoning about fault stop conditions, the file system client can be designed as a lock-free model and can implement atomic data reading based on version identifiers and fence instructions. Since the CPU may automatically adjust the execution order of each machine instruction when executing multiple machine instructions, for example, during the process of writing the target file data to the target secure container, the proxy service program first updates the version identifier corresponding to the target file data before updating the target file data stored in the first memory address space, causing the file access programs corresponding to other secure containers to mistakenly believe that the target file data has been updated; therefore, based on the fence instruction, the execution order of "updating the usage identifier corresponding to the target file data from the first value to the second value" → "writing the target file data in the shared memory space" → "updating the usage identifier corresponding to the target file data from the second value to the first value and updating the version identifier corresponding to the target file data" can be guaranteed.

[0096] In one embodiment shown, the file system client can support access to multiple file systems; the host user space can be deployed with multiple proxy service programs that act as agents for the multiple file systems respectively; the shared memory space may include multiple shared memory subspaces allocated to the multiple proxy service programs respectively.

[0097] In this case, the file system client needs to determine the memory capacity of the shared memory subspace allocated to each file system. The method may also include: determining the memory capacity of the shared memory subspace allocated to each file system based on the number of accesses performed by the target security container on each of the multiple file systems.

[0098] For example, see Figure 7, which is a schematic diagram illustrating memory resource allocation according to an exemplary embodiment. As shown in Figure 7, the daemon of each file system client can determine the cache hit ratio corresponding to each file system and the memory capacity (cache size) of the shared memory subspace currently allocated for each file system. Furthermore, the coordinator running on the host machine can determine the memory capacity (expected cache size) of the shared memory subspace allocated for each file system based on the number of accesses made by the target secure container to each file system.

[0099] It can be seen from the above technical solutions that, on the one hand, by providing shared memory space for the proxy service program and the file access service program, and loading the shared memory space for the secure container, the file access service program corresponding to the secure container can directly obtain the file data that needs to be accessed from the shared memory space without reserving private data cache for each secure container, thereby reducing memory overhead and achieving higher file I / O performance with fewer memory resources in a virtualized environment.

[0100] On the other hand, since the proxy service program can copy file data in the file system to the shared memory space, the file access service program can directly obtain file data from the shared memory space. Therefore, the file access service program does not need to go through complex communication protocols to directly interact with the file system server, thereby reducing the virtualization overhead in the file access process.

[0101] On the other hand, in response to the target security container's access request for the target file data, the file access service program corresponding to the target security container can obtain the target file data from the shared memory space; since the file access service program can use memory read and write instructions to access file data instead of system functions such as file reading and writing, the efficiency of the security container in accessing file data is improved.

[0102] Corresponding to the above-mentioned embodiment of the file access method, this specification also provides an embodiment of a file access system and an embodiment of a file access device.

[0103] In this specification, the file access system may execute steps 302 to 306 to implement the technical solution of this specification.

[0104] Please refer to Figure 8, which is a hardware structure diagram of an electronic device in which a file access device is located, shown in an exemplary embodiment. At the hardware level, the device includes a processor 802, an internal bus 804, a network interface 806, a memory 808, and a non-volatile memory 810, and of course may also include other required hardware. One or more embodiments of this specification can be implemented based on software, such as the processor 802 reading the corresponding computer program from the non-volatile memory 810 into the memory 808 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logical devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logical unit, but can also be hardware or logical devices.

[0105] Please refer to Figure 9, which is a block diagram of a file access device shown in an exemplary embodiment. The file access device can be applied to an electronic device as shown in Figure 8 to implement the technical solution of this specification. Among them, the file access device can be applied to a file system client corresponding to a security container running on a client; the file system client includes a proxy service program deployed in the user space of the host machine and a file access service program deployed in the kernel space of the client; the file access device may include: a loading unit 902, which is used to load a shared memory space between the proxy service program and the file access service program for the target security container; a copying unit 904, which is used for the proxy service program to copy the file data in the file system it proxies to the shared memory space; a first acquisition unit 906, which is used to respond to the target security container's access request for the target file data, and the file access service program corresponding to the target security container obtains the target file data from the shared memory space.

[0106] In this embodiment, the loading unit 902 is specifically used to: allocate a private virtual address space corresponding to the shared memory space to the file access program corresponding to the target secure container; map the shared physical address space corresponding to the shared memory space applied for by the proxy service program to the private virtual address space allocated to the file access program corresponding to the target secure container, so as to complete the loading of the shared memory space for the target secure container.

[0107] In this embodiment, the first acquisition unit 906 is specifically used to: in response to the access request of the target security container for the target file data, the file access service program corresponding to the target security container searches for the target file data in the shared memory space; if the file access service program corresponding to the target security container finds the target file data in the shared memory space, the file access service program corresponding to the target security container reads the target file data from the shared memory space.

[0108] In this embodiment, the device also includes: a sending unit, which is used for sending an access request for the target file data to the proxy service program if the file access service program corresponding to the target security container fails to find the target file data in the shared memory space; a second acquisition unit, which is used for the proxy service program to obtain the target file data from the file system in response to the access request; the copying unit 904 is also used to copy the obtained target file data to the shared memory space; the first acquisition unit 906 is also used for the file access service program corresponding to the target security container to read the target file data from the shared memory space.

[0109] In this embodiment, the copying unit 904 is specifically used to: the proxy service program copies the file data in the file system it represents to the first memory address space in the shared memory space; wherein, the first memory address space is used to store file data shared by the file access service program and the proxy service program; the proxy service program stores the layout index corresponding to the file data copied to the first memory address space in the shared memory space; wherein, the layout index is used to indicate the index node of the file data corresponding thereto, and to indicate the file offset of the file data corresponding thereto; the file offset is the offset of the corresponding file data in the file where it is located.

[0110] In this embodiment, the access request carries a target layout index corresponding to the target file data; the first acquisition unit 906 is specifically used to: in response to the access request of the target security container for the target file data, the file access service program corresponding to the target security container calculates a hash value of the target layout index, takes a modulo on the hash value, and determines the target memory address of the target file data in the first memory address space according to the modulo value; determines whether the layout index corresponding to the target memory address stored in the shared memory space is consistent with the target layout index; if the layout index corresponding to the target memory address is consistent with the target layout index, the file access service program corresponding to the target security container reads the target file data from the first memory address space according to the target memory address.

[0111] In this embodiment, the access request is used to perform a write operation on the target file data; the device also includes a write operation unit, which is used for: the file access service program corresponding to the target security container copies the found target file data to the second memory address space in the shared memory space; wherein, the second memory address space is a memory address space allocated to the target security container in the shared memory space for performing a write log operation on the target file data; the file access service program corresponding to the target security container performs a write log operation on the target file data copied to the second memory address space to obtain the target file data modified by the target security container; the proxy service program updates the target file data stored in the first memory address space based on the target file data modified by the target security container stored in the second memory address space.

[0112] In this embodiment, the shared memory space also stores a usage identifier and a version identifier corresponding to the file data; the write operation unit is further used to: in response to the target file data being subjected to a log write operation, update the usage identifier corresponding to the target file data from a first value to a second value; wherein, the usage mark is a first value, used to indicate that the corresponding file data is not being subjected to a write operation; the usage mark is a second value, used to indicate that the corresponding file data is being subjected to a write operation; in response to the proxy service program completing the update of the target file data stored in the first memory address space, update the usage identifier corresponding to the target file data from the second value to the first value, and update the version identifier corresponding to the target file data.

[0113] In this embodiment, the access request is used to perform a read operation on the target file data; the first acquisition unit 906 is also used to: in response to the file access service program corresponding to the target security container finding the target file data in the shared memory space, obtain the version identifier corresponding to the target file data from the shared memory space; in response to the file access service program corresponding to the target security container completing reading the target file data from the shared memory space, obtain the version identifier corresponding to the target file data from the shared memory space again, and determine whether the version identifier obtained again is consistent with the version identifier obtained previously; if inconsistent, the file access service program corresponding to the target security container re-reads the target file data from the shared memory space.

[0114] In this embodiment, the file system client supports access to multiple file systems; the host user space is deployed with multiple proxy service programs that act as agents for the multiple file systems respectively; the shared memory space includes multiple shared memory subspaces allocated to the multiple proxy service programs respectively; the device also includes: an allocation unit for determining the memory capacity of the shared memory subspace allocated to each file system based on the number of accesses made by the target security container to each of the multiple file systems.

[0115] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0116] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying any creative work.

[0117] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email transceiver, game console, tablet computer, wearable device, or any combination of these devices.

[0118] In a typical configuration, a computer includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0119] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0120] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0121] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0122] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0123] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0124] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "an," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0125] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when..." or "when..." or "in response to determining."

[0126] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included in the scope of protection of one or more embodiments of this specification.

Claims

1. A file access method, the method being applied to a file system client corresponding to a secure container running on a client ; The file system client comprises a proxy service program deployed in the user space of the host machine and a file access service program deployed in the kernel space of the client machine; the method comprises: Loading a shared memory space between the proxy service program and the file access service program for the target secure container; The proxy service program copies the file data in the file system of its proxy to the shared memory space; In response to the access request of the target security container to the target file data, the file access service program corresponding to the target security container obtains the target file data from the shared memory space.

2. The method according to claim 1, wherein the shared memory space between the target secure container loading proxy service program and the file access service program is include: Allocating a private virtual address space corresponding to the shared memory space to a file access program corresponding to the target secure container; The shared physical address space corresponding to the shared memory space applied for by the proxy service program is mapped to the private virtual address space allocated to the file access program corresponding to the target secure container, so as to complete the loading of the shared memory space for the target secure container.

3. The method according to claim 1, wherein in response to the target secure container's access request for target file data, the file access service program corresponding to the target secure container obtains the target file data from the shared memory space, include: In response to an access request from the target secure container for target file data, the file access service program corresponding to the target secure container searches for the target file data in the shared memory space; If the file access service program corresponding to the target secure container finds the target file data in the shared memory space, the file access service program corresponding to the target secure container reads the target file data from the shared memory space.

4. The method according to claim 3, further comprising: include: If the file access service program corresponding to the target secure container fails to find the target file data in the shared memory space, the file access service program corresponding to the target secure container sends an access request for the target file data to the proxy service program; In response to the access request, the proxy service program obtains the target file data from the file system, and copies the obtained target file data to the shared memory space; The file access service program corresponding to the target secure container reads the target file data from the shared memory space.

5. The method according to claim 1, wherein the proxy service program copies the file data in the file system it represents to the shared memory space, include: The proxy service program copies the file data in the file system it represents to the first memory address space in the shared memory space; wherein the first memory address space is used to store the file data shared by the file access service program and the proxy service program; The proxy service program stores the layout index corresponding to the file data copied to the first memory address space in the shared memory space; wherein the layout index is used to indicate the index node of the file data corresponding thereto, and is used to indicate the file offset of the file data corresponding thereto; the file offset is the offset of the corresponding file data in the file where it is located.

6. The method according to claim 5, wherein the access request carries a target layout index corresponding to the target file data; In response to the target secure container's access request for the target file data, the file access service program corresponding to the target secure container obtains the target file data from the shared memory space, include: In response to an access request from the target secure container for target file data, the file access service program corresponding to the target secure container calculates a hash value of the target layout index, performs modulo operation on the hash value, and determines a target memory address of the target file data in the first memory address space according to the modulo operation value; Determining whether a layout index corresponding to the target memory address and stored in the shared memory space is consistent with the target layout index; If the layout index corresponding to the target memory address is consistent with the target layout index, the file access service program corresponding to the target secure container reads the target file data from the first memory address space according to the target memory address.

7. The method according to claim 5, wherein the access request is used to perform a write operation on the target file data; the method further include: The file access service program corresponding to the target secure container copies the found target file data to the second memory address space in the shared memory space; wherein the second memory address space is a memory address space allocated to the target secure container in the shared memory space for performing a log write operation on the target file data; The file access service program corresponding to the target secure container performs a log write operation on the target file data copied to the second memory address space to obtain the target file data modified by the target secure container; The proxy service program updates the target file data stored in the first memory address space according to the target file data stored in the second memory address space that is modified by the target security container.

8. The method according to claim 7, wherein the shared memory space further stores a usage identifier and a version identifier corresponding to the file data; include: In response to the target file data being subjected to a log write operation, updating the use flag corresponding to the target file data from a first value to a second value; wherein the use flag is the first value, used to indicate that the corresponding file data is not being subjected to a write operation; and the use flag is the second value, used to indicate that the corresponding file data is being subjected to a write operation; In response to the proxy service program completing the update of the target file data stored in the first memory address space, the usage identifier corresponding to the target file data is updated from the second value to the first value, and the version identifier corresponding to the target file data is updated.

9. The method according to claim 8, wherein the access request is used to perform a read operation on the target file data; the method further include: In response to the file access service program corresponding to the target secure container finding the target file data in the shared memory space, obtaining a version identifier corresponding to the target file data from the shared memory space; In response to the file access service program corresponding to the target secure container completing reading the target file data from the shared memory space, the version identifier corresponding to the target file data is obtained again from the shared memory space, and it is determined whether the version identifier obtained again is consistent with the version identifier obtained previously; if they are inconsistent, the file access service program corresponding to the target secure container re-reads the target file data from the shared memory space.

10. The method according to claim 1, wherein the file system client supports access to multiple file systems; the host user space is deployed with multiple proxy service programs for respectively acting as agents for the multiple file systems; the shared memory space includes multiple shared memory subspaces respectively allocated to the multiple proxy service programs; the method further include: The memory capacity of the shared memory subspace allocated to each file system is determined according to the number of accesses performed by the target secure container on each of the multiple file systems.

11. A file access system, the file access system comprising a file system client corresponding to a secure container running on a client; the file system client comprising a proxy service program deployed in a host user space and a file access service program deployed in a client kernel space; The file system client is used to implement the method according to any one of claims 1 to 10.

12. An electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the method according to any one of claims 1 to 10 by calling the machine-readable instructions.

13. A machine-readable storage medium storing machine-readable instructions, wherein the machine-readable instructions, when called and executed by a processor, implement the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Trusted file indirection

    CN104487943A

  • Methods and systems for shared file storage

    CN105340240A

  • Information searching method and device, server, readable storage medium and program product

    CN113110944A

  • File access method and system, electronic equipment and machine readable storage medium

    CN116680233A

  • File system sharing method and apparatus for multi-operating system, and electronic device

    WO2019127191A1

Cited By

  • Data processing method and device, electronic equipment and readable storage medium

    CN119766882A

  • Method and device for loading kernel extension program, storage medium and electronic equipment

    CN119987897A