File resource pool allocation method and device, equipment, storage medium and program product

By intercepting requests when files are created and using a global storage policy table to match filenames, files are automatically assigned to target storage pools. This solves the problems of poor flexibility in file resource pool allocation and high management costs, and achieves efficient and intelligent file storage management.

CN121326231APending Publication Date: 2026-01-13INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510783660.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

In existing technologies, file resource pool allocation has poor flexibility and high management costs. Traditional storage systems rely on manual intervention and rigid rules, which cannot adapt to dynamically changing storage environments and ever-changing business needs.

Method used

By intercepting requests when files are created, and utilizing filename wildcards and target storage pool identifiers in the global storage policy table, files are automatically matched and allocated to the target storage pool, achieving intelligent allocation.

Benefits of technology

It improves the flexibility and efficiency of file storage, reduces management costs, ensures that files are stored in the corresponding target storage pool, and improves system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121326231A_ABST
    Figure CN121326231A_ABST
Patent Text Reader

Abstract

The invention provides a file resource pool allocation method and device, equipment, a storage medium and a program product, relates to the field of big data, and can be applied to the field of cloud application. The method comprises the following steps: in response to a file creation request of a file system, modifying a kernel driver of the file system so as to intercept the file creation request when an index node is allocated to a file corresponding to the file creation request; acquiring a global storage strategy table; wherein the global storage strategy table comprises a plurality of strategies, and the strategies comprise file name wildcard characters and identifiers of corresponding target storage pools; extracting a file name of the file; determining an identifier of a target storage pool corresponding to the file according to the file name and a global storage strategy table; writing an identifier of a target storage pool corresponding to the file into the index node; wherein the index node is used for indicating to distribute the file to the target storage pool. The flexibility of file resource allocation is improved, the manual scheduling cost is reduced, and the overall performance of a system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data, and in particular to a method, apparatus, device, storage medium, and program product for allocating file resource pools. Background Technology

[0002] In cloud computing environments, efficient file storage scheduling is crucial to system performance and management costs. Traditional storage systems rely on data access patterns such as hot / cold tiers, resource utilization, or fixed directory structures for file allocation to meet basic file storage needs.

[0003] However, in a dynamically changing storage environment, the problems of frequent manual intervention and rigid rules are becoming increasingly prominent. With the surge in data volume and the elastic expansion of storage resources, the existing cold and hot tiered data access model lacks the ability to pre-allocate data when files are created. The balanced allocation of storage nodes based on resource utilization cannot simultaneously take into account file semantics and business attributes, resulting in a mismatch between logical and physical storage. On the other hand, adopting a fixed directory structure requires manual specification of storage paths, which lacks dynamic adaptation capabilities and is difficult to match the ever-changing business needs.

[0004] Therefore, existing technologies suffer from poor flexibility in allocating file resource pools and high management costs. Summary of the Invention

[0005] This application provides a file resource pool allocation method, apparatus, device, storage medium, and program product to solve the technical problems of poor flexibility and high management cost in file resource pool allocation.

[0006] Firstly, this application provides a method for allocating a file resource pool, including:

[0007] In response to a file creation request from the file system, the kernel driver of the file system is modified to intercept the file creation request when allocating an inode for the file corresponding to the file creation request.

[0008] Retrieve the global storage policy table; the global storage policy table includes multiple policies, each of which includes a filename wildcard and an identifier for the corresponding target storage pool;

[0009] Extract the file name;

[0010] Based on the filename and the global storage policy table, determine the identifier of the target storage pool corresponding to the file;

[0011] Write the identifier of the target storage pool corresponding to the file to the inode; the inode is used to indicate that the file should be allocated to the target storage pool.

[0012] Secondly, this application provides a file resource pool allocation device, comprising:

[0013] Create a processing module to respond to file creation requests from the file system, modify the file system kernel driver to intercept file creation requests when allocating inodes for the files corresponding to the file creation requests;

[0014] The acquisition module is used to acquire the global storage policy table; the global storage policy table includes multiple policies, and each policy includes a filename wildcard and the identifier of the corresponding target storage pool.

