File system-oriented capacity expansion method and device

By distinguishing between the root file set and the user file set, determining expansion needs based on inode information, and performing task queue management, the problem of inode exhaustion in the file system is solved, improving the performance and reliability of the storage service.

CN121935217APending Publication Date: 2026-04-28BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BAIDU NETCOM SCI & TECH CO LTD
Filing Date
2025-12-19
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, file systems lack an automatic index node resizing mechanism for file sets, leading to index node exhaustion and write delays, which affect storage service performance.

Method used

By distinguishing between the root file set and the user file set, the expansion needs are determined based on the relevant information of the inode, expansion tasks are generated and executed, and the expansion process is managed by a task queue to avoid resource contention and waste.

Benefits of technology

It achieves precise index node expansion, avoiding file creation failures and business write interruptions, and improving the performance and reliability of storage services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121935217A_ABST
    Figure CN121935217A_ABST
Patent Text Reader

Abstract

The invention provides a file system-oriented capacity expansion method and device, and relates to the field of data processing, in particular to the field of artificial intelligence. According to the specific implementation scheme, a plurality of file sets contained in the file system are determined, wherein the file sets comprise a root file set created by the system in a default mode and a user file set created by a user autonomously; collecting index node related information corresponding to each file set, and for any file set, judging whether the file set has an expansion demand related to the index node based on the index node related information; if the file set has the capacity expansion requirement, generating a capacity expansion task corresponding to the file set in combination with the index node related information; and storing the capacity expansion tasks into the corresponding task queues, and executing the capacity expansion tasks according to the task sequence in the task queues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing, and more particularly to the field of artificial intelligence, specifically to a method and apparatus for expanding the capacity of a file system. Background Technology

[0002] In distributed file system storage management, a file set, as an independent logical storage unit, possesses its own dedicated inode space and management capabilities. Related technologies often lack an automatic inode expansion mechanism for file sets, leading to inode exhaustion and write failures as user data writes increase. Furthermore, untimely inode allocation frequently increases user write latency and impacts storage service performance. Summary of the Invention

[0003] This disclosure provides a method, apparatus, device, and storage medium for expanding a file system.

[0004] According to one aspect of this disclosure, a method for expanding a file system is provided, comprising: identifying multiple file sets contained in the file system, including a root file set created by default by the system and user-created user file sets; collecting inode-related information corresponding to each file set; determining, based on the inode-related information, whether the file set has an inode-related expansion requirement for any given file set; if the file set has an expansion requirement, generating an expansion task corresponding to the file set by combining the inode-related information; storing the expansion task in a corresponding task queue, and executing the expansion task in the order of the tasks in the task queue.

[0005] According to another aspect of this disclosure, a file system expansion device is provided, comprising: a determining module, configured to determine multiple file sets contained in the file system, the file sets including a root file set created by default by the system and user-created user file sets; a judging module, configured to collect inode-related information corresponding to each file set, and for any file set, determine whether the file set has an inode-related expansion requirement based on the inode-related information; a generating module, configured to generate an expansion task corresponding to the file set if the file set has an expansion requirement, in combination with the inode-related information; and an execution module, configured to store the expansion task in a corresponding task queue and execute the expansion task in the order of the tasks in the task queue.

[0006] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute the file system-oriented expansion method of the aforementioned file system.

[0007] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the file system-oriented expansion method of the aforementioned file system.

[0008] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the file system-oriented expansion method of the above-described file system.

[0009] The file system expansion method proposed in this application achieves at least the following beneficial effects: This application clearly distinguishes between two types of objects: root file sets and user file sets. Expansion can be performed according to different expansion logics for different types of file sets, avoiding resource contention or waste caused by using the same expansion rule for both types of file sets, thereby improving the accuracy of expansion. Expansion needs are determined based on the file set's own inode information, rather than using a globally unified threshold standard for the file system, enabling precise matching of the actual usage status of a single file set. By determining in advance whether expansion is needed, expansion can be triggered when the file set's inodes are about to run out, avoiding problems such as file creation failures and business write interruptions due to inode exhaustion.

[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is a schematic diagram illustrating an exemplary implementation of a file system expansion method according to an exemplary embodiment of the present disclosure.

[0012] Figure 2 This is a schematic diagram illustrating the relationship of index node-related information according to an exemplary embodiment of this disclosure.

[0013] Figure 3 This is a schematic diagram illustrating an exemplary implementation of a file system expansion method according to an exemplary embodiment of the present disclosure.

[0014] Figure 4 This is a schematic diagram illustrating an exemplary implementation of a file system expansion method according to an exemplary embodiment of the present disclosure.

[0015] Figure 5This is a schematic diagram illustrating an exemplary implementation of a file system expansion method according to an exemplary embodiment of the present disclosure.

[0016] Figure 6 This is a schematic diagram of a file system expansion device according to an exemplary embodiment of the present disclosure.

[0017] Figure 7 This is a schematic diagram of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0018] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0019] Artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It involves both hardware and software technologies. AI hardware technologies generally include computer vision, speech recognition, natural language processing, as well as learning / deep learning, big data processing, and knowledge graph technologies.

