-
Notifications
You must be signed in to change notification settings - Fork 2
/
sequence_cognition_20.plantuml
80 lines (73 loc) · 1.91 KB
/
sequence_cognition_20.plantuml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
@startuml
box "Client"
actor "Client" as client
participant "Client dApp" as dapp
end box
box "Distributed Data"
entity "Pandora Contracts" as pandora
database "IPFS" as ipfs
end box
box "Workers"
collections "Worker Nodes" as workers
control "Keras/TensorFlow" as nn
collections "Validating Nodes" as validators
end box
entity "Cognition Contract" as cognition
== Cognition ==
activate workers
workers -> cognition: readData
cognition --> workers: < cognitive job info >
workers ->> ipfs: download
... downloading ...
ipfs -->> workers: < files >
workers -> workers: integrityCheck
workers -> workers: consistencyCheck
alt Data are incorrect
workers ->> cognition: incorrectData
cognition ->> pandora: arbitrateInvalidData
ref over pandora, workers, validators: Data artibitrage
|||
else Data are correct
workers -> nn: loadNetwork
activate nn
workers -> nn: getDetails
activate pandora
alt Worker declines
workers ->> pandora: jobDeclined
pandora -[#red]->x workers: penalty
group repeat [workers lottery]
end
|||
else Worker accepts job
workers ->> pandora: jobAccepted(timeEstimation)
pandora -> pandora: updateWorkers
deactivate pandora
workers ->> nn: compute
... computing ...
nn -->> workers: < results >
deactivate nn
workers ->> ipfs: upload
... uploading ...
ipfs -->> workers: < addresses >
opt timeout
pandora -[#blue]->> workers: updateTimeEstimation
activate pandora
alt Worker responses
workers ->> pandora: updateTimeEstimation
pandora -[#red]->x workers: smallPenalty
else Worker does not response
pandora -[#red]->x workers: penalty
group repeat [workers lottery]
end
end
deactivate pandora
end
workers -> cognition: acceptResults
deactivate workers
activate cognition
end
end
== Validation ==
ref over pandora, cognition: Validation
|||
@enduml