CN115422296A - Block chaining-out method, device and storage medium - Google Patents

Block chaining-out method, device and storage medium Download PDF

Info

Publication number
CN115422296A
CN115422296A CN202211117124.9A CN202211117124A CN115422296A CN 115422296 A CN115422296 A CN 115422296A CN 202211117124 A CN202211117124 A CN 202211117124A CN 115422296 A CN115422296 A CN 115422296A
Authority
CN
China
Prior art keywords
block
candidate
nodes
node
information
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202211117124.9A
Other languages
Chinese (zh)
Inventor
吴思进
王志文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
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 Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN202211117124.9A priority Critical patent/CN115422296A/en
Publication of CN115422296A publication Critical patent/CN115422296A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • G06F21/445Program or device authentication by mutual authentication, e.g. between devices or programs

Abstract

The invention belongs to the technical field of computers, and particularly relates to a block chaining block method, a block chaining block device and a storage medium. The method has the advantages that the committee members are randomly selected to further select the candidate nodes, the candidate nodes perform block pre-output, the committee members verify the candidate output blocks of the candidate nodes, the verification is confirmed to be the output block nodes, the accuracy and consistency of the output blocks are guaranteed, the rollback or overtime situation of new output blocks is greatly reduced, and the TPS of the whole system is improved.

Description