[0020] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0021] Figure 1 This is a schematic diagram illustrating an exemplary implementation of a file system expansion method as shown in this application, such as... Figure 1 As shown, this file system expansion method includes the following steps: S101, determine the multiple file sets contained in the file system, including the root file set created by default by the system and the user-created user file set.

[0022] Each file system has one and only one root fileset. The root fileset is created automatically when the file system is created. All files except for the user fileset belong to the root fileset, which is invisible to the user.

[0023] Each file system may include one or more user file sets (which may be recorded as indepentfileset), and user file sets are created by the users themselves.

[0024] S102, collect the relevant information of the index nodes corresponding to each file set, and for any file set, determine whether there is an index node-related expansion requirement based on the relevant information of the index nodes.

[0025] In some feasible methods, inode information for each file set can be collected periodically. For example, it can be set to collect information every 2 minutes, that is, to determine every 2 minutes whether there is an inode-related expansion requirement for each file set. The specific collection cycle can be set according to the actual situation and is not limited here.

[0026] The index node information may include the number of currently occupied index nodes at the time of data collection, the current maximum number of index nodes, and the current number of pre-allocated index nodes.

[0027] The number of currently occupied inodes refers to the number of currently used inodes corresponding to the file set. Since each file or directory corresponds to one inode, the number of currently occupied inodes can also be understood as the sum of the number of files and directories in the file set.

[0028] The current maximum number of inodes refers to the maximum number of inodes corresponding to the file set. Once the total number of files and directories written to the file set reaches the current maximum number of inodes, writing to files or directories will fail.

[0029] The number of pre-allocated index nodes refers to the number of index nodes that have been allocated for the file set. When the user's usage is less than this value, new writes will preferentially use the already allocated index nodes; otherwise, they will be dynamically allocated. Once allocated, they cannot be reclaimed.

[0030] Each index node is unique.

[0031] Figure 2 This application illustrates a schematic diagram of the relationship between indices and related information, such as... Figure 2 As shown, for any file set, at any given time, the number of currently occupied index nodes does not exceed the number of currently pre-allocated index nodes, and the number of currently pre-allocated index nodes does not exceed the current upper limit of the number of index nodes.

[0032] It is important to note that within the same file system, the sum of the maximum number of current inodes across all file sets cannot exceed the maximum available inode limit of the file system. Figure 2Taking a file system containing one root file set and three user file sets as an example, the sum of the current maximum number of inodes for the four file sets does not exceed the maximum available inode limit threshold of the file system.

[0033] The maximum number of available inodes in a file system can be roughly calculated using the following formula: Maximum number of available inodes = (Total file system capacity) / (Single inode capacity + Single data block capacity) The capacity of a single index node can be set to 8KB by default.

[0034] The default size of a single data block is 4KB.

[0035] That is, if the total capacity of the file system is 200TB, the maximum threshold for the number of available indices in the file system is 17.8 billion.

[0036] For any file set, after collecting the relevant information about the index nodes as described above, it can be determined whether the file set has an expansion requirement that exceeds the current limit for the number of index nodes.

[0037] For any file set, after collecting the relevant information about the index nodes as described above, it can be determined whether the file set has an expansion requirement based on the relevant information about the index nodes, which is currently allocated a certain number of index nodes.

[0038] S103, If the file set needs to be expanded, generate the expansion task corresponding to the file set by combining the relevant information of the inode.

[0039] For example, when a file set has a need to expand its current maximum number of index nodes, the current maximum number of index nodes and the preset expansion rules (different types of file sets may correspond to different expansion rules) are combined to obtain the expanded maximum number of index nodes, and an expansion task for the maximum number of index nodes corresponding to the file set is generated based on the expanded maximum number of index nodes.

[0040] For example, when a file set has a need to expand the number of pre-allocated index nodes, the number of pre-allocated index nodes after expansion is obtained by combining the current number of pre-allocated index nodes and the preset expansion rules (different types of file sets may correspond to different expansion rules), and an expansion task for the number of pre-allocated index nodes corresponding to the file set is generated based on the expanded number of pre-allocated index nodes.

[0041] S104, store the expansion tasks into the corresponding task queue, and execute the expansion tasks in the order of the tasks in the task queue.

[0042] As a preferred implementation method, each file system can correspond to two task queues, one queue for storing tasks to expand the upper limit of the number of inodes, and the other queue for storing tasks to expand the number of pre-allocated inodes. The tasks in each task queue are executed sequentially.

