KR20220141170A - Leader election method using federated learning for private blockchain, recording medium and device for performing the method - Google Patents

Leader election method using federated learning for private blockchain, recording medium and device for performing the method Download PDF

Info

Publication number
KR20220141170A
KR20220141170A KR1020210047393A KR20210047393A KR20220141170A KR 20220141170 A KR20220141170 A KR 20220141170A KR 1020210047393 A KR1020210047393 A KR 1020210047393A KR 20210047393 A KR20210047393 A KR 20210047393A KR 20220141170 A KR20220141170 A KR 20220141170A
Authority
KR
South Korea
Prior art keywords
leader
candidate
federated learning
node
network
Prior art date
Application number
KR1020210047393A
Other languages
Korean (ko)
Other versions
KR102486419B1 (en
Inventor
도인실
채기준
김동희
Original Assignee
이화여자대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 이화여자대학교 산학협력단 filed Critical 이화여자대학교 산학협력단
Priority to KR1020210047393A priority Critical patent/KR102486419B1/en
Publication of KR20220141170A publication Critical patent/KR20220141170A/en
Application granted granted Critical
Publication of KR102486419B1 publication Critical patent/KR102486419B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/30Decision processes by autonomous network management units using voting and bidding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A leader election method using federative learning in a private blockchain comprises the following steps of: monitoring parameters of a number of transitions from each node of a private blockchain to a candidate node, freshness of a log index, and a set timeout time; generating a federative learning model by learning about a relationship between the parameters and network stability for previous leaders; calculating a weight that each parameter contributes to the network stability according to the generated federated learning model; calculating a network stability value by applying the calculated weight to each parameter; and if election of a leader is consented, electing the leader by reflecting the calculated network stability. Accordingly, by electing a leader that can guarantee optimized performance according to flexible network environment conditions through an improved raft algorithm, a block confirmation time is shortened to improve performance.

Description

프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법, 이를 수행하기 위한 기록 매체 및 장치{LEADER ELECTION METHOD USING FEDERATED LEARNING FOR PRIVATE BLOCKCHAIN, RECORDING MEDIUM AND DEVICE FOR PERFORMING THE METHOD}LEADER ELECTION METHOD USING FEDERATED LEARNING FOR PRIVATE BLOCKCHAIN, RECORDING MEDIUM AND DEVICE FOR PERFORMING THE METHOD

본 발명은 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법, 이를 수행하기 위한 기록 매체 및 장치에 관한 것으로서, 더욱 상세하게는 프라이빗 블록체인의 래프트(raft) 알고리즘에서 발생하는 네트워크 분할(Network Split) 문제를 해결하기 위해 연합학습을 접목하여 지도자 선출 메커니즘을 개선한 기술에 관한 것이다.The present invention relates to a method for selecting a leader using federated learning in a private block chain, a recording medium and an apparatus for performing the same, and more particularly, a network split problem occurring in a raft algorithm of a private block chain. It is about a technology that improves the leader election mechanism by grafting federated learning to solve the problem.

최근 소프트웨어, 에너지, 금융 서비스, 헬스 케어 등 다양한 분야의 기업에서 블록체인을 이용한 비즈니스 사례가 증가하고 있다. 특히, 포브스는 기업이 참가하는 프라이빗 블록체인인 엔터프라이즈 블록체인이 지속적으로 발전하면서 비즈니스 프로세스에서 혁신을 주도할 것이라고 전망했다. Recently, business cases using blockchain are increasing in companies in various fields such as software, energy, financial services, and healthcare. In particular, Forbes predicted that enterprise blockchain, a private blockchain in which companies participate, will continue to develop and lead innovation in business processes.

블록체인이란 피어-투-피어로 연결된 분산 네트워크 시스템에서 모든 노드가 데이터를 담고 있는 블록이 연결된 체인을 동일하게 유지하고 있는 기술을 의미한다. 블록체인은 체인에 연결된 노드 간에 데이터를 공유하는 기술인 원장과 모든 노드가 공유하고 있는 원장의 일관성을 유지하는 기술인 합의 알고리즘 기술로 이루어져 있다. 합의 알고리즘은 사용자의 환경에 따라 효율적으로 사용될 수 있는 적절한 합의 알고리즘 방식을 적용하여 데이터의 무결성과 정확성을 유지한다. Blockchain refers to a technology in which all nodes maintain the same chain in which blocks containing data are connected in a peer-to-peer distributed network system. The blockchain consists of a ledger, a technology that shares data between nodes connected to a chain, and a consensus algorithm technology, a technology that maintains the consistency of the ledger shared by all nodes. The consensus algorithm maintains the integrity and accuracy of data by applying an appropriate consensus algorithm method that can be used efficiently according to the user's environment.

블록체인 네트워크 환경에 따라 적용되는 합의 알고리즘이 달라지는데 블록체인 네트워크 환경은 두 가지 환경으로 나눌 수 있다. 누구나 노드로 참여하고 합의 과정에 참여할 수 있는 퍼블릭 블록체인과 제한된 사용자만이 노드에 참여하고 합의 과정에 참여할 수 있는 프라이빗 블록체인이다.The consensus algorithm applied depends on the blockchain network environment, and the blockchain network environment can be divided into two environments. It is a public blockchain where anyone can participate as a node and participate in the consensus process, and a private blockchain where only limited users can participate in the node and participate in the consensus process.

프라이빗 블록체인에서 사용하는 대표적인 합의 알고리즘은 PBFT(Practical Byzantine Fault Tolerance)와 래프트(raft)가 있다. PBFT는 합의가 진행되는 각 단계마다 모든 노드 간에 커밋(commit) 메시지를 주고 받기 때문에 통신 메시지의 복잡도가 크며 따라서 확정성의 한계를 가진다. Representative consensus algorithms used in private blockchains are PBFT (Practical Byzantine Fault Tolerance) and raft. In PBFT, since a commit message is exchanged between all nodes at each stage of consensus, the complexity of the communication message is large, and thus there is a limit in scalability.

반면에, 래프트(raft) 알고리즘은 리더 기반의 합의 알고리즘으로 리더가 모든 클라이언트의 요청을 처리한 것을 로그를 복제하여 노드에게 전송하기 때문에 심플하다. 또한, 클라이언트의 요청과 관련된 메시지는 리더에서 다른 서버 쪽으로 한 방향으로만 흐르기 때문에 PBFT와 비교해 적은 통신 비용으로 합의할 수 있다. On the other hand, the raft algorithm is a leader-based consensus algorithm, and it is simple because the leader duplicates the log of processing all client requests and transmits it to the node. In addition, since the message related to the client's request flows in only one direction from the reader to the other server, it is possible to agree on a lower communication cost compared to PBFT.

그러나, 래프트(raft) 알고리즘은 리더의 통신이 불안정한 경우, 패킷 손실로 인한 노드 장애와 통신 중단의 발생 확률이 높아진다. 이는 노드의 절반 이상이 현재 지도자의 통제를 벗어나는 네트워크 분할(Network Split)을 야기한다. 래프트(raft) 알고리즘에서 네트워크 분할이 발생하면 새로운 지도자 선출 기간으로 기간 변경이 진행되는데, 리더 선출 기간 동안 네트워크는 클라이언트의 요청에 대한 처리가 중단된다.However, in the raft algorithm, when the leader's communication is unstable, the probability of node failure and communication interruption due to packet loss increases. This results in a network split where more than half of the nodes are out of the control of the current leader. When network segmentation occurs in the raft algorithm, the period is changed to a new leader election period. During the leader election period, the network stops processing client requests.

따라서, TPS(Transaction Per Second) 처리량이 감소되고 블록 확정 시간이 지연되는데, TPS와 블록 확정 시간은 전체 합의 시간에 영향을 미치기 때문에 주요한 합의 성능 판단 기준에 해당한다. 따라서, 래프트(raft) 알고리즘은 노드의 네트워크 안정성에 따라 합의 성능이 영향을 받는다는 취약점이 존재한다.Therefore, TPS (Transaction Per Second) throughput is reduced and block confirmation time is delayed. Since TPS and block confirmation time affect the overall consensus time, they correspond to the main consensus performance criteria. Therefore, the raft algorithm has a weakness that the consensus performance is affected by the network stability of the node.

KR 10-2021-0025411 AKR 10-2021-0025411 A KR 10-2021-0022852 AKR 10-2021-0022852 A KR 10-2021-0010044 AKR 10-2021-0010044 A

D. Ongaro and J. Ousterhout, "In search of an understandable consensus algorithm," 2014 USENIX ATC pp. 305-319., 2014. D. Ongaro and J. Ousterhout, "In search of an understandable consensus algorithm," 2014 USENIX ATC pp. 305-319., 2014.

이에, 본 발명의 기술적 과제는 이러한 점에서 착안된 것으로 본 발명의 목적은 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법을 제공하는 것이다.Accordingly, the technical task of the present invention was conceived in this regard, and an object of the present invention is to provide a method for selecting a leader using federated learning in a private blockchain.

본 발명의 다른 목적은 상기 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법을 수행하기 위한 컴퓨터 프로그램이 기록된 기록 매체를 제공하는 것이다.Another object of the present invention is to provide a recording medium in which a computer program for performing a leader election method using federated learning in the private block chain is recorded.

본 발명의 또 다른 목적은 상기 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법을 수행하기 위한 장치를 제공하는 것이다.Another object of the present invention is to provide an apparatus for performing a leader election method using federated learning in the private block chain.

상기한 본 발명의 목적을 실현하기 위한 일 실시예에 따른 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법은, 프라이빗 블록체인의 각 노드에서 후보자 노드로 전환된 수, 로그 인덱스(index)의 최신도 및 설정된 타임아웃 시간의 파라미터들을 모니터링하는 단계; 파라미터들과 이전 지도자들에 대한 네트워크 안정도의 관계에 대해 학습하여 연합학습 모델을 생성하는 단계; 생성된 연합학습 모델에 따라 각 파라미터가 네트워크의 안정도에 기여하는 가중치를 계산하는 단계; 계산된 가중치를 각 파라미터에 적용한 네트워크 안정도 값을 계산하는 단계; 및 지도자 선출이 합의되면, 계산된 네트워크 안정도 반영하여 지도자를 선출하는 단계;를 포함한다.In the method for selecting a leader using federated learning in a private blockchain according to an embodiment for realizing the object of the present invention, the number of conversions from each node of the private blockchain to a candidate node, the log index and monitoring parameters of the set timeout time; generating a federated learning model by learning about the relationship between parameters and network stability for previous leaders; calculating a weight that each parameter contributes to the stability of the network according to the generated federated learning model; calculating a network stability value by applying the calculated weight to each parameter; and when the leader election is agreed upon, selecting a leader by reflecting the calculated network stability.

본 발명의 실시예에서, 상기 계산된 네트워크 안정도 반영하여 지도자를 선출하는 단계는, 추종자 상태의 노드가 지도자와의 연결이 끊어지는 경우 후보자 상태로 전환되는 단계; 후보자 상태의 노드는 자기 자신에게 투표하고, 텀(term)을 하나 증가시키는 단계; 및 후보자 노드로 전환된 수, 로그 인덱스(index)의 최신도 및 설정된 타임아웃 시간의 파라미터들을 포함시킨 지도자 선거 요청 메시지를 모든 노드에게 전송하는 단계;를 더 포함할 수 있다.In an embodiment of the present invention, the step of selecting a leader by reflecting the calculated network stability includes: converting a node in a follower state to a candidate state when the connection with the leader is cut; a node in the candidate state votes for itself and increases the term by one; and transmitting, to all nodes, a leader election request message including parameters of the number of converted candidate nodes, the freshness of a log index, and a set timeout time to all nodes.

본 발명의 실시예에서, 상기 계산된 네트워크 안정도 반영하여 지도자를 선출하는 단계는, 후보자 상태의 노드가 과반수 이상으로부터 투표를 받은 경우, 지도자로 상태가 전환되는 단계;를 더 포함할 수 있다.In an embodiment of the present invention, the step of selecting a leader by reflecting the calculated network stability may further include a step of changing the state to a leader when the nodes in the candidate state receive a vote from a majority or more.

본 발명의 실시예에서, 상기 계산된 네트워크 안정도 반영하여 지도자를 선출하는 단계는, 후보자가 자신보다 높은 텀(term)을 가지고 있는지 확인하는 단계; 널(null) 또는 후보자 ID인지 확인하는 단계; 후보자의 로그가 최소한 자신의 로그만큼 최신인지 확인하는 단계; 및 후보자의 네트워크 안정도 값이 임계값을 초과하는지 확인하는 단계;를 포함할 수 있다.In an embodiment of the present invention, the step of selecting a leader by reflecting the calculated network stability comprises: checking whether a candidate has a higher term than himself; checking whether it is null or a candidate ID; verifying that the candidate's log is at least as up-to-date as his own; and checking whether the network stability value of the candidate exceeds a threshold value.

본 발명의 실시예에서, 상기 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법은, 일정 주기마다 각 노드에서 학습한 로컬 연합학습 모델을 종합하여 글로벌 연합학습 모델을 업데이트하는 단계;를 더 포함할 수 있다.In an embodiment of the present invention, the method for selecting a leader using federated learning in the private block chain may further include updating the global federated learning model by synthesizing the local federated learning model learned from each node at regular intervals. have.

상기한 본 발명의 다른 목적을 실현하기 위한 일 실시예에 따른 컴퓨터로 판독 가능한 저장 매체에는, 상기 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법을 수행하기 위한 컴퓨터 프로그램이 기록되어 있다. In a computer-readable storage medium according to an embodiment for realizing another object of the present invention, a computer program for performing a leader election method using federated learning in the private block chain is recorded.

상기한 본 발명의 또 다른 목적을 실현하기 위한 일 실시예에 따른 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 장치는, 프라이빗 블록체인의 각 노드에서 후보자 노드로 전환된 수, 로그 인덱스(index)의 최신도 및 설정된 타임아웃 시간의 파라미터들을 모니터링하는 파라미터 선정부; 파라미터들과 이전 지도자들에 대한 네트워크 안정도의 관계에 대해 학습하여 연합학습 모델을 생성하는 연합학습부; 생성된 연합학습 모델에 따라 각 파라미터가 네트워크의 안정도에 기여하는 가중치를 계산하는 가중치 계산부; 계산된 가중치를 각 파라미터에 적용한 네트워크 안정도 값을 계산하는 안정도 계산부; 및 지도자 선출이 합의되면, 계산된 네트워크 안정도 값을 반영하여 지도자를 선출하는 투표부;를 포함한다.A leader election device using federated learning in a private block chain according to an embodiment for realizing another object of the present invention is the number of conversions from each node of the private block chain to a candidate node, the log index a parameter selector for monitoring the parameters of the freshness and the set timeout time; a federated learning unit that generates a federated learning model by learning about the relationship between parameters and network stability with respect to previous leaders; a weight calculation unit for calculating a weight that each parameter contributes to the stability of the network according to the generated federated learning model; a stability calculation unit for calculating a network stability value by applying the calculated weight to each parameter; and a voting unit that selects a leader by reflecting the calculated network stability value when the leader election is agreed upon.

본 발명의 실시예에서, 상기 투표부는, 추종자 상태의 노드가 지도자와의 연결이 끊어지는 경우 후보자 상태로 전환되고, 후보자 노드로 전환된 수, 로그 인덱스(index)의 최신도 및 설정된 타임아웃 시간의 파라미터들을 포함시킨 지도자 선거 요청 메시지를 모든 노드에게 전송할 수 있다.In an embodiment of the present invention, the voting unit switches to the candidate state when the node in the follower state is disconnected from the leader, the number of conversions to the candidate node, the freshness of the log index, and the set timeout time A leader election request message including parameters of can be transmitted to all nodes.

본 발명의 실시예에서, 상기 투표부는, 후보자가 자신보다 높은 텀(term)을 가지고 있고, 널(null) 또는 후보자 ID이고, 후보자의 로그가 최소한 자신의 로그만큼 최신이고, 후보자의 네트워크 안정도 값이 임계값을 초과하는 조건을 만족하는 경우, 후보자를 지도자로 투표할 수 있다.In an embodiment of the present invention, the voting unit is configured such that the candidate has a higher term than itself, is null or a candidate ID, the candidate's log is at least as new as its own, and the candidate's network stability value If a condition exceeding this threshold is met, the candidate may be voted as the leader.

이와 같은 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법에 따르면, 개선된 래프트(raft) 알고리즘에 의해 네트워크 분할(Network Split) 문제의 발생 빈도를 감소시켜 연산 처리 기간을 높임으로써 트랜잭션 처리와 관련된 프라이빗 블록체인 성능을 향상시킨다. 결과적으로, 네트워크가 불안정한 환경의 프라이빗 블록체인에서 개선된 래프트(raft) 알고리즘을 통해 기존 블록체인의 강점인 무결성과 투명성을 보장하면서 데이터 가용성을 높일 수 있다.According to the leader election method using federated learning in such a private block chain, an improved raft algorithm reduces the frequency of network split problems and increases the computation processing period by reducing the occurrence of the network split problem, thereby increasing the private block related to transaction processing. Improves chain performance. As a result, data availability can be increased while ensuring integrity and transparency, the strengths of existing blockchains, through an improved raft algorithm in a private blockchain in an environment where the network is unstable.

도 1은 본 발명의 일 실시예에 따른 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 장치의 블록도이다.
도 2는 본 발명에서 사용하는 래프트(raft) 알고리즘에서 노드의 상태 변환을 설명하기 위한 도면이다.
도 3은 본 발명에서 사용하는 연합학습을 설명하기 위한 도면이다.
도 4는 본 발명에서 저장되는 데이터 구조를 설명하기 위한 도면이다.
도 5는 본 발명의 성능을 검증하기 위해 종래 기술과 비교한 시뮬레이션 결과를 보여주는 표이다.
도 6은 본 발명의 일 실시예에 따른 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법의 흐름도이다.
도 7은 본 발명에서 지도자 선출 매커니즘을 보여주는 흐름도이다.
1 is a block diagram of an apparatus for selecting a leader using federated learning in a private blockchain according to an embodiment of the present invention.
2 is a diagram for explaining the state transformation of a node in the raft algorithm used in the present invention.
3 is a view for explaining the associative learning used in the present invention.
4 is a diagram for explaining a data structure stored in the present invention.
5 is a table showing simulation results compared with the prior art in order to verify the performance of the present invention.
6 is a flowchart of a method for selecting a leader using federated learning in a private blockchain according to an embodiment of the present invention.
7 is a flowchart showing a leader election mechanism in the present invention.

후술하는 본 발명에 대한 상세한 설명은, 본 발명이 실시될 수 있는 특정 실시예를 예시로서 도시하는 첨부 도면을 참조한다. 이들 실시예는 당업자가 본 발명을 실시할 수 있기에 충분하도록 상세히 설명된다. 본 발명의 다양한 실시예는 서로 다르지만 상호 배타적일 필요는 없음이 이해되어야 한다. 예를 들어, 여기에 기재되어 있는 특정 형상, 구조 및 특성은 일 실시예에 관련하여 본 발명의 정신 및 범위를 벗어나지 않으면서 다른 실시예로 구현될 수 있다. 또한, 각각의 개시된 실시예 내의 개별 구성요소의 위치 또는 배치는 본 발명의 정신 및 범위를 벗어나지 않으면서 변경될 수 있음이 이해되어야 한다. 따라서, 후술하는 상세한 설명은 한정적인 의미로서 취하려는 것이 아니며, 본 발명의 범위는, 적절하게 설명된다면, 그 청구항들이 주장하는 것과 균등한 모든 범위와 더불어 첨부된 청구항에 의해서만 한정된다. 도면에서 유사한 참조부호는 여러 측면에 걸쳐서 동일하거나 유사한 기능을 지칭한다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS [0012] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS [0014] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS [0016] Reference is made to the accompanying drawings, which show by way of illustration specific embodiments in which the present invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the present invention. It should be understood that the various embodiments of the present invention are different but need not be mutually exclusive. For example, certain shapes, structures, and characteristics described herein with respect to one embodiment may be implemented in other embodiments without departing from the spirit and scope of the invention. In addition, it should be understood that the location or arrangement of individual components within each disclosed embodiment may be changed without departing from the spirit and scope of the present invention. Accordingly, the detailed description set forth below is not intended to be taken in a limiting sense, and the scope of the present invention, if properly described, is limited only by the appended claims, along with all scope equivalents to those claimed. Like reference numerals in the drawings refer to the same or similar functions throughout the various aspects.

이하, 도면들을 참조하여 본 발명의 바람직한 실시예들을 보다 상세하게 설명하기로 한다. Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the drawings.

도 1은 본 발명의 일 실시예에 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 장치의 블록도이다.1 is a block diagram of an apparatus for selecting a leader using federated learning in a private blockchain according to an embodiment of the present invention.

본 발명에 따른 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 장치(10, 이하 장치)는 기존 래프트(raft) 알고리즘에서 발생하는 네트워크 분할 문제를 해결하기 위해 연합학습을 접목하여 지도자 선출 메커니즘을 개선한 래프트(raft) 알고리즘을 제안한다. 네트워크 분할은 지도자의 통신 장애에 의해 발생하므로 네트워크가 안정적인 노드를 지도자로 선출하도록 지도자 선출 메커니즘을 개선한다. The leader election device (10, hereinafter device) using federated learning in the private block chain according to the present invention is a raft that improves the leader election mechanism by grafting federated learning to solve the network division problem that occurs in the existing raft algorithm. (raft) algorithm is proposed. The network segmentation is caused by the communication failure of the leader, so the leader election mechanism is improved so that the network elects a stable node as the leader.

먼저, 네트워크 안정도를 평가하기 위한 항목으로 후보자로 전환된 횟수, 설정된 타임아웃 시간 그리고 로그 인덱스의 상태를 선정한다. 개선된 래프트(raft) 알고리즘은 이 항목을 기반으로 참여 노드에 대한 데이터를 수집하여 연합학습을 통해 네트워크가 안정적이라고 예측된 노드만을 지도자로 선출하여 네트워크 분할 발생 빈도를 감소시킨다.First, as items for evaluating network stability, the number of times the candidate has been converted, the set timeout time, and the status of the log index are selected. The improved raft algorithm collects data on participating nodes based on this item and reduces the frequency of network splitting by selecting only nodes predicted to be stable through federated learning as leaders.

도 1을 참조하면, 본 발명에 따른 장치(10)는 파라미터 선정부(110), 연합학습부(130), 가중치 계산부(150), 안정도 계산부(170) 및 투표부(190)를 포함한다. 상기 장치(10)는 프라이빗 블록체인을 구성하는 각 노드이거나 각 노드의 일부일 수 있다.Referring to FIG. 1 , the device 10 according to the present invention includes a parameter selection unit 110 , a joint learning unit 130 , a weight calculation unit 150 , a stability calculation unit 170 and a voting unit 190 . do. The device 10 may be each node constituting the private blockchain or may be a part of each node.

본 발명의 상기 장치(10)는 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출을 수행하기 위한 소프트웨어(애플리케이션)가 설치되어 실행될 수 있으며, 상기 파라미터 선정부(110), 상기 연합학습부(130), 상기 가중치 계산부(150), 상기 안정도 계산부(170) 및 상기 투표부(190)의 구성은 상기 장치(10)에서 실행되는 상기 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출을 수행하기 위한 소프트웨어에 의해 제어될 수 있다. In the device 10 of the present invention, software (application) for performing leader election using federated learning in a private block chain may be installed and executed, and the parameter selection unit 110, the federated learning unit 130, The configuration of the weight calculation unit 150, the stability calculation unit 170 and the voting unit 190 is software for performing leader election using federated learning in the private blockchain executed in the device 10. can be controlled by

상기 장치(10)는 별도의 단말이거나 또는 단말의 일부 모듈일 수 있다. 또한, 상기 파라미터 선정부(110), 상기 연합학습부(130), 상기 가중치 계산부(150), 상기 안정도 계산부(170) 및 상기 투표부(190)의 구성은 통합 모듈로 형성되거나, 하나 이상의 모듈로 이루어 질 수 있다. 그러나, 이와 반대로 각 구성은 별도의 모듈로 이루어질 수도 있다.The device 10 may be a separate terminal or may be a part of a module of the terminal. In addition, the configuration of the parameter selection unit 110, the joint learning unit 130, the weight calculation unit 150, the stability calculation unit 170 and the voting unit 190 is formed as an integrated module, or one It may consist of more than one module. However, on the contrary, each configuration may be formed of a separate module.

일반적으로, 합의에 대한 블록체인의 성능을 평가할 때 트랜잭션 처리량(throughput)과 트랜잭션 지연시간(latency)을 사용한다. 트랜잭션 지연시간은 트랜잭션이 요청된 시간과 최종 커밋 되었을 때 사이의 시간을 의미한다. 블록체인이 높은 성능을 가지기 위해서는 트랜잭션 지연시간이 짧아야 한다.In general, transaction throughput and transaction latency are used when evaluating the performance of a blockchain for consensus. Transaction latency refers to the time between when a transaction is requested and when it is finally committed. In order for the blockchain to have high performance, the transaction latency must be short.

트랜잭션 처리량은 정해진 기간 내에 유효한 트랜잭션을 처리한 비율을 나타내며, number of transactions per second(TPS)로 표현된다. TPS가 높을수록 좋은 성능을 나타낸다.Transaction throughput indicates the rate of processing valid transactions within a specified period and is expressed as number of transactions per second (TPS). The higher the TPS, the better the performance.

래프트(raft) 알고리즘은 지도자(leader, 리더) 기반 합의 알고리즘으로써 클라이언트의 요청에 대한 수용과 모든 노드에서의 요청 처리를 지도자에 의해 운영된다. 그러나 byzantine fault는 고려하지 않기 때문에 모든 노드를 신뢰할 수 있다고 가정하는 프라이빗 블록체인에서 합의 알고리즘으로 적용된다.The raft algorithm is a leader-based consensus algorithm and is operated by the leader to accept client requests and process requests in all nodes. However, since the byzantine fault is not considered, it is applied as a consensus algorithm in a private blockchain that assumes that all nodes can be trusted.

래프트(raft)는 리더선출, 로그복제, 안정성(safety)라는 세가지 메커니즘에 의해 작동된다. Raft operates by three mechanisms: leader election, log replication, and safety.

도 2를 참조하면, 래프트(raft)는 노드를 지도자(leader, 리더), 후보자(candidate), 추종자(follower, 팔로워)의 세가지 역할로 나눈다. 래프트(raft)는 상태 복제 머신 기반으로 진행되고 각 노드는 반드시 세가지 중 하나의 상태가 되도록 한다.Referring to FIG. 2 , a raft divides a node into three roles: a leader (leader), a candidate (candidate), and a follower (follower). Raft is based on a state replication machine, and each node must be in one of three states.

지도자는 클라이언트의 요청을 받고 이것을 포함 시킨 로그를 다른 노드들에게 전달하는 일을 수행한다. 로그를 전달하고 로그에 담긴 명령을 실행하는 지시는 지도자만 할 수 있다. 지도자는 주기적으로 추종자에게 로그가 담긴 RPC메시지를 보낸다. RPC메시지는 AppendEntries라고 부르며 리더의 term, leaderId, Log와 관련된 내용을 포함하고 있다. 텀(term)은 래프트(raft)에서 가지는 시간상의 순서를 의미한다. The leader receives the client's request and delivers the log including this to other nodes. Only the leader can direct the log forwarding and executing the commands contained in the log. Leaders periodically send RPC messages with logs to their followers. RPC message is called AppendEntries and contains contents related to the leader's term, leaderId, and Log. A term means a temporal order in a raft.

추종자는 AppendEntries를 받으면 리더의 요청이 수용되었다는 내용과 현재 자신의 텀을 지도자에게 보낸다. 그리고 추종자는 로그에 포함된 명령으로 상태 머신을 업데이트 한다. 그 결과 추종자는 시퀀셜한 로그와 상태를 리더와 동일하게 유지한다. 로그는 리스트 형태로 하나의 인덱스에 클라이언트가 요청하는 내용과 텀을 함께 저장한다. 인덱스와 텀을 통해 시퀀셜한 로그가 유지된다.When the follower receives the AppendEntries, it sends to the leader that the leader's request has been accepted and the current term. And the follower updates the state machine with the commands contained in the log. As a result, the follower maintains the same sequential log and state as the leader. The log stores the contents requested by the client and the term together in one index in the form of a list. A sequential log is maintained through an index and a term.

도 2에서 노드는 RPC 메시지와 타임아웃(timeout)에 의해 상태 전환이 발생한다. 타임아웃은 지도자가 가지는 heart beat timeout과 추종자가 가지는 leader election timeout으로 2가지 종류가 있다. heart beat timeout은 지도자가 AppendEntries 메시지를 보내는 주기이다. In FIG. 2 , a state transition occurs in a node by an RPC message and a timeout. There are two types of timeout: the heart beat timeout of the leader and the leader election timeout of the follower. The heart beat timeout is the interval at which the leader sends the AppendEntries message.

지도자는 타임아웃 될 때마다 AppendEntries 메시지를 통해 생존을 증명하고 로그를 전달한다. 추종자는 leader election timeout 시간 안에 지도자의 AppendEntries 메시지를 받지 못하면 지도자에 문제가 있다고 판단하고 후보자로 전환된다. 이것을 리더 선출 기간이라고 부른다. 리더를 선출하는 과정은 다음과 같다.Each time the leader times out, it proves its survival through the AppendEntries message and delivers the log. If the follower does not receive the leader's AppendEntries message within the leader election timeout time, it is judged that there is a problem with the leader and is converted to a candidate. This is called the leader election period. The process of selecting a leader is as follows.

후보자가 되면 후보자는 자신의 텀(term)을 하나 증가하고 네트워크 내의 모든 노드에게 투표를 요청하는 RequestVote RPC메시지를 보낸다. RequestVote RPC는 후보자의 현재 텀과 후보자 ID, 후보자의 마지막 로그의 인텍스와 텀이 포함되어있다. RequestVote 메시지를 받은 추종자는 후보자가 지도자가 되기 위한 기준을 만족하는지 다음 내용을 확인한다.When a candidate becomes a candidate, the candidate increases his or her term by one and sends a RequestVote RPC message requesting a vote to all nodes in the network. RequestVote RPC contains the candidate's current term, candidate ID, and the index and term of the candidate's last log. Upon receiving the RequestVote message, the follower checks whether the candidate meets the criteria for becoming a leader.

지도자가 되기 위한 기준을 만족하면 노드는 자신의 현재 텀(term)과 함께 승인 메시지를 전송한다. 승인 메시지를 전송한 추종자가 과반수 이상이면 후보자는 지도자로 선출되고, 그렇지 않으면 추종자로 돌아간다. 이때, 여러 후보자 노드가 동시에 추종자로 전환될 확률을 감소시키기 위해 leader election timer는 랜덤하게 설정된다.If the criteria for becoming a leader are met, the node sends an acknowledgment message with its current term. If more than half of the followers who have sent the approval message, the candidate will be elected as the leader, otherwise it will return to the followers. At this time, the leader election timer is set randomly in order to reduce the probability that several candidate nodes will be converted into followers at the same time.

래프트(raft)에서는 오직 지도자만 클라이언트의 요청을 처리할 수 있다. 따라서, 클라이언트는 처리할 명령을 지도자에게 요청해야 한다. 지도자는 클라이언트의 요청을 로그에 담아 나머지 서버에 로그를 복제하고 로그 안의 명령을 실행하여 완전히 커밋하면 클라이언트에게 요청을 성공했다는 응답을 보낸다.In a raft, only the leader can handle a client's request. Therefore, the client must ask the leader for an order to be processed. The leader records the client's request in a log, replicates the log to the rest of the server, executes the command in the log and commits it completely, and sends a response to the client indicating that the request was successful.

합의가 시작되면 클라이언트는 현재 텀의 지도자에 대한 정보가 없기 때문에 네트워크 내의 서버 중 랜덤하게 선택한 서버에게 처리를 요청한다. 만약 이 선택된 서버가 리더가 아니면 클라이언트에 대한 요청을 거절하면서 현재 텀의 지도자에 대한 정보를 함께 응답한다. 그런데 지도자 선출 기간과 같이 지도자가 없는 경우 합의의 처음 시작과 같이 랜덤한 서버에게 요청하며 요청이 성공할 때까지 반복한다.When consensus is initiated, the client requests processing from a randomly selected server among the servers in the network because there is no information about the leader of the current term. If this selected server is not the leader, it responds with information about the leader of the current term while rejecting the request to the client. However, when there is no leader, such as during the leader election period, a request is made to a random server like the beginning of consensus, and the request is repeated until the request is successful.

래프트(raft) 알고리즘에서 패킷 손실이나 지연은 노드 간의 네트워크 불안정을 야기한다. 네트워크 분할(Network Split)은 지도자와 네트워크 내의 과반 이상의 노드가 연결이 끊기는 것을 의미한다. 즉, 네트워크 분할은 래프트(raft)에서 리더 선출 기간과 동일하다고 할 수 있다. 따라서, 노드의 불안정한 네트워크는 래프트(raft) 합의 알고리즘에서 빈번한 리더 선출 기간을 발생시킨다.In the raft algorithm, packet loss or delay causes network instability between nodes. Network split means that the leader and more than half of the nodes in the network are disconnected. In other words, network segmentation can be said to be the same as the leader election period in a raft. Therefore, an unstable network of nodes causes frequent leader election periods in the raft consensus algorithm.

그러나, 래프트(raft) 알고리즘에 의해 블록체인에서 합의가 진행되면 네트워크 분할(Network Split)에 의해 지도자 선출 기간이 되었을 때 클라이언트는 트랜잭션을 포함하는 블록 생성과 관련된 명령을 노드에 요청할 수 없다. 이는 블록이 생성되는 시간을 지연시켜 지연시간이 길어지고 TPS가 감소할 수 밖에 없다. 따라서, 블록 체인의 합의 성능을 평가하는 방법에 의해 잦은 네트워크 분할은 블록체인 합의 성능을 저하시킨다고 말할 수 있다. However, if consensus is in progress on the blockchain by the raft algorithm, the client cannot request a command related to block generation including the transaction from the node when the leader election period is reached by the network split. This delays the block generation time, which inevitably increases the delay time and reduces the TPS. Therefore, by the method of evaluating the consensus performance of the blockchain, it can be said that frequent network splitting degrades the blockchain consensus performance.

따라서, 본 발명은 블록체인 합의 성능이 저하되는 것을 방지하기 위해 네트워크 분할(Network Split)이 발생하는 확률을 줄이고자 한다. 네트워크 분할은 지도자와 다른 노드 간의 네트워크 연결이 불안정할수록 빈번하게 발생하므로 네트워크가 안정적인 노드를 다음 노드로 선출함으로써 발생 확률을 줄일 수 있다.Therefore, the present invention aims to reduce the probability that a network split occurs in order to prevent the performance of the blockchain consensus from being deteriorated. Since network segmentation occurs more frequently as the network connection between the leader and other nodes becomes unstable, the probability of occurrence can be reduced by electing a stable node as the next node.

상기 파라미터 선정부(110)는 프라이빗 블록체인의 각 노드에서 후보자 노드로 전환된 수, 로그 인덱스(index)의 최신도 및 설정된 타임아웃 시간의 파라미터들을 모니터링한다.The parameter selector 110 monitors the number of transitions from each node of the private block chain to the candidate node, the freshness of the log index, and the parameters of the set timeout time.

본 발명은 래프트(raft)에서 노드의 네트워크 안정도를 평가하기 위한 3가지 파라미터를 선정한다. 파라미터는 다음과 같다.The present invention selects three parameters for evaluating the network stability of a node in a raft. The parameters are as follows.

1) 후보자 노드로 전환된 수1) Number of conversions to candidate nodes

노드 사이의 네트워크 연결이 불안정하면 지도자와의 연결이 끊어지면서 후보자로 전환될 확률이 높다. 따라서, 후보자 노드 횟수를 통해 네트워크 안정도를 판단할 수 있다.If the network connection between the nodes is unstable, the connection with the leader is lost and there is a high probability of being converted into a candidate. Therefore, network stability can be determined through the number of candidate nodes.

2) 로그 인덱스(index)의 최신도2) Up-to-dateness of log index

지도자와의 통신이 불안정한 노드는 로그를 최신의 상태로 유지할 수 없다. 따라서 로그의 최신 인덱스(last index)가 비교하는 노드보다 작은 정도를 통해 네트워크 안정도를 알 수 있다.A node with unstable communication with its leader cannot keep its logs up to date. Therefore, the network stability can be known through the degree to which the last index of the log is smaller than that of the node being compared.

3) 설정된 타임아웃 시간3) Set timeout time

설정된 타임 아웃 시간은 네트워크 분할 발생 확률에 영향을 미친다. 설정된 타임아웃이 작을수록 네트워크 분할 발생 확률이 높기 때문에 타임아웃 또한 네트워크 성능 평가 파라미터로 추가되어야 한다.The set timeout time affects the probability of network splitting. The smaller the set timeout, the higher the probability of network splitting. Therefore, the timeout should also be added as a network performance evaluation parameter.

