Horizontal data partitioning method and system for cloud data analysis scene

By generalizing historical query loads and combining axis-vertical hyperplane cutting and sorted bisection cutting, the problem that partitioning schemes in the existing technology cannot adapt to future loads and evaluation overheads is solved, and data skipping efficiency and the accuracy of partitioning decisions are improved.

CN118585585APending Publication Date: 2024-09-03HUAZHONG UNIV OF SCI & TECH +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410726943.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Existing horizontal data partitioning methods cannot effectively take into account the similarities and differences between future and historical query loads, making it difficult to accurately evaluate load overhead, resulting in poor partitioning decisions and inefficient data skipping.

Method used

By obtaining the historical range query set, recording the query interval and frequency, using the DBSCAN clustering algorithm to generalize the query pattern, combining axis vertical hyperplane cutting and sorted bisection cutting, the partitioning strategy is optimized to adapt to future loads.

Benefits of technology

It implements a more flexible partitioning scheme to adapt to future loads, accurately evaluates query overhead, improves data skipping efficiency, and enhances the robustness of partitioning methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585585A
    Figure CN118585585A
Patent Text Reader

Abstract

The invention discloses a horizontal data partitioning method for a cloud data analysis scene, which adaptively identifies a hotspot query interval of a historical query load in each attribute, a local query mode and an outlier query interval, so that the historical query load is flexibly generalized, and the data partitioning efficiency is improved. The similarity and the difference between a future query load and a historical query load are considered; according to the method, a probability-based cost model is designed, the expenditure of a generalization query load is accurately evaluated, and the correlation among data attributes is considered, so that the earnings of partitioning actions are more accurately quantified, and the partitioning decision is optimized; a two-stage horizontal partitioning method based on a probability cost model is designed, firstly, axis vertical hyperplane cutting is used, so that a partitioning scheme aligns a generalization query load as fine as possible, and the data skipping efficiency is ensured; in order to solve the problem of tilt data failure of the axis vertical hyperplane cutting surface, sorting bisection cutting is designed as supplement, and the data skipping efficiency is further improved while the robustness of the partitioning method is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer data storage, and more specifically, to a horizontal data partitioning method and system for cloud data analysis scenarios. Background Art

[0002] In the era of big data, cloud-based data analysis services are widely used due to their high cost-effectiveness and ease of use. Under this storage-computing separation architecture, data access and transmission often become the performance bottleneck of the system. In order to reduce the access and transmission of irrelevant data, cloud-based data analysis systems partition data horizontally and maintain lightweight metadata Zone Maps for each partition. Combined with predicate push-down technology, they skip query-irrelevant partitions, reduce data access and transmission, and thus reduce the data processing overhead of computing nodes, improving query performance while reducing resource consumption. However, the data skipping efficiency of metadata depends on the degree of alignment between horizontal data partitions and query loads.

[0003] In order to maximize the data skipping efficiency, the existing horizontal data partitioning method guides the partitioning strategy by sensing data characteristics and load characteristics; compared with the traditional coarse-grained and static partitioning strategy, the data skipping efficiency of the existing horizontal data partitioning method has been greatly improved.

[0004] However, the existing horizontal data partitioning method still has some non-negligible defects: First, since it does not take into account the similarities and differences between future query loads and historical query loads, the partitioning scheme cannot adapt well to future query loads; second, it is difficult to accurately evaluate the query overhead of the load, which will affect the partitioning decision; third, it cannot simultaneously achieve fine-grained alignment of query loads and deal with skewed data, resulting in its data skipping efficiency is not very ideal. Summary of the invention

[0005] In response to the above defects or improvement needs of the prior art, the present invention provides a horizontal data partitioning method and system for cloud data analysis scenarios, which aims to solve the technical problems of the existing horizontal data partitioning method, namely, that the partitioning scheme cannot adapt well to the future query load because it does not take into account the similarities and differences between the future query load and the historical query load, and that it is difficult to accurately evaluate the query overhead of the load, thus affecting the partitioning decision, and that the data skipping efficiency is not very ideal because it cannot simultaneously achieve fine-grained alignment of query loads and deal with skewed data.

[0006] To achieve the above object, according to one aspect of the present invention, a horizontal data partitioning method for cloud data analysis scenarios is provided, comprising the following steps:

[0007] (1) Obtain the historical range query set QH , and obtain the historical range query set Q H The query interval of each attribute in the pre-established data table, as well as the frequency of occurrence of the query interval, and the historical range query set Q H The range query of the “≤” type in the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the first dictionary leDict, and the historical range query set Q H The range query of the “≥” type in the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the second dictionary geDict, and the historical range query set Q H In the range query of the "between" type, the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the third dictionary btDict.

[0008] (2) Obtain the historical range query set Q according to the first dictionary leDict obtained in step (1) H A generalized function for range queries of the "≤" type in .

[0009] (3) Obtain the historical range query set Q according to the second dictionary geDict obtained in step (1) H A generalized function for range queries of the "≥" type in .

[0010] (4) Obtain the historical range query set Q according to the third dictionary btDict obtained in step (1) H A generalized function for range queries of type "between" in ;

[0011] (5) Based on the generalized function obtained in steps (2), (3) and (4), the historical range query set Q H Perform generalization to obtain the generalized range query set Q G .

[0012] (6) Based on the generalized range query set Q in step (5) G Perform axis-perpendicular hyperplane cutting processing on the data V to be partitioned in the pre-established data table to obtain a binary tree;

[0013] (7) The binary tree obtained in step (6) is sorted and binary cut according to the range query set after generalization in step (5) to obtain a final binary tree, in which each leaf node corresponds to a horizontal partition.

[0014] Preferably, step (1) comprises the following sub-steps:

[0015] (1-1) Initialize three empty dictionaries, the first dictionary leDict = {}, the second dictionary geDict = {}, the third dictionary btDict = {};

[0016] (1-2) Initialize counters cnt1=0, cnt2=0;

[0017] (1-3) Determine whether cnt1 is equal to the historical range query set Q H If the value is the same as the value of , the process ends, otherwise it goes to step (1-4);

[0018] (1-4) Determine whether cnt2 is equal to the total number of attributes n in the pre-established data table. If yes, proceed to step (1-22); otherwise, proceed to step (1-5);

[0019] (1-5) Obtain the query lower bound ql and query upper bound qm of the cnt2th attribute in the pre-established data table for the cnt1th range query in the historical range query set, and determine whether the query lower bound ql is empty and the query upper bound qm is not empty, or the query lower bound ql is not empty and the query upper bound qm is empty, or both the query lower bound ql and the query lower bound are not empty, or both the query lower bound ql and the query lower bound are empty. If the query lower bound ql is empty and the query upper bound qm is not empty, proceed to step (1-6); if the query lower bound ql is not empty and the query upper bound qm is empty, proceed to step (1-11); if both the query lower bound ql and the query upper bound qm are not empty, proceed to step (1-16); if both the query lower bound ql and the query upper bound qm are empty, proceed to step (1-21);

[0020] (1-6) Determine whether the key cnt2 exists in the first dictionary leDict. If so, proceed to step (1-8); otherwise, proceed to step (1-7);

[0021] (1-7) Add the key-value pair with key cnt2 and value {} of the empty dictionary to the first dictionary leDict;

[0022] (1-8) Determine whether the key qm exists in the dictionary corresponding to the key cnt2 in the first dictionary leDict. If so, proceed to step (1-10); otherwise, proceed to step (1-9);

[0023] (1-9) Add the key-value pair whose key is qm and whose value is an array of length 1, and whose only element value in the array is 0, to the dictionary corresponding to the key cnt2 in the first dictionary leDict;

[0024] (1-10) Increase the 0th element in the value (array type) corresponding to the key qm in the dictionary of the key cnt2 in the first dictionary leDict by 1, and go to step (1-21);

[0025] (1-11) Determine whether the key cnt2 exists in the second dictionary geDict. If so, proceed to step (1-13); otherwise, proceed to step (1-12);

[0026] (1-12) Add the key-value pair with key cnt2 and value {} of the empty dictionary to the second dictionary geDict;

[0027] (1-13) Determine whether the key ql exists in the dictionary corresponding to the key cnt2 in the second dictionary geDict. If yes, proceed to step (1-15); otherwise, proceed to step (1-14);

[0028] (1-14) Add the key-value pair whose key is ql and whose value is an array of length 1 and whose only element value is 0 to the dictionary corresponding to the key cnt2 in the second dictionary geDict;

[0029] (1-15) Increase the 0th element in the value (array type) corresponding to the key ql in the dictionary corresponding to the key cnt2 in the second dictionary geDict by 1, and go to step (1-21);

[0030] (1-16) Determine whether the key cnt2 exists in btDict. If so, proceed to step (1-18), otherwise proceed to step (1-17);

[0031] (1-17) Add the key-value pair with key cnt2 and value {} of the empty dictionary to the third dictionary btDict;

[0032] (1-18) Determine whether the key (ql, qm) exists in the dictionary corresponding to the key cnt2 in the third dictionary btDict. If yes, proceed to step (1-20); otherwise, proceed to step (1-19);

[0033] (1-19) Add the key (ql, qm), the value is an array of length 1, and the only element value in the array is 0 to the dictionary corresponding to the key cnt2 in the third dictionary btDict;

[0034] (1-20) Increase the 0th element in the value (array type) corresponding to the key (ql, qm) in the dictionary corresponding to the key cnt2 in the third dictionary btDict by 1, and go to step (1-21);

[0035] (1-21) Set counter cnt2=cnt2+1, and return to step (1-4);

[0036] (1-22) Set counter cnt1=cnt1+1, counter cnt2=0, and return to step (1-3);

[0037] Preferably, step (2) comprises the following sub-steps:

[0038] (2-1) Initialize counters cnt3=0, cnt4=0;

[0039] (2-2) Determine whether cnt3 is equal to the number of keys in the first dictionary leDict. If so, the process ends, otherwise proceed to step (2-3);

[0040] (2-3) Initialize an empty array xList = [], and get the dictionary corresponding to the value in the cnt3th key-value pair in the first dictionary leDict

[0041] (2-4) Determine whether cnt4 is equal to the dictionary The number of middle keys, if yes, go to step (2-8), otherwise go to step (2-5);

[0042] (2-5) Judgement dictionary Is the 0th element in the array corresponding to the value of the cnt4th key-value pair greater than or equal to the preset threshold H? t If yes, go to step (2-7), otherwise go to step (2-6);

[0043] (2-6) Convert the number into a dictionary The 0th element in the array corresponding to the value of the cnt4th key-value pair is a dictionary. The key of the cnt4th key-value pair is added to the array xList;

[0044] (2-7) Set counter cnt4=cnt4+1, and return to step (2-4);

[0045] (2-8) Use the density-based noise spatial clustering DBSCAN method to cluster the array xList and obtain the clustering result clusterX.

[0046] (2-9) Initialize the array hotRs with a length equal to the number of clusters in the clustering result clusterX, where each element in the array is an array [∞,-∞];

[0047] (2-10) Initialize counter cnt5 = 0;

[0048] (2-11) Determine whether cnt5 is equal to the length of the clustering result clusterX. If so, proceed to step (2-15), otherwise proceed to step (2-12);

[0049] (2-12) Determine whether the cnt5th element clusterX[cnt5] of the clustering result clusterX is equal to -1. If so, proceed to step (2-14); otherwise, proceed to step (2-13);

[0050] (2-13) Update the array corresponding to the clusterX[cnt5]th element of the array hotRs, where the update method of the 0th element is: hotRs[clusterX[cnt5]][0] = min(hotRs[clusterX[cnt5]][0], xList[cnt5]); the update method of the 1st element is: hotRs[clusterX[cnt5]][1] = max(hotRs[clusterX[cnt5]][1], xList[cnt5]);

[0051] (2-14) Set counter cnt5=cnt5+1, and return to step (2-11);

[0052] (2-15) Set counter cnt5 = 0;

[0053] (2-16) Determine whether cnt5 is equal to the length of the clustering result clusterX. If so, proceed to step (2-20), otherwise proceed to step (2-17);

[0054] (2-17) Determine whether there is a cluster result clusterX whose cnt5th element is not equal to -1, and the dictionary The length of the array corresponding to the key of the cnt5th element in the array xList is equal to 1. If so, proceed to step (2-18), otherwise proceed to step (2-19);

[0055] (2-18) Add the 0th and 1st elements in the array corresponding to the clusterX[cnt5]th element of the array hotRs to In the array corresponding to the key of the cnt5th element of the array xList;

[0056] (2-19) Set counter cnt5=cnt5+1, and return to step (2-16);

[0057] (2-20) Set counter cnt3=cnt3+1, set counter cnt4=0, and return to step (2-2);

[0058] Preferably, step (3) comprises the following sub-steps:

[0059] (3-1) Initialize counters cnt6=0, cnt7=0;

[0060] (3-2) Determine whether cnt6 is equal to the number of keys in the second dictionary geDict. If so, the process ends, otherwise proceed to step (3-3);

[0061] (3-3) Initialize an empty array xList1 = [];

[0062] (3-4) Get the dictionary corresponding to the value in the cnt6th key-value pair in the second dictionary geDict Determine whether cnt7 is equal to the dictionary The number of middle keys, if yes, go to step (3-8), otherwise go to step (3-5);

[0063] (3-5) Judgement dictionary Is the 0th element in the array corresponding to the value of the cnt7th key-value pair greater than or equal to the preset threshold H? t , if yes, go to step (3-7), otherwise go to step (3-6);

[0064] (3-6) Convert the number into a dictionary The value of the cnt7th key-value pair in the array corresponds to the 0th element, whose value is a dictionary. The key of the cnt7th key-value pair is added to the array xList1;

[0065] (3-7) Set counter cnt7=cnt7+1, and return to step (3-4);

[0066] (3-8) Use the DBSCAN clustering method to cluster the array xList1 and obtain the clustering result clusterX1.

[0067] (3-9) Initialize the array hotRs1 with a length equal to the number of clusters in the clustering result clusterX1, where each element is an array [∞,-∞];

[0068] (3-10) Initialize counter cnt8 = 0;

[0069] (3-11) Determine whether cnt8 is equal to the length of the clustering result clusterX1. If yes, proceed to step (3-15); otherwise, proceed to step (3-12);

[0070] (3-12) Determine whether the cnt8th element clusterX1[cnt8] of the clustering result clusterX1 is equal to -1. If not, proceed to step (3-13), otherwise proceed to step (3-14);

