Data file integration method and device, equipment and storage medium

By integrating data files while the database cluster services are offline, the problems of long collation and merge time and resource limitation in the existing technology are solved, and fast and efficient data file integration is achieved, meeting the requirements of timeliness and resource utilization.

CN119576929APending Publication Date: 2025-03-07BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411620761.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The prior art performs data file integration when the services of database clusters are online, resulting in long collation and merging time, difficulty in meeting timeliness, and resource limitations lead to overall inefficiency, resulting in waste of disk space and business blockage.

Method used

It provides a data file integration method, which can integrate data files when the services of the database cluster are offline. By analyzing the data table directory, it determines whether the partition meets the preset integration conditions, records the list to be sorted, and integrates the data files based on the list.

Benefits of technology

Quickly integrate data files when the database cluster service is offline, avoiding resource constraints and dependence on merging threads, improving the efficiency of data file sorting, effectively making use of disk space, and meeting timeliness requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576929A_ABST
    Figure CN119576929A_ABST
Patent Text Reader

Abstract

The invention relates to a data file integration method and device, equipment and a storage medium. The method comprises the following steps of: in response to an integration instruction of a user on a data file, stopping service of a database cluster, analyzing a data table directory of the database cluster to obtain the data file under each partition of each data table, judging whether each partition of each data table meets a preset integration condition or not, and for any partition, carrying out integration on the data file according to the preset integration condition. And when the partition meets a preset integration condition, recording the partition identifier of the partition into a to-be-sorted list, and based on the partition identifier in the to-be-sorted list, integrating the data files in the partition corresponding to the partition identifier. Compared with the prior art, the embodiment of the invention has the advantages that under the condition that the service of the database cluster is offline, the data files can be quickly integrated without relying on arrangement and combination of threads and being limited by resources, the data file arrangement efficiency is improved, and the disk space can be effectively utilized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data file integration method, device, equipment and storage medium. Background Art

[0002] Multiple clusters of the database (hbase) may need to perform offline data migration due to issues such as computer room relocation and operating system replacement. Usually, hbase snapshot technology is used for this migration, which can achieve fast and accurate migration. However, this technology also has a problem. The migrated data will first enter the archive directory in the new hbase cluster, and then create many reference files to the data files in the archive directory from the main data directory. When the application accesses the new hbase cluster, the new hbase cluster will automatically access the real data files through the reference files. However, the new hbase cluster needs to gradually organize and merge the data files in the archive directory through compaction actions in order to restore the data files in the archive directory to the main data directory.

[0003] In the related art, data nodes (region servers) in the cluster are usually used for compaction and merging. Each region server starts a compaction and merging thread pool to regularly check whether the data files of this data node can be compacted. In order to speed up the compaction processing capability of a single region server node in the cluster, it is necessary to manually adjust the number of threads in the compaction thread pool of the region server to improve the processing capability.

[0004] However, the above integration method has the following disadvantages:

[0005] 1) Adjusting the number of threads can only increase the throughput of data nodes for data consolidation and merging. When a compaction thread of a single data node consolidates too many data files, or some data files are too large, the consolidation and merging time of this compaction thread will also be very long, and it is difficult to meet the requirements of complete data recovery in terms of timeliness. If the archived data files cannot be quickly integrated and restored to the main data directory, it will lead to a waste of disk space and block the consolidation and merging of normal business data.

[0006] 2) Because the HBase cluster must be active when the compaction thread is executed, the execution of the thread will compete with the client access requests of the HBase cluster for disk and network IO resources, so it is usually not possible to add too many compaction threads to improve the overall compaction efficiency. Summary of the invention

[0007] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a data file integration method, device, equipment and storage medium, which can quickly integrate data files when the service of the database cluster is offline.

[0008] In a first aspect, an embodiment of the present disclosure provides a data file integration method, the method comprising:

[0009] In response to a user's instruction to integrate the data files, stopping the service of the database cluster;

[0010] Parsing the data table directory of the database cluster to obtain data files under each partition of each data table;

[0011] Determine whether each partition of each data table meets the preset integration conditions;

[0012] For any partition, if the partition meets the preset integration conditions, the partition identifier of the partition is recorded in the list to be sorted;

[0013] Based on the partition identifiers in the to-be-organized list, data files under the partitions corresponding to the partition identifiers are integrated.