상기 연합학습부(130)는 파라미터들과 이전 지도자들에 대한 네트워크 안정도의 관계에 대해 학습하여 연합학습 모델을 생성한다.The federated learning unit 130 generates a federated learning model by learning about the relationship between parameters and network stability for previous leaders.

연합학습(federated learning)은 분산 머신러닝의 일종으로, 분산된 훈련 데이터를 사용하여 DNN, Deep Neural Networks를 훈련시키는 머신러닝이다. 연합학습은 동일한 학습 모델을 분산하여 학습하고 한 곳에 모아 더 정교한 모델을 만들어 예측 결과의 정확도를 높인다. Federated learning is a type of distributed machine learning, which is machine learning that uses distributed training data to train DNNs and Deep Neural Networks. Federated learning improves the accuracy of prediction results by distributing and learning the same learning model and gathering them in one place to create a more sophisticated model.

도 3을 참조하면, 모든 서버는 동일한 초기 학습 모델을 나눠 갖는다. 그리고 각 서버는 각자 다른 데이터를 사용해 모델을 학습시킨다. 클라우드는 각 서버가 학습한 모델의 파라미터의 평균 값으로 모델을 업데이트하고 다시 이 모델의 파라미터를 전송 받은 서버가 각자 학습하는 과정을 반복한다.Referring to FIG. 3 , all servers share the same initial learning model. And each server trains the model using different data. The cloud updates the model with the average value of the parameters of the model learned by each server and repeats the process of learning by each server that receives the parameters of the model again.