[0043] This application proposes a file system expansion method, comprising: identifying multiple file sets contained in the file system, including a root file set created by default and user-created user file sets; for any file set, collecting inode-related information corresponding to the file set, and determining whether the file set has an inode-related expansion requirement based on the inode-related information; if the file set has an expansion requirement, generating an expansion task corresponding to the file set based on the inode-related information; storing the expansion task in a corresponding task queue, and executing the expansion task in the order of the tasks in the task queue. In this application embodiment, the root file set and user file sets are clearly distinguished, allowing expansion to be performed according to different expansion logics for different types of file sets, avoiding resource contention or waste caused by using the same expansion rule for both types of file sets, thereby improving the accuracy of expansion; determining expansion requirements based on the inode-related information of the file set itself, rather than using a globally unified threshold standard of the file system, can accurately match the actual usage status of a single file set; by determining in advance whether expansion is needed, expansion can be triggered in advance when the file set inodes are about to run out, avoiding problems such as file creation failure and business write interruption caused by inode exhaustion.

[0044] Considering that there is an upper limit to the number of inodes that can be written to any given file set, and that writing will fail if this limit is exceeded, this application proposes a mechanism to expand the upper limit of the number of inodes to avoid user write failures. The following section combines... Figure 3 Let me introduce it. Figure 3 This is a schematic diagram illustrating an exemplary implementation of a file system expansion method as shown in this application, such as... Figure 3 As shown, this file system expansion method includes the following steps: S301, determine the multiple file sets contained in the file system, including the root file set created by default by the system and the user-created user file sets.

[0045] S302, collect relevant information about the index nodes corresponding to each file set. The relevant information about the index nodes includes the number of currently occupied index nodes and the current maximum number of index nodes.

[0046] For details regarding steps S301 to S302 and the meaning of each parameter, please refer to the specific descriptions of the relevant parts in the above embodiments. They will not be repeated here.

[0047] S303, for any file set, calculate the first ratio of the number of currently occupied inodes to the current upper limit of the number of inodes.

[0048] S304, if the first ratio is greater than the first ratio threshold corresponding to the file set, it is determined that the file set has a first expansion requirement, and the first expansion requirement is used to increase the current upper limit of the number of index nodes.

[0049] The first ratio threshold for the two types of file sets, root file set and user file set, can be set to the same or different. Furthermore, it can be adjusted in real time based on the actual online situation.

[0050] For example, the first ratio threshold for both the root file set and the user file set can be set to 80%. That is, if the first ratio of the root file set is greater than 80%, the root file set has a first expansion requirement; if the first ratio of the user file set is greater than 80%, the user file set has a first expansion requirement.

[0051] S305, if the file set has a first expansion requirement, generate the first expansion task corresponding to the file set based on the current upper limit of the number of index nodes.

[0052] Specifically, the expansion threshold corresponding to the parameter to be expanded is determined (in this embodiment, the expansion requirement of the file set is the first expansion requirement, that is, the parameter to be expanded is the current upper limit of the number of indices); the expansion step size corresponding to the first expansion requirement is determined; based on the parameter to be expanded, the expansion threshold, and the expansion step size, the target parameter value after the expansion of the parameter to be expanded is determined (that is, the upper limit of the number of indices after expansion); based on the target parameter value, the first expansion task corresponding to the file set is generated. In this way, the parameter value after expansion satisfies the resource growth requirements of the file set without exceeding the preset upper limit; the generated expansion task is directly associated with the target parameter value, the task execution goal is clear, no additional parameter conversion or rule interpretation is required, and the efficiency and accuracy of task execution are improved.

[0053] If the file set is a user file set, determining the expansion step size corresponding to the expansion requirement includes: determining the interval in which the parameter to be expanded (in this embodiment, the expansion requirement of the file set is the first expansion requirement, i.e., the parameter to be expanded is the current upper limit of the number of index nodes) lies; and determining the expansion step size corresponding to the first expansion requirement based on the interval. For example, if the current upper limit of the number of index nodes in the user file set is less than 100 million, the expansion step size is the current upper limit of the number of index nodes itself; if the current upper limit of the number of index nodes in the user file set is greater than or equal to 100 million, the expansion step size is 100 million. In this way, the resource requirements of user file sets of different sizes can be adapted, improving the rationality of expansion; the optimal step size can be automatically matched by the preset interval division rules, greatly reducing the workload of manual intervention.

[0054] For example, if the root file set has a first expansion requirement, then the expansion threshold corresponding to the current upper limit of the number of inodes in the root file set is determined. For instance, the expansion threshold corresponding to the current upper limit of the number of inodes in the root file set is 10 billion. Also, the expansion step size corresponding to the first expansion requirement is determined. For instance, the expansion step size corresponding to the first expansion requirement can be defaulted to 500 million. Assuming the current upper limit of the number of inodes in the root file set is 3 billion, then the upper limit of the number of inodes after expansion is min{current upper limit of inodes + 500 million, expansion threshold corresponding to the current upper limit of inodes} = min{3 billion + 500 million, 10 billion} = 3.5 billion. Based on 3.5 billion, a first expansion task corresponding to the root file set is generated. This first expansion task is used to expand the current upper limit of the number of inodes in the root file set from 3 billion to 3.5 billion.

