Packing method and device on block chain

A blockchain and block technology, applied in the computer field, can solve the problems affecting the efficiency of accounting, development constraints, and higher computing power requirements of super nodes, so as to reduce the possibility of successful attacks, improve the efficiency of block generation, and improve the recording capacity. The effect of account efficiency

Active Publication Date: 2019-09-17
BEIJING AIMORECE TECH CO LTD
6 Cites 0 Cited by

AI-Extracted Technical Summary

Problems solved by technology

After being voted and elected by all currency holders, the supernodes that finally obtain the right to bookkeeping can greatly reduce the waste of energy. However, since the operations are concentrated on the supernodes, the computing po...
View more

Method used

[0091] After the first block node determines the first block, if it is determined that the first block is greater than the first threshold, then it is determined that the first block is too large, which will affect the efficiency of block generation, then the first block can be A block is divided into multiple sub-blocks, which are packaged by different block producing nodes to improve packaging efficiency.
[0145] Through the embodiment of the...
View more

Abstract

The embodiment of the invention relates to a packaging method and device on a block chain. The method comprises the steps that if a first block to be generated is larger than a first threshold value, dividing the first block into a first sub-block and at least one second sub-block; performing a first hash operation according to the first block to obtain a first hash value; determining a first numerical value of the plurality of outblock nodes; selecting a specified number of first numerical values according to the sizes of the first numerical values of the plurality of outblock nodes; performing a second hash operation on the specified number of first numerical values to obtain a second hash value; and selecting at least one second block output node from the plurality of block output nodes as a block output node of the at least one second sub-block according to the second hash value and a preset random rule. Therefore, the block output node can assign the next block output node, the assigned process has certain randomness and verifiability, and the block output efficiency of the block chain node network is improved.

Application Domain

FinanceEncryption apparatus with shift registers/memories +1

Technology Topic

Computational sciencePacking method

Image

  • Packing method and device on block chain
  • Packing method and device on block chain
  • Packing method and device on block chain

Examples

  • Experimental program(1)

Example Embodiment