합의 알고리즘은 분산 네트워크 환경에서 하나의 장애(failure) 노드가 존재하더라도 시스템이 유지되도록 하는 기술을 의미한다. 래프트(raft)는 crash fault를 허용하는 합의 알고리즘으로 네트워크에 참여하는 노드 중 절반까지 하드웨어적으로 crash가 발생하더라도 허용할 수 있는 것을 의미한다.The consensus algorithm refers to a technology that allows the system to be maintained even if one failure node exists in a distributed network environment. A raft is a consensus algorithm that allows crash faults. It means that even if a crash occurs in hardware, up to half of the nodes participating in the network can be tolerated.

래프트(raft) 합의에 참여하는 노드 사이의 연결은 각각 다른 네트워크 안정도를 가진다. 따라서, 네트워크에 대해 모니터링하는 데이터는 각자 다르게 된다. 각자의 데이터에 따라 로컬 모델을 분산 학습하고 이를 지도자 노드가 종합하여 글로벌 모델로 동기화하는 연합학습을 진행하면 노드의 로컬 모델이 글로벌 모델에 반영되므로 합의를 위임하는 의미를 가진다.Connections between nodes participating in raft consensus have different network stability. Therefore, the data to be monitored for the network is different for each. If the local model is learned distributedly according to their data, and the leader node synthesizes it and synchronizes it to the global model, it has the meaning of delegating consensus because the local model of the node is reflected in the global model.

또한, 연합학습은 단일장애지점(SPOF, Single Point Of Failure)과 같은 중앙 집중형 네트워크의 한계가 발생되는 것을 방지할 수 있고 서버의 저장공간에 대한 부담이 적다는 이점이 있다. 따라서, 연합학습이 중앙 서버에서 모델을 학습하는 방법보다 블록체인 네트워크 환경에 적합한 학습이라고 할 수 있다. In addition, federated learning has the advantage that it can prevent the limitations of centralized networks such as SPOF (Single Point Of Failure) from occurring and the load on the storage space of the server is small. Therefore, it can be said that federated learning is more suitable for a blockchain network environment than a method for learning a model on a central server.

그러므로, 본 발명은 지도자 선출을 제외한 모든 메커니즘은 기존의 래프트(raft) 방식을 따르면서 각각의 노드의 네트워크 안정도를 모니터링하고 이 데이터를 이용해 연합학습하여 네트워크가 안정적인 지도자를 선출하는 과정을 반복한다.Therefore, the present invention repeats the process of selecting a stable leader by monitoring the network stability of each node while all mechanisms except for leader election follow the existing raft method, and jointly learning using this data.

