Small file aggregation method, device and equipment and computer readable storage medium

By obtaining small file and load information on the target node, the aggregation task is dynamically determined, which solves the performance problem of the small file aggregation method under high load and improves read and write performance and business fluency.

CN118732944APending Publication Date: 2024-10-01JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410705898.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing small file aggregation methods will consume additional performance resources in scenarios with heavy business pressure, causing client front-end business to freeze and block, affecting storage read and write performance.

Method used

By obtaining the small files to be aggregated in the solid-state drive storage pool of the target node, and querying its initial node average load and CPU core number within the preset recent time period, it dynamically and adaptively decides whether to perform the aggregation task to avoid node load Aggregation is performed at high times to optimize resource utilization.

Benefits of technology

It effectively avoids the impact of node performance consumed by aggregation on front-end business, improves the read and write performance of small files, reduces the chance of business lag, and makes full use of node idle time for aggregation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118732944A_ABST
    Figure CN118732944A_ABST
Patent Text Reader

Abstract

The invention discloses a small file aggregation method. The method comprises the steps of obtaining to-be-aggregated small files in a solid state disk storage pool corresponding to a target node; querying an initial node average load of the target node in a preset latest time period; obtaining the number of CPU cores of the target node; and when the executable aggregation task is determined according to the average load of the initial node and the number of the CPU cores, aggregating the small files by using the target node. By applying the small file aggregation method provided by the invention, the influence of node performance consumed by aggregation on the front-end service is avoided, and the read-write performance of the small file is improved. The invention furthermore discloses a small file aggregation apparatus and device, and a storage medium, which have corresponding technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer application technology, and in particular to a small file aggregation method, device, equipment and computer-readable storage medium. Background Art

[0002] Massive data storage and fast data reading and writing are becoming increasingly important. Although small files do not occupy much data capacity, the amount of metadata occupied by massive small files is very large. In order to improve the file reading and writing performance in the scenario of massive small files, the current common method is to use offline aggregation to temporarily store small files in an SSD (Solid State Drive) pool with excellent random IO (Input / Output) capabilities, and start a merge thread in the background to read and merge data from the cache pool, merge small files into aggregated large files, thereby converting the small block random IO of small files into the bandwidth random IO of large files, thereby improving the reading and writing performance of small files.

[0003] Most existing aggregation solutions set up a timing strategy to initiate aggregation tasks for small files that meet the conditions. In scenarios with high business pressure, aggregating small files at this time will consume additional performance resources and affect the current read and write business of storage. In serious cases, it will cause customer front-end business to be stuck and blocked.

[0004] To sum up, how to effectively solve the problem that the existing small file aggregation method consumes additional performance resources, affects the storage of current read and write services, and causes customer front-end business lags and blockages is an issue that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The purpose of this application is to provide a small file aggregation method, which avoids the impact of node performance consumed by aggregation on front-end business and improves the reading and writing performance of small files; another purpose of this application is to provide a small file aggregation device, equipment and computer-readable storage medium.

[0006] In order to solve the above technical problems, this application provides the following technical solutions:

[0007] A small file aggregation method, comprising:

[0008] Obtain the small files to be aggregated in the SSD storage pool corresponding to the target node;

[0009] Querying the average initial node load of the target node within a preset recent time period;

[0010] Obtain the number of CPU cores of the target node;

[0011] When an executable aggregation task is determined according to the average load of the initial node and the number of CPU cores, each of the small files is aggregated.

[0012] In a specific implementation of the present application, obtaining small files to be aggregated in a solid-state hard disk storage pool corresponding to a target node includes:

[0013] When the preset aggregation period is reached, each small file to be aggregated in the solid-state hard disk storage pool corresponding to the target node is obtained.

[0014] In a specific implementation of the present application, querying the average initial node load of the target node within a preset recent time period includes:

[0015] The average initial node load of the target node within a preset recent time period is queried through a runtime command.

[0016] In a specific implementation of the present application, obtaining the number of CPU cores of the target node includes:

[0017] Get the number of CPU cores of the target node through the available processor count command.

[0018] In a specific implementation of the present application, obtaining small files to be aggregated in a solid-state hard disk storage pool corresponding to a target node includes:

[0019] Obtain the small files to be aggregated in the SSD storage pool corresponding to the node cluster;

[0020] Accordingly, querying the average initial node load of the target node within a preset recent time period includes:

[0021] Querying respectively the initial node average load of each node in the node cluster within the preset recent time period;

[0022] Accordingly, obtaining the number of CPU cores of the target node includes:

[0023] Obtain the number of CPU cores of each node in the node cluster respectively;

[0024] Correspondingly, when the executable aggregation task is determined according to the average load of the initial node and the number of CPU cores, the small files are aggregated, including:

[0025] The average load of the target nodes corresponding to each of the nodes is obtained by dividing the average load of the initial nodes corresponding to each of the nodes by the number of CPU cores;

[0026] Calculate the average load of each target node to obtain the average load of the cluster;

[0027] Using a preset probability function to perform probability mapping on the average load of the cluster to a range of 0 to 1, to obtain a target probability value;

[0028] Generate a target random number between 0 and 1 through a random correlation function;

[0029] Determine whether the target probability value is greater than the target random number;

[0030] If so, the small files are aggregated.

[0031] In a specific implementation of the present application, it also includes:

[0032] When it is determined that the target probability value is less than or equal to the target random number, the aggregation task of this aggregation cycle is skipped and the next scanning cycle is waited.

[0033] In a specific implementation of the present application, a preset probability function is used to perform probability mapping on the average load of the cluster to an interval of 0 to 1 to obtain a target probability value, including:

[0034] The target probability value is obtained by mapping the average load of the cluster to the interval of 0 to 1 using a preset probability function through the formula:

[0035] f=e -c ;

[0036] Where f represents the target probability value and c represents the average load of the cluster.

[0037] A small file aggregation device, comprising:

[0038] A small file acquisition module is used to acquire small files to be aggregated in the solid-state hard disk storage pool corresponding to the target node;

[0039] A load query module, used to query the initial node average load of the target node within a preset recent time period;

[0040] A core number acquisition module, used to obtain the number of CPU cores of the target node;

[0041] The file aggregation module is used to aggregate the small files when it is determined that a preset aggregation condition is met according to the average load of the initial node and the number of CPU cores.

[0042] A small file aggregation device, comprising:

[0043] Memory for storing computer programs;

[0044] A processor is used to implement the steps of the small file aggregation method as described above when executing the computer program.

[0045] A computer-readable storage medium stores a computer program, which implements the steps of the small file aggregation method as described above when executed by a processor.

[0046] The small file aggregation method provided in the present application obtains the small files to be aggregated in the solid-state hard disk storage pool corresponding to the target node; queries the initial node average load of the target node within a preset recent time period; obtains the number of CPU cores of the target node; and when the executable aggregation task is determined based on the initial node average load and the number of CPU cores, the target node is used to aggregate the small files.

[0047] It can be seen from the above technical solution that by obtaining the small files to be aggregated in the SSD storage pool corresponding to the target node, and querying the initial node average load of the target node in the preset recent time period, it is determined whether the aggregation task can be executed according to the initial node average load and the number of CPU cores of the node. Taking into account the node load situation, a dynamic adaptive strategy is adopted to aggregate small files, and small files are aggregated only when it is determined that the aggregation task can be executed according to the node load situation. This avoids the node performance consumed by aggregation affecting the front-end business. When the overall load of the node occupied by the node front-end business is low, the aggregation task is executed first, so as to make full use of the node idle time to aggregate small files into large files, thereby improving the reading and writing performance of small files.

[0048] Correspondingly, the present application also provides a small file aggregation device, equipment and computer-readable storage medium corresponding to the above-mentioned small file aggregation method, which have the above-mentioned technical effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 This is an implementation flow chart of the small file aggregation method in the embodiment of the present application;

[0051] Figure 2 Another implementation flow chart of the small file aggregation method in the embodiment of the present application;

[0052] Figure 3 This is a structural block diagram of a small file aggregation device in an embodiment of the present application;

[0053] Figure 4 This is a structural block diagram of a small file aggregation device in an embodiment of the present application;