[0082] In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of the embodiments of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
[0083] The embodiment of the present invention provides a packaging method and device on a blockchain. figure 1 An exemplary architecture applying the embodiments provided in this application is shown.
[0084] Such as figure 1 As shown, the exemplary architecture may include multiple blockchain nodes, and the multiple blockchain nodes may include multiple block-producing nodes 101 and multiple block-producing nodes 102. In an example, the block producing node may be a plurality of super nodes selected through an election mechanism, the number of the super nodes may be determined according to actual needs, and the number of the super nodes may be an odd number, such as 21. In another example, the multiple verification nodes may be candidate nodes, where the super node may be selected from candidate nodes, and the number of candidate nodes may also be determined according to actual needs, for example, it may be 100 , Where the candidate nodes can be selected according to a preset random rule, for example, a specified number of nodes with the highest computing power can be used as candidate nodes. In another example, the verification node may also be all or part of the nodes except the block producing node. Among them, the blockchain node can be implemented in the form of software or hardware. When implemented as hardware, it can be a notebook computer, a desktop computer, a mobile terminal, and so on.
[0085] Block producers are mainly used to produce blocks based on the consensus mechanism, which means that they are mainly used for accounting. The verification node is mainly used to verify the block generated by the block producer based on the consensus mechanism, and the verified block will be recorded in the blockchain. The nodes can communicate to synchronize data such as the blockchain. For example, nodes can communicate based on the D2D protocol.
[0086] In order to facilitate the understanding of the embodiments of the present invention, specific embodiments will be further explained below in conjunction with the drawings, and the embodiments do not constitute a limitation to the embodiments of the present invention.
[0087] figure 2 It is a flowchart of a packaging method on a blockchain provided by the present invention. The blockchain node network includes multiple block producers, such as figure 1 In the block chain node network in the exemplary architecture shown, this method is applicable to a first block generating node, and the first block generating node is any one of a plurality of block generating nodes. Such as figure 2 As shown, the method specifically includes:
[0088] S210: If the first block to be packaged is greater than a first threshold, divide the first block into a first sub-block and at least one second sub-block, wherein the first block-producing node serves as the first The block producer node of the sub-block.
[0089] Among them, each node in the blockchain node network operates based on a consensus mechanism. The consensus mechanism is pre-defined, and the consensus mechanism may include a block consensus mechanism, a verification consensus mechanism, and so on.
[0090] The block producing node in the blockchain node network can determine the first block producing node according to the block producing consensus mechanism, and the first block producing node can generate blocks from the data in the system within a specified time period. The specified time period can be determined according to actual needs, for example, it can be 1 second, 10 seconds, 3 minutes, 10 minutes, and so on. The system can be the entire blockchain system corresponding to the blockchain node network. Among them, the blockchain is composed of multiple blocks, and each block can carry the identifier of the previous block to form a chain storage structure.
[0091] After the first block generation node determines the first block, if the first block is determined to be greater than the first threshold, it is determined that the first block is too large, which will affect the block generation efficiency, and the first block can be divided into Multiple sub-blocks are packaged by different block producing nodes to improve packaging efficiency.
[0092] Among them, the first threshold can be determined according to actual needs.
[0093] The rules for dividing sub-blocks can be determined according to actual needs. For example, it can be determined that the data of the block is less than the maximum time interval of the first threshold, and then the sub-blocks are divided according to the maximum time interval. For example, the maximum time interval can be 1 minute, and a block is 3 minutes, then it can be divided into three 1-minute sub-blocks.
[0094] S220: Perform a first hash operation according to the first block to obtain a first hash value.
[0095] The current blockchain node needs to determine the next node that needs to generate a block when generating a block. The current blockchain node can be called the first block node, and the next node that needs to generate a block can be called the second node. Block node, the block generated by the current blockchain node may be called the first block, and the block generated by the next node that needs to generate the block may be called the second block.
[0096] In order to increase the efficiency of the node's block-producing node selection and reduce the burden on the system, when the next block-producing node is selected, the first hash operation can be performed on the first block to obtain the first hash value. Wherein, the verification consensus mechanism may include a predefined first hash operation, and the first hash operation may be determined according to actual needs. For example, the first hash operation may be SHA-256.
[0097] S230: Send the first hash value to other nodes among the multiple block producing nodes.
[0098] The multiple block producing nodes may be all block producing nodes.
[0099] S240: Determine the first numerical value of the multiple block producing nodes, and the first numerical value of each block producing node is determined based on the signature of the block producing node to the first hash value.
[0100] Each block producer signs the first hash value to obtain the first digital signature of the block producer; the first digital signature of the block producer can be used as the first value of the block producer. Alternatively, each block producer performs a third hash operation on the first digital signature of the block producer to obtain the first value of the block producer.
[0101] In an example, the first block producer may sign the first hash value to obtain the first digital signature of the first block producer; the first block producer may perform the first digital signature on the first block producer The third hash operation obtains the first value of the first block producing node.
[0102] Each blockchain node may include at least one secret key pair, and each secret key pair includes a public key and a private key. The private key can be stored locally, and the public key can be sent to other blockchain nodes.
[0103] After determining the first hash value, the current block producer may sign the first hash value to obtain the first digital signature. The first signature of the block producer can be signed using the private key of the block producer, and the public key corresponding to the private key can be used to verify the first signature of the block producer.
[0104] S250: Select a specified number of first values ​​according to the size of the first values ​​of the multiple block producing nodes.
[0105] Among them, the first values ​​of multiple block producing nodes can be sorted, and a specified number of first values ​​with larger or smaller values ​​can be selected. The designated number can be determined according to actual needs, for example, the designated number can be two.
[0106] S260: Perform a second hash operation on the specified number of first values ​​to obtain a second hash value.
[0107] When determining the block producing node, a second hash operation can be performed on a specified number of first digital signatures to obtain a second hash value. The block generation consensus mechanism may include a predefined second hash operation, and the second hash operation may be determined according to actual needs. For example, the second hash operation may be SHA-256. The first hash operation and the second hash operation may be the same hash operation or different hash operations.
[0108] S270: According to the second hash value and a preset random rule, select at least one second block generating node from among the plurality of block generating nodes respectively as the block generating node of the at least one second sub-block.
[0109] In some embodiments, the sequence relationship may be determined according to the size relationship of the sequence number of the at least one second block producing node, and the block producing nodes of the at least one second sub-block are respectively used according to the sequence relationship. For example, each block-producing sub-node is divided according to time, and the second block-producing node of each block-producing sub-node can be determined according to the time sequence relationship of the block-producing sub-nodes and the sequence relationship of the second block-producing node.
[0110] When determining the block producing node, it can be selected according to the second hash value. Among them, the block generation consensus mechanism may include a preset random rule based on which the selection is based, and the preset random rule has certain randomness and verifiability.
[0111] In an example, the preset random rule may include:
[0112] Convert the second hash value to decimal, and take the remainder of the fourth value;
[0113] It is determined that the verification node corresponding to the remainder is the second block producing node.
[0114] Wherein, the fourth value can be determined according to the number of block producing nodes. For example, the number of block producing nodes may be 100, and the fourth value may be 100.
[0115] Among them, the second hash value guarantees randomness, and the determination of the second hash value and the preset random rule guarantee the verifiability of the second block producing node.
[0116] The first block producing node may send the first digital signature to the second block producing node so that the second block producing node can continue to produce blocks. For example, the first digital signature can be sent to multiple block producing nodes by broadcasting.
[0117] The public key of the first block and the first block producer can also be sent to the second block producer. Among them, the public key can be sent in multiple forms. In one example, the address of the block producer can be generated according to the public key, and the address can be used as the transfer-out or transfer-in address of the transaction, and the second block-producing node can determine the block-producing node according to the address of the block-producing node The public key. In another example, the public key can be carried in the first block for transmission.
[0118] After receiving the first digital signature, the second block-producing node can first verify the identity of the first block-producing node, and the identity of the block-producing node can be implemented by verifying the first digital signature through the public key of the block-producing node. After the verification is passed, the second block-producing node can verify its own verification identity. The verification process can be based on a preset random rule to verify whether the block-producing node of the second block includes itself. After the above two verification processes are passed, the second block producing node then packs the second block and synchronizes the packed second block across the entire network.
[0119] In some embodiments, the foregoing step S260 may be specifically implemented through the following steps:
[0120] Perform a second hash operation on the first digital signature and the third value to obtain a second hash value.
[0121] Wherein, the third value is a predefined fixed value such as 1-n, and the n is any value.
[0122] The third value may also be the serial number of the first block-producing node, or a value determined according to the serial number of the first block-producing node. Through the third value, the randomness of the selection of the block producing node can be further realized.
[0123] In some embodiments, the method further includes the following steps:
[0124] 1) Receive the third hash value sent by the third block producer.
[0125] Wherein, the third hash value is obtained by the third block producing node performing the first hash operation on the third block; the third block may be a block newly generated by the second block producing node.
[0126] 2) Sign the third hash value to obtain the second digital signature of the first block producer;
[0127] 3) Perform a third hash operation on the second digital signature of the first block producer to obtain the second value of the first block producer;
[0128] 4) The second value of the first block-producing node sent to the third block-producing node.
[0129] In some embodiments, the following steps may also be included:
[0130] 1) Receive a third digital signature sent by a fourth block producer, the third digital signature is for a fourth block, and the fourth block is divided into a third sub-block and at least one fourth sub-block;
[0131] 2) Perform a third hash operation on the third digital signature of the first block-producing node to obtain the fourth value of the first block-producing node;
[0132] 3) According to the size of the fourth value of the multiple block producing nodes, select a specified number of fourth values;
[0133] 4) Perform a second hash operation on the specified number of fourth values ​​to obtain a fourth hash value;
[0134] 5) According to the fourth hash value and a preset random rule, determine whether the first block-producing node is the block-producing node of the fifth block, and the fifth block is the fourth zone The next block of the block;
[0135] 6) If yes, pack the fifth block.
[0136] 7) If not, end.
[0137] In step 1), the fourth block, public key and third digital signature sent by the fourth block producer can be received.
[0138] Among them, the fourth block may be a block newly generated by the fourth block producing node. The third digital signature can be determined according to the fourth block. For details, refer to the acquisition process of the aforementioned first digital signature, which will not be repeated here.
[0139] The first block-producing node may also determine the public key of the fourth block-producing node. The public key may be determined according to the address of the fourth block-producing node, or it may obtain the public key carried in the third block.
[0140] In step 5), the sequence number of the block producing node of the fifth block can be determined according to the fourth hash value and the preset random rule; judge whether the sequence number of the block producing node of the fifth block is the first block producing node The serial number.
[0141] After the first block producer node receives the fourth block, it can first verify the identity of the fourth block producer node, and the identity of the block producer node can be implemented through the following steps.
[0142] Step A: Use the public key of the fourth block producer to verify the third digital signature of the fourth block producer to obtain the fifth hash value of the fourth block producer.
[0143] Step B: Perform a first hash operation on the fourth block to obtain a sixth hash value;
[0144] The first block-producing node can compare whether the fifth hash value and the sixth hash value are the same. If they are the same, it means that the third digital signature is the digital signature of the fourth block-producing node, that is, the verification is passed. If they are different, the verification fails.
[0145] Through the embodiment of the present invention, the block producer can designate the next block producer. The designation process has a certain degree of randomness and verifiability, which can reduce the possibility of the blockchain being successfully attacked and improve the network performance of the blockchain node. Block generation efficiency, thereby improving accounting efficiency, makes the blockchain node network suitable for service scenarios with larger data scales.
[0146] image 3 It is a schematic structural diagram of a packaging device on a blockchain provided by an embodiment of the present invention. The blockchain node network includes multiple block producers, such as figure 1 In the block chain node network in the exemplary architecture shown, the device is applicable to the current block producing node, and the current block producing node is any one of the multiple block producing nodes, and the device includes:
[0147] The block division unit 301, if the first block to be generated is greater than the first threshold, is used to divide the first block into a first sub-block and at least one second sub-block, wherein the first output The block node serves as the block producer of the first sub-block;
[0148] The hash unit 302 performs a first hash operation according to the first block to obtain a first hash value;
[0149] The sending unit 303 is configured to send the first hash value to other nodes among the multiple block producing nodes;
[0150] The determining unit 304 is configured to determine the first value of the plurality of block producing nodes, and the first value of each block producing node is determined based on the signature of the block producing node to the first hash value;
[0151] The first selection unit 305 is configured to select a specified number of first values ​​according to the size of the first values ​​of the multiple block producing nodes;
[0152] The hash unit 302 is further configured to perform a second hash operation on the specified number of first values ​​to obtain a second hash value;
[0153] The second selection unit 306 is configured to select at least one second block generating node from among the plurality of block generating nodes as the at least one second subarea respectively according to the second hash value and a preset random rule The block producer node.
[0154] In some embodiments, the device further includes:
[0155] A signature unit, configured to sign the first hash value to obtain the first digital signature of the first block producer;
[0156] The hash unit is configured to perform a third hash operation on the first digital signature of the first block-producing node to obtain the first value of the first block-producing node.
[0157] In some embodiments, it further includes:
[0158] A receiving unit, configured to receive a third hash value sent by a third block producing node, where the third hash value is obtained by the third block producing node performing a first hash operation on the third block;
[0159] A signature unit, configured to sign the third hash value to obtain a second digital signature of the first block producer;
[0160] A hash unit, configured to perform a third hash operation on the second digital signature of the first block producing node to obtain the second value of the first block producing node;
[0161] The sending unit is configured to send the second value of the first block producing node to the third block producing node.
[0162] In some embodiments, the hash unit is specifically used for:
[0163] Perform a second hash operation on the specified number of first values ​​and third values ​​to obtain a second hash value, where the third value is 1-n or the serial number of the first block producing node, and the n Any value.
[0164] In some embodiments, the preset random rule includes:
[0165] Converting the second hash value into a decimal system, and taking a remainder of a fourth value, the fourth value being determined according to the number of the multiple verification nodes;
[0166] It is determined that the verification node corresponding to the remainder is the second block producing node.
[0167] In some embodiments, it further includes:
[0168] The sending unit is configured to send the first digital signature to the multiple block producing nodes.
[0169] In some embodiments, it further includes:
[0170] The receiving unit is configured to receive a third digital signature sent by a fourth block producer, where the third digital signature is for a fourth block, and the fourth block is divided into a third sub-block and at least one fourth sub-block Piece;
[0171] A hash unit, configured to perform a third hash operation on the third digital signature of the first block producer to obtain the fourth value of the first block producer;
[0172] The selection unit is configured to select a designated number of fourth values ​​according to the size of the fourth values ​​of the multiple block producing nodes;
[0173] A hash unit, configured to perform a second hash operation on the specified number of fourth values ​​to obtain a fourth hash value;
[0174] A judging unit, configured to judge whether the first block-producing node is the block-producing node of the at least one fourth sub-block according to the fourth hash value and a preset random rule;
[0175] The packing unit, if yes, is used to pack the fifth block.
[0176] In some embodiments, the judging unit is specifically used for:
[0177] Determine the serial number of the block producing node of at least one fourth sub-block according to the fourth hash value and a preset random rule;
[0178] It is determined whether the sequence number of the block producing node of the at least one fourth sub-block includes the sequence number of the first block producing node.
[0179] It can be understood that the packaging device on the blockchain of this embodiment is figure 2 The method embodiment shown corresponds to, therefore, the above is about figure 2 The description of the method embodiment shown is also applicable to the device of this embodiment, and will not be repeated here.
[0180] Figure 4 It shows a schematic structural diagram of a computer device provided by an embodiment of this specification. The computer device may include a processor 410, a memory 420, an input/output interface 430, a communication interface 440, and a bus 450. The processor 440, the memory 420, the input/output interface 430, and the communication interface 440 realize the communication connection between each other in the device through the bus 450.
[0181] The processor 410 may be implemented by a general CPU (Central Processing Unit, central processing unit), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., for executing related Program to realize the technical solutions provided in the embodiments of this specification.
[0182] The memory 420 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 420 may store an operating system and other application programs. When the technical solutions provided in the embodiments of the present specification are implemented by software or firmware, related program codes are stored in the memory 420 and called and executed by the processor 410.
[0183] The input/output interface 430 is used to connect the input/output module to realize information input and output. The input/output/module can be configured in the device as a component (not shown in the figure), or can be connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and an output device may include a display, a speaker, a vibrator, an indicator light, and the like.
[0184] The communication interface 440 is used to connect a communication module (not shown in the figure) to implement communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.), or through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0185] The bus 450 includes a path to transmit information between various components of the device (for example, the processor 410, the memory 420, the input/output interface 430, and the communication interface 440).
[0186] It should be noted that although the above device only shows the processor 410, the memory 420, the input/output interface 430, the communication interface 440, and the bus 450, in the specific implementation process, the device may also include the equipment necessary for normal operation. Other components. In addition, those skilled in the art can understand that the above-mentioned device may also include only the components necessary to implement the solutions of the embodiments of this specification, and not necessarily include all the components shown in the figures.
[0187] Professionals should also be further aware that the units and algorithm steps of the examples described in the embodiments disclosed in this article can be implemented by electronic hardware, computer software or a combination of both, in order to clearly illustrate the hardware and software Interchangeability. In the above description, the composition and steps of each example have been generally described in accordance with the function. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the present invention.
[0188] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or all areas in the technical field. Any other known storage media.
[0189] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in further detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the scope of the present invention. The protection scope, any modification, equivalent replacement, improvement, etc. made within the scope of the present invention shall be included in the protection scope of the present invention.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

One-key cost accounting management system and method for visual accounting process

PendingCN110910008Aaccurate dataImprove accounting efficiency
Owner:江苏睿孜星智控科技有限公司

Subsea production system device quantity rapid accounting method

ActiveCN108833547AImprove accounting efficiencyImprove work efficiency
Owner:CHINA NAT OFFSHORE OIL CORP +1
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products