A file management method and device, computer equipment and storage medium

By introducing a large file system into the game engine and utilizing a combination of metadata management layer and data block management layer, the problem of slow file access speed was solved, and efficient management of resource files was achieved.

CN114153787BActive Publication Date: 2026-02-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111475124.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2026-02-10
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

The existing game engine's file system has a slow file access speed when managing a large number of game resources, resulting in low resource management efficiency.

Method used

A large file system is introduced, including a metadata management layer and a data block management layer. The target data block is determined by a hash algorithm, and the file data of the resource file is written to the target data block, thereby reducing the number of files and improving management efficiency.

Benefits of technology

By merging resource files in the file system, file read and write overhead is reduced, and the efficiency of resource file management in the file system is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114153787B_ABST
    Figure CN114153787B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a file management method and device, computer equipment and a storage medium. The present application adds a metadata file layer for storing metadata information of resource files and a data block file layer for storing file data of the resource files in a file system, and merges multiple files in the file system through the data block file. In this way, the number of resource files in the file system can be reduced, and the data of the resource files can be managed through the data block file, so that the management efficiency of the resource files in the file system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a file management method, apparatus, computer equipment, and storage medium. Background Technology

[0002] During game operation, various game resources are frequently loaded and unloaded from the disk. As the types and quantities of game resources increase, in order to manage game resources uniformly, most game engines use a resource manager to load and manage the countless resources required to make up the game.

[0003] In related technologies, file systems are heavily used by file systems, and game engines wrap the native file system interface as a dedicated file interface to manage file resources in a specified directory. However, as the number of files increases exponentially, the speed at which the file system manages file resources slows down. Summary of the Invention

[0004] This application provides a file management method, apparatus, computer device, and storage medium, which can improve the management efficiency of resource files in a file system.

[0005] This application provides a file management method, including:

[0006] The system receives a file write instruction from a large file system based on a game engine, and obtains the file information of the resource file to be written according to the file write instruction. The large file system includes a metadata management layer and a data block management layer. The metadata management layer is used to manage the metadata of the resource files in the large file system, and the data block management layer is used to manage the file data of the resource files in the large file system.

[0007] Based on the file information and the metadata file in the metadata management layer, a target data block is determined from the data blocks in the data block management layer, wherein the metadata file includes metadata information of resource files in the large file system;

[0008] The file data of the resource file to be written is written to the target data block through the large file system.

[0009] Accordingly, embodiments of this application also provide a file management device, including:

[0010] The first receiving unit is used to receive a file write instruction based on a large file system of a game engine, and to obtain the file information of the resource file to be written according to the file write instruction. The large file system includes a metadata management layer and a data block management layer. The metadata management layer is used to manage the metadata of the resource files in the large file system, and the data block management layer is used to manage the file data of the resource files in the large file system.

[0011] The first determining unit is configured to determine a target data block from the data blocks of the data block management layer based on the file information and the metadata file in the metadata management layer, wherein the metadata file includes metadata information of resource files in the large file system;

[0012] The first writing unit is used to write the file data of the resource file to be written into the target data block through the large file system.

[0013] In some embodiments, the first determining unit includes:

[0014] The first determining subunit is used to determine the index information corresponding to the resource file to be written based on the file information;

[0015] A search subunit is used to search for the file information in the metadata file based on the index information, and obtain the search result;

[0016] The second determining subunit is used to determine the target data block from the data blocks of the data block management layer based on the search result.

[0017] In some embodiments, the second determining subunit is specifically used for:

[0018] If the search result indicates that the file information exists in the metadata file, then the data block corresponding to the resource file to be written is determined from the data blocks of the data block management layer to obtain the target data block;

[0019] If the search result indicates that the file information does not exist in the metadata file, a new data block is created in the data block management layer to obtain the target data block.

[0020] In some embodiments, the first determining unit further includes:

[0021] The removal subunit is used to remove existing resource file data from the target data block to obtain the processed target data block.

[0022] In some embodiments, the first writing unit includes:

[0023] The first writing subunit is used to write the file data of the resource file to be written into the processed target data block.

[0024] In some embodiments, the first writing unit includes:

[0025] The second determining subunit is used to determine the target storage location from the target data block based on the file information;

[0026] The second writing subunit is used to write the file data of the resource file to be written to the target storage location.

[0027] In some embodiments, the second determining subunit is specifically used for:

[0028] Obtain the remaining storage space of the target data block;

[0029] Based on the file data and the file length, a storage location is selected from the remaining storage space to obtain the target storage location.

[0030] In some embodiments, the device further includes:

[0031] A generation unit is configured to generate target metadata information for the resource file to be written based on the file information and the target data block.

[0032] The second writing unit is used to write the target metadata information into the metadata file.

[0033] In some embodiments, the second writing unit is specifically used for:

[0034] Detect whether the metadata file includes historical metadata information of the resource file to be written;

[0035] If the metadata file includes the historical metadata information, then the historical metadata information is updated based on the target metadata information.

[0036] In some embodiments, the device further includes:

[0037] The detection unit is used to detect the usage status of the metadata file;

[0038] The acquisition unit is configured to acquire a backup metadata file of the metadata file if the usage status indicates that the metadata file is in use.

[0039] In some embodiments, the second writing unit includes:

[0040] The third writing subunit is used to write the target metadata information into the backup metadata file.

[0041] In some embodiments, the device further includes:

[0042] The second receiving unit is used to receive a file read instruction based on the large file system and obtain the file path of the resource file to be read according to the read instruction.

[0043] The second determining unit is used to determine the metadata information of the resource file to be read from the metadata file based on the file path;

[0044] The third determining unit is used to determine the data block corresponding to the resource file to be read from the data blocks of the metadata management layer based on the metadata information of the resource file to be read.

[0045] The reading unit is used to read the file data of the resource file to be read from the data block corresponding to the resource file to be read.

