Object storage-based file gateway high availability implementation method and electronic device

By generating and persisting file handle mapping information in the file gateway, the problem of reduced availability of gateway cache capacity and performance is solved, and a highly available file gateway is realized, which improves performance and reliability.

CN113282563BActive Publication Date: 2024-12-27SANDSTONE DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110594798.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-28
Publication Date
2024-12-27
Estimated Expiration
2041-05-28

AI Technical Summary

Technical Problem

The existing high availability implementation method of file gateways based on object storage has the performance degradation caused by the reduction in gateway cache capacity availability, increased usage cost, and a single write cache operation to two write cache operations.

Method used

By receiving the initial access request for file metadata, the file handle mapping information between the file handle and the file is generated and persisted into the file handle information object, so that the backup gateway can directly obtain the file metadata when the main and standby gateway switches, without the need for Cache synchronization, thereby improving read and write performance and cache space utilization.

Benefits of technology

Improve the read and write performance and cache space utilization of file gateways, avoid dependence on third-party software, and improve the reliability of the gateway.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113282563B_ABST
    Figure CN113282563B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and electronic device for realizing high availability of a file gateway based on object storage, the method comprising: receiving an initial access request for obtaining file metadata; obtaining and responding to the file metadata and a file handle corresponding to the file according to the file access request, and generating file handle mapping information between the file handle and the file; persisting the file handle mapping information to a file handle information object storing the file handle mapping information. The present invention solves the problem of reduced gateway read and write performance and reduced cache capacity utilization in the existing gateway high availability solution by persisting the file handle mapping information to the object storage system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network data management, and in particular to a method and electronic device for realizing high availability of a file gateway based on object storage. Background Art

[0002] In the era of data informatization, the rapid development of cloud, AI (Artificial Intelligence) services, and big data has brought about the challenges of rapid data growth, device diversification, and rapid business response. This requires storage systems to have more massive storage space, faster service distribution, more convenient operation and maintenance capabilities, and lower costs. Traditional centralized storage systems can no longer meet the needs of big data processing.

[0003] "Distributed" refers to a unique type of system architecture, which is composed of a group of computer nodes that communicate through a network and coordinate work to complete common tasks. The emergence of distributed systems is to use cheap, ordinary machines to complete computing and storage tasks that a single computer cannot complete, and its purpose is to use more machines to process more data.

[0004] File gateway is a solution that can be deployed locally and in the cloud, provides users with standard storage protocols, and enables application system stock data to seamlessly access object storage services. NFS (Network File System) file gateway can realize protocol conversion between file system and object storage, allowing NFS clients to operate files on remote hosts like files on the local machine. Most open source file gateway products are designed with a single-node architecture. When the gateway is abnormal, it will cause service interruption and cannot meet the needs of the production environment.

[0005] The high availability implementation method of NFS file gateway based on object storage is to persist the file system metadata information locally and synchronize the data of the gateway cache through third-party software to achieve the purpose of high availability of the gateway. The main implementation steps are as follows: the client sends an IO request to read and write files through the file path; the main gateway updates the metadata information of the local cache (the mapping relationship between the file path and the file handle); after the main gateway operation is completed, it notifies the client that the operation is completed; the cache file or disk data is synchronized to the backup gateway in real time through the third-party software; when the main gateway and the backup gateway switch, the backup gateway provides services normally due to the synchronization of cache data, ensuring the high availability of the gateway. However, the solution has the following technical problems: (1) The solution introduces third-party software, resulting in a decrease in the overall reliability of the gateway; (2) The single write cache operation is changed to two write cache operations, resulting in a decrease in the overall performance of the gateway; (3) The use of additional space to back up the cache reduces the cache utilization by 50%.

[0006] The related technology also proposed another solution, which is to persist the file system metadata information locally and achieve the purpose of high availability of the gateway cache through data synchronization of the gateway cache. Its main implementation steps are as follows: the client sends an IO request to read and write files through the file path; the main gateway updates the metadata information of the local cache (the mapping relationship between the file path and the file handle); the backup gateway is synchronously triggered to update the metadata information of the local cache (the mapping relationship between the file path and the file handle); after the operations of the main and backup gateways are completed, the client is notified that the operation is completed; when the main and backup gateways switch, due to cache synchronization, the backup gateway provides services normally, ensuring the high availability of the gateway. However, this solution achieves high availability of the gateway cache by synchronously writing the cache data of the main and backup gateways, which also causes the availability rate of the gateway cache capacity to drop to 50%, the cost of use to increase, and the single write cache operation is changed to two write cache operations, resulting in a decrease in the overall performance of the gateway. Summary of the invention

