Dynamic data partitioning method based on local weighted linear regression for Dask cluster

By using the local weighted linear regression algorithm to dynamically adjust the data block size in the Dask cluster, the time-consuming and labor-intensive problem of the data segmentation method in the existing technology is solved, and efficient parallel processing of large-scale data sets is achieved, with strong adaptability and improvement. improve processing efficiency.

CN114296911BActive Publication Date: 2024-08-30HUNAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111509160.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2024-08-30
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

Existing data segmentation methods based on manual experience and machine learning are time-consuming and labor-intensive, and difficult to adapt to changes in data sets, parallel applications, and cluster environments, and cannot effectively optimize the parallel processing performance of big data in Dask clusters.

Method used

A dynamic data blocking method based on locally weighted linear regression is used to divide the large-scale data set into two sub-datasets. The block size is estimated online through the local weighted linear regression algorithm and the block size is dynamically adjusted to optimize processing efficiency and avoid the impact of manual experience. Dependent and time-consuming offline training.

Benefits of technology

It achieves efficient processing of large-scale data sets in Dask clusters, can adapt to changes in data sets and cluster environments, improves parallel computing performance, and reduces processing time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114296911B
    Figure CN114296911B
Patent Text Reader

Abstract

The present invention discloses a dynamic data partitioning method based on local weighted linear regression for Dask cluster, which divides the large-scale data set to be processed into a set of sub-data sets for block size optimization and a set of remaining sub-data sets to be processed, and processes the block size corresponding to each sub-data set for block size optimization, and adopts a local weighted linear regression algorithm to accurately and dynamically estimate the block size corresponding to each remaining sub-data set to be processed online, based on the block size and time consumed for each sub-data set that has been processed. The present invention solves the high dependence on manual experience and time-consuming and labor-intensive offline training, can better adapt to changes in data sets, parallel applications and cluster environments, and improves the efficiency of processing large-scale data sets in Dask clusters to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of performance optimization of big data parallel processing, and more specifically, to a dynamic data partitioning method based on local weighted linear regression for a Dask cluster. Background Art

[0002] When executing parallel applications in a Dask cluster to process a large-scale data set, the data set needs to be divided into blocks. CN201410836567.2 Big Data Parallel Computing Method and Device discloses dividing the data set into blocks according to the data set size, cluster memory size and parallelism, and obtaining a block data set composed of multiple data blocks; using the block data set as a training data set for the logistic regression classification algorithm, solving the optimal weight vector of the logistic regression function to obtain a logistic regression classifier. The embodiment of the present invention divides the data set into blocks according to the data set size, cluster memory size and parallelism, that is, when dividing the big data into blocks, the computing resources are fully considered, and the computing resources determine the data block size, so that each computing node can make full use of the computing resources when processing the data blocks, improve the processing efficiency of the data blocks, and improve the parallel computing performance of the big data. The block size setting has a great influence on the efficiency of processing large-scale data sets, so how to reasonably divide the data set into blocks to improve the efficiency of processing large-scale data sets to a certain extent is of great significance.

[0003] When partitioning large-scale data sets, there are two main ways to set the block size:

[0004] The first is a data partitioning method based on artificial experience. This method targets specific large-scale data sets, specific parallel applications, and specific cluster environments. Based on experience, different block sizes are manually selected for multiple experiments. Each experiment uses a fixed block size to partition the large-scale data set and obtain its total time consumption. Finally, the block size corresponding to the shortest total time consumption is selected from multiple experiments as the block size for partitioning the large-scale data set.

[0005] The second is a data block method based on machine learning. This method first obtains the more appropriate fixed block sizes used when executing different parallel applications in different cluster environments to process data sets of different sizes as training samples, then uses a large number of samples and trains a block size prediction model based on machine learning algorithms, and finally uses the model to predict the block size required to execute a specific parallel application in a specific cluster environment to process a data set of a specific size.

[0006] Although data partitioning methods based on manual experience and machine learning can select a more appropriate fixed block size for partitioning a specific large-scale data set for a specific parallel application in a specific cluster environment, the data partitioning method based on manual experience is not only highly dependent on the programmer's experience and knowledge but also requires a lot of testing, while the data partitioning method based on machine learning requires a high cost to collect a large number of training samples for offline training. Both methods are not only time-consuming and labor-intensive, but also difficult to adapt to changes in data sets, parallel applications, and cluster environments. Summary of the invention

[0007] The technical problem to be solved by the present invention is to provide a dynamic data partitioning method based on local weighted linear regression for Dask clusters in view of the shortcomings of existing data partitioning methods based on manual experience and machine learning, which are time-consuming and labor-intensive and difficult to adapt to changes in data sets, parallel applications and cluster environments.

[0008] The purpose of the present invention is achieved through the following technical solutions:

[0009] A dynamic data partitioning method based on local weighted linear regression for Dask cluster, comprising the following steps:

[0010] S1. Divide the large-scale dataset X into N sub-datasets, and then divide the N sub-datasets into sub-dataset sets X for block size optimization. profiling =(X profiling.1 ,X profiling.2 ,...,X profiling.i ,...,X profiling.n ) and the remaining sub-dataset set X to be processed rest =(X rest.1 ,X rest.2 ,...,X rest.j ,...,X rest.m ), where 1≤i≤n, 1≤j≤m, N=n+m;

[0011] S2. Set the optimal sub-dataset set X profiling The block size corresponding to each sub-dataset in;

[0012] S3. Processing X profiling Subdatasets in

[0013] From X profiling Read the i-th sub-dataset X profiling.i And in the specified block size M profiling.i X profiling.i The application is then divided into chunks and executed in parallel on the Dask cluster for X profiling.i Process and obtain the time T it takes profiling.i, and finally M profiling.i and T profiling.i Add observation matrix O N×2 , where 1≤i≤n;

[0014] S4..Processing X rest The first subdataset in

[0015] S41. Obtain the minimum time T corresponding to all processed sub-data sets from the observation matrix min , calculate the regression coefficient θ of the local weighted linear regression algorithm based on the observation matrix, and use T min and θ to estimate X rest.1 The corresponding block size M rest.1 , and press M rest.1 X rest.1 Divide into blocks;

[0016] S42. Execute parallel applications on a Dask cluster rest.1 Process and obtain the time T it takes rest.1 , M rest.1 and T rest.1 Add to the observation matrix, that is, use M rest.1 and T rest.1 Replace the two values ​​in the n+1th row of the matrix;

[0017] S5. Repeat step S4 to calculate X rest The block size and time consumed by the next sub-dataset of the observation matrix are added to the block size and time consumed by the observation matrix;

[0018] S6. Calculate X rest All sub-datasets in the dataset are obtained to obtain the total time consumed in processing the large-scale dataset X.

[0019] Furthermore, the subset of data sets used for block size optimization is X profiling And the remaining sub-datasets to be processed are X rest The ratio is 2:8.

[0020] Furthermore, the large-scale dataset X and the sub-dataset set for block size optimization are X profiling And the remaining sub-datasets to be processed are X rest The relationship is X = X profiling ∪X rest and

[0021] Furthermore, the step of setting the block size in step S2 includes:

[0022] S21. Determine an initial block size Minit And the block size change d. S22. According to the initial block size M init and the block size change d, calculate X profiling The block size corresponding to each sub-dataset in .

[0023] Furthermore, the block size M in S2 is profiling.i for:

[0024]

[0025]

[0026] Furthermore, the initial block size M init It cannot be too large to ensure that the intermediate results generated by executing parallel applications on the Dask cluster to process multiple blocks do not exceed the main memory size and GPU memory size, and the initial block size M init It should not be too small to ensure that the time it takes to process each chunk of your parallel application in the Dask cluster is significantly longer than the time it takes Dask to schedule the tasks for that chunk.

[0027] Furthermore, the block size change d should ensure that X profiling The block sizes of all sub-datasets in X are greater than 0 and profiling A more suitable block size can be found between the minimum and maximum block sizes corresponding to all sub-datasets in .

[0028] Furthermore, the observation matrix O N×2 for:

[0029]

[0030] Where N is the row, N=n+m.

[0031] Furthermore, M rest.1 and T rest.1 Add to the observation matrix and use the newly obtained M each time rest.1 and T rest.1 Replace the two values ​​of the corresponding row in the matrix, and the M obtained for the i-th time i and T i , use M i and T i Replace the two values ​​in the i-th row of the matrix.

[0032] Furthermore, the weight w of the local weighted linear regression algorithm is k The calculation formula is:

[0033] w k =exp((T min -Ok,2 ) 2 / (-2σ 2 )), (1≤k≤n+j-1)

[0034] Among them, T min =min(O 1,2 ,O 2,2 ,...,O n+j-1,2 )k is a loop variable, O k,2 represents the kth

[0035] The value of the second column of the row.

[0036] Furthermore, the regression coefficient θ is:

[0037] θ=θ1 / θ2,

[0038] in

[0039] Furthermore, the X rest.1 The corresponding block size M rest.1 for:

[0040] M rest.j =θT min .

[0041] Furthermore, step S6 includes determining X rest Have all the sub-datasets in the X been processed? If so, the total time consumed to process the large-scale dataset X is obtained. If not, repeat step S5.

[0042] Compared with the prior art, the beneficial effects are:

[0043] The present invention provides a dynamic data segmentation method based on local weighted linear regression for Dask cluster. By dividing a large data set into two sub-data sets, all processed sub-data sets are obtained, and a local weighted linear regression algorithm is used to more accurately and dynamically estimate the block size corresponding to each remaining sub-data set to be processed online, thereby avoiding high dependence on manual experience and time-consuming and labor-intensive offline training, being able to better adapt to changes in data sets, parallel applications and cluster environments, and improving the efficiency of processing large-scale data sets in Dask clusters to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flow chart of a dynamic data partitioning method based on local weighted linear regression for Dask clusters;

[0045] Figure 2 It is a schematic diagram of dynamic data partitioning based on local weighted linear regression for Dask cluster;

[0046] Figure 3 This is a performance comparison chart of processing a large-scale dataset in a Dask cluster using two different data partitioning methods and three different parallel applications. DETAILED DESCRIPTION

[0047] The present invention is further described below in conjunction with specific implementation methods, wherein the accompanying drawings are only used for exemplary descriptions and represent only schematic diagrams rather than actual drawings, and should not be understood as limitations on this patent; in order to better illustrate the embodiments of the present invention, some parts of the accompanying drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the accompanying drawings may be omitted.

[0048] Example 1

[0049] In the dynamic data partitioning method based on local weighted linear regression for Dask cluster, the large-scale dataset is defined as X, and the sub-dataset set for block size optimization is defined as X profiling , the remaining sub-datasets to be processed are X rest , the number of sub-datasets in X is N, X profiling The number of neutron data sets is n, X rest The number of neutron data sets is m, X profiling The i-th sub-dataset is X profiling.i , X rest The jth sub-dataset is X rest.j , the initial block size is M init , X profiling The block size M corresponding to the i-th sub-dataset in profiling.i , X rest The block size M corresponding to the jth sub-dataset in rest.j , process X profiling The time consumed by the i-th sub-dataset is T profiling.i , process X rest The time consumed by the jth sub-dataset is T rest.i , the total time consumed to process X is T total .

[0050] The following steps are involved:

[0051] S1. Divide the large-scale dataset X into N sub-datasets, and then divide the N sub-datasets into n sub-dataset sets X for block size optimization. profiling =(X profiling.1 ,X profiling.2 ,...,X profiling.i ,...,X profiling.n ) and m remaining sub-dataset sets X rest =(Xrest.1 ,X rest.2 ,...,X rest.j ,...,X rest.m ), where 1≤i≤n, 1≤j≤m, N=n+m, X=X profiling ∪X rest and

[0052] S2. Set the optimal sub-dataset set X profiling The block size corresponding to each sub-dataset in

[0053] S21. Determine an initial block size M init ;

[0054] S22. According to the initial block size M init and the block size change d, calculate X profiling The block size corresponding to each sub-dataset in .

[0055] S3. Processing X profiling Subdatasets in

[0056] From X profiling Read the i-th sub-dataset X profiling.i And in the specified block size M profiling.i X profiling.i The application is then divided into chunks and executed in parallel on the Dask cluster for X profiling.i Process and obtain the time T it takes profiling.i , and finally M profiling.i and T profiling.i Add observation matrix O N×2 middle.

[0057] S4..Processing X rest The first subdataset in

[0058] S41. Obtain the minimum time T corresponding to all processed sub-data sets from the observation matrix min , calculate the regression coefficient θ of the local weighted linear regression algorithm based on the observation matrix, and use T min and θ to estimate X rest.1 The corresponding block size M rest.1 , and press M rest.1 X rest.1 Divide into blocks;

[0059] S42. Execute parallel applications on a Dask cluster rest.1 Process and obtain the time T it takes rest.1 , M rest.1 and T rest.1 Add to the observation matrix;

[0060] S5. Repeat step S4 to calculate the block size M of the next word data set rest.1 and the time taken T rest.1 ;

[0061] S6. Judge X rest Have all the sub-datasets in been processed? If so, the total time consumed to process the large-scale dataset X is obtained. If not, repeat step 5.

[0062] Example 2

[0063] This embodiment provides a specific algorithm according to the method described in Embodiment 1, and the specific steps include:

[0064]

[0065]

[0066] The “←” is a notation used in the algorithm, which is equivalent to “=”.

[0067] Example 3

[0068] This implementation performs static and dynamic calculations on a data set based on the algorithm described in Example 2, wherein the hardware environment used is:

[0069]

[0070] The software environment is:

[0071]

[0072] (1) Static calculation

[0073] A dataset of size 8.7GB is divided into n blocks and then processed simultaneously using a parallel application.

[0074] (2) Dynamic calculation

[0075] Divide a 8.7GB dataset into m sub-datasets, and divide the m sub-datasets into X in sequence according to the ratio of 2:8. profiling and X rest , for X profiling Each sub-dataset is divided into blocks, with an initial block size of M init , block size change d, Gaussian kernel parameter σ, residual X rest The number of blocks in the neutron data set is dynamically selected by the program, and then the m sub-data sets are processed sequentially using a parallel application.

[0076] The parameters of the specific block settings in the dynamic are as follows

[0077] m <![CDATA[M init ]]> d σ K-Means 100 10000 1000 0.26 DBSCAN 100 2000 50 0.25 Spectral Custering 100 1000 50 2.00

[0078] The static and dynamic calculations were performed using K-Means, DBSCAN, and Spectral Custering respectively. The running times are shown in the following table:

[0079] Static dynamic K-Means 2103.95s 2015.64s DBSCAN 4480.41s 4217.33s Spectral Custering 30746.53s 27518.99s

[0080] From the above table and Figure 3 It can be seen that the method of the present invention can improve the efficiency of processing large-scale data sets when processing data in parallel.

[0081] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A dynamic data partitioning method based on local weighted linear regression for Dask cluster, characterized in that the steps include: S1. Divide the large-scale dataset X into N sub-datasets, and then divide the N sub-datasets into sub-dataset sets X for block size optimization. profiling and the remaining sub-dataset set X to be processed rest ; S2. Set the optimal sub-dataset set X profiling The block size corresponding to each sub-dataset in; S3. Processing X profiling Subdatasets in From X profiling Read the i-th sub-dataset X profiling.i And in the specified block size M profiling.i X profiling.i We can then divide the application into chunks and execute them in parallel on the Dask cluster. profiling.i Process and obtain the time T it takes profiling.i , and finally M profiling.i and T profiling.i Add observation matrix O N×2 , where 1≤i≤n; S4..Processing X rest The first subdataset in S41. Obtain the minimum time T corresponding to all processed sub-data sets from the observation matrix min , calculate the regression coefficient θ of the local weighted linear regression algorithm based on the observation matrix, and use T min and θ to estimate X rest.1 The corresponding block size M rest.1 , and press M rest.1 X rest.1 Divide into blocks; S42. Execute parallel applications on a Dask cluster rest.1 Process and obtain the time T it takes rest.1 , M rest.1 and T rest.1 Add to the observation matrix, that is, use M rest.1 and T rest.1 Replace the two values ​​in row n+1 of the matrix; S5. Repeat step S4 to calculate X rest The block size and time consumed by the next sub-dataset of the observation matrix are added to the block size and time consumed by the observation matrix; S6. Calculate X rest All sub-datasets in the dataset are obtained to obtain the total time consumed in processing the large-scale dataset X.

2. The dynamic data partitioning method based on local weighted linear regression for Dask cluster according to claim 1 is characterized in that: Sub-dataset set X for block size optimization profiling The number n and the remaining sub-dataset set to be processed is X rest The ratio of the number m is 2:

8.

3. The dynamic data partitioning method based on local weighted linear regression for Dask cluster according to claim 1 is characterized in that: The large-scale dataset X and the sub-dataset set for block size optimization are X profiling And the remaining sub-datasets to be processed are X rest The relationship is X = X profiling UX rest and 4. The dynamic data partitioning method based on local weighted linear regression for Dask cluster according to claim 1 is characterized in that: The step of setting the block size in step S2 includes: S21. Determine an initial block size M init ; S22. According to the initial block size M init and the block size change d, calculate X profiling The block size corresponding to each sub-dataset in .

5. The dynamic data partitioning method based on local weighted linear regression for Dask cluster according to claim 4 is characterized in that: S2 medium block size M profiling.i for:

6. The dynamic data partitioning method based on local weighted linear regression for Dask cluster according to claim 1, characterized in that: The observation matrix O N×2 for: Where N is the row, N=n+m.

7. The dynamic data partitioning method based on local weighted linear regression for Dask cluster according to claim 1, characterized in that: The weight w of the local weighted linear regression algorithm k The calculation formula is: w k =exp((T min -O k,2 ) 2 / (-2σ 2 )),(1≤k≤n+j-1) Among them, T min =min(O 1,2 ,O 2,2 ,K,O n+j-1,2 ), k is a loop variable, O k,2 Represents the value of the kth row and 2nd column of the matrix.

8. The dynamic data partitioning method based on local weighted linear regression for Dask cluster according to claim 1, characterized in that: The regression coefficient θ is: θ=θ1 / θ2, in 9. The dynamic data partitioning method based on local weighted linear regression for Dask cluster according to claim 1, characterized in that: The X rest.1 The corresponding block size M rest.1 for: M rest.j =θT min 。 10. The dynamic data partitioning method based on local weighted linear regression for Dask cluster according to claim 1, characterized in that: Step S6 includes determining X rest Have all the sub-datasets in the X been processed? If so, the total time consumed to process the large-scale dataset X is obtained. If not, repeat step 5.

Citation Information

Patent Citations

  • Big data parallel computing method and device

    CN105808339A

  • Parallelization techniques for variable selection and predictive models generation and its applications

    EP3258388A1