[0071] (3-13) Update the array corresponding to the clusterX1[cnt8]th element of hotRs1, where the update method of the 0th element is: hotRs1[clusterX1[cnt8]][0] = min(hotRs1[clusterX1[cnt8]][0], xList1[cnt8]); the update method of the 1st element is: hotRs1[clusterX1[cnt8]][1] = max(hotRs1[clusterX1[cnt8]][1], xList1[cnt8]);

[0072] (3-14) Set counter cnt8=cnt8+1, and return to step (3-11);

[0073] (3-15) Set counter cnt8 = 0;

[0074] (3-16) Determine whether cnt8 is equal to the length of the clustering result clusterX1. If so, proceed to step (3-20), otherwise proceed to step (3-17);

[0075] (3-17) Determine whether there is a cluster result clusterX1 whose cnt8th element is not equal to -1, and The length of the array corresponding to the key of the cnt8th element in the array xList1 is equal to 1. If so, proceed to step (3-18), otherwise proceed to step (3-19);

[0076] (3-18) Add the 0th and 1st elements in the array corresponding to the clusterX1[cnt8]th element of the array hotRs1 to the dictionary In the array corresponding to the key of the cnt8th element of array xList1;

[0077] (3-19) Set counter cnt8=cnt8+1, and return to step (3-16);

[0078] (3-20) Set counter cnt6=cnt6+1, set counter cnt7=0, and return to step (3-2);

[0079] Preferably, step (4) comprises the following sub-steps:

[0080] (4-1) Initialize counter cnt9=0, cnta=0;

[0081] (4-2) Determine whether cnt9 is equal to the number of keys in the third dictionary btDict. If so, the process ends, otherwise proceed to step (4-3);

[0082] (4-3) Initialize an empty array sList = [], an empty array xyList = [];

[0083] (4-4) Get the dictionary corresponding to the value of the cnt9th key-value pair in the third dictionary btDict Determine whether cnta is equal to the dictionary The number of middle keys, if yes, go to step (4-8), otherwise go to step (4-5);

[0084] (4-5) Judgement dictionary Is the 0th element in the array corresponding to the median value of the cntath key-value pair greater than or equal to the preset threshold H? t , if yes, go to step (4-7), otherwise go to step (4-6);

[0085] (4-6) Get dictionary For the cntath key-value pair, assuming the key and value are tk and tv respectively, add tv[0]tk[1]-tk[0] to the array sList, and add tv[0]tk to the array xyList;

[0086] (4-7) Set counter cnta=cnta+1 and return to step (4-5);

[0087] (4-8) Use the DBSCAN clustering method to cluster the array sList and obtain the clustering result clusterLen.

[0088] (4-9) Initialize the arrays cxList and cxyList with a length equal to the number of clusters in the clustering result clusterLen, and each element in the array is an empty array. Initialize the array csList with a length equal to the number of clusters in the clustering result clusterLen, and each element in the array is -∞;

[0089] (4-10) Initialize counter cntb = 0;

[0090] (4-11) Determine whether cntb is equal to the length of the clustering result clusterLen. If so, proceed to step (4-16), otherwise proceed to step (4-12);

[0091] (4-12) Determine whether the cntb-th element clusterLen[cntb] of the clustering result clusterLen is equal to -1. If so, proceed to step (4-15), otherwise proceed to step (4-13);

[0092] (4-13) Add xyList[cntb][0] to the array corresponding to the clusterLen[cntb]th element in the array cxList, and add xyList[cntb] to the array corresponding to the clusterLen[cntb]th element in the array cxyList;

[0093] (4-14) Update the clusterLen[cntb]th element of the array csList, and the updating method is: csList[clusterLen[cntb]] = max(csList[clusterLen[cntb]], sList[cntb]);

[0094] (4-15) Set counter cntb=cntb+1 and return to step (4-11);

[0095] (4-16) Set counter cntc=0;

[0096] (4-17) Determine whether cntc is equal to the length of the array cxList. If so, proceed to step (4-31), otherwise proceed to step (4-18);

[0097] (4-18) Use the DBSCAN clustering method to cluster the array cxList[cntc] corresponding to the cntc-th element of the array cxList to obtain the clustering result clusterX2.

[0098] (4-19) Initialize the array hotRs2 with a length equal to the number of clusters in the clustering result clusterX2, and each element in the array is an array [∞,-∞];

[0099] (4-20) Set counter cntd = 0;

[0100] (4-21) Determine whether cntd is equal to the length of the clustering result clusterX2. If so, proceed to step (4-25), otherwise proceed to step (4-22);

[0101] (4-22) Determine whether the cntd-th element clusterX2[cntd] of the clustering result clusterX2 is equal to -1. If so, proceed to step (4-24); otherwise, proceed to step (4-23);

[0102] (4-23) Update the array corresponding to the clusterX2[cntd]th element of the array hotRs2. The updating method of the 0th element is: hotRs2[clusterX2[cntd]][0] = min(hotRs2[clusterX2[cntd]][0], cxyList[cntc][cntd][0]); the updating method of the 1st element is: hotRs2[clusterX2[cntd]][1] = max(hotRs2[clusterX2[cntd]][1], cxyList[cntc][cntd][0]);

[0103] (4-24) Set counter cntd=cntd+1 and return to step (4-21);

[0104] (4-25) Set counter cntd = 0;

[0105] (4-26) Determine whether cntd is equal to the length of the clustering result clusterX2. If so, proceed to step (4-30), otherwise proceed to step (4-27);

[0106] (4-27) Determine whether there is a cluster result clusterX2 whose cntdth element is not equal to -1, and the dictionary Is the length of the array cxyList[cntc][cntd] corresponding to the cntd-th element in the array corresponding to the key equal to the cntc-th element in the array cxyList equal to 1? If so, proceed to step (4-28); otherwise, proceed to step (4-29);

[0107] (4-28) Add the 0th and 1st elements in the array corresponding to the clusterX2[cntd]th element of the array hotRs2 to the dictionary In the array corresponding to the key cxyList[cntc][cntd].

[0108] (4-29) Set counter cntd=cntd+1 and return to step (4-26);

[0109] (4-30) Set counter cntc=cntc+1 and return to step (4-17);

[0110] (4-31) Set counter cnt9=cnt9+1, cnta=0, and return to step (4-2);

[0111] Preferably, step (5) comprises the following sub-steps:

[0112] (5-1) Initialize an empty array QG ;

[0113] (5-2) Set counters cnte=0, cntf=0;

[0114] (5-3) Determine whether cnte is equal to the historical range query set Q H If the length is, the process ends, otherwise it goes to step (5-4);

[0115] (5-4) Initialize an empty array q G =[];

[0116] (5-5) Determine whether cntf is equal to the total number of attributes n in the pre-established data table. If so, proceed to step (5-24); otherwise, proceed to step (5-6);

[0117] (5-6) Get the cnteth range query Q in the historical range query set QH H [cnte] The query lower bound Q of the cntfth attribute in the pre-established data table H [cnte][cntf] and query upper bound Q H [cnte][cntf+n], and determine whether there is a query lower bound Q H [cnte][cntf] is empty and query the upper bound Q H [cnte][cntf+n] is not empty, or the lower bound Q is queried H [cnte][cntf] is not empty and query the upper bound Q H [cnte][cntf+n] is empty, or query the lower bound Q H [cnte][cntf] and query upper bound Q H [cnte][cntf+n] are not empty, or query the lower bound Q H [cnte][cntf] and query upper bound Q H [cnte][cntf+n] are both empty. If the lower bound Q is queried, H [cnte][cntf] is empty and query the upper bound Q H [cnte][cntf+n] is not empty, then go to step (5-7); if the query lower bound Q H [cnte][cntf] is not empty and query the upper bound Q H [cnte][cntf+n] is empty, go to step (5-12); if the query lower bound Q H [cnte][cntf] and query upper bound Q H [cnte][cntf+n] are not empty, then go to step (5-17); if the query lower bound Q H[cnte][cntf] and query upper bound Q H If [cnte][cntf+n] are both empty, go to step (5-22);

[0118] (5-7) Get the dictionary key Q corresponding to the key cntf in the first dictionary leDict H [cnte][cntf+n] corresponds to the array leDict[cntf][Q H [cnte][cntf+n]], and determine whether the value of the 0th element in the array is not less than the preset threshold H t If yes, go to step (5-8), otherwise go to step (5-9);

[0119] (5-8)[0,bounds[cntf],Q H [cnte][cntf+n]] adds to array q G In which bounds[cntf] is the lower bound of the domain value of the cntf-th attribute in the pre-established data table, and then proceed to step (5-23);

[0120] (5-9) Judge the array leDict[cntf][Q H Is the length of [cnte][cntf+n]] greater than 1? If so, proceed to step (5-10); otherwise, proceed to step (5-11);

[0121] (5-10)[1,leDict[cntf][Q H [cnte][cntf+n]][1]―E r *(leDict[cntf][Q H [cnte][cntf+n]][2]―leDict[cntf][Q H [cnte][cntf+n]][1]),leDict[cntf][Q H [cnte][cntf+n]][2]+E r *(leDict[cntf][QH[cnte][cntf+n]][2]―leDict[cntf][Q H [cnte][cntf+n]][1])] adds to array q G Among them, E r is the expansion ratio hyperparameter (its value is a number greater than zero, preferably between 0.1 and 0.5), and then proceeds to step (5-23);

[0122] (5-11)[0,bounds[cntf],Q H[cnte][cntf+n]+E r *(Q H [cnte][cntf+n]―bounds[cntf])] is added to the array q G , go to step (5-23);

[0123] (5-12) Get the dictionary key Q in the geDict dictionary whose key is cntf H [cnte][cntf] corresponds to the array geDict[cntf][Q H [cnte][cntf]], if the array geDict[cntf][Q H The value of the 0th element in [cnte][cntf]] is not less than H t , then go to step (5-13), otherwise go to step (5-14);

[0124] (5-13)[0,Q H [cnte][cntf],bounds[cntf+n]] is added to array q G In which bounds[cntf+n] is the upper bound of the domain value of the cntf-th attribute in the pre-established data table, and then proceed to step (5-23);

[0125] (5-14) Judge the array geDict[cntf][Q H Is the length of [cnte][cntf]] greater than 1? If so, proceed to step (5-15); otherwise, proceed to step (5-16);

[0126] (5-15)[2,geDict[cntf][Q H [cnte][cntf]][1]―E r *(geDict[cntf][Q H [cnte][cntf]][2]―geDict[cntf][Q H [cnte][cntf]][1]),geDict[cntf][Q H [cnte][cntf]][2]+E r *(geDict[cntf][Q H [cnte][cntf]][2]―geDict[cntf][Q H [cnte][cntf]][1])] is added to the array q G Then go to step (5-23);

[0127] (5-16)[0,QH [cnte][cntf]―E r *(bounds[cntf+n]―Q H [cnte][cntf]),bounds[cntf+n]] increases to q G Then go to step (5-23);

[0128] (5-17) Get the dictionary key corresponding to the key cntf in the third dictionary btDict (Q H [cnte][cntf],Q H [cnte][cntf+n]) corresponds to the array btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])], if the value of the 0th element in the array is not less than H t , then go to step (5-18), otherwise go to step (5-19);

[0129] (5-18)[0,Q H [cnte][cntf],Q H [cnte][cntf+n]] adds to array q G Then go to step (5-23);

[0130] (5-19) Judge the array btDict[cntf][(Q H [cnte][cntf],Q H Whether the length of [cnte][cntf+n])] is greater than 1, if so, proceed to step (5-20), otherwise proceed to step (5-21);

[0131] (5-20)[3,btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][1],btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][2]―E r *(btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][3]―btDict[cntf][(Q H [cnte][cntf],Q H[cnte][cntf+n])][2]),btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][3]+E r *(btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][3]―btDict[cntf]

[0132] [(Q H [cnte][cntf],Q H [cnte][cntf+n])][2])] adds to array q G , then go to step (5-23);

[0133] (5-21)[0,Q H [cnte][cntf]―E r *(Q H [cnte][cntf+n]―Q H [cnte][cntf]),Q H [cnte][cntf+n]+E r *(Q H [cnte][cntf+n]―Q H [cnte][cntf])] is added to the array q G Then go to step (5-23);

[0134] (5-22) Add [0, bounds[cntf], bounds[cntf+n]] to array q G middle;

[0135] (5-23) Set counter cntf=cntf+1 and return to step (5-5);

[0136] (5-24) Set counter cnte=cnte+1, cntf=0, and set q G Add to array Q G and return to step (5-3);

[0137] Preferably, step (6) comprises the following sub-steps:

[0138] (6-1) Initialize a node Root. Its corresponding record set dataset is the set V consisting of all records in the pre-established data table. Its corresponding generalized query set querySet is the generalized range query set QG ;

[0139] (6-2) Initialize an empty queue candNodes and put the node Root into candNodes;

[0140] (6-3) Determine whether the queue candNodes is empty. If so, the process ends, otherwise proceed to step (6-4);

[0141] (6-4) Take out the first element in the queue candNodes, that is, the node N to be cut;

[0142] (6-5) Initialize an empty array candCuts to record the candidate axis perpendicular hyperplane cutting set;

[0143] (6-6) Initialize counters cntg=0, cnth=0;

[0144] (6-6) Determine whether cntg is equal to the length of the generalized query set N.querySet in the node to be cut N. If so, proceed to step (6-21), otherwise proceed to step (6-7);

[0145] (6-7) Determine whether cnth is equal to the total number of attributes n in the pre-established data table. If so, proceed to step (6-20); otherwise, proceed to step (6-8);

[0146] (6-9) Obtain the cnth element N.querySet[cntg][cnth] of the cntg-th query in the generalized query set of the node to be cut N, and determine whether N.querySet[cntg][cnth][0] is equal to 0, 1, 2, or 3. If it is equal to 0, proceed to step (6-10); if it is equal to 1, proceed to step (6-13); if it is equal to 2, proceed to step (6-10); if it is equal to 3, proceed to step (6-15);

[0147] (6-10) Determine whether N.querySet[cntg][cnth][1] is greater than bounds[cnth]. If so, proceed to step (6-11); otherwise, proceed to step (6-13);

[0148] (6-11) Add (cnth, N.querySet[cntg][cnth][1]) to the array candCuts;

[0149] (6-12) Determine whether N.querySet[cntg][cnth][0] is equal to 2. If so, proceed to step (6-19); otherwise, proceed to step (6-13);

[0150] (6-13) Determine whether N.querySet[cntg][cnth][2] is less than or equal to bounds[cnth+n]. If so, proceed to step (6-14); otherwise, proceed to step (6-19);

[0151] (6-14) Add (cntf, N.querySet[cntg][cnth][2]+MPVS[cnth]) to the array candCuts, where MPVS[cnth] is the minimum precision of the cnth attribute in the pre-established data table, and go to step (6-19);

[0152] (6-15) Determine whether N.querySet[cntg][cnth][2] is greater than bounds[cnth]. If so, proceed to step (6-16); otherwise, proceed to step (6-17);

[0153] (6-16) Add (cntf, N.querySet[cntg][cnth][2]) to the candCuts array;

[0154] (6-17) Determine whether N.querySet[cntg][cnth][3]+N.querySet[cntg][cnth][1] is less than or equal to bounds[cnth+n]. If so, proceed to step (6-18); otherwise, proceed to step (6-19);

[0155] (6-18) Add (cntf, N.querySet[cntg][cnth][3]+N.querySet[cntg][cnth][1]) to the array candCuts;

[0156] (6-19) Set counter cnth=cnth+1, and return to step (6-7);

[0157] (6-20) Set counter cntg=cntg+1, cnth=0, and return to step (6-6);

[0158] (6-21) Set counter cnti = 0, bestCutIndex = -1, bestBenifit = 0;

[0159] (6-22) Determine whether cnti is equal to the length of the array candCuts. If so, proceed to step (6-28), otherwise proceed to step (6-23);

[0160] (6-23) Use the cnti-th element in the array candCuts to cut the candidate axis perpendicular to the hyperplane to divide the record set dataset in node N into two temporary nodes TN l and TN r The number of records in and Zone Maps;

[0161] (6-24) Determine the temporary node TN l and temporary node TN r Whether the number of records contained in the record set in is not less than b, if so, proceed to step (6-25), otherwise proceed to step (6-27);

[0162] (6-25) Calculate the generalized query set N of the node to be cut N.querySet in the node to be cut N and the temporary node TN respectively. l and temporary node TN r The total query cost C(N), C(N l ), C(N r ) and determine whether there is C(N)-C(TN l )-C(TN r ) is greater than bestBenifit, if so, proceed to step (6-26), otherwise proceed to step (6-27);

[0163] (6-26) Set bestCutIndex = cnti, bestBenifit = C(N) - C(TNl) - C(TNr);

[0164] (6-27) Set counter cnti=cnti+1 and return to step (6-22);

[0165] (6-28) Determine whether bestCutIndex is equal to -1, if so, return to step (6-3), otherwise go to step (6-29);

[0166] (6-29) Use the bestCutIndex element in the candCuts array to generate the left child node N by cutting the vertical hyperplane corresponding to the candidate axis. l and right child node N r , where the generalized query set in each child node is equal to the generalized query subset of all generalized queries in the generalized query set in the parent node whose query cost in the child node is greater than 0;

[0167] (6-30) Determine the left child node N of node N l Whether the number of records contained in the record set in is greater than or equal to 2*b, where b is the partition size threshold, then proceed to step (6-31), otherwise proceed to step (6-32);

[0168] (6-31) The left child node N of node N l Add to the queue candNodes;

[0169] (6-32) Determine the right child node N of node N r Is the number of records in greater than or equal to 2*b, where b is the partition size threshold, if yes, go to step (6-33), otherwise go to step (6-34);

[0170] (6-33) The right child node N of node N r Add to the queue candNodes;

[0171] (6-34) Return to step (6-3);

[0172] Preferably, the process of calculating the total query cost cost of the generalized range query set NQ on a certain node in step (6-25) is obtained by the following sub-steps:

[0173] (A1) Initialize counters cntj=0, cntk=0, and total query cost cost=0;

[0174] (A2) Determine whether cntj is equal to the length of the generalized range query set NQ. If so, the process ends; otherwise, proceed to step (A3);

[0175] (A3) Initialize the single query cost to the number of records RN contained in the record set in the node, that is, curCost = RN;

[0176] (A4) determining whether cntk is equal to the total number of attributes n in the pre-established data table, if yes, proceeding to step (A11), otherwise proceeding to step (A5);

[0177] (A5) Obtain the lower bound ZM[cntk] and upper bound ZM[cntk+n] of the domain value of the cntk-th attribute in the pre-established data table of the Zone Maps of the record set in the node, obtain the query type and the query interval after generalization of the cntk-th attribute in the pre-established data table of the cntj-th range query in the generalized range query set NQ, i.e., NQ[cntj][cntk], and determine whether the 0th element value NQ[cntj][cntk][0] in NQ[cntj][cntk] is 0, 1, 2, or 3. If it is 0, proceed to step (A6); if it is 1, proceed to step (A7); if it is 2, proceed to step (A8); if it is 3, proceed to step (A9);

[0178] (A6) Update curCost using the following formula:

[0179] (A7) Update curCost using the following formula:

[0180] (A8) Update curCost using the following formula:

[0181] (A9) Update curCost using the following formula: curCost = curCost*max(min(ZM[cntk+n],NQ[cntj][cntk][3])-max(ZM[cntk]-NQ[cntj][cntk][1],NQ[cntj][cntk][2])+MPVS[cntk],0)÷(NQ[cntj][cntk][3]-NQ[cntj][cntk][2]+MPVS[cntk]);

[0182] (A10) Set counter cntk=cntk+1, and return to step (A4);

[0183] (A11) Set cost=cost+curCost, cntk=0, and return to step (A2);

[0184] Preferably, step (7) comprises the following sub-steps:

[0185] (7-1) Initialize the counter, cntl=0, cntm=0, and initialize an empty queue candNodes1;

[0186] (7-2) Put all leaf nodes of the binary tree generated by cutting the axis perpendicular to the hyperplane into the queue candNodes1;

[0187] (7-3) Determine whether the queue candNodes1 is empty. If so, the process ends, otherwise proceed to step (7-4);

[0188] (7-4) Take out the first element of the queue candNodes1, which is the waiting node N1;

[0189] (7-5) Determine whether the number of records in the node to be cut N1 is not less than 2*b. If so, proceed to step (7-6), otherwise return to step (7-3);

[0190] (7-6) Initialize the colScore array of length n to record the ranking weight of each attribute. The initial value of each element in the array is 0;

[0191] (7-7) Get the minimum, median and maximum values ​​of each attribute of all records in the pre-established data table in node N1, record them in the dictionary colInfo, and get the Zone Maps of node N1 at the same time.

[0192] (7-8) Determine whether cntl is equal to the length of the generalized query set N1.querySet in node N1. If so, proceed to step (7-14), otherwise proceed to step (7-9);

[0193] (7-9) Determine whether cntm is equal to the total number of attributes n in the pre-established data table. If so, proceed to step (7-13); otherwise, proceed to step (7-10);

[0194] (7-10) Calculate the cntlth query in the generalized query set N1.querySet at node N1 and temporary node TN1 l , and temporary node TN1 r The query cost C(N1), C(TN1) on the cntmth attribute of the pre-established data table l ), C(TN1 r ), where TN1 l and TN1 r The number of records in TN1 is half of the number of records in node N1. l The lower bound of the domain value of the cntmth attribute of the pre-established data table in the record set in node N1 is the same as the lower bound of the domain value of the cntmth attribute of the pre-established data table in node N1. l The upper limit of the domain value of the cntmth attribute of the record set in the pre-established data table is the median of the cntmth attribute of the record set in node N1 in the pre-established data table; TN1 r The lower bound of the domain value of the cntmth attribute of the record set in the pre-established data table is the median of the cntmth attribute of the record set in node N1 in the pre-established data table, TN1 r The upper limit of the domain value of the cntm-th attribute of the record set in the pre-established data table is the same as the domain value limit of the cntm-th attribute of the record set in the node N1 in the pre-established data table;

[0195] (7-11) Set the cntmth element of colScore colScore[cntm] = colScore[cntm] + C(N1) - C(TN1 l )-C(TN1r );

[0196] (7-12) Set counter cntm=cntm+1 and return to step (7-9);

[0197] (7-13) Set counter cntl=cntl+1, cntm=0, and return to step (7-8);

[0198] (7-14) Get the index value array sortCols whose values ​​in colScore are greater than 0 and in reverse order;

[0199] (7-15) Determine whether the length of sortCols is 0. If so, return to step (7-3), otherwise go to step (7-16);

[0200] (7-16) Use sortCols to sort node N and generate two child nodes from node N1. The left child node N1 l and right child node N1 r , where the generalized query set in each child node is equal to the generalized query subset of all generalized queries in the generalized query set in the parent node whose query cost in the child node is greater than 0;

[0201] (7-17) Determine the left child node N1 of node N l Whether the number of records contained in the record set in is greater than or equal to 2*b, if so, proceed to step (7-18), otherwise proceed to step (7-19);

[0202] (7-18) The left child node N1 of node N l Add to the queue candNodes1;

[0203] (7-19) Determine the right child node N1 of node N r Whether the number of records contained in the record set in is greater than or equal to 2*b, if so, proceed to step (7-20), otherwise proceed to step (7-21);

[0204] (7-20) The right child node N1 of node N r Add to the queue candNodes1;

[0205] (7-21) Return to step (7-3).

[0206] According to another aspect of the present invention, a horizontal data partitioning system for cloud data analysis scenarios is provided, comprising:

[0207] The first module is used to obtain the historical range query set Q H , and obtain the historical range query set Q HThe query interval of each attribute in the pre-established data table, as well as the frequency of occurrence of the query interval, and the historical range query set Q H The range query of the “≤” type in the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the first dictionary leDict, and the historical range query set Q H The range query of the “≥” type in the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the second dictionary geDict, and the historical range query set Q H In the range query of the "between" type, the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the third dictionary btDict.

[0208] The second module is used to obtain the historical range query set Q according to the first dictionary leDict obtained in the first module H A generalized function for range queries of the "≤" type in .

[0209] The third module is used to obtain the historical range query set Q according to the second dictionary geDict obtained in the first module H A generalized function for range queries of the "≥" type in .

[0210] The fourth module is used to obtain the historical range query set Q according to the third dictionary btDict obtained in the first module H A generalized function for range queries of type "between" in ;

[0211] The fifth module is used to query the historical range set Q according to the generalized function obtained by the first module, the second module and the third module. H Perform generalization to obtain the generalized range query set Q G .

[0212] The sixth module is used to query the range set Q after generalization processing according to the fifth module G Perform axis-perpendicular hyperplane cutting processing on the data V to be partitioned in the pre-established data table to obtain a binary tree;

[0213] The seventh module is used to sort and binary cut the binary tree obtained by the sixth module according to the range query set after generalization processing by the fifth module, so as to obtain the final binary tree, in which each leaf node corresponds to a horizontal partition.

[0214] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:

[0215] (1) The present invention adopts steps (1) to (5), which learns the hot query intervals, query patterns and outlier query intervals in the historical query load based on the DBSCAN clustering algorithm, thereby flexibly generalizing the historical query load, taking into account the similarities and differences between the future query load and the historical query load, so that the partitioning scheme can be well adapted to the future query load;

[0216] (2) The present invention adopts steps (A1) to (A11), which accurately evaluate the total query overhead of the load through a probability-based cost model, thereby accurately quantifying the benefits of partitioning actions and better guiding partitioning decisions;

[0217] (3) The present invention adopts steps (6) to (7), which first uses fine-grained alignment to cut the axis perpendicular to the generalized query load, and on this basis, continues to use sorted binary cutting to deal with skewed data, so that the partitioning scheme has maximized data skipping efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0218] Figure 1 is a flow chart of a horizontal data partitioning method for cloud data analysis scenarios of the present invention;

[0219] Figure 2 It is a schematic diagram of the generalization processing process of the historical range query set in the method of the present invention;

[0220] Figure 3 It is a schematic diagram of the two-stage horizontal data partitioning process in the method of the present invention. DETAILED DESCRIPTION

[0221] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0222] The following first explains and illustrates the technical terms in the present invention:

[0223] Horizontal partitioning: The process of dividing a table into a number of horizontal blocks, each containing a number of records of the table.

[0224] Zone Maps: Records the minimum and maximum values ​​of each attribute in all records within a partition (data block).

[0225] DBSCAN (Density-Based Spatial Clustering of Applications with Noise): A density-based clustering algorithm that includes two key parameters: the radius R and the minimum number of points MinPts. The algorithm considers points with a distance less than R to be adjacent. If the number of adjacent points of a point is not less than MinPts, then the point is a core point. Points adjacent to the core point belong to the same cluster as the core point, and points that do not belong to any cluster are outliers.

[0226] Storage and computing separation: A new data architecture design paradigm, which is divided into data analysis layer, computing layer and storage layer from top to bottom, where the computing layer and storage layer are decoupled and are independent distributed services. Its design goal is to meet three requirements: data can be flexibly opened to different businesses for data analysis, computing and storage can be independently expanded, and computing and storage resources can be isolated, while also providing storage and computing performance equivalent to the storage and computing integrated architecture.

[0227] Predicate: query condition. Common predicates include: greater than >, less than <, greater than or equal to ≥, less than or equal to ≤, between (actually a combination of ≥ and ≤) in range queries, = and in in equality comparisons, and like in fuzzy queries. These common predicates can be reduced to range queries consisting of ≥ and ≤.

[0228] Predicate pushdown: A query optimization technique that moves filter conditions in a query as close to the data source as possible. The filter conditions are often predicates connected by AND and OR operators.

[0229] Historical query load: The historical query set received by the cloud-based data analysis system. Since partition filtering often requires the use of predicate push-down technology, the pushed-down filter conditions can be converted into one or more range queries. Therefore, in the present invention, historical query load refers to the historical range query set, where each element is in the form of [ql0,…,ql n―1 ,qm0,…,qm n―1 ]. Where n represents the number of attributes of the data, ql i and qm i They represent the lower and upper bounds of the query interval for attribute i. If attribute i does not have a lower or upper bound, then ql i or qm i Is a null value.

[0230] Query interval: refers to the filtering condition on a single attribute. For example, if you query between 10 and 20 for attribute i, the query interval is [10, 20].

[0231] Hot query interval: refers to the historical query load, the query interval that frequently appears on a certain attribute;

[0232] Query mode: refers to the length of the filter condition on a single attribute. For example, if you query between 10and20 for attribute i, the query mode is 10.

[0233] Local query patterns: refers to historical query load, frequently occurring query patterns on a certain attribute, and their query starting point range;

[0234] Outlier query interval: refers to the query interval in the historical query load that is neither a hot query interval nor a local query pattern in terms of a certain attribute;

[0235] Generalization function: refers to the generalization method of the query interval of the historical query load on each attribute;

[0236] Axis perpendicular hyperplane cutting: Use the cutting value x on attribute i to split the parent node's record set into two parts. The left child contains a subset of records that are less than x on attribute i; the right child contains a subset of records that are greater than or equal to x on attribute i, expressed as<i,x> .

[0237] Sorting binary cut: sort the record set in the parent node by attribute i, attribute j, ..., and evenly divide the sorted data into two. The left child node contains the first half of the record subset, and the right child node contains the second half of the record subset, which is expressed as<i,j,…> .

[0238] The basic idea of ​​the present invention is to provide a horizontal data partitioning method based on flexible workload generalization (Flexible Workload Generalization based Partition, FWGP for short), design a clustering-based heuristic method to adaptively identify the hot query intervals, local query patterns and outlier query intervals of historical query loads in various attributes, thereby flexibly generalizing the historical query loads and taking into account the similarities and differences between future query loads and historical query loads; design a probability-based cost model to accurately evaluate the overhead of generalized query loads, and consider the correlation between data attributes to more accurately quantify the benefits of partitioning actions, thereby optimizing partitioning decisions; design a two-stage horizontal partitioning method based on a probabilistic cost model, first use axis-perpendicular hyperplane cutting to make the partitioning scheme as fine-grained as possible to align the generalized query load to ensure data skipping efficiency; further, in view of the problem of failure of skewed data faced by axis-perpendicular hyperplane cutting, a sorted binary cutting is designed as a supplement to enhance the robustness of the partitioning method while further improving the data skipping efficiency.

[0239] like Figure 1As shown, the present invention provides a horizontal data partitioning method for cloud data analysis scenarios, including the following steps (1) to (7). The method of the present invention includes a generalization processing process of a historical range query set (such as Figure 2 As shown), it specifically includes the following steps (1) to (5), and a two-stage horizontal data partitioning process (as shown Figure 3 As shown), it specifically includes the following steps (6) to (7).

[0240] (1) Obtain the historical range query set Q H , and obtain the historical range query set Q H The query interval of each attribute in the pre-established data table, as well as the frequency of occurrence of the query interval, and the historical range query set Q H The range query of the “≤” type in the first dictionary leDict records the query interval of each attribute and the frequency of occurrence of the query interval (the format of the record is attribute-query interval-frequency of occurrence), and the historical range query set Q H The range query of the “≥” type in the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the second dictionary geDict (the format of the record is attribute-query interval-frequency of occurrence), and the historical range query set Q H In the range query of the "between" type, the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the third dictionary btDict (the format of the record is attribute-query interval-frequency of occurrence).

[0241] Specifically, this step is to obtain the historical range query set Q from the historical query log of the cloud data analysis service H .

[0242] For example, for the range query where A between 10and 15, the query interval of the A attribute is [10,15], and it appears once. Then it will be recorded in the dictionary btDict: A attribute, query interval [10,15], and the frequency of occurrence plus one.

[0243] For the range query where A between 10and 15and B<=100and C>=20, the query interval for the A attribute is [10,15], the query interval for the B attribute is (-∞,100], and the query interval for the C attribute is [20,∞).

[0244] (2) Obtain the historical range query set Q according to the first dictionary leDict obtained in step (1) H A generalized function for range queries of the "≤" type in ;

[0245] (3) Obtain the historical range query set Q according to the second dictionary geDict obtained in step (1) H A generalized function for range queries of the "≥" type in ;

[0246] (4) Obtain the historical range query set Q according to the third dictionary btDict obtained in step (1) H A generalized function for range queries of type "between" in ;

[0247] It should be noted that the execution order of the above steps (2), (3) and (4) can be arranged arbitrarily and is not limited to the above order of (2)-(3)-(4).

[0248] (5) Based on the generalized function obtained in steps (2), (3) and (4), the historical range query set Q H Perform generalization to obtain the generalized range query set Q G .

[0249] The advantage of the above steps (1) to (5) is that the historical range query set Q is adaptively identified. H In the hot query intervals of each attribute, local query patterns, and outlier query intervals, the historical range query set is flexibly generalized. The generalized range query set better represents the future query load, so that the subsequent partitioning scheme can better adapt to the future query load.

[0250] (6) Based on the generalized range query set Q in step (5) G Perform axis-perpendicular hyperplane cutting processing on the data V to be partitioned in the pre-established data table to obtain a binary tree;

[0251] The advantage of the above step (6) is that it efficiently selects the approximately optimal axis-perpendicular hyperplane cut in each state, so that the obtained binary tree representing the partitioning scheme is better adapted to the range query set after generalization.

[0252] (7) The binary tree obtained in step (6) is sorted and binary cut according to the range query set after generalization in step (5) to obtain a final binary tree, in which each leaf node corresponds to a horizontal partition.

[0253] The advantage of the above step (7) is that it effectively handles the skewed data that fails in step (6), improves the robustness of the partitioning scheme, and further improves the performance of the partitioning scheme.

[0254] Specifically, step (1) includes the following sub-steps:

[0255] (1-1) Initialize three empty dictionaries, the first dictionary leDict = {}, the second dictionary geDict = {}, the third dictionary btDict = {};

[0256] (1-2) Initialize counters cnt1=0, cnt2=0;

[0257] (1-3) Determine whether cnt1 is equal to the historical range query set Q H If the value is the same as the value of , the process ends, otherwise it goes to step (1-4);

[0258] (1-4) Determine whether cnt2 is equal to the total number of attributes n in the pre-established data table. If yes, proceed to step (1-22); otherwise, proceed to step (1-5);

[0259] (1-5) Obtain the query lower bound ql and query upper bound qm of the cnt2th attribute in the pre-established data table for the cnt1th range query in the historical range query set, and determine whether the query lower bound ql is empty and the query upper bound qm is not empty, or the query lower bound ql is not empty and the query upper bound qm is empty, or both the query lower bound ql and the query lower bound are not empty, or both the query lower bound ql and the query lower bound are empty. If the query lower bound ql is empty and the query upper bound qm is not empty, proceed to step (1-6); if the query lower bound ql is not empty and the query upper bound qm is empty, proceed to step (1-11); if both the query lower bound ql and the query upper bound qm are not empty, proceed to step (1-16); if both the query lower bound ql and the query upper bound qm are empty, proceed to step (1-21);

[0260] (1-6) Determine whether the key cnt2 exists in the first dictionary leDict. If so, proceed to step (1-8); otherwise, proceed to step (1-7);

[0261] (1-7) Add the key-value pair with key cnt2 and value {} of the empty dictionary to the first dictionary leDict;

[0262] (1-8) Determine whether the key qm exists in the dictionary corresponding to the key cnt2 in the first dictionary leDict. If so, proceed to step (1-10); otherwise, proceed to step (1-9);

[0263] (1-9) Add the key-value pair whose key is qm and whose value is an array of length 1, and whose only element value in the array is 0, to the dictionary corresponding to the key cnt2 in the first dictionary leDict;

[0264] (1-10) Increase the 0th element in the value (array type) corresponding to the key qm in the dictionary of the key cnt2 in the first dictionary leDict by 1, and go to step (1-21);

[0265] (1-11) Determine whether the key cnt2 exists in the second dictionary geDict. If so, proceed to step (1-13); otherwise, proceed to step (1-12);

[0266] (1-12) Add the key-value pair with key cnt2 and value {} of the empty dictionary to the second dictionary geDict;

[0267] (1-13) Determine whether the key ql exists in the dictionary corresponding to the key cnt2 in the second dictionary geDict. If yes, proceed to step (1-15); otherwise, proceed to step (1-14);

[0268] (1-14) Add the key-value pair whose key is ql and whose value is an array of length 1 and whose only element value is 0 to the dictionary corresponding to the key cnt2 in the second dictionary geDict;

[0269] (1-15) Increase the 0th element in the value (array type) corresponding to the key ql in the dictionary corresponding to the key cnt2 in the second dictionary geDict by 1, and go to step (1-21);

[0270] (1-16) Determine whether the key cnt2 exists in btDict. If so, proceed to step (1-18), otherwise proceed to step (1-17);

[0271] (1-17) Add the key-value pair with key cnt2 and value {} of the empty dictionary to the third dictionary btDict;

[0272] (1-18) Determine whether the key (ql, qm) exists in the dictionary corresponding to the key cnt2 in the third dictionary btDict. If yes, proceed to step (1-20); otherwise, proceed to step (1-19);

[0273] (1-19) Add the key (ql, qm), the value is an array of length 1, and the only element value in the array is 0 to the dictionary corresponding to the key cnt2 in the third dictionary btDict;

[0274] (1-20) Increase the 0th element in the value (array type) corresponding to the key (ql, qm) in the dictionary corresponding to the key cnt2 in the third dictionary btDict by 1, and go to step (1-21);

[0275] (1-21) Set counter cnt2=cnt2+1, and return to step (1-4);

[0276] (1-22) Set counter cnt1=cnt1+1, counter cnt2=0, and return to step (1-3);

[0277] Specifically, step (2) includes the following sub-steps:

[0278] (2-1) Initialize counters cnt3=0, cnt4=0;

[0279] (2-2) Determine whether cnt3 is equal to the number of keys in the first dictionary leDict. If so, the process ends, otherwise proceed to step (2-3);

[0280] (2-3) Initialize an empty array xList = [], and get the dictionary corresponding to the value of the cnt3th key-value pair in the first dictionary leDict

[0281] (2-4) Determine whether cnt4 is equal to the dictionary The number of middle keys, if yes, go to step (2-8), otherwise go to step (2-5);

[0282] (2-5) Judgement dictionary Is the 0th element in the array corresponding to the value of the cnt4th key-value pair greater than or equal to the preset threshold H? t If yes, go to step (2-7), otherwise go to step (2-6);

[0283] Specifically, the preset threshold H t is an integer greater than or equal to zero, and can be set to a smaller value if the similarity between future range queries and historical range queries is considered high; otherwise, it can be set to a larger value.

[0284] (2-6) Convert the number into a dictionary The 0th element in the array corresponding to the value of the cnt4th key-value pair is a dictionary. The key of the cnt4th key-value pair is added to the array xList;

[0285] (2-7) Set counter cnt4=cnt4+1, and return to step (2-4);

[0286] (2-8) Use the density-based spatial clustering of applications with noise (DBSCAN) method to cluster the array xList and obtain the clustering result clusterX.

[0287] (2-9) Initialize the array hotRs with a length equal to the number of clusters in the clustering result clusterX, where each element in the array is an array [∞,-∞];

[0288] (2-10) Initialize counter cnt5 = 0;

[0289] (2-11) Determine whether cnt5 is equal to the length of the clustering result clusterX. If so, proceed to step (2-15), otherwise proceed to step (2-12);

[0290] (2-12) Determine whether the cnt5th element clusterX[cnt5] of the clustering result clusterX is equal to -1. If so, proceed to step (2-14); otherwise, proceed to step (2-13);

[0291] (2-13) Update the array corresponding to the clusterX[cnt5]th element of the array hotRs, where the update method of the 0th element is: hotRs[clusterX[cnt5]][0] = min(hotRs[clusterX[cnt5]][0], xList[cnt5]); the update method of the 1st element is: hotRs[clusterX[cnt5]][1] = max(hotRs[clusterX[cnt5]][1], xList[cnt5]);

[0292] (2-14) Set counter cnt5=cnt5+1, and return to step (2-11);

[0293] (2-15) Set counter cnt5 = 0;

[0294] (2-16) Determine whether cnt5 is equal to the length of the clustering result clusterX. If so, proceed to step (2-20), otherwise proceed to step (2-17);

[0295] (2-17) Determine whether there is a cluster result clusterX whose cnt5th element is not equal to -1, and the dictionary The length of the array corresponding to the key of the cnt5th element in the array xList is equal to 1. If so, proceed to step (2-18), otherwise proceed to step (2-19);

[0296] (2-18) Add the 0th and 1st elements in the array corresponding to the clusterX[cnt5]th element of the array hotRs to In the array corresponding to the key of the cnt5th element of the array xList;

[0297] (2-19) Set counter cnt5=cnt5+1, and return to step (2-16);

[0298] (2-20) Set counter cnt3=cnt3+1, set counter cnt4=0, and return to step (2-2);

[0299] Specifically, step (3) includes the following sub-steps:

[0300] (3-1) Initialize counters cnt6=0, cnt7=0;

[0301] (3-2) Determine whether cnt6 is equal to the number of keys in the second dictionary geDict. If so, the process ends, otherwise proceed to step (3-3);

[0302] (3-3) Initialize an empty array xList1 = [];

[0303] (3-4) Get the dictionary corresponding to the value in the cnt6th key-value pair in the second dictionary geDict Determine whether cnt7 is equal to the dictionary The number of middle keys, if yes, go to step (3-8), otherwise go to step (3-5);

[0304] (3-5) Judgement dictionary Is the 0th element in the array corresponding to the value of the cnt7th key-value pair greater than or equal to the preset threshold H? t , if yes, go to step (3-7), otherwise go to step (3-6);

[0305] (3-6) Convert the number into a dictionary The value of the cnt7th key-value pair in the array corresponds to the 0th element, whose value is a dictionary. The key of the cnt7th key-value pair is added to the array xList1;

[0306] (3-7) Set counter cnt7=cnt7+1, and return to step (3-4);

[0307] (3-8) Use the DBSCAN clustering method to cluster the array xList1 and obtain the clustering result clusterX1.

[0308] (3-9) Initialize the array hotRs1 with a length equal to the number of clusters in the clustering result clusterX1, where each element is an array [∞,-∞];

[0309] (3-10) Initialize counter cnt8 = 0;

[0310] (3-11) Determine whether cnt8 is equal to the length of the clustering result clusterX1. If yes, proceed to step (3-15); otherwise, proceed to step (3-12);

[0311] (3-12) Determine whether the cnt8th element clusterX1[cnt8] of the clustering result clusterX1 is equal to -1. If not, proceed to step (3-13), otherwise proceed to step (3-14);

[0312] (3-13) Update the array corresponding to the clusterX1[cnt8]th element of hotRs1, where the update method of the 0th element is: hotRs1[clusterX1[cnt8]][0] = min(hotRs1[clusterX1[cnt8]][0], xList1[cnt8]); the update method of the 1st element is: hotRs1[clusterX1[cnt8]][1] = max(hotRs1[clusterX1[cnt8]][1], xList1[cnt8]);

[0313] (3-14) Set counter cnt8=cnt8+1, and return to step (3-11);

[0314] (3-15) Set counter cnt8 = 0;

[0315] (3-16) Determine whether cnt8 is equal to the length of the clustering result clusterX1. If so, proceed to step (3-20), otherwise proceed to step (3-17);

[0316] (3-17) Determine whether there is a cluster result clusterX1 whose cnt8th element is not equal to -1, and The length of the array corresponding to the key of the cnt8th element in the array xList1 is equal to 1. If so, proceed to step (3-18), otherwise proceed to step (3-19);

[0317] (3-18) Add the 0th and 1st elements in the array corresponding to the clusterX1[cnt8]th element of the array hotRs1 to the dictionary In the array corresponding to the key of the cnt8th element of array xList1;

[0318] (3-19) Set counter cnt8=cnt8+1, and return to step (3-16);

[0319] (3-20) Set counter cnt6=cnt6+1, set counter cnt7=0, and return to step (3-2);

[0320] Specifically, step (4) includes the following sub-steps:

[0321] (4-1) Initialize counter cnt9=0, cnta=0;

[0322] (4-2) Determine whether cnt9 is equal to the number of keys in the third dictionary btDict. If so, the process ends, otherwise proceed to step (4-3);

[0323] (4-3) Initialize an empty array sList = [], an empty array xyList = [];

[0324] (4-4) Get the dictionary corresponding to the value of the cnt9th key-value pair in the third dictionary btDict Determine whether cnta is equal to the dictionary The number of middle keys, if yes, go to step (4-8), otherwise go to step (4-5);

[0325] (4-5) Judgement dictionary Is the 0th element in the array corresponding to the median value of the cntath key-value pair greater than or equal to the preset threshold H? t , if yes, go to step (4-7), otherwise go to step (4-6);

[0326] (4-6) Get dictionary For the cntath key-value pair, assuming the key and value are tk and tv respectively, add tv[0]tk[1]-tk[0] to the array sList, and add tv[0]tk to the array xyList;

[0327] (4-7) Set counter cnta=cnta+1 and return to step (4-5);

[0328] (4-8) Use the DBSCAN clustering method to cluster the array sList and obtain the clustering result clusterLen.

[0329] (4-9) Initialize the arrays cxList and cxyList with a length equal to the number of clusters in the clustering result clusterLen, and each element in the array is an empty array. Initialize the array csList with a length equal to the number of clusters in the clustering result clusterLen, and each element in the array is -∞;

[0330] (4-10) Initialize counter cntb = 0;

[0331] (4-11) Determine whether cntb is equal to the length of the clustering result clusterLen. If so, proceed to step (4-16), otherwise proceed to step (4-12);

[0332] (4-12) Determine whether the cntb-th element clusterLen[cntb] of the clustering result clusterLen is equal to -1. If so, proceed to step (4-15), otherwise proceed to step (4-13);

[0333] (4-13) Add xyList[cntb][0] to the array corresponding to the clusterLen[cntb]th element in the array cxList, and add xyList[cntb] to the array corresponding to the clusterLen[cntb]th element in the array cxyList;

[0334] (4-14) Update the clusterLen[cntb]th element of the array csList, and the updating method is: csList[clusterLen[cntb]] = max(csList[clusterLen[cntb]], sList[cntb]);

[0335] (4-15) Set counter cntb=cntb+1 and return to step (4-11);

[0336] (4-16) Set counter cntc=0;

[0337] (4-17) Determine whether cntc is equal to the length of the array cxList. If so, proceed to step (4-31), otherwise proceed to step (4-18);

[0338] (4-18) Use the DBSCAN clustering method to cluster the array cxList[cntc] corresponding to the cntc-th element of the array cxList to obtain the clustering result clusterX2.

[0339] (4-19) Initialize the array hotRs2 with a length equal to the number of clusters in the clustering result clusterX2, and each element in the array is an array [∞,-∞];

[0340] (4-20) Set counter cntd = 0;

[0341] (4-21) Determine whether cntd is equal to the length of the clustering result clusterX2. If so, proceed to step (4-25), otherwise proceed to step (4-22);

[0342] (4-22) Determine whether the cntd-th element clusterX2[cntd] of the clustering result clusterX2 is equal to -1. If so, proceed to step (4-24); otherwise, proceed to step (4-23);

[0343] (4-23) Update the array corresponding to the clusterX2[cntd]th element of the array hotRs2. The updating method of the 0th element is: hotRs2[clusterX2[cntd]][0] = min(hotRs2[clusterX2[cntd]][0], cxyList[cntc][cntd][0]); the updating method of the 1st element is: hotRs2[clusterX2[cntd]][1] = max(hotRs2[clusterX2[cntd]][1], cxyList[cntc][cntd][0]);

[0344] (4-24) Set counter cntd=cntd+1 and return to step (4-21);

[0345] (4-25) Set counter cntd = 0;

[0346] (4-26) Determine whether cntd is equal to the length of the clustering result clusterX2. If so, proceed to step (4-30), otherwise proceed to step (4-27);

[0347] (4-27) Determine whether there is a cluster result clusterX2 whose cntdth element is not equal to -1, and the dictionary Is the length of the array cxyList[cntc][cntd] corresponding to the cntd-th element in the array corresponding to the key equal to the cntc-th element in the array cxyList equal to 1? If so, proceed to step (4-28); otherwise, proceed to step (4-29);

[0348] (4-28) Add the 0th and 1st elements in the array corresponding to the clusterX2[cntd]th element of the array hotRs2 to the dictionary In the array corresponding to the key cxyList[cntc][cntd].

[0349] (4-29) Set counter cntd=cntd+1 and return to step (4-26);

[0350] (4-30) Set counter cntc=cntc+1 and return to step (4-17);

[0351] (4-31) Set counter cnt9=cnt9+1, cnta=0, and return to step (4-2);

[0352] Specifically, step (5) includes the following sub-steps:

[0353] (5-1) Initialize an empty array QG ;

[0354] (5-2) Set counters cnte=0, cntf=0;

[0355] (5-3) Determine whether cnte is equal to the historical range query set Q H If the length is, the process ends, otherwise it goes to step (5-4);

[0356] (5-4) Initialize an empty array q G =[];

[0357] (5-5) Determine whether cntf is equal to the total number of attributes n in the pre-established data table. If so, proceed to step (5-24); otherwise, proceed to step (5-6);

[0358] (5-6) Get the cnteth range query Q in the historical range query set QH H [cnte] The query lower bound Q of the cntfth attribute in the pre-established data table H [cnte][cntf] and query upper bound Q H [cnte][cntf+n], and determine whether there is a query lower bound Q H [cnte][cntf] is empty and query the upper bound Q H [cnte][cntf+n] is not empty, or the lower bound Q is queried H [cnte][cntf] is not empty and query the upper bound Q H [cnte][cntf+n] is empty, or query the lower bound Q H [cnte][cntf] and query upper bound Q H [cnte][cntf+n] are not empty, or query the lower bound Q H [cnte][cntf] and query upper bound Q H [cnte][cntf+n] are both empty. If the lower bound Q is queried, H [cnte][cntf] is empty and query the upper bound Q H [cnte][cntf+n] is not empty, then go to step (5-7); if the query lower bound Q H [cnte][cntf] is not empty and query the upper bound Q H [cnte][cntf+n] is empty, go to step (5-12); if the query lower bound Q H [cnte][cntf] and query upper bound Q H [cnte][cntf+n] are not empty, then go to step (5-17); if the query lower bound Q H[cnte][cntf] and query upper bound Q H If [cnte][cntf+n] are both empty, go to step (5-22);

[0359] (5-7) Get the dictionary key Q corresponding to the key cntf in the first dictionary leDict H [cnte][cntf+n] corresponds to the array leDict[cntf][Q H [cnte][cntf+n]], and determine whether the value of the 0th element in the array is not less than the preset threshold H t If yes, go to step (5-8), otherwise go to step (5-9);

[0360] (5-8)[0,bounds[cntf],Q H [cnte][cntf+n]] adds to array q G In which bounds[cntf] is the lower bound of the domain value of the cntf-th attribute in the pre-established data table, and then proceed to step (5-23);

[0361] (5-9) Judge the array leDict[cntf][Q H Is the length of [cnte][cntf+n]] greater than 1? If so, proceed to step (5-10); otherwise, proceed to step (5-11);

[0362] (5-10)[1,leDict[cntf][Q H [cnte][cntf+n]][1]―E r *(leDict[cntf][Q H [cnte][cntf+n]][2]―leDict[cntf][Q H [cnte][cntf+n]][1]),leDict[cntf][Q H [cnte][cntf+n]][2]+E r *(leDict[cntf][Q H [cnte][cntf+n]][2]―leDict[cntf][Q H [cnte][cntf+n]][1])] adds to array q G Among them, E r is the expansion ratio hyperparameter (its value is a number greater than zero, preferably between 0.1 and 0.5), and then proceeds to step (5-23);

[0363] (5-11)[0,bounds[cntf],QH [cnte][cntf+n]+E r *(Q H [cnte][cntf+n]―bounds[cntf])] is added to the array q G , go to step (5-23);

[0364] (5-12) Get the dictionary key Q in the geDict dictionary whose key is cntf H [cnte][cntf] corresponds to the array geDict[cntf][Q H [cnte][cntf]], if the array geDict[cntf][Q H The value of the 0th element in [cnte][cntf]] is not less than H t , then go to step (5-13), otherwise go to step (5-14);

[0365] (5-13)[0,Q H [cnte][cntf],bounds[cntf+n]] is added to array q G In which bounds[cntf+n] is the upper bound of the domain value of the cntf-th attribute in the pre-established data table, and then proceed to step (5-23);

[0366] (5-14) Judge the array geDict[cntf][Q H Is the length of [cnte][cntf]] greater than 1? If so, proceed to step (5-15); otherwise, proceed to step (5-16);

[0367] (5-15)[2,geDict[cntf][Q H [cnte][cntf]][1]―E r *(geDict[cntf][Q H [cnte][cntf]][2]―geDict[cntf][Q H [cnte][cntf]][1]),geDict[cntf][Q H [cnte][cntf]][2]+E r *(geDict[cntf][Q H [cnte][cntf]][2]―geDict[cntf][Q H [cnte][cntf]][1])] is added to the array q G Then go to step (5-23);

[0368] (5-16)[0,v[cnte][cntf]―E r *(bounds[cntf+n]―Q H [cnte][cntf]),bounds[cntf+n]] increases to q G Then go to step (5-23);

[0369] (5-17) Get the dictionary key corresponding to the key cntf in the third dictionary btDict (Q H [cnte][cntf],Q H [cnte][cntf+n]) corresponds to the array btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])], if the value of the 0th element in the array is not less than H t , then go to step (5-18), otherwise go to step (5-19);

[0370] (5-18)[0,Q H [cnte][cntf],Q H [cnte][cntf+n]] adds to array q G Then go to step (5-23);

[0371] (5-19) Judge the array btDict[cntf][(Q H [cnte][cntf],Q H Whether the length of [cnte][cntf+n])] is greater than 1, if so, proceed to step (5-20), otherwise proceed to step (5-21);

[0372] (5-20)[3,btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][1],btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][2]―E r *(btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][3]―btDict[cntf][(Q H [cnte][cntf],Q H[cnte][cntf+n])][2]),btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][3]+E r *(btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][3]―btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])][2])] adds to array q G , then go to step (5-23);

[0373] (5-21)[0,Q H [cnte][cntf]―E r *(Q H [cnte][cntf+n]―Q H [cnte][cntf]),Q H [cnte][cntf+n]+E r *(Q H [cnte][cntf+n]―Q H [cnte][cntf])] is added to the array q G Then go to step (5-23);

[0374] (5-22) Add [0, bounds[cntf], bounds[cntf+n]] to array q G middle;

[0375] (5-23) Set counter cntf=cntf+1 and return to step (5-5);

[0376] (5-24) Set counter cnte=cnte+1, cntf=0, and set q G Add to array Q G and return to step (5-3);

[0377] Specifically, step (6) includes the following sub-steps:

[0378] (6-1) Initialize a node Root. Its corresponding record set dataset is the set V consisting of all records in the pre-established data table. Its corresponding generalized query set querySet is the generalized range query set Q G ;

[0379] (6-2) Initialize an empty queue candNodes and put the node Root into candNodes;

[0380] (6-3) Determine whether the queue candNodes is empty. If so, the process ends, otherwise proceed to step (6-4);

[0381] (6-4) Take out the first element in the queue candNodes, that is, the node N to be cut;

[0382] (6-5) Initialize an empty array candCuts to record the candidate axis perpendicular hyperplane cutting set;

[0383] (6-6) Initialize counters cntg=0, cnth=0;

[0384] (6-6) Determine whether cntg is equal to the length of the generalized query set N.querySet in the node to be cut N. If so, proceed to step (6-21), otherwise proceed to step (6-7);

[0385] (6-7) Determine whether cnth is equal to the total number of attributes n in the pre-established data table. If so, proceed to step (6-20); otherwise, proceed to step (6-8);

[0386] (6-9) Obtain the cnth element N.querySet[cntg][cnth] of the cntg-th query in the generalized query set of the node to be cut N, and determine whether N.querySet[cntg][cnth][0] is equal to 0, 1, 2, or 3. If it is equal to 0, proceed to step (6-10); if it is equal to 1, proceed to step (6-13); if it is equal to 2, proceed to step (6-10); if it is equal to 3, proceed to step (6-15);

[0387] (6-10) Determine whether N.querySet[cntg][cnth][1] is greater than bounds[cnth]. If so, proceed to step (6-11); otherwise, proceed to step (6-13);

[0388] (6-11) Add (cnth, N.querySet[cntg][cnth][1]) to the array candCuts;

[0389] (6-12) Determine whether N.querySet[cntg][cnth][0] is equal to 2. If so, proceed to step (6-19); otherwise, proceed to step (6-13);

[0390] (6-13) Determine whether N.querySet[cntg][cnth][2] is less than or equal to bounds[cnth+n]. If so, proceed to step (6-14); otherwise, proceed to step (6-19);

[0391] (6-14) Add (cntf, N.querySet[cntg][cnth][2]+MPVS[cnth]) to the array candCuts, where MPVS[cnth] is the minimum precision of the cnth attribute in the pre-established data table, and go to step (6-19);

[0392] (6-15) Determine whether N.querySet[cntg][cnth][2] is greater than bounds[cnth]. If so, proceed to step (6-16); otherwise, proceed to step (6-17);

[0393] (6-16) Add (cntf, N.querySet[cntg][cnth][2]) to the candCuts array;

[0394] (6-17) Determine whether N.querySet[cntg][cnth][3]+N.querySet[cntg][cnth][1] is less than or equal to bounds[cnth+n]. If so, proceed to step (6-18); otherwise, proceed to step (6-19);

[0395] (6-18) Add (cntf, N.querySet[cntg][cnth][3]+N.querySet[cntg][cnth][1]) to the array candCuts;

[0396] (6-19) Set counter cnth=cnth+1, and return to step (6-7);

[0397] (6-20) Set counter cntg=cntg+1, cnth=0, and return to step (6-6);

[0398] (6-21) Set counter cnti = 0, bestCutIndex = -1, bestBenifit = 0;

[0399] (6-22) Determine whether cnti is equal to the length of the array candCuts. If so, proceed to step (6-28), otherwise proceed to step (6-23);

[0400] (6-23) Use the cnti-th element in the array candCuts to cut the candidate axis perpendicular to the hyperplane to divide the record set dataset in node N into two temporary nodes TN l and TN r The number of records in and Zone Maps;

[0401] (6-24) Determine the temporary node TN l and temporary node TN r Whether the number of records contained in the record set in is not less than b, if so, proceed to step (6-25), otherwise proceed to step (6-27);

[0402] (6-25) Calculate the generalized query set N of the node to be cut N.querySet in the node to be cut N and the temporary node TN respectively. l and temporary node TN r The total query cost C(N), C(N l ), C(N r ) and determine whether there is C(N)-C(TN l )-C(TN r ) is greater than bestBenifit, if so, proceed to step (6-26), otherwise proceed to step (6-27);

[0403] (6-26) Set bestCutIndex = cnti, bestBenifit = C(N)-C(TN l )-C(TN r );

[0404] (6-27) Set counter cnti=cnti+1 and return to step (6-22);

[0405] (6-28) Determine whether bestCutIndex is equal to -1, if so, return to step (6-3), otherwise go to step (6-29);

[0406] (6-29) Use the bestCutIndex element in the candCuts array to generate the left child node N by cutting the vertical hyperplane corresponding to the candidate axis. l and right child node N r , where the generalized query set in each child node is equal to the generalized query subset of all generalized queries in the generalized query set in the parent node whose query cost in the child node is greater than 0;

[0407] (6-30) Determine the left child node N of node N lWhether the number of records contained in the record set in is greater than or equal to 2*b, where b is the partition size threshold, then proceed to step (6-31), otherwise proceed to step (6-32);

[0408] (6-31) The left child node N of node N l Add to the queue candNodes;

[0409] (6-32) Determine the right child node N of node N r Is the number of records in greater than or equal to 2*b, where b is the partition size threshold, if yes, go to step (6-33), otherwise go to step (6-34);

[0410] (6-33) The right child node N of node N r Add to the queue candNodes;

[0411] (6-34) Return to step (6-3);

[0412] In step (6-25), the total query cost cost of the generalized range query set NQ on a certain node is calculated by the following sub-steps:

[0413] (A1) Initialize counters cntj=0, cntk=0, and total query cost cost=0;

[0414] (A2) Determine whether cntj is equal to the length of the generalized range query set NQ. If so, the process ends; otherwise, proceed to step (A3);

[0415] (A3) Initialize the single query cost to the number of records RN contained in the record set in the node, that is, curCost = RN;

[0416] (A4) determining whether cntk is equal to the total number of attributes n in the pre-established data table, if yes, proceeding to step (A11), otherwise proceeding to step (A5);

[0417] (A5) Obtain the lower bound ZM[cntk] and upper bound ZM[cntk+n] of the domain value of the cntk-th attribute in the pre-established data table of the Zone Maps of the record set in the node, obtain the query type and the query interval after generalization of the cntk-th attribute in the pre-established data table of the cntj-th range query in the generalized range query set NQ, i.e., NQ[cntj][cntk], and determine whether the 0th element value NQ[cntj][cntk][0] in NQ[cntj][cntk] is 0, 1, 2, or 3. If it is 0, proceed to step (A6); if it is 1, proceed to step (A7); if it is 2, proceed to step (A8); if it is 3, proceed to step (A9);

[0418] (A6) Update curCost using the following formula:

[0419] (A7) Update curCost using the following formula:

[0420] (A8) Update curCost using the following formula:

[0421] (A9) Update curCost using the following formula: curCost = curCost*max(min(ZM[cntk+n],NQ[cntj][cntk][3])-max(ZM[cntk]-NQ[cntj][cntk][1],NQ[cntj][cntk][2])+MPVS[cntk],0)÷(NQ[cntj][cntk][3]-NQ[cntj][cntk][2]+MPVS[cntk]);

[0422] (A10) Set counter cntk=cntk+1, and return to step (A4);

[0423] (A11) Set cost=cost+curCost, cntk=0, and return to step (A2);

[0424] The advantage of the above sub-steps (A1) to (A11) is that the total query cost of the generalized range query set can be efficiently calculated, guiding the selection of a better cutting strategy.

[0425] Specifically, step (7) includes the following sub-steps:

[0426] (7-1) Initialize the counter, cntl=0, cntm=0, and initialize an empty queue candNodes1;

[0427] (7-2) Put all leaf nodes of the binary tree generated by cutting the axis perpendicular to the hyperplane into the queue candNodes1;

[0428] (7-3) Determine whether the queue candNodes1 is empty. If so, the process ends, otherwise proceed to step (7-4);

[0429] (7-4) Take out the first element of the queue candNodes1, which is the waiting node N1;

[0430] (7-5) Determine whether the number of records in the node to be cut N1 is not less than 2*b. If so, proceed to step (7-6), otherwise return to step (7-3);

[0431] (7-6) Initialize the colScore array of length n to record the ranking weight of each attribute. The initial value of each element in the array is 0;

[0432] (7-7) Get the minimum, median and maximum values ​​of each attribute of all records in the pre-established data table in node N1, record them in the dictionary colInfo, and get the Zone Maps of node N1 at the same time.

[0433] (7-8) Determine whether cntl is equal to the length of the generalized query set N1.querySet in node N1. If so, proceed to step (7-14), otherwise proceed to step (7-9);

[0434] (7-9) Determine whether cntm is equal to the total number of attributes n in the pre-established data table. If so, proceed to step (7-13); otherwise, proceed to step (7-10);

[0435] (7-10) Calculate the cntlth query in the generalized query set N1.querySet at node N1 and temporary node TN1 l , and temporary node TN1 r The query cost C(N1), C(TN1) on the cntmth attribute of the pre-established data table l ), C(TN1 r ), where TN1 l and TN1 r The number of records in TN1 is half of the number of records in node N1. l The lower bound of the domain value of the cntmth attribute of the pre-established data table in the record set in node N1 is the same as the lower bound of the domain value of the cntmth attribute of the pre-established data table in node N1.l The upper limit of the domain value of the cntmth attribute of the record set in the pre-established data table is the median of the cntmth attribute of the record set in node N1 in the pre-established data table; TN1 r The lower bound of the domain value of the cntmth attribute of the record set in the pre-established data table is the median of the cntmth attribute of the record set in node N1 in the pre-established data table, TN1 r The upper limit of the domain value of the cntm-th attribute of the record set in the pre-established data table is the same as the domain value limit of the cntm-th attribute of the record set in the node N1 in the pre-established data table;

[0436] (7-11) Set the cntmth element of colScore colScore[cntm] = colScore[cntm] + C(N1) - C(TN1 l )-C(TN1 r );

[0437] (7-12) Set counter cntm=cntm+1 and return to step (7-9);

[0438] (7-13) Set counter cntl=cntl+1, cntm=0, and return to step (7-8);

[0439] (7-14) Get the index value array sortCols whose values ​​in colScore are greater than 0 and in reverse order;

[0440] (7-15) Determine whether the length of sortCols is 0. If so, return to step (7-3), otherwise go to step (7-16);

[0441] (7-16) Use sortCols to sort node N and generate two child nodes from node N1. The left child node N1 l and right child node N1 r , where the generalized query set in each child node is equal to the generalized query subset of all generalized queries in the generalized query set in the parent node whose query cost in the child node is greater than 0;

[0442] (7-17) Determine the left child node N1 of node N l Whether the number of records contained in the record set in is greater than or equal to 2*b, if so, proceed to step (7-18), otherwise proceed to step (7-19);

[0443] (7-18) The left child node N1 of node N l Add to the queue candNodes1;

[0444] (7-19) Determine the right child node N1 of node N r Whether the number of records contained in the record set in is greater than or equal to 2*b, if so, proceed to step (7-20), otherwise proceed to step (7-21);

[0445] (7-20) The right child node N1 of node N r Add to the queue candNodes1;

[0446] (7-21) Return to step (7-3);

[0447] In steps (7-10), the method for calculating the query overhead of a single query on a single attribute of a node is as shown in steps (A1) to step A(11), except that it is not necessary to traverse all attributes.

[0448] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. 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 present invention.

Claims

1. A horizontal data partitioning method for cloud data analysis scenarios, It is characterized in that The steps include: (1) Obtain the historical range query set Q H , and obtain the historical range query set Q H The query interval of each attribute in the pre-established data table, as well as the frequency of occurrence of the query interval, and the historical range query set Q H The range query of the "≤" type in the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the first dictionary leDict, and the historical range query set Q H The range query of the "≥" type in each attribute and the frequency of occurrence of the query interval are recorded in the second dictionary geDict, and the historical range query set Q H In the "between" type range query, the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the third dictionary btDict. (2) Obtain the historical range query set Q according to the first dictionary leDict obtained in step (1) H A generalized function for range queries of the "≤" type in . (3) Obtain the historical range query set Q according to the second dictionary geDict obtained in step (1) H A generalized function for range queries of the "≥" type in . (4) Obtain the historical range query set Q according to the third dictionary btDict obtained in step (1) H A generalized function for range queries of type "between" in ; (5) Based on the generalized function obtained in steps (2), (3) and (4), the historical range query set Q H Perform generalization to obtain the generalized range query set Q G . (6) Based on the generalized range query set Q in step (5) G Perform axis-perpendicular hyperplane cutting processing on the data V to be partitioned in the pre-established data table to obtain a binary tree; (7) The binary tree obtained in step (6) is sorted and binary cut according to the range query set after generalization in step (5) to obtain a final binary tree, in which each leaf node corresponds to a horizontal partition.

2. The horizontal data partitioning method for cloud data analysis scenarios according to claim 1, It is characterized in that Step (1) includes the following sub-steps: (1-1) Initialize three empty dictionaries: the first dictionary leDict = {}, the second dictionary geDict = {}, and the third dictionary btDict = {}; (1-2) Initialize counters cnt1=0, cnt2=0; (1-3) Determine whether cnt1 is equal to the historical range query set Q H If the value is the same as the value of , the process ends, otherwise it goes to step (1-4); (1-4) Determine whether cnt2 is equal to the total number of attributes n in the pre-established data table. If yes, proceed to step (1-22); otherwise, proceed to step (1-5); (1-5) Obtain the query lower bound ql and query upper bound qm of the cnt2th attribute in the previously established data table for the cnt1th range query in the historical range query set, and determine whether the query lower bound ql is empty and the query upper bound qm is not empty, or the query lower bound ql is not empty and the query upper bound qm is empty, or both the query lower bound ql and the query lower bound are not empty, or both the query lower bound ql and the query lower bound are empty. If the query lower bound ql is empty and the query upper bound qm is not empty, proceed to step (1-6); If the query lower bound ql is not empty and the query upper bound qm is empty, go to step (1-11); If both the query lower bound ql and the query upper bound qm are not empty, go to step (1-16); If both the query lower bound ql and the query upper bound qm are empty, go to step (1-21); (1-6) Determine whether the key cnt2 exists in the first dictionary leDict. If so, proceed to step (1-8); otherwise, proceed to step (1-7); (1-7) Add the key-value pair with key cnt2 and value {} of the empty dictionary to the first dictionary leDict; (1-8) Determine whether the key qm exists in the dictionary corresponding to the key cnt2 in the first dictionary leDict. If so, proceed to step (1-10); otherwise, proceed to step (1-9); (1-9) Add the key-value pair whose key is qm and whose value is an array of length 1, and whose only element value in the array is 0, to the dictionary corresponding to the key cnt2 in the first dictionary leDict; (1-10) Increase the 0th element in the value (array type) corresponding to the key qm in the dictionary of the key cnt2 in the first dictionary leDict by 1, and go to step (1-21); (1-11) Determine whether the key cnt2 exists in the second dictionary geDict. If yes, proceed to step (1-13); otherwise, proceed to step (1-12); (1-12) Add the key-value pair with key cnt2 and value {} of the empty dictionary to the second dictionary geDict; (1-13) Determine whether the key ql exists in the dictionary corresponding to the key cnt2 in the second dictionary geDict. If yes, proceed to step (1-15); otherwise, proceed to step (1-14); (1-14) Add the key-value pair whose key is ql and whose value is an array of length 1 and whose only element value is 0 to the dictionary corresponding to the key cnt2 in the second dictionary geDict; (1-15) Increase the 0th element in the value (array type) corresponding to the key ql in the dictionary corresponding to the key cnt2 in the second dictionary geDict by 1, and go to step (1-21); (1-16) Determine whether the key cnt2 exists in btDict. If so, proceed to step (1-18), otherwise proceed to step (1-17); (1-17) Add the key-value pair with key cnt2 and value {} of the empty dictionary to the third dictionary btDict; (1-18) Determine whether the key (ql, qm) exists in the dictionary corresponding to the key cnt2 in the third dictionary btDict. If yes, proceed to step (1-20); otherwise, proceed to step (1-19); (1-19) Add the key (ql, qm), the value is an array of length 1, and the only element value in the array is 0 to the dictionary corresponding to the key cnt2 in the third dictionary btDict; (1-20) Increase the 0th element in the value (array type) corresponding to the key (ql, qm) in the dictionary corresponding to the key cnt2 in the third dictionary btDict by 1, and go to step (1-21); (1-21) Set counter cnt2=cnt2+1, and return to step (1-4); (1-22) Set counter cnt1=cnt1+1, counter cnt2=0, and return to step (1-3).

3. The horizontal data partitioning method for cloud data analysis scenarios according to claim 1 or 2, It is characterized in that Step (2) includes the following sub-steps: (2-1) Initialize counters cnt3=0, cnt4=0; (2-2) Determine whether cnt3 is equal to the number of keys in the first dictionary leDict. If so, the process ends, otherwise proceed to step (2-3); (2-3) Initialize an empty array xList = [], and get the dictionary corresponding to the value of the cnt3th key-value pair in the first dictionary leDict (2-4) Determine whether cnt4 is equal to the dictionary The number of middle keys, if yes, go to step (2-8), otherwise go to step (2-5); (2-5) Judgement dictionary Is the 0th element in the array corresponding to the value of the cnt4th key-value pair greater than or equal to the preset threshold H? t If yes, go to step (2-7), otherwise go to step (2-6); (2-6) Convert the number into a dictionary The 0th element in the array corresponding to the value of the cnt4th key-value pair is a dictionary. The key of the cnt4th key-value pair is added to the array xList; (2-7) Set counter cnt4=cnt4+1, and return to step (2-4); (2-8) Use the density-based noise spatial clustering DBSCAN method to cluster the array xList and obtain the clustering result clusterX. (2-9) Initialize the array hotRs with a length equal to the number of clusters in the clustering result clusterX, where each element in the array is an array [∞,-∞]; (2-10) Initialize counter cnt5 = 0; (2-11) Determine whether cnt5 is equal to the length of the clustering result clusterX. If so, proceed to step (2-15), otherwise proceed to step (2-12); (2-12) Determine whether the cnt5th element clusterX[cnt5] of the clustering result clusterX is equal to -1. If so, proceed to step (2-14); otherwise, proceed to step (2-13); (2-13) Update the array corresponding to the clusterX[cnt5]th element of the array hotRs, where the update method of the 0th element is: hotRs[clusterX[cnt5]][0] = min(hotRs[clusterX[cnt5]][0], xList[cnt5]); the update method of the 1st element is: hotRs[clusterX[cnt5]][1] = max(hotRs[clusterX[cnt5]][1], xList[cnt5]); (2-14) Set counter cnt5=cnt5+1, and return to step (2-11); (2-15) Set counter cnt5 = 0; (2-16) Determine whether cnt5 is equal to the length of the clustering result clusterX. If so, proceed to step (2-20), otherwise proceed to step (2-17); (2-17) Determine whether there is a cluster result clusterX whose cnt5th element is not equal to -1, and the dictionary The length of the array corresponding to the key of the cnt5th element in the array xList is equal to 1. If so, proceed to step (2-18), otherwise proceed to step (2-19); (2-18) Add the 0th and 1st elements in the array corresponding to the clusterX[cnt5]th element of the array hotRs to In the array corresponding to the key of the cnt5th element of the array xList; (2-19) Set counter cnt5=cnt5+1, and return to step (2-16); (2-20) Set counter cnt3=cnt3+1, set counter cnt4=0, and return to step (2-2).

4. The horizontal data partitioning method for cloud data analysis scenarios according to any one of claims 1 to 3, It is characterized in that Step (3) includes the following sub-steps: (3-1) Initialize counters cnt6=0, cnt7=0; (3-2) Determine whether cnt6 is equal to the number of keys in the second dictionary geDict. If so, the process ends, otherwise proceed to step (3-3); (3-3) Initialize an empty array xList1 = []; (3-4) Get the dictionary corresponding to the value in the cnt6th key-value pair in the second dictionary geDict Determine whether cnt7 is equal to the dictionary The number of middle keys, if yes, go to step (3-8), otherwise go to step (3-5); (3-5) Judgement dictionary Is the 0th element in the array corresponding to the value of the cnt7th key-value pair greater than or equal to the preset threshold H? t , if yes, go to step (3-7), otherwise go to step (3-6); (3-6) Convert the number into a dictionary The value of the cnt7th key-value pair in the array corresponds to the 0th element, whose value is a dictionary. The key of the cnt7th key-value pair is added to the array xList1; (3-7) Set counter cnt7=cnt7+1, and return to step (3-4); (3-8) Use the DBSCAN clustering method to cluster the array xList1 and obtain the clustering result clusterX1. (3-9) Initialize the array hotRs1 with a length equal to the number of clusters in the clustering result clusterX1, where each element is an array [∞,-∞]; (3-10) Initialize counter cnt8 = 0; (3-11) Determine whether cnt8 is equal to the length of the clustering result clusterX1. If yes, proceed to step (3-15); otherwise, proceed to step (3-12); (3-12) Determine whether the cnt8th element clusterX1[cnt8] of the clustering result clusterX1 is equal to -1. If not, proceed to step (3-13), otherwise proceed to step (3-14); (3-13) Update the array corresponding to the clusterX1[cnt8]th element of hotRs1, where the update method of the 0th element is: hotRs1[clusterX1[cnt8]][0] = min(hotRs1[clusterX1[cnt8]][0], xList1[cnt8]); the update method of the 1st element is: hotRs1[clusterX1[cnt8]][1] = max(hotRs1[clusterX1[cnt8]][1], xList1[cnt8]); (3-14) Set counter cnt8=cnt8+1, and return to step (3-11); (3-15) Set counter cnt8 = 0; (3-16) Determine whether cnt8 is equal to the length of the clustering result clusterX1. If so, proceed to step (3-20), otherwise proceed to step (3-17); (3-17) Determine whether there is a cluster result clusterX1 whose cnt8th element is not equal to -1, and The length of the array corresponding to the key of the cnt8th element in the array xList1 is equal to 1. If so, proceed to step (3-18), otherwise proceed to step (3-19); (3-18) Add the 0th and 1st elements in the array corresponding to the clusterX1[cnt8]th element of the array hotRs1 to the dictionary In the array corresponding to the key of the cnt8th element of array xList1; (3-19) Set counter cnt8=cnt8+1, and return to step (3-16); (3-20) Set counter cnt6=cnt6+1, set counter cnt7=0, and return to step (3-2).

5. The horizontal data partitioning method for cloud data analysis scenarios according to claim 4, It is characterized in that Step (4) includes the following sub-steps: (4-1) Initialize counter cnt9=0, cnta=0; (4-2) Determine whether cnt9 is equal to the number of keys in the third dictionary btDict. If so, the process ends, otherwise proceed to step (4-3); (4-3) Initialize an empty array sList = [], an empty array xyList = []; (4-4) Get the dictionary corresponding to the value of the cnt9th key-value pair in the third dictionary btDict Determine whether cnta is equal to the dictionary The number of middle keys, if yes, go to step (4-8), otherwise go to step (4-5); (4-5) Judgement dictionary Is the 0th element in the array corresponding to the median value of the cntath key-value pair greater than or equal to the preset threshold H? t , if yes, go to step (4-7), otherwise go to step (4-6); (4-6) Get dictionary For the cntath key-value pair, assuming the key and value are tk and tv respectively, add tv[0]tk[1]-tk[0] to the array sList, and add tv[0]tk to the array xyList; (4-7) Set counter cnta=cnta+1 and return to step (4-5); (4-8) Use the DBSCAN clustering method to cluster the array sList and obtain the clustering result clusterLen. (4-9) Initialize the arrays cxList and cxyList with a length equal to the number of clusters in the clustering result clusterLen, and each element in the array is an empty array. Initialize the array csList with a length equal to the number of clusters in the clustering result clusterLen, and each element in the array is -∞; (4-10) Initialize counter cntb = 0; (4-11) Determine whether cntb is equal to the length of the clustering result clusterLen. If so, proceed to step (4-16), otherwise proceed to step (4-12); (4-12) Determine whether the cntb-th element clusterLen[cntb] of the clustering result clusterLen is equal to -1. If so, proceed to step (4-15), otherwise proceed to step (4-13); (4-13) Add xyList[cntb][0] to the array corresponding to the clusterLen[cntb]th element in the array cxList, and add xyList[cntb] to the array corresponding to the clusterLen[cntb]th element in the array cxyList; (4-14) Update the clusterLen[cntb]th element of the array csList, and the updating method is: csList[clusterLen[cntb]] = max(csList[clusterLen[cntb]], sList[cntb]); (4-15) Set counter cntb=cntb+1 and return to step (4-11); (4-16) Set counter cntc=0; (4-17) Determine whether cntc is equal to the length of the array cxList. If so, proceed to step (4-31), otherwise proceed to step (4-18); (4-18) Use the DBSCAN clustering method to cluster the array cxList[cntc] corresponding to the cntc-th element of the array cxList to obtain the clustering result clusterX2. (4-19) Initialize the array hotRs2 with a length equal to the number of clusters in the clustering result clusterX2, and each element in the array is an array [∞,-∞]; (4-20) Set counter cntd = 0; (4-21) Determine whether cntd is equal to the length of the clustering result clusterX2. If so, proceed to step (4-25), otherwise proceed to step (4-22); (4-22) Determine whether the cntd-th element clusterX2[cntd] of the clustering result clusterX2 is equal to -1. If so, proceed to step (4-24); otherwise, proceed to step (4-23); (4-23) Update the array corresponding to the clusterX2[cntd]th element of the array hotRs2. The updating method of the 0th element is: hotRs2[clusterX2[cntd]][0] = min(hotRs2[clusterX2[cntd]][0], cxyList[cntc][cntd][0]); the updating method of the 1st element is: hotRs2[clusterX2[cntd]][1] = max(hotRs2[clusterX2[cntd]][1], cxyList[cntc][cntd][0]); (4-24) Set counter cntd=cntd+1 and return to step (4-21); (4-25) Set counter cntd = 0; (4-26) Determine whether cntd is equal to the length of the clustering result clusterX2. If so, proceed to step (4-30), otherwise proceed to step (4-27); (4-27) Determine whether there is a cluster result clusterX2 whose cntdth element is not equal to -1, and the dictionary Is the length of the array cxyList[cntc][cntd] corresponding to the cntd-th element in the array corresponding to the key equal to the cntc-th element in the array cxyList equal to 1? If so, proceed to step (4-28); otherwise, proceed to step (4-29); (4-28) Add the 0th and 1st elements in the array corresponding to the clusterX2[cntd]th element of the array hotRs2 to the dictionary In the array corresponding to the key cxyList[cntc][cntd]. (4-29) Set counter cntd=cntd+1 and return to step (4-26); (4-30) Set counter cntc=cntc+1 and return to step (4-17); (4-31) Set counter cnt9=cnt9+1, cnta=0, and return to step (4-2).

6. The horizontal data partitioning method for cloud data analysis scenarios according to claim 5, It is characterized in that Step (5) includes the following sub-steps: (5-1) Initialize an empty array Q G ; (5-2) Set counters cnte=0, cntf=0; (5-3) Determine whether cnte is equal to the historical range query set Q H If the length is, the process ends, otherwise it goes to step (5-4); (5-4) Initialize an empty array q G =[]; (5-5) Determine whether cntf is equal to the total number of attributes n in the pre-established data table. If so, proceed to step (5-24); otherwise, proceed to step (5-6); (5-6) Get the cnteth range query Q in the historical range query set QH H [cnte] The query lower bound Q of the cntfth attribute in the pre-established data table H [cnte][cntf] and query upper bound Q H [cnte][cntf+n], and determine whether there is a query lower bound Q H [cnte][cntf] is empty and query the upper bound Q H [cnte][cntf+n] is not empty, or the lower bound Q is queried H [cnte][cntf] is not empty and query the upper bound Q H [cnte][cntf+n] is empty, or query the lower bound Q H [cnte][cntf] and query upper bound Q H [cnte][cntf+n] are not empty, or query the lower bound Q H [cnte][cntf] and query upper bound Q H [cnte][cntf+n] are both empty. If the lower bound Q is queried, H [cnte][cntf] is empty and query the upper bound Q H If [cnte][cntf+n] is not empty, go to step (5-7); If the query lower bound Q H [cnte][cntf] is not empty and query the upper bound Q H If [cnte][cntf+n] is empty, go to step (5-12); If the query lower bound Q H [cnte][cntf] and query upper bound Q H [cnte][cntf+n] are not empty, then go to step (5-17); if the query lower bound Q H [cnte][cntf] and query upper bound Q H If [cnte][cntf+n] are both empty, go to step (5-22); (5-7) Get the dictionary key Q corresponding to the key cntf in the first dictionary leDict H [cnte][cntf+n] corresponds to the array leDict[cntf][Q H [cnte][cntf+n]], and determine whether the value of the 0th element in the array is not less than the preset threshold H t If yes, go to step (5-8), otherwise go to step (5-9); (5-8)[0,bounds[cntf],Q H [cnte][cntf+n]] adds to array q G In which bounds[cntf] is the lower bound of the domain value of the cntf-th attribute in the pre-established data table, and then proceed to step (5-23); (5-9) Judge the array leDict[cntf][Q H Is the length of [cnte][cntf+n]] greater than 1? If so, proceed to step (5-10); otherwise, proceed to step (5-11); (5-10)[1,leDict[cntf][Q H [cnte][cntf+n]][1]―E r *(leDict[cntf][Q H [cnte][cntf+n]][2]―leDict[cntf][Q H [cnte][cntf+n]][1]),leDict[cntf][Q H [cnte][cntf+n]][2]+E r *(leDict[cntf][Q H [cnte][cntf+n]][2]―leDict[cntf][Q H [cnte][cntf+n]][1])] adds to array q G Among them, E r is the expansion ratio hyperparameter (its value is a number greater than zero, preferably between 0.1 and 0.5), and then proceeds to step (5-23); (5-11)[0,bounds[cntf],Q H [cnte][cntf+n]+E r *(Q H [cnte][cntf+n]―bounds[cntf])] is added to the array q G , go to step (5-23); (5-12) Get the dictionary key Q in the geDict dictionary whose key is cntf H [cnte][cntf] corresponds to the array geDict[cntf][Q H [cnte][cntf]], if the array geDict[cntf][Q H The value of the 0th element in [cnte][cntf]] is not less than H t , then go to step (5-13), otherwise go to step (5-14); (5-13)[0,Q H [cnte][cntf],bounds[cntf+n]] is added to array q G In which bounds[cntf+n] is the upper bound of the domain value of the cntf-th attribute in the pre-established data table, and then proceed to step (5-23); (5-14) Judge the array geDict[cntf][Q H Is the length of [cnte][cntf]] greater than 1? If so, proceed to step (5-15); otherwise, proceed to step (5-16); (5-15)[2,geDict[cntf][Q H [cnte][cntf]][1]―E r *(geDict[cntf][Q H [cnte][cntf]][2]―geDict[cntf][Q H [cnte][cntf]][1]),geDict[cntf][Q H [cnte][cntf]][2]+E r *(geDict[cntf][Q H [cnte][cntf]][2]―geDict[cntf][Q H [cnte][cntf]][1])] is added to the array q G Then go to step (5-23); (5-16)[0,Q H [cnte][cntf]―E r *(bounds[cntf+n]―Q H [cnte][cntf]),bounds[cntf+n]] increases to q G Then go to step (5-23); (5-17) Get the dictionary key corresponding to the key cntf in the third dictionary btDict (Q H [cnte][cntf],Q H [cnte][cntf+n]) corresponds to the array btDict[cntf][(Q H [cnte][cntf],Q H [cnte][cntf+n])], if the value of the 0th element in the array is not less than H t , then go to step (5-18), otherwise go to step (5-19); (5-18)[0,Q H [cnte][cntf],Q H [cnte][cntf+n]] adds to array q G Then go to step (5-23); (5-19) Judge the array btDict[cntf][(Q H [cnte][cntf],Q H Whether the length of [cnte][cntf+n])] is greater than 1, if so, proceed to step (5-20), otherwise proceed to step (5-21); (5 - 20) Add [3, btDict[cntf][(Q H [cnte][cntf], Q H [cnte][cntf + n])][1], bt Dict[cntf][(Q H [cnte][cntf], Q H [cnte][cntf + n])][2] - E r *(btDict[cntf][(Q H [cnte][cntf], Q H [cnte][cntf + n])][3] - btDict[cntf][(Q H [cnte][cntf], Q H [cnte][cntf + n])][2]), btDict[cntf][(Q H [cnte][cntf], Q H [cnte][cntf + n])][3] + E r *(btDict[cntf][(Q H [cnte][cntf], Q H [cnte][cntf + n])][3] - btDict[cntf][(Q H [cnte][cntf], Q H [cnte][cntf + n])][2])] to the array q G , and then go to step (5 - 23); (5-21)[0,Q H [cnte][cntf]―E r *(Q H [cnte][cntf+n]―Q H [cnte][cntf]),Q H [cnte][cntf+n]+E r *(Q H [cnte][cntf+n]―Q H [cnte][cntf])] is added to the array q G Then go to step (5-23); (5-22) Add [0, bounds[cntf], bounds[cntf+n]] to array q G middle; (5-23) Set counter cntf=cntf+1 and return to step (5-5); (5-24) Set counter cnte=cnte+1, cntf=0, and set q G Add to array Q G and returns to step (5-3).

7. The horizontal data partitioning method for cloud data analysis scenarios according to claim 6, It is characterized in that Step (6) includes the following sub-steps: (6-1) Initialize a node Root. Its corresponding record set dataset is the set V consisting of all records in the pre-established data table. Its corresponding generalized query set querySet is the generalized range query set Q G ; (6-2) Initialize an empty queue candNodes and put the node Root into candNodes; (6-3) Determine whether the queue candNodes is empty. If so, the process ends, otherwise proceed to step (6-4); (6-4) Take out the first element in the queue candNodes, that is, the node N to be cut; (6-5) Initialize an empty array candCuts to record the candidate axis perpendicular hyperplane cutting set; (6-6) Initialize counters cntg=0, cnth=0; (6-6) Determine whether cntg is equal to the length of the generalized query set N.querySet in the node to be cut N. If so, proceed to step (6-21), otherwise proceed to step (6-7); (6-7) Determine whether cnth is equal to the total number of attributes n in the pre-established data table. If so, proceed to step (6-20); otherwise, proceed to step (6-8); (6-9) Obtain the cnth element N.querySet[cntg][cnth] of the cntg-th query in the generalized query set of the node to be cut N, and determine whether N.querySet[cntg][cnth][0] is equal to 0, 1, 2, or 3. If it is equal to 0, go to step (6-10); If it is equal to 1, go to step (6-13); if it is equal to 2, go to step (6-10); if it is equal to 3, go to step (6-15); (6-10) Determine whether N.querySet[cntg][cnth][1] is greater than bounds[cnth]. If so, proceed to step (6-11); otherwise, proceed to step (6-13); (6-11) Add (cnth, N.querySet[cntg][cnth][1]) to the array candCuts; (6-12) Determine whether N.querySet[cntg][cnth][0] is equal to 2. If so, proceed to step (6-19); otherwise, proceed to step (6-13); (6-13) Determine whether N.querySet[cntg][cnth][2] is less than or equal to bounds[cnth+n]. If so, proceed to step (6-14); otherwise, proceed to step (6-19); (6-14) Add (cntf, N.querySet[cntg][cnth][2]+MPVS[cnth]) to the array candCuts, where MPVS[cnth] is the minimum precision of the cnth attribute in the pre-established data table, and go to step (6-19); (6-15) Determine whether N.querySet[cntg][cnth][2] is greater than bounds[cnth]. If so, proceed to step (6-16), otherwise proceed to step (6-17); (6-16) Add (cntf, N.querySet[cntg][cnth][2]) to the candCuts array; (6-17) Determine whether N.querySet[cntg][cnth][3]+N.querySet[cntg][cnth][1] is less than or equal to bounds[cnth+n]. If so, proceed to step (6-18); otherwise, proceed to step (6-19); (6-18) Add (cntf, N.querySet[cntg][cnth][3]+N.querySet[cntg][cnth][1]) to the array candCuts; (6-19) Set counter cnth=cnth+1, and return to step (6-7); (6-20) Set counter cntg=cntg+1, cnth=0, and return to step (6-6); (6-21) Set counter cnti = 0, bestCutIndex = -1, bestBenifit = 0; (6-22) Determine whether cnti is equal to the length of the array candCuts. If so, proceed to step (6-28), otherwise proceed to step (6-23); (6-23) Use the cnti-th element in the array candCuts to cut the candidate axis perpendicular to the hyperplane to divide the record set dataset in node N into two temporary nodes TN l and TN r The number of records in and Zone Maps; (6-24) Determine the temporary node TN l and temporary node TN r Whether the number of records contained in the record set in is not less than b, if so, proceed to step (6-25), otherwise proceed to step (6-27); (6-25) Calculate the generalized query set N of the node to be cut N.querySet in the node to be cut N and the temporary node TN respectively. l and temporary node TN r The total query cost C(N), C(N l ), C(N r ) and determine whether there is C(N)-C(TN l )-C(TN r ) is greater than bestBenifit, if so, proceed to step (6-26), otherwise proceed to step (6-27); (6-26) Set bestCutIndex = cnti, bestBenifit = C(N) - C(TNl) - C(TNr); (6-27) Set counter cnti=cnti+1 and return to step (6-22); (6-28) Determine whether bestCutIndex is equal to -1, if so, return to step (6-3), otherwise go to step (6-29); (6-29) Use the bestCutIndex element in the candCuts array to generate the left child node N by cutting the vertical hyperplane corresponding to the candidate axis. l and right child node N r , where the generalized query set in each child node is equal to the generalized query subset of all generalized queries in the generalized query set in the parent node whose query cost in the child node is greater than 0; (6-30) Determine the left child node N of node N l Whether the number of records contained in the record set in is greater than or equal to 2*b, where b is the partition size threshold, then proceed to step (6-31), otherwise proceed to step (6-32); (6-31) The left child node N of node N l Add to the queue candNodes; (6-32) Determine the right child node N of node N r Is the number of records in greater than or equal to 2*b, where b is the partition size threshold, if yes, go to step (6-33), otherwise go to step (6-34); (6-33) The right child node N of node N r Add to the queue candNodes; (6-34) Return to step (6-3).

8. The horizontal data partitioning method for cloud data analysis scenarios according to claim 7, It is characterized in that The process of calculating the total query cost cost of the generalized range query set NQ on a certain node in step (6-25) is obtained through the following sub-steps: (A1) Initialize counters cntj=0, cntk=0, and total query cost cost=0; (A2) Determine whether cntj is equal to the length of the generalized range query set NQ. If so, the process ends; otherwise, proceed to step (A3); (A3) Initialize the single query cost to the number of records RN contained in the record set in the node, that is, curCost = RN; (A4) determining whether cntk is equal to the total number of attributes n in the pre-established data table, if yes, proceeding to step (A11), otherwise proceeding to step (A5); (A5) Obtain the lower bound ZM[cntk] and upper bound ZM[cntk+n] of the domain value of the cntk-th attribute in the pre-established data table of the Zone Maps of the record set in the node, obtain the query type and the query interval after generalization of the cntk-th attribute in the pre-established data table of the cntj-th range query in the generalized range query set NQ, i.e., NQ[cntj][cntk], and determine whether the 0th element value NQ[cntj][cntk][0] in NQ[cntj][cntk] is 0, 1, 2, or 3. If it is 0, proceed to step (A6); if it is 1, proceed to step (A7); if it is 2, proceed to step (A8); if it is 3, proceed to step (A9); (A6) Update curCost using the following formula: (A7) Update curCost using the following formula: (A8) Update curCost using the following formula: (A9) Update curCost using the following formula: curCost = curCost*max(min(ZM[cntk+n],NQ[cntj][cntk][3])-max(ZM[cntk]-NQ[cntj][cntk][1],NQ[cntj][cntk][2])+MPVS[cntk],0)÷(NQ[cntj][cntk][3]-NQ[cntj][cntk][2]+MPVS[cntk]); (A10) Set counter cntk=cntk+1, and return to step (A4); (A11) Set cost=cost+curCost, cntk=0, and return to step (A2).

9. The horizontal data partitioning method for cloud data analysis scenarios according to claim 8, It is characterized in that Step (7) includes the following sub-steps: (7-1) Initialize the counter, cntl=0, cntm=0, and initialize an empty queue candNodes1; (7-2) Put all leaf nodes of the binary tree generated by cutting the axis perpendicular to the hyperplane into the queue candNodes1; (7-3) Determine whether the queue candNodes1 is empty. If so, the process ends, otherwise proceed to step (7-4); (7-4) Take out the first element of the queue candNodes1, which is the waiting node N1; (7-5) Determine whether the number of records in the node to be cut N1 is not less than 2*b. If so, proceed to step (7-6), otherwise return to step (7-3); (7-6) Initialize the colScore array of length n to record the ranking weight of each attribute. The initial value of each element in the array is 0; (7-7) Get the minimum, median and maximum values ​​of each attribute of all records in the pre-established data table in node N1, record them in the dictionary colInfo, and get the Zone Maps of node N1 at the same time. (7-8) Determine whether cntl is equal to the length of the generalized query set N1.querySet in node N1. If so, proceed to step (7-14), otherwise proceed to step (7-9); (7-9) Determine whether cntm is equal to the total number of attributes n in the pre-established data table. If so, proceed to step (7-13); otherwise, proceed to step (7-10); (7-10) Calculate the cntlth query in the generalized query set N1.querySet at node N1 and temporary node TN1 l , and temporary node TN1 r The query cost C(N1), C(TN1) on the cntmth attribute of the pre-established data table l ), C(TN1 r ), where TN1 l and TN1 r The number of records in TN1 is half of the number of records in node N1. l The lower bound of the domain value of the cntmth attribute of the pre-established data table in the record set in node N1 is the same as the lower bound of the domain value of the cntmth attribute of the pre-established data table in node N1. l The upper limit of the domain value of the cntmth attribute of the record set in the pre-established data table is the median of the cntmth attribute of the record set in node N1 in the pre-established data table; TN1 r The lower bound of the domain value of the cntmth attribute of the record set in the pre-established data table is the median of the cntmth attribute of the record set in node N1 in the pre-established data table, TN1 r The upper limit of the domain value of the cntm-th attribute of the record set in the pre-established data table is the same as the domain value limit of the cntm-th attribute of the record set in the node N1 in the pre-established data table; (7-11) Set the cntmth element of colScore colScore[cntm] = colScore[cntm] + C(N1) - C(TN1 l )-C(TN1 r ); (7-12) Set counter cntm=cntm+1 and return to step (7-9); (7-13) Set counter cntl=cntl+1, cntm=0, and return to step (7-8); (7-14) Get the index value array sortCols whose values ​​in colScore are greater than 0 and in reverse order; (7-15) Determine whether the length of sortCols is 0. If so, return to step (7-3), otherwise go to step (7-16); (7-16) Use sortCols to sort node N and generate two child nodes from node N1. The left child node N1 l and right child node N1 r , where the generalized query set in each child node is equal to the generalized query subset of all generalized queries in the generalized query set in the parent node whose query cost in the child node is greater than 0; (7-17) Determine the left child node N1 of node N l Whether the number of records contained in the record set in is greater than or equal to 2*b, if so, proceed to step (7-18), otherwise proceed to step (7-19); (7-18) The left child node N1 of node N l Add to the queue candNodes1; (7-19) Determine the right child node N1 of node N r Whether the number of records contained in the record set in is greater than or equal to 2*b, if so, proceed to step (7-20), otherwise proceed to step (7-21); (7-20) The right child node N1 of node N r Add to the queue candNodes1; (7-21) Return to step (7-3).

10. A horizontal data partitioning system for cloud data analysis scenarios, It is characterized in that include: The first module is used to obtain the historical range query set Q H , and obtain the historical range query set Q H The query interval of each attribute in the pre-established data table, as well as the frequency of occurrence of the query interval, and the historical range query set Q H The range query of the "≤" type in the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the first dictionary leDict, and the historical range query set Q H The range query of the "≥" type in each attribute and the frequency of occurrence of the query interval are recorded in the second dictionary geDict, and the historical range query set Q H In the "between" type range query, the query interval of each attribute and the frequency of occurrence of the query interval are recorded in the third dictionary btDict. The second module is used to obtain the historical range query set Q according to the first dictionary leDict obtained in the first module H A generalized function for range queries of the "≤" type in . The third module is used to obtain the historical range query set Q according to the second dictionary geDict obtained in the first module H A generalized function for range queries of the "≥" type in . The fourth module is used to obtain the historical range query set Q according to the third dictionary btDict obtained in the first module H A generalized function for range queries of type "between" in ; The fifth module is used to query the historical range set Q according to the generalized function obtained by the first module, the second module and the third module. H Perform generalization to obtain the generalized range query set Q G . The sixth module is used to query the range set Q after generalization processing according to the fifth module G Perform axis-perpendicular hyperplane cutting processing on the data V to be partitioned in the pre-established data table to obtain a binary tree; The seventh module is used to sort and binary cut the binary tree obtained by the sixth module according to the range query set after generalization processing by the fifth module, so as to obtain the final binary tree, in which each leaf node corresponds to a horizontal partition.

Citation Information

Patent Citations

  • Big data analysis method for warning of heavy-load and overload of electric power system

    CN105404944A

  • Physical resource scheduling method based on Kubernetes and scheduler

    CN116841718A

  • Iterate-aggregate query parallelization

    US20080162409A1

  • Efficient and verifiable multi-keyword sorting searchable encryption method supporting preference search and logical search

    WO2019165880A1