|
Algorithm 5 Algorithm for traceability query. |
Input: Query object:
Output: traceability information chain: and
-
1:
while All have been queried on the privacy-chain do
-
2:
(Diffp(TDn), BHn) ← Find the on the privacy-chain, BH is the height of the block.
-
3:
Add (Diffp(TDn), BHn) to the .
-
4:
end while
-
5:
Then get a complete and Sort it by timestamp.
-
6:
= (Diffp(TD0),BH0)←(Diffp(TD1),BH1)←...← (Diffp(TDn), BHn).
-
7:
while All have been queried in
do
-
8:
According to the (Diffp(TDn),BHn), Query data from its management node.
-
9:
The management node query TD from its self-chain based on BHn and its hash(TD).
-
10:
Add TDn to the .
-
11:
end while
-
12:
Then get a complete .
-
13:
= TD0←TD1←...←TDn.
|