[0015] The extraction module is used to extract the filenames of files;

[0016] The determination module is used to determine the identifier of the target storage pool corresponding to the file based on the filename and the global storage policy table;

[0017] The write module is used to write the identifier of the target storage pool corresponding to the file to the inode; wherein the inode is used to indicate that the file is allocated to the target storage pool.

[0018] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0019] The memory stores the instructions that the computer executes;

[0020] The processor executes computer-executable instructions stored in memory to implement, as in the first aspect or various possible implementations of the first aspect.

[0021] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect or various possible implementations of the first aspect.

[0022] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the first aspect or various possible implementations of the first aspect.

[0023] This application provides a file resource pool allocation method, apparatus, device, storage medium, and program product. By intercepting file creation requests and matching the filename with filename wildcards in the global storage policy table based on an obtained global storage policy table, the identifier of the corresponding target storage pool is determined. The identifier of the target storage pool corresponding to the file is written into an inode to indicate that the file should be allocated to the target storage pool. Compared with existing technologies, this method provides a flexible storage management scheme through a global policy table including filename wildcards and corresponding target storage pool identifiers. By intercepting, matching, and indexing file creation requests during file creation, it ensures that files are stored in the corresponding target storage pool, achieving rapid and intelligent file allocation, improving system performance, and reducing management costs. Attached Figure Description

[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0025] Figure 1 A schematic diagram of a file resource pool allocation system architecture is provided for this application;

[0026] Figure 2 A flowchart illustrating a file resource pool allocation method provided in this application. Figure 1 ;

[0027] Figure 3 A flowchart illustrating a file resource pool allocation method provided in this application. Figure 2 ;

[0028] Figure 4 A flowchart illustrating a file resource pool allocation method provided in this application. Figure 3 ;

[0029] Figure 5 A flowchart illustrating a file resource pool allocation method provided in this application. Figure 4 ;

[0030] Figure 6 A schematic diagram of a file resource pool allocation device provided in this application;

[0031] Figure 7 This is a schematic diagram of the structure of an electronic device provided in this application.

[0032] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0033] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation access points for users to choose to authorize or refuse.

[0035] Furthermore, the technical solution involved in this application, which involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and the use of artificial intelligence technology for automated decision-making, and makes decisions that have a significant impact on personal rights based on the results of automated decision-making, provides users with corresponding operation entry points for users to choose to agree to or reject the results of automated decision-making; if the user chooses to reject, the process will proceed to the expert decision-making process.

[0036] It should be noted that the file resource pool allocation method, apparatus, device, storage medium, and program product provided in this application can be used in the field of big data, or in any field other than big data, such as cloud applications. The application field of the file resource pool allocation method, apparatus, device, storage medium, and program product in this application is not limited.

[0037] In cloud computing environments, traditional storage scheduling relies on manual management, using methods such as data access patterns, hot and cold data tiering, or resource utilization to schedule files. However, traditional storage scheduling requires specifying directories, and the scheduling rules are inflexible. Furthermore, with the dynamic changes in the number of files and storage resources, manual management is prone to errors in file storage scheduling and incurs significant costs.

[0038] To address the aforementioned issues, this application proposes a file resource pool allocation method. Its core concept lies in: establishing a global storage strategy table based on rules corresponding to filename wildcards and storage pool identifiers; intercepting file creation requests when a file is created, performing filename matching, and determining the identifier of the target storage pool corresponding to the file; indexing based on the identifier of the target storage pool corresponding to the file, thereby allocating the file to the target storage pool; achieving intelligent allocation of storage resources, reducing the cost of manual scheduling, and improving the flexibility and efficiency of file storage allocation.

[0039] Optionally, Figure 1 This is a schematic diagram of a file resource pool allocation system architecture provided in this application. Figure 1 As shown, the file resource pool allocation system architecture includes at least one of a data acquisition device 101, a processing device 102, and a display device 103.

[0040] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the above architecture. In other feasible embodiments of this application, the above architecture may include more or fewer components than illustrated, or combine some components, or split some components, or arrange different components, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of both.