[0046] In some embodiments, the device further includes:

[0047] The third receiving unit is used to receive a download instruction for the resource file to be written, and to start multiple threads of the large file system to download the resource file to be written according to the download instruction.

[0048] In some embodiments, the first writing unit includes:

[0049] The fourth writing subunit is used to write the file data of the resource file to be written into the target data block through the multiple threads.

[0050] Accordingly, this application also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes any of the file management methods provided in this application.

[0051] Accordingly, embodiments of this application also provide a storage medium that stores multiple instructions, which are adapted for loading by a processor to execute the file management method described above.

[0052] This application embodiment adds a metadata file layer for storing metadata information of resource files and a data block file layer for storing file data of resource files to the file system. Multiple files in the file system are merged through the data block file, thereby reducing the number of resource files in the file system and managing the data of resource files through the data block file, thereby improving the management efficiency of resource files in the file system. Attached Figure Description

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

[0054] Figure 1 This is a flowchart illustrating a file management method provided in an embodiment of this application.

[0055] Figure 2 This is a structural block diagram of a file system for a file management method provided in an embodiment of this application.

[0056] Figure 3 A structural block diagram of a file system for another file management method provided in an embodiment of this application.

[0057] Figure 4 This is a schematic diagram of the data storage structure of a file management method provided in an embodiment of this application.

[0058] Figure 5 This is a schematic diagram of the data storage structure of a file management method provided in an embodiment of this application.

[0059] Figure 6 This is a flowchart illustrating another file management method provided in an embodiment of this application.

[0060] Figure 7 This is a structural block diagram of a file management device provided in an embodiment of this application.

[0061] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0062] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0063] This application provides a file management method, apparatus, storage medium, and computer device. Specifically, the file management method of this application can be executed by a computer device, which can be a server or similar device. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0064] For example, the computer device could be a server that receives file write instructions from a large file system based on a game engine, obtains file information of the resource file to be written according to the file write instructions, wherein the large file system includes a metadata management layer and a data block management layer. The metadata management layer is used to manage the metadata of the resource files in the large file system, and the data block management layer is used to manage the file data of the resource files in the large file system; based on the file information and the metadata file in the metadata management layer, the target data block is determined from the data blocks in the data block management layer, wherein the metadata file includes the metadata information of the resource files in the large file system; and the file data of the resource file to be written is written to the target data block through the large file system.

[0065] Based on the above problems, this application provides a first file management method, apparatus, computer device, and storage medium, which can improve the management efficiency of resource files in the file system.

[0066] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0067] This application provides a file management method, which can be executed by a terminal or a server. This application uses the example of a file management method executed by a server to illustrate the method.

[0068] like Figure 1 As shown, Figure 1 This is a flowchart illustrating a file management method provided in an embodiment of this application. The specific flow of this file management method can be as follows:

[0069] 101. Receive file write instructions based on the large file system of the game engine, and obtain the file information of the resource file to be written according to the file write instructions.

[0070] In related technologies, most game engines employ some type of resource manager to load and manage the multiple resource files required to construct a 3D game. Each resource manager heavily utilizes the file system; therefore, game engines wrap the native file system interface as a dedicated file interface for the game engine. Messiah, as a mature game engine, provides a universal file access interface that can access files in a specified directory.

[0071] A file system is the method and data structure used by an operating system to define files on storage devices (commonly disks, but also NAND flash-based solid-state drives); that is, the method of organizing files on storage devices. The software component in an operating system responsible for managing and storing file information is called the file management system, or simply the file system. A file system consists of three parts: the file system interface, the set of software for manipulating and managing objects, and the objects and their attributes.

[0072] For example, please see Figure 2 , Figure 2 This is a structural block diagram of a file system for a file management method provided in an embodiment of this application. Figure 2 The diagram shows the current structure of the Messiah engine's Multi FileSystem. MultiFileSystem encapsulates multiple native file systems, each of which provides a common file access interface that can access files in a specified directory.

[0073] Multi FileSystem provides a very concise file access interface. When accessing a file, it first searches the LocalData / Patch directory, then the Package directory, next the Engine directory, and finally the LocalData directory. The Patch logic places the latest Patch file in the LocalData / Patch directory so that the latest file can be accessed after the game starts. Multi FileSystem provides good support for the game's Patch functionality.

[0074] However, during development, the number of files typically increases exponentially. Faced with such a large number of files, Messiah's multi-file system may suffer from slow access speeds.

[0075] To address the slow file access speed issue in the aforementioned multi-filesystem architecture, this application proposes inserting a new filesystem, Compact FileSystem, into the existing MultiFileSystem. Compact FileSystem comprises two levels of directories: LocalData / CompactPatch and CompactPackage. Specifically, by inserting these two levels of Compact FileSystem directories into the multi-filesystem architecture, a new filesystem, i.e., a large filesystem, is created.

[0076] For example, please see Figure 3 , Figure 3 A structural block diagram of a file system for another file management method provided in an embodiment of this application. Figure 3 A structural block diagram of the large file system according to an embodiment of this application is shown. After adding the two new directories, the directories of the large file system include: local data / patches, local data / metadata patches (LocalData / CompactPatch), packages, metadata packages (CompactPackage), engine, and local data.

[0077] In the large file system, the file access priority from high to low is as follows: LocalData / Patch, LocalData / CompactPatch, Package, CompactPackage, Engine, LocalData.

[0078] In this embodiment, in addition to providing the file function interface required by the original file system, the large file system also provides the function of transferring files in the LocalData / Patch directory to the LocalData / CompactPatch directory, which is convenient for online use and can merge small files in the Patch directory when the game starts.

[0079] Specifically, when the large file system function is enabled, the files downloaded during the patch phase will be automatically written to the CompactPatch directory. When the game starts, the files in the LocalData / Patch directory can be moved to the LocalData / CompactPatch directory without affecting the patch logic, and it can be perfectly compatible with the old engine.