Block chaining-out method, device and storage medium
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a block chaining out method, a device and a storage medium.
Background
In the prior art, when a new block is generated in a block chain, a plurality of nodes compete for the new block, and since common identification nodes are dispersed in different network environments, the time for receiving the new block is different, and a part of nodes can have the situation that the new block approved by the nodes is inconsistent with the new blocks approved by the other nodes, so that a rollback situation can occur.
Disclosure of Invention
The invention provides a block chaining block outputting method, a device and a storage medium, which can greatly reduce the condition of rollback or timeout of a new block.
In order to solve or partially solve the technical problems, the invention adopts the following technical scheme:
in a first aspect, the present invention provides a block chaining method, including:
randomly selecting a first number of votes and selecting nodes corresponding to the selected votes as members of the current committee;
the block link points calculate corresponding candidate information based on a preset rule according to the first public information of the designated block and the vote id of the vote held by the block link points and upload the signature; the first public information comprises block height and block hash, and vote id of votes held by block link points is obtained by calculation according to a public key of a block link node;
when the member nodes of the present committee sort the candidate nodes according to the candidate information of the block chain nodes and generate sorting information, selecting a second number of candidate nodes according to the sorting information, verifying the candidate information of the selected candidate nodes, if all the verification passes, setting corresponding orders for the candidate nodes according to the sorting information, and if not, rejecting the block chain nodes failing to verify, supplementing and verifying the block chain nodes according to the sorting information until the number of the candidate nodes passing the verification reaches the second number;
uploading the corresponding candidate node sets by the member nodes of the current committees, performing consensus and determining a first candidate set;
each current committee member uploading the first candidate set to a block chain and recording;
each candidate node generates a corresponding candidate block within a first time period after the generation of the previous block and sends the candidate block to each current committee member;
when the member of the committee confirms that the candidate block generated by the first order candidate node is received and verifies that the candidate block is correct, the member votes to pass through the first order candidate node;
when the current committee member voting exceeding the first proportion passes, determining that the first priority candidate node is a block outlet node, otherwise, voting a candidate block generated by a next priority candidate node in the first candidate set until the block node is determined; if all nodes in the first candidate set are traversed and the block nodes are not determined, the candidate set is reselected and voting is carried out until the block nodes are determined;
and performing consensus on the determined block nodes and the ticket obtaining condition, and performing block discharging by the block discharging node after the consensus is completed.
In a second aspect, there is provided a computer device comprising one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method as described in the first aspect above.
In a third aspect, there is provided a storage medium storing a computer program which, when executed by a processor, implements the method as described in the first aspect above.
The method has the advantages that the committee members are randomly selected to further select the candidate nodes, the candidate nodes are subjected to block pre-output, the candidate output blocks of the candidate nodes are verified by the committee members, the verified candidate output blocks are determined to be output block nodes, accuracy and consistency of output blocks are guaranteed, rollback or overtime of new output blocks is greatly reduced, and the overall TPS of the system is improved.
Drawings
Fig. 1 is a flowchart of a block chaining method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to specific embodiments and drawings. Those skilled in the art will be able to implement the invention based on these teachings. Moreover, the embodiments of the present invention described in the following description are generally only some embodiments of the present invention, and not all embodiments. Therefore, all other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative effort shall fall within the protection scope of the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. Unless otherwise specified, the methods described in the examples of the present invention are all those known to those skilled in the art.
Fig. 1 is a flowchart of a block chaining method according to an embodiment of the present invention.
As an embodiment of the present invention, a block chaining method in this embodiment is provided, where the method includes:
randomly selecting a first number of votes and selecting nodes corresponding to the selected votes as members of the current committee;
the block link points calculate corresponding candidate information based on a preset rule according to the first public information of the designated block and the vote id of the vote held by the block link points and upload the signature; the first public information comprises block height and block hash, and vote id of votes held by block link points is obtained by calculation according to a public key of a block link node;
when the member nodes of the present committee sort the candidate nodes according to the candidate information of the block chain nodes and generate sorting information, selecting a second number of candidate nodes according to the sorting information, verifying the candidate information of the selected candidate nodes, if all the verification passes, setting corresponding orders for the candidate nodes according to the sorting information, and if not, rejecting the block chain nodes failing to verify, supplementing and verifying the block chain nodes according to the sorting information until the number of the candidate nodes passing the verification reaches the second number; the selection of the members of the committee of decentralization and the selection of the candidate nodes are realized, and the decentralization and the fairness are ensured.
Uploading the corresponding candidate node sets by the member nodes of the current committees, performing consensus and determining a first candidate set;
each current committee member uploads the first candidate set to a block chain and records;
each candidate node generates a corresponding candidate block within a first time period after the generation of the previous block and sends the candidate block to each current committee member;
when the member of the committee confirms that the candidate block generated by the first order candidate node is received and verifies that the candidate block is correct, the member votes to pass through the first order candidate node;
when the current committee member voting exceeding the first proportion passes, determining that the first priority candidate node is a block outlet node, otherwise, voting a candidate block generated by a next priority candidate node in the first candidate set until the block node is determined; if all nodes in the first candidate set are traversed and the block nodes are not determined, the candidate set is reselected and voting is carried out until the block nodes are determined; and the candidate node performs block pre-extraction, and when the candidate node with high priority cannot pass through, the next candidate node can be directly verified, so that the overall processing speed of the system is ensured, and the possibility of block generation timeout can be better reduced in a parallel block extraction mode.
And performing consensus on the determined block nodes and the ticket obtaining condition, and performing block discharging by the block discharging node after the consensus is completed.
Specifically, in this embodiment, the vote id is obtained by performing hash operation on a node public KEY, and the method for calculating the corresponding candidate information based on the preset rule according to the first public information of the specified block and the vote id of the vote held by the node may be that the node performs hash operation on the block height of the specified block, the block hash of the specified block and the vote id of the node to obtain the corresponding candidate information, assuming that the specified block height is block _20, the candidate information M _ a = hash (20 + hash (block _ 20) + hash (KEY _ a)), and the sorting information is to sort the candidate information of each block chain node in size, and select the smallest several bits as the candidate nodes.
The method has the advantages that the committee members are randomly selected to further select the candidate nodes, the candidate nodes perform block pre-extraction, the committee members verify the candidate extraction blocks of the candidate nodes, the verification is confirmed to be the extraction nodes, accuracy and consistency of extraction are guaranteed, rollback or overtime new extraction is greatly reduced, and the TPS of the whole system is improved.
Fig. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 2, as still another embodiment of the present invention, there is provided a computer apparatus 100 including one or more Central Processing Units (CPUs) 101 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 102 or a program loaded from a storage section 108 into a Random Access Memory (RAM) 103. In the RAM103, various programs and data necessary for the operation of the apparatus 100 are also stored. The CPU101, ROM102, and RAM103 are connected to each other via a bus 104. An input/output (I/O) interface 105 is also connected to bus 104.
The following components are connected to the I/O interface 105: an input portion 106 including a keyboard, a mouse, and the like; an output section 107 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 108 including a hard disk and the like; and a communication section 109 including a network interface card such as a LAN card, a modem, or the like. The communication section 109 performs communication via a network such as the internet, and the processing driver 110 is also connected to the I/O interface 105 as necessary. A removable medium 111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 110 as necessary, so that a computer program read out therefrom is mounted into the storage section 108 as necessary.
In particular, according to embodiments disclosed herein, the method described in embodiment 1 above may be implemented as a computer software program. For example, embodiments disclosed herein include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method described in any of the embodiments above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 109 and/or installed from the removable medium 111.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described herein.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions which implement parallel chain cross-chain transaction state synchronization information based on a self-expression of a compressed account number address, the account number address being compressed, and an expression of asset type information being compressed in order to conserve transaction byte count. The design saves the number of transaction bytes, and meanwhile, the synchronization of the states can be completed without pulling the history height block by the main chain.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements in which any combination of the above features or their equivalents is incorporated without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (3)

1. A block chaining block method, the method comprising:
randomly selecting a first number of votes and selecting nodes corresponding to the selected votes as members of the current committee;
the block link points calculate corresponding candidate information based on a preset rule according to the first public information of the designated block and the vote id of the vote held by the block link points and upload the signature; the first public information comprises block height and block hash, and vote id of votes held by block link points is obtained by calculation according to a public key of a block link node;
when the member nodes of the present committee sort the candidate nodes according to the candidate information of the block chain nodes and generate sorting information, selecting a second number of candidate nodes according to the sorting information, verifying the candidate information of the selected candidate nodes, if all the verification passes, setting corresponding orders for the candidate nodes according to the sorting information, and if not, rejecting the block chain nodes failing to verify, supplementing and verifying the block chain nodes according to the sorting information until the number of the candidate nodes passing the verification reaches the second number;
uploading the corresponding candidate node sets by the member nodes of the current committees, performing consensus and determining a first candidate set;
each current committee member uploads the first candidate set to a block chain and records;
each candidate node generates a corresponding candidate block within a first time length after the generation of the previous block and sends the candidate block to each current committee member;
when the member of the committee confirms that the candidate block generated by the first order candidate node is received and verifies that the candidate block is correct, the member votes to pass through the first order candidate node;
when the current committee member voting exceeding the first proportion passes, determining that the first priority candidate node is a block outlet node, otherwise, voting a candidate block generated by a next priority candidate node in the first candidate set until the block node is determined; if all nodes in the first candidate set are traversed and the block nodes are not determined, the candidate set is reselected and voting is carried out until the block nodes are determined;
and carrying out consensus on the determined block nodes and the ticket obtaining condition, and carrying out block output by the block output node after the consensus is finished.
2. A computer device, characterized by one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in claim 1.
3. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method of claim 1.
CN202211117124.9A 2022-09-14 2022-09-14 Block chaining-out method, device and storage medium Pending CN115422296A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211117124.9A CN115422296A (en) 2022-09-14 2022-09-14 Block chaining-out method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211117124.9A CN115422296A (en) 2022-09-14 2022-09-14 Block chaining-out method, device and storage medium

Publications (1)

Publication Number Publication Date
CN115422296A true CN115422296A (en) 2022-12-02

Family

ID=84202412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211117124.9A Pending CN115422296A (en) 2022-09-14 2022-09-14 Block chaining-out method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115422296A (en)

Similar Documents

Publication Publication Date Title
US20190386834A1 (en) Blockchain management apparatus, blockchain management method, and program
US20210035095A1 (en) Blockchain consensus method, accounting node and node
CN107832062B (en) Program updating method and terminal equipment
CN112597153B (en) Block chain-based data storage method, device and storage medium
CN106327340B (en) Abnormal node set detection method and device for financial network
CN114595479B (en) Data median determination method and device
CN110570311B (en) Block chain consensus method, device and equipment
CN111694839A (en) Time series index construction method and device based on big data and computer equipment
CN111931047B (en) Artificial intelligence-based black product account detection method and related device
CN112016967B (en) Transaction data processing method and device
WO2020253037A1 (en) Target area screening method and device
CN116170162B (en) Selective consensus method, computer storage medium, and terminal device
CN115422296A (en) Block chaining-out method, device and storage medium
CN108960111B (en) Face recognition method, face recognition system and terminal equipment
CN107392745B (en) Reconciliation data fragmentation processing method
CN111612616A (en) Block chain account evaluation method and device, terminal device and computer readable medium
CN113837878B (en) Data comparison method, device, equipment and storage medium
CN116433369A (en) Verification method and device
US20220254002A1 (en) Method for improving efficiency of defect detection in images, image defect detection apparatus, and computer readable storage medium employing method
CN113220598A (en) System test method, apparatus, device, medium, and program product
CN114265740A (en) Error information processing method, device, equipment and storage medium
CN113591881A (en) Intention recognition method and device based on model fusion, electronic equipment and medium
CN111857883A (en) Page data checking method and device, electronic equipment and storage medium
CN110837537A (en) Order data synchronization method and device, computer readable storage medium and server
CN115482422B (en) Training method of deep learning model, image processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination