WO2022000169A1 - 跨数据中心的数据分析方法、装置、设备及存储介质 - Google Patents

跨数据中心的数据分析方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022000169A1
WO2022000169A1 PCT/CN2020/098872 CN2020098872W WO2022000169A1 WO 2022000169 A1 WO2022000169 A1 WO 2022000169A1 CN 2020098872 W CN2020098872 W CN 2020098872W WO 2022000169 A1 WO2022000169 A1 WO 2022000169A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
target
sets
centers
blocks
Prior art date
Application number
PCT/CN2020/098872
Other languages
English (en)
French (fr)
Inventor
龙浩
吴胤旭
黄哲学
Original Assignee
深圳大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳大学 filed Critical 深圳大学
Priority to PCT/CN2020/098872 priority Critical patent/WO2022000169A1/zh
Publication of WO2022000169A1 publication Critical patent/WO2022000169A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/30Post-processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application relates to the technical field of data processing, and in particular, to a method, apparatus, device and storage medium for data analysis across data centers.
  • One of the purposes of the embodiments of the present application is to provide a cross-data center data analysis method, device, equipment, and storage medium, aiming to solve the problem of time-consuming and time-consuming analysis of large-scale cross-data center data in the prior art. Longer, less efficient problems.
  • a method for data analysis across data centers where a subset of data is stored in the data center, and the method includes:
  • each data center According to the data subsets in each data center, correspondingly generate the data model of each data center;
  • the target learner is trained according to all the target data sets, and the data in the large data set is analyzed according to the target learner.
  • an embodiment of the present application provides a data analysis device across data centers, where data subsets are stored in the data center, and the device includes:
  • a first generation module configured to generate corresponding data models of each data center according to the data subsets in each data center
  • a second generation module configured to randomly select a first preset number of initial data blocks from each of the data models, and generate a first data block set corresponding to each of the data centers;
  • a third generating module configured to sequentially select target data blocks from each of the first data block sets, and generate a second preset number of target data sets;
  • the analysis module is used to train the target learner according to all the target data sets, and analyze the data in the large data set according to the target learner.
  • an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program
  • a terminal device including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements any one of the first aspect Data analysis methods across data centers.
  • an embodiment of the present application provides a computer program product that, when the computer program product runs on a terminal device, enables the terminal device to execute the cross-data center data analysis method described in any one of the first aspects above.
  • the embodiments of the present application have the following beneficial effects: through the random division model of big data, data subsets in each data center are processed to generate data models; and initial data blocks are randomly selected in each data model , correspondingly generate the first data block set; then select the target data block from each first data block set to generate the target data set; the target learner obtained by training the target data set can be considered to be based on the data of the large data set The target learner obtained by training.
  • the analysis accuracy of the target learner when analyzing the data in the big data also meets the requirements, and because the amount of data processing is reduced, the data processing time is also relatively reduced, which can achieve the effect of efficient and accurate analysis of the big data.
  • FIG. 1 is a schematic flowchart of an implementation of a data analysis method across data centers provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of an implementation of a data analysis method across data centers provided by another embodiment of the present application;
  • FIG. 3 is a schematic flowchart of an implementation of a method for data analysis across data centers provided by yet another embodiment of the present application;
  • FIG. 5 shows the classification accuracy and processing time of a classification model obtained by training a single data center, and the classification accuracy and processing time of the improved classification model obtained after training in a method for data analysis across data centers provided by an embodiment of the present application. Schematic diagram of the comparison;
  • FIG. 6 shows the classification accuracy rate and processing time of a classification model obtained by training a separate data center, and the classification accuracy rate and processing time of the classification model obtained after the improved training in the method for data analysis across data centers provided by another embodiment of the present application. Time comparison diagram;
  • FIG. 7 shows the classification accuracy and processing time of the classification model obtained by training a single data center, and the classification accuracy and processing time of the classification model obtained after training in a method for data analysis across data centers provided by another embodiment of the present application. Time comparison diagram;
  • Fig. 9 is the classification accuracy rate and processing duration of the classification model obtained by training under the state of distribution of different data categories in the data center in the cross-data center data analysis method provided by an embodiment of the present application;
  • FIG. 10 is a schematic structural diagram of a cross-data center data analysis device provided by an embodiment of the present application.
  • FIG. 1 shows an implementation flowchart of a method for data analysis across data centers provided by an embodiment of the present application. The details are as follows: Data subsets are stored in the data center, and the method includes:
  • the above-mentioned data center is used to store the data of the data subset center.
  • it contains multiple data subsets, each data subset contains at least one data block, and each data block contains data.
  • each of the above data subsets can be stored separately in a data center, and the data in the data centers does not overlap, or each of the above data subsets can be stored in one data center, or part of the data may be stored in other data centers. , which is not limited.
  • a large data set is represented by a set of non-overlapping data subsets, each of which is a random sample of the entire large data set.
  • several data blocks can be randomly selected to approximately analyze the entire large data set.
  • the central data subset is the set of data blocks transformed by the RSP data model.
  • RSP is a transformation function used to transform a subset of raw data into an RSP data model.
  • the data block sets after the conversion of each original data subset corresponding to the above-mentioned data model the corresponding data content in each data block set is consistent with the data content corresponding to the original data, but the order of the data content records is marked. chaos. Therefore, the data model corresponding to each data center can also be considered to contain the content of the original data subset.
  • the initial data block is randomly selected from each of the above data models, and the first data block set is generated, and it can be considered that each first data block set is random sample data of each data center. According to the definition of the big data random sample partition model, it can be considered that the data type distribution in each first data block set is consistent with the data type randomly distributed in each data subset of the entire big data.
  • the data analysis results in the first data block set are approximately considered to be the data analysis results of the corresponding data subsets, then correspondingly, the data analysis results in all the first data block sets can be approximately considered to be The result of an analysis of data in a large dataset.
  • the above-mentioned initial data block is the data block included in the data model of each data center at present.
  • the above-mentioned first preset number may be a number manually preset according to actual needs, or may be a number randomly defined by the terminal, which is not limited.
  • the first data block set corresponding to each of the above data centers can be considered as: S i ⁇ R i , where S i is the i-th first data block set, is the b-th initial data block in the i-th first data set, and b is the first preset number.
  • each first data block set includes a plurality of initial data blocks. Selecting target data blocks from each first data set to generate a target data set, it can be considered that each of the above-mentioned target data sets includes the target data blocks in the first data set, and also includes the selected data blocks in the remaining first data sets. target data block.
  • the above-mentioned target data block selected in a first data block set can be approximately considered to be an approximate sample data in the entire first data set. Then, analyzing the approximate sample data (target data block) can be regarded as analyzing the entire first data set. Therefore, when the target data set also includes the target data blocks in each first data set, it can be considered that the result obtained by analyzing the data in the target data set can be approximately regarded as the data in the large data set. Analyze the results obtained.
  • a first preset number of initial data blocks of -1 can be selected, and repeating the above steps again to select a target data block from the remaining initial data blocks in each first data block set in turn, Generate the target data set. Then, the number of target data sets that can be generated may be the same as the number of the first preset number.
  • S104 Train a target learner according to all the target data sets, and analyze the data in the large data set according to the target learner.
  • the above S103 has described the result obtained by analyzing the data in the target data set, which can be approximately regarded as the result obtained by analyzing the data in the large data set. Then, the target learner obtained by training the target data set having the second preset number can be regarded as the target learner for training the data in the entire large data set. Afterwards, the data in the large data set can be analyzed through the target learner to obtain the corresponding analysis results.
  • each data in the large data set is stored in a data center by itself, and there is no consistent data content in each data center.
  • the data center stores data subsets, which saves storage space and data management is relatively simple, which can be considered as a non-replication mode.
  • the above S102 has explained that the first data block set is generated by randomly selecting a first preset number of initial data blocks from each of the data models.
  • the above-mentioned sorting numbers may be letters (A, B, . . . , Z) or numbers (1, 2, . . . ), which are not limited. It can be considered that each initial data block in each of the above-mentioned first data block set has a separate corresponding sorting number for identification.
  • S102 S i ⁇ R i in each first data block set, there is an initial data block corresponding to the 1-b sequence number.
  • each of the first data block sets the initial data blocks with the same sequence number are aggregated as target data blocks to generate the second preset number of target data sets; A predetermined number is equal to the second predetermined number.
  • the above-mentioned initial data blocks with the same sequence number are aggregated as target data blocks, that is, for i data block sets, the initial data blocks with the same sequence in each first data set are aggregated, and each generated data block is aggregated.
  • Each target data set contains i initial data blocks (target data blocks) from different data centers, and the number of generated target data sets is the number of initial data blocks in each first data block set.
  • each of the above target data sets can be considered as in, It can be considered that in the i-th first data block set, the initial data block with sorting number b is used as the target data block, then Represents the target data set generated by the target data block with sequence number b in each target data set.
  • the second preset number is b
  • there are b corresponding sorting numbers and there will be b generated target data sets, and the data blocks in each target data set correspond to the first data block set.
  • the number (number of data centers) i is equal. Then all target data sets can be defined as:
  • the initial data blocks with the same sequence number in each first data block set are aggregated as target data blocks, so that the generated target data set has the initial data blocks of each data center.
  • the initial data block is a random sample of each data center, then the generated target data set can be a random sample of all data centers (large data sets).
  • the target learner obtained by training can be regarded as a target learner obtained by training a large data set.
  • At least one initial data block is randomly selected as the target data block.
  • the above 102 has explained that the first data block set is generated from each of the data models and randomly selects a first preset number of initial data blocks.
  • a preset number of initial data blocks That is, if the first preset number is b, then for the b initial data blocks in each first data block set recorded in the above S201, S i ⁇ R i , at least one initial data block can be randomly selected each time as the target data block. Wherein, for each first data block set, it is not required whether to select initial data blocks with the same order number.
  • the target data blocks in each of the first data block sets are aggregated each time as a target data set until the second preset number of target data sets are generated.
  • the number of target data blocks selected from the first data block set each time can be equal or unequal.
  • the number of selected target data blocks can be equal. So that the data content in the target data set is not more biased to the content of a certain data center, so that the target learner obtained by training according to the target data set has stronger generalization ability.
  • each of the above-mentioned first data sets has b initial data blocks, and when the number of target data blocks selected each time is multiple, the corresponding second preset number of generated target data sets is It can be different from the first preset number; it can also be obtained by randomly combining b initial data blocks each time, and the number of random combinations can be the first preset number of times, then the second preset number of the generated target data block is obtained.
  • the set number can still be the same as the first preset number, which is not limited.
  • the generated target data by randomly selecting initial data blocks as target data blocks for aggregation in each first data block set, so that the generated target data set has the initial data blocks of each data center, the generated target data There are also multiple data sets, and the target learner obtained by training according to all the target data sets can more accurately analyze the data in the large data set, and improve the accuracy of the target learning to analyze the data in the large data set. Moreover, the terminal does not need to sort each initial data block in each first data block set, which reduces the operation process and speeds up the training of the target learner.
  • S102 includes:
  • each data subset in the above-mentioned large data set are scattered and stored in multiple data centers. Specifically, for a large data set, each data subset of it is also stored in a data center, but from the perspective of disaster tolerance, data security, and rapid response, some or all of the data content in each data subset will be copied. to multiple remaining data centers. That is, each subset of data may be stored in only one data center, or may be replicated to other data centers, in which case it can be considered a no-replication mode.
  • the above preset rule may be to set a replication factor ⁇ according to the number M of the first data block sets in each data subset, where 0 ⁇ 1.
  • the M* ⁇ number of first data block sets are randomly selected; it may also be that a specified number of first data block sets are randomly selected from the first data block sets in each data subset, which is not limited.
  • the content of the i-1 first data block set may be completely the same, may be partially the same, or completely different, and this is not limited.
  • each copy subset includes the original data subset The original set of first data blocks included, and the set of replicated first data blocks randomly obtained from the rest of the data centers.
  • each of the above-mentioned replicated subsets includes the original first data block set included in the original data subset, and the replicated first data block set randomly obtained from other data centers.
  • the above-mentioned original first data block set is the M first data block set in each data subset in the above S301, and the above-mentioned replicated first data block set randomly obtained from the rest of the data centers is the set of M first data blocks from each of the other data centers.
  • Sk is the original first data block set of the kth data center
  • Si is the first data block set copied from the ith data center.
  • i data centers above there are i data centers above, and therefore, there are i replica subsets corresponding to each data center generated.
  • randomly selecting the first preset number of first data blocks from the replication subset as the initial data block can be considered as randomly selecting a replication subset from the i replication subsets to select the initial data block.
  • the current replicated subset in each data center also includes the data content of the remaining data centers (the replicated first data block set randomly replicated by each data center). Therefore, a first preset number of first data blocks are randomly selected as initial data blocks from the original first data block set in any duplicated subset and each duplicated first data block set. That is to say, in S102, a first preset number of initial data blocks are randomly selected from each data model.
  • a first preset number of first data blocks are selected from the first data block set as initial data blocks. It can be considered that the first data block set in each data model is composed of a plurality of first data blocks, and the data block selected from the plurality of first data blocks is regarded as an initial data block.
  • G k ⁇ S1, S2, . . . , Sk, . . . , Si ⁇ , where Sk is the kth data center
  • Si is the first set of data blocks copied from the i-th data center
  • Gk is the copy subset currently corresponding to the k-th data center (that is, it can be considered that Gk at this time can be approximated as is a large dataset).
  • S i is the i-th first data block set
  • b is the first preset number.
  • the first data block of the first preset number is selected as the initial data block from S1, it is the expression when i in S102 is equal to 1, That is, it can be considered that the data model in S102 is equivalent to the replicated subset in S302. Then, in the first data block set (Si) replicated in each data center in Gk, the above steps between S103 to S104 can be used to train the target learner.
  • the target learner in order to make the data obtained by training according to the first data block set corresponding to each data center
  • the target learner can better analyze large data sets. It can repeat i-1 times in each data center, and randomly obtain a certain percentage of the first data block sets in the remaining data centers each time, so that each Each data center can approximately represent large data sets.
  • the data storage proportion of the replicated subset in each data center is reduced, which reduces the data processing time relatively, and can achieve the effect of efficient and accurate analysis of the big data.
  • S301 includes:
  • a corresponding number of first data blocks in the data model are randomly copied each time as a first data block set.
  • each of the data models a corresponding number of first data blocks in the data model are repeatedly copied i-1 times to obtain i-1 sets of the first data blocks.
  • S301 has already described how to replicate the first database set according to the replication factor and the number of the first data blocks, which will not be described in detail.
  • can be 0.9, which reduces the storage space of the copied first data set in the remaining data centers under the condition that the copied first data set is as close to the first data block with the complete data model as possible.
  • the obtaining of the i-1 first data block set has also been described, and the explanation of this will not be repeated.
  • the first data block set is determined by setting the replication factor and the number of first data blocks in each data model, so that in the replication subset corresponding to any generated data center, each The ratio of the categories is closer to the ratio of each category corresponding to the data content in the actual large data set, so that the first data block set corresponding to each data center is generated according to the copy subset corresponding to any data center, according to the first data block set.
  • the target learner obtained by training the data block set has a higher accuracy in analyzing the data in the large data set.
  • S104 includes:
  • a target learner corresponding to each target data set is trained according to all the target data blocks in each target data set.
  • each of the above All data contain random sample data obtained from each data center in the large data set. Therefore, it can be used to estimate statistical functions of a large dataset or to build a machine learning model. Since all target data set G is a random sample data of the large data set, it has the same statistical properties as the large data set. Analyzing all target data sets G can obtain approximate results of the large data set. And the data size of the target data set G is much smaller than the large data set, so it can be quickly trained on each target data set in a parallel or distributed manner in the central data center.
  • the above-mentioned training target data set obtains a target learner, which can be trained for common neural network models, such as using random forest algorithm as the modeling target learner, so that the trained target learner can classify the data, This is not described in detail.
  • a target analysis result of the data in the large data set is obtained based on a consensus function.
  • each target data set needs to be trained according to the data in each target data set.
  • the target learner f b where f b is the target learner obtained by training the b-th target data set.
  • all target data sets can be stored in the data analysis center, and the data in each target data set can be stored in a distributed manner so that they are stored on each node of the data analysis center, and There is no communication interaction with each other. Furthermore, it is possible to simultaneously train each target data set to obtain a corresponding target learner, which greatly reduces the training time.
  • each target learner f b is a sampling training on the large data set.
  • the analysis result of F is approximately the analysis result of the large data set.
  • the definition of the consensus function is that for b target learners, when it analyzes one data, there will be b classification results, and for the b classification results, the number of a certain classification result is the largest, then the The classification result is determined as the analysis result obtained by analyzing the data.
  • a target learner is obtained by training each target data set, and then when analyzing the data, a consensus function is used to obtain the final analysis result, so that the ensemble model obtained by training can analyze the data accurately. higher.
  • a random sample division algorithm is used to process the data subsets of the respective data centers to obtain the data models of the respective data centers. It has been described in S101 and will not be described in detail.
  • this embodiment uses 5 data centers, including 1 local data center and 4 AWS (Amazon cloud computing service) data centers.
  • the local data center is located in Shenzhen University, and the other four data centers are located in Mumbai, India, Seoul, South Korea, Sydney, Australia, and Northern Virginia, USA.
  • a 5-node hadoop (distributed system infrastructure) environment is used, each node contains 24-core CPU, 128G memory, and 8TB disk storage.
  • the other 4 AWS data centers use Amazon's EC2 (a system that allows users to rent cloud computers to run the required applications) hadoop micro-instances.
  • the hadoop environment of the local data center is used for data analysis
  • the remote AWS data center is used to test the time overhead of data transmission.
  • this data distribution mode can be called a no-copy mode.
  • the specific process of analyzing the data in the big data set in this mode is as follows:
  • the first step is to generate corresponding data models of each data center according to the data subsets in each data center.
  • a large data set, its various data subsets are scattered in various data centers, and the data between the data subsets does not overlap.
  • the random sample division algorithm adopted in the specific steps of generating the RSP data model is implemented based on the existing big data random sampling data sub-block division and device. For details, refer to the content recorded in S101, which will not be described in detail.
  • a 90GB data can be artificially generated, which contains 100 features, 500 categories, and 100 million records.
  • the first way is to simulate category independence (category 1), that is, there is no intersection of categories between data centers.
  • the 90G data is divided into 4 copies, each containing 125 categories.
  • a random sample data division algorithm is used to generate RSP data models for four pieces of data, and finally the four RSP data models are uploaded to the corresponding AWS data center.
  • the first copy is uploaded to Mumbai AWS data center DC1
  • the second is uploaded to Seoul AWS data center DC2
  • the third is uploaded to Sydney, Australia AWS data center DC3
  • the fourth is uploaded to Zhou AWS data center DC4, different data
  • the categories included in the center are different.
  • the second way is to simulate imbalanced categories (category 2), that is, one category has far more records in a data center than others.
  • Divide the 90G data into 4 parts the first one contains 70% of the records are 0-124 categories, and the remaining 30% are other categories.
  • the second contains 70% of the records in categories 125-249 and the remaining 30% in other categories.
  • the third contains 70% of the records in the 250-374 category and the remaining 30% in other categories.
  • the fourth contains 70% of the records in the 375-499 category and the remaining 30% in the other categories.
  • a random sample data division algorithm is used to generate an RSP data model for the four data sets, and finally the four data sets are uploaded to the corresponding AWS data centers (DC1, DC2, DC3, DC4).
  • the third way is to simulate balanced categories (category 3), that is, the number of records of all categories in each data center is evenly distributed. Divide the records of 500 categories of 90G data into 4 evenly, use the random sample data division algorithm in the local data center to generate RSP data models for each of the four data, and finally upload the 4 data to the corresponding AWS data center. (DC1, DC2, DC3, DC4).
  • a first preset number of initial data blocks are randomly selected from each data model, and a first data block set corresponding to each data center is generated.
  • random block extraction is performed under the above three types of distribution modes. Since each initial data block in the RSP data model is a random sample data of a data subset, in actual work, the data blocks are extracted in a simple order and the random The final effect of extracting data blocks is not much different.
  • the third step is to download the first data block set extracted by each data center to the data analysis center.
  • a local data center is used as the data analysis center, and the local data center is located in Shenzhen University.
  • This link can measure the time overhead of transmitting the first data block set from each data center to the data analysis center.
  • the RSP data model of this embodiment adopts two data block sizes for testing, one is that the block size is 1MB, and the other is that the block size is 1GB.
  • the specific time overhead of transmitting the first data block set to the data analysis center is as follows in Table 1:
  • the fourth step is to sequentially select target data blocks from each of the first data block sets to generate a second preset number of target data sets.
  • the first data block set S i (i is the number of data centers) randomly selected and generated by each of the above data centers is downloaded to the data analysis center, and the data analysis center will obtain 4 first data block sets.
  • the target learner is trained according to all target data sets, and the data in the large data set is analyzed according to the target learner.
  • the random forest algorithm in the classification algorithm is used as the base learner, and the consensus function uses the avg function.
  • random forests were used to analyze the three types of distributions in step 1.
  • the time cost of distribution data analysis and the classification accuracy are shown in Figure 5, because the data in each data center Only 25% of categories can be covered.
  • the curve represented by the Center DC (Data Analysis Center) in Figure 5(a) is the accuracy rate of the model trained after merging the target data sets of each data center. It can be seen that the classification accuracy rate has reached an accuracy rate of more than 90%.
  • the curve in Figure 5(a) also shows that only a small number of target data sets in each data center is needed to meet the required accuracy, and the increase in the number of data blocks in the target data set (segment sampling ratio) is not significant Bring about an increase in classification accuracy.
  • the data analysis time overhead and classification accuracy are shown in Figure 6(a).
  • the data in each data center is heavily biased towards 125 categories, and the other 375 categories only account for 30%.
  • the classification accuracy of the model trained using the data subsets of each data center independently is also far inferior to the accuracy of the model trained by combining the target data sets of each data center.
  • the data analysis time overhead and classification accuracy are shown in Figure 7(a).
  • the classification accuracy of the model trained on the set can reach 73%. But this data storage mode is difficult to appear in practical work. After merging the target data sets of each data center, the classification accuracy of the model trained in the data center can reach 90%.
  • the performance of the models trained in the above three methods has a similar calculation pattern, the time overhead is basically a linear increase, and the data processing time Significantly related to the size of the data. It can be seen that the data subsets in each data center are processed through the above steps based on the random sample division algorithm, and the classification accuracy of the final generated target learner is far better than that of using the data of each data center independently under a single data center. The classification accuracy of the subset training model, the method of analyzing data across data centers has better classification accuracy.
  • each data subset of it is also stored in a data center, but from the perspective of disaster tolerance, data security, and rapid response, some or all of the data in the data subset will be replicated to multiple data center.
  • This data distribution mode can be called a replication mode.
  • the specific process of analyzing data in a large data set in this mode is as follows:
  • the first step is to generate corresponding data models of each data center according to the data subsets in each data center.
  • the details are consistent with the first step in the above copy mode, and the details are not described in detail.
  • the second step is to randomly select a first preset number of initial data blocks from each data model to generate a first data block set corresponding to each data center.
  • a group of data blocks (the first preset number of initial data blocks) are randomly selected and copied to another data block. It is ensured that each data center has the first data block set of the data center, and the number of data blocks copied to other data centers is defined as M* ⁇ .
  • M is the number of the first data block set in the data subset.
  • the data subsets (B1, . . . , B12) stored in the local data center are stored, M is 12, ⁇ is 0.5, and 6 first data blocks are randomly copied each time and randomly distributed to 4 remote data centers. Then the above random selection replication will perform the operation 4 times, each time replicating to a data center. At this time, all remote data centers include a set of replicated first data blocks of a group of local data centers. In the remaining 4 remote data centers, it will also be replicated 4 times, and the data will be randomly copied to the local data center and the remaining 3 remote data centers.
  • each data center all the first data block sets Sk are merged locally and the first data block sets ⁇ S1,..., Sk-1, Sk+1,...,Si ⁇ are copied. , generating a replica subset Gk. Then, from the corresponding original first data block set Sk in the replicated subset Gk, and each replicated first data block set ⁇ S1,...,Sk-1,Sk+1,...,Si ⁇ , random A first preset number of first data blocks are selected as initial data blocks, and a first data block set corresponding to the replicated subset Gk is generated.
  • the third step is to sequentially select target data blocks from each of the first data block sets to generate a second preset number of target data sets.
  • the replicated subset Gk generated after the above-mentioned replication operation already includes the first data block set of each data center. Therefore, the target data block can be selected from the first data block set in any replication subset to generate the target data set.
  • the arbitrarily generated replicated subsets come from all other data centers that have to replicate the first set of data blocks, and the replicated subsets generated by merging are random sample data of the entire large data set.
  • the fourth step modeling analysis is performed on the target data set generated in any of the above-mentioned replicated subsets, and the analysis result can be used as a representative of the entire large data set.
  • the random forest algorithm is used as the target learner for modeling.
  • the first data block set Sk in the arbitrary replica subset Gk can be referred to.
  • the target learners trained by the four data centers are aggregated into the data analysis center, and a consensus function is used to analyze the results.
  • the test results are shown in Figure 9. From Figure 9(a), it can be found that when the sampling rate is 20%, the classification accuracy rate of more than 90% can be achieved under the three types of distribution states in the first step.
  • Figure 9(b) shows that the time overhead is linearly related to the sampling rate.
  • this embodiment further provides a data analysis device 100 across data centers, where a subset of data is stored in the data center, and the device includes:
  • the first generating module 10 is configured to generate corresponding data models of each data center according to the data subsets in each data center.
  • the third generating module 30 is configured to sequentially select target data blocks from each of the first data block sets, and generate a second preset number of target data sets.
  • the analysis module 40 is configured to train a target learner according to all the target data sets, and analyze the data in the large data set according to the target learner.
  • the third generation module 30 is further configured to:
  • the initial data blocks are randomly distributed in the first data block set, so that each of the initial data blocks randomly corresponds to The sequence number, the number of the sequence number is equal to the first preset number;
  • the third generation module 30 is further configured to:
  • the preset rule repeat i-1 times in each of the data models, and randomly acquire the first data block set each time, and the i is the number of data centers;
  • the first data block set is copied to the remaining data centers in sequence, and the current copy subsets corresponding to the respective data centers are generated; wherein, each of the copied subsets includes the data contained in the original data subsets.
  • the original first data block set, and the replicated first data block set randomly obtained from the rest of the data centers;
  • any of the replicated subsets randomly select a first preset number of first data blocks from the original first data block set corresponding to the replicated subset and each of the replicated first data block sets as the initial data block;
  • the second generation module 20 is further configured to:
  • the replication factor and the number of first data blocks in each of the data models, randomly copy a corresponding number of first data blocks in the data model each time, as a first data block set;
  • each of the data models a corresponding number of first data blocks in the data model are repeatedly copied i-1 times to obtain i-1 sets of the first data blocks.
  • the analysis module 40 is also used to:
  • a target analysis result of the data in the large data set is obtained based on a consensus function.
  • the first generating module 10 is further configured to: adopt a random sample division algorithm to process the data subsets of the respective data centers to obtain the data models of the respective data centers.
  • FIG. 11 is a schematic diagram of a terminal device 80 provided by an embodiment of the present application.
  • the terminal device 80 in this embodiment includes: a processor 803 , a memory 801 , and a computer program 802 stored in the memory 801 and executable on the processor 803 .
  • the processor 803 executes the computer program 802
  • the steps in each of the foregoing method embodiments are implemented, for example, steps S101 to S104 shown in FIG. 1 .
  • the processor 803 executes the computer program 802
  • the functions of the modules/units in the foregoing device embodiments are implemented.
  • the computer program 802 can be divided into one or more modules/units, and the one or more modules/units are stored in the memory 801 and executed by the processor 803 to complete. this application.
  • the one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 802 in the terminal device 80 .
  • the computer program 802 can be divided into a first generation module, a second generation module, a third generation module and an analysis module, and the specific functions of each module are as follows:
  • the first generating module is configured to generate corresponding data models of each data center according to the data subsets in each data center.
  • the second generation module is configured to randomly select a first preset number of initial data blocks from each of the data models, and generate a first data block set corresponding to each of the data centers.
  • the third generating module is configured to sequentially select target data blocks from each of the first data block sets, and generate a second preset number of target data sets.
  • the analysis module is used to train the target learner according to all the target data sets, and analyze the data in the large data set according to the target learner.
  • the terminal device 80 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device may include, but is not limited to, the processor 803 and the memory 801 .
  • FIG. 11 is only an example of the terminal device 80 , and does not constitute a limitation on the terminal device 80 , and may include more or less components than shown, or combine some components, or different components
  • the terminal device may further include an input and output device, a network access device, a bus, and the like.
  • the so-called processor 803 may be a central processing unit, and may also be other general-purpose processors, digital signal processors, application-specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. Wait.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 801 may be an internal storage unit of the terminal device 80 , such as a hard disk or a memory of the terminal device 80 .
  • the memory 801 may also be an external storage device of the terminal device 80, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the terminal device 80. card, Flash Card, etc.
  • the memory 801 may further include both an internal storage unit of the terminal device 80 and an external storage device.
  • the memory 801 is used to store the computer program and other programs and data required by the terminal device.
  • the memory 801 can also be used to temporarily store data that has been output or will be output.
  • the embodiments of the present application provide a computer program product, when the computer program product runs on a terminal device, so that the terminal device can implement the steps in the foregoing method embodiments when executed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Mathematical Physics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开一种跨数据中心的数据分析方法、装置、设备及存储介质,其中,方法通过各个数据中心内的数据子集,对应生成各个数据中心的数据模型;从各个数据模型中,随机选择第一预设数量的初始数据块,生成每个数据中心对应的第一数据块集合;依次从每个第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合;根据所有目标数据集合训练目标学习器,并根据目标学习器对大数据集中的数据进行分析。进而达到快速且高效地对大规模的跨数据中心的数据进行分析的目的。

Description

跨数据中心的数据分析方法、装置、设备及存储介质 技术领域
本申请涉及数据处理技术领域,具体涉及一种跨数据中心的数据分析方法、装置、设备及存储介质。
背景技术
随着数据规模的不断增长,单一数据中心存储的方式已不再适合存储数据。因此,很多公司会在多个地区建设数据中心以存储各地的用户数据。然而在对存储在各个数据中心的数据进行分析时,若只对单一数据中心的数据进行分析来度量整个大数据,其对单一数据中心进行模型训练得到的模型,对于整体大数据的分类准确率很低。若对所有数据中心的数据进行训练,则需要将大数据进行汇聚并进行模型训练,其数据汇聚的时间长,且模型训练所需的时间也非常长。因此,现有技术在对大规模的跨数据中心的数据进行分析时,存在耗时较长、效率较低的问题。
技术问题
本申请实施例的目的之一在于:提供一种跨数据中心的数据分析方法、装置、设备及存储介质,旨在解决现有技术在对大规模的跨数据中心的数据进行分析时,耗时较长、效率较低的问题。
技术解决方案
为解决上述技术问题,本申请实施例采用的技术方案是:
第一方面,提供了一种跨数据中心的数据分析方法,所述数据中心内存储有数据子集,所述方法包括:
根据各个数据中心内的数据子集,对应生成所述各个数据中心的数据模型;
从各个所述数据模型中,随机选择第一预设数量的初始数据块,生成每个所述数据中心对应的第一数据块集合;
依次从每个所述第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合;
根据所有所述目标数据集合训练目标学习器,并根据所述目标学习器对大数据集中的数据进行分析。
第二方面,本申请实施例提供了一种跨数据中心的数据分析装置,所述数据中心内存储有数据子集,所述装置包括:
第一生成模块,用于根据各个数据中心内的数据子集,对应生成所述各个数据中心的数据模型;
第二生成模块,用于从各个所述数据模型中,随机选择第一预设数量的初始数据块,生成每个所述数据中心对应的第一数据块集合;
第三生成模块,用于依次从每个所述第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合;
分析模块,用于根据所有所述目标数据集合训练目标学习器,并根据所述目标学习器对大数据集中的数据进行分析。
第三方面,本申请实施例提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面任一项所述的跨数据中心的数据分析方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质 存储有计算机程序,所述计算机程序被处理器执行时实现如第一方面任一项所述的跨数据中心的数据分析方法。
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的跨数据中心的数据分析方法。
本申请实施例与现有技术相比存在的有益效果是:通过大数据随机划分模型,对各个数据中心内的数据子集进行处理,生成数据模型;并在各个数据模型中随机选择初始数据块,对应生成第一数据块集合;之后从每个第一数据块集合中选择目标数据块,生成目标数据集合;对目标数据集合训练得到的目标学习器,即可认为是根据大数据集的数据进行训练得到的目标学习器。目标学习器对大数据中的数据进行分析时的分析准确率也满足要求,且因数据处理的量减少,数据处理的时间也相对减少,进而可实现高效对大数据进行准确分析的效果。
可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或示范性技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1是本申请一实施例提供的跨数据中心的数据分析方法的一种实现流程示意图;
图2是本申请另一实施例提供的跨数据中心的数据分析方法的一种实现流程示意图;
图3是本申请再一实施例提供的跨数据中心的数据分析方法的一种实现流程示意图;
图4是本申请一实施例提供的跨数据中心的数据分析方法中应用场景示意图;
图5是本申请一实施例提供的跨数据中心的数据分析方法中,对单独数据中心训练得到分类模型的分类准确率以及处理时长,与改进后训练得到的分类模型的分类准确率以及处理时长的比较示意图;
图6是本申请另一实施例提供的跨数据中心的数据分析方法中,对单独数据中心训练得到分类模型的分类准确率以及处理时长,与改进后训练得到的分类模型的分类准确率以及处理时长的比较示意图;
图7是本申请再一实施例提供的跨数据中心的数据分析方法中,对单独数据中心训练得到分类模型的分类准确率以及处理时长,与改进后训练得到的分类模型的分类准确率以及处理时长的比较示意图;
图8是本申请再一实施例提供的跨数据中心的数据分析方法中应用场景示意图;
图9是本申请一实施例提供的跨数据中心的数据分析方法中对数据中心内不同数据类别分布的状态下,训练得到分类模型的分类准确率以及处理时长;
图10是本申请实施例提供的跨数据中心的数据分析装置的一种结构示意图;
图11是本申请实施例提供的终端设备的结构示意图。
本发明的实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本申请。
为了说明本申请所述的技术方案,以下结合具体附图及实施例进行详细说明。
本申请实施例提供的跨数据中心的数据分析方法可以应用于平板电脑、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等终端设备上,本申请实施例对终端设备的具体类型不作任 何限制。
参照图1,图1示出了本申请实施例提供的跨数据中心的数据分析方法的实现流程图,详述如下:所述数据中心内存储有数据子集,所述方法包括:
S101、根据各个数据中心内的数据子集,对应生成所述各个数据中心的数据模型。
在应用中,上述数据中心用于存储数据子集中心的数据。对于大数据,其包含多个数据子集,每个数据子集均包含至少一个数据块,每个数据块均包含数据。其中,上述每个数据子集均可单独存储于一个数据中心,数据中心的数据没有重叠,也可以是上述每个数据子集均可一个数据中心里,也可能部分数据存储在其余数据中心里,对此不作限定。
在应用中,上述数据模型具体可为大数据随机样本划分(Random sample partition,RSP)模型,该RSP数据模型为本实施例用于跨数据中心的大规模数据分析方法的基础数据结构。具体的,随机样本划分算法基于pyspark(用Scala编程语言编写的工具)编写,生成的RSP数据模型依然存储在分布式文件系统(例如HDFS系统)之上,相对各个数据中心内的原始数据子集的数据内容,只是记录的顺序被打乱,数据内容完全一样,可以替代原始数据子集,减少在分布式文件系统存储占用。且在RSP数据模型中,一个大数据集是由一组不重叠的数据子集所表示,每个数据子集都是整个大数据集的随机样本。当需要对整个大数据集做数据分析时,可随机选取若干数据块来近似分析整个大数据集。
在应用中,RSP数据模型可以为:R i=RSP(D i),其中,i为数据中心的标识号,D i中为第i个数据中心的数据子集,R i为第i个数据中心的数据子集经过RSP数据模型进行转换后的数据块集合。RSP为用于将原始数据子集转换为RSP数据模型的转换函数。
S102、从各个所述数据模型中,随机选择第一预设数量的初始数据块,生成每个所述数据中心对应的第一数据块集合。
在应用中,上述已说明数据模型对应的各个原始数据子集转换后的数据块集合,每个数据块集合内部对应的数据内容与原始数据对应的数据内容一致,只是数据内容记录的顺序被打乱。因此,各个数据中心对应的数据模型也可认为是包含原始数据子集的内容。从上述每个数据模型中随机选择初始数据块,生成的第一数据块集合,即可认为每个第一数据块集合均为各个数据中心随机样本数据。根据大数据随机样本划分模型的定义,可认为每个第一数据块集合中的数据类型分布,与整个大数据随机分布在各个数据子集中的数据类型一致。即可认为对第一数据块集合中的数据分析结果,近似认为是对相应数据子集的数据分析结果,那么相应的,对所有第一数据块集合中的数据分析结果,即可近似认为是对大数据集中的数据进行分析的结果。
在应用中,上述初始数据块即为当前各个数据中心的数据模型包含的数据块。上述第一预设数量可以为人为根据实际需求预先设定的数量,也可以为终端随机定义的数量,对此不作限定。
在应用中,上述每个数据中心对应的第一数据块集合可以认为是:
Figure PCTCN2020098872-appb-000001
S i∈R i,其中,S i中为第i个第一数据块集合,
Figure PCTCN2020098872-appb-000002
为第i个第一数据集合中的第b个初始数据块,b为第一预设数量。
S103、依次从每个所述第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合。
在应用中,上述数据中心若有N个,则对应的第一数据块集合也会对应有N个,每个第一数据块集合中均包含多个初始数据块。从每个第一数据集合中挑选目标数据块生成目标数据集合,即可认为上述每个目标数据集合包含了第一数据集合中的目标数据块,也同时包含了其余第一数据集合中挑选的目标数据块。对应的,根据大数据随机样本划分理论,上述在一个第一数据块集合中选择的目标数据块,可近似认为该目标数据块是整个第一数 据集合中的一个近似样本数据。则对该近似样本数据(目标数据块)进行分析,即可认为是对整个第一数据集合进行分析。因此,在目标数据集合中同时包含了每个第一数据集合中的目标数据块时,可认为对目标数据集合中的数据进行分析得到的结果,即可近似认为是对大数据集中的数据进行分析得到的结果。
在应用中,上述第二预设数量可以与第一预设数据量一致,也可以不一致,对此不作限定。上述在每个第一数据块集合从选择目标数据块,可以为随机在每个第一数据块集合中进行选择,将选择到的初始数据块作为目标数据块;也可以为人为进行有目的的选择,对此不作限定。
在应用中,执行上述:依次从每个所述第一数据块集合中,选择目标数据块生成目标数据集合时,可认为是一次生成目标数据集合的动作。为生成第二预设数量的目标数据集合,上述动作需执行第二预设数量的次数。示例性的,若上述第一数据块集合具有N个,每个第一数据块集合中,具有第一预设数量的初始数据块。则可每次在每个第一数据块集合中,挑选一个初始数据块,则生成的目标数据集合中包含了N个第一数据块。之后每个第一数据块集合中则有第一预设数量-1的初始数据块可被选择,再次重复上述步骤依次从每个第一数据块集合中剩余初始数据块选择一个目标数据块,生成目标数据集合。则可生成的目标数据集合的个数,则可与第一预设数量的个数一致。
S104、根据所有所述目标数据集合训练目标学习器,并根据所述目标学习器对大数据集中的数据进行分析。
在应用中,上述S103已说明对目标数据集合中的数据进行分析得到的结果,即可近似认为是对大数据集中的数据进行分析得到的结果。则在对具有第二预设数量的目标数据集合进行训练得到的目标学习器,即可认为是对整个大数据集中的数据进行训练的目标学习器。之后可通过目标学习器对大数据集中的数据进行分析,得到对应的分析结果。
在本实施例中,通大数据随机划分模型,对各个数据中心内的数据子集进行处理,生成各个数据中心的数据模型;并在各个数据模型中随机选择初始数据块,生成可代表每个数据中心对应的第一数据块集合;之后从每个第一数据块集合中,选择目标数据块,生成可代表第一数据块集合的目标数据集合;对目标数据集合训练得到的目标学习器,即可认为是根据大数据集的数据进行训练得到目标学习器。其目标学习器对大数据中的数据进行分析时的分析类准确率也满足要求,且因数据处理的量减少,数据处理的时间也相对减少,进而可实现高效对大数据进行准确分析的效果。
参照图2,在一实施例中,所述各个数据中心存储的数据子集之间没有重叠;S103包括:
S201、获取每个所述第一数据块集合中,各个所述初始数据块的排序号;所述初始数据块随机分布在所述第一数据块集合中,以使得每个所述初始数据块随机对应所述排序号,所述排序号的个数与所述第一预设数量相等。
在应用中,上述各个数据中心存储的数据子集之间没有重叠,即可认为是大数据集中的每个数据自己分别存储在一个数据中心内,每个数据中心内没有一致的数据内容。在此种情况下,该数据中心对数据子集进行存储,比较节省存储空间,数据管理比较简单,可认为其为无复制模式。
在应用中,上述S102已说明第一数据块集合是从各个所述数据模型中,随机选择第一预设数量的初始数据块生成的,即可认为上述各个第一数据块块集合包含第一预设数量的初始数据块。上述排序号可以是字母(A、B、...、Z),也可以是数字(1、2、...),对此不作限定。可认为,对于每个上述第一数据块集合中的各个初始数据块,均有单独对应的排序号,进行标识。具体可参照上述S102中的
Figure PCTCN2020098872-appb-000003
S i∈R i,每个第一数据块集合中,均有1-b序列号对应的初始数据块。
S202、依次将每个所述第一数据块集合中,具有相同所述排序号的初始数据块作为目 标数据块进行汇聚,生成所述第二预设数量的目标数据集合;其中,所述第一预设数量与第二预设数量相等。
在应用中,上述将相同排序号的初始数据块作为目标数据块进行汇聚,即为对于i个数据块集合,将每个第一数据集合中,序列相同的初始数据块进行汇聚,生成的每个目标数据集合中则包含有i个来自不同数据中心的初始数据块(目标数据块),生成的目标数据集合的数量即为每个第一数据块集合中的初始数据块的个数。具体的,上述每个目标数据集合可以认为是
Figure PCTCN2020098872-appb-000004
其中,
Figure PCTCN2020098872-appb-000005
可以认为是第i个第一数据块集合中,排序号为b的初始数据块作为目标数据块,则
Figure PCTCN2020098872-appb-000006
代表每个目标数据集合中,排序号为b的目标数据块生成的目标数据集合。因第二预设数量为b个,因此,排序号对应有b个,生成的目标数据集合也会有b个,而每个目标数据集合中的数据块,则对应与第一数据块集合的个数(数据中心的个数)i相等。则所有目标数据集合可定义为:
Figure PCTCN2020098872-appb-000007
在本实施例中,通过将每个第一数据块集合中,具有相同排序号的初始数据块作为目标数据块进行汇聚,使生成的目标数据集合均有每个数据中心的初始数据块。生成的目标数据集合也对应有多个,使得根据所有目标数据集合进行训练得到的目标学习器,更能准确对大数据集中的数据进行分析,提高目标学习对大数据集中的数据进行分析的准确率。且基于大数据样本随机化理论,初始数据块为每个数据中心的一个随机样本,则生成的目标数据集合为则可为所有数据中心(大数据集)的一个随机样本,对目标数据集合进行训练得到的目标学习器,即可认为是对大数据集进行训练得到的目标学习器。
在一实施例中,所述各个数据中心存储的数据子集之间没有重叠;S103包括:
依次从每个所述第一数据块集合中,随机选择至少一个初始数据块作为目标数据块。
在应用中,上述102已说明第一数据块集合是从各个所述数据模型中,随机选择第一预设数量的初始数据块生成的,即可认为上述各个第一数据块块集合包含第一预设数量的初始数据块。即若第一预设数量为b,则对于上述S201记载的每个第一数据块集合中的b个初始数据块,
Figure PCTCN2020098872-appb-000008
S i∈R i,可每次随机挑选至少一个初始数据块,作为目标数据块。其中,对于每个第一数据块集合中,是否挑选排序号相同的初始数据块不作要求。
每次汇聚每个所述第一数据块集合中的目标数据块,作为目标数据集合,直到生成所述第二预设数量的目标数据集合。
在应用中,每次从第一数据块集合中挑选目标数据块的个数可以相等,也可以不相等,为使生成的目标数据集合包含的各个数据中心块更均配,在此情况下,可以使选择的目标数据块的个数相等。使目标数据集合中的数据内容不会更偏向与某个数据中心的内容,使得根据该目标数据集合进行训练得到的目标学习器的泛化能力更强。
在应用中,上述每个第一数据集合中具有b个初始数据块,对于每次选择的目标数据块的个数为多个时,其对应的生成的目标数据集合的第二预设数量则可以与第一预设数量不同;也可以为每次对b个初始数据块进行随机组合进行获取,其随机组合的次数可以为第一预设次数,则生成的目标数据块的的第二预设数量还是可与第一预设数量一致,对此不作限定。
在本实施例中,通过在每个第一数据块集合中,随机将选择初始数据块作为目标数据块进行汇聚,使生成的目标数据集合均有每个数据中心的初始数据块,生成的目标数据集合也对应有多个,进而根据所有目标数据集合进行训练得到的目标学习器,更能准确对大数据集中的数据进行分析,提高目标学习对大数据集中的数据进行分析的准确率。且终端 无需对每个第一数据块集合中的各个初始数据块进行排序,减少了操作过程,加快目标学习器的训练。
参照图3,在一实施例中,所述大数据集中的每个所述数据子集中的部份或者全部数据分散存储于多个数据中心;S102包括:
S301、根据预设规则,在每个所述数据模型中重复i-1次,每次随机获取第一数据块集合,所述i为数据中心的个数。
在应用中,上述大数据集中的每个数据子集中的部份或者全部数据分散存储于多个数据中心。具体的,一个大数据集,它的每个数据子集也是分别存储在一个数据中心,但是基于容灾、数据安全、快速响应角度考虑,每个数据子集中的部份或者全部数据内容会复制到其余多个数据中心。即每个数据子集可能只存储在一个数据中心,也可能被复制到其他数据中心,在此情况下,可认为其为无复制模式。
在应用中,上述预设规则可以为根据每个数据子集中的第一数据块集合的个数M,设定一个复制因子γ,0≤γ≤1。随机挑选M*γ个数的第一数据块集合;也可以为在每个数据子集中的第一数据块集合中,随机挑选指定数量的第一数据块集合,对此不作限定。
在应用中,对于数据中心的个数具有i个,那么对于其中一个数据中心,需要从该数据中心的数据子集中,随机获取i-1次第一数据块集合,每次获取的第一数据块集合中的数据内容因是随机获取的,i-1个第一数据块集合的内容可能完全一样,也可能部分一样,或者完全不一样,对此不做限定。
S302、对应将所述第一数据块集合依次复制到其余所述数据中心,生成当前所述各个数据中心对应的复制子集;其中,每个所述复制子集包括原有所述数据子集包含的原有第一数据块集合,以及从其余所述数据中心随机获取的复制第一数据块集合。
在应用中,上述每个复制子集包括原有数据子集包含的原有第一数据块集合,以及从其余数据中心随机获取的复制第一数据块集合。上述原有第一数据块集合即为上述S301中每个数据子集中的M个第一数据块集合,上述从其余数据中心随机获取的复制第一数据块集合,即为从其余每个数据中心里,均获取的M*γ个数的第一数据块集合。
具体的,上述当前各个数据中心对应的复制子集的表达式具体可以为:G k={S1,S2,...,Sk,...,Si},其中,Gk为第k个数据中心当前对应的复制子集,Sk为第k个数据中心的原有第一数据块集合,Si为从第i个数据中心内复制的第一数据块集合。
S303、针对任意所述复制子集,从所述复制子集对应的所述原有第一数据块集合,以及各个所述复制第一数据块集合中,随机选择第一预设数量的第一数据块作为初始数据块。
在应用中,上述数据中心有i个,因此,生成的各个数据中心对应的复制子集也具有i个。上述针对任意复制子集,从复制子集中随机选择第一预设数量的第一数据块作为初始数据块,可认为是从i个复制子集中,任意随机挑选一个复制子集进行选择初始数据块。然而,当前各个数据中心内的复制子集,还包含了其余各个数据中心的数据内容(各个数据中心随机复制的复制第一数据块集合)。因此,从任意复制子集中的原有第一数据块集合,以及各个复制第一数据块集合中,随机选择第一预设数量的第一数据块作为初始数据块。即可认为是S102中的,从各个数据模型中随机选择第一预设数量的初始数据块。
在应用中,从第一数据块集合中选择第一预设数量的第一数据块作为初始数据块。可认为每个数据模型中的第一数据块集合中均由多个第一数据块组合而成,而在多个第一数据块中被选择出来的数据块,才认为是初始数据块。
S304、根据所述初始数据块,生成每个所述数据中心对应的第一数据块集合。
在应用中,使用上述S302中的当前各个数据中心对应的复制子集的表达式: G k={S1,S2,...,Sk,...,Si},Sk为第k个数据中心的原有第一数据块集合,Si为从第i个数据中心内复制的第一数据块集合,Gk为第k个数据中心当前对应的复制子集(即可认为此时的Gk可近似认为是大数据集)。以及上述S102中的代表式:
Figure PCTCN2020098872-appb-000009
S i中为第i个第一数据块集合,
Figure PCTCN2020098872-appb-000010
为第i个第一数据集合中的第b个初始数据块,b为第一预设数量。则可知,若从S1中选择第一预设数量的第一数据块作为初始数据块,即为S102中的i等于1时的表达式,
Figure PCTCN2020098872-appb-000011
也即可认为S102中的数据模型等同于S302中的复制子集。之后可在Gk中的各个数据中心内复制的第一数据块集合(Si)中,使用上述S103至S104之间的步骤,进行训练目标学习器。
在本实施例中,在大数据集中的每个数据子集中的部份或者全部数据分散存储于多个数据中心的情况下,为了使得根据每个数据中心对应的第一数据块集合训练得到的目标学习器,能够更好对大数据集进行分析,则可在每个数据中心里,重复i-1次,每次随机获取其余数据中心一定比例的第一数据块集合,使得复制之后的每个数据中心能够近似的代表大数据集。相比于大数据集中的数据存储占比,每个数据中心的复制子集的数据存储占比减少,使得数据处理的时间也相对减少,进而可实现高效对大数据进行准确分析的效果。
在一实施例中,S301包括:
获取所述数据模型中的复制因子。
根据所述复制因子,与每个所述数据模型中第一数据块的个数,每次随机复制所述数据模型中对应数量的第一数据块,作为第一数据块集合。
在每个所述数据模型中重复复制i-1次所述数据模型中对应数量的第一数据块,得到i-1个所述第一数据块集合。
在应用中,S301已经说明如何根据复制因子与第一数据块的个数复制第一数据库集合,对此不在详细说明。其中,γ可以为0.9,使其在复制的第一数据块集合在尽可能趋近于数据模型完整的第一数据块的情况下,减少复制的第一数据集合在其余数据中心内的存储空间。另外,对于得到i-1个所述第一数据块集合也已进行说明,对此不在重复解释。
在本实施例中,通过设置复制因子,与每个数据模型中第一数据块的个数,进行确定第一数据块集合,使得生成的任意数据中心对应的复制子集中,数据内容对应的各个类别的比值,更接近于实际大数据集中数据内容对应的各个类别的比值,使其根据任意数据中心对应的复制子集,进行生成的每个数据中心对应的第一数据块集合,根据第一数据块集合进行训练得到的目标学习器,对大数据集中数据的进行分析的准确率更高。
在一实施例中,S104包括:
根据每个所述目标数据集合中的所有所述目标数据块,训练每个所述目标数据集合对应的目标学习器。
在应用中,所有目标数据集合的表达式为:
Figure PCTCN2020098872-appb-000012
上述每个
Figure PCTCN2020098872-appb-000013
得均包含从大数据集中的每个数据中心得到的随机样本数据。因此,可使用它去估计一个大数据集的统计性函数或者构建一个机器学习模型。因所有目标数据集合G是大数据集的一个随机样本数据,因此它有着合大数据集相同的统计属性,分析所有目标数据集合G可以得到大数据集的近似结果。且目标数据集合G的数据规模是远小于大数据集,因此,它可以在中央数据中心以并行或者分布式的方式对每个目标数据集合快速训练。
在应用中,上述训练目标数据集合得到目标学习器,其可为常见的神经网络模型训练, 如使用随机森林算法作为建模的目标学习器,使训练的目标学习器可对数据进行分类处理,对此不做详细描述。
根据所有所述目标学习器,依次对所述大数据集中的数据进行分析,获得每个所述目标学习器的分析结果。
根据所有所述分析结果,基于共识函数得出所述大数据集中数据的目标分析结果。
在应用中,需根据每个目标数据集合中的数据,对每个目标数据集合进行训练应目标学习器f b,其中,f b为第b个目标数据集合进行训练得到的目标学习器。在得到上述所有目标数据集合后,可将所有目标数据集合存储到数据分析中心内,并将每个目标数据集合中的数据进行分布式存储,使其存储在数据分析中心的各个节点上,且相互之间没有通信交互。进而可实现对每个目标数据集合同时进行训练得到对应的目标学习器,大大减少训练时间。
在应用中,由于上述各个目标数据集合均是大数据集中的一个随机样本数据,因此,每一个目标学习器f b,都是对大数据集的一次抽样训练,综合所有目标学习器的结果即构成一个对大数据集合进行训练得到的集成模型:F=θ(f 1,f 2,...,f b),其中,θ是集成模型的共识函数。F的分析结果即近似为大数据集的分析结果。其中,共识函数的定义为,对于b个目标学习器,使其对一个数据进行分析时将有b个分类结果,而对于b个分类结果中,某个分类结果的个数最多,则将该分类结果确定为对该数据进行分析得到的分析结果。
在应用中,上述S302中记载:对应将所述第一数据块集合依次复制到其余所述数据中心,生成当前所述各个数据中心对应的复制子集。即S302可生成i个Gk的复制子集,而后任意选择一个Gk进行使用上述S103至S104之间的步骤,训练目标学习器,即对Gk训练一个集成模型F。然而,在实际情况下也可以随机选择多个,或者全部复制子集,使用上述S103至S104之间的步骤,得到每个复制子集中的各个目标数据集合对应的目标学习器,即对应得到每个复制子集的集成模型F。因此,为了使训练得到的集成模型F在对数据进行分析时可以得到更优结果。可在训练之后得到的多个集成模型F中进一步挑选最优的目标学习器f b组成的集成模型F。
在本实施例中,通过对每个目标数据集合进行训练对应得到目标学习器,之后对数据进行分析时,使用共识函数获取最终的分析结果,使训练得到的集成模型对数据进行分析的准确率更高。
在一实施例中,采用随机样本划分算法,对所述各个数据中心的数据子集进行处理,获得所述各个数据中心的数据模型。已在S101中进行描述,对此不再详细说明。
在一具体实施例中,本实施例使用了5个数据中心,其中1个本地数据中心,4个AWS(亚马逊云计算服务)数据中心。本地数据中心位于深圳大学,另外四个数据中心分别位于,印度孟买,韩国首尔,澳大利亚悉尼,美国北弗吉尼亚。在本地数据中心,使用5个节点的hadoop(分布式系统基础架构)环境,每个节点包含24核cpu,128G内存,8TB磁盘存储。另外4个AWS数据中心,使用亚马逊的EC2(可让使用者可以租用云端电脑运行所需应用的系统)hadoop微实例。由于性能原因,本实施例使用本地数据中心的hadoop环境做数据分析,远端AWS数据中心用于测试数据传输的时间开销。对于将大数据集中各个数据子集分别存储在一个数据中心,且各个数据中心存储的数据子集之间没有重叠,这种数据分布模式可称为无复制模式。在该模式下进行对大数据集中的数据进行分析的具体过程如下:
第一步,根据各个数据中心内的数据子集,对应生成各个数据中心的数据模型。一个大数据集,它的各个数据子集分散存储在各个数据中心,数据子集之间的数据没有重叠。 生成RSP数据模型的具体步骤采用的随机样本划分算法基于已有的大数据随机采样数据子块的划分及装置进行实现。具体可参照S101记载的内容,对此不在详细描述。
在实际示例中,可通过人工生成了一个90GB大小的数据,该数据包含100个特征、500个类别、1亿条记录。可使用三种方式分发数据子集到4个远端数据中心,用于模拟数据的不同状态。
第一种方式是,模拟类别独立(类别1),即各个数据中心之间类别无交集。将90G数据划分为4份,每一份包含125个类别。在本地数据中心使用随机样本数据划分算法,分别对4份数据生成RSP数据模型,最后将4个RSP数据模型分别上传到相应的AWS数据中心。例如,第一份上传到孟买AWS数据中心DC1,第二份上传到首尔AWS数据中心DC2,第三份上传到澳大利亚悉尼AWS数据中心DC3,第四份上传到周AWS数据中心DC4,不同的数据中心所包含的类别不同。
第二种方式是,模拟不平衡类别(类别2),即在一个数据中心某个类别记录远多于其他类别。将90G数据分为4份,第一份包含70%的记录是0-124类别,剩下30%是其他类别。第二份包含70%的记录是125-249类别,剩下30%是其他类别。第三份包含70%的记录是250-374类别,剩下的30%是其他类别。第四份包含70%的记录是375-499类别,剩下的30%是其他类别。在本地数据中心使用随机样本数据划分算法,分别对四份数据生成RSP数据模型,最后分别将4份数据上传到相应的AWS数据中心(DC1、DC2、DC3、DC4)。
第三种方式是,模拟平衡类别(类别3),即每个数据中心所有类别记录数目均匀分布。将90G数据的500个类别的记录数均匀分为4份,在本地数据中心使用随机样本数据划分算法,分别对四份数据生成RSP数据模型,最后分别将4份数据上传到相应的AWS数据中心(DC1、DC2、DC3、DC4)。
第二步,从各个数据模型中,随机选择第一预设数量的初始数据块,生成每个数据中心对应的第一数据块集合。本实施例分别在上述三种类别分布方式下做了随机块抽取,由于RSP数据模型中的每个初始数据块均为数据子集的随机样本数据,实际工作中,简单顺序抽取数据块与随机化抽取数据块最终效果没有太大差别。
第三步,将各个数据中心抽取的第一数据块集合下载到数据分析中心。本实施例使用本地数据中心充当数据分析中心,本地数据中心位于深圳大学校内。该环节可度量从各个数据中心传输第一数据块集合到数据分析中心的时间开销。具体可参照图4中的数据传输。相应的,本实施例的RSP数据模型采用了两种数据块大小来测试,一种是块大小为1MB,另一种是块大小1GB。另外,当初始数据块大小为1GB时,平均传输时间开销为53分钟,该时间是从悉尼传输到深圳的开销,因这种下载操作通常只需要执行一次,因此块大小为1GB时的时间开销在实际工作中是可被接受的。其中,数据块大小为1MB时,传输第一数据块集合到数据分析中心的具体时间开销如下表1:
Figure PCTCN2020098872-appb-000014
其中,数据块大小为1GB时,传输第一数据块集合到数据分析中心的具体时间开销如下表2:
Figure PCTCN2020098872-appb-000015
Figure PCTCN2020098872-appb-000016
第四步,依次从每个第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合。将上述每个数据中心随机抽取并生成的第一数据块集合S i(i为数据中心个数),下载到数据分析中心,数据分析中心将得到4个第一数据块集合。合并4个第一数据块集合得到所有目标数据集合G,其中G表示如下:
Figure PCTCN2020098872-appb-000017
此时,则
Figure PCTCN2020098872-appb-000018
代表4个目标数据集合中,排序号为b的目标数据块生成的目标数据集合,即
Figure PCTCN2020098872-appb-000019
基于随机样本划分理论,因为第一数据块集合S i为第i个数据子集中的随机样本数据。因此,所有目标数据集合G则为大数据集的随机样本数据,对数据集合G的数据分析结果,可近似为对数据集的数据分析。
第五步,根据所有目标数据集合训练目标学习器,并根据目标学习器对大数据集中的数据进行分析。在所有目标数据集合G上使用基于RSP的集成学习方法如下:对所有目标数据集合G的每个目标数据集合训练一个目标学习器f b,由于目标数据集合是分布式存储在各个节点上,相互之间没有通信开销,每个目标学习器的训练可以同时进行,大大减少训练时间。且各个目标数据集合都是大数据集的一个随机样本数据,因此,每一个目标学习器f b,都是对大数据集的一次抽样训练,综合所有目标学习器的结果即够成一个集成模型:F=θ(f 1,f 2,...,f b)。
本实施例试验中采用分类算法中的随机森林算法作为基学习器,共识函数使用avg函数。实验中,分别对步骤1中的三种类别分布使用随机森林做了数据分析,第一种类别独立模式下,分布数据分析时间开销与分类准确率如图5所示,因为各个数据中心的数据只能覆盖25%的类别。具体可参照图5(a)中各个数据中心基于单个数据子集进行训练的模型,其分类准确率最多只能到25%,说明不能单纯使用一个数据中心的数据来度量整个大数据集。图5(a)中Center DC(数据分析中心)表示的曲线是合并各个数据中心的目标数据集合后训练的模型准确率,可以看到其分类准确率达到了90%以上的准确率。同时图5(a)中曲线也显示了只需要用每个数据中心里少量的目标数据集合就足以满足所需准确率,目标数据集合中数据块数目的增长(分段抽样比例)并不能显著带来分类准确率的增长。第二种类别不平衡模式下,数据分析时间开销与分类准确率如图6(a)中所示,每个数据中心数据严重偏向125个类别,其他的375个类别只占30%。独立使用各个数据中心的数据子集训练模型的分类准确率,同样远不及使用合并各个数据中心目标数据集合后的训练的模型准确率。第三种类别平衡模式下,数据分析时间开销与分类准确率如图7(a)中所示,由于各个数据中心的数据子集类别覆盖均衡,图7(a)中基于各个数据中心数据子集训练的模型分类准确率可以达到73%。但是这种数据存储模式在实际工作中很难出现。而合并各个数据中心目标数据集合后,在数据中心进行训练的模型分类准确率可达到90%。
相应的,如图5(b)、图6(b)、图7(b)所示,以上述三种方式训练模型的性能有着相似的计算模式,时间开销基本上是线性增长,数据处理时间与数据量大小显著相关。由此可看出基于随机样本划分算法对各个数据中心内的数据子集经过上述步骤进行处理,最后生成的目标学习器的分类准确率远胜于,单个数据中心下独立使用各个数据中心的数据子集训练模型的分类准确率,其对跨数据中心的数据进行分析的方法分类准确率更优。
在另一具体实施例中,还是使用上述5个数据中心以及相应数据,具体提可参照上述具体实施例的内容。此时,一个大数据集,它的每个数据子集也是分别存储在一个数据中心,但是基于容灾、数据安全、快速响应角度考虑,数据子集中的部份或者全部数据会复制到多个数据中心。这种数据分布模式可称为复制模式,在该模式下进行对大数据集中的数据进行分析的具体过程如下:
第一步,根据各个数据中心内的数据子集,对应生成各个数据中心的数据模型。具体与上述复制模式下的第一步一致,具体的不在详细说明。
第二步,在从各个数据模型中,随机选择第一预设数量的初始数据块,生成每个数据中心对应的第一数据块集合。从这步骤开始与复制模式下的第二步骤具体操作方式具有一定区别。具体的,在每个数据中心内数据复制,对每个数据中心的第一数据块集合S i,在其中随机选择一组数据块(第一预设数量的初始数据块)复制到另外一个数据中心,保证每个数据中心均有该数据中心的第一数据块集合,复制到其他数据中心的数据块数目定义为M*γ。其中,0≤γ≤1,γ定义为复制因子,M为数据子集中第一数据块集合的个数。示例性的,如图8所示,在本实施例中共有一个本地数据中心DC1以及4个远端数据中心(DC2、DC3、DC4、DC5),即有5个数据中心。若将存储在本地数据中心的数据子集(B1,...,B12),M为12,γ为0.5,每次随机复制6个第一数据块随机分散到4个远端数据中心。则上述随机选择复制将操作执行4次,每次复制到一个数据中心。此时,所有远端数据中心均包含有一组本地数据中心的复制第一数据块集合。在其余4个远端数据中心里,也将对应复制4次,将数据随机复制到本地数据中心以及其余3个远端数据中心内部。则上述复制工作完成后,在每个数据中心合并本地所有的第一数据块集合Sk以及复制第一数据块集合{S1,...,Sk-1,Sk+1,...,Si},生成复制子集Gk。而后从复制子集Gk中对应的原有第一数据块集合Sk,以及各个复制第一数据块集合{S1,...,Sk-1,Sk+1,...,Si}中,随机选择第一预设数量的第一数据块作为初始数据块,生成复制子集Gk对应的第一数据块集合。
在其他示例中,若上述本地数据中心为大数据集的存储中心,即上述B1,...,B12为大数据集,而为了减少训练大数据集的训练量,采用随机样本划分方法对大数据集进行划分。即也可参照图8所示,此时本地数据中心DC1包含大数据集(B1,...,B12),依次随机复制M*γ最终个第一数据块集合至其余远端数据中心内(DC2,DC3,DC4,DC5)。而后可直接对其于4个数据中心内的数据执行S101-S104中的步骤,对此不作限定。
第三步,依次从每个第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合。实际工作中,上述复制操作结束后生成的复制子集Gk已经包含了每个数据中心的第一数据块集合。因此,可在任意复制子集里面的第一数据块集合中进行挑选目标数据块,生成目标数据集合。任意生成的复制子集均有来自于其他所有数据中心得复制第一数据块集合,合并生成的复制子集即为整个大数据集的随机样本数据。
第四步,对任意上述复制子集中生成的目标数据集合进行建模分析,分析结果可作为整个大数据集的代表。在本发明实施例中,使用随机森林算法作为建模的目标学习器,具体可参照第一种模式下的第四步以及第五步,在任意复制子集Gk中的第一数据块集合Sk以及复制第一数据块集合{S1,...,Sk-1,Sk+1,...,Si},随机挑选目标数据块生成b个目标数据集合G,根据每个目标数据集合对应训练一个目标学习器f b,并将所有目标学习器进行 集成得到集成模型F=θ(f 1,f 2,...,f b),对大数据集中的数据进行分析。在此种情况下,对第一步中三种类别分布状态下的分类准确率均可达到90%。
在其他示例中,上述第四步还可以为:对所有上述复制子集中生成的目标数据集合进行建模分析,分析结果可作为整个大数据集的代表。即对于i个数据中心,则有i个第四步骤得到的集成模型F=θ(f 1,f 2,...,f b)。此时,在数据分析中心将i个集成中模型F中的各个目标学习器f b进行汇聚至数据分析中心,则将有i*b个目标学习器,将所有目标学习器构造新的集成模型。即综合所有目标学习器的结果够成一个集成模型:F =θ(f 1,f 2,...,f i*b)。
具体的,在本发明实施例中,将4个数据中心训练好的目标学习器汇聚到数据分析中心,采用共识函数进行分析结果。试验结果如图9所示,从图9(a)中可以发现,当抽样率在20%时,第一步中三种类别分布状态下,均能达到90%以上的分类准确率。图9(b)显示,时间开销与抽样率线性相关。
综上可知,在复制第一数据块集合完成后,每个数据中心基本都拥有了大数据集的随机样本数据,合并生成新的复制子集具有类似原始大数据集的统计特征。因此,在任意数据中心处理复制子集均能得到与处理原始大数据集近似的结果。
如图6所示,本实施例还提供一种跨数据中心的数据分析装置100,所述数据中心内存储有数据子集,所述装置包括:
第一生成模块10,用于根据各个数据中心内的数据子集,对应生成所述各个数据中心的数据模型。
第二生成模块20,用于从各个所述数据模型中,随机选择第一预设数量的初始数据块,生成每个所述数据中心对应的第一数据块集合。
第三生成模块30,用于依次从每个所述第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合。
分析模块40,用于根据所有所述目标数据集合训练目标学习器,并根据所述目标学习器对大数据集中的数据进行分析。
在一实施例中,所述各个数据中心存储的数据子集之间没有重叠;第三生成模块30还用于:
获取每个所述第一数据块集合中,各个所述初始数据块的排序号;所述初始数据块随机分布在所述第一数据块集合中,以使得每个所述初始数据块随机对应所述排序号,所述排序号的个数与所述第一预设数量相等;
依次将每个所述第一数据块集合中,具有相同所述排序号的初始数据块作为目标数据块进行汇聚,生成所述第二预设数量的目标数据集合;其中,所述第一预设数量与第二预设数量相等。
在一实施例中,所述各个数据中心存储的数据子集之间没有重叠;第三生成模块30还用于:
依次从每个所述第一数据块集合中,随机选择至少一个初始数据块作为目标数据块;
每次汇聚每个所述第一数据块集合中的目标数据块,作为目标数据集合,直到生成所述第二预设数量的目标数据集合。
在一实施例中,所述大数据集中的每个所述数据子集中的部份或者全部数据分散存储于多个数据中心;第二生成模块20还用于:
根据预设规则,在每个所述数据模型中重复i-1次,每次随机获取第一数据块集合,所述i为数据中心的个数;
对应将所述第一数据块集合依次复制到其余所述数据中心,生成当前所述各个数据中心对应的复制子集;其中,每个所述复制子集包括原有所述数据子集包含的原有第一数据块集合,以及从其余所述数据中心随机获取的复制第一数据块集合;
针对任意所述复制子集,从所述复制子集对应的所述原有第一数据块集合,以及各个所述复制第一数据块集合中,随机选择第一预设数量的第一数据块作为初始数据块;
根据所述初始数据块,生成每个所述数据中心对应的第一数据块集合。
在一实施例中,第二生成模块20还用于:
获取所述数据模型中的复制因子;
根据所述复制因子,与每个所述数据模型中第一数据块的个数,每次随机复制所述数据模型中对应数量的第一数据块,作为第一数据块集合;
在每个所述数据模型中重复复制i-1次所述数据模型中对应数量的第一数据块,得到i-1个所述第一数据块集合。
在一实施例中,分析模块40还用于:
根据每个所述目标数据集合中的所有所述目标数据块,训练每个所述目标数据集合对应的目标学习器;
根据所有所述目标学习器,依次对所述大数据集中的数据进行分析,获得每个所述目标学习器的分析结果;
根据所有所述分析结果,基于共识函数得出所述大数据集中数据的目标分析结果。
在一实施例中,所述第一生成模块10还用于:采用随机样本划分算法,对所述各个数据中心的数据子集进行处理,获得所述各个数据中心的数据模型。
图11是本申请一实施例提供的终端设备80的示意图。如图11所示,该实施例的终端设备80包括:处理器803、存储器801以及存储在所述存储器801中并可在所述处理器803上运行的计算机程序802。所述处理器803执行所述计算机程序802时实现上述各个方法实施例中的步骤,例如图1所示的步骤S101至S104。或者,所述处理器803执行所述计算机程序802时实现上述各装置实施例中各模块/单元的功能。
示例性的,所述计算机程序802可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器801中,并由所述处理器803执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序802在所述终端设备80中的执行过程。例如,所述计算机程序802可以被分割成第一生成模块、第二生成模块、第三生成模块和分析模块,各模块具体功能如下:
第一生成模块,用于根据各个数据中心内的数据子集,对应生成所述各个数据中心的数据模型。
第二生成模块,用于从各个所述数据模型中,随机选择第一预设数量的初始数据块,生成每个所述数据中心对应的第一数据块集合。
第三生成模块,用于依次从每个所述第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合。
分析模块,用于根据所有所述目标数据集合训练目标学习器,并根据所述目标学习器对大数据集中的数据进行分析。
所述终端设备80可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器803、存储器801。本领域技术人员可以理解,图11仅仅是终端设备80的示例,并不构成对终端设备80的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器803可以是中央处理单元,还可以是其他通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、 分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器801可以是所述终端设备80的内部存储单元,例如终端设备80的硬盘或内存。所述存储器801也可以是所述终端设备80的外部存储设备,例如所述终端设备80上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。在一个实施例中,所述存储器801还可以既包括所述终端设备80的内部存储单元也包括外部存储设备。所述存储器801用于存储所述计算机程序以及所述终端设备所需的其他程序和数据。所述存储器801还可以用于暂时地存储已经输出或者将要输出的数据。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行时实现可实现上述各个方法实施例中的步骤。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (15)

  1. 一种跨数据中心的数据分析方法,其特征在于,所述数据中心内存储有数据子集,所述方法包括:
    根据各个数据中心内的数据子集,对应生成所述各个数据中心的数据模型;
    从各个所述数据模型中,随机选择第一预设数量的初始数据块,生成每个所述数据中心对应的第一数据块集合;
    依次从每个所述第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合;
    根据所有所述目标数据集合训练目标学习器,并根据所述目标学习器对大数据集中的数据进行分析。
  2. 如权利要求1任一所述的跨数据中心的数据分析方法,其特征在于,所述各个数据中心存储的数据子集之间没有重叠;
    所述依次从每个所述第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合,包括:
    获取每个所述第一数据块集合中,各个所述初始数据块的排序号;所述初始数据块随机分布在所述第一数据块集合中,以使得每个所述初始数据块随机对应所述排序号,所述排序号的个数与所述第一预设数量相等;
    依次将每个所述第一数据块集合中,具有相同所述排序号的初始数据块作为目标数据块进行汇聚,生成所述第二预设数量的目标数据集合;其中,所述第一预设数量与第二预设数量相等。
  3. 如权利要求1所述的跨数据中心的数据分析方法,其特征在于,所述各个数据中心存储的数据子集之间没有重叠;
    所述依次从每个所述第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合,包括:
    依次从每个所述第一数据块集合中,随机选择至少一个初始数据块作为目标数据块;
    每次汇聚每个所述第一数据块集合中的目标数据块,作为目标数据集合,直到生成所述第二预设数量的目标数据集合。
  4. 如权利要求1所述的跨数据中心的数据分析方法,其特征在于,所述大数据集中的每个所述数据子集中的部份或者全部数据分散存储于多个数据中心;
    所述从各个所述数据模型中,随机选择第一预设数量的初始数据块,生成每个所述数据中心对应的第一数据块集合,包括:
    根据预设规则,在每个所述数据模型中重复i-1次,每次随机获取第一数据块集合,所述i为数据中心的个数;
    对应将所述第一数据块集合依次复制到其余所述数据中心,生成当前所述各个数据中心对应的复制子集;其中,每个所述复制子集包括原有所述数据子集包含的原有第一数据块集合,以及从其余所述数据中心随机获取的复制第一数据块集合;
    针对任意所述复制子集,从所述复制子集对应的所述原有第一数据块集合,以及各个所述复制第一数据块集合中,随机选择第一预设数量的第一数据块作为初始数据块;
    根据所述初始数据块,生成每个所述数据中心对应的第一数据块集合。
  5. 如权利要求4所述的跨数据中心的数据分析方法,其特征在于,所述根据预设规则,在每个所述数据模型中重复i-1次,每次随机获取第一数据块集合,包括:
    获取所述数据模型中的复制因子;
    根据所述复制因子,与每个所述数据模型中第一数据块的个数,每次随机复制所述数据模型中对应数量的第一数据块,作为第一数据块集合;
    在每个所述数据模型中重复复制i-1次所述数据模型中对应数量的第一数据块,得到i-1个所述第一数据块集合。
  6. 如权利要求1-5任一所述的跨数据中心的数据分析方法,其特征在于,所述根据所有所述目标数据集合训练目标学习器,并根据所述目标学习器对所述大数据集中的数据进行分析,包括:
    根据每个所述目标数据集合中的所有所述目标数据块,训练每个所述目标数据集合对应的目标学习器;
    根据所有所述目标学习器,依次对所述大数据集中的数据进行分析,获得每个所述目标学习器的分析结果;
    根据所有所述分析结果,基于共识函数得出所述大数据集中数据的目标分析结果。
  7. 如权利要求6所述的跨数据中心的数据分析方法,其特征在于,所述根据各个数据中心内的数据子集,对应生成所述各个数据中心的数据模型,包括;
    采用随机样本划分算法,对所述各个数据中心的数据子集进行处理,获得所述各个数据中心的数据模型。
  8. 一种跨数据中心的数据分析装置,其特征在于,所述数据中心内存储有数据子集,所述装置包括:
    第一生成模块,用于根据各个数据中心内的数据子集,对应生成所述各个数据中心的数据模型;
    第二生成模块,用于从各个所述数据模型中,随机选择第一预设数量的初始数据块,生成每个所述数据中心对应的第一数据块集合;
    第三生成模块,用于依次从每个所述第一数据块集合中,选择目标数据块,生成第二预设数量的目标数据集合;
    分析模块,用于根据所有所述目标数据集合训练目标学习器,并根据所述目标学习器对大数据集中的数据进行分析。
  9. 如权利要求8所述的跨数据中心的数据分析装置,其特征在于,所述各个数据中心存储的数据子集之间没有重叠;第三生成模块还用于:
    获取每个所述第一数据块集合中,各个所述初始数据块的排序号;所述初始数据块随机分布在所述第一数据块集合中,以使得每个所述初始数据块随机对应所述排序号,所述排序号的个数与所述第一预设数量相等;
    依次将每个所述第一数据块集合中,具有相同所述排序号的初始数据块作为目标数据块进行汇聚,生成所述第二预设数量的目标数据集合;其中,所述第一预设数量与第二预设数量相等。
  10. 如权利要求8所述的跨数据中心的数据分析装置,其特征在于,所述各个数据中心存储的数据子集之间没有重叠;第三生成模块还用于:
    依次从每个所述第一数据块集合中,随机选择至少一个初始数据块作为目标数据块;
    每次汇聚每个所述第一数据块集合中的目标数据块,作为目标数据集合,直到生成所述第二预设数量的目标数据集合。
  11. 如权利要求8所述的跨数据中心的数据分析装置,其特征在于,所述大数据集中的每个所述数据子集中的部份或者全部数据分散存储于多个数据中心;第二生成模块还用于:
    根据预设规则,在每个所述数据模型中重复i-1次,每次随机获取第一数据块集合,所述i为数据中心的个数;
    对应将所述第一数据块集合依次复制到其余所述数据中心,生成当前所述各个数据中心对应的复制子集;其中,每个所述复制子集包括原有所述数据子集包含的原有第一数据块集合,以及从其余所述数据中心随机获取的复制第一数据块集合;
    针对任意所述复制子集,从所述复制子集对应的所述原有第一数据块集合,以及各个 所述复制第一数据块集合中,随机选择第一预设数量的第一数据块作为初始数据块;
    根据所述初始数据块,生成每个所述数据中心对应的第一数据块集合。
  12. 如权利要求11所述的跨数据中心的数据分析装置,其特征在于,第二生成模块还用于:
    获取所述数据模型中的复制因子;
    根据所述复制因子,与每个所述数据模型中第一数据块的个数,每次随机复制所述数据模型中对应数量的第一数据块,作为第一数据块集合;
    在每个所述数据模型中重复复制i-1次所述数据模型中对应数量的第一数据块,得到i-1个所述第一数据块集合。
  13. 如权利要求8-12任一所述的跨数据中心的数据分析装置,其特征在于,分析模块还用于:
    根据每个所述目标数据集合中的所有所述目标数据块,训练每个所述目标数据集合对应的目标学习器;
    根据所有所述目标学习器,依次对所述大数据集中的数据进行分析,获得每个所述目标学习器的分析结果;
    根据所有所述分析结果,基于共识函数得出所述大数据集中数据的目标分析结果。
  14. 如权利要求13所述的跨数据中心的数据分析装置,其特征在于,第一生成模块还用于:采用随机样本划分算法,对所述各个数据中心的数据子集进行处理,获得所述各个数据中心的数据模型。
  15. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的方法。
PCT/CN2020/098872 2020-06-29 2020-06-29 跨数据中心的数据分析方法、装置、设备及存储介质 WO2022000169A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/098872 WO2022000169A1 (zh) 2020-06-29 2020-06-29 跨数据中心的数据分析方法、装置、设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/098872 WO2022000169A1 (zh) 2020-06-29 2020-06-29 跨数据中心的数据分析方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022000169A1 true WO2022000169A1 (zh) 2022-01-06

Family

ID=79317803

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/098872 WO2022000169A1 (zh) 2020-06-29 2020-06-29 跨数据中心的数据分析方法、装置、设备及存储介质

Country Status (1)

Country Link
WO (1) WO2022000169A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105956015A (zh) * 2016-04-22 2016-09-21 四川中软科技有限公司 一种基于大数据的服务平台整合方法
CN109271015A (zh) * 2018-10-10 2019-01-25 杭州电子科技大学 一种降低大规模分布式机器学习系统能耗的方法
CN109656702A (zh) * 2018-12-20 2019-04-19 西安电子科技大学 一种基于强化学习的跨数据中心网络任务调度方法
EP3506116A1 (en) * 2017-12-28 2019-07-03 INTEL Corporation Shared memory controller in a data center
CN110086650A (zh) * 2019-03-20 2019-08-02 武汉大学 面向分布式机器学习任务的云资源在线调度方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105956015A (zh) * 2016-04-22 2016-09-21 四川中软科技有限公司 一种基于大数据的服务平台整合方法
EP3506116A1 (en) * 2017-12-28 2019-07-03 INTEL Corporation Shared memory controller in a data center
CN109271015A (zh) * 2018-10-10 2019-01-25 杭州电子科技大学 一种降低大规模分布式机器学习系统能耗的方法
CN109656702A (zh) * 2018-12-20 2019-04-19 西安电子科技大学 一种基于强化学习的跨数据中心网络任务调度方法
CN110086650A (zh) * 2019-03-20 2019-08-02 武汉大学 面向分布式机器学习任务的云资源在线调度方法及装置