[0080] The file write command instructs the writing of resource files to the large file system. Resource files refer to various resources required for the game to run, such as UI (User Interface), shaders, scripts, models, textures, and audio resources. Therefore, the resource file to be written refers to the resource file that needs to be written to the large file system. Specifically, the file information of the resource file to be written refers to the file's attribute information, which may include file type, file length, and file data.

[0081] The large file system includes a metadata management layer (LocalData / CompactPatch) and a data block management layer (CompactPackage). The metadata management layer is used to manage the metadata of resource files in the large file system. Metadata, also known as intermediary data or relay data, is data about data, mainly describing data properties, and is used to support functions such as indicating storage location, historical data, resource lookup, and file records. The data block management layer is used to manage the file data of resource files in the large file system. File data is the data included in the resource files.

[0082] 102. Based on the file information and the metadata file in the metadata management layer, determine the target data block from the data blocks in the data block management layer.

[0083] Metadata files refer to files in the metadata management layer directory of the large file system. Metadata files contain metadata information of each resource file in the large file system, and the file extension of metadata files can be: Compact.

[0084] In this embodiment of the application, a new data storage structure was designed for metadata files in order to manage a large number of resource files in a large file system. For example, please refer to... Figure 4 , Figure 4 This is a schematic diagram of the data storage structure of a file management method provided in an embodiment of this application. Figure 4 The version identifier (version) refers to the version identifier of the metadata file. For example, the version identifier can be V1, V2, V3, etc. The larger the value, the newer the version of the metadata file. The number of data blocks (blocknum) refers to the number of data blocks. The number of resource files (filenum) refers to the number of resource files. After the number of resource files, the name of each data block is stored, followed by the metadata information of each resource file.

[0085] The metadata information includes: the file path of the resource file, the data block identifier where the resource file is located, the offset position of the resource file in the data block, and the file length of the resource file.

[0086] The file path refers to the location where the file is stored. For example, E:\work\Market Data\Market Plan.doc is a file path. This means that a Word file named "Market Plan" is stored in the "Market Plan" folder within the "work" folder on drive E. To open this file, simply follow the file path to find it and perform the corresponding operations.

[0087] File length, also known as file size, refers to the amount of storage space occupied in the file system. Offset position refers to the location of the resource file within the data block.

[0088] In this context, a data block, or block, refers to a file in the data block management layer directory of a large file system. A block is the smallest unit of storage and processing in a database, containing header information and other data.

[0089] Specifically, a data block contains file data from various resource files within a large file system, and the file extension for a data block can be ".block". A data block is essentially a data storage file that integrates a large amount of resource file data. Reading file data from a data block requires first obtaining the metadata information of the resource files.

[0090] Specifically, in this embodiment, the large file system based on the game engine supports multiple large files, each of which is a file with the suffix ".block", meaning each large file refers to a data block. The data blocks are managed by a `CompactBlockHandler` class at the engine layer of the large file system. The `restSpace` member variable of `CompactBlockHandler` maintains information about unused data within the large files.

[0091] In some embodiments, to improve the file write efficiency of a large file system, the step "determine the target data block from the data blocks in the data block management layer based on file information and metadata files in the metadata management layer" may include the following operations:

[0092] Determine the index information corresponding to the resource file to be written based on the file information;

[0093] The file information is searched in the metadata file based on the index information to obtain the search results;

[0094] The target data block is determined from the data blocks in the data block management layer by searching the results.

[0095] The file information includes the file path, file data, and file length of the resource file to be written. Further, based on the file path of the resource file to be written, index information is determined, which can be achieved by using a hash algorithm to determine the hash bucket corresponding to the file path. The index information refers to the correspondence between the file path and the hash bucket.

[0096] Specifically, a hash algorithm refers to mapping a binary value of arbitrary length to a shorter, fixed-length binary value, called a hash value. A hash value is a unique and extremely compact numerical representation of a piece of data. If you hash a piece of plaintext and change even a single letter in that piece of text, the subsequent hash will produce a different value. It can be used for fast lookup and encryption algorithms.

[0097] In this embodiment of the application, the file path of the resource file can correspond to a hash bucket. A hash bucket is a container used to hold different key linked lists (i.e., hash tables). A hash table maps a group of keys to a finite address range according to a set hash function and a collision handling method, and uses the image of the key in the address range as the storage location of the record in the table. This kind of table is called a hash table or hash, and the resulting storage location is called a hash address or hash address.

[0098] Furthermore, the string representing the file path to be written to the resource file is hashed and mapped to a hash bucket. For example, resource files named 0a0001 and 0a0002 can be mapped to hash bucket 0a, meaning they can be written to the data block 0a.block.

[0099] After determining the index information of the file path, the file information of the resource file to be written can be searched in the metadata file based on the index information, thus obtaining the search result. If the resource file to be written can be an update file of an existing resource file in the large file system, then the metadata file of the large file system may store the metadata information of the resource file to be written, thus confirming that the search result indicates the existence of file information in the metadata file; or if the resource file to be written can be a resource file not included in the large file system, then the metadata file of the large file system will not store the metadata information of the resource file to be written, thus confirming that the search result indicates the absence of file information in the metadata file. Further, subsequent operations are performed based on the search results for the file information.

[0100] In some embodiments, to further improve the writing efficiency of resource files, the step "determine the target data block from the data blocks of the data block management layer using the lookup results" may include the following operations:

[0101] If the search results indicate that file information exists in the metadata file, then the data block corresponding to the resource file to be written is determined from the data blocks in the data block management layer to obtain the target data block;

[0102] If the search results indicate that the file information does not exist in the metadata file, a new data block is created in the data block management layer to obtain the target data block.