[0055] For example, if a user file set has a first expansion requirement, the expansion threshold corresponding to the current upper limit of the number of inodes in the user file set is determined. For instance, the expansion threshold corresponding to the current upper limit of the number of inodes in the user file set is 3 billion. Then, the expansion step size corresponding to the first expansion requirement is determined. Assuming the current upper limit of the number of inodes in the user file set is 20 million, which is less than 100 million, the expansion step size is 20 million (the current upper limit of the number of inodes itself). The upper limit of the number of inodes after expansion is then min{current upper limit of inodes + 20 million, expansion threshold corresponding to the current upper limit of inodes} = min{20 million + 20 million, 3 billion} = 40 million. Based on 40 million, a first expansion task is generated for this user file set. This first expansion task is used to expand the current upper limit of the number of inodes in the user file set from 20 million to 40 million.

[0056] In order to fully respect users' personal wishes in the expansion scheme related to file system inodes, if the file set is a user file set and the current upper limit of the number of inodes in the user file set is manually set by the user, then it is determined that the file set does not have a first expansion requirement. That is, it is not necessary to expand the upper limit of the number of inodes for the user file set for which the user has manually set the upper limit of the number of inodes.

[0057] S306, store the first expansion task into the first task queue corresponding to the file system, and execute the first expansion task in the order of the tasks in the first task queue.

[0058] After generating the first expansion task, the first expansion task is stored in the first task queue corresponding to the file system, and the first expansion task is executed serially according to the task order in the first task queue.

[0059] S307, check the task status of each first expansion task in the first task queue, and perform corresponding control operations on the first task queue according to the task status.

[0060] Specifically, the task status of each first expansion task in the first task queue can be checked periodically (for example, the period can be set to 1 second). If the task status of any first expansion task is "task completed", then the first expansion task is deleted from the first task queue (to avoid accumulating a large number of historical tasks in the first task queue, reduce the resource overhead of queue storage and management, and improve the scheduling efficiency and response speed of the task queue). If the task status of any first expansion task is "task failed", then the failure log of the first expansion task is recorded and an alarm is triggered (which can provide complete fault data support for operation and maintenance personnel to locate the cause of expansion failure, and can also realize timely fault detection through alarm signals). If the task status of the first first expansion task in the first task queue is "in execution", then jump to check the task status of each expansion task in the next task queue.

[0061] Furthermore, when the current maximum number of inodes for a file set has reached the corresponding expansion threshold (for example, the current maximum number of inodes for the root file set has reached 10 billion), and the first ratio corresponding to that file set is detected to be greater than the preset first alarm threshold (for example, it can be set to 90%), a first alarm signal is issued. Thus, when the number of inodes for a file set can no longer be expanded, and the first ratio of the currently occupied inodes to the current maximum number of inodes exceeds the first alarm threshold, an alarm is triggered, providing early warning that inode resources are about to be exhausted. This allows maintenance personnel to take manual intervention measures in advance, avoiding problems such as file write failures and business interruptions due to lack of expansion space or resource exhaustion.

[0062] This application embodiment proactively identifies expansion needs due to insufficient index node capacity by calculating a first ratio between the current number of occupied index nodes in the file set and the current upper limit of the number of index nodes, and comparing it with a first ratio threshold. This avoids file write failures and business interruptions caused by index node exhaustion. By storing the first expansion task in a dedicated first task queue and executing it sequentially, it avoids problems such as system resource contention and index node allocation conflicts caused by parallel expansion of multiple tasks. Combined with a periodic task status check mechanism, completed tasks are automatically cleaned up, reducing queue storage and management overhead and improving task scheduling efficiency. Failed tasks are logged and alarms are triggered, making it easier for maintenance personnel to quickly locate the cause of the failure and reducing the cost of troubleshooting.

[0063] Considering that for any file set, writing one file to that file set will occupy one pre-allocated inode, if the inode allocation is not timely, it may increase the latency of user file writing. To reduce this latency, this application proposes a scaling mechanism based on the number of pre-allocated inodes. The following section combines... Figure 4 Let me introduce it. Figure 4 This is a schematic diagram illustrating an exemplary implementation of a file system expansion method as shown in this application, such as... Figure 4 As shown, this file system expansion method includes the following steps: S401, determine the multiple file sets contained in the file system, including the root file set created by default by the system and the user-created user file sets.

[0064] S402, collect the relevant information of the index nodes corresponding to each file set. The relevant information of the index nodes includes the number of currently occupied index nodes and the number of currently pre-allocated index nodes.

[0065] For details regarding steps S401 to S402 and the meaning of each parameter, please refer to the specific descriptions of the relevant parts in the above embodiments. They will not be repeated here.

[0066] S403, for any file set, calculate the second ratio of the number of currently occupied inodes to the number of currently pre-allocated inodes.

