Summary of the invention
Goal of the invention:In order to overcome the deficiencies in the prior art, the present invention, which provides, a kind of utilizes network topological information
Construct the restorative procedure for simple regeneration code of parallel tree-shaped repair path.
Technical solution:In order to solve the above technical problems, the present invention provides it is a kind of using network topological information it is simple again
Raw code restorative procedure, specific step is as follows for data reparation:
Step 1:It is configured, is obtained according to the distributed memory system where failure node and the simple regeneration code of application
The simple regeneration code coding parameter (n, k, f) that system uses by node to be repaired, repairs the memory node for participating in node and being constituted
Link set in set and memory node set between each node;
Step 2:Network G (N, E) is repaired in building, and wherein N is that node set is made of node to be repaired and participation node,
Meet | N |=2f+1, f+1 node set Vi(1≤i≤f+1), set ViRepresent i-th of loss data block on node to be repaired
Participation node set needed for repairing,E is link set, is met | E | structure between each pair of node in=f (2f+1), N
Build a link;Each of the links in E are all associated with a bandwidth C (e), e ∈ E;
Step 3:According to the reparation network established in step 2, tree developing algorithm building is repaired for all f using parallel
F+1 of+1 loss data block are parallel to repair tree Fi(1≤i≤f+1);
Step 4:To reparation tree F obtained in step 3i(1≤i≤f+1) carries out the reparation to data block.
Wherein, tree F is repaired in building in step 3i(1≤i≤f+1) specific step is as follows:
Step 3.1:Repair data number of blocks is m, is initialized as 0 to the data block repaired, represents no data block
It is repaired, has constructed successfully to repair and set set F, F is initialized as sky;
Step 3.2:Loss data block is f+1, judges whether the data block f+1 lost and repair data block are equal, such as
Fruit is unequal to enter step 3.3, if equal proof repairs tree set Fi(1≤i≤f+1) is constructed successfully;
Step 3.3:The optimal reparation of f+1-m item is generated to remaining data block and sets OTj(1≤j≤f+1-m);
Step 3.4:OT is set to optimal reparationj(1≤j≤f+1-m) is ranked up by rule;
Step 3.5:For the reparation tree OT of highest prioritysDistribute link bottleneck bandwidth Bs;
Step 3.6:Link bandwidth is adjusted for OTsLink e, C (e)=C (e)-B of processs;
Step 3.7:The reparation tree OT of corresponding data blocksReparation tree construct complete, by OTsIt is added to reparation tree set F
In, repair data block m=m+1, and be again introduced into step 3.2 for m and judged with loss data block f+1.
Wherein, repaired that specific step is as follows in step 4 to data block:
Step 4.1:A node in OT is set in some given corresponding reparation for losing data block;
Step 4.2:Judge whether root node obtains all data blocks, data block is successfully restored if obtaining, if do not had
Have, is entered step 4.3;
Step 4.3:The data for judging whether to receive child node transmission, if the data for receiving child node transmission into
Enter step 4.4, otherwise carries out judging whether there is again and repair required and not sent data, and if so, being sent out to father node
It send data and is again introduced into step 4.2;
Step 4.4:It judges whether there is and repairs required and not sent data, if there is no then to father node forwarding number
According to and be again introduced into step 4.2, and if so, being sent to father node and again after received data and stored data XOR operation
It is secondary to enter step 4.2.
Wherein, optimal reparation tree OT is generated in step 3.3j(1≤j≤f+1-m) specific step is as follows:
Step 3.3.1:The participation node set V of a given corresponding non-repair data blocki(1≤i≤f+1-m);
Step 3.3.2:According to the optimal bottleneck path p of the dijkstra's algorithm of modification calculating source node to all nodest
(t∈N);
Step 3.3.3:For ViIn all nodes optimal bottleneck path pt(t ∈ N) is merged;
Step 3.3.4:Using obtained source node as root, V is generatediIn all nodes optimal reparation tree.
Wherein, the optimal ordering rule for repairing tree is in step 3.4:Optimal reparation tree OT has d side, where each edge
Link has an available bandwidth value, to it is all while according to while where link available bandwidth ascending order arrangement after, obtain d side
An arrangement b1≤b2≤b3≤…≤bd, b1For the bandwidth bottleneck link of the reparation tree;Two corresponding different files to be repaired
The reparation tree OT of block1And OT2, two are repaired the n and m link that tree passes through respectively in network, then OT1< OT2And if only if:
1) there are k (k≤n, k≤m), so that
2) n < m and
Wherein, optimal bottleneck path p of the calculating source node to all nodes in step 3.3.2tThe specific steps of (t ∈ N)
It is as follows:
Step 3.3.2.1:Obtain the available bandwidth C (e), e ∈ E on network information G (N, E) and every remotest places;
Step 3.3.2.2:Source node s is marked, and defines the bottleneck band in the optimal bottleneck path from source node s to node x
Width is widthto (x), bottleneck bandwidth widthto (s)=∞ of the node s to its own;
Step 3.3.2.3:Judge whether all nodes are labeled, obtains if all nodes are all labeled by source
Node s sets out into network the optimal bottleneck path p of each nodet(t ∈ N), if all nodes are not all marked
Then enter step 3.3.2.4;
Step 3.3.2.4:Examine bottleneck bandwidth widthto (j)=max of all flag node k to tail flag node j
{min{widthto(k),C(k,j)}};
Step 3.3.2.5:Never widthto (i) maximum i is chosen in flag node;
Step 3.3.2.6:It is pre (i) that the node being connected directly with i is searched in marked node;
Step 3.3.2.7:Flag node i simultaneously carries out judging whether all nodes have been marked again by step 3.3.2.3
Note.
Wherein, as follows about optimal bottleneck path merging process in step 3.3.3:
To the optimal bottleneck path p of node i by source node si:s,n1,n2,…,nk,…,i;
To the optimal bottleneck path p of node j by source node sj:s,m1,m2,…,mt,…,j;
Two paths are in respective point nkWith mtIntersect, i.e. nk=mt,nk-1!=mt-1, then merge after tree-shaped knot
Structure is selection s, n1,n2,…,nkOr s, m1,m2,…,mtAs common link, piWith pjUpper nkLink later as sublink,
It is linked to n respectivelykOn.
The coding mode of simple regeneration code is a kind of block encoding process:In (n, k, f) simple regeneration code, input file quilt
It is cut into f block, every piece is recoded into n sub-block using MDS (n, k) coding.Obtained f group coded data block carries out exclusive or
Operation obtains one group of check block.F+1 group data block is placed on n memory node according to certain rule.By simple regeneration
There is f+1 data block on each memory node after code coding.Need to restore all f+1 loss numbers when repairing failure node
According to block, and participation node set needed for repairing each data block is different.This encoding characteristics cause for common correcting and eleting codes
Repairing algorithm with the tree-shaped node of regeneration code can not be applied in the node repair process of simple regeneration code, and therefore, the present invention mentions
Algorithm is repaired for the parallel tree-shaped of simple regeneration code node repair process out.
The present invention is that f+1 loss data block of failure node in (n, k, f) simple regeneration code plans tree-shaped reparation respectively
Path, so that different data block repair process parallelization, reduces node and repair time delay, improve network bandwidth utilization factor.Simultaneously originally
The calculation for inventing the encoding and decoding without changing simple regeneration code uses simple regeneration code as storage redundancy suitable for all
The distributed memory system of strategy.
Compared with prior art, the present invention having the advantages that:
1, the present invention is by the coding/decoding capability using network link bandwidth information and transmission path intermediate node to simple
Regeneration code repair process optimizes, and building is directed to the tree-shaped repair path of particular lost data block, so that data block was repaired
Journey energy reasonable employment high-bandwidth link reduces and repairs time delay.
2, decoding method of the bottom decoding method based on simple regeneration code script in the present invention, makes suitable for all
Use simple regeneration code as the distributed memory system of storage redundancy strategy.
Specific embodiment
The present invention will be further explained with reference to the accompanying drawing.
The present invention is based on use distributed memory system of the simple regeneration code as storage redundancy strategy to utilize network topology
Information and bandwidth information optimize node repair process.
Data reparation as described in Figure 1 the specific steps are:
Step 1:It is configured, is obtained according to the distributed memory system where failure node and the simple regeneration code of application
The simple regeneration code coding parameter (n, k, f) that system uses by node to be repaired, repairs the memory node for participating in node and being constituted
Link set in set and memory node set between each node;
Step 2:Network G (N, E) is repaired in building, and wherein N is that node set is made of node to be repaired and participation node,
Meet | N |=2f+1, f+1 node set Vi(1≤i≤f+1), set ViRepresent i-th of loss data block on node to be repaired
Participation node set needed for repairing,E is link set, is met | E | structure between each pair of node in=f (2f+1), N
Build a link;Each of the links in E are all associated with a bandwidth C (e), e ∈ E;
Step 3:According to the reparation network established in step 2, tree developing algorithm building is repaired for all using parallel
F+1 of f+1 loss data block are parallel to repair tree Fi(1≤i≤f+1);As shown in Figure 1, tree F is repaired in buildingi(1≤i≤f+
1) the specific steps are:
Step 3.1:Repair data number of blocks is m, is initialized as 0 to the data block repaired, represents no data block
It is repaired, has constructed successfully to repair and set set F, F is initialized as sky;
Step 3.2:Loss data block is f+1, judges whether the data block f+1 lost and repair data block are equal, such as
Fruit is unequal to enter step 3.3, if equal proof repairs tree set Fi(1≤i≤f+1) is constructed successfully;
Step 3.3:The optimal reparation of f+1-m item is generated to remaining data block and sets OTj(1≤j≤f+1-m);As shown in Fig. 2,
Generating the step of optimal reparation is set is:
Step 3.3.1:The participation node set V of a given corresponding non-repair data blocki(1≤i≤f+1-m);
Step 3.3.2:According to the optimal bottleneck path p of the dijkstra's algorithm of modification calculating source node to all nodest
(t∈N);As shown in figure 3, calculate source node to the optimal bottleneck paths of all nodes the specific steps are:
Step 3.3.2.1:Obtain the available bandwidth C (e), e ∈ E on network information G (N, E) and every remotest places;
Step 3.3.2.2:Source node s is marked, and defines the bottleneck band in the optimal bottleneck path from source node s to node x
Width is widthto (x), bottleneck bandwidth widthto (s)=∞ of the node s to its own;
Step 3.3.2.3:Judge whether all nodes are labeled, obtains if all nodes are all labeled by source
Node s sets out into network the optimal bottleneck path p of each nodet(t ∈ N), if all nodes are not all marked
Then enter step 3.3.2.4;
Step 3.3.2.4:Examine bottleneck bandwidth widthto (j)=max of all flag node k to tail flag node j
{min{widthto(k),C(k,j)}};
Step 3.3.2.5:Never widthto (i) maximum i is chosen in flag node;
Step 3.3.2.6:It is pre (i) that the node being connected directly with i is searched in marked node;
Step 3.3.2.7:Flag node i simultaneously carries out judging whether all nodes have been marked again by step 3.3.2.3
Note.
Step 3.3.3:For ViIn all nodes optimal bottleneck path pt(t ∈ N) is merged;Optimal bottleneck path
Merging process is as follows:
To the optimal bottleneck path p of node i by source node si:s,n1,n2,…,nk,…,i;
To the optimal bottleneck path p of node j by source node sj:s,m1,m2,…,mt,…,j;
Two paths are in respective point nkWith mtIntersect, i.e. nk=mt,nk-1!=mt-1, then merge after tree-shaped knot
Structure is selection s, n1,n2,…,nkOr s, m1,m2,…,mtAs common link, piWith pjUpper nkLink later as sublink,
It is linked to n respectivelykOn.
Step 3.3.4:Using obtained source node as root, V is generatediIn all nodes optimal reparation tree.
Step 3.4:OT is set to optimal reparationj(1≤j≤f+1-m) is ranked up by rule;The optimal sequence rule for repairing tree
Then it is:Optimal reparation tree OT has d side, and the link where each edge has an available bandwidth value, to it is all while according to while
After the available bandwidth ascending order arrangement of place link, an arrangement b on d side is obtained1≤b2≤b3≤…≤bd, b1For the reparation
The bandwidth bottleneck link of tree;The reparation tree OT of two corresponding different blocks of files to be repaired1And OT2, two reparation trees are respectively by net
N and m link in network, then OT1< OT2And if only if:
1) there are k (k≤n, k≤m), so that
2) n < m and
Step 3.5:For the reparation tree OT of highest prioritysDistribute link bottleneck bandwidth Bs;
Step 3.6:Link bandwidth is adjusted for OTsLink e, C (e)=C (e)-B of processs;
Step 3.7:The reparation tree OT of corresponding data blocksReparation tree construct complete, by OTsIt is added to reparation tree set F
In, repair data block m=m+1, and be again introduced into step 3.2 for m and judged with loss data block f+1.
Step 4:To reparation tree F obtained in step 3i(1≤i≤f+1) carries out the reparation to data block.Such as Fig. 4 institute
Show, by lose data block reparation tree to data block repaired the specific steps are:
Step 4.1:A node in OT is set in some given corresponding reparation for losing data block;
Step 4.2:Judge whether root node obtains all data blocks, data block is successfully restored if obtaining, if do not had
Have, is entered step 4.3;
Step 4.3:The data for judging whether to receive child node transmission, if the data for receiving child node transmission into
Enter step 4.4, otherwise carries out judging whether there is again and repair required and not sent data, and if so, being sent out to father node
It send data and is again introduced into step 4.2;
Step 4.4:It judges whether there is and repairs required and not sent data, if there is no then to father node forwarding number
According to and be again introduced into step 4.2, and if so, being sent to father node and again after received data and stored data XOR operation
It is secondary to enter step 4.2.
The Network status in the node repair process of (5,3,2) simple regeneration code is indicated by taking Fig. 5 as an example.Wherein there are 5 sections
Point is connected between node by network link two-by-two, and each of the links have corresponding bandwidth.
Assuming that node i is node to be repaired, wherein loss data block is respectively with corresponding reparation participation node:
Data block xi, participation node is node i -2, node i -1;
Data block yi+1, participation node is node i -1, node i+1;
Data block si+2, participation node is node i+1, node i+2;
In the algorithmic procedure of Fig. 1 description, m is initialized as 0, the algorithm after 3 wheel three tree-shaped repair paths of grey iterative generation
Terminate.This three repair paths respectively correspond a loss data block.
In first round iteration, three optimal reparations are generated first with optimal reparation tree generation algorithm and are set, process is as follows:
Step 1:The optimal bottle from node i to other nodes is calculated using the dijkstra's algorithm of the modification described by Fig. 3
Neck path:
Initialization:D={ i },Widthto (i)=∞
The first round:D={ i },
Widthto (i-1)=min { widthto (i), C (i, i-1) }=40,
Widthto (i-2)=min { widthto (i), C (i, i-2) }=45,
Widthto (i+1)=min { widthto (i), C (i, i+1) }=30,
Widthto (i+2)=min { widthto (i), C (i, i+2) }=35
Second wheel:D={ i, i-2 },
Third round:D={ i, i-2, i-1 },
Fourth round:D={ i, i-2, i-1, i+1 },
As a result:Widthto (i)=∞, widthto (i-1)=45, widthto (i-2)=45,
Widthto (i+1)=45, widthto (i+2)=35
Obtain be by the optimal bottleneck path of node i to each node:
Node i -2:I → i-2, bottleneck link bandwidth 45;
Node i -1:I → i-2 → i-1, bottleneck link bandwidth 45;
Node i+1:I → i-2 → i-1 → i+1, bottleneck link bandwidth 45;
Node i+2:I → i+2, bottleneck link bandwidth 35;
:Step 2:For each lost block data block, its optimal reparation tree is constructed:
Data block xiReparation to participate in node be i-2, i-1, then its optimal reparations tree is i-1 → i-2 → i;
Data block yi+1Reparation to participate in node be i-1, i+1, then its optimal reparations tree is i+1 → i-1 → i-2 → i;
Data block si+2Reparation to participate in node be i+1, i+2, then its optimal reparations, which is set, is
i+2→i,i+1→i-1→i-2→i;
Step 3:Obtained all optimal reparations are set and are ranked up according to the strategy, the reparation of highest priority is taken out
Tree:
Quicksort, merger sequence scheduling algorithm can be used in sort algorithm.Wait the size relation between the element that sorts according to
The rule is judged.
Got in step 2 three optimal reparation trees are ranked up according to the rule, obtain highest priority most
Excellent reparation tree is data block si+2Optimal reparation tree, the bottleneck bandwidth of the reparation tree is 35.For the optimal chain repairing tree and passing through
Road distributes respective bandwidth and is used for si+2Repair process, then data block si+2Reparation time delay be m/35.
Second wheel iteration, carries out same process on remaining sub-network figure.
A step:Obtained using the dijkstra's algorithm of modification be by the optimal bottleneck path of node i to each node:
Node i -2:I-2 → i+1 → i+2 → i-1 → i, link bottleneck bandwidth 25;
Node i -1:I-1 → i, link bottleneck bandwidth 40;
Node i+1:I+1 → i+2 → i-1 → i, link bottleneck bandwidth are 35;
Node i+2:I+2 → i-1 → i, link bottleneck bandwidth 35;
B step:For remaining data block to be repaired, its optimal reparation tree is constructed:
Data block xiOptimal reparation tree be i-2 → i+1 → i+2 → i-1 → i;
Data block yi+1Optimal reparation tree be i+1 → i+2 → i-1 → i;
C step:Obtained optimal reparation tree is ranked up according to the rule, obtains the optimal reparation of highest priority
Tree is data block xiReparation tree, the reparation tree bottleneck bandwidth be 25.The optimal bandwidth repaired needed for setting is distributed in network
Resource is used for xiReparation, then data block xiReparation time delay be m/25.
Third round iteration carries out same process on remaining sub-network figure.
Data block to be repaired is yi+1, participation node is node i -1, node i+1.
A step:It is obtained using the dijkstra's algorithm of modification by node i to described two optimal bottleneck roads for participating in node
Diameter is:
Node i -1:I-1 → i+1 → i, link bottleneck bandwidth 20;
Node i+1:I+1 → i, link bottleneck bandwidth 30;
B step:For data block y to be repairedi+1, construct its optimal reparation tree:
Data block yi+1Optimal reparation tree be i-1 → i+1 → i;
C step:Selectable optimal reparation tree only has the yi+1Optimal reparation tree, the bottleneck bandwidth of the reparation tree is
20.In the reparation tree, data block yi+1Reparation time delay be m/20.
After algorithm proposed by the present invention operation, 3 parallel tree-shaped repair paths are generated.Utilize this 3 parallel repair way
Diameter repairs failure node i parallel, and the reparation time delay of node i is max { m/35, m/25, m/20 }=m/20.
In the conventional node repair process of simple regeneration code, participate in node data passed to by direct link it is to be repaired
Knot cluster point.In this mode, repair process time delay shown in Fig. 5 is max { 2m/40,2m/30, m/45, m/35 }=m/15.
From the foregoing, it will be observed that node can be effectively reduced in this example using algorithm proposed by the present invention repairs time delay.
The method of the present invention utilizes network topology and link bandwidth information, utilizes the encoding and decoding energy of network code intermediate node
Power optimizes the node repair process of simple regeneration code, reduces the reparation time delay of node.The method of the present invention calculates letter
Single, versatility and scalability are strong, to using node of the simple regeneration code as the distributed memory system for storing redundancy strategy to repair
Multiple efficiency has very big promotion.
The above is only a preferred embodiment of the present invention, it should be pointed out that:For the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.