[0054] Figure 5 A schematic diagram of the specific structure of a small file aggregation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] With the development of artificial intelligence and deep learning technologies, massive data storage and fast data reading and writing are becoming increasingly important. Currently, finance, communications, banking, and manufacturing industries generate massive amounts of small file data every day. Every file access tests the read and write performance of the cluster.

[0056] Most existing aggregation solutions set up a timing strategy to initiate aggregation tasks for small files that meet the conditions. In scenarios with high business pressure, aggregating small files at this time will consume additional performance resources and affect the current read and write business of storage. In serious cases, it will cause customer front-end business to be stuck and blocked.

[0057] To this end, the small file aggregation method provided in this application avoids the impact of node performance consumed by aggregation on front-end business and improves the reading and writing performance of small files.

[0058] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0059] See also Figure 1 , Figure 1 This is an implementation flow chart of the small file aggregation method in the embodiment of the present application. The method may include the following steps:

[0060] S101: Acquire small files to be aggregated in the solid-state drive storage pool corresponding to the target node.

[0061] The SSD storage pool corresponding to the target node is pre-set to cache small files. When the pre-set small file aggregation condition is met, such as when the preset aggregation cycle is reached or when it is detected that the data volume of the small files to be aggregated in the SSD storage pool reaches the preset data volume threshold, the small files to be aggregated in the SSD storage pool corresponding to the target node are obtained.

[0062] The target node can be any node of an executable file aggregation task.

[0063] Small files refer to files with smaller file sizes, usually ranging from a few KB to a few MB. These files take up less space and time during storage and transmission. Common small file types include documents, photos, audio clips, etc.

[0064] In a specific implementation of the present application, step S101 may include the following steps:

[0065] When the preset aggregation period is reached, each small file to be aggregated in the solid-state hard disk storage pool corresponding to the target node is obtained.

[0066] The aggregation cycle is pre-set, and when the preset aggregation cycle is reached, the small files to be aggregated in the SSD storage pool corresponding to the target node are obtained. By making small file aggregation decisions according to the preset aggregation cycle, the impact of frequent small file aggregation applications on system performance is avoided.

[0067] It should be noted that the preset polymerization period can be set and adjusted according to actual conditions, and the embodiment of the present application does not limit this. For example, it can be set to 1 hour.

[0068] S102: Query the average initial node load of the target node within a preset recent time period.

[0069] After obtaining the small files to be aggregated in the SSD storage pool corresponding to the target node, query the initial node average load of the target node in the preset recent time period. By calculating the average load in the preset recent time period, the pressure state of the target node is determined according to the average load. Compared with determining the pressure state of the target node according to the current real-time load, the randomness of node load acquisition is avoided and the reliability of the obtained node load information is improved.

[0070] It should be noted that the preset recent time period can be set and adjusted according to actual conditions, and the embodiment of the present application does not limit this. For example, it can be set to 5 minutes.

[0071] In a specific implementation of the present application, step S102 may include the following steps:

[0072] Use the runtime command to query the initial node average load of the target node within the preset recent time period.

[0073] The node load information is queried by the uptime command in advance. After obtaining the small files to be aggregated in the SSD storage pool corresponding to the target node, the initial node average load of the target node in the preset recent time period is queried by the uptime command. Querying the initial node average load of the target node in the preset recent time period by presetting the uptime command is simple and easy, which improves the efficiency of node average load query.

[0074] S103: Obtain the number of CPU cores of the target node.

[0075] When the preset small file aggregation condition is met, the number of CPU (Central Processing Unit) cores of the target node is obtained.

[0076] In a specific implementation of the present application, step S103 may include the following steps:

[0077] Use the available processor count command to obtain the number of CPU cores on the target node.

[0078] The number of CPU cores of the target node is obtained by presetting the available number of processors (nproc) command. When the pre-set small file aggregation conditions are met, the number of CPU cores of the target node is obtained by the available number of processors command. It is simple and easy to obtain the number of CPU cores of the target node by presetting the available number of processors command, which improves the efficiency of obtaining the number of CPU cores of the node.

[0079] S104: When it is determined that an executable aggregation task can be performed according to the average load of the initial node and the number of CPU cores, the small files are aggregated.