[0014] In a second aspect, an embodiment of the present disclosure provides a data file integration device, the device comprising:

[0015] A stop module, used to stop the service of the database cluster in response to a user's instruction to integrate the data files;

[0016] A parsing module, used to parse the data table directory of the database cluster to obtain data files under each partition of each data table;

[0017] A judgment module is used to judge whether each partition of each data table meets the preset integration conditions;

[0018] A recording module, for recording a partition identifier of any partition into a to-be-sorted list when the partition meets a preset integration condition;

[0019] The integration module is used to integrate the data files under the partition corresponding to the partition identifier in the to-be-organized list based on the partition identifier.

[0020] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0021] Memory;

[0022] Processor; and

[0023] Computer programs;

[0024] The computer program is stored in the memory and is configured to be executed by the processor to implement the method as described in the first aspect.

[0025] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method as described in the first aspect.

[0026] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the method described in the first aspect is implemented.

[0027] The data file integration method, device, equipment and storage medium provided by the embodiments of the present disclosure, by responding to the user's integration instruction for the data file, stopping the service of the database cluster, parsing the data table directory of the database cluster, obtaining the data files under each partition of each data table, judging whether each partition of each data table meets the preset integration condition, for any partition, if the partition meets the preset integration condition, recording the partition identifier of the partition into the list to be sorted, and based on the partition identifier in the list to be sorted, integrating the data files under the partition corresponding to the partition identifier. Compared with the prior art, the embodiments of the present disclosure can quickly integrate the data files when the service of the database cluster is offline, does not rely on the sorting and merging thread, will not be subject to resource constraints, improves the efficiency of data file sorting, and can effectively utilize disk space. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0030] Figure 1 A flow chart of a data file integration method provided by an embodiment of the present disclosure;

[0031] Figure 2 A flow chart of a data file integration method provided by another embodiment of the present disclosure;

[0032] Figure 3 A schematic diagram of a processing flow of a mapping task provided in an embodiment of the present disclosure;

[0033] Figure 4 A flow chart of a data file integration method provided by another embodiment of the present disclosure;

[0034] Figure 5 A schematic diagram of the structure of a data file integration device provided in an embodiment of the present disclosure;

[0035] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0036] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0037] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0038] In the related art, data nodes (region servers) in the cluster are usually used for compaction and merging. Each region server starts a compaction and merging thread pool to regularly check whether the data files of this data node can be compacted. In order to speed up the compaction processing capability of a single region server node in the cluster, it is necessary to manually adjust the number of threads in the compaction thread pool of the region server to improve the processing capability.

[0039] However, the above integration method has the following disadvantages:

[0040] 1) Adjusting the number of threads can only increase the throughput of data nodes for data consolidation and merging. When a compaction thread of a single data node consolidates too many data files, or some data files are too large, the consolidation and merging time of this compaction thread will also be very long, and it is difficult to meet the requirements of complete data recovery in terms of timeliness. If the archived data files cannot be quickly integrated and restored to the main data directory, it will lead to a waste of disk space and block the consolidation and merging of normal business data.

[0041] 2) Because the HBase cluster must be active when the compaction thread is executed, the execution of the thread will compete with the client access requests of the HBase cluster for disk and network IO resources, so it is usually not possible to add too many compaction threads to improve the overall compaction efficiency.

[0042] To address this problem, an embodiment of the present disclosure provides a data file integration method, which is described below in conjunction with a specific embodiment.

[0043] Figure 1 A flow chart of a data file integration method provided in an embodiment of the present disclosure. The executor of the method is an electronic device. The electronic device may be a portable mobile device such as a tablet computer or a laptop computer; it may also be a fixed device such as a personal computer or a server, wherein the server may be a single server or a server cluster, and the server cluster may be a distributed cluster or a centralized cluster. The method may be applied to scenarios where data files are integrated, and may also be applied to scenarios where data files in an archive directory are sorted and merged. It is understandable that the data file integration method provided in an embodiment of the present disclosure may also be applied in other scenarios.

[0044] Below Figure 1 The data file integration method shown in the figure is introduced, and the method can be applied to electronic devices. The specific steps of the method are as follows:

[0045] S101 . In response to a user's instruction to integrate data files, stop the service of the database cluster.