Similar Documents

Publication Publication Date Title
CN109993299B (zh) 数据训练方法及装置、存储介质、电子装置
Hoang et al. A novel CPU/GPU simulation environment for large-scale biologically realistic neural modeling
US20190156214A1 (en) Systems and methods for exchange of data in distributed training of machine learning algorithms
CN111860609B (zh) 跨数据中心的数据分析方法、装置、设备及存储介质
CN106980623B (zh) 一种数据模型的确定方法及装置
DE102012216029B4 (de) Ein skalierbares anpassungsfähiges map-reduce-rahmenwerk mit verteilten daten
WO2019090325A1 (en) Methods and systems for improved transforms in convolutional neural networks
CN110910982A (zh) 自编码模型训练方法、装置、设备及存储介质
Pandey Machine learning and systems for building the next generation of EDA tools
Silva et al. Integrating big data into the computing curricula
Sun et al. Learning structured densities via infinite dimensional exponential families
CN113626168A (zh) 联邦学习中参与方贡献量计算方法、系统、设备及介质
WO2022227214A1 (zh) 分类模型训练方法、装置、终端设备及存储介质
Ballani et al. Sparse inverse covariance estimation with hierarchical matrices
WO2022000169A1 (zh) 跨数据中心的数据分析方法、装置、设备及存储介质
Anjos et al. BIGhybrid: a simulator for MapReduce applications in hybrid distributed infrastructures validated with the Grid5000 experimental platform
TWI758223B (zh) 具有動態最小批次尺寸之運算方法,以及用於執行該方法之運算系統及電腦可讀儲存媒體
PURDILĂ et al. MR-Tree-A Scalable MapReduce Algorithm for Building Decision Trees.
WO2022227169A1 (zh) 图像分类方法、装置、电子设备及存储介质
Frei et al. Efficient deterministic MapReduce algorithms for parallelizable problems
Leadbetter Extremes Under Dependence—Historical Development and Parallels with Central Limit Theory
CN114154714A (zh) 时序数据预测方法、装置、计算机设备及介质
CN116362101A (zh) 基于联合学习的数据处理方法、数据模型生成方法及装置
CN109376349A (zh) 基于元数据体系的成教系统表数据处理平台及方法
Raman et al. Online agnostic multiclass boosting

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20942821

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 13.04.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20942821

Country of ref document: EP

Kind code of ref document: A1