[0067] S404, if the second ratio is greater than the second ratio threshold corresponding to the file set, it is determined that the file set has a second expansion requirement, and the second expansion requirement is used to increase the number of currently pre-allocated index nodes.

[0068] The second ratio threshold for the two types of file sets, root file set and user file set, can be set to the same or different. Furthermore, it can be adjusted in real time according to the actual online situation.

[0069] For example, the second ratio threshold for both the root file set and the user file set can be set to 80%. That is, if the second ratio of the root file set is greater than 80%, the root file set has a second expansion requirement; if the second ratio of the user file set is greater than 80%, the user file set has a second expansion requirement.

[0070] S405, if the file set has a second expansion requirement, generate a second expansion task corresponding to the file set based on the current number of pre-allocated index nodes.

[0071] Specifically, the expansion threshold corresponding to the parameter to be expanded is determined (in this embodiment, the expansion requirement of the file set is the second expansion requirement, that is, the parameter to be expanded is the number of currently pre-allocated index nodes); the expansion step size corresponding to the second expansion requirement is determined; based on the parameter to be expanded, the expansion threshold and the expansion step size, the target parameter value after the expansion of the parameter to be expanded is determined (that is, the number of pre-allocated index nodes after expansion); based on the target parameter value, the second expansion task corresponding to the file set is generated.

[0072] If the file set is a user file set, determining the expansion step size corresponding to the expansion requirement includes: determining the interval in which the expansion parameter to be expanded (in this embodiment, the expansion requirement of the file set is the second expansion requirement, that is, the expansion parameter to be expanded is the current number of pre-allocated index nodes) lies; and determining the expansion step size corresponding to the second expansion requirement based on the interval. For example, if the current number of pre-allocated index nodes in the user file set is less than 20 million, the expansion step size is 2 million; if the current number of pre-allocated index nodes in the user file set is greater than or equal to 20 million and less than 100 million, the expansion step size is 10 million; and if the current number of pre-allocated index nodes in the user file set is greater than 100 million, the expansion step size is 20 million. For example, if the root file set has a second expansion requirement, the expansion threshold corresponding to the current number of pre-allocated index nodes in the root file set is determined. For instance, the expansion threshold corresponding to the current number of pre-allocated index nodes in the root file set is 10 billion. The expansion step size corresponding to the second expansion requirement is also determined. For instance, the expansion step size corresponding to the second expansion requirement can be assumed to be 20 million. Assuming the current number of pre-allocated index nodes in the root file set is 3 billion, the expanded number of pre-allocated index nodes would be min{current number of pre-allocated index nodes + 20 million, expansion threshold corresponding to the current number of pre-allocated index nodes} = min{3 billion + 20 million, 10 billion} = 3.02 billion. Based on 3.02 billion, a second expansion task is generated for the root file set, which expands the current number of pre-allocated index nodes in the root file set from 3 billion to 3.02 billion.

[0073] For example, if a user file set has a second expansion requirement, the expansion threshold corresponding to the current number of pre-allocated index nodes in the user file set is determined. For instance, the expansion threshold corresponding to the current number of pre-allocated index nodes in the user file set is 3 billion. The expansion step size corresponding to the second expansion requirement is also determined. Assuming the current number of pre-allocated index nodes in the user file set is 10 million, which is less than 20 million, the expansion step size is 2 million. The expanded number of pre-allocated index nodes is then min{current number of pre-allocated index nodes + 2 million, expansion threshold corresponding to the current number of pre-allocated index nodes} = min{20 million + 2 million, 3 billion} = 22 million. Based on 22 million, a second expansion task is generated for this user file set. This second expansion task is used to expand the current number of pre-allocated index nodes in the user file set from 20 million to 22 million.

[0074] S406, store the second expansion task into the second task queue corresponding to the file system, and execute the second expansion task in the order of the tasks in the second task queue.

[0075] After generating the second expansion task as described above, the second expansion task is stored in the second task queue corresponding to the file system, and the second expansion task is executed serially according to the task order in the second task queue.

[0076] S407, check the task status of each second expansion task in the second task queue, and perform corresponding control operations on the second task queue according to the task status.

[0077] Specifically, the task status of each second expansion task in the second task queue can be checked periodically (for example, the period can be set to 1 second). If the task status of any second expansion task is "task completed", then the second expansion task is deleted from the second task queue (to avoid accumulating a large number of historical tasks in the second task queue, reduce the resource overhead of queue storage and management, and improve the scheduling efficiency and response speed of the task queue). If the task status of any second expansion task is "task failed", then the failure log of the second expansion task is recorded and an alarm is triggered (which can provide complete fault data support for operation and maintenance personnel to locate the cause of expansion failure, and can also realize timely fault detection through alarm signals). If the task status of the first second expansion task in the second task queue is "in execution", then jump to check the task status of each expansion task in the next task queue.

[0078] Furthermore, when the current pre-allocated index node count of a file set reaches the corresponding expansion threshold (for example, the current pre-allocated index node count of the root file set has reached 10 billion), and the second ratio corresponding to that file set is detected to be greater than the preset second alarm threshold (for example, it can be set to 92%), a second alarm signal is issued. This allows maintenance personnel to take manual intervention measures in advance to avoid delays in user file writing.

[0079] This application embodiment proactively identifies issues with untimely index node pre-allocation by calculating a second ratio of the number of currently occupied index nodes to the number of currently pre-allocated index nodes in the file set and comparing it with a second ratio threshold. This allows for intervention to expand the number of pre-allocated index nodes, preventing delays in user file writing. By storing the second expansion task in a dedicated second task queue and executing it sequentially, it avoids problems such as system resource contention and index node allocation conflicts caused by parallel expansion of multiple tasks. Combined with a periodic task status check mechanism, completed tasks are automatically cleaned up, reducing queue storage and management overhead and improving task scheduling efficiency. Failed tasks are logged and alarms are triggered, facilitating rapid fault location by maintenance personnel and reducing troubleshooting costs.

[0080] Figure 5 This is a schematic diagram illustrating an exemplary implementation of a file system expansion method as shown in this application, such as... Figure 5 As shown, this file system expansion method includes the following steps: S501, determine the multiple file sets contained in the file system, including the root file set created by default by the system and the user-created user file set.

[0081] S502, collect the relevant information of the index nodes corresponding to each file set. The relevant information of the index nodes includes the number of currently occupied index nodes, the current upper limit of the number of index nodes, and the current number of pre-allocated index nodes.

[0082] For details on the specific implementation of steps S501 to S502, please refer to the relevant parts of the above embodiments, which will not be repeated here.

[0083] S503, for any file set, calculate the first ratio of the number of currently occupied inodes to the current upper limit of the number of inodes.

[0084] S504, if the first ratio is greater than the first ratio threshold corresponding to the file set, it is determined that the file set has a first expansion requirement, and the first expansion requirement is used to increase the current upper limit of the number of index nodes.

[0085] S505, if the file set has a first expansion requirement, generate the first expansion task corresponding to the file set based on the current upper limit of the number of index nodes.

[0086] S506, the first expansion task is stored in the first task queue corresponding to the file system, and the first expansion task is executed in the order of the tasks in the first task queue.

[0087] For details on the specific implementation of steps S503 to S506, please refer to the relevant parts of the above embodiments; they will not be repeated here.

[0088] S507, for any set of files, calculate the second ratio of the number of currently occupied inodes to the number of currently pre-allocated inodes.

[0089] S508, if the second ratio is greater than the second ratio threshold corresponding to the file set, it is determined that the file set has a second expansion requirement, and the second expansion requirement is used to increase the number of currently pre-allocated index nodes.

[0090] S509, if the file set has a second expansion requirement, generate a second expansion task corresponding to the file set based on the current number of pre-allocated index nodes.

[0091] S510, the second expansion task is stored in the second task queue corresponding to the file system, and the second expansion task is executed in the order of the tasks in the second task queue.

[0092] For details on the specific implementation of steps S507 to S510, please refer to the relevant parts of the above embodiments, which will not be repeated here.

[0093] S511, for any one of the first task queues and the second task queue, check the task status of each expansion task in the task queue.

[0094] S512 performs corresponding control operations on the task queue based on the task status.

[0095] For details on the specific implementation of steps S511 to S512, please refer to the relevant parts of the above embodiments, which will not be repeated here.

[0096] In other words, it can be understood as, Figure 5 The described embodiment simultaneously monitors both types of expansion needs in the file set, namely the first expansion need and the second expansion need, thereby proactively identifying expansion needs where the upper limit of the number of index nodes is insufficient, thus avoiding file write failures and business interruptions caused by the exhaustion of index nodes; and proactively identifying problems with untimely pre-allocation of index nodes, thereby intervening to expand the number of pre-allocated index nodes and avoiding delays in user file writing.

[0097] Similar to the above, Figure 5In the described embodiments, when the current index node count limit of any file set has reached the corresponding expansion threshold, and the first ratio corresponding to the file set is detected to be greater than the preset first alarm threshold, a first alarm signal is issued.

[0098] Similar to the above, Figure 5 In the described embodiments, when the number of pre-allocated index nodes of any file set has reached the corresponding expansion threshold, and the second ratio corresponding to the file set is detected to be greater than the preset second alarm threshold, a second alarm signal is issued.

[0099] This application clearly distinguishes between two types of objects: root file sets and user file sets. Different expansion logics can be applied to different types of file sets to avoid resource contention or waste caused by using the same expansion rule for both types of file sets, thereby improving the accuracy of expansion. Simultaneously, it monitors both the first and second expansion needs of the file sets to proactively identify expansion needs where the upper limit of the number of index nodes is insufficient, preventing file write failures and business interruptions due to index node exhaustion. Furthermore, it proactively identifies issues with untimely index node pre-allocation and intervenes to pre-allocate the number of index nodes for expansion, avoiding delays in user file writes.

[0100] Figure 6 This is a schematic diagram of a file system expansion device according to an exemplary embodiment of the present disclosure, as shown below. Figure 6 As shown, the file system-oriented expansion device 600 includes: The determination module 601 is used to determine multiple file sets contained in the file system, including the root file set created by default by the system and the user-created user file set.

[0101] The judgment module 602 is used to collect the relevant information of the index nodes corresponding to each file set, and for any file set, it determines whether the file set has an index node-related expansion requirement based on the relevant information of the index nodes.

[0102] The generation module 603 is used to generate a corresponding expansion task for the file set if the file set needs to be expanded, based on the relevant information of the inode.

[0103] The execution module 604 is used to store the expansion tasks into the corresponding task queue and execute the expansion tasks in the order of the tasks in the task queue.

[0104] This device clearly distinguishes between root file sets and user file sets, and can perform expansion according to different expansion logics for different types of file sets. This avoids resource contention or waste caused by using the same expansion rule for both types of file sets, thereby improving the accuracy of expansion. It judges expansion needs based on the inode information of the file set itself, rather than using a globally unified threshold standard of the file system, which can accurately match the actual usage status of a single file set. By determining in advance whether expansion is needed, it can trigger expansion in advance when the file set inode is about to run out of inodes, avoiding problems such as file creation failure and business write interruption caused by inode exhaustion.

[0105] Furthermore, the index node related information includes the number of currently occupied index nodes and the current upper limit of the number of index nodes. The judgment module 602 is also used to: calculate a first ratio between the number of currently occupied index nodes and the current upper limit of the number of index nodes; if the first ratio is greater than the first ratio threshold corresponding to the file set, it is determined that the file set has a first expansion requirement, and the first expansion requirement is used to increase the current upper limit of the number of index nodes.

[0106] Furthermore, the index node related information also includes the current number of pre-allocated index nodes. The judgment module 602 is also used to: calculate a second ratio between the current number of occupied index nodes and the current number of pre-allocated index nodes, wherein the current number of pre-allocated index nodes does not exceed the current upper limit of the number of index nodes; if the second ratio is greater than the second ratio threshold corresponding to the file set, it is determined that the file set has a second expansion requirement, and the second expansion requirement is used to increase the current number of pre-allocated index nodes.

[0107] Furthermore, the generation module 603 is also used to: if the file set has a first expansion requirement, generate a first expansion task corresponding to the file set based on the current upper limit of the number of index nodes; if the file set has a second expansion requirement, generate a second expansion task corresponding to the file set based on the current number of pre-allocated index nodes.

[0108] Furthermore, the generation module 603 is also used to: determine the expansion threshold corresponding to the expansion parameter to be expanded, wherein when the expansion requirement is the first expansion requirement, the expansion parameter to be expanded is the current upper limit of the number of index nodes, and when the expansion requirement is the second expansion requirement, the expansion parameter to be expanded is the current number of pre-allocated index nodes; determine the expansion step size corresponding to the expansion requirement; determine the target parameter value after the expansion of the expansion parameter based on the expansion parameter to be expanded, the expansion threshold, and the expansion step size; and generate the expansion task corresponding to the file set based on the target parameter value.

[0109] Furthermore, in response to the file set being a user file set, the generation module 603 is also used to: determine the range in which the parameter to be expanded is located; and determine the expansion step size corresponding to the expansion requirement based on the range.

[0110] Furthermore, the judgment module 602 is also used to: if the file set is a user file set, and the current maximum number of inodes in the user file set is manually set by the user, determine that the file set does not have a first expansion requirement.

[0111] Furthermore, the file system expansion device 600 also includes an alarm module, used to: issue a first alarm signal when the current maximum number of inodes in the file set has reached the corresponding expansion threshold and a first ratio corresponding to the file set is detected to be greater than a preset first alarm threshold; and issue a second alarm signal when the current pre-allocated number of inodes in the file set has reached the corresponding expansion threshold and a second ratio corresponding to the file set is detected to be greater than a preset second alarm threshold.

[0112] Furthermore, the execution module 604 is also used to: store the first expansion task into the first task queue corresponding to the file system; and store the second expansion task into the second task queue corresponding to the file system.

[0113] Furthermore, the execution module 604 is also used to: check the task status of each expansion task in the task queue for either the first task queue or the second task queue; and perform corresponding control operations on the task queue according to the task status.

[0114] Furthermore, within the same file system, the sum of the current maximum number of inodes for all file sets does not exceed the maximum available inode limit threshold of the file system.

[0115] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0116] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0117] like Figure 7As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded into random access memory (RAM) 703 from storage unit 708. The RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.

[0118] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0119] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the file system expansion method. For example, in some embodiments, the file system expansion method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the file system expansion method described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured to perform the file system expansion method by any other suitable means (e.g., by means of firmware).

[0120] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0121] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0122] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0124] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0125] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0126] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0127] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for expanding the capacity of a file system, characterized in that, include: Identify multiple file sets contained in the file system, including the root file set created by default by the system and user-created user file sets; Collect relevant information about the index nodes corresponding to each of the file sets, and for any file set, determine whether the file set has an index node-related expansion requirement based on the relevant information about the index nodes; If the file set has the expansion requirement, generate the expansion task corresponding to the file set by combining the relevant information of the index node; The expansion task is stored in the corresponding task queue, and the expansion task is executed in the order of the tasks in the task queue.

2. The method according to claim 1, wherein, The inode-related information includes the number of currently occupied inodes and the current maximum number of inodes. Determining whether the file set has inode-related expansion needs based on the inode-related information includes: Calculate the first ratio of the number of currently occupied index nodes to the upper limit of the current number of index nodes; If the first ratio is greater than the first ratio threshold corresponding to the file set, it is determined that the file set has a first expansion requirement, and the first expansion requirement is used to increase the current upper limit of the number of index nodes.

3. The method according to claim 2, wherein, The index node information also includes the number of currently pre-allocated index nodes. Determining whether the file set has an index node-related expansion requirement based on the index node information includes: Calculate a second ratio of the number of currently occupied index nodes to the number of currently pre-allocated index nodes, wherein the number of currently pre-allocated index nodes does not exceed the upper limit of the number of current index nodes; If the second ratio is greater than the second ratio threshold corresponding to the file set, it is determined that the file set has a second expansion requirement, and the second expansion requirement is used to increase the number of currently pre-allocated index nodes.

4. The method according to claim 3, wherein, If the file set has the expansion requirement, the expansion task corresponding to the file set is generated by combining the relevant information of the inode, including: If the file set has a first expansion requirement, a first expansion task corresponding to the file set is generated based on the current maximum number of index nodes. If the file set has a second expansion requirement, a second expansion task corresponding to the file set is generated based on the current number of pre-allocated index nodes.

5. The method according to claim 4, wherein, The step of generating the first expansion task corresponding to the file set or generating the second expansion task corresponding to the file set includes: Determine the expansion threshold corresponding to the expansion parameter. When the expansion requirement is the first expansion requirement, the expansion parameter is the current upper limit of the number of index nodes. When the expansion requirement is the second expansion requirement, the expansion parameter is the current number of pre-allocated index nodes. Determine the expansion step size corresponding to the expansion requirement; Based on the parameter to be expanded, the expansion threshold, and the expansion step size, determine the target parameter value after the parameter to be expanded. Based on the target parameter values, an expansion task corresponding to the file set is generated.

6. The method according to claim 5, wherein, In response to the fact that the file set is a user file set, determining the expansion step size corresponding to the expansion requirement includes: Determine the range in which the parameter to be expanded is located; The expansion step size corresponding to the expansion requirement is determined based on the range.

7. The method according to claim 2, wherein, The method further includes: If the file set is a user file set, and the current maximum number of index nodes in the user file set is manually set by the user, it is determined that the file set does not have a first expansion requirement.

8. The method according to any one of claims 5-7, wherein, The method further includes: When the current maximum number of index nodes in the file set has reached the corresponding expansion threshold, and the first ratio corresponding to the file set is detected to be greater than the preset first alarm threshold, a first alarm signal is issued. When the number of pre-allocated index nodes in the file set has reached the corresponding expansion threshold, and the second ratio corresponding to the file set is detected to be greater than the preset second alarm threshold, a second alarm signal is issued.

9. The method according to any one of claims 4-7, wherein, The step of storing the expansion task into the corresponding task queue includes: The first expansion task is stored in the first task queue corresponding to the file system; The second expansion task is stored in the second task queue corresponding to the file system.

10. The method according to claim 9, wherein, The method further includes: For any one of the first task queue and the second task queue, check the task status of each expansion task in the task queue; Based on the task status, perform corresponding management operations on the task queue.

11. The method according to claim 2, wherein, Within the same file system, the sum of the current maximum number of inodes for all file sets does not exceed the maximum available inode count threshold of the file system.

12. A file system-oriented expansion device, characterized in that, include: The determination module is used to determine multiple file sets contained in the file system, including the root file set created by default by the system and the user-created user file set; The judgment module is used to collect relevant information about the index nodes corresponding to each of the file sets, and for any file set, to determine whether the file set has an index node-related expansion requirement based on the relevant information about the index nodes. The generation module is used to generate a corresponding expansion task for the file set if the file set has the expansion requirement, by combining the relevant information of the inode; The execution module is used to store the expansion tasks into the corresponding task queue and execute the expansion tasks in the order of the tasks in the task queue.

13. An electronic device, comprising: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-11.

15. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-11.