[0046] In this step, the user will start the integration operation of the data files, that is, the user issues an integration instruction for the data files, and the electronic device responds to the user's integration instruction for the data files, starts the integration operation for the data files, and automatically stops the service of the database cluster. In some embodiments, the electronic device responds to the user's integration instruction for the data files and starts a data file processing device, the data file processing device is used to integrate the data files, and after the data file processing device is started, the service of the database cluster is automatically stopped.

[0047] S102: Parse the data table directory of the database cluster to obtain data files under each partition of each data table.

[0048] In this step, the electronic device will parse the data table directory of the database cluster to obtain the data files under each partition of each data table, that is, the data table structure of the database cluster. The data table structure specifically refers to how many data tables there are in the database cluster, how many partitions there are under each data table, and what data files there are under each partition.

[0049] S103: Determine whether each partition of each data table meets a preset integration condition.

[0050] In this step, after obtaining the data files under each partition of each data table, the electronic device will determine whether each partition of each data table meets the preset integration conditions. The essence of this step is to determine whether each partition needs to be sorted. For any partition, if the partition meets the preset integration conditions, S104 is executed, otherwise no processing is performed.

[0051] S104: For any partition, if the partition meets the preset integration condition, the partition identifier of the partition is recorded in the to-be-sorted list.

[0052] In this step, for any partition, if the partition meets the preset integration condition, the electronic device records the partition identifier of the partition into the list to be sorted. In some embodiments, the list to be sorted is a common text file type, in which each line of data represents a partition (region) information to be sorted, and the format of each line of data is: <partition identifier> = <path in the distributed file system where the partition is located>. Optionally, the partition identifier can be a partition number, that is, a region number, or other identifiers, without specific limitation.

[0053] S105: Based on the partition identifiers in the to-be-organized list, data files under the partitions corresponding to the partition identifiers are integrated.

[0054] In this step, the electronic device will integrate the data files under the partition corresponding to the partition identifier in the list to be sorted, without relying on the sorting and merging thread and being subject to resource constraints, thereby improving the efficiency of data file sorting and effectively utilizing disk space.

[0055] The disclosed embodiment responds to the user's instruction to integrate data files, stops the service of the database cluster, parses the data table directory of the database cluster, obtains the data files under each partition of each data table, determines whether each partition of each data table meets the preset integration conditions, and for any partition, if the partition meets the preset integration conditions, records the partition identifier of the partition into the list to be sorted, and integrates the data files under the partition corresponding to the partition identifier based on the partition identifier in the list to be sorted. Compared with the prior art, the disclosed embodiment can quickly integrate data files when the service of the database cluster is offline, does not rely on the sorting and merging thread, will not be subject to resource constraints, improves the efficiency of data file sorting, and can effectively utilize disk space.

[0056] Figure 2 A flow chart of a data file integration method provided by another embodiment of the present disclosure is shown in FIG. Figure 2As shown, the method includes the following steps:

[0057] S201. In response to the user's integration instruction for the data file, stop the service of the database cluster.

[0058] Specifically, the implementation processes and principles of S201 and S101 are the same, and will not be elaborated here.

[0059] S202. Obtain the main data directory of the distributed file system of the database cluster.

[0060] In this step, the electronic device obtains the main data directory of the distributed file system (Hadoop Distributed File System, HDFS) of the database cluster.

[0061] S203. Parse the data table directories in the main data directory to obtain the data files under each partition of each data table.

[0062] Furthermore, the electronic device parses the data table directories in the main data directory to obtain the data files under each partition of each data table.

[0063] S204. Determine whether the number of data files under each partition of each data table is greater than a preset threshold. And / or

[0064] In this step, the electronic device determines whether the number of data files under each partition of each data table is greater than a preset threshold. Optionally, the preset threshold can be 3, or 5, or other values, without specific limitation. Taking the preset threshold as 3 as an example, determine whether the number of data files under each partition of each data table is greater than 3.

[0065] S205. Determine whether there are reference files under each partition of each data table.

[0066] In this step, the electronic device determines whether there are reference files under each partition of each data table.

[0067] In some embodiments, S205 includes but is not limited to S2051 and S2052:

[0068] S2051. Determine whether the file name format of the data files under each partition of each data table matches the file name format of the reference files;

[0069] In this step, the electronic device determines whether the file name format of the data files under each partition of each data table matches the file name format of the reference files. Optionally, the file name format of the reference files is: <tablespace name> = = <partition identifier> - <hfile number>.