[0103] If the search result indicates that file information exists in the metadata file, then the corresponding data block in the data management layer stores the historical file data of the resource file to be written. The data block storing the historical file data of the resource file to be written can be determined from the data block in the data management layer, and thus the target data block can be obtained.

[0104] For example, if the search results indicate that file information exists in the metadata file, and the data management layer includes: data block 1, data block 2, and data block 3, and the data block containing historical file data to be written to the resource file is determined to be data block 1 based on the file information, then data block 1 can be determined as the target data block.

[0105] If the search result indicates that the file information does not exist in the metadata file, it means that the data block of the data management layer does not store the file data of the resource file to be written. In this case, a new data block can be created in the data block of the data management layer, and the target data block can be obtained.

[0106] For example, if the search results indicate that the file information does not exist in the metadata file, and the data management layer includes: data block 1, data block 2, and data block 3, a new data block can be created in the data blocks of the data management layer: data block 4, then data block 4 can be determined as the target data block.

[0107] In some embodiments, if the resource file to be written is an existing resource file in a large file system, in order to save file system storage space, after the step "determine the data block corresponding to the resource file to be written from the data blocks of the data block management layer to obtain the target data block", the following steps may also be included:

[0108] Remove existing resource file data from the target data block to obtain the processed target data block;

[0109] The step "Write the file data to be written to the resource file to the target data block" may include the following steps:

[0110] Write the file data to be written to the resource file into the processed target data block.

[0111] The existing resource file data in the target data block refers to the initial file data of the resource files to be written stored in the historical time period. Before writing the data of the current resource files to be written into the target data block, the initial file data can be cleaned up to avoid occupying unnecessary storage space.

[0112] Furthermore, after clearing the target data block, the processed target data block can be obtained, and then the resource file data to be written to the resource file can be written into the processed target data block.

[0113] In some embodiments, to ensure the security of resource files in a large file system, the data in the metadata file is binary data, and the data in the data block is binary data.

[0114] Specifically, the large file system maintains a directory of files including block files (data blocks) and compact files (metadata files). The block files store binary data files sequentially, while the compact files store binary metadata data. If a user maliciously renames or tamperes with file data, the game will fail to start normally. Therefore, the large file system has a high level of security.

[0115] 103. Write the file data of the resource file to be written to the target data block through the large file system.

[0116] After the target data block is determined, the file data of the resource file to be written can be written to the target data block, so as to write the resource file to be written into the large file system.

[0117] In some embodiments, to improve resource file writing efficiency, the step "writing the file data of the resource file to be written to the target data block through a large file system" may include the following operations:

[0118] Determine the target storage location from the target data block based on the file information;

[0119] Write the file data to be written to the resource file to the target storage location.

[0120] First, the target storage location is determined from the target data block based on the file information of the resource file to be written. This target storage location is the position where the file data of the resource file to be written is written into the target data block.

[0121] In some embodiments, the file information includes at least file data and file length. To quickly determine the storage location within the target data block, the step "determine the target storage location from the target data block based on the file information" may include the following operations:

[0122] Obtain the remaining storage space of the target data block;

[0123] Based on the file data and file length, a storage location is selected from the remaining storage space to obtain the target storage location.

[0124] In this embodiment of the application, the files in the data block are stored in a close-knit arrangement. For example, please refer to... Figure 5 , Figure 5 This is a schematic diagram of the data storage structure of another file management method provided in an embodiment of this application. Figure 5 The diagram illustrates the file storage structure within a data block. For example, a data block can be data block 1, which stores: file 1, file 2, file 3, file 4, ..., file n. In this case, files 1 through n within data block 1 contain file data. The file data to be written to the resource file can be stored after file n. Then, based on the file data and file length, a storage location that meets the file length requirement is selected from the storage locations following file n to obtain the target storage location.

[0125] In some embodiments, if the resource files already stored in the target data block have been deleted, for example, for Figure 5 If files 2 and 3 are deleted from the resource files in the database, then when storing file data to be written to the resource files, we can first determine whether the storage locations of files 2 and 3 meet the file length requirements of the resource files to be written. If they do, the file data to be written to the resource files can be stored in the locations of files 2 and 3. This can improve the management of file storage in the database.

[0126] In some embodiments, to facilitate subsequent reading of the resource files to be written in the large file system, the following steps may be included after the step "writing the file data of the resource files to be written to the target data block through the large file system":

[0127] Generate the target metadata information for the resource file to be written based on the file information and the target data block;

[0128] Write the target metadata information into the metadata file.

[0129] Specifically, based on the file name, file length, file path of the resource file to be written, and the storage location of the file data of the resource file to be written in the target data block, the metadata information of the resource file to be written is generated, and the target metadata information is obtained. Then, the target metadata information is stored in the metadata file of the metadata management layer of the large file system, thereby realizing the rapid reading of the file data of the resource file to be written based on the target metadata information.

[0130] In some embodiments, to further improve the reading efficiency of resource files to be written in a large file system, the step "Write target metadata information in metadata file" may include the following operations:

[0131] Check whether the metadata file contains historical metadata information to be written to the resource file;

[0132] If the metadata file includes historical metadata information, then the historical metadata information is updated based on the target metadata information.

[0133] Historical metadata information refers to the initial metadata information of the resource file to be written. For example, if the resource file to be written can be an updated version of an existing resource file, then the initial metadata information can be the metadata information of that existing resource file.

[0134] Specifically, to check whether the metadata file includes historical metadata information for the resource file to be written, the index information can be determined through the file path of the resource file to be written, and the hash bucket corresponding to the file path can be determined through a hash algorithm. The index information refers to the correspondence between the file path and the hash bucket.

[0135] If a hash bucket exists corresponding to the file path of the resource file to be written, it can be determined that the metadata file includes historical metadata information. At this time, the historical metadata can be updated using the target metadata information to obtain the updated metadata information of the resource file to be written.

