Random distribution input data-oriented MapReduce coding calculation method and system
By modeling the data shuffling process of MapReduce computing tasks as a graph and solving the optimal balanced graph segmentation, the problem of large communication load in MapReduce computing under random input data distribution is solved, and the data shuffling is completed under low network overhead. Effect.
Patent Information
- Application Number
- CN202410729986.X
- 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
Existing coded distributed computing solutions cannot be effectively applied to random input data distribution scenarios, resulting in the problem of large communication load still existing in MapReduce computing.
The data shuffling process of MapReduce computing tasks is modeled as a graph, the optimal balanced graph segmentation is solved, the working nodes are merged, and the intermediate results are transmitted through encoded multicast to reduce network overhead.
By using the encoded distributed computing method of node merging in a MapReduce system that randomly distributes input data, the transmission overhead in the data shuffling process is reduced and the network performance of the system is improved.
Smart Images

Figure CN118585192A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer distributed computing, and more specifically, to a MapReduce coding computing method and system for randomly distributed input data. Background Art
[0002] With the development of big data analysis applications and the explosive accumulation of Internet data, distributed computing represented by MapReduce has become an effective means of processing massive data and efficient data analysis. The running cost of these MapReduce calculations is very high, especially in the shuffle process. The exchange of intermediate result data brings huge network overhead, which also leads to the communication overhead between cluster nodes becoming the performance bottleneck of the task in some distributed computing tasks. There are many studies on MapReduce communication overhead, such as Coded Distributed Computing (CDC) by using coding to reduce communication load. Specifically, CDC first places the input data files to multiple worker nodes according to a carefully designed placement strategy to create coding opportunities. In the data shuffle stage, the intermediate values calculated by each worker node are XOR-encoded, and the encoded information is multicast to a group of corresponding worker nodes, thereby reducing the communication load.
[0003] However, existing CDC research relies heavily on carefully designed placement of input data files to create encoding opportunities. However, for more balanced data storage and lower data loss risk, in many practical distributed file systems (e.g., Hadoop distributed file system), files are usually scattered among nodes, making the input of distributed computing randomly distributed. It is observed that such CDC schemes cannot work properly for random input data distribution, because CDC cannot create encoding opportunities for random input data distribution, which leads to a large amount of communication load. Therefore, how to design a CDC scheme that is effective for random input data distribution is still a challenging problem. Summary of the invention
[0004] In view of the defects of the prior art, the purpose of this application is to provide a MapReduce coding calculation method and system for randomly distributed input data, aiming to solve the problem that the existing coding distributed computing scheme cannot be applied to random input distribution scenarios.
[0005] To achieve the above objectives, in a first aspect, the present application provides a MapReduce coding calculation method for randomly distributed input data, comprising:
[0006] S1. Using the MapReduce cluster network topology and input data distribution, the data shuffling process of the MapReduce computing task is modeled as a graph;
[0007] S2. Find the optimal balanced graph partitioning of the graph;
[0008] S3. Map the work nodes corresponding to all points in each subgraph after segmentation into a merged work node of the MapReduce computing task;
[0009] S4. After merging, each working node transmits the intermediate results of the data shuffling process through coded multicast.
[0010] Preferably, step S1 is specifically as follows:
[0011] S11. Abstract each working node in the cluster as a point in the graph;
[0012] S12. Establish an undirected edge between every two points in the graph;
[0013] S13. Based on the MapReduce cluster network topology and input data distribution, calculate the point weight of each point and the edge weight of each edge.
[0014] Preferably, the point weight is the number of input files of the corresponding node; the edge weight is the ratio of the cosine similarity to the penalty of two nodes across racks, the cosine similarity is the ratio of the cosine similarity value of the union vector of the input file sets of the two nodes and the standard encoding distributed computing file set vector to the size of the input file sets of the two nodes to the overall file size; the penalty of two nodes across racks is the ratio of the intersection size of the rack sets where the two nodes are located to the average rack set size.
[0015] Preferably, in each round of merging, several edges with the highest edge weights are greedily selected, and the two points of each edge are merged until the number of points in the current graph is equal to the target number of merges, and then the merging is stopped.
[0016] Preferably, the two points of the selected edge are merged into a new point, and a new edge is established between every two points in all the points in the graph after the merger. The point weight of the new point is the sum of the number of input files of the nodes before the merger, and the edge weight of the new edge is calculated using the same rules as modeling as a graph.
[0017] Preferably, the number of edges greedily selected in each round is 1 to N / 2, where N is the number of points in the current graph.
[0018] Preferably, the target merge number is equal to the number of partitions in MapReduce.
[0019] Preferably, after each round of merging, the obtained graph is judged. If moving a point in the graph to another merged node can achieve a smaller cut or the weights of the points after merging are more balanced, the point is moved to obtain a new graph segmentation result.
[0020] To achieve the above-mentioned purpose, in a second aspect, the present application provides a MapReduce coding and computing system for randomly distributed input data, comprising at least one processor and at least one memory; the at least one memory is used to store computer instructions; the at least one processor is used to execute at least part of the computer instructions to implement the coding and computing method described in the first aspect.
[0021] To achieve the above objectives, in a third aspect, the present application provides a computer-readable storage medium, which stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the encoding calculation method described in the first aspect.
[0022] It can be understood that the beneficial effects of the second to third aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0023] In general, the above technical solutions conceived by this application have the following beneficial effects compared with the prior art:
[0024] The present application provides a coding calculation method and system for MapReduce with randomly distributed input data, which models the data shuffling process of MapReduce computing tasks as a graph, transforms the optimal working node merging for solving the data shuffling process into the optimal balanced graph segmentation problem for solving the corresponding graph, determines the node merging scheme according to the graph segmentation result, and performs coding distributed computing for the node merging scheme to complete data shuffling with low network overhead. The present application reduces the transmission overhead in the system data shuffling process by using coding distributed computing based on node merging on a MapReduce big data processing system with randomly distributed input data. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a flow chart of a MapReduce encoding calculation method for randomly distributed input data provided in an embodiment of the present application.
[0026] Figure 2 This is an example of a random input distribution MapReduce computing task provided in an embodiment of the present application.
[0027] Figure 3 This is a schematic diagram of the graph modeling results provided in the embodiments of the present application.
[0028] Figure 4It is a schematic diagram of the MapReduce encoding calculation shuffle process for random input distribution provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.
[0030] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.
[0031] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of the response messages.
[0032] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0033] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.
[0034] Next, the technical solutions provided in the embodiments of the present application are introduced.
[0035] like Figure 1 As shown, the present application provides a MapReduce encoding calculation method for randomly distributed input data, including:
[0036] S1. Using the MapReduce cluster network topology and input data distribution, the data shuffling process of the MapReduce computing task is modeled as a graph.
[0037] In actual distributed file systems, in order to ensure the correctness of data access, some additional data is used to save information such as file size and file storage location. This type of information is called metadata information. The metadata information related to this task is read from the distributed storage system, and the cluster network topology and input data distribution are determined based on the metadata information.
[0038] In order to make the modeled graph have the characteristics of the original problem and meet the goals of the graph partitioning algorithm, each working node in the cluster is abstracted as a point in the graph, and every two nodes are connected by an undirected edge, including intra-rack and cross-rack situations.
[0039] Preferably, step S1 is specifically as follows:
[0040] S11. Abstract each working node in the cluster as a point in the graph;
[0041] S12. Establish an undirected edge between every two points in the graph;
[0042] S13. Based on the MapReduce cluster network topology and input data distribution, calculate the point weight of each point and the edge weight of each edge.
[0043] In the current mainstream cloud computing system, there is a hierarchical network topology, that is, multiple working nodes are organized in multiple racks. Nodes within a rack communicate directly through switches, and nodes between racks communicate through switches and routers. Therefore, the available cross-rack bandwidth is only 1 / 5 or even 1 / 20 of the intra-rack bandwidth.
[0044] Preferably, the point weight is the number of input files of the corresponding node; the edge weight is the ratio of the cosine similarity to the penalty of two nodes across racks, the cosine similarity is the ratio of the cosine similarity value of the union vector of the input file sets of the two nodes and the standard encoding distributed computing file set vector to the size of the input file sets of the two nodes to the overall file size; the penalty of two nodes across racks is the ratio of the intersection size of the rack sets where the two nodes are located to the average rack set size.
[0045] It should be noted that the larger the cosine similarity value of the union vector of the two-node input file set and the vector of the standard coding distributed computing file set and the ratio of the two-node input file set size to the total file size, the more coding opportunities and the less network overhead; the larger the penalty for the cross-rack of the two nodes, the greater the network overhead. The edge weight constructed in the above way can measure the potential coding opportunities and the reduction of network overhead after the two nodes are merged.
[0046] S2. Find the optimal balanced graph partitioning of the graph.
[0047] By modeling the data shuffling process of MapReduce computing tasks as a graph, the optimal working node merging solution for the data shuffling process is transformed into the optimal balanced graph partitioning problem for the corresponding graph. "Optimal" means that the communication overhead of shuffling is minimized when the node merging solution corresponding to the graph partitioning result is used to execute the computing task.
[0048] Recursive search or heuristic algorithms can be used to solve the balanced graph partitioning problem. The recursive search here needs to recursively enumerate all node merging solutions and evaluate them. The algorithm time complexity is exponential. In the distributed computing scenario, due to the large number of nodes, even if the solution can enable the subsequent encoding distributed computing to achieve the lowest transmission overhead, its exponential solution time is often unacceptable. Therefore, the solution here should be to use appropriate greedy and other strategies heuristically according to the characteristics of the problem, so that a node merging solution close to the optimal solution can be obtained in a very short time.
[0049] Preferably, in each round of merging, several edges with the highest edge weights are greedily selected, and the two points of each edge are merged until the number of points in the current graph is equal to the target number of merges, and then the merging is stopped.
[0050] It should be noted that, by applying the above-mentioned appropriate greedy strategy, the algorithm time complexity of this application is reduced from the recursive exponential level to the polynomial level. At the same time, experiments show that the solution quality of the designed heuristic algorithm is also close to optimal.
[0051] Preferably, the two points of the selected edge are merged into a new point, and a new edge is established between every two points in all the points in the graph after the merger. The point weight of the new point is the sum of the number of input files of the nodes before the merger, and the edge weight of the new edge is calculated using the same rules as modeling as a graph.
[0052] Preferably, the number of edges greedily selected in each round is 1 to N / 2, where N is the number of points in the current graph.
[0053] Preferably, the target merge number is equal to the number of partitions in MapReduce.
[0054] Preferably, after each round of merging, the obtained graph is judged. If moving a point in the graph to another merged node can achieve a smaller cut (the minimum cut is the smallest sum of the weights of all edges in the cut set) or the weights of the points after the merge are more balanced, the point is moved to obtain a new graph segmentation result.
[0055] It should be noted that the present application further adopts the above-mentioned preferred adjustment method to achieve the goal of balanced graph segmentation ("minimum cut" or "load balancing") of the final segmentation result, with higher accuracy and lower transmission overhead.
[0056] S3. Map the working nodes corresponding to all points in each segmented subgraph to a merged working node of the MapReduce computing task.
[0057] The segmented subgraph is mapped as the target merge node of the current MapReduce computing task, and the original graph nodes in the subgraph are mapped back to the working nodes of the current MapReduce computing task.
[0058] S4. After merging, each working node transmits the intermediate results of the data shuffling process through coded multicast.
[0059] When executing MapReduce computing tasks, the working nodes corresponding to all nodes belonging to the same subgraph in the graph segmentation results are merged into one node. Each working node realizes logical merging by transmitting part of the intermediate results. In addition, the system network overhead can be reduced through coded multicast transmission in the data shuffling stage.
[0060] Example
[0061] like Figure 2 As shown, this embodiment provides a 5-worker node MapReduce computing task cluster, the nodes are distributed in different racks, and 6 files (i.e., w1 to w6) with a file random placement strategy with a copy number of 2 are used as computing inputs, and the number of target output functions is 3 (i.e., the square, circle, and triangle in the figure). The dotted line in the figure is the intermediate value that needs to be transmitted in the data shuffling stage when no node merging is performed.
[0062] Step S1. Read the metadata information in the file system to determine the network topology of the working nodes and the distribution of the input files to be processed.
[0063] Step S2. Convert the network topology of each working node and the local input file situation into a graph. The point weight is modeled as the number of input files of the corresponding node; the edge weight consists of two parts: 1) the normalized cosine similarity of the input file set of the two nodes and the file distribution of the standard encoding distributed computing solution, and 2) the penalty of the two nodes crossing the rack. The weighted sum of these two parts is used as the edge weight to measure the potential encoding opportunities and network overhead reduction after the two nodes are merged. Figure 2 The input file distribution shown can be converted into Figure 3 In the undirected graph shown, the numbers in brackets on the nodes are the node weights, and the numbers on the edges are the edge weights.
[0064] Step S3. Solve the optimal balanced graph partitioning of the graph through a greedy heuristic algorithm, greedily select a part of the edges with the highest edge weights, merge the two endpoints of these edges, and continuously reduce the graph size (number of graph nodes) until the current number of graph nodes is equal to the target merge number.
[0065] In this embodiment, the number of target output functions is 3, so the target of the merger here is that the target graph has only 3 nodes. Figure 3 In the graph in , we give priority to edges with higher weights, that is, edges with weight 300 and edges with weight 244, and merge their corresponding endpoints, that is, merge node 3 with node 4, and merge node 2 with node 5.
[0066] Since the number of nodes here is small, one round of merging can reach the target scale of "only 3 nodes in the graph". For graphs with more nodes, some edges are selected for merging in each round, so that the number of nodes in each round is reduced to half of the original number, and the edge weights and vertex weights of the merged new graph are recalculated according to the definition of edge weights and vertex weights in step S2. This process is repeated until the number of nodes in the current graph reaches the target. For example, 20 nodes are merged into 3 nodes, and the process of reducing the scale of the graph is: 20->10->5->3.
[0067] As for the algorithm solution effect, experimental comparisons were conducted on embodiments with 9, 12, and 15 nodes. For solution time, the solution time of the above heuristic algorithm was always maintained at 0.01s, while the solution time of the recursive search algorithm increased exponentially from 5.0265s for 9 nodes to 718.927s for 12 nodes and 35380.4s for 15 nodes; for solution quality, the heuristic algorithm deteriorated by no more than 7% compared with the optimal result of recursive search in the worst case, which shows that the above heuristic algorithm achieved the goal of solving a node merging solution close to the optimal one in a very short time.
[0068] Step S4. Map the graph segmentation result back to the node merging solution. In step S3, nodes 3 and 4 in the graph are merged into one node, and nodes 2 and 5 are merged into one node. Correspondingly, the node merging solution for the original problem is also to merge nodes 3 and 4, and nodes 2 and 5.
[0069] Step S5. Merge the corresponding nodes into one node according to the merging scheme to perform data shuffling: When executing the MapReduce computing task, each working node will transmit a part of the intermediate results according to the node merging scheme to achieve logical merging.
[0070] like Figure 4 As shown, node 4 transmits the intermediate value triangle 4 to node 3; node 5 transmits the intermediate value square 1 and square 2 to node 2. Afterwards, node 1, merged node 2' and merged node 3' can be transmitted through coded multicast.
[0071] Therefore, by taking advantage of the sufficient network bandwidth within the rack to transmit intermediate values point-to-point, and using coded multicast to transmit intermediate values between racks with relatively tight network bandwidth, in the scenario of random input distribution, the cross-rack network overhead can be significantly reduced by sacrificing a small part of the overhead within the rack with the help of the coded multicast idea, thereby reducing the overall network overhead of data shuffling in a real MapReduce cluster.
[0072] This application implements a MapReduce encoding calculation method for random input distribution, which improves the encoding opportunities through the idea of node merging on a MapReduce big data processing cluster with random input distribution, so as to give full play to the advantages of encoding distributed computing in reducing network overhead and reduce the network load of the system in the data shuffling stage.
[0073] It can be understood that the detailed functional implementation of each of the above-mentioned units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.
[0074] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0075] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device, which may include: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. The processor may call the logic instructions in the memory to execute the method in the above embodiment.
[0076] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0077] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0078] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0079] It is understandable that the processor in the embodiment of the present application can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor.
[0080] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0081] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0082] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0083] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A MapReduce coding calculation method for randomly distributed input data, characterized in that: include: S1. Using the MapReduce cluster network topology and input data distribution, the data shuffling process of the MapReduce computing task is modeled as a graph; S2. Find the optimal balanced graph partitioning of the graph; S3. Map the work nodes corresponding to all points in each subgraph after segmentation into a merged work node of the MapReduce computing task; S4. After merging, each working node transmits the intermediate results of the data shuffling process through coded multicast.
2. The coding calculation method according to claim 1, characterized in that: Step S1 is specifically as follows: S11. Abstract each working node in the cluster as a point in the graph; S12. Establish an undirected edge between every two points in the graph; S13. Based on the MapReduce cluster network topology and input data distribution, calculate the point weight of each point and the edge weight of each edge.
3. The coding calculation method according to claim 2, characterized in that: The point weight is the number of input files of the corresponding node; the edge weight is the ratio of the cosine similarity to the penalty of two nodes across racks, the cosine similarity is the ratio of the cosine similarity value of the union vector of the input file sets of the two nodes and the standard encoding distributed computing file set vector to the size of the input file sets of the two nodes to the total file size; the penalty of two nodes across racks is the ratio of the intersection size of the rack sets where the two nodes are located to the average rack set size.
4. The coding calculation method according to claim 1, characterized in that: In each round of merging, several edges with the highest weights are greedily selected and the two points on each edge are merged until the number of points in the current graph is equal to the target number of merges, and then the merging stops.
5. The coding calculation method according to claim 4, characterized in that: The two points of the selected edge are merged into a new point. After the merger, a new edge is established between every two points in all the points in the graph. The point weight of the new point is the sum of the number of input files of the nodes before the merger. The edge weight of the new edge is calculated using the same rules as modeling as a graph.
6. The coding calculation method according to claim 4, characterized in that: The number of greedily selected edges in each round is 1 to N / 2, where N is the number of points in the current graph.
7. The coding calculation method according to claim 4, characterized in that: The target merge number is equal to the number of partitions in MapReduce.
8. The coding calculation method according to any one of claims 4 to 7, characterized in that: After each round of merging, the obtained graph is judged. If moving a point in the graph to another merged node can achieve a smaller cut or the point weights of each point after the merge are more balanced, the point is moved to obtain a new graph segmentation result.
9. A MapReduce coding computing system for randomly distributed input data, characterized in that: comprising at least one processor and at least one memory; The at least one memory is used to store computer instructions; The at least one processor is used to execute at least part of the computer instructions to implement the encoding calculation method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The storage medium stores computer instructions. When the computer reads the computer instructions in the storage medium, the computer executes the encoding calculation method as described in any one of claims 1 to 8.
Citation Information
Cited By
Image processing method based on end-cloud collaboration and electronic equipment
CN120935305A