[0041] In the specific implementation process, the data acquisition device 101 may include an input / output interface or a communication interface, and the data acquisition device 101 can be connected to the processing device through the input / output interface or the communication interface.

[0042] The processing device 102 can respond to a file creation request from the file system by modifying the file system kernel driver to intercept the file creation request when allocating an inode for the file corresponding to the file creation request; extracting the file name; determining the identifier of the target storage pool corresponding to the file based on the file name and the obtained global storage policy table; wherein the global storage policy table includes multiple policies, and each policy includes a file name wildcard and the corresponding identifier of the target storage pool; and writing the identifier of the target storage pool corresponding to the file to the inode; wherein the inode is used to indicate that the file is allocated to the target storage pool.

[0043] The display device 103 can also be a touch screen or the screen of a terminal device, used to receive user commands while displaying the above-mentioned content, so as to realize interaction with the user.

[0044] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0045] Figure 2 A flowchart illustrating a file resource pool allocation method provided in this application. Figure 1 ,like Figure 2 As shown, the method includes:

[0046] S201. In response to a file creation request from the file system, modify the file system kernel driver to intercept the file creation request when allocating an inode for the file corresponding to the file creation request.

[0047] In this embodiment, the kernel driver of the file system includes ext4 (Fourth Extended Filesystem) or XFS (Extremely Large File System). By adding hooks to the ext4 interface function ext4_create() or the XFS interface function xfs_create(), the kernel driver of the file system in this embodiment is obtained. This is used to intercept the file creation request before allocating an inode for the file corresponding to the file creation request. Here, a hook is a custom code snippet inserted into the execution flow of a specific function, used to intercept, modify, or extend the original functionality.

[0048] S202. Obtain the global storage policy table; wherein, the global storage policy table includes multiple policies, and each policy includes a filename wildcard and the identifier of the corresponding target storage pool.

[0049] In this embodiment, for example, the filename wildcards include log and appdata; the corresponding target storage pool identifiers include LOGPOOL and APPPOOL.

[0050] S203, Extract the file name.

[0051] In this embodiment, the file name is obtained from the intercepted file creation request. The file name includes the main file name and the extension. The main file name is the core identifier name of the file, and the extension represents the file format.

[0052] S204. Based on the filename and the global storage policy table, determine the identifier of the target storage pool corresponding to the file.

[0053] In this embodiment, by matching the file extension in the filename with the filename wildcard in the global storage policy table, if the match is successful, the identifier of the target storage pool corresponding to the file is determined as the identifier of the target storage pool corresponding to the file.

[0054] S205. Write the identifier of the target storage pool corresponding to the file to the inode; wherein, the inode is used to indicate that the file is allocated to the target storage pool.

[0055] In this embodiment, the identifier of the target storage pool corresponding to the file is written to the extended attribute of the inode to indicate that the file is allocated to the target storage pool.

[0056] Optionally, if the file extension in the filename does not match the filename wildcard in the global storage policy table, the file will be assigned to the default storage pool.

[0057] This application provides a file resource pool allocation method that automatically matches the file name with the global storage policy table when the file is created, and routes the file to the corresponding target storage pool. This achieves intelligent allocation of storage resources, reduces the cost of manual scheduling, and improves the flexibility and efficiency of file resource pool allocation.

[0058] Figure 3 A flowchart illustrating a file resource pool allocation method provided in this application. Figure 2 ,exist Figure 2 Based on the illustrated embodiment, the method for obtaining the global storage strategy table in step S202 above will be described in detail. The method includes:

[0059] S301, Construct a two-way communication mechanism between the kernel and user space for the file system.

[0060] In this embodiment, a bidirectional communication mechanism between the file system kernel and user space is constructed to establish a data exchange channel between the file system kernel and user programs. The bidirectional communication mechanism between the file system kernel and user space includes a user-space daemon process, the kernel, and Zookeeper (a distributed coordination service). The user-space daemon process is a background process that runs in user space for a long time and is responsible for pulling Zookeeper and managing the global storage policy table. Zookeeper is an open-source distributed coordination service that provides available configuration management, naming services, and cluster synchronization.