[0136] In some embodiments, to avoid failure in writing metadata information to the metadata file, the following steps may be included before the step "Write the target metadata information to the metadata file":

[0137] Detect the usage status of metadata files;

[0138] If the status indicator indicates that the metadata file is in use, then obtain the alternative metadata file for the metadata file;

[0139] The step "Write target metadata information in metadata file" can include the following operations:

[0140] Write the target metadata information into the backup metadata file.

[0141] The usage status indicates whether the data in the current metadata file is being used, that is, whether it has been accessed, edited, or updated.

[0142] In this embodiment of the application, a backup original data file is set for the metadata file. The backup metadata file is also a backup file of the metadata file. When the usage status of the original data file is detected as being in use, the backup metadata file of the metadata file can be obtained. By writing the target metadata information into the backup metadata file, the metadata information of the resource file to be written can be stored. The backup metadata file stores the same metadata information as the metadata file to ensure the consistency of the metadata file.

[0143] For example, metadata information for a large file system can be stored in the resource_x.Compact file, where 'x' can represent a number from 0 to 9. Specifically, if resource_1.Compact can be a metadata file, then resource_2.Compact can be set as a backup metadata file. Furthermore, when metadata information needs to be written, if resource_1.Compact is detected to be in use, the necessary metadata information can be written to resource_2.Compact. This avoids the problem of the Compact file being corrupted due to a sudden process shutdown while writing to the Compact file, resulting in a lack of usable Compact index file upon the next startup and the game failing to start normally.

[0144] In some embodiments, to improve the reading efficiency of resource files in a large file system, the method may further include the following steps:

[0145] Receive file read commands based on a large file system and obtain the file path of the resource file to be read according to the read commands;

[0146] Determine the metadata information of the resource file to be read from the metadata file based on the file path;

[0147] Based on the metadata information of the resource file to be read, determine the corresponding data block of the resource file to be read from the data blocks of the metadata management layer;

[0148] Read the file data of the resource file to be read from the data block corresponding to the resource file to be read.

[0149] Specifically, when a file read instruction for a large file system is received, the resource file to be read is determined according to the file read instruction, and the file information of the resource file to be read is obtained, such as the file path of the resource file to be read.

[0150] Furthermore, based on the file path of the resource file to be read, the metadata information corresponding to the file path is searched in the metadata file of the large file system. This yields the metadata information of the resource file to be read, which may include the data block corresponding to the resource file to be read. Then, the file data of the resource file to be read is read from the data block corresponding to the resource file to be read.

[0151] In some embodiments, to improve the resource file writing speed, the following operations may be included before the step "receiving file writing instructions based on a large file system of the game engine":

[0152] Receive download instructions for the resource file to be written, and start multiple threads of the large file system to download the resource file to be written according to the download instructions;

[0153] The step "Write the file data to be written to the resource file to the target data block through the large file system" can include the following operations:

[0154] The file data to be written to the resource file is written to the target data block using multiple threads.

[0155] In this embodiment of the application, the resource file to be written can be downloaded first before performing the writing operation on the resource file to be written.

[0156] Specifically, the script layer of the patch logic in the large file system starts multiple download threads. By having multiple download threads download the resource files to be written simultaneously, the download speed can be accelerated.

[0157] Furthermore, after the resource file to be written is downloaded via multi-threading, it can be written to the local disk. To fully utilize the advantages of multi-threaded parallel downloading, logic for releasing the global interpreter lock is added to the large file system's file writing process, and a spin lock, `writeSpinLock`, is added to prevent two threads from writing to the same file simultaneously.

[0158] The Global Interpreter Lock (GIL) is a tool used by computer programming language interpreters to synchronize threads, ensuring that only one thread is executing at any given time. Spin locks are locks specifically introduced to prevent multiprocessor concurrency and are widely used in the kernel, particularly in interrupt handling and other related areas.

[0159] Specifically, the process of writing file data of the resource file to be written to the target data block through multiple threads can be as follows: obtain the file name, file data, and file length of the resource file to be written, release the global interpreter lock, acquire the spin lock, and then write the file data of the resource file to be written to the target data block of the large file system through multiple threads, and then acquire the global interpreter lock and release the spin lock.

[0160] This application discloses a file management method, which includes: receiving a file write instruction from a large file system based on a game engine; obtaining file information of a resource file to be written according to the file write instruction; wherein the large file system includes a metadata management layer and a data block management layer; the metadata management layer is used to manage the metadata of resource files in the large file system, and the data block management layer is used to manage the file data of resource files in the large file system; further, determining a target data block from the data blocks of the data block management layer based on the file information and the metadata file in the metadata management layer; wherein the metadata file includes the metadata information of resource files in the large file system; and then, writing the file data of the resource file to be written to the target data block through the large file system. This solution reduces the number of files by storing resource files in the file system into a large block file for management, allowing files that need to be accessed frequently to be managed in the same block, and also reducing the overhead of file read and write operations.

[0161] Based on the above description, the document management method of this application will be further illustrated with examples below. Please refer to... Figure 6 , Figure 6 The following is a flowchart illustrating another file management method provided in this application embodiment. Taking the application of this file management method to file management in a game file system as an example, the specific process can be as follows:

[0162] 201. Obtain file information of downloaded game patch files in the game file system.

[0163] The game file system refers to the file system used to manage resource files in the game. For example, resource files in the game may include: UI (User Interface), shaders, scripts, models, textures, audio and other resources.

[0164] Specifically, the game file system can include five directories, namely: Local Data / Patch, Local Data / Metadata Patch, Package, Metadata Package, Engine, and Local Data. The Patch logic places the latest Patch file in the LocalData / Patch directory. When the game starts, it can manage the latest files, and this game file system can support the game's Patch functionality.

