Management method, device and equipment based on block chain and computer readable medium
By deploying configuration contracts on the blockchain, the problem of inconsistency in the configuration information of consensus nodes is solved, and the information unity and security of blockchain nodes is achieved.
Patent Information
- Application Number
- CN202410172447.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2025-08-08
AI Technical Summary
The blockchain configuration information of different consensus nodes is inconsistent, resulting in consensus problems such as frequent switching of proposers and blocking of blocks.
By receiving the deployment request from the requesting party, the blockchain configuration contract is subject to consensus verification, and after the consensus is passed, it is deployed on the blockchain, so that the blockchain nodes can obtain and execute blockchain operation specification information.
Ensure that each blockchain node obtains the same configuration contract, improve information consistency, reduce coordination inconsistency, and enhance the security and decentralized characteristics of the blockchain network.
Smart Images

Figure CN120455273A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and specifically to a blockchain-based management method, apparatus, device, and computer-readable medium. Background Art
[0002] Blockchain configuration information typically includes a series of parameters and settings that affect the operation and behavior of the entire blockchain system. Consensus nodes are nodes that participate in the blockchain consensus algorithm, responsible for verifying the validity of transactions and reaching consensus to maintain consistency across the entire blockchain network.
[0003] Different consensus nodes only maintain their locally stored blockchain configuration information and perform blockchain-related operations based on this information, such as block generation and proposer selection. However, the blockchain configuration information of different consensus nodes may vary, which can lead to consensus issues such as frequent proposer switching and block generation congestion.
[0004] Therefore, how to improve the information uniformity in blockchain nodes is an urgent problem to be solved. Summary of the Invention
[0005] To solve the above technical problems, the embodiments of the present application provide a blockchain-based management method, apparatus, device, and computer-readable storage medium.
[0006] Among them, the technical solutions adopted in this application are:
[0007] A blockchain-based management method, comprising:
[0008] Receive a deployment request for a blockchain configuration contract from a requesting party, wherein the blockchain configuration contract includes blockchain operation specification information, wherein the blockchain operation specification information is a specification followed by blockchain nodes in the blockchain to perform blockchain-related operations;
[0009] Reaching consensus on the blockchain configuration contract based on the deployment request;
[0010] After consensus is passed, the blockchain configuration contract is deployed to the blockchain, so that the blockchain node obtains the blockchain configuration contract from the blockchain, extracts the blockchain operation specification information from the blockchain configuration contract, and performs blockchain-related operations based on the blockchain operation specification information.
[0011] A blockchain-based management method, comprising:
[0012] Obtain the contract address corresponding to the blockchain configuration contract; wherein the contract address is generated after the blockchain configuration contract is successfully deployed on the blockchain;
[0013] Find the blockchain configuration contract that matches the contract address from the blockchain;
[0014] Extracting blockchain operation specification information from the blockchain configuration contract;
[0015] Execute blockchain-related operations based on the blockchain operation specification information.
[0016] A blockchain-based management device, comprising:
[0017] A transceiver unit, configured to receive a deployment request for a blockchain configuration contract sent by a requester, wherein the blockchain configuration contract includes blockchain operation specification information, which is a specification followed by blockchain nodes in the blockchain to perform blockchain-related operations;
[0018] A consensus unit, configured to reach a consensus on the blockchain configuration contract based on the deployment request;
[0019] A processing unit is configured to deploy the blockchain configuration contract to the blockchain after consensus is passed, so that the blockchain node obtains the blockchain configuration contract from the blockchain, extracts the blockchain operation specification information from the blockchain configuration contract, and performs blockchain-related operations based on the blockchain operation specification information.
[0020] In one embodiment of the present application, based on the aforementioned scheme, the deployment request includes the identification information of the requester; the processing unit is further used to extract the identification information of the requester from the deployment request; based on a preset identification and permission mapping relationship, and the identification information, the deployment permission of the requester is verified; if the verification is passed, consensus is reached on the blockchain configuration contract based on the deployment request.
[0021] In one embodiment of the present application, based on the aforementioned scheme, the blockchain operation specification information includes multiple configuration parameter items; the processing unit is further used to extract the multiple configuration parameter items from the blockchain operation specification information; if it is detected that the value of each configuration parameter item is within the standard value range corresponding to each configuration parameter item, the consensus unit reaches a consensus on the blockchain configuration contract based on the deployment request.
[0022] In one embodiment of the present application, based on the aforementioned solution, the processing unit is further used to generate a block to be chained based on the blockchain configuration contract; the acquisition unit is used to obtain response information of the blockchain node in the blockchain for the block to be chained; the processing unit is further used to add the blockchain configuration contract to the blockchain if the number of response information corresponding to the agreement to deploy is greater than or equal to a preset number threshold.
[0023] In one embodiment of the present application, based on the aforementioned solution, after the smart contract is deployed on the blockchain, the acquisition unit is further used to obtain the contract address of the blockchain configuration contract deployed on the blockchain; the transceiver unit is further used to send the contract address to the requester, so that the requester sends the contract address to the blockchain node.
[0024] A blockchain-based management device, comprising:
[0025] An acquisition unit, configured to acquire a contract address corresponding to a blockchain configuration contract; wherein the contract address is generated after the blockchain configuration contract is successfully deployed on the blockchain;
[0026] A processing unit, configured to search the blockchain for a blockchain configuration contract that matches the contract address;
[0027] The processing unit is further configured to extract blockchain operation specification information from the blockchain configuration contract;
[0028] The processing unit is further used to perform blockchain-related operations based on the blockchain operation specification information.
[0029] In one embodiment of the present application, based on the aforementioned scheme, the transceiver unit is used to receive a proposal request for a newly generated block sent by a first proposal node; wherein, the first proposal node is selected from the blockchain nodes based on the blockchain operation normative information; the processing unit is also used to verify the proposal request and send the verification result to the first proposal node through the transceiver unit; if a message is received that the newly generated block has been added to the blockchain, it is determined that the newly generated block has been successfully uploaded to the chain.
[0030] In one embodiment of the present application, based on the aforementioned scheme, the blockchain operation normative information includes a preset empty block timeout; if the transceiver unit does not receive a message that the block to be generated has been added to the blockchain within the preset empty block timeout, a request to replace the proposal node is sent to other blockchain nodes; if the transceiver unit receives identification information sent by a second proposal node, the processing unit stores the identification information sent by the second proposal node; wherein, the second proposal node is selected from the blockchain node based on the request to replace the proposal node.
[0031] In one embodiment of the present application, based on the aforementioned solution, the transceiver unit is further used to receive the contract address corresponding to the blockchain configuration contract sent by the requester; wherein, the contract address is obtained by the requester after the blockchain configuration contract is successfully deployed on the blockchain.
[0032] A blockchain-based management device includes a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the blockchain-based management method described above is implemented.
[0033] A computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor of a computer, causes the computer to execute the above blockchain-based management method.
[0034] A computer program product includes computer-readable instructions, which, when executed by a processor, implement the above blockchain-based management method.
[0035] In the above technical solution:
[0036] Blockchain operational specifications are recorded in the blockchain configuration contract. Upon receiving a deployment request for the blockchain configuration contract from the requesting party, consensus verification of the blockchain configuration contract is performed based on the request. Once consensus is reached, the blockchain configuration contract is successfully deployed to the blockchain. Once deployment is complete, blockchain nodes can retrieve the configuration contract from the blockchain and extract the blockchain operational specifications. This ensures that each blockchain node can retrieve the same configuration contract from the blockchain, ensuring information consistency across the blockchain nodes and enabling each blockchain node to execute blockchain-related operations according to the same rules.
[0037] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, serving to explain the principles of the present application. It is obvious that the drawings described below are merely some embodiments of the present application, and a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0039] Figure 1 It is a schematic diagram of an implementation environment involved in this application;
[0040] Figure 2 is a schematic diagram of multiple consensus nodes within a generation involved in an embodiment of the present application;
[0041] Figure 3 This is an optional schematic diagram of the block structure involved in the embodiment of the present application;
[0042] Figure 4 is a flowchart of a blockchain-based management method according to an exemplary embodiment;
[0043] Figure 5 is a flowchart of a blockchain-based management method according to another exemplary embodiment;
[0044] Figure 6 is a flowchart of a blockchain-based management method according to another exemplary embodiment;
[0045] Figure 7 is a flowchart of a blockchain-based management method according to another exemplary embodiment;
[0046] Figure 8 is a flowchart of a blockchain-based management method according to another exemplary embodiment;
[0047] Figure 9 is a flowchart of a blockchain-based management method according to another exemplary embodiment;
[0048] Figure 10 is a flowchart of a blockchain-based management method according to another exemplary embodiment;
[0049] Figure 11 is a block diagram of a blockchain-based management device according to an exemplary embodiment;
[0050] Figure 12 The present invention is a structural diagram of a computer system of a blockchain-based management device according to an exemplary embodiment. DETAILED DESCRIPTION
[0051] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments applicable to the present application. Rather, they are merely examples of apparatus and methods applicable to certain aspects of the present application, as detailed in the appended claims.
[0052] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0053] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be integrated or partially integrated. Therefore, the actual execution order may vary depending on the actual situation.
[0054] It should be noted that the term "plurality" used in this application refers to two or more. "And / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0055] It should be noted that in the specific implementation of this application, when user-related data is involved, when the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. At the same time, the formulas involved in the embodiments of this application can be flexibly adjusted, such as adding or reducing corresponding parameters.
[0056] Before introducing the technical solutions of the embodiments of the present application, the technical terms involved in the embodiments of the present application are first introduced here.
[0057] Blockchain is a new application model for computer technologies, including distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a series of data blocks linked using cryptographic methods. Each block contains information about a batch of online transactions, used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product and service layer, and the application service layer.
[0058] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operational testing. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the corresponding relationship between the user's real identity and the blockchain address (authority management), etc., and under authorization, it supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first adapts the interface for parsing and authentication (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration, issuance, triggering and execution of contracts. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the contract logic is triggered by calling keys or other events to trigger execution. The contract logic is completed, and the contract upgrade and cancellation functions are also provided. The operation detection module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarms, network status detection, node device health status detection, etc.
[0059] A smart contract is a computer program that runs on a blockchain. Its hallmark is that it can automatically execute contract terms and verify their results, thereby achieving decentralized trust and enforcement. Smart contracts are commonly used to write and execute a series of fully automated operations, such as currency transactions, digital identity verification, asset management, and voting. Smart contracts operate on blockchain technology and can be controlled by multiple participants without the need for a single authority or middleman. This decentralized nature makes smart contracts a powerful solution for conducting transactions and executing business logic without the need for trusted third parties. Smart contracts enable all parties to reach consensus on a blockchain network, eliminating the need for intermediaries to verify and enforce the contract. The smart contract's code logic and execution results are recorded on the blockchain, ensuring transparency and immutability of transactions.
[0060] A virtual machine (VM) is a software or hardware entity that simulates the running of another complete operating system on a computer. It allows the creation and running of multiple virtual, independent operating system instances on a host operating system. Each instance is called a virtual machine. In the embodiment of this application, each time a node creates a smart contract, it will create a corresponding virtual machine to store information related to the smart contract, such as the address, the storage location of the contract code, and other metadata.
[0061] Blockchain operational specifications, also known as chain configuration information, refer to a set of information used to configure and regulate the behavior of blockchain nodes. These specifications include a series of parameters and settings that influence the operation and behavior of nodes across the entire blockchain system. The specific blockchain operational specifications vary depending on the blockchain platform, application scenario, and design choices, but typically include consensus algorithm configuration, network parameters, blockchain storage configuration, transaction parameters, smart contract configuration, on-chain governance parameters, security parameters, on-chain resource limits, and system maintenance parameters. The definition and management of these operational specifications are crucial to ensuring the stable operation and consistency of the entire blockchain network. Based on specific application scenarios and design requirements, these operational specifications can be adjusted during blockchain deployment and operation.
[0062] In this embodiment of the present application, the blockchain operation specification information may include two configuration items:
[0063] One is the configuration item that affects the consensus process: empty block time: specifies the maximum time interval between two blocks; number of generation transition blocks: determines the number of blocks that need to be generated when a generation is replaced; number of consecutive blocks generated by a node: stipulates the number of blocks that a node can generate continuously; fuel fee (Gas) limit: sets the upper limit of Gas that can be used in each block.
[0064] The second is the configuration items that require nodes to maintain a high degree of consistency: transaction polling timeout: defines the maximum waiting time when making a transaction; maximum number of transactions in a block: stipulates the maximum number of transactions included in each block; use optimization proposals: specifies whether to enable optimization proposals to improve blockchain system performance.
[0065] A blockchain node is a participant in a blockchain network, responsible for maintaining, verifying, and disseminating blockchain data. Blockchain nodes can be categorized as full nodes and light nodes. Full nodes maintain a copy of the entire blockchain and can verify and store all transactions. Light nodes, on the other hand, do not store the entire blockchain but focus solely on their own data, relying on other nodes to provide missing information.
[0066] Consensus nodes are nodes that participate in the consensus algorithm in a blockchain, responsible for validating transactions and collectively determining the blockchain's state. Consensus nodes have different roles in different consensus algorithms. For example, in Proof of Stake (PoS), they may be called validators.
[0067] Trusted Byzantine Fault Tolerance (TBFT) is a consensus algorithm that improves upon the BFT (Byzantine Fault Tolerance) consensus algorithm. TBFT is primarily used in blockchain systems to improve consensus efficiency and performance. The TBFT consensus algorithm involves the replacement of proposal nodes within the consensus nodes. In TBFT, proposal nodes are responsible for generating new block proposals, while other consensus nodes verify and reach consensus on the proposals. Once a proposal node receives confirmation from other consensus nodes that a block proposal has been approved, it can generate the new block and add it to the blockchain. To enhance system security and protect against potential attacks, TBFT allows for the periodic replacement of proposal nodes. This replacement can be based on specific rules and mechanisms, such as time intervals or triggered by specific events.
[0068] In addition, TBFT also has a generational replacement of consensus nodes. This refers to the process of replacing consensus nodes regularly or according to certain rules. This involves replacing multiple consensus nodes of the current generation and re-voting to select multiple consensus nodes of the next generation. This maintains the security, stability, and decentralization of the network. Consensus nodes may be replaced at a certain frequency or under certain conditions, with new consensus nodes replacing old ones to participate in consensus operations.
[0069] In related technologies, different consensus nodes only maintain their locally stored blockchain configuration information and perform blockchain-related operations, such as block generation and proposer selection, based on this blockchain configuration information. However, different consensus nodes may have different blockchain configuration information, which can lead to consensus issues such as frequent proposer switching and block generation bottlenecks. For example, assume that multiple consensus nodes include an empty block timeout configuration item. Since the empty block timeout is independently maintained by each consensus node, inconsistencies may exist. For example, if four consensus nodes are deployed, each node's empty block timeout is configured to be 1ms, 10ms, 100ms, and 1000ms, respectively. If the proposing node is a consensus node with a 1000ms empty block timeout, and at the 101st millisecond in the blockchain, the first three consensus nodes all detect a new block generation, they will assume that the fourth consensus node may have failed and initiate a proposal node replacement. If the replacement is successful, two of the four consensus nodes may be proposing nodes, leading to inconsistent coordination between the consensus nodes.
[0070] Based on this, the embodiments of the present application respectively propose a blockchain-based management method, a blockchain-based management apparatus, a blockchain-based management device, a computer-readable storage medium, and a computer program product. In these embodiments, blockchain operation specification information is recorded in a blockchain configuration contract. Upon receiving a deployment request for a blockchain configuration contract from a requesting party, consensus verification of the blockchain configuration contract can be performed based on the request. After consensus is reached, the blockchain configuration contract is successfully deployed on the blockchain. Upon completion of deployment, the blockchain node can retrieve the configuration contract from the blockchain and extract the blockchain operation specification information therein. This ensures that each blockchain node can retrieve the same configuration contract from the blockchain, thereby ensuring information consistency across blockchain nodes and enabling each blockchain node to perform blockchain-related operations according to the same rules.
[0071] See also Figure 1 , Figure 1 It is a schematic diagram of an implementation environment involved in this application.
[0072] Figure 1 The illustrated implementation environment includes a requester 110 , a first blockchain node 120 , a second blockchain node 130 , and a blockchain 140 .
[0073] The requester 110 is a node that makes a deployment request for a blockchain configuration contract. The requester 110 may be a management node or a node with a specific configuration for managing other nodes.
[0074] The first blockchain node 120 is a node connected to the blockchain and can be a consensus node. It can receive the deployment request for the blockchain configuration contract sent by the requesting party 110. In the embodiment of the present application, according to the TBFT consensus algorithm, the proposal node is responsible for broadcasting the proposal request for the new block to other consensus nodes of the same generation. Only when the other consensus nodes of the same generation reach a consensus can the proposal node add the newly generated block to the blockchain (i.e., the contract storage process). Therefore, the first blockchain node 120 is a proposal node among multiple consensus nodes in the current generation.
[0075] See Figure 2 , which shows a diagram of multiple consensus nodes within a generation. In this example, there are four consensus nodes in the current generation: Consensus Node 1, Consensus Node 2, Consensus Node 3, and Consensus Node 4, with communication connections established between them. In this example scenario, Consensus Node 1 acts as a proposal node.
[0076] The requester can broadcast a deployment request for the blockchain configuration contract to these four consensus nodes. Consensus nodes 1 through 4 will receive the deployment request, verify it, and vote on it to determine the voting result. However, since consensus nodes 1 through 3 are currently standard consensus nodes and do not currently have block production authority, they will not directly send a deployment response to the requester. Instead, consensus nodes 1 through 3 will send the voting results on the deployment contract to the current generation's proposing node (i.e., consensus node 1), reflecting their support or opposition to the deployment of the blockchain configuration contract in the deployment request.
[0077] Consensus Node 1 also verifies and votes on the deployment request. Consensus Node 1 then aggregates the four voting results and initiates a consensus process to determine whether the current generation of consensus nodes agrees on the deployment request for the blockchain configuration contract. If the consensus result indicates that the deployment request is passed, Consensus Node 1 adds the blockchain configuration contract to the blockchain, generates a deployment response, and returns the deployment response to the requester.
[0078] exist Figure 1In the example, the second blockchain node 130 is also a node connected to the blockchain and can also be a consensus node. It can receive the contract address corresponding to the blockchain configuration contract sent by the requester 110 to obtain the blockchain configuration contract from the blockchain. The second blockchain node 130 can be a consensus node belonging to a different generation than the first blockchain node 120. For example, the first blockchain node 120 is any consensus node of the first generation, and the second blockchain node 130 can be any consensus node of the second generation or any consensus node of the third generation. Moreover, the generation to which the second blockchain node 130 belongs is formed later than the generation to which the first blockchain node 120 belongs. In this embodiment of the present application, since the second blockchain node 130 does not need to respond to the contract address to initiate a proposal to generate a new block, the second blockchain node 130 can be any consensus node in its generation, that is, it can be a normal consensus node or a proposal node in its generation.
[0079] Optionally, the second blockchain node 130 may also be a non-consensus node.
[0080] The blockchain 140 includes a series of blocks that are connected in chronological order. Once a new block is added to the blockchain, it will not be removed. The block records the data submitted by the nodes in the blockchain system. Figure 3 , Figure 3 This is an optional schematic diagram of the block structure provided by the embodiment of the present application. Each block includes the hash value of the transaction record stored in this block (the hash value of this block) and the hash value of the previous block. The blocks are connected by hash values to form a blockchain. In addition, the block can also include information such as the timestamp when the block was generated. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains relevant information used to verify the validity of its information (anti-counterfeiting) and generate the next block.
[0081] It should be noted that the requesting party and the blockchain node (including the first blockchain node and the second blockchain node) in the embodiments of the present application can be terminal devices, which can be mobile phones, tablet computers, laptops, PDAs, mobile Internet devices (MIDs), vehicle-mounted devices, aircraft, wearable devices (smart devices such as smart watches, smart bracelets, pedometers, etc.), virtual reality devices (such as VR (Virtual Reality) devices, AR (Augmented Reality) devices), etc.
[0082] Optionally, the requester and blockchain node (including the first blockchain node and the second blockchain node) in the embodiments of the present application may also be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0083] See also Figure 4 , Figure 4 This is a flowchart of a blockchain-based management method according to an exemplary embodiment. Figure 1 The implementation environment shown is specifically executed by the first blockchain node 120 (the corresponding physical device of which can be a computer). Of course, this method can also be applied to other implementation environments, and the execution subject of this method is not limited here.
[0084] The following will use the first blockchain node as an exemplary execution subject to elaborate on the blockchain-based management method. Figure 4 As shown, in an exemplary embodiment, the method includes at least the following steps:
[0085] S410, receiving a deployment request for a blockchain configuration contract sent by a requesting party, where the blockchain configuration contract includes blockchain operation specification information, and the blockchain operation specification information is a specification followed by blockchain nodes in the blockchain to perform blockchain-related operations.
[0086] Among them, the blockchain operation specification information in the blockchain configuration contract sent by the requester may include two aspects of information. The first is the configuration items that affect the consensus process, including the empty block time, the number of generation transition blocks, the number of consecutive blocks produced by the node, and the fuel fee (Gas) limit; the second is the configuration items that require nodes to maintain a high degree of consistency, including transaction polling timeout, the maximum number of transactions in a block, and the use of optimization proposals.
[0087] The requester can generate the deployment request by calling a specific contract method, such as the SetProperty function, which is a function that sets properties. The requester can use the SetProperty function to set some contract method codes, such as deploying a blockchain configuration contract, setting blockchain operation specification information, and querying configuration items in the blockchain operation specification information.
[0088] The code for deploying the blockchain configuration contract can be:
[0089] Exports["OnDeploy"]=reflect.ValueOf(OnDeploy).
[0090] The code for setting blockchain operation specification information can be:
[0091] Exports["SetProperty"]=reflect.ValueOf(SetProperty).
[0092] The code to query the configuration items in the blockchain operation specification information can be:
[0093] Exports["QueryChainConfigProperties"]=reflect.ValueOf(QueryChainConfigProperties).
[0094] In addition, the blockchain configuration contract set by the requester can include the following parameters:
[0095] chainContext.RegisterObject(&chainconfig.Property{}) is used to deploy the contract and create a configuration table containing the following types of configurations:
[0096] new(types.ConsensusConfig) is a consensus configuration type used to manage configurations such as empty block time and generation switching time during the consensus process.
[0097] new(types.BlockConfig) is a block configuration type, which is used to manage the relevant conditions of block generation, such as the number of transactions in a block.
[0098] new(types.VMGasConfig) is the gas consumption configuration type of the virtual machine, which is used to manage gas consumption related options, such as min_gas_limit, max_block_gas, etc.
[0099] new(types.ChainFeatureConfig) is the blockchain feature configuration type, such as chain id.
[0100] new(types.ChainVersion) is the blockchain version configuration type, such as the chain version number.
[0101] new(types.VMConfig) is a virtual machine configuration type used to manage virtual machine related options.
[0102] In the embodiment of the present application, each parameter and its configuration value may be represented in a key-value manner, as shown in Table 1, which is an exemplary table of each parameter and its corresponding configuration value.
[0103]
[0104] Table 1
[0105] block.common = {"maxBlockTxSize": 2000} refers to the maximum number of transactions in a block, limiting the number of transactions that can be included in each block to 2000 to control block size and processing power.
[0106] chain.feature={"EnableOnChainConfig":true} means that the state corresponding to enabling on-chain configuration in the blockchain feature configuration is true, that is, on-chain configuration needs to be enabled.
[0107] consensus.common = {"consensusType":"tbft","waitAvailableTxs":true,"instan tNewRoundAfterTx":true,"emptyBlockTimeout":2000,txTimeout:100} sets the consensus mechanism. These settings include setting the consensus algorithm type (consensusType) to the TBFT consensus algorithm; setting waitAvailableTxs to true to enable a mechanism while waiting for available transactions; setting the emptyBlockTimeout to 2000 milliseconds, meaning that if no new blocks are generated within this time, an action may be triggered; and setting the transaction timeout to 100 milliseconds.
[0108] In vm.gas = {"minTxGasPrice":0,"minTxGasLimit":0."maxTxGasLimit":200000}, minTxGasPrice sets the minimum transaction Gas price, that is, the minimum Gas price required for transaction execution; minTxGasLimit sets the minimum transaction Gas limit, that is, the minimum Gas limit required for transaction execution; maxTxGasLimit sets the maximum transaction Gas limit, that is, the maximum Gas limit allowed for transaction execution.
[0109] By analogy, those skilled in the art can flexibly write the blockchain operation specification information in the blockchain configuration contract according to different scenarios to meet the usage requirements of different scenarios.
[0110] In this way, the requester can generate a deployment request for the blockchain configuration contract and send it to the first blockchain node. Accordingly, the first blockchain node receives the deployment request.
[0111] S420: Reach consensus on the blockchain configuration contract based on the deployment request.
[0112] In this embodiment of the present application, before the first blockchain node reaches consensus on the blockchain configuration contract, it is necessary to verify the authority of the requester of the deployment request and verify each configuration parameter item in the blockchain operation specification information. After both the authority verification and the parameter configuration item verification are passed, the blockchain configuration contract consensus is entered.
[0113] It should be noted that the first blockchain node in this application is Figure 2 Consensus Node 1 is shown as a proposal node. Since the requester will also broadcast the deployment request to other consensus nodes (including consensus nodes 1 to 3), consensus nodes 1 to 3 also need to verify the requester's permissions for the deployment request and verify the various configuration parameters in the blockchain operation specification information. If both the permission verification and parameter configuration items pass, consensus nodes 1 to 3 need to vote on the deployment request of the blockchain configuration contract to indicate whether to support the deployment of the blockchain configuration contract on the blockchain, thereby generating the corresponding voting results and sending them to the first blockchain node.
[0114] The first blockchain node also votes on the deployment request for the blockchain configuration contract and obtains the corresponding voting results. The first blockchain node also receives voting results from other common consensus nodes of the same generation and calculates the support rate for the deployment request from each consensus node in the current blockchain network. If the support rate exceeds a preset threshold, the deployment request is considered to have passed consensus.
[0115] S430, after the consensus is passed, the blockchain configuration contract is deployed to the blockchain, so that the blockchain node obtains the blockchain configuration contract from the blockchain, extracts the blockchain operation specification information from the blockchain configuration contract, and performs blockchain-related operations based on the blockchain operation specification information.
[0116] In an embodiment of the present application, after consensus is passed, the first blockchain node can deploy the blockchain configuration contract to the blockchain. At this time, the first blockchain node will receive the contract address of the blockchain configuration contract returned by the blockchain, and can then add the contract address to the deployment response to inform the requester that the deployment request has been approved and inform its contract address. Specifically, the first blockchain node can obtain the contract address of the blockchain configuration contract deployed on the blockchain and send the contract address to the requester through the deployment response, so that the requester can send the contract address to other blockchain nodes.
[0117] Optionally, if at least one of permission verification, configuration parameter verification, and consensus fails, the first blockchain node will also send a deployment response to the requester. This deployment response will indicate the failure of the deployment request and the process in which the failure occurred. For example, if the configuration parameter verification fails, the deployment response will inform the requester that the configuration parameter verification failed.
[0118] After the blockchain configuration contract is successfully deployed on the blockchain, other blockchain nodes can obtain the blockchain configuration contract from the blockchain, extract blockchain operation specification information from the blockchain configuration contract, and perform blockchain-related operations based on the blockchain operation specification information.
[0119] Optionally, each consensus node in the blockchain provides a query interface, so that external nodes can view the configuration parameter items and their corresponding values in the blockchain operation specification through the query interface.
[0120] This method first records blockchain operational specifications in a blockchain configuration contract. Upon receiving a deployment request for the blockchain configuration contract from a requesting party, consensus verification of the blockchain configuration contract is performed based on the request. Once consensus is reached, the blockchain configuration contract is successfully deployed to the blockchain. Following deployment, blockchain nodes can retrieve the configuration contract from the blockchain and extract the blockchain operational specifications. This ensures that each blockchain node can access the same configuration contract from the blockchain, ensuring that each blockchain node has access to the same blockchain operational specifications. This allows each blockchain node to execute blockchain-related operations according to the same rules, improving information uniformity across blockchain nodes.
[0121] Secondly, the blockchain configuration contract is combined with the consensus mechanism. During the consensus generation switching process, the blockchain operation specification information in the blockchain configuration contract is uniformly read, so that each blockchain node can obtain the information at the same time, reducing the coordination inconsistency problems caused by asynchronous synchronization. All blockchain nodes obtain the same information at the same time, making it easier to reach consensus.
[0122] Finally, even if the requester is a management node, the deployment request initiated by it needs to be passed by consensus at all consensus nodes before the blockchain configuration contract can be deployed, rather than having to agree to the deployment request of the management node. In this way, the decentralized characteristics of the blockchain can be retained and the security of the blockchain network can be improved.
[0123] In one embodiment of the present application, another blockchain-based management method is provided, which can be executed by a first blockchain node. Figure 5 As shown, the blockchain-based management method may include S410, S510 to S530 and S430. That is, S510 to S530 are Figure 4 The specific implementation method of S420 is shown.
[0124] In an embodiment of the present application, the deployment request includes identification information of the requester.
[0125] S510 to S530 are described below:
[0126] S510: Extract identification information of the requester from the deployment request.
[0127] The identification information may be signature information of the requester, and the identity of the requester is confirmed by the signature information.
[0128] S520: Verify the deployment authority of the requester based on the preset identification and authority mapping relationship and the identification information.
[0129] In order to verify whether the requester has sufficient authority to perform the deployment operation, the first blockchain node can verify whether the requester has the authority to perform the requested deployment by comparing the identification information and the authority mapping relationship.
[0130] S530: If the verification is successful, consensus is reached on the blockchain configuration contract based on the deployment request.
[0131] If the verification is successful, it means that the requester has the authority to make the deployment request and is a management node. Therefore, the next step can be executed - consensus on the blockchain configuration contract based on the deployment request.
[0132] Through this method, verification permissions ensure that only requesters with sufficient permissions can perform key deployment operations, reducing the risk of potential abnormal behavior and misconfiguration, and enhancing the security of blockchain configuration contract deployment.
[0133] In one embodiment of the present application, another blockchain-based management method is provided, which can be executed by a first blockchain node. Figure 6As shown, the blockchain-based management method may include S410, S610 to S620 and S430. That is, S610 to S620 are Figure 4 The specific implementation method of S420 is shown.
[0134] In an embodiment of the present application, the blockchain operation specification information includes multiple configuration parameter items.
[0135] S610 to S620 are described below:
[0136] S610, extracting multiple configuration parameter items from the blockchain operation specification information.
[0137] The first blockchain node may first obtain blockchain operation specification information from the blockchain configuration contract, and then extract multiple configuration parameter items from the blockchain operation specification information. The multiple configuration parameter items have been described in detail in the previous embodiment and will not be repeated here.
[0138] S620: If it is detected that the value of each configuration parameter item is within the standard value range corresponding to each configuration parameter item, consensus is reached on the blockchain configuration contract based on the deployment request.
[0139] That is, each configuration parameter item corresponds to a standard value range. If it is detected that the value of each configuration parameter item is within the standard value range corresponding to each configuration parameter item, it means that the blockchain operation specification information is correct and the next step can be carried out - consensus on the blockchain configuration contract based on the deployment request.
[0140] Through this method, it is ensured that the blockchain configuration contract is reached consensus only when the blockchain operation specification information is correct, thereby improving the accuracy of contract deployment.
[0141] In one embodiment of the present application, another blockchain-based management method is provided, which can be executed by a first blockchain node. Figure 7 As shown, the blockchain-based management method may include S410 to S420 and S710 to S730. That is, S710 to S730 are Figure 4 The specific implementation method of S430 is shown.
[0142] S710 to S730 are described below:
[0143] S710: Generate a block to be uploaded to the blockchain based on the blockchain configuration contract.
[0144] In one embodiment of the present application, before the blockchain configuration contract is uploaded to the chain, consensus on the blockchain configuration contract is required.
[0145] Specifically, each consensus node in the current generation receives the deployment request. After verifying the permissions and configuration parameters of the deployment request, each consensus node votes on deploying the blockchain contract. The voting results are sent to the first blockchain node, which serves as the proposing node. Based on the votes of each consensus node, the first blockchain node calculates the support rate for deploying the blockchain configuration contract. If the support rate exceeds a preset support rate threshold, consensus is successful and the contract can be deployed on the blockchain.
[0146] S720: Obtain response information of the blockchain node in the blockchain for the block to be chained.
[0147] Blockchain nodes refer to other consensus nodes of the same generation as the first blockchain node. The first blockchain node needs to send a proposal request for the block to be on-chain to other consensus nodes, and the other consensus nodes need to respond to it to indicate whether they agree to the deployment.
[0148] S730: If the number of response messages indicating deployment consent is greater than or equal to a preset threshold, the blockchain configuration contract is added to the blockchain.
[0149] The preset quantity threshold may be set by those skilled in the art and is not limited here.
[0150] Optionally, when the first blockchain node adds the blockchain configuration contract to the blockchain, the blockchain configuration contract may be added in the form of transaction information.
[0151] It should be noted that in the embodiments of this application, although the blockchain configuration contract has been added to the blockchain, i.e., successfully deployed, the current generation of consensus nodes can still perform blockchain-related operations according to the blockchain configuration information they maintain. The blockchain configuration contract will officially take effect when the next generation of consensus nodes is selected and synchronized to the blockchain configuration contract. In other words, the current generation of consensus nodes will use the old configuration information, and the new blockchain operation specification information will not be fully adopted and take effect until the next generation of consensus nodes synchronizes.
[0152] This allows, on the one hand, for systems to become unstable due to the introduction of new blockchain operational specifications, to detect the issue promptly during the update process and quickly restore to the previous configuration through a rollback operation, thus improving the stability of the blockchain network. Furthermore, asynchronous synchronization prevents modules such as consensus, transactions, and virtual machines from querying outdated configuration information.
[0153] Through this method, the first blockchain node will add the blockchain configuration contract to the blockchain only when the proposal request formula of the to-be-chained block corresponding to the blockchain configuration contract is passed, thereby improving the reliability of the blockchain configuration contract deployment.
[0154] See also Figure 8 , Figure 8 This is a flowchart of a blockchain-based management method according to an exemplary embodiment. Figure 1 The implementation environment shown is specifically executed by the second blockchain node 130 (the corresponding physical device of which can be a computer). Of course, this method can also be applied to other implementation environments, and the execution subject of this method is not limited here.
[0155] The following will use the second blockchain node as an exemplary execution subject to elaborate on the blockchain-based management method. Figure 8 As shown, in an exemplary embodiment, the method includes at least the following steps:
[0156] S810, obtaining a contract address corresponding to the blockchain configuration contract; wherein the contract address is generated after the blockchain configuration contract is successfully deployed on the blockchain.
[0157] The contract address may be sent by the requester. After the first blockchain node successfully deploys the blockchain configuration contract on the blockchain, it obtains a contract address. The first blockchain node adds the contract address to the deployment response to the requester's deployment request. Upon receiving the contract address, the requester sends it to the second blockchain node.
[0158] It should be noted that the second blockchain node can be a consensus node, and the generation to which the second blockchain node belongs can be after the generation to which the first blockchain node belongs, and the second blockchain node can be any one of the multiple consensus nodes in its generation.
[0159] Optionally, the second blockchain node may also be a non-consensus node.
[0160] S820, searching the blockchain for a blockchain configuration contract that matches the contract address.
[0161] The second blockchain node uses the query function of the blockchain to search on the blockchain according to the contract address, locates the block to which the blockchain configuration contract belongs, and thus obtains the blockchain configuration contract.
[0162] S830, extracting blockchain operation specification information from the blockchain configuration contract.
[0163] When the second blockchain node finds the transaction containing the contract address, it will parse the transaction, obtain the blockchain configuration contract, and extract the blockchain operation specification information.
[0164] Optionally, after obtaining the blockchain configuration contract, the second blockchain node may also verify it to ensure that the contract is valid, has not been tampered with, and complies with the rules of the blockchain.
[0165] S840, performing blockchain-related operations based on the blockchain operation specification information.
[0166] In an embodiment of the present application, blockchain-related operations may be operations based on blockchain operation specification information, such as initiating a request to replace a proposal node (which may be called a round operation request), a transaction gas limit, a maximum number of transactions in a block, the time it takes for a node to continuously generate blocks, etc.
[0167] In an embodiment of the present application, a second blockchain node may receive a proposal request for a newly generated block from a first proposal node. If the second blockchain node approves the proposal request for the newly generated block, the second blockchain node may send a verification result to the first proposal node, indicating whether the verification was successful and whether the first proposal node approves the addition of the newly generated block to the blockchain. The first proposal node and the second blockchain node are of the same generation.
[0168] Through this method, once the second blockchain node is selected as a consensus node, it can retrieve the blockchain configuration contract and extract blockchain operational specifications based on the contract address sent by the requester. The remaining consensus nodes in the same generation can also obtain blockchain operational specifications in a timely manner. In this way, multiple consensus nodes in the same generation synchronously obtain blockchain operational specifications at the same time, improving the uniformity of information among blockchain nodes.
[0169] In one embodiment of the present application, another blockchain-based management method is provided, which can be executed by a computer. Figure 9 As shown, the blockchain-based management method may include S810 to S830 and S910 to S930. That is, S910 to S930 are Figure 8 The specific implementation method of S830 is shown.
[0170] S910 to S930 are described below:
[0171] S910, receiving a proposal request for a newly generated block sent by a first proposal node; wherein the first proposal node is selected from the blockchain nodes based on blockchain operation normative information.
[0172] The first proposal node also synchronizes the blockchain operation specification information in the blockchain configuration contract, so the proposal request it issues is also generated based on the blockchain operation specification information. At this point, the first proposal node and the second blockchain node are different nodes, and therefore the second blockchain node is a normal consensus node.
[0173] S920: Verify the proposal request and send the verification result to the first proposal node.
[0174] The second blockchain node, acting as a common consensus node, can verify the proposal request and vote to determine whether to support the proposal request, and generate a verification result to send to the first proposal node.
[0175] S930: If a message is received indicating that the newly generated block has been added to the blockchain, it is determined that the newly generated block has been successfully added to the blockchain.
[0176] If the first proposal node determines that the support rate of other consensus nodes for the proposal request exceeds a certain support rate threshold, it can add the newly generated block to the blockchain. At the same time, the first proposal node will also notify the other consensus nodes of this message, so the second blockchain node will receive the message that the newly generated block has been added to the blockchain.
[0177] Optionally, if the second blockchain node itself is the proposal node in the current generation, then the second blockchain node will broadcast the proposal request for the newly generated block to other consensus nodes to obtain the support rate of other consensus nodes for the proposal request. If the support rate is greater than a certain support rate threshold, the newly generated block can be added to the blockchain.
[0178] In one embodiment of the present application, the blockchain operation specification information includes a preset empty block timeout (i.e., emptyblocktime). If the second blockchain node does not receive a message indicating that the block to be generated has been added to the blockchain within the preset empty block timeout, it sends a request to other blockchain nodes to replace the proposal node. Since each consensus node in the current generation has synchronized the blockchain operation specification message at this time, their preset empty block timeouts are the same, and these consensus nodes will simultaneously initiate a request to replace the proposal node. This may be caused by the failure or offline of the first proposal node. In order to maintain the normal operation of the blockchain, a proposal node needs to be replaced.
[0179] If the second blockchain node receives the identification information sent by the second proposal node, it will store the identification information sent by the second proposal node; the second proposal node is selected from the blockchain nodes based on the request to replace the proposal node. In other words, after the second blockchain node initiates the request to replace the proposal node, if consensus is passed, a new proposal node will be selected, namely the second proposal node. If the second proposal node is not the second blockchain node, the second blockchain node will store the identification information sent to the second proposal node, so that it can determine which consensus node the second proposal node is.
[0180] This method writes blockchain operational specifications into a blockchain configuration contract, which is then written to the blockchain in the form of a smart contract after consensus is reached. A second blockchain node can then synchronize this blockchain operational specification information based on the received contract address. This allows every blockchain node in the generation to which the second blockchain node belongs to synchronize with this blockchain operational specification information, improving information consistency across blockchain nodes, enabling more orderly execution of blockchain tasks, and enhancing the robustness of the blockchain system.
[0181] In one embodiment of the present application, another blockchain-based management method is provided, which can be executed by a computer. Figure 10 As shown, the blockchain-based management method may include S1001 to S1014.
[0182] S1001 to S1014 are described below:
[0183] S1001, the requesting party sends a deployment request for the blockchain configuration contract to the first blockchain node.
[0184] S1002: The first blockchain node determines whether the authority verification of the requesting party is successful based on the deployment request.
[0185] If the verification passes, execute S1003; if the verification fails, execute S1010.
[0186] S1003, the first blockchain node determines whether the blockchain operation specification information verification is passed.
[0187] If the verification passes, execute S1004; if the verification fails, execute S1010.
[0188] S1004, the first blockchain node receives the voting results of the deployment request sent by other consensus nodes.
[0189] S1005: The first blockchain node determines whether the deployment request consensus is passed based on the voting results.
[0190] If the consensus is passed, execute S1007; if the consensus is not passed, execute S1010.
[0191] S1006: The first blockchain node generates a block to be uploaded to the chain based on the blockchain configuration contract.
[0192] S1007: The first blockchain node determines whether the consensus on the on-chain block is successful.
[0193] If the consensus is passed, execute S1008; if the consensus is not passed, execute S1010.
[0194] S1008, the first blockchain node adds the block to be chained to the blockchain to deploy the blockchain configuration contract to the blockchain.
[0195] S1009, the first blockchain node sends a deployment response including the contract address to the requester.
[0196] The deployment response is used to indicate that the blockchain configuration contract has been successfully deployed, and the contract address is the contract address of the blockchain configuration contract in the blockchain.
[0197] After executing S1009, S1011 may be executed.
[0198] S1010, the first blockchain node returns a deployment failure response to the requester.
[0199] If the requester sends a deployment request again, S1001 may be executed.
[0200] S1011, the requesting party sends the contract address corresponding to the blockchain configuration contract to the second blockchain node.
[0201] S1012, the second blockchain node searches the blockchain for a blockchain configuration contract that matches the contract address.
[0202] S1013, the second blockchain node extracts blockchain operation specification information from the blockchain configuration contract.
[0203] S1014, the second blockchain node performs blockchain-related operations based on the blockchain operation specification information.
[0204] This method first records blockchain operational specifications in a blockchain configuration contract. Upon receiving a deployment request for the blockchain configuration contract from a requesting party, consensus verification of the blockchain configuration contract is performed based on the request. Once consensus is reached, the blockchain configuration contract is successfully deployed to the blockchain. Following deployment, blockchain nodes can retrieve the configuration contract from the blockchain and extract the blockchain operational specifications. This ensures that each blockchain node can access the same configuration contract from the blockchain, ensuring that each blockchain node has access to the same blockchain operational specifications. This allows each blockchain node to execute blockchain-related operations according to the same rules, improving information uniformity across blockchain nodes.
[0205] Secondly, the blockchain configuration contract is combined with the consensus mechanism. During the consensus generation switching process, the blockchain operation specification information in the blockchain configuration contract is uniformly read, so that each blockchain node can obtain the information at the same time, reducing the coordination inconsistency problems caused by asynchronous synchronization. All blockchain nodes obtain the same information at the same time, making it easier to reach consensus.
[0206] Finally, even if the requester is a management node, the deployment request initiated by it needs to be passed by consensus at all consensus nodes before the blockchain configuration contract can be deployed, rather than having to agree to the deployment request of the management node. In this way, the decentralized characteristics of the blockchain can be retained and the security of the blockchain network can be improved.
[0207] Figure 11 FIG is a block diagram of a management device based on blockchain according to an embodiment of the present application. Figure 11 As shown, the blockchain-based management device can be applied to a computer, and the device includes:
[0208] A blockchain-based management device, comprising:
[0209] The transceiver unit 1110 is configured to receive a deployment request for a blockchain configuration contract from a requesting party, where the blockchain configuration contract includes blockchain operation specification information, which is the specification followed by blockchain nodes in the blockchain to perform blockchain-related operations;
[0210] A consensus unit 1120 is used to reach a consensus on the blockchain configuration contract based on the deployment request;
[0211] Processing unit 1130 is used to deploy the blockchain configuration contract to the blockchain after consensus is passed, so that the blockchain node obtains the blockchain configuration contract from the blockchain, extracts blockchain operation specification information from the blockchain configuration contract, and performs blockchain-related operations based on the blockchain operation specification information.
[0212] In one embodiment of the present application, based on the aforementioned solution, the deployment request includes identification information of the requester; the processing unit 1130 is further used to extract the identification information of the requester from the deployment request; based on the preset identification and permission mapping relationship, and the identification information, the deployment permission of the requester is verified; if the verification is successful, consensus is reached on the blockchain configuration contract based on the deployment request.
[0213] In one embodiment of the present application, based on the aforementioned scheme, the blockchain operation specification information includes multiple configuration parameter items; the processing unit 1130 is also used to extract multiple configuration parameter items from the blockchain operation specification information; if it is detected that the value of each configuration parameter item is within the standard value range corresponding to each configuration parameter item, the consensus unit 1120 reaches a consensus on the blockchain configuration contract based on the deployment request.
[0214] In one embodiment of the present application, based on the aforementioned solution, the processing unit 1130 is further used to generate a block to be chained based on the blockchain configuration contract; the acquisition unit 1140 is used to obtain response information of the blockchain node in the blockchain for the block to be chained; the processing unit 1130 is further used to add the blockchain configuration contract to the blockchain if the number of response information corresponding to the consent for deployment is greater than or equal to a preset number threshold.
[0215] In one embodiment of the present application, based on the aforementioned solution, after the smart contract is deployed on the blockchain, the acquisition unit 1140 is further used to obtain the contract address of the blockchain configuration contract deployed on the blockchain; the transceiver unit 1110 is further used to send the contract address to the requester, so that the requester sends the contract address to the blockchain node.
[0216] A blockchain-based management device, comprising:
[0217] An acquisition unit 1140 is configured to acquire a contract address corresponding to a blockchain configuration contract; wherein the contract address is generated after the blockchain configuration contract is successfully deployed on the blockchain;
[0218] Processing unit 1130 is used to search the blockchain for a blockchain configuration contract that matches the contract address;
[0219] The processing unit 1130 is further configured to extract blockchain operation specification information from the blockchain configuration contract;
[0220] The processing unit 1130 is further configured to execute blockchain-related operations based on the blockchain operation specification information.
[0221] In one embodiment of the present application, based on the aforementioned solution, the transceiver unit 1110 is used to receive a proposal request for a newly generated block sent by a first proposal node; wherein the first proposal node is selected from the blockchain nodes based on the blockchain operation normative information; the processing unit 1130 is also used to verify the proposal request and send the verification result to the first proposal node through the transceiver unit 1110; if a message is received indicating that the newly generated block has been added to the blockchain, it is determined that the newly generated block has been successfully uploaded to the chain.
[0222] In one embodiment of the present application, based on the aforementioned scheme, the blockchain operation normative information includes a preset empty block timeout period; if the transceiver unit 1110 does not receive a message that the block to be generated has been added to the blockchain within the preset empty block timeout period, a request to replace the proposal node is sent to other blockchain nodes; if the transceiver unit 1110 receives identification information sent by the second proposal node, the processing unit 1130 stores the identification information sent by the second proposal node; wherein the second proposal node is selected from the blockchain node based on the request to replace the proposal node.
[0223] In one embodiment of the present application, based on the aforementioned solution, the transceiver unit 1110 is further configured to receive a contract address corresponding to a blockchain configuration contract sent by a requesting party; wherein the contract address is obtained by the requesting party after the blockchain configuration contract is successfully deployed on the blockchain.
[0224] It should be noted that the apparatus provided in the aforementioned embodiment and the method provided in the aforementioned embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment.
[0225] An embodiment of the present application also provides a blockchain-based management device, comprising: one or more processors; and a memory for storing one or more programs, which, when executed by one or more processors, enables the electronic device to implement the aforementioned blockchain-based management method.
[0226] Figure 12 Schematic diagram of a computer system suitable for implementing a blockchain-based management device according to an embodiment of the present application.
[0227] It should be noted that Figure 12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0228] like Figure 12As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 into the random access memory (RAM) 1203, such as executing the method in the above embodiment. Various programs and data required for system operation are also stored in the RAM 1203. The CPU 1201, ROM 1202 and RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0229] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, and the like; an output section 1207 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 1208 including a hard disk; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. Removable media 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1210 as needed, so that computer programs read from the removable media can be installed in the storage section 1208 as needed.
[0230] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by the central processing unit (CPU) 1201, the various functions defined in the system of the present application are executed.
[0231] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0232] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0233] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.
[0234] Another aspect of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned blockchain-based management method. The computer-readable medium may be included in the electronic device described in the above embodiments, or may exist independently and not be incorporated into the electronic device.
[0235] Another aspect of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable medium. A processor of a computer device reads the computer instructions from the computer-readable medium and executes the computer instructions, causing the computer device to perform the blockchain-based management method provided in each of the above embodiments.
[0236] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. Ordinary technicians in this field can easily make corresponding changes or modifications based on the main ideas and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A management method based on blockchain, characterized in that: include: Receive a deployment request for a blockchain configuration contract from a requesting party, wherein the blockchain configuration contract includes blockchain operation specification information, wherein the blockchain operation specification information is a specification followed by blockchain nodes in the blockchain to perform blockchain-related operations; Reaching consensus on the blockchain configuration contract based on the deployment request; After consensus is passed, the blockchain configuration contract is deployed to the blockchain, so that the blockchain node obtains the blockchain configuration contract from the blockchain, extracts the blockchain operation specification information from the blockchain configuration contract, and performs blockchain-related operations based on the blockchain operation specification information.
2. The method according to claim 1, characterized in that The deployment request includes identification information of the requesting party; The reaching a consensus on the blockchain configuration contract based on the deployment request includes: extracting identification information of the requester from the deployment request; Verifying the deployment authority of the requester based on a preset identification and authority mapping relationship and the identification information; If the verification is successful, consensus is reached on the blockchain configuration contract based on the deployment request.
3. The method according to claim 1, characterized in that The blockchain operation specification information includes multiple configuration parameter items; The reaching a consensus on the blockchain configuration contract based on the deployment request includes: Extracting the multiple configuration parameter items from the blockchain operation specification information; If it is detected that the value of each configuration parameter item is within the standard value range corresponding to each configuration parameter item, consensus is reached on the blockchain configuration contract based on the deployment request.
4. The method according to claim 1, wherein After consensus is passed, the blockchain configuration contract is deployed on the blockchain, including: Generate a block to be uploaded to the chain based on the blockchain configuration contract; Obtaining response information of a blockchain node in the blockchain for the block to be put on the chain; If the number of response messages indicating deployment consent is greater than or equal to a preset threshold, the blockchain configuration contract is added to the blockchain.
5. The method according to claim 1, characterized in that After deploying the blockchain configuration contract on the blockchain, the method further includes: Obtain the contract address of the blockchain configuration contract deployed on the blockchain; The contract address is sent to the requesting party, so that the requesting party sends the contract address to the blockchain node.
6. A blockchain-based management method, characterized in that: include: Obtain the contract address corresponding to the blockchain configuration contract; wherein the contract address is generated after the blockchain configuration contract is successfully deployed on the blockchain; Find the blockchain configuration contract that matches the contract address from the blockchain; Extracting blockchain operation specification information from the blockchain configuration contract; Execute blockchain-related operations based on the blockchain operation specification information.
7. The method according to claim 6, characterized in that The performing of blockchain-related operations based on the blockchain operation specification information includes: receiving a proposal request for a newly generated block from a first proposal node, wherein the first proposal node is selected from blockchain nodes based on the blockchain operation specification information; Verifying the proposal request and sending the verification result to the first proposal node; If a message is received indicating that the newly generated block has been added to the blockchain, it is determined that the newly generated block has been successfully added to the blockchain.
8. The method according to claim 7, characterized in that The blockchain operation specification information includes a preset empty block timeout period; the method further includes: If no message that the newly generated block has been added to the blockchain is received within the preset empty block timeout period, a request to replace the proposal node is sent to other blockchain nodes; If identification information sent by the second proposal node is received, the identification information sent by the second proposal node is stored; wherein, the second proposal node is selected from the blockchain node based on the request to replace the proposal node.
9. The method according to claim 6, characterized in that Obtaining the contract address corresponding to the blockchain configuration contract includes: Receive the contract address corresponding to the blockchain configuration contract sent by the requester; wherein the contract address is obtained by the requester after the blockchain configuration contract is successfully deployed on the blockchain.
10. A blockchain-based management device, characterized in that: include: A transceiver unit, configured to receive a deployment request for a blockchain configuration contract sent by a requester, wherein the blockchain configuration contract includes blockchain operation specification information, which is a specification followed by blockchain nodes in the blockchain to perform blockchain-related operations; A consensus unit, configured to reach a consensus on the blockchain configuration contract based on the deployment request; A processing unit is configured to deploy the blockchain configuration contract to the blockchain after consensus is passed, so that the blockchain node obtains the blockchain configuration contract from the blockchain, extracts the blockchain operation specification information from the blockchain configuration contract, and performs blockchain-related operations based on the blockchain operation specification information.
11. A blockchain-based management device, characterized in that: include: An acquisition unit, configured to acquire a contract address corresponding to a blockchain configuration contract; wherein the contract address is generated after the blockchain configuration contract is successfully deployed on the blockchain; A processing unit, configured to search the blockchain for a blockchain configuration contract that matches the contract address; The processing unit is further configured to extract blockchain operation specification information from the blockchain configuration contract; The processing unit is further used to perform blockchain-related operations based on the blockchain operation specification information.
12. A blockchain-based management device, characterized in that: include: a memory storing computer-readable instructions; A processor reads the computer-readable instructions stored in the memory to execute the method according to any one of claims 1 to 5 or 6 to 9.
13. A computer-readable storage medium, characterized in that Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to perform the method according to any one of claims 1 to 5 or 6 to 9.