후보자 노드로 전환되면 네트워크의 모든 노드에게 RequestVote 메시지를 전송한다. 이때, RequestVote 메시지는 해당 노드의 텀(term)과 최신 인덱스(lastindex)를 포함시켜 전송하는데, 본 발명에서는 노드의 ID와 타임아웃을 추가하여 전송한다.When switching to a candidate node, a RequestVote message is sent to all nodes in the network. At this time, the RequestVote message is transmitted including the term and the latest index of the node. In the present invention, the node ID and timeout are added and transmitted.

따라서, 후보자 노드가 전송한 RequestVote 메시지를 통해 해당 파라미터들을 측정할 수 있다. 노드 사이의 네트워크가 불안정한 것이 두 노드 중 어느 노드의 네트워크가 불안정한 것인지 확신할 수 없지만 연합학습을 통해 데이터가 종합될 것이므로 데이터를 측정하는 노드 자신은 문제가 없다고 가정한다.Accordingly, corresponding parameters can be measured through the RequestVote message transmitted by the candidate node. If the network between the nodes is unstable, we cannot be sure which of the two nodes is unstable, but since the data will be aggregated through federated learning, we assume that the node measuring the data has no problem.

도 4를 참조하면, 파라미터에 대해 카운팅된 데이터는 로그의 저장방식과 동일하게 텀과 함께 리스트에 저장된다. 그리고, 각 노드에 대한 파라미터 측정값은 2차원으로 저장되며 네트워크에 참여하는 모든 노드에 대해 모니터링하므로 각 노드는 최종적으로 3차원 데이터를 갖는다. 그리고 모든 노드는 이 데이터를 다음 지도자 선출을 위한 연합학습 모델을 학습하는데 사용한다. Referring to FIG. 4 , the data counted for the parameter is stored in the list together with the term in the same way as the log storage method. In addition, parameter measurement values for each node are stored in two dimensions, and since all nodes participating in the network are monitored, each node finally has three-dimensional data. And all nodes use this data to train a federated learning model for selecting the next leader.

상기 가중치 계산부(150)는 생성된 연합학습 모델에 따라 각 파라미터가 네트워크의 안정도에 기여하는 가중치를 계산하고, 상기 안정도 계산부(170)는 계산된 가중치를 각 파라미터에 적용한 네트워크 안정도 값을 계산한다.The weight calculation unit 150 calculates a weight that each parameter contributes to the stability of the network according to the generated federated learning model, and the stability calculation unit 170 calculates a network stability value by applying the calculated weight to each parameter. do.

연합학습에서 각 노드가 학습하는 로컬 모델은 텀에 대한 후보자 횟수와 파라미터와의 관계를 통해 네트워크 안정도에 대한 파라미터의 영향도(가중치)를 계산한다. 그 후 이를 기반으로 노드들의 0~1 사이의 네트워크 안정도 점수를 계산하고, 이 점수는 다음 지도자를 선출하는데 반영된다.In federated learning, the local model that each node learns calculates the influence (weight) of the parameter on the network stability through the relationship between the number of candidates for the term and the parameter. Then, based on this, the network stability score between 0 and 1 of the nodes is calculated, and this score is reflected in electing the next leader.

그리고 학습 모델은 지도자가 서버가 되어 일정 주기마다 로컬 모델을 종합하여 글로벌 모델을 업데이트하면서 연합학습이 진행된다.And in the learning model, the leader becomes the server and the global model is updated by synthesizing the local model at regular intervals, and federated learning proceeds.

네트워크에 참여하는 모든 노드는 연합학습을 통해 다른 노드에 대한 네트워크 안정도를 가지고 있다. 후보자가 발생했을 때, 추종자는 후보자의 네트워크 안정도가 임계값(예를 들어, 0.5) 보다 높을 때만 다음 지도자로 투표함으로서 네트워크가 안정적일 때만 지도자로 선출되도록 한다. 네트워크가 안정적인 기준을 0.5로 설정한 이유는 수치가 낮을수록 정말 네트워크가 안정적이라고 하기 어렵고 수치가 높을수록 지도자로 선택될 노드의 범위가 좁아져 투표 분할이 발생할 수 있기 때문이다. All nodes participating in the network have network stability with respect to other nodes through federated learning. When a candidate occurs, followers vote as the next leader only when the candidate's network stability is higher than a threshold (eg, 0.5), so that the leader is elected only when the network is stable. The reason why the standard for network stability is set to 0.5 is that the lower the number, the harder it is to say that the network is really stable.

상기 투표부(190)는 지도자 선출이 합의되면, 계산된 네트워크 안정도 값을 반영하여 지도자를 선출한다.When the leader election is agreed upon, the voting unit 190 selects a leader by reflecting the calculated network stability value.

지도자 선출 기간이 발생하기 전에 지도자를 중심으로 로그를 복제하고 커밋하는 과정을 통해 클라이언트의 요청을 처리한다. 동시에 모든 노드는 네트워크 상태를 모니터링한 데이터를 쌓아 연합학습을 진행한다.Process client requests by replicating and committing logs around the leader before the leader election period occurs. At the same time, all nodes accumulate the data that monitors the network status and proceed with federated learning.

추종자 중 지도자와의 연결이 끊어지면 후보자로 상태가 전환된다. 후보자는 자기 자신에게 투표한 뒤 텀(term)을 하나 높이고 텀, 마지막 인덱스 번호, 설정된 타임아웃 시간을 포함시켜 모든 노드에게 RequestVote RPC를 전송한다.When a follower loses connection with a leader, he or she transitions to a candidate. After voting for themselves, the candidate increases the term by one and sends a RequestVote RPC to all nodes including the term, the last index number, and the set timeout time.

RequsetvoteRPC를 받은 추종자는 모니터링 데이터를 기록하고 새로운 지도자의 기준에 부합하는지 판단한다. 판단하는 내용은 다음과 같다.Followers who receive a RequsetvoteRPC record monitoring data and judge whether they meet the standards of the new leader. The judgment is as follows.

1) 나보다 높은 텀을 가지고 있다.1) You have a higher term than me.

2) 널(null) 또는 후보자 ID인이다.2) Null or candidate ID.

3) 후보자의 로그가 최소한 자신의 로그만큼 최신이다.3) The candidate's log is at least as up-to-date as his own.

4) 후보자에 대한 연합학습 결과가 0.5보다 크다.4) The combined learning result for the candidate is greater than 0.5.

위의 조건을 모두 만족하면 추종자는 후보자를 지도자로 투표하는 응답을 보낸다. 후보자는 과반수 이상으로부터 투표를 받으면 지도자로 상태가 전환된다. 그렇지 않으면 후보자는 다시 추종자가 된다.If all of the above conditions are met, the follower sends a response voting the candidate as leader. Candidates become leaders when they receive a majority of votes. Otherwise, the candidate becomes a follower again.

본 발명의 성능을 평가하기 위한 시뮬레이션은 리눅스 환경에서 파이썬으로 작성한 래프트(raft) 합의 알고리즘으로 수행하였다. 그리고 시뮬레이션을 하는 동안 새로운 노드가 합의에 참가하는 멤버쉽 체인지는 발생하지 않는다고 가정한다.Simulations for evaluating the performance of the present invention were performed with a raft consensus algorithm written in Python in a Linux environment. And it is assumed that membership change does not occur during the simulation where new nodes participate in consensus.

래프트(raft)알고리즘은 네트워크 스케일이 작을수록 그리고 설정된 타임아웃이 작을수록 네트워크 분할 발생 확률이 높아진다. 따라서, 네트워크 분할이 많이 발생하는 환경을 가정하기 위해 타임아웃이 이 작은 노드가 포함되고 타임아웃이 작을수록 노드의 통신에 장애가 발생할 확률이 높도록 시뮬레이션하였다.As for the raft algorithm, the smaller the network scale and the smaller the set timeout, the higher the probability of network splitting. Therefore, in order to assume an environment in which a lot of network partitioning occurs, a node with this small timeout is included, and the probability of communication failure of the node increases as the timeout is small was simulated.

도 5는 일정한 시간마다 주기적으로 발생하는 로그 100개를 처리하는 동안 변경되는 텀의 수에 대해 원래의 래프트(raft)와 본 발명에서 제안하는 메커니즘을 비교한 결과이다. 5 is a result of comparing the original raft and the mechanism proposed by the present invention with respect to the number of terms that are changed while processing 100 logs periodically occurring at regular time intervals.

도 5를 참조하면, 네트워크 스케일은 노드 수를 의미한다. 노드 수가 400개 보다 작을 때는 기존 래프트(raft) 알고리즘과 본 발명에서 제안하는 방법의 텀의 수가 차이가 없다. 그러나 네트워크 스케일이 커질수록 모델이 학습되면서 기존의 래프트(raft) 합의 방식보다 본 발명에서 제안하는 메커니즘의 텀 수가 적은 것을 알 수 있다.Referring to FIG. 5 , the network scale means the number of nodes. When the number of nodes is less than 400, there is no difference in the number of terms between the existing raft algorithm and the method proposed in the present invention. However, it can be seen that the number of terms of the mechanism proposed in the present invention is smaller than that of the existing raft consensus method as the model is learned as the network scale increases.

지도자가 변경될 때마다 텀이 1개씩 상승되기 때문에, 네트워크 분할의 발생 빈도가 높으면 텀의 수가 높아진다. 텀 수가 적으면 지도자 선출 기간이 적게 발생한 것이므로 클라이언트의 요청이 처리되는 지연시간이 길어지는 것을 방지한다. 클라이언트의 요청이 처리되는 지연시간이 짧아지면 그것은 래프트(raft) 알고리즘에 의해 합의하는 블록체인의 TPS를 높이는 결과를 낳는다. 따라서 블록체인에서 사용되는 래프트(raft) 합의의 성능이 향상되었다고 할 수 있다.Since the term is increased by one each time the leader is changed, the higher the frequency of network segmentation, the higher the number of terms. If the number of terms is small, the leader election period is short, so the delay time for processing the client's request is prevented. When the delay time for processing a client's request is shortened, it results in increasing the TPS of the blockchain agreed by the raft algorithm. Therefore, it can be said that the performance of the raft consensus used in the blockchain has improved.