[0070] S2052: For any partition, if the file name format of any data file under the partition matches the file name format of the reference file, it is determined that the reference file exists under the partition.

[0071] In this step, for any partition, if the file name format of any data file under the partition matches the file name format of the reference file, it is determined that the reference file exists under the partition.

[0072] S206: For any partition, if the number of data files under the partition is greater than a preset threshold, or there are reference files under the partition, it is determined that the partition meets the preset integration condition.

[0073] In this step, for any partition, if the electronic device determines that the number of data files under the partition is greater than the preset threshold, or determines that there are reference files under the partition, it is determined that the partition meets the preset integration conditions. When the number of data files in any region under the data table is greater than the preset threshold, or there are reference files, it means that the region needs to sort and merge data files, then it is determined that the partition meets the preset integration conditions, and the region will be further recorded in the list to be sorted. The reference file is a special file native to hbase, and the file name format is a pointer to the data file in the archive directory.

[0074] S207: For any partition, if the partition meets the preset integration condition, record the partition identifier of the partition into the to-be-sorted list.

[0075] Specifically, the implementation process and principle of S207 and S104 are the same, and will not be repeated here.

[0076] S208: Detect whether each partition of each data table has performed a judgment on whether it meets the preset integration condition.

[0077] In this step, the electronic device detects whether all partitions have performed the judgment of satisfying the preset integration condition, and if so, executes S209. This step traverses all partitions to ensure that all partitions have performed the judgment of satisfying the preset integration condition, and then the partitions satisfying the preset integration condition are subsequently integrated.

[0078] S209: If each partition of each data table has been judged to meet the preset integration condition, the partition identifier in the to-be-sorted list is obtained.

[0079] In this step, if each partition of each data table has been judged to meet the preset integration conditions, all partition identifiers recorded in the list to be sorted are obtained. When all partitions of all data tables are analyzed, the final list to be sorted is obtained, which contains all region information that needs to be sorted and merged. Each region information includes a partition identifier and a path in the distributed file system where the partition is located, and the partition identifier in the list to be sorted is further obtained.

[0080] S210: Based on the partition identifiers in the to-be-organized list, data files under the partitions corresponding to the partition identifiers are integrated.

[0081] Specifically, the implementation process and principle of S210 and S105 are the same, and will not be repeated here.

[0082] The disclosed embodiment stops the service of the database cluster in response to the user's instruction to integrate the data files, obtains the main data directory of the distributed file system of the database cluster, parses the data table directory in the main data directory, and obtains the data files under each partition of each data table. Then, it is determined whether the number of data files under each partition of each data table is greater than the preset threshold, and / or whether there are reference files under each partition of each data table. For any partition, if the number of data files under the partition is greater than the preset threshold, or there are reference files under the partition, it is determined that the partition meets the preset integration condition. Further, for any partition, if the partition meets the preset integration condition, the partition identifier of the partition is recorded in the list to be sorted, and it is detected whether each partition of each data table has performed the judgment of meeting the preset integration condition. If each partition of each data table has performed the judgment of meeting the preset integration condition, the partition identifier in the list to be sorted is obtained. Then, based on the partition identifier in the list to be sorted, the data files under the partition corresponding to the partition identifier are integrated. Compared with the prior art, the disclosed embodiment can quickly integrate and process data files when the database cluster service is offline, does not rely on the sorting and merging threads, is not subject to resource constraints, improves the efficiency of data file sorting, and can effectively utilize disk space.

[0083] Figure 4 A flow chart of a data file integration method provided by another embodiment of the present disclosure is shown in FIG. Figure 4 As shown, the method includes the following steps:

[0084] S301 . In response to a user's instruction to integrate data files, stop the service of the database cluster.

[0085] Specifically, the implementation process and principle of S301 and S101 are the same, and will not be repeated here.

[0086] S302: Parse the data table directory of the database cluster to obtain data files under each partition of each data table.

[0087] Specifically, the implementation process and principle of S302 and S102 are the same, and will not be repeated here.

[0088] S303: Determine whether each partition of each data table meets a preset integration condition.

[0089] Specifically, the implementation process and principle of S303 and S103 are the same, and will not be repeated here.

[0090] S304: For any partition, if the partition meets the preset integration condition, the partition identifier of the partition is recorded in the to-be-sorted list.

[0091] Specifically, the implementation process and principle of S304 and S104 are the same, and will not be repeated here.

