# US 2020/0396290 A1 · Distributed processing method and apparatus based on consistency protocol and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2020/0396290 A1
- Document ID: US20200396290A1
- Status: Published application
- Kind: A1
- Application number: 17/008,765
- Filed: 2020-09-01
- Published: 2020-12-17
- Earliest claimed: 2018-07-19
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Tong Xing MA
- Web page: https://patentgrep.com/patent/US20200396290A1

## CPC

- H04L 67/1097: for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
- G06F 3/061: {Improving I/O performance}
- G06F 3/0619: {in relation to data integrity, e.g. data losses, bit errors}
- G06F 3/0638: {Organizing or formatting or addressing of data}
- G06F 3/0659: {Command handling arrangements, e.g. command buffers, queues, command scheduling}
- G06F 3/067: {Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]}
- H04L 41/30: {Decision processes by autonomous network management units using voting and bidding}
- H04L 67/1008: based on parameters of servers, e.g. available memory or workload (monitoring of computer activity G06F11/30)
- G06F 2206/1012: Load balancing
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A distributed processing method based on a consistency protocol is provided. The method includes: transmitting a decree prepare request including a first decree number, the decree prepare request requesting other nodes to promise to no longer accept a fast write operation initiated by a leader node whose leader number is less than the first decree number, the first decree number representing a leader number of a current node, and the leader number representing a number of a decree at which the current node that becomes a leader node is located; and in response to receiving decree promises from at least a preset quantity of nodes among the other nodes, enabling the fast write operation from a subsequent decree number of a second decree number determined based on the decree promises, each of the decree promises including the first decree number.

## Claims

### Claim 1

A distributed processing method based on a consistency protocol, applied to a network node device, the method comprising:
transmitting a decree prepare request including a first decree number, the decree prepare request requesting other nodes to promise to no longer accept a fast write operation initiated by a leader node whose leader number is less than the first decree number, the first decree number representing a leader number of a current node, and the leader number representing a number of a decree at which the current node that becomes a leader node is located; and
in response to receiving decree promises from at least a preset quantity of nodes among the other nodes, enabling the fast write operation from a subsequent decree number of a second decree number determined based on the decree promises, each of the decree promises including the first decree number.

### Claim 2 (depends on 1)

The method according to claim 1, wherein a decree promise includes the first decree number and a previous decree number, the previous decree number indicating that a node transmitting the decree promise has voted for: performing a write operation in a decree corresponding to the previous decree number, the method further comprising determining the second decree number based on previous decree numbers in the decree promises.

### Claim 3 (depends on 2)

The method according to claim 2, wherein each of the decree promises further comprises a previous leader number indicating that the node transmitting the decree promise has voted for a node corresponding to the previous leader number to perform the fast write operation, and
wherein the determining the second decree number comprises:
determining a first leader number from the received decree promises, the first leader number being a largest value in previous leader numbers or a value appearing most frequently in the decree promises, and determining the second decree number based on first previous decree numbers corresponding to the first leader number.

### Claim 4 (depends on 2)

The method according to claim 2, wherein the determining the second decree number comprises:
in response to receiving an (N30 1)th previous decree number, determining that a largest value in the previous decree numbers in received (N+1) decree promises is the second decree number, (N+1) being the preset quantity.

### Claim 5 (depends on 2)

The method according to claim 2, wherein the determining the second decree number comprises:
in response to a quantity of decree promises corresponding to received previous decree numbers being greater than the preset quantity, determining, as the second decree number, a largest value of decree numbers that corresponds to an estimated quantity of votes not less than the preset quantity and that is in the received previous decree numbers.

### Claim 6 (depends on 5)

The method according to claim 5, wherein the determining, as the second decree number, the largest value of decree numbers comprises:
ranking the previous decree numbers according to values, and determining that a previous decree number ranked (N+1)th in ascending order is the second decree number, (N+1) being the preset quantity.

### Claim 7 (depends on 1)

The method according to claim 1, further comprising, after the enabling the fast write operation:
transmitting a ballot request, the ballot request including a fast write identifier, the first decree number, a third decree number greater than the second decree number, and a decree value corresponding to the third decree number, the ballot request requesting the other nodes to record the decree value in a decree corresponding to the third decree number; and
performing a write operation in the decree corresponding to the third decree number in response to receiving at least the preset quantity of votes that comprise votes of the third decree number.

### Claim 8 (depends on 1)

The method according to claim 1, further comprising, prior to transmitting the decree prepare request:
determining, in response to receiving a data operation request, whether the current node meets preset conditions, the preset conditions being that the current node has become the leader node and receives the decree promises from at least the preset quantity of nodes; and
writing the data operation request according to preset operations of the consistency protocol in response to determining that the current node does not meet the preset conditions.

### Claim 9 (depends on 8)

The method according to claim 8, wherein the preset operations comprise transmitting a first ballot request, and the method further comprises:
determining, in response to determining that the current node is not the leader node and based on processing load of the current node, whether the current node is to be elected as the leader node;
writing election information into a decree value of the first ballot request in response to determining that the current node is to be elected as the leader node; and
determining, in response to receiving votes with respect to the first ballot request from at least the preset quantity of nodes, that the current node becomes the leader node.

### Claim 10 (depends on 1)