본 발명은 래프트(raft) 알고리즘에서 네트워크 안정도에 따라 지도자를 선출하는 방법에 대해 제안했다. 이는 블록체인 노드의 네트워크가 불안정할 때 래프트(raft)의 네트워크 분할 발생 확률을 낮춤으로서 블록체인의 성능이 저하되는 것을 방지할 수 있다. The present invention proposes a method for selecting a leader according to network stability in a raft algorithm. This reduces the probability of network splitting of rafts when the network of blockchain nodes is unstable, thereby preventing degradation of blockchain performance.

도 6은 본 발명의 일 실시예에 따른 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법의 흐름도이다. 도 7은 본 발명에서 지도자 선출 매커니즘을 보여주는 흐름도이다.6 is a flowchart of a method for selecting a leader using federated learning in a private blockchain according to an embodiment of the present invention. 7 is a flowchart showing a leader election mechanism in the present invention.

본 실시예에 따른 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법은, 도 1의 장치(10)와 실질적으로 동일한 구성에서 진행될 수 있다. 따라서, 도 1의 장치(10)와 동일한 구성요소는 동일한 도면부호를 부여하고, 반복되는 설명은 생략한다. The method of selecting a leader using federated learning in the private block chain according to the present embodiment may proceed in substantially the same configuration as the device 10 of FIG. 1 . Accordingly, the same components as those of the device 10 of FIG. 1 are given the same reference numerals, and repeated descriptions are omitted.

또한, 본 실시예에 따른 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법은 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출을 수행하기 위한 소프트웨어(애플리케이션)에 의해 실행될 수 있다.In addition, the method for selecting a leader using federated learning in the private block chain according to this embodiment may be executed by software (application) for performing leader election using federated learning in the private block chain.

본 발명은 기존 래프트(raft) 알고리즘에서 발생하는 네트워크 분할 문제를 해결하기 위해 연합학습을 접목하여 지도자 선출 메커니즘을 개선한 래프트(raft) 알고리즘을 제안한다. 네트워크 분할은 지도자의 통신 장애에 의해 발생하므로 네트워크가 안정적인 노드를 지도자로 선출하도록 지도자 선출 메커니즘을 개선한다.The present invention proposes a raft algorithm that improves the leader election mechanism by grafting federated learning to solve the network segmentation problem that occurs in the existing raft algorithm. The network segmentation is caused by the communication failure of the leader, so the leader election mechanism is improved so that the network elects a stable node as the leader.

도 6을 참조하면, 본 실시예에 따른 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법은, 프라이빗 블록체인의 각 노드에서 후보자 노드로 전환된 수, 로그 인덱스(index)의 최신도 및 설정된 타임아웃 시간의 파라미터들을 모니터링한다(단계 S10). Referring to FIG. 6 , in the method of selecting a leader using federated learning in the private blockchain according to this embodiment, the number of conversions from each node of the private blockchain to a candidate node, the latest log index, and a set timeout The parameters of time are monitored (step S10).

노드 사이의 네트워크 연결이 불안정하면 지도자와의 연결이 끊어지면서 후보자로 전환될 확률이 높다. 따라서, 후보자 노드 횟수를 통해 네트워크 안정도를 판단할 수 있다.If the network connection between the nodes is unstable, the connection with the leader is lost and there is a high probability of being converted into a candidate. Therefore, network stability can be determined through the number of candidate nodes.

또한, 지도자와의 통신이 불안정한 노드는 로그를 최신의 상태로 유지할 수 없다. 따라서 로그의 최신 인덱스(last index)가 비교하는 노드보다 작은 정도를 통해 네트워크 안정도를 알 수 있다.Also, nodes with unstable communication with the leader cannot keep their logs up to date. Therefore, the network stability can be known through the degree to which the last index of the log is smaller than that of the node being compared.

설정된 타임 아웃 시간은 네트워크 분할 발생 확률에 영향을 미친다. 설정된 타임아웃이 작을수록 네트워크 분할 발생 확률이 높기 때문에 타임아웃 또한 네트워크 성능 평가 파라미터로 추가되어야 한다.The set timeout time affects the probability of network splitting. The smaller the set timeout, the higher the probability of network splitting. Therefore, the timeout should also be added as a network performance evaluation parameter.

파라미터들과 이전 지도자들에 대한 네트워크 안정도의 관계에 대해 학습하여 연합학습 모델을 생성한다(단계 S20).A federated learning model is created by learning about the relationship between parameters and network stability for previous leaders (step S20).

연합학습(federated learning)은 분산 머신러닝의 일종으로, 분산된 훈련 데이터를 사용하여 DNN, Deep Neural Networks를 훈련시키는 머신러닝이다. 연합학습은 동일한 학습 모델을 분산하여 학습하고 한 곳에 모아 더 정교한 모델을 만들어 예측 결과의 정확도를 높인다. Federated learning is a type of distributed machine learning, which is machine learning that uses distributed training data to train DNNs and Deep Neural Networks. Federated learning improves the accuracy of prediction results by distributing and learning the same learning model and gathering them in one place to create a more sophisticated model.

모든 서버는 동일한 초기 학습 모델을 나눠 갖는다. 그리고 각 서버는 각자 다른 데이터를 사용해 모델을 학습시킨다. 클라우드는 각 서버가 학습한 모델의 파라미터의 평균 값으로 모델을 업데이트하고 다시 이 모델의 파라미터를 전송 받은 서버가 각자 학습하는 과정을 반복한다.All servers share the same initial training model. And each server trains the model using different data. The cloud updates the model with the average value of the parameters of the model learned by each server and repeats the process of learning by each server that receives the parameters of the model again.

합의 알고리즘은 분산 네트워크 환경에서 하나의 장애(failure) 노드가 존재하더라도 시스템이 유지되도록 하는 기술을 의미한다. 래프트(raft)는 crash fault를 허용하는 합의 알고리즘으로 네트워크에 참여하는 노드 중 절반까지 하드웨어적으로 crash가 발생하더라도 허용할 수 있는 것을 의미한다.The consensus algorithm refers to a technology that allows the system to be maintained even if one failure node exists in a distributed network environment. A raft is a consensus algorithm that allows crash faults. It means that even if a crash occurs in hardware, up to half of the nodes participating in the network can be tolerated.

래프트(raft) 합의에 참여하는 노드 사이의 연결은 각각 다른 네트워크 안정도를 가진다. 따라서, 네트워크에 대해 모니터링하는 데이터는 각자 다르게 된다. 각자의 데이터에 따라 로컬 모델을 분산 학습하고 이를 지도자 노드가 종합하여 글로벌 모델로 동기화하는 연합학습을 진행하면 노드의 로컬 모델이 글로벌 모델에 반영되므로 합의를 위임하는 의미를 가진다.Connections between nodes participating in raft consensus have different network stability. Therefore, the data to be monitored for the network is different for each. If the local model is learned distributedly according to their data, and the leader node synthesizes it and synchronizes it to the global model, it has the meaning of delegating consensus because the local model of the node is reflected in the global model.

또한, 연합학습은 단일장애지점(SPOF, Single Point Of Failure)과 같은 중앙 집중형 네트워크의 한계가 발생되는 것을 방지할 수 있고 서버의 저장공간에 대한 부담이 적다는 이점이 있다. 따라서, 연합학습이 중앙 서버에서 모델을 학습하는 방법보다 블록체인 네트워크 환경에 적합한 학습이라고 할 수 있다. In addition, federated learning has the advantage that it can prevent the limitations of centralized networks such as SPOF (Single Point Of Failure) from occurring and the load on the storage space of the server is small. Therefore, it can be said that federated learning is more suitable for a blockchain network environment than a method for learning a model on a central server.

그러므로, 본 발명은 지도자 선출을 제외한 모든 메커니즘은 기존의 래프트(raft) 방식을 따르면서 각각의 노드의 네트워크 안정도를 모니터링하고 이 데이터를 이용해 연합학습하여 네트워크가 안정적인 지도자를 선출하는 과정을 반복한다.Therefore, the present invention repeats the process of selecting a stable leader by monitoring the network stability of each node while all mechanisms except for leader election follow the existing raft method, and jointly learning using this data.

생성된 연합학습 모델에 따라 각 파라미터가 네트워크의 안정도에 기여하는 가중치를 계산한다(단계 S30). 계산된 가중치를 각 파라미터에 적용한 네트워크 안정도 값을 계산한다(단계 S40).A weight that each parameter contributes to the stability of the network is calculated according to the generated federated learning model (step S30). A network stability value by applying the calculated weight to each parameter is calculated (step S40).

연합학습에서 각 노드가 학습하는 로컬 모델은 텀에 대한 후보자 횟수와 파라미터와의 관계를 통해 네트워크 안정도에 대한 파라미터의 영향도(가중치)를 계산한다. 그 후 이를 기반으로 노드들의 0~1 사이의 네트워크 안정도 점수를 계산하고, 이 점수는 다음 지도자를 선출하는데 반영된다.In federated learning, the local model that each node learns calculates the influence (weight) of the parameter on the network stability through the relationship between the number of candidates for the term and the parameter. Then, based on this, the network stability score between 0 and 1 of the nodes is calculated, and this score is reflected in electing the next leader.

그리고 학습 모델은 지도자가 서버가 되어 일정 주기마다 로컬 모델을 종합하여 글로벌 모델을 업데이트하면서 연합학습이 진행된다.And in the learning model, the leader becomes the server and the global model is updated by synthesizing the local model at regular intervals, and federated learning proceeds.

네트워크에 참여하는 모든 노드는 연합학습을 통해 다른 노드에 대한 네트워크 안정도를 가지고 있다. 후보자가 발생했을 때, 추종자는 후보자의 네트워크 안정도가 임계값(예를 들어, 0.5) 보다 높을 때만 다음 지도자로 투표함으로서 네트워크가 안정적일 때만 지도자로 선출되도록 한다. 네트워크가 안정적인 기준을 0.5로 설정한 이유는 수치가 낮을수록 정말 네트워크가 안정적이라고 하기 어렵고 수치가 높을수록 지도자로 선택될 노드의 범위가 좁아져 투표 분할이 발생할 수 있기 때문이다. All nodes participating in the network have network stability with respect to other nodes through federated learning. When a candidate occurs, followers vote as the next leader only when the candidate's network stability is higher than a threshold (eg, 0.5), so that the leader is elected only when the network is stable. The reason why the standard for network stability is set to 0.5 is that the lower the number, the harder it is to say that the network is really stable.

지도자 선출이 합의되면, 계산된 네트워크 안정도 반영하여 지도자를 선출한다(단계 S50).When the leader election is agreed upon, a leader is elected by reflecting the calculated network stability (step S50).