[0165] Each directory level represents a file access interface. The file system can manage the resource files under each directory level through the file access interface. The access priority of each directory from high to low can be as follows: LocalData / Patch, LocalData / CompactPatch, Package, CompactPackage, Engine, LocalData.

[0166] For example, when the file system manages a resource file, it can first search and manage the LocalData / Patch directory, then the LocalData / CompactPatch directory, then the Package directory, then the CompactPackage directory, then the Engine directory, and finally the LocalData directory, until the resource file that needs to be managed is found.

[0167] Specifically, in this embodiment, two directories, LocalData / CompactPatch and CompactPackage, are added. The LocalData / CompactPatch layer stores the metadata of each resource file in the game file system (recording the storage location of each resource file, with "Compact" being the suffix for binary files); the CompactPackage layer stores the block data of each resource file in the game file system (the actual storage location of the resource file, with "block" being the suffix).

[0168] In this embodiment, the downloaded game patch file can first be stored in the LocalData / Patch directory, and then the downloaded game patch file in LocalData / Patch can be transferred to the LocalData / CompactPatch directory for file writing.

[0169] Then, obtain the file information of the game patch file. For example, the file information may include the file name, file data, file path, and file length of the game patch file.

[0170] 202. Based on the file information and the game file system's metadata file, determine the target game data storage block from the game data storage blocks of the game file system.

[0171] First, determine whether the game patch file's metadata information is stored in the game file system's metadata file based on the game patch file's file path. Specifically, the index corresponding to the file path can be determined based on the determined hash algorithm, and the game file system can try to find the game patch file's metadata information in the metadata file using the index.

[0172] If the metadata information of the game patch file is found in the metadata file, the game data storage block storing the game patch file can be determined based on the metadata information of the game patch file, and the target game data storage block can be obtained.

[0173] If the metadata information of the game patch file is not found in the metadata file, a new game data storage block can be created in the game file system based on the metadata information of the game patch file to obtain the target game data storage block.

[0174] 203. Determine the target storage location from the target game data storage block based on the file information.

[0175] Specifically, based on the file data and file length in the file information, a suitable storage location is selected from the target game data storage block to obtain the target storage location. The specific method has been described in the above embodiments and will not be repeated here.

[0176] 204. Store the file data of the game patch file in the target storage location.

[0177] Furthermore, the game file system can write the game patch file's data to the target storage location of the target game data storage block, thus completing the storage of the game patch file's data. Using game data storage blocks, multiple game patch files can be stored and managed centrally. When there are many game patch files, merging multiple files into a single large file can improve file management efficiency.

[0178] 205. Generate metadata information for the game patch file based on the file information and the target storage location, and store the metadata information in a metadata file.

[0179] Specifically, based on the file name, file length, file data, and the target storage location of the game patch file in the target game data storage block, the metadata information of the game patch file can be obtained. Then, the metadata information is written into the metadata file of the game file system to facilitate the efficiency of subsequent reading of the game patch file.

[0180] This application discloses a file management method, which includes: obtaining file information of downloaded game patch files in a game file system; determining a target game data storage block from the game data storage block of the game file system based on the file information and the metadata file of the game file system; determining a target storage location from the target game data storage block based on the file information; storing the file data of the game patch files in the target storage location; generating metadata information of the game patch files based on the file information and the target storage location; and storing the metadata information in the metadata file. This method can improve the read and write efficiency of game patch files in the game file system.

[0181] To facilitate better implementation of the file management method provided in this application, this application also provides a file management device based on the above-described file management method. The meanings of the terms used are the same as in the file management method described above, and specific implementation details can be found in the descriptions within the method embodiments.

[0182] Please see Figure 7 , Figure 7 A structural block diagram of a file management device provided in this application embodiment, the device comprising:

[0183] The first receiving unit 301 is used to receive a file write instruction based on a large file system of a game engine, and to obtain file information of the resource file to be written according to the file write instruction. The large file system includes a metadata management layer and a data block management layer. The metadata management layer is used to manage the metadata of the resource files in the large file system, and the data block management layer is used to manage the file data of the resource files in the large file system.

[0184] The first determining unit 302 is configured to determine a target data block from the data blocks of the data block management layer based on the file information and the metadata file in the metadata management layer, wherein the metadata file includes metadata information of resource files in the large file system;

[0185] The first writing unit 303 is used to write the file data of the resource file to be written into the target data block through the large file system.

[0186] In some embodiments, the first determining unit 302 may include:

[0187] The first determining subunit is used to determine the index information corresponding to the resource file to be written based on the file information;

[0188] A search subunit is used to search for the file information in the metadata file based on the index information, and obtain the search result;

[0189] The second determining subunit is used to determine the target data block from the data blocks of the data block management layer based on the search result.

[0190] In some embodiments, the second determining subunit is specifically used for:

[0191] If the search result indicates that the file information exists in the metadata file, then the data block corresponding to the resource file to be written is determined from the data blocks of the data block management layer to obtain the target data block;

[0192] If the search result indicates that the file information does not exist in the metadata file, a new data block is created in the data block management layer to obtain the target data block.

[0193] In some embodiments, the first determining unit 302 may further include:

[0194] The removal subunit is used to remove existing resource file data from the target data block to obtain the processed target data block.

[0195] In some embodiments, the first writing unit 303 may include:

[0196] The first writing subunit is used to write the file data of the resource file to be written into the processed target data block.

[0197] In some embodiments, the first writing unit 303 may include:

[0198] The second determining subunit is used to determine the target storage location from the target data block based on the file information;

[0199] The second writing subunit is used to write the file data of the resource file to be written to the target storage location.

[0200] In some embodiments, the second determining subunit is specifically used for:

[0201] Obtain the remaining storage space of the target data block;

[0202] Based on the file data and the file length, a storage location is selected from the remaining storage space to obtain the target storage location.

[0203] In some embodiments, the device further includes:

[0204] A generation unit is configured to generate target metadata information for the resource file to be written based on the file information and the target data block.

[0205] The second writing unit is used to write the target metadata information into the metadata file.

[0206] In some embodiments, the second writing unit is specifically used for:

[0207] Detect whether the metadata file includes historical metadata information of the resource file to be written;

[0208] If the metadata file includes the historical metadata information, then the historical metadata information is updated based on the target metadata information.

[0209] In some embodiments, the device further includes:

[0210] The detection unit is used to detect the usage status of the metadata file;

[0211] The acquisition unit is configured to acquire a backup metadata file of the metadata file if the usage status indicates that the metadata file is in use.

[0212] In some embodiments, the second writing unit includes:

[0213] The third writing subunit is used to write the target metadata information into the backup metadata file.

[0214] In some embodiments, the device further includes:

[0215] The second receiving unit is used to receive a file read instruction based on the large file system and obtain the file path of the resource file to be read according to the read instruction.

[0216] The second determining unit is used to determine the metadata information of the resource file to be read from the metadata file based on the file path;

[0217] The third determining unit is used to determine the data block corresponding to the resource file to be read from the data blocks of the metadata management layer based on the metadata information of the resource file to be read.

[0218] The reading unit is used to read the file data of the resource file to be read from the data block corresponding to the resource file to be read.

[0219] In some embodiments, the device further includes:

[0220] The third receiving unit is used to receive a download instruction for the resource file to be written, and to start multiple threads of the large file system to download the resource file to be written according to the download instruction.

[0221] In some embodiments, the first writing unit 303 may include:

[0222] The fourth writing subunit is used to write the file data of the resource file to be written into the target data block through the multiple threads.

[0223] This application discloses a file management device. A first receiving unit 301 receives a file write instruction from a large file system based on a game engine. Based on the file write instruction, it obtains file information of the resource file to be written. The large file system includes a metadata management layer and a data block management layer. The metadata management layer manages the metadata of the resource files in the large file system, and the data block management layer manages the file data of the resource files in the large file system. A first determining unit 302 determines a target data block from the data blocks of the data block management layer based on the file information and the metadata file in the metadata management layer. The metadata file includes the metadata information of the resource files in the large file system. A first writing unit 303 writes the file data of the resource file to be written into the target data block through the large file system. This improves the management efficiency of resource files in the file system.

[0224] Accordingly, embodiments of this application also provide a computer device, which can be a server. For example... Figure 8 As shown, Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 400 includes a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, and a computer program stored on the memory 402 and executable on the processor. The processor 401 and the memory 402 are electrically connected. Those skilled in the art will understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0225] The processor 401 is the control center of the computer device 400. It connects various parts of the computer device 400 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it performs various functions of the computer device 400 and processes data, thereby monitoring the computer device 400 as a whole.

[0226] In this embodiment, the processor 401 in the computer device 400 loads the instructions corresponding to the processes of one or more applications into the memory 402 according to the following steps, and the processor 401 runs the applications stored in the memory 402 to achieve various functions:

[0227] The system receives file write commands from a large file system based on the game engine. It then retrieves the file information of the resource file to be written based on these commands. The large file system includes a metadata management layer and a data block management layer. The metadata management layer manages the metadata of the resource files within the large file system, while the data block management layer manages the file data of the resource files within the large file system. Based on the file information and the metadata file in the metadata management layer, the system determines the target data block from the data blocks in the data block management layer. The metadata file includes the metadata information of the resource files within the large file system. Finally, the system writes the file data of the resource file to be written to the target data block using the large file system.

[0228] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0229] Optional, such as Figure 8 As shown, the computer device 400 also includes: a touch screen display 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. The processor 401 is electrically connected to the touch screen display 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407. Those skilled in the art will understand that... Figure 8 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0230] The touch display screen 403 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 403 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 401. It can also receive and execute commands from the processor 401. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 401 to determine the type of touch event. Subsequently, the processor 401 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 403 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 403 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 403 can also be used as part of the input unit 406 to achieve input functions.

[0231] In this embodiment, a game application is executed by processor 401 to generate a graphical user interface (GUI) on touch display screen 403. The virtual scene on the GUI includes at least one skill control area, and the skill control area includes at least one skill control. The touch display screen 403 is used to present the GUI and receive operation commands generated by the user interacting with the GUI.

[0232] The radio frequency circuit 404 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.

[0233] Audio circuitry 405 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuitry 405 can convert received audio data into electrical signals and transmit them to the speaker, where the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 405, converted back into audio data, and then processed by processor 401 before being transmitted via radio frequency circuitry 404 to, for example, another computer device, or output to memory 402 for further processing. Audio circuitry 405 may also include an earphone jack to facilitate communication between peripheral headphones and the computer device.

[0234] The input unit 406 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0235] Power supply 407 is used to supply power to various components of computer device 400. Optionally, power supply 407 can be logically connected to processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 407 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0236] although Figure 8 As not shown in the diagram, computer equipment 400 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.

[0237] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0238] As can be seen from the above, the computer device provided in this embodiment receives a file write instruction from a large file system based on a game engine, obtains file information of the resource file to be written according to the file write instruction, wherein the large file system includes a metadata management layer and a data block management layer. The metadata management layer is used to manage the metadata of the resource files in the large file system, and the data block management layer is used to manage the file data of the resource files in the large file system. Based on the file information and the metadata file in the metadata management layer, a target data block is determined from the data blocks in the data block management layer, wherein the metadata file includes the metadata information of the resource files in the large file system. The file data of the resource file to be written is written to the target data block through the large file system.

[0239] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0240] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute steps in any of the file management methods provided in embodiments of this application. For example, the computer program can execute the following steps:

[0241] Receive file write instructions from a large file system based on a game engine, and obtain file information of the resource file to be written according to the file write instructions. The large file system includes a metadata management layer and a data block management layer. The metadata management layer is used to manage the metadata of the resource files in the large file system, and the data block management layer is used to manage the file data of the resource files in the large file system.