[0080] After querying the average initial node load of the target node in the preset recent time period and obtaining the number of CPU cores of the target node, it is determined whether the aggregation task can be executed according to the average initial node load and the number of CPU cores. For example, it can be determined whether the average initial node load is less than the number of CPU cores. When the average initial node load is less than the number of CPU cores, it means that the tasks in the system are relatively small and the system load is light. When the average initial node load is greater than or equal to the number of CPU cores, it means that the system load is heavy, which may cause tasks to queue up for CPU resources, the system performance may decline, and the response time will be longer. When it is determined that the aggregation task can be executed based on the average initial node load and the number of CPU cores, each small file is aggregated. This application fully considers the overall load of the node cluster, which can reflect the overall busy state of the node cluster. When the node cluster is busy, the aggregation task is executed with a lower probability. When the cluster is idle or occupies fewer resources, the aggregation task is executed with a higher probability. It improves the utilization rate of the node cluster during idle time, reduces the pressure when the node cluster is busy, releases performance resources for the front-end business, and reduces the probability of front-end business jams, thereby improving the overall user experience.

[0081] It can be seen from the above technical solution that by obtaining the small files to be aggregated in the SSD storage pool corresponding to the target node, and querying the initial node average load of the target node in the preset recent time period, it is determined whether the aggregation task can be executed according to the initial node average load and the number of CPU cores of the node. Taking into account the node load situation, a dynamic adaptive strategy is adopted to aggregate small files, and small files are aggregated only when it is determined that the aggregation task can be executed according to the node load situation. This avoids the node performance consumed by aggregation affecting the front-end business. When the overall load of the node occupied by the node front-end business is low, the aggregation task is executed first, so as to make full use of the node idle time to aggregate small files into large files, thereby improving the reading and writing performance of small files.

[0082] It should be noted that, based on the above embodiments, the embodiments of the present application also provide corresponding improved solutions. In the subsequent embodiments, the same steps or corresponding steps as those in the above embodiments can be referenced to each other, and the corresponding beneficial effects can also be referenced to each other, which will not be repeated one by one in the following improved embodiments.

[0083] See also Figure 2 , Figure 2 This is another implementation flow chart of the small file aggregation method in the embodiment of the present application. The method may include the following steps:

[0084] S201: Acquire small files to be aggregated in the solid-state drive storage pool corresponding to the node cluster.

[0085] When the node used to perform the small file aggregation task is a distributed node cluster, the small files are cached using the solid state disk storage pool corresponding to the node cluster. When the pre-set small file aggregation condition is met, the small files to be aggregated in the solid state disk storage pool corresponding to the node cluster are obtained.

[0086] You can also set up a selection process for selecting small files to be aggregated from all small files in the SSD storage pool, such as counting the access frequencies of each small file in the SSD storage pool. When it is determined that the pre-set small file aggregation conditions are met, select small files with low access frequencies from the SSD storage pool as small files to be aggregated based on the access frequencies of each small file. You can also select small files that have not been accessed within the preset aggregation cycle from the small files cached in the SSD storage pool as small files to be aggregated when the preset aggregation cycle is reached. This fully considers the hotness and coldness of each small file, and prioritizes aggregating small files with low access frequencies, thereby making full use of the idle time of the node to aggregate small files into large files, thereby improving the read and write performance of small files.

[0087] S202: Query the initial node average load of each node in the node cluster within a preset recent time period.

[0088] The load of each node in the node cluster may be different. After obtaining the small files to be aggregated in the SSD storage pool corresponding to the node cluster, the initial node average load of each node in the node cluster within a preset recent time period is queried respectively.

[0089] S203: Obtain the number of CPU cores of each node in the node cluster respectively.

[0090] The number of CPU cores of each node in the node cluster may be different. When it is determined that the preset small file aggregation condition is met, the number of CPU cores of each node in the node cluster is obtained respectively.

[0091] S204: Divide the initial node average load corresponding to each node by the number of CPU cores to obtain the target node average load corresponding to each node.

[0092] After querying the initial node average load of each node in the node cluster in the recent preset time period and obtaining the number of CPU cores of each node in the node cluster, the initial node average load corresponding to each node is divided by the number of CPU cores to obtain the target node average load corresponding to each node. When the target node average load is smaller, the average load of the node is smaller. When the target node average load is greater than or equal to 1, it can be understood that the node is in a busy state.

[0093] S205: Calculate the average load of each target node to obtain the average load of the cluster.

[0094] If the node cluster has multiple storage nodes, after obtaining the target node average load corresponding to each node in the node cluster, the average load of each target node is calculated to obtain the cluster average load. The cluster average load can reflect the overall average load of the cluster.

[0095] S206: Use a preset probability function to perform probability mapping on the average load of the cluster to a range of 0 to 1 to obtain a target probability value.

[0096] A probability function is designed in advance to map the average load of the target node to the interval of 0-1. The larger the average load of the target node, the smaller the probability value obtained, and the smaller the average load of the target node, the larger the probability value obtained. After calculating the average value of the average load of the target node corresponding to each node in the node cluster and obtaining the average load of the cluster, the preset probability function is used to perform probability mapping of the average load of the cluster to the interval of 0 to 1 to obtain the target probability value.

[0097] In a specific implementation of the present application, step S206 may include the following steps:

[0098] The target probability value is obtained by mapping the average load of the cluster to the range of 0 to 1 using the preset probability function through the formula:

[0099] f=e -c ;

[0100] Where f represents the target probability value and c represents the average load of the cluster.

[0101] The above formula is used to map the cluster average load to a probability to obtain the target probability value. From the above formula, it can be seen that when the cluster average load c is close to 0, that is, when the system load is small, the target probability value f is close to 1. When the cluster average load gradually increases, the value of f gradually approaches 0. Therefore, the availability of the node cluster can be intuitively obtained based on the target probability value.

[0102] S207: Generate a target random number between 0 and 1 through a random correlation function.

[0103] After the cluster average load is probabilistically mapped to the interval of 0 to 1 using the preset probability function to obtain the target probability value, a target random number between 0 and 1 is generated through a random correlation function. For example, a two-digit random number between 0 and 1 is generated through a random correlation function, such as 0.1, ..., 0.9.

[0104] S208: Determine whether the target probability value is greater than the target random number, if so, execute step S209, if not, execute step S210.

[0105] After using the preset probability function to perform probability mapping of the average load of the cluster to the interval of 0 to 1, obtaining the target probability value, and generating the target random number between 0 and 1 through the random correlation function, it is determined whether the target probability value is greater than the target random number. If so, it means that the node cluster is currently relatively idle, and step S209 is executed. If not, it means that the node cluster is currently still relatively busy, and step S210 is executed. When the load is small, the probability of initiating aggregation is greater. Conversely, when the load is large, the probability of initiating an aggregation task is smaller. In this way, the aggregation task can be adaptively adjusted. When the business is busy, the background aggregation tasks can be reduced, and when the business is idle, the number of aggregation tasks can be increased.

[0106] S209: Aggregate the small files.

[0107] When the target probability value is determined to be greater than the target random number, it means that the node cluster is currently relatively idle and the small files are aggregated.

[0108] S210: Skip the aggregation task of this aggregation cycle and wait for the next scanning cycle.

[0109] When it is determined that the target probability value is less than or equal to the target random number, it means that the node cluster is still relatively busy, and the aggregation task of this aggregation cycle is skipped and waits for the next scanning cycle.

[0110] For ease of understanding, we can consider two special scenarios. For example, in the extreme scenario, the current cluster load is 0, c is 0, and e -c The value of is 1, because the random number generated by the random correlation function is between 0 and 1, so random<1 is satisfied, and the aggregation task is initiated normally. When the overall cluster load is very large, for example, c is 10, then e -c The value is about 0.00045. At this time, the values ​​generated by the random correlation function are all greater than this value. At this time, the current aggregation task is skipped and waits for the next aggregation cycle.

[0111] By comparing the target probability value with the target random number, when the overall cluster load is higher, the probability of choosing to initiate an aggregation task is lower. Conversely, when the overall cluster business is relatively idle, the probability of choosing to initiate an aggregation task is higher. This application takes into account the overall load of the node cluster. When the node cluster is busy, it gives priority to processing front-end business. When the node cluster is idle, it gives priority to completing aggregation tasks, thereby improving the utilization rate of the node cluster during idle periods. It perceives the busy state of the cluster in a lighter manner, reduces the bandwidth loss caused by aggregation to the cluster when the business pressure is high, reduces the pressure when the node cluster is busy, and improves the smoothness of the customer's front-end business. It releases performance resources for the front-end business, reduces the chance of front-end business jams, and thus improves the overall user experience.

[0112] Corresponding to the above method embodiments, the present application also provides a small file aggregation device. The small file aggregation device described below and the small file aggregation method described above can refer to each other.

[0113] See also Figure 3 , Figure 3 This is a structural block diagram of a small file aggregation device in an embodiment of the present application, and the device may include:

[0114] A small file acquisition module 31 is used to acquire small files to be aggregated in the solid state disk storage pool corresponding to the target node;

[0115] A load query module 32 is used to query the initial node average load of the target node within a preset recent time period;

[0116] The core number acquisition module 33 is used to obtain the CPU core number of the target node;

[0117] The file aggregation module 34 is used to aggregate the small files when an executable aggregation task is determined according to the average load of the initial node and the number of CPU cores.

[0118] Pre-set to use the SSD storage pool corresponding to the target node to cache small files. When the pre-set small file aggregation conditions are met, such as when the preset aggregation cycle is reached or it is detected that the data volume of small files to be aggregated in the SSD storage pool reaches the preset data volume threshold, obtain the small files to be aggregated in the SSD storage pool corresponding to the target node. Query the initial node average load of the target node within the preset recent time period. By calculating the average load within the preset recent time period, the pressure state of the target node is determined according to the average load. Compared with determining the pressure state of the target node according to the current real-time load, this avoids the randomness of node load acquisition and improves the reliability of the acquired node load information.

[0119] When the preset small file aggregation condition is reached, the number of CPU cores of the target node is obtained. Whether the preset aggregation condition is met is determined according to the average load of the initial node and the number of CPU cores. For example, it can be determined whether the average load of the initial node is less than the number of CPU cores. When the average load of the initial node is less than the number of CPU cores, it means that the tasks in the system are relatively small and the system load is light. When the average load of the initial node is greater than or equal to the number of CPU cores, it means that the system load is heavy, which may cause tasks to queue for CPU resources, the system performance may decline, and the response time will be longer. When it is determined that the preset aggregation condition is met according to the average load of the initial node and the number of CPU cores, each small file is aggregated. This application fully considers the overall load of the node cluster, which can reflect the overall busy state of the node cluster. When the node cluster is busy, the aggregation task is executed with a lower probability. When the cluster is idle or occupies fewer resources, the aggregation task is executed with a higher probability. The cluster busy state is perceived at a lighter level, the bandwidth loss caused by aggregation to the cluster when the business pressure is high is reduced, the pressure of the node cluster when it is busy is reduced, the utilization rate of the node cluster during idle period is improved, the performance resources are released for the front-end business, and the probability of front-end business jam is reduced, thereby improving the overall user experience.

[0120] It can be seen from the above technical solution that by obtaining the small files to be aggregated in the SSD storage pool corresponding to the target node, and querying the initial node average load of the target node in the preset recent time period, it is determined whether the aggregation task can be executed according to the initial node average load and the number of CPU cores of the node. Taking into account the node load situation, a dynamic adaptive strategy is adopted to aggregate small files, and small files are aggregated only when it is determined that the aggregation task can be executed according to the node load situation. This avoids the node performance consumed by aggregation affecting the front-end business. When the overall load of the node occupied by the node front-end business is low, the aggregation task is executed first, so as to make full use of the node idle time to aggregate small files into large files, thereby improving the reading and writing performance of small files.

[0121] In a specific implementation of the present application, the small file acquisition module 31 is specifically a module for acquiring small files to be aggregated in the solid state disk storage pool corresponding to the target node when a preset aggregation period is reached.

[0122] Preset the aggregation period, for example, you can set the aggregation period to 1 hour. When the preset aggregation period is reached, obtain the small files to be aggregated in the SSD storage pool corresponding to the target node. By making small file aggregation decisions according to the preset aggregation period, while ensuring that the small files to be aggregated can be effectively aggregated, the impact of frequent small file aggregation applications on system performance is avoided.