도 7을 참조하면, 각 노드는 블록을 생성하는 동안 이전 지도자들의 매개변수 데이터 집합을 사용하여 모델을 학습하면서 다른 추종자에 대한 매개변수를 측정하여 데이터 집합을 만들어 연합학습을 진행한다(단계 S11). Referring to Figure 7, each node performs federated learning by making a data set by measuring parameters for other followers while learning a model using the parameter data sets of previous leaders while generating blocks (step S11) .

추종자 상태의 노드가 지도자와의 연결이 끊어지는 경우(단계 S12) 후보자 상태로 전환된다. 후보자 노드로 전환되면 네트워크의 모든 노드에게 RequestVote 메시지를 전송한다. 이때, RequestVote 메시지는 해당 노드의 텀(term)과 최신 인덱스(lastindex)를 포함시켜 전송하는데, 본 발명에서는 노드의 ID와 타임아웃을 추가하여 전송한다.When the node in the follower state is disconnected from the leader (step S12), it switches to the candidate state. When switching to a candidate node, a RequestVote message is sent to all nodes in the network. At this time, the RequestVote message is transmitted including the term and the latest index of the node. In the present invention, the node ID and timeout are added and transmitted.

따라서, 후보자 노드가 전송한 RequestVote 메시지를 통해 해당 파라미터들을 측정할 수 있다. 노드 사이의 네트워크가 불안정한 것이 두 노드 중 어느 노드의 네트워크가 불안정한 것인지 확신할 수 없지만 연합학습을 통해 데이터가 종합될 것이므로 데이터를 측정하는 노드 자신은 문제가 없다고 가정한다.Accordingly, corresponding parameters can be measured through the RequestVote message transmitted by the candidate node. If the network between the nodes is unstable, we cannot be sure which of the two nodes is unstable, but since the data will be aggregated through federated learning, we assume that the node measuring the data has no problem.

RequsetvoteRPC를 받은 추종자는 모니터링 데이터를 기록하고 새로운 지도자의 기준에 부합하는지 판단한다(단계 S13). 판단하는 내용은 다음과 같다.The follower who has received the RequsetvoteRPC records the monitoring data and judges whether it meets the criteria of the new leader (step S13). The judgment is as follows.

1) 나보다 높은 텀을 가지고 있다.1) You have a higher term than me.

2) 널(null) 또는 후보자 ID인이다.2) Null or candidate ID.

3) 후보자의 로그가 최소한 자신의 로그만큼 최신이다.3) The candidate's log is at least as up-to-date as his own.

4) 후보자에 대한 연합학습 결과가 0.5보다 크다.4) The combined learning result for the candidate is greater than 0.5.

위의 조건을 모두 만족하면 추종자는 후보자를 지도자로 투표하는 응답을 보낸다. 후보자는 과반수 이상으로부터 투표를 받으면 지도자로 상태가 전환된다. 그렇지 않으면 후보자는 다시 추종자가 된다(단계 S14).If all of the above conditions are met, the follower sends a response voting the candidate as leader. Candidates become leaders when they receive a majority of votes. Otherwise, the candidate becomes a follower again (step S14).

본 발명은 개선된 래프트(raft) 알고리즘에 의해 네트워크 분할(Network Split) 문제의 발생 빈도를 감소시켜 연산 처리 기간을 높임으로써 트랜잭션 처리와 관련된 프라이빗 블록체인 성능을 향상시킨다. 결과적으로, 네트워크가 불안정한 환경의 프라이빗 블록체인에서 개선된 래프트(raft) 알고리즘을 통해 기존 블록체인의 강점인 무결성과 투명성을 보장하면서 데이터 가용성을 높일 수 있다.The present invention improves the private blockchain performance related to transaction processing by reducing the frequency of occurrence of a network split problem by an improved raft algorithm and increasing the computation processing period. As a result, data availability can be increased while ensuring integrity and transparency, the strengths of existing blockchains, through an improved raft algorithm in a private blockchain in an environment where the network is unstable.

이와 같은, 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법은 애플리케이션으로 구현되거나 다양한 컴퓨터 구성요소를 통하여 수행될 수 있는 프로그램 명령어의 형태로 구현되어 컴퓨터 판독 가능한 기록 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능한 기록 매체는 프로그램 명령어, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. Such a method for selecting a leader using federated learning in a private block chain can be implemented as an application or implemented in the form of a program command that can be executed through various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium may include program instructions, data files, data structures, etc. alone or in combination.

상기 컴퓨터 판독 가능한 기록 매체에 기록되는 프로그램 명령어는 본 발명을 위하여 특별히 설계되고 구성된 것들이거니와 컴퓨터 소프트웨어 분야의 당업자에게 공지되어 사용 가능한 것일 수도 있다. The program instructions recorded on the computer-readable recording medium are specially designed and configured for the present invention, and may be known and available to those skilled in the art of computer software.

컴퓨터 판독 가능한 기록 매체의 예에는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM, DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 ROM, RAM, 플래시 메모리 등과 같은 프로그램 명령어를 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. Examples of the computer-readable recording medium include a hard disk, a magnetic medium such as a floppy disk and a magnetic tape, an optical recording medium such as a CD-ROM and DVD, and a magneto-optical medium such as a floppy disk. media), and hardware devices specially configured to store and execute program instructions such as ROM, RAM, flash memory, and the like.

프로그램 명령어의 예에는, 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드도 포함된다. 상기 하드웨어 장치는 본 발명에 따른 처리를 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.Examples of program instructions include not only machine language codes such as those generated by a compiler, but also high-level language codes that can be executed by a computer using an interpreter or the like. The hardware device may be configured to operate as one or more software modules to perform processing according to the present invention, and vice versa.

이상에서는 실시예들을 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다.Although the above has been described with reference to the embodiments, those skilled in the art can variously modify and change the present invention within the scope without departing from the spirit and scope of the present invention described in the claims below You will understand.

프라이빗 블록체인의 대표적인 합의 알고리즘인 래프트(raft) 알고리즘은 IBM, 블로코 등 다수의 기업에서 사용되고 있으나 네트워크가 불안정한 환경에 대한 합의 연구가 부족한 실정이다. 본 발명에서 제안하는 개선된 래프트(raft)는 네트워크가 불안정한 환경에서 블록체인 성능을 향상 시킬 수 있는 합의 기술이므로 상대적으로 네트워크 안정도가 낮은 VANET(Vehicle Ad-hoc Network), FANET(Flying Ad-hoc Network), UWSN(Underwater Wireless Sensor Network) 등에서 향상된 데이터 가용성과 신뢰성을 보장할 수 있다. The raft algorithm, a representative consensus algorithm of the private blockchain, is used by many companies such as IBM and Blocko, but there is a lack of consensus research on an unstable network environment. The improved raft proposed in the present invention is a consensus technology that can improve blockchain performance in an unstable network environment, so VANET (Vehicle Ad-hoc Network), FANET (Flying Ad-hoc Network), which have relatively low network stability ), UWSN (Underwater Wireless Sensor Network), etc., can ensure improved data availability and reliability.

따라서, IIoT(Industrial Internet of Things), IoV(Internet of Vehicles), IoUT(Internet of Under water Things) 디바이스의 이동성과 통신 거리 및 지리적 장애물에 의해 통신 장애가 빈번하게 발생하는 스마트 시티, 스마트팜, 수중 네트워크 환경에 적용하여 성능 향상을 도모 할 수 있다. 또한, 통신 장애에 유연하게 대처할 수 있으므로 네트워크가 불안정한 환경뿐만 아니라 스포츠, 건설, 의료 등 다양한 산업의 블록체인 시스템에서 성능을 향상할 수 있어 확장 가능성이 넓은 기술이다.Accordingly, smart cities, smart farms, and underwater networks in which communication failures occur frequently due to the mobility, communication distance, and geographic obstacles of IIoT (Industrial Internet of Things), IoV (Internet of Vehicles), and IoUT (Internet of Under water Things) devices Performance can be improved by applying it to the environment. In addition, as it can flexibly cope with communication failures, it is a technology with wide scalability as it can improve performance in various industries such as sports, construction, and medical as well as in unstable network environments.

10: 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 장치
110: 파라미터 선정부
130: 연합학습부
150: 가중치 계산부
170: 안정도 계산부
190: 투표부
10: Leader Election Device Using Federated Learning in Private Blockchain
110: parameter selection unit
130: Union Learning Department
150: weight calculation unit
170: stability calculation unit
190: Voting Department

Claims (10)

