Data processing method, execution workstation, distributed computing system and storage medium
By splitting the aggregator into multiple parallel reduction fragments in Spark, the scalability problem of the reduction step in the MLlib tree aggregation process is solved, achieving higher processing performance and parallelism.
Patent Information
- Application Number
- CN202110766780.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-07
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-07-07
AI Technical Summary
The scalability of the reduction step in the tree aggregation process of MLlib in Spark is poor, resulting in performance bottlenecks, and it lacks the object splitting function and cannot support scalable reduction algorithms.
By splitting an aggregator into multiple aggregation sub-fragments, parallel reduction is performed between execution workstations until all reductions are completed and spliced by the management workstation, ultimately achieving higher parallelism and processing performance.
The parallelism of data aggregation is improved, thereby improving the processing performance, making the data processing method suitable for scalable reduction algorithms.
Smart Images

Figure CN115599956B
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to a data processing method, an execution workstation, a distributed computing system, and a computer-readable storage medium. Background Art
[0002] Today is the data age, and data informatization is closely related to our lives and work. Due to the rapid increase in the amount of data, it is difficult for a single machine to process it, so a distributed computing framework for big data processing is designed. Spark is one of the most popular big data processing frameworks today. Spark connects various data analysis domains through its elastic distributed dataset programming model. Spark's machine learning framework MLlib is widely used because MLlib can be easily integrated into Spark's data analysis workflow. Tree aggregation is an important research hotspot in MLlib. Tree aggregation in Spark can be roughly divided into two consecutive steps: calculation and reduction. In the calculation step, the value of the current partition is calculated locally. In the reduction step, the calculated value (called an aggregator) is further globally reduced to a single aggregator. Summary of the invention
[0003] At least one embodiment of the present disclosure provides a data processing method for distributed computing executed by an execution workstation, comprising: splitting an aggregate having a predetermined data format into multiple aggregate sub-fragments; sending a first portion of the aggregate sub-fragments among the multiple aggregate sub-fragments to other execution workstations for reduction on the other execution workstations; receiving aggregate sub-fragments corresponding to a second portion of the aggregate sub-fragments among the multiple aggregate sub-fragments generated by other execution workstations from other execution workstations and reducing them with the second portion of the aggregate sub-fragments to update the second portion of the aggregate sub-fragments, wherein the first portion is different from the second portion; redetermining the first portion of the aggregate sub-fragments and the second portion of the aggregate sub-fragments from the remaining portion after removing the sent first portion of the aggregate sub-fragments from the multiple aggregate sub-fragments and performing the above-mentioned sending, receiving and reducing until each of the multiple aggregate sub-fragments is sent or all reductions are completed; and if there is an aggregate sub-fragment that has completed all reductions, sending the aggregate sub-fragment that has completed all reductions to the management workstation, so that the management workstation can splice it with other aggregate sub-fragments that have completed all reductions into an aggregate.
[0004] For example, in the data processing method provided by at least one embodiment of the present disclosure, the number of aggregate sub-fragments into which the aggregate is split is equal to the number of execution workstations participating in the aggregation; and the number of the first part of aggregate sub-fragments and the second part of aggregate sub-fragments are one respectively.
[0005] For example, in the data processing method provided by at least one embodiment of the present disclosure, the number of aggregate sub-fragments into which the aggregate is split is equal to the number of execution workstations participating in the aggregation multiplied by the number of parallel communication lines of each execution workstation; and the number of the first part of aggregate sub-fragments and the second part of aggregate sub-fragments are respectively the number of parallel communication lines of each execution workstation.
[0006] For example, in the data processing method provided by at least one embodiment of the present disclosure, the first part of the aggregated sub-segment re-determined from the remaining part of the first part of the aggregated sub-segment removed from the multiple aggregated sub-segments is the second part of the aggregated sub-segment updated in the previous round of reception and reduction.
[0007] At least one embodiment of the present disclosure provides an execution workstation for distributed computing, including: a processor and a memory, the memory storing one or more computer program instructions, the one or more computer program instructions are stored in the memory, and when executed by the processor, the steps of the data processing method provided by at least one embodiment of the present disclosure are implemented.
[0008] At least one embodiment of the present disclosure provides a data processing method executed by a distributed computing system, the distributed computing system comprising a plurality of execution workstations and a management workstation, the data processing method comprising: each of the plurality of execution workstations executing the following steps: splitting an aggregate having a predetermined data format into a plurality of aggregate sub-fragments; sending a first portion of the plurality of aggregate sub-fragments to other execution workstations for reduction on the other execution workstations; receiving from the other execution workstations the aggregate sub-fragments corresponding to a second portion of the plurality of aggregate sub-fragments generated by the other execution workstations and reducing the aggregate sub-fragments with the second portion of the aggregate sub-fragments; Reducing to update the second part of the aggregated sub-segment, the first part is different from the second part; redetermining the first part of the aggregated sub-segment and the second part of the aggregated sub-segment from the remaining part of the first part of the aggregated sub-segment removed from the multiple aggregated sub-segments and performing the above sending, receiving and reducing until each of the multiple aggregated sub-segments is sent or all reductions are completed; and if there is an aggregated sub-segment that completes all reductions, sending the aggregated sub-segment that completes all reductions to the management workstation; and the management workstation receives the aggregated sub-segments that complete all reductions sent by multiple execution workstations, and splices the received aggregated sub-segments into an aggregate.
[0009] For example, in the data processing method provided by at least one embodiment of the present disclosure, the number of aggregate sub-fragments into which the aggregate is split is equal to the number of multiple execution workstations; and the number of the first part of aggregate sub-fragments and the second part of aggregate sub-fragments are one respectively.
[0010] For example, in the data processing method provided by at least one embodiment of the present disclosure, the number of multiple execution workstations is N, and they are sequentially numbered as 0, 1, ...i, ...N-1; the number of multiple aggregate sub-segments is N, and they are sequentially numbered as 0, 1, ...i, ...N-1; the multiple execution workstations perform the above-mentioned sending, receiving and reducing steps as follows: Step 1: let j = N-1, Step 2: for i = 0 to N-1, the i-th execution workstation sends its i+j+1-th aggregate sub-segment to the i+1-th execution workstation, and receiving the i+j-th aggregate sub-fragment from the i-1-th execution workstation and performing reduction, wherein, if i-1<0, i-1 is replaced by i+N-1; if i+j>N-1, i+j is replaced by i+jN; if i+j+1>N-1, i+j+1 is replaced by i+j+1-N; if j>1, the value of j is reduced by 1 and the second step is repeated; the third step: for i=0 to N-1, the i-th execution workstation sends the i+1-th aggregate sub-fragment to the management workstation, and if i+1=N, i+1 is replaced by 0.
[0011] For example, in the data processing method provided by at least one embodiment of the present disclosure, the number of aggregate sub-fragments into which the aggregate is split is equal to the number of multiple execution workstations multiplied by the number of parallel communication lines of each execution workstation; and the number of the first part of aggregate sub-fragments and the second part of aggregate sub-fragments are respectively the number of parallel communication lines of each execution workstation.
[0012] At least one embodiment of the present disclosure provides a distributed computing system, which includes multiple execution workstations and management workstations, each of the multiple execution workstations is used to: split an aggregate having a predetermined data format into multiple aggregate sub-fragments; send a first part of the aggregate sub-fragments in the multiple aggregate sub-fragments to other execution workstations for reduction on the other execution workstations; receive aggregate sub-fragments corresponding to a second part of the aggregate sub-fragments in the multiple aggregate sub-fragments generated by other execution workstations from other execution workstations and reduce them with the second part of the aggregate sub-fragments to update the second part of the aggregate sub-fragments, wherein the first part is different from the second part; redetermine the first part of the aggregate sub-fragments and the second part of the aggregate sub-fragments from the remaining part of the multiple aggregate sub-fragments after removing the sent first part of the aggregate sub-fragments and perform the above sending, receiving and reducing until each of the multiple aggregate sub-fragments is sent or all reductions are completed; and if there is an aggregate sub-fragment that has completed all reductions, send the aggregate sub-fragment that has completed all reductions to the management workstation; and the management workstation is used to receive the aggregate sub-fragments that have completed all reductions sent by multiple execution workstations, and splice the received aggregate sub-fragments into an aggregate.
[0013] At least one embodiment of the present disclosure provides a computer-readable storage medium that non-temporarily stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the data processing method provided by at least one embodiment of the present disclosure is implemented.
[0014] According to the data processing method, execution workstation, distributed computing system and computer-readable storage medium of the embodiments of the present disclosure, it is possible to split and reduce aggregates, thereby improving the parallelism of data aggregation and thus improving processing performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure.
[0016] Figure 1 A schematic diagram showing a comparison between split-reduce and non-split-reduce provided by at least one embodiment of the present disclosure;
[0017] Figure 2A A flow chart of a data processing method for distributed computing performed by an execution workstation according to at least one embodiment of the present disclosure is shown;
[0018] Figure 2B A flowchart showing a data processing method performed by a distributed computing system provided by at least one embodiment of the present disclosure is shown;
[0019] Figure 3 A topological schematic diagram showing a communication infrastructure of an execution workstation provided by at least one embodiment of the present disclosure;
[0020] Figure 4 A flowchart showing a process of sending, receiving and reducing performed by multiple execution workstations provided by at least one embodiment of the present disclosure is shown;
[0021] Figure 5 Shows Figure 4 Schematic diagram of the algorithm provided when the number of execution workstations is 4;
[0022] Figure 6 A schematic block diagram of a distributed computing system provided by at least one embodiment of the present disclosure is shown;
[0023] Figure 7 A schematic block diagram of an execution workstation for distributed computing provided by at least one embodiment of the present disclosure is shown; and
[0024] Figure 8 A schematic diagram of a computer-readable storage medium provided by at least one embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0026] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, similar words such as "one", "one" or "the" do not indicate quantity restrictions, but indicate that there is at least one. Similar words such as "include" or "comprise" mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Similar words such as "connect" or "connected" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0027] MLlib has poor scalability, and its bottleneck lies in the reduction step in tree aggregation. The performance of scalable reduction algorithms (e.g., Rabenseifner reduction algorithm) is better than that of tree aggregation. However, the inseparable object interface in Spark lacks the object splitting function, so MLlib does not support scalable reduction algorithms. Therefore, the inventors designed a new technical solution, which can split objects to obtain more parallelism, so that it can be applied to scalable reduction algorithms.
[0028] At least one embodiment of the present disclosure provides a data processing method, an execution workstation, a distributed computing system, and a computer-readable storage medium. For example, the data processing method is used for distributed computing and is executed by an execution workstation, and may include: splitting an aggregate having a predetermined data format into multiple aggregate sub-fragments; sending a first part of the aggregate sub-fragments in the multiple aggregate sub-fragments to other execution workstations for reduction on the other execution workstations; receiving aggregate sub-fragments corresponding to a second part of the aggregate sub-fragments in the multiple aggregate sub-fragments generated by other execution workstations from other execution workstations and reducing them with the second part of the aggregate sub-fragments to update the second part of the aggregate sub-fragments, wherein the first part is different from the second part; re-determining the first part of the aggregate sub-fragments and the second part of the aggregate sub-fragments from the remaining part of the multiple aggregate sub-fragments after removing the sent first part of the aggregate sub-fragments and performing the above sending, receiving, and reducing until each of the multiple aggregate sub-fragments is sent or all reductions are completed; and if there is an aggregate sub-fragment that has completed all reductions, sending the aggregate sub-fragment that has completed all reductions to the management workstation, so that the management workstation splices it with other aggregate sub-fragments that have completed all reductions into an aggregate.
[0029] The data processing method of this embodiment can split the object to be reduced into small blocks (fragments) and reduce them separately to obtain higher parallelism, thereby improving processing performance, and thus can be applicable to a scalable reduction algorithm.
[0030] It should be noted that the big data processing framework includes but is not limited to Spark, and the data processing method provided in at least one embodiment of the present disclosure can also be applied to other big data processing frameworks.
[0031] The distributed computing system provided by at least one embodiment of the present disclosure may include a management workstation, an execution workstation and an internal memory. An execution workstation is a computing device that performs task processing in a distributed computing system, for example, it can run an executor in a Spark architecture; a management workstation is a computing device responsible for managing each execution workstation in a distributed computing system, for example, it can run a driver in a Spark architecture, and the management workstation can coordinate, schedule, and monitor the tasks of each execution workstation. The task results of the execution workstation can eventually be summarized in the management workstation. The management workstation interacts with multiple execution workstations through a communication network, and the execution workstation interacts with other execution workstations through a communication network to receive or send messages. The communication network is used to provide a medium for communication links between the management workstation and multiple execution workstations and between multiple execution workstations. The communication network may include various connection types, such as wired or wireless communication links, specifically such as WIFI, 3G, 4G, 5G, and fiber optic cables.
[0032] In the embodiments of the present disclosure, reduction means merging two or more data, and the total amount of data after merging is less than the total amount of data before merging. For example, two or more data can be summed up. Aggregators represent data units with a predetermined data format, which can be used for aggregation (merging) or other calculations. The predetermined data structure can be predetermined according to the specific application, for example, it can be an array or other data structure defined by the user.
[0033] Figure 1 A schematic diagram showing a comparison between split reduction and non-split reduction provided by at least one embodiment of the present disclosure is shown.
[0034] like Figure 1 As shown, the reduction processes shown on the left and right sides of the diagram both show the reduction of multiple aggregates to one aggregate. The left side of the diagram shows a non-split reduction, while the right side of the diagram shows a split reduction.
[0035] In the figure, the four aggregators V1, V2, V3, and V4 are reduced to one aggregator. Non-divisible reduction treats aggregators as indivisible objects and directly reduces V1, V2, V3, and V4 to V * For split-reduce, each aggregator V i (i=1, 2, 3, 4) are all separable and each aggregate V i (i=1, 2, 3, 4) can be split into three segments, for example, V i,1 、V i,2 、V i,3 . Polymerization V i The first segment V of (i=1,2,3,4) 1,1 、V 2,1 、V 3,1 、V 4,1 As a group, similarly, the second fragment V 1,2 、V 2,2 、V 3,2 、V 4,2 As a group, the third fragment V 1,3 、V 2,3 、V 3,3 、V 4,3 Each group of fragments can be reduced independently to form the result V *,1 、V *,2 、V *,3 Compared with non-split reduction, split reduction achieves 3 times of parallelism, thus improving processing performance.
[0036] Figure 2A A flowchart of a data processing method for distributed computing performed by an execution workstation provided by at least one embodiment of the present disclosure is shown.
[0037] like Figure 2A As shown, the data processing method includes steps S201 to S205.
[0038] Steps S201-S205 are executed by the execution workstation.
[0039] Step S201: splitting an aggregate with a predetermined data format into a plurality of aggregate segments.
[0040] Step S202: sending a first part of the aggregated sub-segments among the multiple aggregated sub-segments to other execution workstations for reduction on the other execution workstations.
[0041] Step S203: receiving aggregated sub-segments corresponding to the second part of the multiple aggregated sub-segments generated by other execution workstations from other execution workstations and reducing them with the second part of the aggregated sub-segments to update the second part of the aggregated sub-segments, wherein the first part is different from the second part.
[0042] Step S204: redetermine the first part of the aggregated sub-segments and the second part of the aggregated sub-segments from the remaining part of the multiple aggregated sub-segments after removing the sent first part of the aggregated sub-segments and perform the above-mentioned sending, receiving and reducing (i.e., steps S202 and S203) until each of the multiple aggregated sub-segments is sent or all reductions are completed.
[0043] Step S205: If there is an aggregate sub-segment that completes all reductions, the aggregate sub-segment that completes all reductions is sent to the management workstation, so that the management workstation can splice it with other aggregate sub-segments that complete all reductions into an aggregate sub-segment.
[0044] For step S201, the aggregator is usually a data unit used for data aggregation or reduction, and its data format can be predetermined according to the specific application, for example, it can be an array or other user-defined data structure. In the embodiment of the present disclosure, the aggregator is split into multiple aggregator fragments, each of which can be reduced independently, thereby improving parallelism. The division of the aggregator fragments can be determined according to the needs of the application. For example, the number of aggregator fragments can be determined according to the number of desired parallel processing, and then the aggregator can be divided according to the number of aggregator fragments, such as evenly or unevenly. For example, the number of aggregator fragments can be equal to the number of execution workstations participating in the aggregation. In this case, each execution workstation can simultaneously reduce one aggregator fragment, thereby making full use of the parallelism of multiple execution workstations.
[0045] For step S202, the first part of aggregated sub-fragments refers to aggregated sub-fragments that are sent to other execution workstations and reduced on other execution workstations. Other execution workstations refer to one or more execution workstations in a distributed computing system that are different from the current execution workstation and participate in aggregation. The first part of aggregated sub-fragments can be one or more fragments, which are sent to other execution workstations to be reduced with corresponding aggregated sub-fragments on other workstations. "Corresponding aggregated sub-fragments" means that the position of the aggregated sub-fragment in its aggregate is the same as the position of the sent aggregated sub-fragment in its aggregate. During reduction, two corresponding aggregated sub-fragments are merged and calculated as one fragment. When the first part has multiple fragments, the first part can be sent to the same other execution workstation, or can be sent to different other execution workstations respectively.
[0046] For step S203, the second part of the aggregated sub-segments refers to the aggregated sub-segments that are reduced with the aggregated sub-segments received from other execution workstations, that is, the second part of the aggregated sub-segments are the aggregated sub-segments that are reduced in the current execution workstation. It should be noted that the other execution workstations in step S203 may be the same as or different from the other execution workstations in step 202. In addition, in the case where the number of aggregated sub-segments from which the aggregate is split is equal to the number of execution workstations participating in the aggregation, the number of the first part of the aggregated sub-segments and the number of the second part of the aggregated sub-segments may be one respectively, so that all execution workstations in the distributed system can reduce one aggregated sub-segment each time, so as to make full use of the parallelism of multiple execution workstations.
[0047] For step S204, after removing the aggregated sub-segments that have been sent, the first part of the aggregated sub-segments and the second part of the aggregated sub-segments are re-determined, and the above steps S202 and S203 are iteratively performed until each of the multiple aggregated sub-segments is sent or all reductions are completed. The "all reductions" mentioned here means that the aggregated sub-segment has aggregated the corresponding segments of all the aggregates that need to be reduced in the distributed system. For example, the distributed system has a total of M execution workstations, and each execution workstation has an aggregate that needs to be reduced. If a certain aggregated sub-segment has aggregated the corresponding segments of the M aggregates of the M execution workstations, it means that the aggregated sub-segment has completed all reductions. The redetermination of the first part and the second part can be set according to the needs of the application. For example, the first part of the aggregated sub-segments re-determined from the remaining part of the first part of the aggregated sub-segments that have been sent after removing the multiple aggregated sub-segments can be the second part of the aggregated sub-segments that have been updated in the previous round of receiving and reducing, that is, the aggregated sub-segments that have been reduced are sent first. For step S205, the execution workstation sends the aggregate sub-segments that have completed the reduction in step S204 to the management workstation, so that the management workstation can splice the aggregate sub-segments that have completed all the reductions into a result aggregate.
[0048] Figure 2B The flowchart of the data processing method performed by the distributed computing system provided by at least one embodiment of the present disclosure is shown. The distributed computing system includes a management workstation and multiple execution workstations.
[0049] like Figure 2B As shown, the data processing method includes steps S301 to S306.
[0050] Steps S301 to S305 are executed by each execution workstation, and step S306 is executed by the management workstation.
[0051] Step S301: splitting an aggregate with a predetermined data format into a plurality of aggregate segments.
[0052] Step S302: sending a first portion of the aggregated sub-segments among the multiple aggregated sub-segments to other execution workstations for reduction on the other execution workstations.
[0053] Step S303: receiving aggregated sub-segments corresponding to the second part of the aggregated sub-segments from other execution workstations and reducing them with the second part of the aggregated sub-segments to update the second part of the aggregated sub-segments, wherein the first part is different from the second part.
[0054] Step S304: redetermine the first part of the aggregated sub-segments and the second part of the aggregated sub-segments from the remaining part of the multiple aggregated sub-segments after removing the sent first part of the aggregated sub-segments and perform the above sending, receiving and reducing until each of the multiple aggregated sub-segments is sent or all reductions are completed.
[0055] Step S305: If there is an aggregated sub-segment that has completed all reductions, the aggregated sub-segment that has completed all reductions is sent to the management workstation.
[0056] Step S306: the management workstation receives the aggregated sub-fragments that complete all reductions and are sent by the multiple execution workstations, and splices the received aggregated sub-fragments into an aggregate.
[0057] Steps S301-S305 and Figure 2A The steps S201-S205 shown are the same and have been described in detail above, and will not be repeated here.
[0058] For step S306, the management workstation receives all the reduced aggregate sub-fragments, and then splices these aggregate sub-fragments into a result aggregate.
[0059] Figure 3The topology diagram of the communication infrastructure of the execution workstation provided by at least one embodiment of the present disclosure is shown. It should be noted that: Figure 3 The connection relationship between each execution workstation in the process only represents the logical communication relationship between them, and does not represent the actual network connection relationship. The actual network connection can be in any suitable way as long as it can achieve Figure 3 The logical communication relationship shown in is sufficient.
[0060] like Figure 3 As shown, for example, there are four execution workstations in the distributed computing system, namely, execution workstation 0, execution workstation 1, execution workstation 2, and execution workstation 3. The four execution workstations communicate in the form of a parallel directional ring. Each execution workstation can send a message to the next execution workstation and receive a message from the previous workstation. For example, execution workstation 3 sends a message to execution workstation 0 and receives a message from execution workstation 2. Figure 3 The arrows in the figure represent message channels. There can be one or more parallel message channels between two adjacent execution workstations. Figure 3 Two parallel message channels (parallel communication lines) are shown, marked as "0" and "1" respectively.
[0061] In some embodiments of the present disclosure, the number of aggregate sub-segments into which the aggregate is split may be equal to the number of execution workstations participating in the aggregation multiplied by the number of parallel communication lines of each execution workstation, and the number of the first part of aggregate sub-segments and the number of the second part of aggregate sub-segments are respectively the number of parallel communication lines of each execution workstation. In this case, communication resources can be fully utilized to improve parallelism.
[0062] For example, in Figure 3 In the case shown, the number of aggregated sub-segments into which the aggregate is split is equal to the number of execution workstations participating in the aggregation (4) multiplied by the number of parallel communication lines of each execution workstation (2), that is, it is split into 8 aggregated sub-segments. The number of the first part of aggregated sub-segments and the number of the second part of aggregated sub-segments are 2 respectively. Therefore, in each round of processing, an execution workstation can send 2 aggregated sub-segments and receive 2 aggregated sub-segments simultaneously through 2 communication lines.
[0063] Figure 4 A flowchart of a sending, receiving and reducing process performed by multiple execution workstations provided by at least one embodiment of the present disclosure is shown. The number of multiple execution workstations is N, and they are sequentially numbered as 0, 1, ...i, ...N-1; the number of multiple aggregation sub-segments is also N, and they are sequentially numbered as 0, 1, ...i, ...N-1.
[0064] like Figure 4 As shown, the method may include steps S401 to S402.
[0065] Step S401: Let j=N-1.
[0066] Step S402: for i=0 to N-1, the execution workstation i sends its aggregated sub-segment i+j+1 to the execution workstation i+1, and receives the aggregated sub-segment i+j from the execution workstation i-1 and performs reduction, wherein if i-1<0, i-1 is replaced by i+N-1, if i+j>N-1, i+j is replaced by i+jN, and if i+j+1>N-1, i+j+1 is replaced by i+j+1-N;
[0067] If j>1, the value of j is reduced by 1 and step S402 is repeated.
[0068] Step S403: For i=0 to N-1, the execution workstation i sends the aggregated sub-segment i+1 to the management workstation, and if i+1=N, i+1 is replaced by 0.
[0069] For example, N=4, that is, the number of execution workstations is 4, and the number of the plurality of aggregation sub-segments is 4. Let j=N-1=3.
[0070] In the first round of iterations, for execution workstation 0, since i-1<0, i-1=i+N-1=3 is set, and since i+j+1>N-1, i+j+1=i+j+1-N=0 is set, and execution workstation 0 sends its aggregate sub-segment 0 to execution workstation 1, and receives aggregate sub-segment 3 from execution workstation 3 and performs reduction. For execution workstation 1, since i+j=1+3>3, i+j=i+jN=0 is set, and since i+j+1>N-1, i+j+1=i+j+1-N=1 is set, and execution workstation 1 sends its aggregate sub-segment 1 to execution workstation 2, and receives aggregate sub-segment 0 from execution workstation 0 and performs reduction. For execution workstation 2, since i+j=2+3>3, i+j=i+jN=1 is set, and since i+j+1>N-1, i+j+1=i+j+1-N=2 is set, and execution workstation 2 sends its aggregate sub-segment 2 to execution workstation 3, and receives aggregate sub-segment 1 from execution workstation 1 and performs reduction. For execution workstation 3, since i+j=3+3>3, i+j=i+jN=2 is set, and since i+j+1>N-1, i+j+1=i+j+1-N=3 is set, and execution workstation 3 sends its aggregate sub-segment 3 to execution workstation 0, and receives aggregate sub-segment 2 from execution workstation 2 and performs reduction. Since j=3>1, the value of j is reduced by 1, and now j=2, and the second round of iteration is performed.
[0071] In the second round of iteration, for execution workstation 0, since i-1<0, i-1=i+N-1=3 is set, and execution workstation 0 sends its aggregate sub-segment 3 to execution workstation 1, and receives aggregate sub-segment 2 from execution workstation 3 and performs reduction. For execution workstation 1, execution workstation 1 sends its aggregate sub-segment 0 to execution workstation 2, and receives aggregate sub-segment 3 from execution workstation 0 and performs reduction. For execution workstation 2, execution workstation 2 sends its aggregate sub-segment 1 to execution workstation 3, and receives aggregate sub-segment 0 from execution workstation 1 and performs reduction. For execution workstation 3, execution workstation 3 sends its aggregate sub-segment 2 to execution workstation 0, and receives aggregate sub-segment 1 from execution workstation 2 and performs reduction. Since j=2>1, the value of j is reduced by 1, and now j=1, and the third round of iteration is performed.
[0072] In the third iteration, for execution workstation 0, since i-1<0, i-1=i+N-1=3 is set, and execution workstation 0 sends its aggregate sub-segment 2 to execution workstation 1, and receives aggregate sub-segment 1 from execution workstation 3 and performs reduction. For execution workstation 1, execution workstation 1 sends its aggregate sub-segment 3 to execution workstation 2, and receives aggregate sub-segment 2 from execution workstation 0 and performs reduction. For execution workstation 2, since i+j+1>N-1, i+j+1=i+j+1-N=0 is set, and execution workstation 2 sends its aggregate sub-segment 0 to execution workstation 3, and receives aggregate sub-segment 3 from execution workstation 1 and performs reduction. For execution workstation 3, since i+j=3+1>3, i+j=i+jN=0 is set, and since i+j+1>N-1, i+j+1=i+j+1-N=1 is set, and execution workstation 3 sends its aggregated sub-segment 1 to execution workstation 0, and receives aggregated sub-segment 0 from execution workstation 2 and performs reduction. Since j=1, the loop ends and enters step S403.
[0073] For step S403, execution workstation 0 sends aggregated sub-segment 1 to the management workstation, execution workstation 1 sends aggregated sub-segment 2 to the management workstation, and execution workstation 2 sends aggregated sub-segment 3 to the management workstation. For execution workstation 3, since i+1=N, i+1=0, and execution workstation 3 sends aggregated sub-segment 0 to the management workstation.
[0074] Figure 5 Shows Figure 4 Schematic diagram of the algorithm provided when the number of execution workstations is 4.
[0075] like Figure 5As shown, four rounded rectangles represent four execution workstations, and the numbers 0, 1, 2, and 3 on the left side of the rounded rectangles represent the numbers of the execution workstations. Each execution workstation divides the aggregate into four fragments, which are represented by fragment 0, fragment 1, fragment 2, and fragment 3. The rectangle marked with a circular symbol represents the current value to be sent, the rectangle marked with a square symbol represents the next value of the aggregate sub-fragment received and merged from other execution workstations, and the rectangle marked with a triangle symbol represents the final value of the aggregate sub-fragment received and merged from other execution workstations. In the first round of iteration (iteration 0), execution workstation 0 sends its aggregate sub-fragment 0 to execution workstation 1, and receives aggregate sub-fragment 3 from execution workstation 3, execution workstation 1 sends its aggregate sub-fragment 1 to execution workstation 2, and receives aggregate sub-fragment 0 from execution workstation 0, execution workstation 2 sends its aggregate sub-fragment 2 to execution workstation 3, and receives aggregate sub-fragment 1 from execution workstation 1, execution workstation 3 sends its aggregate sub-fragment 3 to execution workstation 0, and receives aggregate sub-fragment 2 from execution workstation 2. In the second round of iteration (iteration 1), execution workstation 0 sends its aggregate sub-segment 3 to execution workstation 1 and receives aggregate sub-segment 2 from execution workstation 3, execution workstation 1 sends its aggregate sub-segment 0 to execution workstation 2 and receives aggregate sub-segment 3 from execution workstation 0, execution workstation 2 sends its aggregate sub-segment 1 to execution workstation 3 and receives aggregate sub-segment 0 from execution workstation 1, execution workstation 3 sends its aggregate sub-segment 2 to execution workstation 0 and receives aggregate sub-segment 1 from execution workstation 2. In the third round of iteration (iteration 2), execution workstation 0 sends its aggregate sub-fragment 2 to execution workstation 1 and merges them to form a final value, and receives aggregate sub-fragment 1 from execution workstation 3 and merges it with the current value to form a final value, execution workstation 1 sends its aggregate sub-fragment 3 to execution workstation 2 and merges it to form a final value, and receives aggregate sub-fragment 2 from execution workstation 0 and merges it with the current value to form a final value, execution workstation 2 sends its aggregate sub-fragment 0 to execution workstation 3 and merges it to form a final value, and receives aggregate sub-fragment 3 from execution workstation 1 and merges it with the current value to form a final value, execution workstation 3 sends its aggregate sub-fragment 1 to execution workstation 0 and merges it to form a final value, and receives aggregate sub-fragment 0 from execution workstation 2 and merges it with the current value to form a final value.
[0076] Figure 6 A schematic block diagram of a distributed computing system provided by at least one embodiment of the present disclosure is shown.
[0077] The distributed computing system 600 includes a plurality of execution workstations 610 and a management workstation 620 .
[0078] Each of the multiple execution workstations 610 is configured to: split an aggregate having a predetermined data format into multiple aggregate sub-fragments; send a first portion of the aggregate sub-fragments among the multiple aggregate sub-fragments to other execution workstations for reduction on the other execution workstations; receive aggregate sub-fragments corresponding to a second portion of the aggregate sub-fragments among the multiple aggregate sub-fragments generated by other execution workstations from other execution workstations and reduce them with the second portion of the aggregate sub-fragments to update the second portion of the aggregate sub-fragments, wherein the first portion is different from the second portion; redetermine the first portion of the aggregate sub-fragments and the second portion of the aggregate sub-fragments from the remaining portion after removing the sent first portion of the aggregate sub-fragments from the multiple aggregate sub-fragments and perform the above sending, receiving and reducing until each of the multiple aggregate sub-fragments is sent or all reductions are completed; and if there is an aggregate sub-fragment that has completed all reductions, send the aggregate sub-fragment that has completed all reductions to the management workstation.
[0079] The execution workstation 610 can execute, for example, Figure 2B Described steps S301-S305.
[0080] The management workstation 620 is configured to receive aggregate sub-fragments that complete all reductions and are sent by multiple execution workstations, and to splice the received aggregate sub-fragments into an aggregate.
[0081] The management workstation 620 may, for example, execute Figure 2B Described step S306.
[0082] For example, the execution workstation 610 and the management workstation 620 can be implemented as hardware, software, firmware, or any feasible combination thereof. For example, the execution workstation 610 and the management workstation 620 can be a dedicated or general circuit, chip, or device, or a combination of a processor and a memory. The embodiments of the present disclosure do not limit the specific implementation forms of the above modules.
[0083] It should be noted that in the embodiment of the present disclosure, the various modules used for the distributed computing system 600 correspond to the various steps of the aforementioned data processing method. For the specific functions used for the distributed computing system 600, please refer to the relevant description of the data processing method, which will not be repeated here. Figure 6 The components and structures shown for the distributed computing system 600 are merely exemplary and non-limiting. The distributed computing system 600 may further include other components and structures as required.
[0084] At least one embodiment of the present disclosure also provides an execution workstation for distributed computing, the execution workstation for distributed computing includes a processor and a memory, the memory includes one or more computer program modules. One or more computer program modules are stored in the memory and are configured to be executed by the processor, and the one or more computer program modules include instructions for implementing the above-mentioned data processing method. The execution workstation for distributed computing can split the object to be reduced into small blocks to obtain higher parallelism, thereby improving processing performance, and thus can be applicable to scalable reduction algorithms.
[0085] Figure 7 FIG. 7 is a schematic block diagram of an execution workstation 700 for distributed computing provided by at least one embodiment of the present disclosure. Figure 7 As shown, the execution workstation 700 for distributed computing includes a processor 710 and a memory 720. The memory 720 is used to store non-transitory computer-readable instructions (e.g., one or more computer program modules). The processor 710 is used to execute non-transitory computer-readable instructions, and when the non-transitory computer-readable instructions are executed by the processor 710, one or more steps in the data processing method described above can be executed. The memory 720 and the processor 710 can be interconnected through a bus system and / or other forms of connection mechanisms (not shown).
[0086] For example, the processor 710 may be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units having data processing capabilities and / or program execution capabilities. For example, the central processing unit (CPU) may be an X86 or ARM architecture, etc. The processor 710 may be a general-purpose processor or a special-purpose processor, and may control other components in the execution workstation 700 for distributed computing to perform desired functions.
[0087] For example, the memory 720 may include any combination of one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules may be stored on the computer-readable storage medium, and the processor 710 may run one or more computer program modules to implement various functions of the execution workstation 700 for distributed computing. Various applications and various data, as well as various data used and / or generated by the application, etc. may also be stored in the computer-readable storage medium.
[0088] It should be noted that, in the embodiments of the present disclosure, the specific functions and technical effects of the execution workstation 700 for distributed computing can be referred to the above description of the data processing method, which will not be repeated here.
[0089] At least one embodiment of the present disclosure further provides a computer-readable storage medium, which is used to store non-transitory computer-readable instructions. When the non-transitory computer-readable instructions are executed by a computer, the above-mentioned data processing method can be implemented. Using the computer-readable storage medium, the object to be reduced can be split into small blocks to obtain more parallelism, thereby improving the scalability of the reduction.
[0090] Figure 8 A schematic diagram of a storage medium provided in some embodiments of the present disclosure. Figure 8 As shown, the storage medium 800 is used to store non-transitory computer-readable instructions 810. For example, when the non-transitory computer-readable instructions 810 are executed by a computer, one or more steps in the data processing method described above can be performed.
[0091] For example, the storage medium 800 may be applied to the execution workstation 700 for distributed computing. Figure 7 The memory 720 in the execution workstation 700 for distributed computing is shown. For example, the description of the storage medium 800 can be referred to Figure 7 The corresponding description of the memory 720 in the execution workstation 700 for distributed computing shown is not repeated here. It should be noted that the drawings of the embodiments of the present disclosure only relate to the structures involved in the embodiments of the present disclosure, and other structures can refer to the general design. In the case of no conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other to obtain new embodiments.
[0092] The above description is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. The protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A data processing method for distributed computing performed by an execution workstation, include: Splitting an aggregate having a predetermined data format into a plurality of aggregate fragments; sending a first portion of the aggregated sub-segments among the plurality of aggregated sub-segments to other execution workstations for performing a first reduction on the other execution workstations; receiving, from other execution workstations, aggregated sub-segments corresponding to a second portion of aggregated sub-segments among the plurality of aggregated sub-segments generated by other execution workstations and performing a second reduction on the aggregated sub-segments and the second portion of aggregated sub-segments to update the second portion of aggregated sub-segments, wherein the first portion is different from the second portion; Re-determine the first part of the aggregated sub-segments and the second part of the aggregated sub-segments from the remaining part of the plurality of aggregated sub-segments after removing the first part of the aggregated sub-segments that have been sent, and perform the sending, receiving, first reduction and second reduction until each of the plurality of aggregated sub-segments is sent or all reductions are completed; and If there is an aggregate sub-fragment that completes all reductions, the aggregate sub-fragment that completes all reductions is sent to the management workstation, so that the management workstation can splice it with other aggregate sub-fragments that complete all reductions into an aggregate sub.
2. The data processing method according to claim 1, wherein The number of aggregated sub-fragments into which the aggregate is split is equal to the number of execution workstations participating in the aggregation; and The number of the first part of aggregated sub-segments and the number of the second part of aggregated sub-segments are respectively one.
3. The data processing method according to claim 1, wherein The number of aggregated sub-fragments into which the aggregate is split is equal to the number of execution workstations participating in the aggregation multiplied by the number of parallel communication lines of each execution workstation; and The number of the first part of aggregated sub-segments and the number of the second part of aggregated sub-segments are respectively the number of parallel communication lines of each execution workstation.
4. The data processing method according to any one of claims 1 to 3, wherein The first portion of aggregate sub-segments newly determined in the remainder of removing the transmitted first portion of aggregate sub-segments from the plurality of aggregate sub-segments is the second portion of aggregate sub-segments updated in the previous round of receiving and second reduction.
5. An execution workstation for distributed computing, comprising a processor and a memory, wherein the memory stores one or more computer program instructions, in, The one or more computer program instructions are stored in the memory and, when executed by the processor, implement the steps of the data processing method according to any one of claims 1 to 4.
6. A data processing method executed by a distributed computing system, the distributed computing system comprising a plurality of execution workstations and a management workstation, wherein the data processing method include: Each of the plurality of execution workstations performs the following steps: Splitting an aggregate having a predetermined data format into a plurality of aggregate fragments; sending a first portion of the aggregated sub-segments among the plurality of aggregated sub-segments to other execution workstations for performing a first reduction on the other execution workstations; receiving, from other execution workstations, aggregated sub-segments corresponding to a second portion of aggregated sub-segments among the plurality of aggregated sub-segments generated by other execution workstations and performing a second reduction on the aggregated sub-segments and the second portion of aggregated sub-segments to update the second portion of aggregated sub-segments, wherein the first portion is different from the second portion; Re-determine the first part of the aggregated sub-segments and the second part of the aggregated sub-segments from the remaining part of the plurality of aggregated sub-segments after removing the first part of the aggregated sub-segments that have been sent, and perform the sending, receiving, first reduction and second reduction until each of the plurality of aggregated sub-segments is sent or all reductions are completed; and If there is an aggregated sub-segment that completes all reductions, sending the aggregated sub-segment that completes all reductions to the management workstation; and The management workstation receives the aggregated sub-fragments that complete all reductions and are sent by the multiple execution workstations, and splices the received aggregated sub-fragments into an aggregate.
7. The data processing method according to claim 6, wherein The number of the aggregated sub-fragments into which the aggregate is split is equal to the number of the plurality of execution workstations; and The number of the first part of aggregated sub-segments and the number of the second part of aggregated sub-segments are respectively one.
8. The data processing method according to claim 7, wherein The number of the plurality of execution workstations is N, and they are sequentially numbered as 0, 1, ...i, ...N-1; The number of the plurality of aggregated sub-segments is N, and they are sequentially numbered as 0, 1, ...i, ...N-1; The multiple execution workstations perform the above steps of sending, receiving, first reduction and second reduction as follows: Step 1: Let j = N-1, Step 2: For i=0 to N-1, the i-th execution workstation sends its i+j+1-th aggregate sub-segment to the i+1-th execution workstation, and receives the i+j-th aggregate sub-segment from the i-1-th execution workstation and performs the second reduction. in, If i-1<0, then i-1 is replaced by i+N-1; if i+j>N-1, then i+j is replaced by i+jN; if i+j+1>N-1, then i+j+1 is replaced by i+j+1-N; If j>1, reduce the value of j by 1 and repeat the second step; Step 3: For i=0 to N-1, the i-th execution workstation sends the i+1-th aggregated sub-segment to the management workstation, wherein if i+1=N, i+1 is replaced by 0.
9. The data processing method according to claim 6, wherein The number of aggregated sub-fragments into which the aggregate is split is equal to the number of the plurality of execution workstations multiplied by the number of parallel communication lines of each execution workstation; and The number of the first part of aggregated sub-segments and the number of the second part of aggregated sub-segments are respectively the number of parallel communication lines of each execution workstation.
10. A distributed computing system, comprising a plurality of execution workstations and a management workstation, wherein Each of the plurality of execution workstations is used to: Splitting an aggregate having a predetermined data format into a plurality of aggregate fragments; sending a first portion of the aggregated sub-segments among the plurality of aggregated sub-segments to other execution workstations for performing a first reduction on the other execution workstations; receiving, from other execution workstations, aggregated sub-segments corresponding to a second portion of aggregated sub-segments among the plurality of aggregated sub-segments generated by other execution workstations and performing a second reduction on the aggregated sub-segments and the second portion of aggregated sub-segments to update the second portion of aggregated sub-segments, wherein the first portion is different from the second portion; Re-determine the first part of the aggregated sub-segments and the second part of the aggregated sub-segments from the remaining part of the plurality of aggregated sub-segments after removing the first part of the aggregated sub-segments that have been sent, and perform the sending, receiving, first reduction and second reduction until each of the plurality of aggregated sub-segments is sent or all reductions are completed; and If there is an aggregated sub-segment that completes all reductions, sending the aggregated sub-segment that completes all reductions to the management workstation; and The management workstation is used to receive the aggregated sub-fragments that complete all reductions and are sent by the multiple execution workstations, and to splice the received aggregated sub-fragments into an aggregate.
11. A computer-readable storage medium non-temporarily storing computer-readable instructions, in, When the computer-readable instructions are executed by a processor, the data processing method according to any one of claims 1 to 4 is implemented.