The method according to claim 1, further comprising:
extracting, in response to receiving a second decree prepare request from a second node, a fourth decree number from the second decree prepare request, the second decree prepare request indicating a request from the second node to other nodes to promise to no longer accept a fast write operation initiated by a leader node whose leader number is less than the fourth decree number, and the fourth decree number representing a leader number of the second node; and
comparing the fourth decree number with a second previous leader number stored in the current node, and determining, based on a comparison result, whether to transmit a second decree promise to the second node.

### Claim 11 (depends on 10)

The method according to claim 10, wherein the determining, based on the comparison result, whether to transmit the second decree promise comprises:
discarding the second decree prepare request based on the fourth decree number being less than the second previous leader number; and
transmitting the second decree promise to the second node based on the fourth decree number being greater than or equal to the second previous leader number, the second decree promise including the fourth decree number and indicating a promise to no longer accept the fast write operation initiated by the leader node whose leader number is less than the fourth decree number.

### Claim 12 (depends on 11)

The method according to claim 11, wherein the second decree promise further includes a second previous decree number, the second previous decree number indicating that the current node has voted for performing a write operation in a decree corresponding to the second previous decree number.

### Claim 13 (depends on 1)

The method according to claim 1, further comprising:
extracting, in response to receiving a second ballot request comprising a fast write identifier, a fifth decree number, a sixth decree number greater than the fifth decree number, and a decree value corresponding to the sixth decree number from the second ballot request, the fifth decree number representing a leader number of a transmission node of the ballot request, and the leader number representing a number of a decree at which the transmission node that becomes the leader node is located; and
comparing the fifth decree number with a previous leader number stored in the current node, and determining, based on a comparison result, whether to record the decree value in a decree corresponding to the sixth decree number.

### Claim 14 (depends on 13)

The method according to claim 13, wherein the determining, based on the comparison result, whether to record the decree value comprises:
discarding the second ballot request based on the fifth decree number being less than the previous leader number; and
transmitting a vote to the transmission node based on the fifth decree number being greater than or equal to the previous leader number, and performing an operation of recording vote information in the decree corresponding to the sixth decree number, the vote including the sixth decree number and the fast write identifier, and the vote information comprising the fifth decree number, the decree value, and the fast write identifier.

### Claim 15

A distributed processing apparatus based on a consistency protocol, the apparatus comprising:
at least one memory configured to store program code; and
at least one processor configured to read the program code and operate as instructed by the program code, the program code comprising:
first transmitting code configured to cause at least one of the at least one processor to transmit a decree prepare request including a first decree number, the decree prepare request requesting other nodes to promise to no longer accept a fast write operation initiated by a leader node whose leader number is less than the first decree number, the first decree number representing a leader number of a current node, and the leader number representing a number of a decree at which the current node that becomes a leader node is located; and
enabling code configured to cause at least one of the at least one processor to enable, in response to receiving decree promises from at least a preset quantity of nodes among the other nodes, enable the fast write operation from a subsequent decree number of a second decree number determined based on the decree promises, each of the decree promises including the first decree number.

### Claim 16 (depends on 15)

The apparatus according to claim 15, wherein a decree promise includes the first decree number and a previous decree number, the previous decree number indicating that a node transmitting the decree promise has voted for performing a write operation in a decree corresponding to the previous decree number, and
wherein the second decree number is determined based on previous decree numbers in the decree promises.

### Claim 17 (depends on 15)

The apparatus according to claim 15, wherein the program code further comprises:
second transmitting code configured to cause at least one of the at least one processor to transmit a ballot request, the ballot request including a fast write identifier, the first decree number, a third decree number greater than the second decree number, and a decree value corresponding to the third decree number, the ballot request requesting the other nodes to record the decree value in a decree corresponding to the third decree number; and
performing code configured to cause at least one of the at least one processor to perform a write operation in the decree corresponding to the third decree number in response to receiving at least the preset quantity of votes that comprise votes of the third decree number.

### Claim 18 (depends on 15)

The apparatus according to claim 15, wherein the program code further comprises:
determining code configured to cause at least one of the at least one processor to, in response to receiving a data operation request, determine whether the current node meets preset conditions, the preset conditions being that the current node has become the leader node and receives the decree promises from at least the preset quantity of nodes; and
writing code configured to cause at least one of the at least one processor to write the data operation request according to preset operations of the consistency protocol in response to determining that the current node does not meet the preset conditions.

### Claim 19

A non-transitory computer readable storage medium storing instructions, the instructions being executable by at least one processor to cause the at least one processor to perform:
transmitting a decree prepare request including a first decree number, the decree prepare request requesting other nodes to promise to no longer accept a fast write operation initiated by a leader node whose leader number is less than the first decree number, the first decree number representing a leader number of a current node, and the leader number representing a number of a decree at which the current node that becomes a leader node is located; and
in response to receiving decree promises from at least a preset quantity of nodes among the other nodes, enabling the fast write operation from a subsequent decree number of a second decree number determined based on the decree promises, each of the decree promises including the first decree number.

### Claim 20 (depends on 1)

A distributed processing apparatus based on a consistency protocol, the apparatus comprising:
at least one processor; and
at least one memory configured to store instructions executable by the at least one processor to cause the at least one processor to perform the method according to claim 1.