[0092] S305: Based on the number of partition identifiers in the to-be-sorted list and the resource status of the database cluster, a plurality of mapping tasks are divided.

[0093] In this step, the electronic device will divide the partitions into multiple mapping tasks based on the number of partition identifiers in the to-be-sorted list and the resource status of the database cluster. Figure 3 As shown, the electronic device first starts a mapreduce job, which will divide several map tasks based on the number of partition identifiers in the to-be-sorted list and the resource status of the database cluster. Specifically, after the to-be-sorted list is generated, it will be transmitted to the mapreduce job. After the mapreduce job receives the to-be-sorted list, it will generate several map tasks based on the number of regions in the to-be-sorted list and the resource status in the cluster. Each map task will be responsible for processing the sorting and merging of one or more regions.

[0094] S306: Allocate the partition identifiers in the to-be-sorted list to determine the partition identifier of each mapping task to be integrated.

[0095] In this step, the electronic device will allocate the partition identifiers in the list to be sorted, and determine the partition identifier to be integrated for each mapping task. For example, the partition identifiers in the list to be sorted are allocated to each mapping task in turn, ensuring that each mapping task can be allocated a partition identifier to achieve load balancing. For example, if there are 4 mapping tasks and 6 partition identifiers, first allocate 4 partition identifiers to the 4 mapping tasks in turn, and then allocate the remaining 2 partition identifiers to the first two mapping tasks in turn.

[0096] S307: Integrate the data files under the partition corresponding to the partition identifier to be integrated based on each mapping task.

[0097] In this step, each mapping task integrates the data files under the partitions corresponding to the partition identifiers assigned to them. The input parameter of each map task is the region information in the list to be sorted. It will parse the region information to obtain the partition identifier and the main data directory of the distributed file system, that is, the path in the distributed file system where the partition is located, and further integrate the data files under the partitions corresponding to the partition identifiers to be integrated.

[0098] In some embodiments, S307 includes but is not limited to S3071, S3072, S3073, S3074, S3075:

[0099] S3071. For the partition corresponding to the partition identifier to be integrated, read the data file under the partition.

[0100] like Figure 3 As shown in S04, each mapping task receives the region information in the list to be sorted, parses the region information, obtains the partition identifier and the path of the partition in the distributed file system, and further reads the data file under the path of the partition in the distributed file system. Specifically, Figure 3 As shown in S05, it is first determined whether the data file is readable. If it is readable, the data file under the partition is read; if the data file is unreadable, it means that there is a problem with the data file under the partition. At this time, an error message will be recorded in the processing result, and then the next data file will be processed.

[0101] S3072: When a reference file exists under the partition, based on the file name of the reference file under the partition, read the data file in the archive directory referenced by the reference file.

[0102] like Figure 3 As shown in S07, it will be determined whether there is a reference file in the data file under the partition. If there is a reference file, the corresponding data file in the hdfs archive directory will be found according to the region identifier and the file name of the reference file, and then it will be checked whether the data file in the hdfs archive directory is readable. If it is readable, the data file in the archive directory referenced by the reference file will be read.

[0103] In some embodiments, if no reference file exists under the partition, the data files under the partition are directly merged to obtain the target data file.

[0104] S3073: Merge the data files under the partition and the data files in the archive directory referenced by the reference files under the partition to obtain a target data file.

[0105] In this step, if Figure 3 As shown in S09, the data files of the partition in the hdfs main data directory and the data files of the partition in the hdfs archive directory (ie, the data files in the archive directory referenced by the reference file) are merged to obtain the target data file.

[0106] S3074. Write the target data file into the partition of the main data directory, and delete the non-target data files under the partition.

[0107] like Figure 3 As shown in S10, when all data files are merged, a target data file is generated under the partition of the hdfs main data directory, and the original data files under the partition, that is, non-target data files, are cleared to release disk space.

[0108] S3075. Delete the data files in the archive directory referenced by the reference files under the partition.

[0109] In this step, the data files in the archive directory referenced by the reference files under the partition are cleared to clean up redundant files and release disk space.

[0110] In some embodiments, if the data files under the partitions assigned to the map task have been sorted and merged, the map task is terminated. When all map tasks are completed, the mapreduce job is also terminated, and the processing result information of all map records is summarized and formed into the final output result. Optionally, the output result will include the processing results of each region in the list to be cleaned up, which is convenient for manual intervention and analysis after the job is completed.