[0007] The present invention aims to solve at least one of the technical problems in the related art to a certain extent. Among them, the high availability implementation scheme of the gateway provided in the related art has the problem of reducing the availability of the gateway cache capacity, increasing the cost of use, and reducing the overall performance of the gateway by changing a single write cache operation into two write cache operations. To this end, the first purpose of the present invention is to propose a high availability implementation method for a file gateway based on object storage.

[0008] A second objective of the present invention is to provide an electronic device.

[0009] To achieve the above-mentioned purpose, the first aspect of the present invention proposes a high-availability implementation method for a file gateway based on object storage, comprising the following steps: S1, receiving an initial access request for obtaining file metadata, and according to the access request, obtaining the bucket information and object information to which the file belongs; S2, generating a file handle through hash calculation based on the bucket information and object information to which the file belongs, and then obtaining the file metadata, and responding to the file metadata and the file handle, and generating file handle mapping information between the file handle and the file; S3, determining the name of the file handle information object that stores the file handle mapping information through the file handle; S4, persisting the file handle mapping information in the file handle information object.

[0010] Optionally, when the file metadata corresponding to the file handle contained in the received access request does not exist in the cache, the method also includes step S5, and the step S5 specifically includes: S5.1, according to the file handle, calculating the file handle information object name associated with the file handle; S5.2, according to the file handle, searching for the file handle mapping information corresponding to the file handle in the associated file handle information object, the file handle mapping information including the bucket information and object information to which the file belongs; S5.3, according to the bucket information and object information to which the file belongs, accessing and obtaining the file metadata corresponding to the file handle, and then rebuilding the file metadata in the cache.

[0011] Optionally, the file handle is composed of the system time when the file handle is created, a hash value of a container name to which the associated file belongs, a hash value of an object name to which the associated file belongs, and a hash value of an object ID to which the associated file belongs.

[0012] Optionally, the name of the file handle information object consists of a hash value associated with the file handle.

[0013] Optionally, the file handle mapping information is stored in a container associated with the file handle information object, and the file handle mapping information consists of the file handle creation time, the bucket name to which the file belongs, the bucket ID, the object name of the object to which the file belongs, the object ID and the object creation time.

[0014] Optionally, the step S4 specifically includes:

[0015] S4.1, according to the obtained file metadata initial access request, obtaining a file handle, file handle mapping information and a file handle information object corresponding to the file, so as to persist the file handle mapping information;

[0016] S4.2, determining whether the file handle information object exists;

[0017] S4.3, if not, create a file handle information object;

[0018] S4.4, determining whether the file handle mapping information can be obtained from the file handle information object;

[0019] S4.5, if yes, then end the persistence instruction;

[0020] S4.6, if not, execute the persistence instruction to persist the file handle mapping information to the file handle information object corresponding to the file handle.

[0021] Optionally, when the file metadata corresponding to the file handle included in the received access request does not exist in the cache, the method further includes step S6, and the step S6 specifically includes:

[0022] S6.1, generating a name of the file handle information object corresponding to the file handle by hash calculation according to the file handle;

[0023] S6.2, acquiring corresponding file handle mapping information according to the file handle and the file handle information object;

[0024] S6.3, judging whether the container to which the file belongs is deleted or modified according to the file handle mapping information;

[0025] S6.4, if yes, return the first error prompt information;

[0026] S6.5, if not, further determine whether the object to which the file belongs is deleted or modified;

[0027] S6.6, if yes, return a second error prompt message;

[0028] S6.7: If not, access and obtain the file metadata corresponding to the file handle and stored in the object to which the file belongs.

[0029] Optionally, for the container where the file handle information object in the object storage system is located, the method further includes step S7, and the step S7 specifically includes:

[0030] S7.1, obtaining all file handle information objects in the container where the file handle information object is located;

[0031] S7.2, traverse and obtain each file handle mapping information in each of the file handle information objects in turn;

[0032] S7.3, determining whether the file handle creation time in each file handle mapping information in the current file handle information object exceeds a preset time;

[0033] S7.4, if yes, delete the corresponding file handle mapping information;

[0034] S7.5, if not, then find out whether the file handle creation time in each file handle mapping information in the next file handle information object exceeds the preset time, until all file handle information objects are traversed.

[0035] To achieve the above-mentioned purpose, the second aspect of the present invention proposes an electronic device, including a memory, a processor and a computer program stored on the memory. When the computer program is executed by the processor, the above-mentioned object storage-based file gateway high-availability implementation method is implemented.

[0036] The present invention has at least the following advantages:

[0037] The present invention generates file handle mapping information between a file handle and an associated file according to a file metadata access request, and persists the file handle mapping information in a corresponding file handle information object, so that when the primary and backup gateways switch, the backup gateway can directly obtain the bucket information and object information to which the corresponding file belongs according to the received file handle, and then obtain the file metadata from the object to which the file belongs, and then rebuild the file metadata in the cache. In this way, there is no need to perform cache synchronization, thereby improving the read and write performance of the file gateway and improving the cache space utilization. In addition, the present invention does not require third-party software and can improve the reliability of the file gateway.

[0038] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A flowchart of a method for implementing high availability of a file gateway based on object storage provided by an embodiment of the present invention;

[0040] Figure 2 A schematic diagram of a high-availability gateway architecture provided by an embodiment of the present invention;

[0041] Figure 3 A mapping relationship diagram between a file handle and a file handle information object provided by an embodiment of the present invention;

[0042] Figure 4 A flowchart of file handle mapping information persistence provided by an embodiment of the present invention;

[0043] Figure 5 A flowchart of a file metadata information reconstruction strategy provided by an embodiment of the present invention;

[0044] Figure 6 A flow chart of a file handle mapping information expiration recovery strategy provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0045] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0046] The following describes the object storage-based file gateway high availability implementation method and electronic device of this embodiment with reference to the accompanying drawings.

[0047] refer to Figure 1 As shown, a method for implementing high availability of a file gateway based on object storage provided in this embodiment includes the following steps:

[0048] Step S1, receiving an initial access request for obtaining file metadata, and obtaining the bucket information and object information to which the file belongs according to the access request.

[0049] Specifically, taking NFS files as an example, the NFS client can access the NFS server through the virtual IP, and send an initial access request for NFS file metadata to the NFS server, where the initial access request for NFS file metadata may include the NFS storage path (composed of the file name of the NFS file and the file handle of the directory where the NFS file is located). According to the storage path, the bucket information and object information to which the NFS file belongs can be obtained.

[0050] Step S2, based on the bucket information and object information to which the file belongs, a file handle is generated through hash calculation, and then the file metadata is obtained, and the file metadata and file handle are responded to, and the file handle mapping information between the file handle and the file is generated.

[0051] like Figure 2 As shown, the main gateway deployed in the NFS server can respond to the initial access request, and the main gateway will obtain the requested NFS file metadata; at the same time, the main gateway also generates a file handle corresponding to the NFS file and sends them together to the NFS client. When the NFS client accesses the NFS file again, it can directly access the NFS file through the file handle corresponding to the NFS file.

[0052] Among them, the file handle is a serial number used to identify a unique file in the network file system. Preferably, the file handle can be generated by hash calculation based on the bucket information and object information to which the associated file belongs. In the NFS protocol, when the NFS client first accesses the NFS file, it calls the lookup protocol according to the file name to obtain the file handle and file metadata information. The NFS server returns the file handle to the NFS client, and the NFS client caches the file handle in memory. If the NFS client accesses the file again, the file handle can be directly passed to the NFS server.

[0053] Optionally, the master gateway also generates file handle mapping information between the file handle and the file. The file handle mapping information consists of the file handle creation time, the bucket name to which the associated file belongs, the bucket ID, the object name, object ID and object creation time of the object to which the associated file belongs.

[0054] Step S3, determining the name of the file handle information object storing the file handle mapping information through the file handle.

[0055] Specifically, Figure 3 As shown, the file handle information object is stored in an associated container, and the naming format of the file handle information object name is a combination of a fixed prefix and a hash value of the associated file handle;

[0056] Step S4, persist the file handle mapping information into the file handle information object.

[0057] like Figure 3 As shown, the object storage system includes a bucket for storing file handle information objects, the bucket includes a plurality of file handle information objects, and each file handle information object includes a plurality of file handle mapping information. The file handle mapping information is stored in the corresponding file handle information object, and the file handle mapping information corresponds to the file handle one by one.

[0058] Each record stored in the file handle information object is a key-value pair consisting of first data (key) and second data (value). The first data key is named as the associated file handle, and the content of the second data is the file handle mapping information.

[0059] Specifically, one NFS file corresponds to one key-value pair recorded in the map of the file handle information object. After the file handle mapping information of an NFS file handle is generated, the file handle mapping information can be persisted to the map of the file handle information object.

[0060] In this embodiment, a specific naming method is used for the file handle information object and the first data key, so that the location where the associated file handle mapping information is stored can be accurately determined through the file handle.

[0061] Optionally, when the file metadata corresponding to the file handle included in the received access request does not exist in the cache, the method further includes step S5, and the step S5 specifically includes:

[0062] S5.1, according to the file handle, calculate the file handle information object name associated with the file handle.

[0063] S5.2, according to the file handle, search and obtain the file handle mapping information corresponding to the file handle in the associated file handle information object, the file handle mapping information includes the bucket information and object information to which the file belongs.

[0064] S5.3, according to the bucket information and object information to which the file belongs, access and obtain the file metadata corresponding to the file handle, and then rebuild the file metadata in the cache.

[0065] like Figure 2 As shown, when the primary and backup gateways switch, and the backup gateway receives an NFS file access request containing a file metadata corresponding to a file handle that does not exist in the cache, the backup gateway can first calculate the file handle information object name based on the file handle, and then search for the file handle mapping information corresponding to the file handle in the file handle information object. Then, the backup gateway accesses the object storage system to obtain the NFS file metadata stored in the object to which the file belongs based on the bucket information and object information to which the file belongs in the file handle mapping information. In this way, the NFS file metadata is rebuilt in the cache, thereby achieving the high availability of the gateway.

[0066] Optionally, step S4 described in the present invention specifically includes:

[0067] S4.1, based on the obtained file metadata initial access request, obtain the file handle, file handle mapping information and file handle information object corresponding to the file to persist the file handle mapping information; S4.2, determine whether the file handle information object exists; S4.3, if not, create a file handle information object; S4.4, determine whether the file handle mapping information can be obtained from the file handle information object; S4.5, if so, end the persistence instruction; S4.6, if not, execute the persistence instruction to persist the file handle mapping information to the file handle information object corresponding to the file handle.

[0068] As an example, Figure 4As shown, after receiving the initial access request for NFS file metadata (such as create / mkdir / symlink / lookup interfaces), the NFS file gateway can obtain the object information to which the file belongs through parameters, and then generate a file handle and file handle mapping information, and calculate and obtain the file handle information object name corresponding to the file handle to save the file handle mapping information. Further, the gateway determines whether the file handle information object exists. If not, it creates a file handle information object, and then determines whether the file handle information corresponding to the file handle exists in the file handle information object. If it exists, it will not be persisted. If it exists, the file handle mapping information will be persisted to the corresponding file handle information object.

[0069] When the NFS file metadata accessed by the NFS client through the file handle does not exist in the cache, it is necessary to obtain the file metadata according to the file handle and reconstruct the NFS file metadata in the cache to ensure the correct execution of the access request.

[0070] In one embodiment of the present invention, when the NFS file metadata corresponding to the file handle included in the received NFS file access request does not exist in the cache, the method further includes step S6, and the step S6 specifically includes:

[0071] S6.1, generate the name of the file handle information object corresponding to the file handle through hash calculation according to the file handle; S6.2, obtain the corresponding file handle mapping information according to the file handle and the file handle information object; S6.3, determine whether the container to which the file belongs is deleted or modified according to the file handle mapping information; S6.4, if so, return the first error prompt information; S6.5, if not, further determine whether the object to which the file belongs is deleted or modified; S6.6, if so, return the second error prompt information; S6.7, if not, access and obtain the NFS file metadata corresponding to the file handle stored in the object to which the file belongs.

[0072] As an example, Figure 5 As shown, after receiving the file handle, when the NFS file metadata corresponding to the backup gateway file handle is not in the cache, the backup gateway then obtains the file handle information object according to the file handle, and then obtains the file handle mapping information according to the file handle and the file handle information object. Further, the container to which the file recorded in the file handle mapping information belongs can be obtained and it can be determined whether it has been deleted or modified. If so, the first error prompt message ESTALE is returned, if not, it is determined whether the object to which the file recorded in the file handle mapping information belongs has been deleted or modified. If so, the second error prompt message ESTALE is returned, if not, the NFS file metadata information corresponding to the file handle stored in the object to which the file belongs is accessed and obtained.

[0073] Furthermore, for the container where the file handle information object is located in the object storage system, the method also includes step S7, and the step S7 specifically includes: S7.1, obtaining all file handle information objects in the container where the file handle information object is located; S7.2, traversing in turn to obtain each file handle mapping information in each file handle information object; S7.3, judging whether the file handle creation time in each file handle mapping information in the current file handle information object exceeds the preset time; S7.4, if so, deleting the corresponding file handle mapping information; S7.5, if not, searching whether the file handle creation time in each file handle mapping information in the next file handle information object exceeds the preset time, until all file handle information objects are traversed.

[0074] Specifically, the file handle mapping information persisted in the file handle information object requires a certain recycling strategy to recycle invalid data to optimize the storage structure. Figure 6 As shown, when the NFS gateway process is started, the recycling thread can be started at the same time. The recycling thread can traverse all file handle mapping information of the file handle information object in each container at a fixed time (such as 6 hours by default), and then determine whether the file handle creation time in each file handle mapping information exceeds the preset time (such as 30 days by default). If it exceeds, the corresponding file handle mapping information is deleted, otherwise it is retained until all file handle information objects are traversed.

[0075] Furthermore, this embodiment also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, the above-mentioned object storage-based file gateway high-availability implementation method is implemented.

[0076] The object storage-based file gateway high availability implementation method of this embodiment generates file handle mapping information between a file handle and an object to which the file storing the file metadata belongs according to an initial access request for the file metadata, and persists the file handle mapping information in a corresponding file handle information object, so that when the primary and backup gateways switch, the backup gateway can directly obtain the corresponding file metadata according to the received file handle without cache synchronization, thereby improving the read and write performance of the file gateway and improving the cache space utilization. In addition, the present invention does not require third-party software and can improve the reliability of the file gateway.

[0077] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0078] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0079] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0080] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for implementing high availability of a file gateway based on object storage, characterized in that: The following steps are involved: S1, receiving an initial access request for obtaining file metadata, and obtaining the bucket information and object information to which the file belongs according to the access request; S2, based on the bucket information and object information to which the file belongs, a file handle is generated by hash calculation, and then file metadata is obtained, and the file metadata and the file handle are responded to, and file handle mapping information between the file handle and the file is generated at the same time; the file handle is composed of the system time when the file handle is created, the hash value of the container name to which the associated file belongs, the hash value of the object name to which the associated file belongs, and the hash value of the object ID to which the associated file belongs; the file handle mapping information is stored in the container of the associated file handle information object, and the file handle mapping information is composed of the file handle creation time, the bucket name to which the file belongs, the bucket ID, the object name of the object to which the file belongs, the object ID, and the object creation time; S3, determining the name of the file handle information object storing the file handle mapping information through the file handle; The name of the file handle information object consists of a hash value associated with the file handle; S4, persisting the file handle mapping information to the file handle information object, specifically including: S4.1, according to the obtained file metadata initial access request, obtaining a file handle, file handle mapping information and a file handle information object corresponding to the file, so as to persist the file handle mapping information; S4.2, determining whether the file handle information object exists; S4.3, if not, create a file handle information object; S4.4, determining whether the file handle mapping information can be obtained from the file handle information object; S4.5, if yes, then end the persistence instruction; S4.6, if not, executing a persistence instruction to persist the file handle mapping information to the file handle information object corresponding to the file handle; For the container where the file handle information object in the object storage system is located, the method further includes step S7, and the step S7 specifically includes: S7.1, obtaining all file handle information objects in the container where the file handle information object is located; S7.2, traverse and obtain each file handle mapping information in each of the file handle information objects in turn; S7.3, determining whether the file handle creation time in each file handle mapping information in the current file handle information object exceeds a preset time; S7.4, if yes, delete the corresponding file handle mapping information; S7.5, if not, then find out whether the file handle creation time in each file handle mapping information in the next file handle information object exceeds the preset time, until all file handle information objects are traversed.

2. The method for implementing high availability of a file gateway based on object storage according to claim 1, characterized in that: When the file metadata corresponding to the file handle included in the received access request does not exist in the cache, the method further includes step S5, and the step S5 specifically includes: S5.1, according to the file handle, calculating the file handle information object name associated with the file handle; S5.2, according to the file handle, searching in the associated file handle information object to obtain file handle mapping information corresponding to the file handle, the file handle mapping information including bucket information and object information to which the file belongs; S5.3, according to the bucket information and object information to which the file belongs, access and obtain the file metadata corresponding to the file handle, and then rebuild the file metadata in the cache.

3. The method for implementing high availability of a file gateway based on object storage as claimed in claim 2, characterized in that: When the file metadata corresponding to the file handle included in the received access request does not exist in the cache, the method further includes step S6, and the step S6 specifically includes: S6.1, generating a name of the file handle information object corresponding to the file handle by hash calculation according to the file handle; S6.2, acquiring corresponding file handle mapping information according to the file handle and the file handle information object; S6.3, judging whether the container to which the file belongs is deleted or modified according to the file handle mapping information; S6.4, if yes, return the first error prompt information; S6.5, if not, further determine whether the object to which the file belongs is deleted or modified; S6.6, if yes, return a second error prompt message; S6.7: If not, access and obtain the file metadata corresponding to the file handle and stored in the object to which the file belongs.

4. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the high-availability implementation method of a file gateway based on object storage as described in any one of claims 1 to 3 is implemented.