[0242] Based on the file information and the metadata file in the metadata management layer, the target data block is determined from the data blocks in the data block management layer. The metadata file includes the metadata information of the resource files in the large file system.

[0243] The file data to be written to the resource file is written to the target data block using the large file system.

[0244] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0245] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0246] Since the computer program stored in the storage medium can execute the steps of any of the file management methods provided in the embodiments of this application, the beneficial effects that any of the file management methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0247] The foregoing has provided a detailed description of a file management method, apparatus, storage medium, and computer device provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A file management method, characterized in that, The method includes: The system receives a file write instruction from a large file system based on a game engine, and obtains the file information of the resource file to be written according to the file write instruction. The large file system includes a metadata management layer and a data block management layer. The metadata management layer is used to manage the metadata of the resource files in the large file system, and the data block management layer is used to manage the file data of the resource files in the large file system. Based on the file information and the metadata file in the metadata management layer, a target data block is determined from the data blocks in the data block management layer, wherein the metadata file includes metadata information of resource files in the large file system; The file data of the resource file to be written is written to the target data block through the large file system; wherein... After writing the file data of the resource file to be written to the target data block through the large file system, the method further includes: Generate the target metadata information of the resource file to be written based on the file information and the target data block; Write the target metadata information into the metadata file; The step of writing the target metadata information into the metadata file includes: Detect whether the metadata file includes historical metadata information of the resource file to be written; If the metadata file includes the historical metadata information, then the historical metadata information is updated based on the target metadata information.

2. The method according to claim 1, characterized in that, The step of determining the target data block from the data blocks in the data block management layer based on the file information and the metadata file in the metadata management layer includes: Determine the index information corresponding to the resource file to be written based on the file information; Based on the index information, the file information is searched in the metadata file to obtain the search results; The target data block is determined from the data blocks in the data block management layer based on the search results.

3. The method according to claim 2, characterized in that, Determining the target data block from the data blocks in the data block management layer using the search results includes: If the search result indicates that the file information exists in the metadata file, then the data block corresponding to the resource file to be written is determined from the data blocks of the data block management layer to obtain the target data block; If the search result indicates that the file information does not exist in the metadata file, a new data block is created in the data block management layer to obtain the target data block.

4. The method according to claim 3, characterized in that, After determining the data block corresponding to the resource file to be written from the data blocks of the data block management layer to obtain the target data block, the method further includes: Remove the existing resource file data from the target data block to obtain the processed target data block; The step of writing the file data of the resource file to be written to the target data block includes: The file data to be written to the resource file is written to the processed target data block.

5. The method according to claim 1, characterized in that, The step of writing the file data of the resource file to be written to the target data block through the large file system includes: The target storage location is determined from the target data block based on the file information; Write the file data of the resource file to be written to the target storage location.

6. The method according to claim 5, characterized in that, The file information includes at least the file data and the file length; Determining the target storage location from the target data block based on the file information includes: Obtain the remaining storage space of the target data block; Based on the file data and the file length, a storage location is selected from the remaining storage space to obtain the target storage location.

7. The method according to claim 1, characterized in that, Before writing the target metadata information into the metadata file, the method further includes: Detect the usage status of the metadata file; If the usage status indicates that the metadata file is in use, then obtain a backup metadata file for the metadata file; The step of writing the target metadata information into the metadata file includes: Write the target metadata information into the backup metadata file.

8. The method according to claim 1, characterized in that, Also includes: Receive a file read instruction based on the large file system, and obtain the file path of the resource file to be read according to the read instruction; Based on the file path, determine the metadata information of the resource file to be read from the metadata file; Based on the metadata information of the resource file to be read, determine the data block corresponding to the resource file to be read from the data blocks of the metadata management layer; Read the file data of the resource file to be read from the data block corresponding to the resource file to be read.

9. The method according to claim 1, characterized in that, Before receiving file write instructions based on a large file system of the game engine, the following is also included: Receive a download instruction for the resource file to be written, and start multiple threads of the large file system to download the resource file to be written according to the download instruction; The step of writing the file data of the resource file to be written to the target data block through the large file system includes: The file data of the resource file to be written is written to the target data block through the multiple threads.

10. The method according to any one of claims 1 to 9, characterized in that, The data in the metadata file is binary data, and the data in the data block is binary data.

11. A document management device, characterized in that, The device includes: The first receiving unit is used to receive a file write instruction based on a large file system of a game engine, and to obtain the file information of the resource file to be written according to the file write instruction. The large file system includes a metadata management layer and a data block management layer. The metadata management layer is used to manage the metadata of the resource files in the large file system, and the data block management layer is used to manage the file data of the resource files in the large file system. The first determining unit is configured to determine a target data block from the data blocks of the data block management layer based on the file information and the metadata file in the metadata management layer, wherein the metadata file includes metadata information of resource files in the large file system; The first writing unit is used to write the file data of the resource file to be written into the target data block through the large file system; wherein... The generation unit is configured to generate target metadata information of the resource file to be written based on the file information and the target data block after the file data of the resource file to be written is written to the target data block through the large file system. The second writing unit is used to write the target metadata information into the metadata file; The second writing unit is further configured to detect whether the metadata file includes historical metadata information of the resource file to be written; if the metadata file includes the historical metadata information, the historical metadata information is updated based on the target metadata information.

12. A computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein, When the processor executes the program, it implements the file management method as described in any one of claims 1 to 10.

13. A storage medium, characterized in that, The storage medium stores a plurality of instructions, which are adapted for loading by a processor to execute the file management method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Distributed file system facing to cloud storage

    CN102420854A

  • File management method and system, electronic equipment and storage medium

    CN110018998A

  • Method, apparatus and computer program product for data management

    CN113590020A