[0111] The disclosed embodiment stops the service of the database cluster in response to the user's instruction to integrate the data files, parses the data table directory of the database cluster, and obtains the data files under each partition of each data table. Then, it is determined whether each partition of each data table meets the preset integration condition. For any partition, if the partition meets the preset integration condition, the partition identifier of the partition is recorded in the list to be sorted. Further, based on the number of partition identifiers in the list to be sorted and the resource status of the database cluster, multiple mapping tasks are divided, the partition identifiers in the list to be sorted are allocated, and the partition identifiers to be integrated for each mapping task are determined. Then, based on each mapping task, the data files under the partition corresponding to the partition identifier to be integrated are integrated. Compared with the prior art, the disclosed embodiment can quickly integrate the data files when the service of the database cluster is offline, does not rely on the sorting and merging thread, will not be limited by resources, improves the efficiency of data file sorting, and can effectively use the disk space. It can automatically identify various reference files in the database to ensure that all files can be processed, and can clean up redundant files at the same time to release disk space.

[0112] Figure 5 Schematic diagram of the structure of the data file integration device provided in the embodiment of the present disclosure. The data file integration device may be the electronic device as described in the above embodiment, or the data file integration device may be a component or assembly in the electronic device. The data file integration device provided in the embodiment of the present disclosure may execute the processing flow provided in the data file integration method embodiment, such as Figure 5 As shown, the data file integration device 50 includes: a stop module 51, a parsing module 52, a judgment module 53, a recording module 54, and an integration module 55; wherein the stop module 51 is used to stop the service of the database cluster in response to the user's integration instruction for the data file; the parsing module 52 is used to parse the data table directory of the database cluster to obtain the data files under each partition of each data table; the judgment module 53 is used to judge whether each partition of each data table meets the preset integration condition; the recording module 54 is used to record the partition identifier of any partition into the list to be sorted if the partition meets the preset integration condition; the integration module 55 is used to integrate the data files under the partition corresponding to the partition identifier based on the partition identifier in the list to be sorted.

[0113] Optionally, when the parsing module 52 parses the data table directory of the database cluster to obtain the data files under each partition of each data table, it is specifically used to: obtain the main data directory of the distributed file system of the database cluster; parse the data table directory in the main data directory to obtain the data files under each partition of each data table.

[0114] Optionally, when the judgment module 53 judges whether each partition of each data table meets the preset integration conditions, it is specifically used to: judge whether the number of data files under each partition of each data table is greater than a preset threshold; and / or judge whether there are reference files under each partition of each data table; for any partition, if the number of data files under the partition is greater than the preset threshold, or there are reference files under the partition, it is judged that the partition meets the preset integration conditions.

[0115] Optionally, when the judgment module 53 judges whether there is a reference file under each partition of each data table, it is specifically used to: judge whether the file name format of the data file under each partition of each data table matches the file name format of the reference file; for any partition, if the file name format of any data file under the partition matches the file name format of the reference file, it is determined that there is a reference file under the partition.

[0116] Optionally, before integrating the data files under the partition corresponding to the partition identifier in the list to be sorted, the device 50 also includes: an acquisition module 56; the acquisition module 56 is used to detect whether each partition of each data table has executed a judgment that meets the preset integration conditions; if each partition of each data table has executed a judgment that meets the preset integration conditions, then the partition identifier in the list to be sorted is acquired.

[0117] Optionally, when the integration module 55 integrates the data files under the partition corresponding to the partition identifier in the list to be sorted, it is specifically used to: divide a plurality of mapping tasks based on the number of partition identifiers in the list to be sorted and the resource status of the database cluster; allocate the partition identifiers in the list to be sorted to determine the partition identifiers to be integrated for each mapping task; and integrate the data files under the partition corresponding to the partition identifier to be integrated based on each mapping task.

[0118] Optionally, when the integration module 55 integrates the data files under the partition corresponding to the partition identifier to be integrated based on each mapping task, it is specifically used to: read the data files under the partition corresponding to the partition identifier to be integrated; if there is a reference file under the partition, read the data file in the archive directory referenced by the reference file based on the file name of the reference file under the partition; merge the data file under the partition and the data file in the archive directory referenced by the reference file under the partition to obtain the target data file; write the target data file to the partition of the main data directory, and delete the non-target data files under the partition; delete the data file in the archive directory referenced by the reference file under the partition.