[0123] In a specific implementation of the present application, the load query module 32 is specifically a module that queries the average initial node load of the target node within a preset recent time period through a runtime command.

[0124] Pre-set the query of node load information through the runtime command. After obtaining the small files to be aggregated in the SSD storage pool corresponding to the target node, query the initial node average load of the target node in the preset recent time period through the runtime command. Pre-set the runtime command to query the initial node average load of the target node in the preset recent time period. When you need to obtain the node load situation, you only need to enter the simple and easy runtime command to query the initial node average load in the preset recent time period, which improves the efficiency of node average load query.

[0125] In a specific implementation of the present application, the core number acquisition module 33 is specifically a module for acquiring the number of CPU cores of the target node through an available processor number command.

[0126] The number of CPU cores of the target node is obtained by pre-setting the available processor number command. When the pre-set small file aggregation conditions are met, the number of CPU cores of the target node is obtained by the available processor number command. When the number of CPU cores of a node needs to be obtained, the number of CPU cores of the target node can be obtained by entering the pre-set available processor number command. This is simple and easy, and improves the efficiency of obtaining the number of CPU cores of the node.

[0127] In a specific implementation of the present application, the small file acquisition module 31 is specifically a module for acquiring each small file to be aggregated in the solid state disk storage pool corresponding to the node cluster;

[0128] The load query module 32 is specifically a module for respectively querying the average initial node load of each node in the node cluster within a preset recent time period;

[0129] The core number acquisition module 33 is specifically a module for respectively acquiring the number of CPU cores of each node in the node cluster;

[0130] The file aggregation module 34 includes:

[0131] The target node average load obtaining submodule is used to obtain the target node average load corresponding to each node by dividing the initial node average load corresponding to each node by the number of CPU cores;

[0132] The cluster average load acquisition submodule is used to calculate the average load of each target node to obtain the cluster average load;

[0133] The probability value acquisition submodule is used to perform probability mapping of the average load of the cluster to the interval of 0 to 1 using a preset probability function to obtain a target probability value;

[0134] The random number generation submodule is used to generate a target random number between 0 and 1 through a random correlation function;

[0135] A judgment submodule is used to judge whether the target probability value is greater than the target random number;

[0136] The file aggregation submodule is used to aggregate the small files when it is determined that the target probability value is greater than the target random number.

[0137] In a specific embodiment of the present application, the device may further include:

[0138] The aggregation task skipping module is used to skip the aggregation task of this aggregation cycle and wait for the next scanning cycle when it is determined that the target probability value is less than or equal to the target random number.

[0139] In a specific implementation of the present application, the probability value acquisition submodule is specifically used to perform probability mapping of the average load of the cluster to the interval of 0 to 1 using a preset probability function through a formula to obtain a target probability value:

[0140] f=e -c ;

[0141] Where f represents the target probability value and c represents the average load of the cluster.

[0142] The above formula is used to map the cluster average load to a probability to obtain the target probability value. From the above formula, it can be seen that when the cluster average load c is close to 0, that is, when the system load is small, the target probability value f is close to 1. When the cluster average load gradually increases, the value of f gradually approaches 0. Therefore, the availability of the node cluster can be intuitively obtained based on the target probability value, that is, the target probability value is proportional to the probability of executing the aggregation task. The aggregation task execution judgment is made in a proportional manner, which is more in line with the public reasoning habits and improves the user experience.

[0143] Corresponding to the above method embodiment, see Figure 4 , Figure 4A schematic diagram of a small file aggregation device provided by the present application, which may include:

[0144] A memory 332, for storing computer programs;

[0145] The processor 322 is used to implement the steps of the small file aggregation method of the above method embodiment when executing the computer program.

[0146] For details, please refer to Figure 5 , Figure 5 A specific structural diagram of a small file aggregation device provided for this embodiment, the small file aggregation device may have relatively large differences due to different configurations or performances, and may include a processor (central processing units, CPU) 322 (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer programs 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the processor 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the small file aggregation device 301.

[0147] The small file aggregation device 301 may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .

[0148] The steps in the small file aggregation method described above can be implemented by the structure of the small file aggregation device.

[0149] Corresponding to the above method embodiment, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:

[0150] Obtain the small files to be aggregated in the SSD storage pool corresponding to the target node; query the target node's initial node average load within a preset recent time period; obtain the number of CPU cores of the target node; when the executable aggregation task is determined based on the initial node average load and the number of CPU cores, use the target node to aggregate the small files.

[0151] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0152] For an introduction to the computer-readable storage medium provided in this application, please refer to the above method embodiment, and this application will not go into details here.

[0153] Corresponding to the above method embodiments, the present application also provides a computer program product, including a computer program, which implements the steps of the above small file aggregation method when executed by a processor.

[0154] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the devices, equipment and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0155] Specific examples are used herein to illustrate the principles and implementation methods of the present application, and the description of the above embodiments is only used to help understand the technical solution and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.

Claims

1. A small file aggregation method, characterized in that: include: Obtain the small files to be aggregated in the SSD storage pool corresponding to the target node; Querying the average initial node load of the target node within a preset recent time period; Obtain the number of CPU cores of the target node; When an executable aggregation task is determined according to the average load of the initial node and the number of CPU cores, each of the small files is aggregated.

2. The small file aggregation method according to claim 1, characterized in that: Get the small files to be aggregated in the SSD storage pool corresponding to the target node, including: When the preset aggregation period is reached, each small file to be aggregated in the solid-state hard disk storage pool corresponding to the target node is obtained.

3. The small file aggregation method according to claim 1, characterized in that: Querying the average initial node load of the target node within a preset recent time period includes: The average initial node load of the target node within a preset recent time period is queried through a runtime command.

4. The small file aggregation method according to claim 1, characterized in that: Get the number of CPU cores of the target node, including: Get the number of CPU cores of the target node through the available processor count command.

5. The small file aggregation method according to any one of claims 1 to 4, characterized in that: The small files to be aggregated in the SSD storage pool corresponding to the target node are obtained, including: Obtain the small files to be aggregated in the SSD storage pool corresponding to the node cluster; Accordingly, querying the average initial node load of the target node within a preset recent time period includes: Querying respectively the initial node average load of each node in the node cluster within the preset recent time period; Accordingly, obtaining the number of CPU cores of the target node includes: Obtain the number of CPU cores of each node in the node cluster respectively; Correspondingly, when the executable aggregation task is determined according to the average load of the initial node and the number of CPU cores, the small files are aggregated, including: The average load of the target nodes corresponding to each of the nodes is obtained by dividing the average load of the initial nodes corresponding to each of the nodes by the number of CPU cores; Calculate the average load of each target node to obtain the average load of the cluster; Using a preset probability function to perform probability mapping on the average load of the cluster to a range of 0 to 1, to obtain a target probability value; Generate a target random number between 0 and 1 through a random correlation function; Determine whether the target probability value is greater than the target random number; If so, the small files are aggregated.

6. The small file aggregation method according to claim 5, characterized in that: Also includes: When it is determined that the target probability value is less than or equal to the target random number, the aggregation task of this aggregation cycle is skipped and the next scanning cycle is waited.

7. The small file aggregation method according to claim 5, characterized in that: Probabilistically mapping the average load of the cluster to a range of 0 to 1 using a preset probability function to obtain a target probability value, including: The target probability value is obtained by mapping the average load of the cluster to the interval of 0 to 1 using a preset probability function through the formula: f=e -c ; Where f represents the target probability value and c represents the average load of the cluster.

8. A small file aggregation device, characterized in that: include: A small file acquisition module is used to acquire small files to be aggregated in the solid-state hard disk storage pool corresponding to the target node; A load query module, used to query the initial node average load of the target node within a preset recent time period; A core number acquisition module, used to obtain the number of CPU cores of the target node; The file aggregation module is used to aggregate the small files when an executable aggregation task is determined according to the average load of the initial node and the number of CPU cores.

9. A small file aggregation device, characterized in that: include: Memory for storing computer programs; A processor, used to implement the steps of the small file aggregation method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the small file aggregation method as described in any one of claims 1 to 7.