[0061] Optionally, when Zookeeper is unavailable, the kernel module switches to a local cache to ensure the availability of basic functions.

[0062] S302. Retrieve the global storage policy table through the user-space daemon process.

[0063] In this embodiment, for example, a user-space daemon process monitors Zookeeper in real time. When a policy change is detected, it pulls the global storage policy table and synchronizes the policy change in the global storage policy table to all nodes at a speed of milliseconds without restarting the service, thus ensuring the real-time synchronization of the policy.

[0064] S303. The global storage policy table is cached in the kernel via a network socket.

[0065] In this embodiment, the policy in the global storage policy table is formatted and validated by a network socket, thereby caching the global storage policy table to the kernel, which improves the policy parsing efficiency and security protection effect.

[0066] Optionally, the global storage policy table is cached in the kernel, including:

[0067] A red-black tree structure is used to cache the global storage policy table in the kernel.

[0068] In this embodiment, the red-black tree structure is a self-balancing binary search tree with a query time complexity of O(logn). Compared with a self-balancing binary search tree, it has higher query performance. Therefore, by adopting the red-black tree structure and caching the global storage strategy table in the kernel, efficient matching of filename wildcards and corresponding target storage pool identifiers can be achieved, ensuring high matching efficiency even with massive amounts of data, thus adapting to the high throughput requirements of cloud computing environments.

[0069] This application provides a file resource pool allocation method that improves the file system kernel through hooks and builds a bidirectional communication mechanism between the kernel and user space. By using network sockets and a red-black tree structure to cache the global storage policy table in the kernel, it achieves real-time policy synchronization, ensuring policy consistency, and improves policy query efficiency and matching performance.

[0070] Figure 4 A flowchart illustrating a file resource pool allocation method provided in this application. Figure 3 ,exist Figure 2 Based on the embodiment shown, before obtaining the global storage policy table in step S202 above, the method further includes:

[0071] S401, Obtain multiple strategies.

[0072] In this embodiment, the strategy refers to the rules used to determine which target storage pool a file is allocated to when it is created or moved.

[0073] A global storage policy table is constructed based on multiple strategies.

[0074] Optionally, a global storage policy table is constructed based on multiple policies, including:

[0075] S402. Obtain the additional version number and effective timestamp corresponding to the strategy.

[0076] In this embodiment, for each policy, when generating the policy, the additional version number and the defined effective timestamp are recorded; wherein, the additional version number is unique and is used to identify different versions of the policy; the effective timestamp is used to indicate the effective time of the policy.

[0077] S403. Construct a global storage policy table based on the policy, additional version number, and effective timestamp.

[0078] In this embodiment, a global storage policy table is constructed based on the policy, additional version number, and effective timestamp; this supports the canary release of policies and the rollback of abnormal states, reducing the risk of policy introduction and improving the stability of the system.

[0079] Optionally, after constructing a global storage policy table based on multiple policies, the following may also be included:

[0080] S404. Utilize the distributed coordination service to save the global storage policy table.

[0081] In this embodiment, a distributed coordination service such as ZooKeeper is used to store a global policy table. Real-time synchronization across nodes is achieved through ZooKeeper's Watcher mechanism. For example, when a policy in the global policy table is updated, the server actively pushes the policy update event to the client to ensure global policy consistency.

[0082] This application provides a file resource pool allocation method that improves the reliability and stability of the system by acquiring multiple policies, attaching version numbers and effective timestamps, and using a distributed coordination service to save the global storage policy table, reducing the impact of manual scheduling and ensuring the global consistency of the policies.

[0083] Figure 5 A flowchart illustrating a file resource pool allocation method provided in this application. Figure 4 ,exist Figure 2 Based on the illustrated embodiment, after writing the identifier of the target storage pool corresponding to the file to the inode in step S205 above, the method further includes:

[0084] S501. In response to a file write request, obtain the inode of the file corresponding to the file write request.

[0085] In this embodiment, in response to a file write request, the index node of the file corresponding to the file write request is obtained, so as to achieve efficient access and management of the file corresponding to the file write request.

[0086] S502. Based on the inode, extract the identifier of the target storage pool corresponding to the file.

[0087] In this embodiment, the identifier of the target storage pool corresponding to the file is extracted based on the inode to indicate that the file is automatically routed to the logical volume corresponding to the identifier of the target storage pool, thus ensuring the accuracy of the file storage location.

[0088] S503. Write the file to the target storage pool.

[0089] In this embodiment, the file is written to the target storage pool according to the identifier of the target storage pool corresponding to the extracted file, thereby achieving data redirection and ensuring that the file is stored in the corresponding storage area, thus improving the accuracy of file storage.

[0090] In this embodiment, changes to the storage pool are completely transparent to upper-layer applications, simplifying system development and maintenance and reducing system management costs.

[0091] Optionally, after writing the file to the target storage pool, the method further includes:

[0092] S504. Monitor the load status of the target resource pool.

[0093] In this embodiment, the load status of the target resource pool includes the capacity of the logical volume, IOPS (Input / Output Operations Per Second), and latency; by obtaining the load status of the target resource pool in real time, and responding to sudden situations in a timely manner, the real-time performance and reliability of the system are enhanced.

[0094] S505. Dynamically adjust the load status according to the load status.

[0095] In this embodiment, for example, if a new logical volume is added, the logical volume will be automatically registered to the storage pool and the corresponding weight parameters will be updated to achieve seamless expansion of storage resources. A weighted round-robin algorithm will be used to dynamically allocate write paths to achieve load balancing, avoid assigning policies to overloaded nodes, and improve the balance and reliability of the system.

[0096] This application provides a file resource pool allocation method that achieves automatic file routing and accurate storage by obtaining inodes and extracting target storage pool identifiers. After a file is written, the system monitors the load status of the target resource pool to enhance the real-time performance and reliability of the system. Based on the load status, the system dynamically adjusts storage resources to achieve load balancing and improve the system's balance and reliability.

[0097] Figure 6 This application provides a schematic diagram of the structure of a file resource pool allocation device, as shown below. Figure 6 As shown, the resource pool allocation device for this file includes:

[0098] A processing module 601 is created to respond to file creation requests from the file system by modifying the file system kernel driver to intercept file creation requests when allocating inodes for the files corresponding to the file creation requests.

[0099] The acquisition module 602 is used to acquire the global storage policy table; wherein, the global storage policy table includes multiple policies, and each policy includes a filename wildcard and an identifier of the corresponding target storage pool.

[0100] Extraction module 603 is used to extract the file name.

[0101] The determination module 604 is used to determine the identifier of the target storage pool corresponding to the file based on the filename and the global storage policy table.

[0102] The write module 605 is used to write the identifier of the target storage pool corresponding to the file to the inode; wherein the inode is used to indicate that the file is allocated to the target storage pool.

[0103] In one possible implementation, the acquisition module 602 can also be used for:

[0104] A two-way communication mechanism between the kernel and user space is established to build the file system;

[0105] The global storage policy table is retrieved through a user-space daemon process;

[0106] The global storage policy table is cached in the kernel via a network socket.

[0107] In one possible implementation, the acquisition module 602 can also be used for:

[0108] A red-black tree structure is used to cache the global storage policy table in the kernel.

[0109] In one possible implementation, the acquisition module 602 can also be used for:

[0110] Obtain multiple strategies;

[0111] A global storage policy table is constructed based on multiple strategies.

[0112] In one possible implementation, the acquisition module 602 can also be used for:

[0113] Get the additional version number and effective timestamp corresponding to the strategy;

[0114] Construct a global storage policy table based on the policy, additional version number, and effective timestamp.

[0115] In one possible implementation, the acquisition module 602 can also be used for:

[0116] A global storage policy table is stored using a distributed coordination service.

[0117] In one possible implementation, the write module 605 can also be used for:

[0118] In response to a file write request, retrieve the inode of the file corresponding to the file write request;

[0119] Based on the inode, extract the identifier of the target storage pool corresponding to the file;

[0120] Write the file to the target storage pool.

[0121] In one possible implementation, after writing the file to the target storage pool, the following is also included:

[0122] The monitoring module is used to monitor the load status of the target resource pool;

[0123] The dynamic adjustment module is used to dynamically adjust the load status based on the load status.

[0124] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.

[0125] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.

[0126] Figure 7 A schematic diagram of the structure of an electronic device provided in this application, such as... Figure 7 As shown, the electronic device includes at least one processor 701 and a memory 702. Optionally, the electronic device also includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.

[0127] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.

[0128] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0129] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0130] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0131] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0132] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0133] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0134] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0135] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0136] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0137] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0138] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0139] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as a portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0140] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0141] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for allocating file resources from a pool, characterized by, The method comprises: In response to a file creation request of a file system, modifying a kernel driver of the file system to intercept the file creation request when allocating an inode for a file corresponding to the file creation request; Obtaining a global storage strategy table, wherein the global storage strategy table comprises a plurality of strategies, and each strategy comprises a file name wildcard and an identifier of a target storage pool corresponding to the file name wildcard; Extracting a file name of the file; Determining the identifier of the target storage pool corresponding to the file according to the file name and the global storage strategy table; Writing the identifier of the target storage pool corresponding to the file into the inode, wherein the inode is used to indicate that the file is allocated to the target storage pool.

2. The method of claim 1, wherein, The obtaining of the global storage strategy table comprises: Constructing a kernel and user state bidirectional communication mechanism of the file system; Pulling the global storage strategy table through a user state daemon process; Caching the global storage strategy table to the kernel through a web socket.

3. The method of claim 2, wherein, The caching of the global storage strategy table to the kernel comprises: Caching the global storage strategy table to the kernel in a red-black tree structure.

4. The method according to any one of claims 1 to 3, characterized in that, Before the obtaining of the global storage strategy table, the method further comprises: Obtaining a plurality of strategies; Constructing a global storage strategy table according to the plurality of strategies.

5. The method of claim 4, wherein, The construction of the global storage strategy table according to the plurality of strategies comprises: Obtaining an additional version number and an effective time stamp corresponding to the strategy; Constructing a global storage strategy table according to the strategy, the additional version number and the effective time stamp.

6. The method of claim 4, wherein, After the construction of the global storage strategy table according to the plurality of strategies, the method further comprises: Saving the global storage strategy table by using a distributed coordination service.

7. The method according to any one of claims 1 to 3, characterized in that, After the writing of the identifier of the target storage pool corresponding to the file into the inode, the method further comprises: In response to a file write request, obtaining an inode of a file corresponding to the file write request; According to the inode, extracting the identifier of the target storage pool corresponding to the file; Writing the file to the target storage pool.

8. The method of claim 7, wherein, After the writing of the file to the target storage pool, the method further comprises: Monitoring a load state of the target resource pool; According to the load state, dynamically adjusting the load state.

9. A file resource pool allocation apparatus characterized by comprising: The method comprises: A creating module, configured to, in response to a file creation request of a file system, modify a kernel driver of the file system to intercept the file creation request when allocating an inode for a file corresponding to the file creation request; An obtaining module, configured to obtain a global storage strategy table, wherein the global storage strategy table comprises a plurality of strategies, and each strategy comprises a file name wildcard and an identifier of a target storage pool corresponding to the file name wildcard; An extracting module, configured to extract a file name of the file; A determining module, configured to determine the identifier of the target storage pool corresponding to the file according to the file name and the global storage strategy table; A writing module, configured to write the identifier of the target storage pool corresponding to the file into the inode, wherein the inode is used to indicate that the file is allocated to the target storage pool.

10. An electronic device, comprising: The method comprises: A processor, and a memory connected with the processor in communication. The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.

11. A computer readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method according to any one of claims 1 to 8.

12. A computer program product, characterised in that, A computer program is included, which, when executed by a processor, implements the method according to any one of claims 1 to 8.