[0119] Figure 5 The data file integration device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned method embodiment, and its implementation principle and technical effect are similar and will not be described in detail here.

[0120] Figure 6 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 6 , which shows a structural schematic diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0121] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603 to implement the data file integration method of the embodiment described in the present disclosure. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0122] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0123] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart, thereby implementing the data file integration method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0124] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0125] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0126] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0127] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0128] In response to a user's instruction to integrate the data files, stopping the service of the database cluster;

[0129] Parsing the data table directory of the database cluster to obtain data files under each partition of each data table;

[0130] Determine whether each partition of each data table meets the preset integration conditions;

[0131] For any partition, if the partition meets the preset integration conditions, the partition identifier of the partition is recorded in the list to be sorted;

[0132] Based on the partition identifiers in the to-be-organized list, data files under the partitions corresponding to the partition identifiers are integrated.

[0133] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

[0134] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0135] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0136] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0137] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

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

[0139] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0140] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0141] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A data file integration method, characterized in that: The method comprises: In response to a user's instruction to integrate the data files, stopping the service of the database cluster; Parsing the data table directory of the database cluster to obtain data files under each partition of each data table; Determine whether each partition of each data table meets the preset integration conditions; For any partition, if the partition meets the preset integration conditions, the partition identifier of the partition is recorded in the list to be sorted; Based on the partition identifiers in the to-be-organized list, data files under the partitions corresponding to the partition identifiers are integrated.

2. The method according to claim 1, characterized in that The data table directory of the database cluster is parsed to obtain data files under each partition of each data table, including: Obtaining a master data directory of a distributed file system of the database cluster; The data table directory in the main data directory is parsed to obtain data files under each partition of each data table.

3. The method according to claim 1, characterized in that The step of judging whether each partition of each data table meets the preset integration condition includes: Determine whether the number of data files under each partition of each data table is greater than a preset threshold; and / or Determine whether there are reference files under each partition of each data table; For any partition, if the number of data files under the partition is greater than a preset threshold, or there are reference files under the partition, it is determined that the partition meets the preset integration condition.

4. The method according to claim 3, characterized in that The step of judging whether a reference file exists in each partition of each data table includes: Determine whether the file name format of the data files under each partition of each data table matches the file name format of the referenced file; For any partition, if the file name format of any data file under the partition matches the file name format of the reference file, it is determined that the reference file exists under the partition.

5. The method according to claim 1, characterized in that: Before integrating the data files under the partitions corresponding to the partition identifiers in the to-be-organized list, the method further includes: Check whether each partition of each data table has executed the judgment that meets the preset integration conditions; If each partition of each data table has been judged to satisfy the preset integration condition, the partition identifier in the to-be-sorted list is obtained.

6. The method according to claim 1, characterized in that The step of integrating data files under the partitions corresponding to the partition identifiers in the to-be-sorted list includes: Based on the number of partition identifiers in the to-be-sorted list and the resource status of the database cluster, a plurality of mapping tasks are divided; Allocate the partition identifiers in the to-be-sorted list to determine the partition identifier to be integrated for each mapping task; Based on each mapping task, the data files under the partition corresponding to the partition identifier to be integrated are integrated.

7. The method according to claim 6, characterized in that The integrating the data files under the partitions corresponding to the partition identifiers to be integrated based on each mapping task includes: For the partition corresponding to the partition identifier to be integrated, read the data file under the partition; In the case where a reference file exists under the partition, based on the file name of the reference file under the partition, reading the data file in the archive directory referenced by the reference file; Merging the data files under the partition and the data files in the archive directory referenced by the reference files under the partition to obtain a target data file; Writing the target data file into the partition of the main data directory and deleting the non-target data files under the partition; Delete the data files in the archive directory referenced by the reference files under the partition.

8. A data file integration device, characterized in that: The device comprises: A stop module, used to stop the service of the database cluster in response to a user's instruction to integrate the data files; A parsing module, used to parse the data table directory of the database cluster to obtain data files under each partition of each data table; A judgment module is used to judge whether each partition of each data table meets the preset integration conditions; A recording module, for recording a partition identifier of any partition into a to-be-sorted list when the partition meets a preset integration condition; The integration module is used to integrate the data files under the partition corresponding to the partition identifier in the to-be-organized list based on the partition identifier.

9. An electronic device, characterized in that: include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.