Block construction method and device, terminal equipment and computer program product
By determining and allocating construction credentials in the blockchain and allocating construction rights based on the builder's disposable value and construction evaluation value, the stability problem in the blockchain caused by different block incentives is solved, and the blockchain is achieved higher stability and security.
Patent Information
- Application Number
- CN202411783007.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-05-06
AI Technical Summary
The stability of building blocks is reduced due to different block incentives in existing blockchains, which affects the overall stability and security of the blockchain.
By determining the build credentials and their build evaluation values, the build credentials are allocated to the corresponding builder according to the disposable value and build evaluation values of each builder. The builder constructs the blocks to be built in the corresponding build time slot to ensure that the incentives for each block are consistent.
It improves the stability of building blocks and improves the overall stability and security of the blockchain.
Smart Images

Figure CN119938639A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of blockchain technology, and in particular, relates to a block construction method, apparatus, terminal device and computer program product. Background Art
[0002] Blockchain is a distributed ledger that combines data blocks into a specific data structure in the form of a chain. It is used to store data and has the characteristics of decentralization and immutability, which ensures the authenticity and security of the data. It is widely used in the financial field and the Internet of Things field.
[0003] Currently, in the blockchain, proposers can propose building blocks and build them. Verifiers verify the blocks built by proposers and broadcast them when the verification is passed. Proposers can outsource the right to build blocks, and each node in the blockchain can compete with each other to obtain the right to build blocks.
[0004] However, since the data stored in each block is different, the value of each block is also different, which in turn leads to different incentives for building each block, thus affecting the stability of the building blocks and reducing the overall stability and security of the blockchain. Summary of the invention
[0005] The embodiments of the present application provide a block construction method, apparatus, terminal device and computer program product, which aim to solve the problem in the existing blockchain that the stability of the construction blocks is reduced due to different incentives of the blocks, thereby reducing the stability and security of the blockchain as a whole.
[0006] In a first aspect, an embodiment of the present application provides a block construction method, the method comprising:
[0007] Determine at least one construction credential, and determine a construction evaluation value of each construction credential; wherein the construction credential is a credential of a construction block, the number of the construction credentials is related to the number of blocks to be constructed in a construction cycle, and the construction evaluation value is related to the value evaluation value of each block in a historical construction cycle;
[0008] Allocate each of the construction vouchers to the corresponding builder according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction voucher; wherein the disposable value is the evaluation value of the resources used by the builder to construct the block;
[0009] The builder builds the block to be built in a building time slot corresponding to the building voucher.
[0010] In a possible implementation manner of the first aspect, determining the build evaluation value of each build credential includes:
[0011] Determine an average block value of at least one of the historical construction periods; wherein the average block value is an average value of the value assessment values of all the blocks in the historical construction period;
[0012] The construction evaluation value of each construction voucher is determined according to the average block value and the dynamic coefficient; wherein the dynamic coefficient is determined based on the proportional relationship between the average block values between any two of the historical construction cycles.
[0013] In a possible implementation manner of the first aspect, determining at least one build credential includes:
[0014] Determine the number of blocks to be constructed in the current construction cycle;
[0015] Based on the number of the blocks to be constructed, at least one construction voucher is generated; wherein the number of the construction vouchers is less than or equal to the number of the blocks to be constructed.
[0016] In a possible implementation of the first aspect, allocating each of the construction vouchers to the corresponding builder according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction voucher includes:
[0017] Determine the disposable value of each builder for the construction voucher in the blockchain; wherein the builder has different disposable values corresponding to different construction vouchers;
[0018] A target builder is selected from all the builders according to the disposable value of each builder and the building evaluation value of the building voucher, and the building voucher is allocated to the target builder.
[0019] In a possible implementation manner of the first aspect, before the builder builds the block to be built in the build time slot corresponding to the build credential, the method further includes:
[0020] Allocate any one construction time slot for each of the construction vouchers; wherein the construction time slot is a time period for constructing each of the blocks to be constructed in the construction cycle, and different blocks to be constructed correspond to different construction time slots;
[0021] The builder constructs the block to be constructed in the construction time slot corresponding to the construction credential, including:
[0022] Determine a target build time slot that matches the current time slot;
[0023] When the construction voucher corresponding to the target construction time slot is allocated to the target builder, the target builder constructs the block to be constructed in the target construction time slot.
[0024] In a possible implementation manner of the first aspect above, the method further includes:
[0025] When the construction voucher corresponding to the target construction time slot is not allocated to any of the builders, the target proposer constructs the block to be constructed in the target construction time slot;
[0026] The target proposer is a proposer that proposes a target block among all the proposers, and the target block is a block to be constructed that is constructed in the target construction time slot among all the blocks to be constructed.
[0027] In a possible implementation manner of the first aspect above, the method further includes:
[0028] The builder broadcasts the construction credential to the proposer corresponding to the block to be constructed, so as to add the block to be constructed to the blockchain;
[0029] The proposer is used to broadcast the construction credential to each verifier in the blockchain; the verifier is used to verify whether the builder of the block to be constructed has the corresponding construction credential, and is used to add the block to be constructed to the blockchain if the builder of the block to be constructed holds the corresponding construction credential.
[0030] In a second aspect, an embodiment of the present application provides a block construction device, the device comprising:
[0031] A determination module, configured to determine at least one construction credential and determine a construction evaluation value of each construction credential; wherein the construction credential is a credential of a construction block, the number of the construction credentials is related to the number of blocks to be constructed in a construction cycle, and the construction evaluation value is related to the value evaluation value of each block in a historical construction cycle;
[0032] An allocation module, configured to allocate each of the construction vouchers to a corresponding builder according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction voucher; wherein the disposable value is the evaluation value of the resources used by the builder to construct the block;
[0033] A construction module is configured to construct the block to be constructed in a construction time slot corresponding to the construction voucher by the builder.
[0034] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the block construction method provided in the first aspect above is implemented.
[0035] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is run on a computer, the computer executes the block construction method provided in the first aspect.
[0036] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the block construction method provided in the first aspect above is implemented.
[0037] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0038] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0039] In an embodiment of the present application, by determining at least one construction credential and determining the construction evaluation value of each construction credential, the construction credential is the credential of the construction block, the number of construction credentials is related to the number of blocks to be constructed in the construction cycle, and the construction evaluation value is related to the value evaluation value of each block in the historical construction cycle, and then according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction credential, each construction credential is allocated to the corresponding builder, and the builder constructs the block to be constructed in the construction time slot corresponding to the construction credential. The value evaluation value of the block in the historical construction cycle can be used as an incentive for constructing the block, and each builder is allocated a construction credential for constructing the block to be constructed, so that the builder has the same incentive to construct each block, thereby improving the stability of the construction block, as well as the overall stability and security of the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a flowchart of a block construction method provided by an embodiment of the present application;
[0041] Figure 2 It is a schematic diagram of a competitive construction credential provided by an embodiment of the present application;
[0042] Figure 3 It is a schematic diagram of allocating disposable value provided by an embodiment of the present application;
[0043] Figure 4 is a flowchart of another block construction method provided by an embodiment of the present application;
[0044] Figure 5 It is a structural schematic diagram of a block construction device provided by an embodiment of the present application;
[0045] Figure 6 It is a structural block diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] Blockchain is a distributed ledger that combines data blocks into a specific data structure in a chain manner, which is used to store data. Specifically, the blockchain is composed of a data layer, a network layer, and a consensus layer. Among them, the data layer includes at least one block, and the data layer can store information in the blockchain through each block. The network layer can be a point-to-point network composed of at least one node. Each node in the network layer can be used to create blocks, store the created blocks, and broadcast the created blocks to other nodes in the blockchain, so that each node can store the blocks created by itself and the blocks created by other nodes. In addition, the node can also verify the validity and legitimacy of the information stored in the block, so that the block can be added to the blockchain when the block passes the verification. The consensus layer can encapsulate various consensus algorithms, and through the consensus algorithm, the information stored in each block between each node is consistent, so as to ensure the consistency of data of each node in the blockchain and ensure the security and credibility of the information in the blockchain.
[0048] Currently, the role of each node in the blockchain is different, including verification nodes used to verify the legitimacy of newly created blocks, proposal nodes used to propose the creation of blocks according to customer needs or according to predetermined network rules, and construction nodes used to build blocks.
[0049] Specifically, the proposer, i.e. the proposing node, can propose a building block and build a block as a builder, i.e. as a building node. Then the verifier, i.e. the verifying node, can verify the block built by the builder and broadcast the block to add it to the blockchain when the verification passes. In actual situations, the proposing node can not only propose building blocks as a proposing node, but also build new blocks as a building node.
[0050] In practical applications, building blocks requires a lot of time and resources. In order to reduce their own operating costs and risks, the proposer can distribute the right to build blocks to other nodes in the blockchain, so that other nodes can build blocks without the proposer having to build blocks, and after successful creation.
[0051] At present, for the stability and security of blockchain, more nodes need to be incentivized to participate in the construction of blocks. Nodes can be incentivized by increasing additional storage space, computing resources, network bandwidth or rewarding digital currency, that is, nodes obtain corresponding incentives when they successfully create blocks. However, since the data stored in each block is different, the value of each block is also different, which in turn leads to different incentives for building each block, making more nodes tend to build blocks with high value or high incentives, while blocks with low value or low incentives are difficult to be successfully built, thus affecting the stability of building blocks and reducing the overall stability and security of blockchain.
[0052] Based on this, an embodiment of the present application provides a block construction method, by determining at least one construction credential and determining the construction evaluation value of each construction credential, the construction credential is the credential of the construction block, the number of construction credentials is related to the number of blocks to be constructed in the construction cycle, and the construction evaluation value is related to the value evaluation value of each block in the historical construction cycle, and then according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction credential, each construction credential is assigned to the corresponding builder, and the builder constructs the block to be constructed in the construction time slot corresponding to the construction credential, and the value evaluation value of the block in the historical construction cycle can be used as an incentive for constructing the block, and each builder is assigned a construction credential for constructing the block to be constructed, so that the builder has the same incentive to construct each block, thereby improving the stability of the construction block, as well as improving the overall stability and security of the blockchain.
[0053] See also Figure 1 , Figure 1 A flowchart of a block construction method provided by an embodiment of the present application is shown, which may specifically include the following steps:
[0054] Step 101 : determining at least one build credential and determining a build evaluation value of each build credential.
[0055] The construction voucher may be a voucher for a construction block, the number of construction vouchers may be related to the number of blocks to be constructed in a construction cycle, and the blocks to be constructed may be blocks that need to be constructed in a construction cycle. The construction evaluation value may be related to the value evaluation value of each block in a historical construction cycle, and the value evaluation value of a block may be a value for evaluating the value of data stored in the block. The historical construction cycle may be one of the construction cycles in the past period of time, and the construction cycle may be a cycle for building blocks.
[0056] In a specific implementation, the construction cycle of the construction blocks can be defined, and the number of blocks that need to be created in the construction cycle can be defined. Then, before the start of the current construction cycle, the corresponding number of construction vouchers can be determined based on the pre-defined number of blocks that need to be created, and the value assessment values of all blocks in one of the construction cycles in the past period of time can be obtained. Then, the construction assessment value of each construction voucher can be determined based on the value assessment values of all blocks in one of the construction cycles in the past period of time.
[0057] It needs to be understood that since there are multiple proposers and builders in the blockchain, multiple blocks will be constructed, and each new construction needs to be added to the blockchain after verification. Therefore, each newly constructed block needs to be verified and broadcast, which results in a large workload. In addition, a large number of blocks need to be processed at a certain moment, but no blocks need to be processed at another moment. This leads to uneven distribution of computing resources and network resources, and poor stability of block construction.
[0058] Based on this, a fixed time period can be defined as the time period for building blocks, that is, the construction cycle of building blocks and the number of blocks that need to be created in the fixed time period can be defined. Then, the blocks can be built and verified in sequence within the corresponding construction cycle, and the newly created blocks can be added to the blockchain in batches at fixed time intervals, so that the blockchain can perform operations such as block construction, verification and broadcasting in a periodic manner, which improves the stability of building blocks in the blockchain and improves the utilization rate of computing resources and network resources.
[0059] In an embodiment of the present application, determining the construction evaluation value of each construction credential in step 101 may include the following steps:
[0060] An average block value of at least one historical construction cycle is determined, and a construction assessment value of each construction voucher is determined based on the average block value and a dynamic coefficient.
[0061] The average block value may be the average of the value assessment values of all blocks in the historical construction cycle, and the dynamic coefficient may be determined based on the proportional relationship between the average block values between any two historical construction cycles.
[0062] In practical applications, the value assessment values of all blocks in one of the construction cycles in the past period of time can be obtained, that is, the value assessment values of each block in at least one historical construction cycle are obtained, and the average value assessment values of all blocks in each historical construction cycle is calculated, that is, the average block value of each historical construction cycle is calculated, and the average value assessment values of all blocks in all historical construction cycles are calculated, that is, the average block value of each block in all historical construction cycles is calculated, and then based on the average block value of each historical construction cycle, the proportional relationship between the average block values between any two historical construction cycles can be calculated, and the dynamic coefficient can be determined based on the proportional relationship, so as to determine the construction assessment value of each construction credential according to the average block value of each block in all historical construction cycles and the dynamic coefficient.
[0063] Exemplarily, the past period may include historical construction cycle A, which may include block 1 and block 2, the value assessment value of block 1 may be 5, and the value assessment value of block 2 may be 15, then the average block value of historical construction cycle A may be calculated to be 10. Another exemplary example, the past period may include historical construction cycle A and historical construction cycle B, wherein the average block value of historical construction cycle A is 10, and the average block value of historical construction cycle B is 20, and historical construction cycle A may include 2 blocks, and historical construction cycle B may include 3 blocks, then the average value assessment value of all blocks in all historical construction cycles may be calculated to be 16, and the ratio relationship between the average block value of historical construction cycle A and historical construction cycle B may be calculated to be 1:2, and then based on the ratio relationship and the average value assessment value of all blocks in all historical construction cycles, the construction assessment value may be determined to be 8, that is, the construction assessment value of each construction voucher.
[0064] In an embodiment of the present application, determining at least one construction credential in step 101 may include the following steps:
[0065] The number of blocks to be constructed in the current construction cycle is determined, and at least one construction credential is generated based on the number of blocks to be constructed.
[0066] The number of construction vouchers is less than or equal to the number of blocks to be constructed.
[0067] In a specific implementation, since the number of blocks that need to be created in a construction cycle can be pre-defined, the number of blocks that need to be created in the current construction cycle can be determined before the current construction cycle starts, that is, the number of blocks to be built in the current construction cycle is determined, and based on the current construction cycle, at least one construction credential is generated, and each construction credential can correspond to a block to be built, and the number of construction credentials can be less than or equal to the number of blocks to be built.
[0068] Step 102 , allocating each construction voucher to a corresponding builder according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction voucher.
[0069] The disposable value may be the assessed value of the resources used by the builder to build the block.
[0070] After obtaining the construction voucher and its construction evaluation value, the disposable value of each builder can be determined.
[0071] It is important to understand that since the construction of blocks requires a lot of time and resources, in order to increase the success rate of building blocks, it is necessary to determine the resources that can be used by builders to build blocks and calculate the assessed value of the resources used by each builder to build blocks, that is, to calculate the disposable value of each builder.
[0072] After obtaining the disposable value of each builder, each construction voucher can be allocated to the corresponding builder according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction voucher, that is, allocated to the builder who can successfully build the block to be built.
[0073] In actual applications, due to the operating environment, operating algorithm, geographical location and machine configuration of each builder, the resources that can be used to build blocks by each builder are also different. For example, computing power, network bandwidth, storage space, digital currency and other resources are also different. Then, by calculating the disposable value of each builder and matching the disposable value of each builder with the construction evaluation value of the construction voucher, the construction voucher can be assigned to the matching builder, that is, the construction voucher is assigned to the builder whose disposable value is greater than or equal to the construction evaluation value of the construction voucher, thereby increasing the probability of building blocks and improving the stability of building blocks.
[0074] In the specific implementation, since the successful construction of a block will reward the builder with corresponding resources, it will encourage more builders to build blocks and improve the stability of the blockchain. In turn, each builder will be incentivized to build blocks and compete for each construction credential in the hope of being allocated a construction credential and building a block based on the construction credential.
[0075] Specifically, for each build voucher, at least one builder currently competing for the build voucher can be determined, and the disposable value of each builder for building blocks can be determined, so that the builder with the highest disposable value that is greater than or equal to the build assessment value of the build voucher can be determined from each builder, and the build voucher can be allocated to the builder.
[0076] In one embodiment of the present application, the disposable value of each builder can be represented by digital currency, that is, the builder can obtain the corresponding digital currency by renting computing power, storage space or network bandwidth, and then the disposable value of each builder can be represented by digital currency, wherein the digital currency can be a currency in digital form issued based on blockchain technology, such as digital RMB, digital US dollar and other legal currencies, and this application does not impose any restrictions here.
[0077] See also Figure 2 , Figure 2 A schematic diagram of a competitive construction credential provided by an embodiment of the present application is shown. Figure 2 As shown, construction voucher 1 can be competed by 3 builders, and the construction evaluation value of construction voucher 1 is 101. Among them, the disposable value of builder A is 100 digital currencies, the disposable value of builder B is 101 digital currencies, and the disposable value of builder C is 103 digital currencies. It can be determined that builder C is the builder with the highest disposable value among all builders and greater than or equal to the construction evaluation value of the construction voucher, and construction voucher 1 is allocated to builder C.
[0078] Step 103 : The builder builds the block to be built in the building time slot corresponding to the building credential.
[0079] The construction time slot may be a specific time for constructing the block to be constructed. The construction cycle may include at least one construction time slot, and each construction time slot may correspond to one of the blocks to be constructed.
[0080] After each build credential is assigned to the corresponding builder, each builder can determine the build slot corresponding to the build credential, that is, determine the specific time in the current build cycle when the builder is allowed to build the block, and then when the current time is the build slot corresponding to the build credential, the corresponding builder builds the block to be built.
[0081] In one embodiment of the present application, each builder can compete for a construction credential based on disposable value, and when successfully competing for the construction credential, pay the disposable value proposed by the builder during the competition. The blockchain can then obtain and store the disposable value paid by the builder when competing for each construction credential, and after the construction cycle ends, the disposable value obtained in the construction cycle can be evenly distributed to all proposers who proposed blocks in the construction cycle.
[0082] Exemplarily, a construction cycle may include two blocks to be constructed, namely, block A and block B, and then a corresponding number of construction vouchers may be generated based on the number of blocks to be constructed in the construction cycle, that is, two construction vouchers are generated, wherein construction voucher a may be a construction voucher corresponding to block A, and construction voucher b may be a construction voucher corresponding to block B. Builder A in the blockchain may propose to pay 10 digital currencies to compete for construction voucher a, and pay 10 digital currencies when successfully competing for construction voucher a, while builder B in the blockchain may propose to pay 20 digital currencies to compete for construction voucher b, and pay 20 digital currencies when successfully competing for construction voucher b, and then the disposable value of 30 digital currencies obtained in the construction cycle may be evenly distributed to all proposers who proposed blocks in the construction cycle.
[0083] It should be understood that since the data stored in each block is different, the value of each block is also different, and each proposer can distribute the block he proposed to other nodes for construction and obtain corresponding digital currency benefits. The benefits that can be obtained from blocks with lower values are also relatively low, which will lead to the proposer's incentive to propose blocks with lower values being lower than the incentive to propose blocks with higher values, thereby reducing the stability of the proposer's proposed blocks, as well as the overall stability and security of the blockchain. Based on this, by evenly distributing the disposable value obtained in each construction cycle to all proposers who proposed blocks in the construction cycle, it can ensure that the proposer's incentives for proposing each block are basically the same, reducing the situation where the incentives for proposing blocks with lower values are lower than the incentives for proposing blocks with higher values, thereby improving the stability of the proposer's proposed blocks, as well as the overall stability and security of the blockchain.
[0084] See also Figure 3 , Figure 3 A schematic diagram of distributing disposable value provided by an embodiment of the present application is shown as follows: Figure 3 As shown, Figure 3 It shows that 32 blocks to be built need to be built in one construction cycle, and each block to be built can correspond to one construction time slot, that is, the construction cycle includes 32 construction time slots, and each block to be built is proposed by 32 proposers, and then a construction voucher corresponding to the number of blocks to be built can be generated, that is, 32 construction vouchers are generated. For the 32 construction time slots, builder A competes for 12 construction vouchers with an average of 51 digital currencies, builder B competes for 10 construction vouchers with an average of 50 digital currencies, and builder C competes for 10 construction vouchers with an average of 52 digital currencies. Based on this, the digital currency obtained in the construction cycle can be evenly distributed to each proposer, that is, each proposer obtains 51 digital currencies.
[0085] In an embodiment of the present application, the following steps may also be included:
[0086] The builder broadcasts the construction certificate to the proposer corresponding to the block to be built, so that the block to be built can be added to the blockchain.
[0087] Among them, the proposer can be used to broadcast the construction credentials to each verifier in the blockchain, and the verifier can be used to verify whether the builder of the block to be built has the corresponding construction credentials, and to add the block to be built to the blockchain when the builder of the block to be built holds the corresponding construction credentials.
[0088] After the builder constructs the block to be constructed, the builder can broadcast the construction credential to the proposer corresponding to the block to be constructed, and broadcast the constructed block to be constructed to the corresponding proposer, that is, broadcast to the proposer who proposed the block to be constructed, and then the proposer can broadcast the received construction credential and the block to be constructed to each verifier in the blockchain, and each verifier can verify the legitimacy of the currently constructed block to be constructed, and verify whether the builder who constructed the block to be constructed has the corresponding construction credential, so that the block to be constructed can be added to the blockchain if the builder of the block to be constructed holds the corresponding construction credential and the currently constructed block to be constructed passes the legitimacy verification.
[0089] In an embodiment of the present application, by determining at least one construction credential and determining the construction evaluation value of each construction credential, the construction credential is the credential of the construction block, the number of construction credentials is related to the number of blocks to be constructed in the construction cycle, and the construction evaluation value is related to the value evaluation value of each block in the historical construction cycle, and then according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction credential, each construction credential is allocated to the corresponding builder, and the builder constructs the block to be constructed in the construction time slot corresponding to the construction credential. The value evaluation value of the block in the historical construction cycle can be used as an incentive for constructing the block, and each builder is allocated a construction credential for constructing the block to be constructed, so that the builder has the same incentive to construct each block, thereby improving the stability of the construction block, as well as the overall stability and security of the blockchain.
[0090] See also Figure 4 , Figure 4 A flowchart of another block construction method provided by an embodiment of the present application is shown, which may specifically include the following steps:
[0091] Step 401 : determining at least one build credential and determining a build evaluation value of each build credential.
[0092] For the relevant description of step 401, please refer to step 101 and will not be repeated here.
[0093] Step 402, determining the disposable value of each builder for the construction voucher in the blockchain.
[0094] Among them, the builder has different disposable values corresponding to different construction credentials.
[0095] In practical applications, for each build voucher, the resources that each builder can control for the build voucher can be calculated, that is, the disposable value of each builder for the build voucher can be determined.
[0096] It is necessary to understand that different builders will have different disposable values, and the same builder will have different disposable values at different times. For example, after a builder is assigned a construction voucher at a previous moment, his disposable value will decrease, and thus the disposable value of the builder at the current moment is less than the disposable value at the previous moment.
[0097] In a specific implementation, the disposable value of each builder for each build voucher can be determined in sequence. For example, for the first build voucher, the disposable value of each builder for the first build voucher can be determined, and after the first build voucher is allocated to the corresponding builder, the disposable value of each builder for the second build voucher can be determined, and so on, the disposable value of each builder for the build voucher can be determined.
[0098] Specifically, for each construction credential, the resources used by the builder to build blocks at the current moment can be evaluated, that is, the computing power, storage space, network bandwidth, digital currency and other resources used by the builder to build blocks can be evaluated to obtain the disposable value of each builder at the current moment.
[0099] Step 403 , according to the disposable value of each builder and the construction evaluation value of the construction voucher, a target builder is selected from all builders, and the construction voucher is allocated to the target builder.
[0100] The target builder may be the builder with the highest disposable value among all builders.
[0101] After obtaining the disposable value of each builder for the build voucher, the builder with the highest disposable value that is greater than or equal to the build evaluation value of the build voucher can be determined from each builder as the target builder, and the build voucher can be assigned to the target builder, and then each build voucher can be assigned to the corresponding builder.
[0102] Step 404 : The target builder builds the block to be built in the building time slot corresponding to the building credential.
[0103] After each build credential is assigned to the corresponding target builder, the build time slot corresponding to each build credential can be determined, and then the build time slot matching the current moment can be determined, as well as the build credential corresponding to the current moment can be determined, and then the target builder assigned the build credential can build the block to be built at the current moment.
[0104] In an embodiment of the present application, before step 404, the following steps may also be included:
[0105] Assign an arbitrary build time slot to each build credential.
[0106] The construction time slot may be a time period during which each block to be constructed is constructed in a construction cycle, and different blocks to be constructed correspond to different construction time slots.
[0107] After each build voucher is assigned to a corresponding builder, any build time slot can be assigned to each build voucher, and different build vouchers correspond to different build time slots, that is, different build vouchers correspond to different blocks to be built.
[0108] Exemplarily, the number of blocks that need to be created in the construction cycle can be defined as 3, and each block is constructed in different time slots of the same construction cycle, that is, the construction cycle can include construction time slots of 3 blocks, and different blocks can correspond to different construction time slots. After determining the number of blocks that need to be created in the construction cycle, the corresponding number of construction vouchers can be determined based on the number of blocks that need to be created, that is, 3 construction vouchers can be generated, and then each construction voucher can be assigned to the corresponding builder based on the disposable value of each builder in the blockchain and the construction evaluation value of the construction voucher, that is, the generated 3 construction vouchers are respectively assigned to the corresponding builders. For example, the first construction voucher can be assigned to builder A in the blockchain, the second construction voucher can be assigned to the second builder B, and so on, and then each construction voucher can be assigned to the corresponding builder. After each construction voucher is assigned to the corresponding builder, any construction time slot can be assigned to each construction voucher, such as assigning construction time slot 1 in the construction cycle to the first construction voucher, assigning construction time slot 2 in the construction cycle to the second construction voucher, and so on.
[0109] After each build credential is assigned to any build time slot, the build time slot corresponding to the current moment can be determined, and the build credential corresponding to the current build time slot can be determined, that is, the block to be built for block construction in the current build time slot can be determined, and the build credential representing the construction of the block to be built can be determined, as well as the builder holding the build credential, so that the block to be built can be built by the builder.
[0110] In an embodiment of the present application, step 404 may include steps 4041 to 4042:
[0111] Step 4041, determine a target construction time slot that matches the current time slot.
[0112] The target construction time slot may be a construction time slot in the construction cycle that matches the current time.
[0113] After each build voucher is assigned to any build time slot and each build voucher is assigned to a corresponding builder, a target build time slot corresponding to the current time may be determined.
[0114] For example, the current build cycle may be a time period with a start time of 9:00 and an end time of 9:10, and the current build cycle may include 5 build time slots, i.e., each build time slot is 2 minutes long, the first build time slot may be a time period from 9:00:01 to 9:02:00, the second build time slot may be a time period from 9:02:01 to 9:04:00, and so on. When the current time is 9:02:01, the build time slot that matches the current time may be determined to be the second build time slot, i.e., the build time slot at the current time is determined to be the target build time slot.
[0115] Step 4042: When the construction voucher corresponding to the target construction time slot is allocated to the target builder, the target builder constructs the block to be constructed in the target construction time slot.
[0116] After determining the target build time slot, it may be determined whether the build credential corresponding to the target build time slot has been allocated to a corresponding builder.
[0117] It should be understood that since the disposable value of each builder is different at each moment, there will be a situation where the disposable value of each builder is less than the construction evaluation value of the construction voucher at a certain moment, and the construction voucher will not be allocated to any builder in the blockchain. Therefore, it is necessary to determine whether the construction voucher corresponding to the target construction time slot has been allocated to the corresponding builder.
[0118] When the build credentials corresponding to the target build slot are allocated to the corresponding builder, that is, when the build credentials corresponding to the target build slot are allocated to the target builder, the target builder can build the block to be built in the target build slot.
[0119] In an embodiment of the present application, the following steps may also be included:
[0120] When the construction voucher corresponding to the target construction slot is not assigned to any builder, the target proposer builds the block to be built in the target construction slot.
[0121] The target proposer may be a proposer who proposes the target block among all proposers, and the target block may be a block to be constructed in a target construction time slot among all blocks to be constructed.
[0122] When the construction voucher corresponding to the target construction slot is not assigned to any builder, there is no corresponding builder to build the block to be built corresponding to the target construction slot, and the target proposer who proposes the block to be built needs to build it, that is, the target proposer builds the block to be built in the target construction slot.
[0123] In one embodiment of the present application, the blockchain may also store the digital currency income of the target proposer for constructing the block to be constructed, and evenly distribute the disposable value obtained in the construction cycle and the digital currency income of the target proposer for constructing the block to be constructed to all proposers who proposed the block in the construction cycle.
[0124] It is important to understand that since successful block construction can obtain corresponding incentives, that is, digital currency of corresponding value, the proceeds from block construction need to be evenly distributed to other proposers to further ensure that the incentives for proposers to propose each block are basically the same, reducing the situation where the incentives for proposing blocks with lower values are lower than those for proposing blocks with higher values, thereby further improving the stability of proposers proposing blocks and improving the overall stability and security of the blockchain.
[0125] In an embodiment of the present application, by determining at least one construction credential and determining a construction evaluation value of each construction credential, the construction credential is a credential for a construction block, the number of construction credentials is related to the number of blocks to be constructed in a construction cycle, and the construction evaluation value is related to the value evaluation value of each block in a historical construction cycle, thereby determining the disposable value of each builder in the blockchain for the construction credential, and selecting a target builder from all builders based on the disposable value of each builder and the construction evaluation value of the construction credential to assign the construction credential to the target builder, and the builder constructs the block to be constructed in the construction time slot corresponding to the construction credential, so that the value evaluation value of the block in the historical construction cycle can be used as an incentive for constructing the block, and each builder is assigned a construction credential for constructing the block to be constructed, so that the builder has the same incentive to construct each block, thereby improving the stability of the construction block, as well as improving the overall stability and security of the blockchain.
[0126] Reference Figure 5 , Figure 5 A schematic diagram of the structure of a block construction device provided by an embodiment of the present application is shown, which may specifically include the following modules:
[0127] Determination module 501 is used to determine at least one construction credential and determine the construction evaluation value of each construction credential; wherein the construction credential is the credential of the construction block, the number of construction credentials is related to the number of blocks to be constructed in the construction cycle, and the construction evaluation value is related to the value evaluation value of each block in the historical construction cycle.
[0128] The allocation module 502 is used to allocate each construction voucher to the corresponding builder according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction voucher; wherein the disposable value is the evaluation value of the resources used by the builder to build the block.
[0129] The construction module 503 is a block to be constructed by the builder in the construction time slot corresponding to the construction credential.
[0130] In one implementation, the determination module 501 may be specifically used to:
[0131] Determine an average block value for at least one historical build cycle; wherein the average block value is an average of the value assessment values of all blocks in the historical build cycle;
[0132] The construction evaluation value of each construction voucher is determined based on the average block value and the dynamic coefficient; wherein the dynamic coefficient is determined based on the proportional relationship between the average block value between any two historical construction cycles.
[0133] In one implementation, the determination module 501 may be specifically used to:
[0134] Determine the number of blocks to be built in the current build cycle;
[0135] At least one construction voucher is generated based on the number of blocks to be constructed; wherein the number of construction vouchers is less than or equal to the number of blocks to be constructed.
[0136] In one implementation, the allocation module 502 may be specifically used to:
[0137] Determine the disposable value of each builder for the construction voucher in the blockchain; wherein the builder has different disposable values for different construction vouchers;
[0138] A target builder is selected from all builders according to the disposable value of each builder and the building evaluation value of the building voucher, and the building voucher is allocated to the target builder.
[0139] In one implementation, the allocation module 502 may also be used to allocate any one construction time slot to each construction voucher before the builder constructs the block to be constructed in the construction time slot corresponding to the construction voucher; wherein the construction time slot is a time period for constructing each block to be constructed in a construction cycle, and different blocks to be constructed correspond to different construction time slots;
[0140] In one implementation, the building module 503 may be specifically used for:
[0141] Determine a target build time slot that matches the current time slot;
[0142] When the construction voucher corresponding to the target construction time slot is allocated to the target builder, the target builder builds the block to be built in the target construction time slot.
[0143] In one implementation, the building module 503 may also be used to:
[0144] When the construction voucher corresponding to the target construction slot is not assigned to any builder, the target proposer builds the block to be built in the target construction slot.
[0145] The target proposer is the proposer who proposes the target block among all proposers, and the target block is the block to be constructed in the target construction time slot among all blocks to be constructed.
[0146] In one implementation, the device may further include the following modules:
[0147] The broadcast module is used for the builder to broadcast the construction credentials to the proposer corresponding to the block to be built, so as to add the block to be built to the blockchain.
[0148] The proposer is used to broadcast the construction credentials to each verifier in the blockchain; the verifier is used to verify whether the builder of the block to be built has the corresponding construction credentials, and is used to add the block to be built to the blockchain when the builder of the block to be built holds the corresponding construction credentials.
[0149] In an embodiment of the present application, by determining at least one construction credential and determining the construction evaluation value of each construction credential, the construction credential is the credential of the construction block, the number of construction credentials is related to the number of blocks to be constructed in the construction cycle, and the construction evaluation value is related to the value evaluation value of each block in the historical construction cycle, and then according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction credential, each construction credential is allocated to the corresponding builder, and the builder constructs the block to be constructed in the construction time slot corresponding to the construction credential. The value evaluation value of the block in the historical construction cycle can be used as an incentive for constructing the block, and each builder is allocated a construction credential for constructing the block to be constructed, so that the builder has the same incentive to construct each block, thereby improving the stability of the construction block, as well as the overall stability and security of the blockchain.
[0150] It should be noted that the information interaction, execution process and other contents between the above-mentioned devices are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0151] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0152] Reference Figure 6 , Figure 6 A structural block diagram of a terminal device provided by an embodiment of the present application is shown as follows: Figure 6 As shown, an embodiment of the present application also provides a terminal device 61, which includes: at least one processor 611, a memory 612, and a computer program 6121 stored in the memory 612 and executable on the at least one processor 611, and when the processor 611 executes the computer program 6121, the steps in any of the above-mentioned method embodiments are implemented.
[0153] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any one of the above method embodiments can be implemented.
[0154] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0155] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the camera device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium.
[0156] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A block construction method, characterized in that: The method comprises: Determine at least one construction credential, and determine a construction evaluation value of each construction credential; wherein the construction credential is a credential of a construction block, the number of the construction credentials is related to the number of blocks to be constructed in a construction cycle, and the construction evaluation value is related to the value evaluation value of each block in a historical construction cycle; Allocate each of the construction vouchers to the corresponding builder according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction voucher; wherein the disposable value is the evaluation value of the resources used by the builder to build the block; The builder builds the block to be built in a building time slot corresponding to the building voucher.
2. The block construction method according to claim 1, characterized in that: Determining the construction evaluation value of each construction credential includes: Determine an average block value of at least one of the historical construction periods; wherein the average block value is an average value of the value assessment values of all the blocks in the historical construction period; The construction evaluation value of each construction voucher is determined according to the average block value and the dynamic coefficient; wherein the dynamic coefficient is determined based on the proportional relationship between the average block values between any two of the historical construction cycles.
3. The block construction method according to claim 1, characterized in that: The determining of at least one construction credential includes: Determine the number of blocks to be constructed in the current construction cycle; Based on the number of the blocks to be constructed, at least one construction voucher is generated; wherein the number of the construction vouchers is less than or equal to the number of the blocks to be constructed.
4. The block construction method according to any one of claims 1 to 3, characterized in that: The method of allocating each construction voucher to a corresponding builder according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction voucher comprises: Determine the disposable value of each builder for the construction voucher in the blockchain; wherein the builder has different disposable values corresponding to different construction vouchers; A target builder is selected from all the builders according to the disposable value of each builder and the building evaluation value of the building voucher, and the building voucher is allocated to the target builder.
5. The block construction method according to claim 4, characterized in that: Before the builder builds the block to be built in the building time slot corresponding to the building voucher, the method further includes: Allocate any one construction time slot for each of the construction vouchers; wherein the construction time slot is a time period for constructing each of the blocks to be constructed in the construction cycle, and different blocks to be constructed correspond to different construction time slots; The builder constructs the block to be constructed in the construction time slot corresponding to the construction credential, including: Determine a target build time slot that matches the current time slot; When the construction voucher corresponding to the target construction time slot is allocated to the target builder, the target builder constructs the block to be constructed in the target construction time slot.
6. The block construction method according to claim 5, characterized in that: The method further comprises: When the construction voucher corresponding to the target construction time slot is not allocated to any of the builders, the target proposer constructs the block to be constructed in the target construction time slot; The target proposer is a proposer that proposes a target block among all the proposers, and the target block is a block to be constructed that is constructed in the target construction time slot among all the blocks to be constructed.
7. The block construction method according to claim 1, characterized in that: The method further comprises: The builder broadcasts the construction credential to the proposer corresponding to the block to be constructed, so as to add the block to be constructed to the blockchain; The proposer is used to broadcast the construction credential to each verifier in the blockchain; the verifier is used to verify whether the builder of the block to be constructed has the corresponding construction credential, and is used to add the block to be constructed to the blockchain if the builder of the block to be constructed holds the corresponding construction credential.
8. A block construction device, characterized in that: The device comprises: A determination module, configured to determine at least one construction credential and determine a construction evaluation value of each construction credential; wherein the construction credential is a credential of a construction block, the number of the construction credentials is related to the number of blocks to be constructed in a construction cycle, and the construction evaluation value is related to the value evaluation value of each block in a historical construction cycle; An allocation module, configured to allocate each of the construction vouchers to a corresponding builder according to the disposable value of each builder in the blockchain and the construction evaluation value of the construction voucher; wherein the disposable value is the evaluation value of the resources used by the builder to construct the block; A construction module is configured to construct the block to be constructed in a construction time slot corresponding to the construction voucher by the builder.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that: When the computer program is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.