프라이빗 블록체인의 각 노드에서 후보자 노드로 전환된 수, 로그 인덱스(index)의 최신도 및 설정된 타임아웃 시간의 파라미터들을 모니터링하는 단계;
파라미터들과 이전 지도자들에 대한 네트워크 안정도의 관계에 대해 학습하여 연합학습 모델을 생성하는 단계;
생성된 연합학습 모델에 따라 각 파라미터가 네트워크의 안정도에 기여하는 가중치를 계산하는 단계;
계산된 가중치를 각 파라미터에 적용한 네트워크 안정도 값을 계산하는 단계; 및
지도자 선출이 합의되면, 계산된 네트워크 안정도 반영하여 지도자를 선출하는 단계;를 포함하는, 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법.
monitoring the number of transitions from each node of the private blockchain to the candidate node, the freshness of the log index, and the parameters of the set timeout time;
generating a federated learning model by learning about the relationship between parameters and network stability for previous leaders;
calculating a weight that each parameter contributes to the stability of the network according to the generated federated learning model;
calculating a network stability value by applying the calculated weight to each parameter; and
When leader election is agreed upon, selecting a leader by reflecting the calculated network stability; A method of selecting a leader using federated learning in a private block chain, including.
제1항에 있어서, 상기 계산된 네트워크 안정도 반영하여 지도자를 선출하는 단계는,
추종자 상태의 노드가 지도자와의 연결이 끊어지는 경우 후보자 상태로 전환되는 단계;
후보자 상태의 노드는 자기 자신에게 투표하고, 텀(term)을 하나 증가시키는 단계; 및
후보자 노드로 전환된 수, 로그 인덱스(index)의 최신도 및 설정된 타임아웃 시간의 파라미터들을 포함시킨 지도자 선거 요청 메시지를 모든 노드에게 전송하는 단계;를 더 포함하는, 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법.
The method of claim 1, wherein the step of selecting a leader by reflecting the calculated network stability comprises:
transitioning to the candidate state when the node in the follower state loses connection with the leader;
a node in the candidate state votes for itself and increases the term by one; and
Transmitting a leader election request message including parameters of the number of conversion to candidate nodes, log index updateness, and set timeout time to all nodes; further comprising, using federated learning in a private blockchain How to elect a leader.
제2항에 있어서, 상기 계산된 네트워크 안정도 반영하여 지도자를 선출하는 단계는,
후보자 상태의 노드가 과반수 이상으로부터 투표를 받은 경우, 지도자로 상태가 전환되는 단계;를 더 포함하는, 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법.
The method of claim 2, wherein the step of selecting a leader by reflecting the calculated network stability comprises:
When the node in the candidate state receives a vote from a majority or more, the state is converted to a leader; a method for selecting a leader using federated learning in a private block chain, further comprising a.
제1항에 있어서, 상기 계산된 네트워크 안정도 반영하여 지도자를 선출하는 단계는,
후보자가 자신보다 높은 텀(term)을 가지고 있는지 확인하는 단계;
널(null) 또는 후보자 ID인지 확인하는 단계;
후보자의 로그가 최소한 자신의 로그만큼 최신인지 확인하는 단계; 및
후보자의 네트워크 안정도 값이 임계값을 초과하는지 확인하는 단계;를 포함하는, 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법.
The method of claim 1, wherein the step of selecting a leader by reflecting the calculated network stability comprises:
checking whether the candidate has a higher term than himself;
checking whether it is null or a candidate ID;
verifying that the candidate's logs are at least as up-to-date as their own; and
A method of selecting a leader using federated learning in a private block chain, including; checking whether the candidate's network stability value exceeds a threshold value.
제1항에 있어서,
일정 주기마다 각 노드에서 학습한 로컬 연합학습 모델을 종합하여 글로벌 연합학습 모델을 업데이트하는 단계;를 더 포함하는, 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법.
According to claim 1,
The step of updating the global federated learning model by synthesizing the local federated learning model learned from each node at regular intervals; a method for selecting a leader using federated learning in a private block chain, further comprising a.
제1항에 따른 상기 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 방법을 수행하기 위한 컴퓨터 프로그램이 기록된 컴퓨터로 판독 가능한 저장 매체.
A computer-readable storage medium in which a computer program for performing the method for selecting a leader using federated learning in the private block chain according to claim 1 is recorded.
프라이빗 블록체인의 각 노드에서 후보자 노드로 전환된 수, 로그 인덱스(index)의 최신도 및 설정된 타임아웃 시간의 파라미터들을 모니터링하는 파라미터 선정부;
파라미터들과 이전 지도자들에 대한 네트워크 안정도의 관계에 대해 학습하여 연합학습 모델을 생성하는 연합학습부;
생성된 연합학습 모델에 따라 각 파라미터가 네트워크의 안정도에 기여하는 가중치를 계산하는 가중치 계산부;
계산된 가중치를 각 파라미터에 적용한 네트워크 안정도 값을 계산하는 안정도 계산부; 및
지도자 선출이 합의되면, 계산된 네트워크 안정도 값을 반영하여 지도자를 선출하는 투표부;를 포함하는, 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 장치.
a parameter selection unit that monitors the number of transitions from each node of the private blockchain to a candidate node, the freshness of a log index, and parameters of a set timeout time;
a federated learning unit that generates a federated learning model by learning about the relationship between parameters and network stability with respect to previous leaders;
a weight calculation unit for calculating a weight that each parameter contributes to the stability of the network according to the generated federated learning model;
a stability calculation unit for calculating a network stability value by applying the calculated weight to each parameter; and
When leader election is agreed upon, a voting unit that selects a leader by reflecting the calculated network stability value; a leader election device using federated learning in a private block chain, including.
제7항에 있어서, 상기 투표부는,
추종자 상태의 노드가 지도자와의 연결이 끊어지는 경우 후보자 상태로 전환되고, 후보자 노드로 전환된 수, 로그 인덱스(index)의 최신도 및 설정된 타임아웃 시간의 파라미터들을 포함시킨 지도자 선거 요청 메시지를 모든 노드에게 전송하는, 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 장치.
The method of claim 7, wherein the voting unit,
When a node in the follower state loses connection with the leader, it switches to the candidate state and sends all the leader election request messages including the parameters of the number of transitions to the candidate node, the freshness of the log index, and the set timeout time. A leader election device using federated learning in a private blockchain that transmits to nodes.
제7항에 있어서, 상기 투표부는,
후보자가 자신보다 높은 텀(term)을 가지고 있고, 널(null) 또는 후보자 ID이고, 후보자의 로그가 최소한 자신의 로그만큼 최신이고, 후보자의 네트워크 안정도 값이 임계값을 초과하는 조건을 만족하는 경우, 후보자를 지도자로 투표하는, 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 장치.
The method of claim 7, wherein the voting unit,
If the candidate has a higher term than itself, is null or a candidate ID, the candidate's log is at least as new as its own, and the candidate's network stability value exceeds the threshold , a leader election device using federated learning in a private blockchain that votes candidates as leaders.
제7항에 있어서, 상기 투표부는,
후보자 상태의 노드가 과반수 이상으로부터 투표를 받은 경우, 지도자로 상태가 전환되는, 프라이빗 블록체인에서 연합학습을 이용한 지도자 선출 장치.
The method of claim 7, wherein the voting unit,
A leader election device using federated learning in a private blockchain that converts the state to a leader when a node in the candidate state receives a majority vote or more.
KR1020210047393A 2021-04-12 2021-04-12 Leader election method using federated learning for private blockchain, recording medium and device for performing the method KR102486419B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210047393A KR102486419B1 (en) 2021-04-12 2021-04-12 Leader election method using federated learning for private blockchain, recording medium and device for performing the method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210047393A KR102486419B1 (en) 2021-04-12 2021-04-12 Leader election method using federated learning for private blockchain, recording medium and device for performing the method

Publications (2)

Publication Number Publication Date
KR20220141170A true KR20220141170A (en) 2022-10-19
KR102486419B1 KR102486419B1 (en) 2023-01-06

Family

ID=83804596

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210047393A KR102486419B1 (en) 2021-04-12 2021-04-12 Leader election method using federated learning for private blockchain, recording medium and device for performing the method

Country Status (1)

Country Link
KR (1) KR102486419B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116827966A (en) * 2023-08-29 2023-09-29 中国兵器装备集团兵器装备研究所 Data processing method and system
WO2024128391A1 (en) * 2022-12-16 2024-06-20 부산대학교 산학협력단 Blockchain p2p network-based iot device software update method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210010044A (en) 2019-07-19 2021-01-27 (주)유미테크 The method for managing node to serve trust network based on block-chain
KR20210022852A (en) 2019-08-21 2021-03-04 주식회사 코아비즈 Block chain-based iot management system using cryptographic module
KR20210025411A (en) 2019-08-27 2021-03-09 주성훈 Method for saving implant information component based block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210010044A (en) 2019-07-19 2021-01-27 (주)유미테크 The method for managing node to serve trust network based on block-chain
KR20210022852A (en) 2019-08-21 2021-03-04 주식회사 코아비즈 Block chain-based iot management system using cryptographic module
KR20210025411A (en) 2019-08-27 2021-03-09 주성훈 Method for saving implant information component based block chain

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
D. Ongaro and J. Ousterhout, "In search of an understandable consensus algorithm," 2014 USENIX ATC pp. 305-319., 2014.
Dongyan Huang 외, Performance Analysis of the Raft Consensus Algorithm for Private Blockchains, IEEE Transactions on Systems, Man, and Cybernetics: Systems PP(99):1-10. 2018.08.03.* *
You Jun Kim 외, Blockchain-based Node-aware Dynamic Weighting Methods for Improving Federated Learning Performance, 2019 20th Asia-Pacific Network Operations and Management Symposium (APNOMS). 2019.9월* *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024128391A1 (en) * 2022-12-16 2024-06-20 부산대학교 산학협력단 Blockchain p2p network-based iot device software update method and device
CN116827966A (en) * 2023-08-29 2023-09-29 中国兵器装备集团兵器装备研究所 Data processing method and system
CN116827966B (en) * 2023-08-29 2024-04-26 中国兵器装备集团兵器装备研究所 Data processing method and system

Also Published As

Publication number Publication date
KR102486419B1 (en) 2023-01-06

Similar Documents

Publication Publication Date Title
Yun et al. DQN-based optimization framework for secure sharded blockchain systems
KR102486419B1 (en) Leader election method using federated learning for private blockchain, recording medium and device for performing the method
WO2018113522A1 (en) Cross–Data Center Hierarchical Consensus Scheme with Geo-Aware Leader Election
CN102882927A (en) Cloud storage data synchronizing framework and implementing method thereof
EP3771993B1 (en) Machine learning systems and methods for data placement in distributed storage
Kim et al. Improved raft algorithm exploiting federated learning for private blockchain performance enhancement
CN106375416A (en) Consistency dynamic adjustment method and device in distributed data storage system
CN111787055A (en) Redis-based transaction mechanism and multi-data center oriented data distribution method and system
CN114415735A (en) Dynamic environment-oriented multi-unmanned aerial vehicle distributed intelligent task allocation method
CN115189908A (en) Random attack survivability evaluation method based on network digital twin
Bouhata et al. Byzantine fault tolerance in distributed machine learning: a survey
CN110730241B (en) Global scale oriented blockchain infrastructure
Islam et al. Transaction management with tree-based consistency in cloud databases
CN110188317A (en) Exclude means of voting, apparatus and system that polyisocyanate structure executes body common mode mistake
RU2720951C1 (en) Method and distributed computer system for data processing
Airlangga et al. A novel architectural design for solving lost-link problems in uav collaboration
US20240028584A1 (en) Distributed ledger system and method
CN112698944A (en) Distributed cloud computing system and method based on human brain simulation
CN116723192B (en) Distributed consensus system based on federal learning and operation method thereof
CN116760837B (en) Distributed consensus method and system based on federal learning and equity election
CN109542353B (en) Consistency algorithm for wide area distributed storage system
Nodine et al. A perceptually-based algorithm provides effective visual feedback to radiologists searching for lung nodules
KR102651602B1 (en) Time synchronization method and apparatus for orbit satellite cluster
Sun et al. Improved PBFT Algorithm Based on K-means clustering for Emergency Scenario Swarm Robotic Systems
CN116957110B (en) Trusted federation learning method and system based on federation chain

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant