WO2020019792A1 - Block release method and apparatus, and electronic device - Google Patents

Block release method and apparatus, and electronic device Download PDF

Info

Publication number
WO2020019792A1
WO2020019792A1 PCT/CN2019/084379 CN2019084379W WO2020019792A1 WO 2020019792 A1 WO2020019792 A1 WO 2020019792A1 CN 2019084379 W CN2019084379 W CN 2019084379W WO 2020019792 A1 WO2020019792 A1 WO 2020019792A1
Authority
WO
WIPO (PCT)
Prior art keywords
character sequence
blockchain
random
random character
blockchain node
Prior art date
Application number
PCT/CN2019/084379
Other languages
French (fr)
Chinese (zh)
Inventor
陆旭明
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2020019792A1 publication Critical patent/WO2020019792A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • One or more embodiments of the present specification relate to the field of blockchain technology, and in particular, to a method and device for issuing blocks, and electronic equipment.
  • the blockchain contains a large number of blockchain nodes.
  • the consensus mechanism is used to reach an agreement between these blockchain nodes to ensure that these blockchain nodes jointly maintain a blockchain ledger with unified content.
  • a PoW (Proof of Work, Proof of Work) algorithm is commonly used to reach consensus among these blockchain nodes; specifically, all blockchain nodes calculate the solution to the same mathematical problem, and the first A blockchain node that finds a qualified solution contends for bookkeeping rights, the blockchain node generates the latest block of the blockchain, and all blockchain nodes generate a block record of the blockchain node To the blockchain ledger.
  • one or more embodiments of the present specification provide a method and device for issuing a block, and an electronic device.
  • a block publishing method is proposed, which is applied to a blockchain node; the method includes:
  • the generated preliminary block is broadcasted on the entire network within the blockchain; wherein, when the random character sequence is verified to match the target character When the sequence and corresponding release time is the earliest in the entire network, the preliminary block is recorded as the latest block of the blockchain.
  • a block publishing device is proposed and applied to a block chain node; the device includes:
  • a calling unit for invoking a smart contract for generating a character sequence the smart contract being used to generate a random character sequence for a blockchain node;
  • a first publishing unit that publishes the random character sequence to the blockchain in association with the identity information of the blockchain node, wherein the publishing time of the random character sequence is earlier than the publishing time of the target character sequence;
  • the broadcasting unit when the random character sequence matches the target character sequence, broadcasts the generated preliminary block on the entire network within the blockchain; wherein, when the random character sequence is verified to match the target character sequence, When the target character sequence and the corresponding release time are the earliest on the entire network, the preliminary block is recorded as the latest block of the blockchain.
  • an electronic device including:
  • Memory for storing processor-executable instructions
  • the processor executes the executable instructions to implement the block publishing method according to any one of the foregoing embodiments.
  • FIG. 1 is a flowchart of a block publishing method according to an exemplary embodiment.
  • FIG. 2 is a schematic structural diagram of a blockchain network according to an exemplary embodiment.
  • FIG. 3 is a schematic flowchart of determining a billing right according to an exemplary embodiment.
  • FIG. 4 is a schematic structural diagram of a device according to an exemplary embodiment.
  • FIG. 5 is a block diagram of a block publishing apparatus according to an exemplary embodiment.
  • the steps of the corresponding method are not necessarily performed in the order shown and described in this specification.
  • the method may include more or fewer steps than described in this specification.
  • a single step described in this specification may be divided into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for other embodiments. description.
  • FIG. 1 is a flowchart of a block publishing method according to an exemplary embodiment. As shown in Figure 1, the method is applied to a blockchain node and can include the following steps:
  • step 102 a smart contract for generating a character sequence is invoked, and the smart contract is used to generate a random character sequence for a blockchain node.
  • processing logic for generating a random character sequence may be written in the smart contract in advance, so that after the smart contract is called, a random character sequence may be automatically generated for a blockchain node based on the processing logic described above. Because the processing logic on the smart contract is public content, and the entire processing process is automatically completed by the smart contract, there is no manual intervention, so that the randomness of the generated random character sequence can be ensured, and the black box operation or cheating behavior is avoided.
  • the random character sequence is not completely “random” and can still meet certain preset rules.
  • the preset rule may include the number of characters, the character type, and the value range of the characters. This specification does not address this. limit.
  • the preset rule can limit the random character sequence to 8 digits, and the random character sequence generated by the smart contract can be "45614381" instead of "ax0642f0"; for example, the preset rule can limit the random character sequence to 5 Digit + 3 letters, the random character sequence generated by the smart contract can be "ax0642f0", and the sequence "45614381" will not be generated.
  • the target character sequence described below when the random character sequence conforms to the preset rule described above, the target character sequence described below also conforms to the preset rule, so that the random character sequence and the target character sequence are consistent in structure and form, and the random character sequence and the target are ensured. Character sequences are comparable.
  • the random character sequences generated by the smart contract for different blockchain nodes should be different from each other to avoid random character sequences and target characters for more than one blockchain node.
  • the sequences match to ensure that only the preliminary blocks generated by one blockchain node are recorded as the latest block of the blockchain.
  • Step 104 Publish the random character sequence to the blockchain in association with the identity information of the blockchain node, wherein the publishing time of the random character sequence is earlier than the publishing time of the target character sequence.
  • the blockchain node may create a transaction on the blockchain client to publish the random character sequence and the identity information of the blockchain node to the block based on the transaction. On the chain, it becomes a piece of data in the distributed database of the blockchain.
  • a narrow transaction refers to a value transfer issued by a user to the blockchain; for example, in a traditional Bitcoin blockchain network, a transaction can be a transfer initiated by a user in the blockchain.
  • the generalized transaction refers to a piece of business data with business intent issued by the user to the blockchain; for example, the operator can build an alliance chain based on actual business needs, and rely on the alliance chain to deploy other types that are not related to value transfer.
  • Online business (such as event forecasting, renting business, vehicle dispatching business, insurance claims business, credit service, medical service, etc.), and in this type of alliance chain, the transaction can be a transaction issued by the user in the alliance chain.
  • Intent business message or business request Transactions in this description should be interpreted as transactions in a broad sense.
  • the random character sequences posted on the blockchain cannot be tampered with, so that the random character sequences corresponding to each blockchain node can be reliably recorded.
  • this specification enables a blockchain node to compete for the right to book the latest block of the blockchain, while the right to book other blocks on the blockchain has been determined, then these can have the right to book
  • the blockchain node is responsible for writing the above transactions containing random character sequences and the identity information of the blockchain nodes into the corresponding blocks and publishing them to the blockchain.
  • the above-mentioned blockchain node does not necessarily directly publish the random character sequence and its identity information to the blockchain in association. It may also be implemented by other blockchain nodes, depending on which zone Blockchain nodes have accounting rights for related blocks.
  • the random character sequence may be fed back to the blockchain node, and the blockchain node determines whether the random character sequence needs to be adopted. In one case, if it is determined that the random character sequence needs to be adopted, the blockchain node may publish the random character sequence to the blockchain in association with its own identity information. In another case, if the currently generated random character sequence is not recognized, the blockchain node can re-invoke the smart contract, and the smart contract regenerates a random character sequence to generate a random character corresponding to the blockchain node. The character sequence is updated; of course, if the blockchain still does not recognize it, the smart contract can continue to be called again until a satisfactory random character sequence is obtained.
  • the release time of the random character sequence should be earlier than the release time of the target character sequence, otherwise the randomness of the random character sequence will be questioned. For example, if the target character sequence is obtained, the same character sequence will be Disguised as a sequence of random characters and posted to the blockchain, it is not really generated by the smart contract described above.
  • step 106 if the random character sequence matches the target character sequence, the generated preliminary block is broadcasted on the entire network within the blockchain; wherein, when the random character sequence is verified to match the target character sequence, When the target character sequence and the corresponding release time are the earliest on the entire network, the preliminary block is recorded as the latest block of the blockchain.
  • the blockchain node A when the blockchain node A receives a preliminary block from the blockchain node B, it can be determined by comparing the random character sequence 1 corresponding to the blockchain node B with the target character sequence. Whether the random character sequence 1 matches the target character sequence. If the blockchain node A also receives a preliminary block from the blockchain node C, and the random character sequence 2 corresponding to the blockchain node C also matches the target character sequence, the blockchain node A can compare the random character sequence 1 and the random character sequence 2 at the moment of release to determine the random character sequence that was released relatively earlier.
  • blockchain node A determines that the random character sequence 1 corresponding to blockchain node B matches the target character sequence, and that among all random character sequences matching the target character sequence, blockchain node B corresponds to The random character sequence 1 has the earliest release time, that is, it can be determined that the random character sequence 1 conforms to "verified as matching the target character sequence and the corresponding release time is the earliest in the entire network", so the blockchain node A can send the The preliminary block of the blockchain node B is recorded as the latest block of the blockchain; similarly, other blockchain nodes can also record the preliminary block from the blockchain node B as the latest area of the blockchain based on the above method.
  • Block which is equivalent to the blockchain node B vying for the right of bookkeeping in the blockchain, and achieving consensus among the various blockchain nodes.
  • the consensus process between the blockchain nodes does not depend on the computing power of each blockchain node, so that even if the blockchain node has mastered 51% of the entire network Or more computing power, still unable to control the accounting rights in the blockchain, to avoid malicious blockchain nodes.
  • a transaction containing the random character sequence and the identity information of the blockchain node may be published to the blockchain, so that the random character sequence and the identity information of the blockchain node are associated To the blockchain.
  • the preliminary block may include a serial number or other characteristic identifier of the transaction, so that a blockchain node that receives the preliminary block can search the blockchain based on the serial number or other characteristic identifier.
  • the target character sequence may be published to the blockchain by a Oracle node. Since the data provided by the oracle machine is considered absolutely reliable, the authenticity of the target character sequence can be ensured.
  • the oracle may obtain the target character sequence from an off-chain object.
  • the off-chain object may randomly generate the target character sequence by a computer, or the off-chain object may control the physical device to randomly release a number of spheres, each There is a one-to-one correspondence between spheres and characters, so that the target character sequence is formed by the release order of each sphere and the characters corresponding to each sphere.
  • the target character sequence is generated by a predictor node by calling the smart contract for generating a character sequence. Because the above-mentioned smart contract has built-in processing logic for randomly generating character sequences, the oracle node can generate the target character sequence randomly by calling the smart contract.
  • the oracle node may broadcast the target character sequence on the entire network to be published into the blockchain by a blockchain node with accounting rights.
  • the oracle node may default to a bookkeeping right, and may directly publish the target character sequence to the blockchain.
  • an asset freezing certificate associated with the random character sequence may be issued to the blockchain, and the asset freezing certificate indicates an area of not less than a preset amount held by the blockchain node.
  • Blockchain assets are in a frozen state; wherein, when there is no asset freezing certificate associated with the random character sequence, the random character sequence is determined as invalid information.
  • a certain threshold of participation can be set for the blockchain nodes participating in the competition for bookkeeping rights, and blockchain nodes with insufficient blockchain assets are excluded (illegal elements may temporarily create some special (To increase the probability of hitting the target character sequence on the blockchain nodes participating in the competition for bookkeeping rights) and increase the evil cost of the blockchain nodes.
  • the random character sequence, the identity information of the blockchain node, and the asset freezing certificate can be included in the same transaction to indicate the association relationship between the asset freezing certificate and the random character sequence.
  • the serial number of the transaction containing the random character sequence and the identity information of the blockchain node may be added to the transaction where the asset freeze certificate is located, or the above-mentioned transaction containing the random character sequence and the blockchain node may be added to the transaction.
  • the transaction serial number of the asset freezing certificate is added to the transaction of the identity information, which depends on the publishing order between the two transactions, that is, the serial number of the earlier published transaction can be added to the later published transaction.
  • a blockchain asset corresponding to the asset freezing certificate is thawed and returned to the blockchain node.
  • a blockchain asset corresponding to the asset freezing certificate is deducted from the blockchain node to participate in the competition The cost of bookkeeping rights.
  • the blockchain node may only have a corresponding random character sequence, that is, each blockchain node has only one chance to compete for the right to account, and all the blockchain nodes have the right to account for the right The probability is consistent.
  • the blockchain node may have a plurality of corresponding random character sequences, and each random character sequence has a corresponding asset freezing certificate; in other words, the blockchain node may provide multiple asset freezing certificates, In order to obtain multiple random character sequences, it helps to increase the probability that the blockchain node will compete for the right of account.
  • the generated preliminary block can be broadcasted on the entire network within the blockchain; accordingly, when the When any random character sequence corresponding to a blockchain node is verified to match the target character sequence and the corresponding release time is the earliest on the entire network, the preliminary block is recorded as the latest block of the blockchain.
  • FIG. 2 is a schematic structural diagram of a blockchain network provided by an exemplary embodiment; as shown in FIG. 2, it is assumed that a blockchain node 21, a blockchain node 22, a blockchain node 23, and Blockchain node 24, etc., the blockchain nodes 21 to 24 can communicate with each other.
  • the two nodes shown in Figure 2 can communicate with each other, and there may be some nodes that need to pass other nodes as a medium. Communication is then achieved, and this specification does not limit this.
  • the blockchain nodes 21 to 23 may be ordinary nodes, the blockchain node 24 may be a oracle node, and transactions issued by the blockchain nodes 21 to 23 in the blockchain are considered unreliable, and The transactions issued by the blockchain node 24 as a oracle node in the blockchain are considered absolutely credible.
  • FIG. 3 is a schematic flowchart of determining a billing right according to an exemplary embodiment.
  • the right to account for the latest block in the blockchain can be contested in the manner shown in Figure 3. This process can include The following steps:
  • Step 302 Generate asset freezing certificate.
  • the blockchain node 21 is taken as an example: the blockchain node 21 can freeze a preset amount of blockchain assets held by itself; for example, the blockchain node 21 can freeze the preset amount The amount of blockchain assets is transferred to a predefined asset freezing account and the corresponding asset freezing certificate is obtained.
  • the blockchain node 21 may issue the asset freezing certificate to the blockchain, so that the asset freezing certificate is recorded in a blockchain ledger maintained by each blockchain node and having a uniform content.
  • Step 304 Obtain a random number string.
  • a blockchain node 21 is taken as an example:
  • the blockchain node 21 can call a smart contract, and the smart contract defines a function logic for generating a random number string in advance, so that the smart contract can automatically based on the function logic.
  • the length of the random number string is restricted in the smart contract.
  • the random number string can be a 128-bit number string. Since the smart contract is published on the blockchain, the functional logic defined in the smart contract is public data, so as to ensure that the generation result of the random number string is objective and fair, and avoid the black box operation caused by human intervention.
  • the blockchain node 21 corresponds to the random number string L1.
  • the smart contract can be repeatedly called until the satisfied random number string is obtained as the random number string L1 described above.
  • each blockchain node can obtain the corresponding random number string by calling the above-mentioned smart contract.
  • the blockchain node 21 may publish its corresponding random number string L1 to the blockchain to indicate the correspondence between the blockchain node 21 and the random number string L1, and may obtain the Release time (characterized by time stamp) of the random number string L1. Then, even if the random number string L1 corresponding to different blockchain nodes is the same, it is possible to compare and determine the right to bookkeeping right through the difference of the publishing time.
  • Step 306 Obtain a target digital string.
  • the oracle machine node 24 can obtain the target digital string and publish the target digital string to the blockchain; correspondingly, each blockchain node can read the target digital string from the blockchain, thereby Get the target number string.
  • the oracle node 24 may call the above-mentioned smart contract so that the smart contract can automatically and randomly generate a digital string, such as an 8-bit digital string, as the target digital string.
  • the oracle node 24 may receive a target number string passed in by an off-chain object, for example, the target number string may be generated by the off-chain object by a random algorithm.
  • Step 308 Determine whether the random number string matches the target number string.
  • each blockchain node can compare its corresponding random number string with the target number string to determine whether the two match. If the random number string is the same as the target number string, it can determine Match the random number string to the target number string.
  • Step 310 When the random number string matches the target number string, broadcast the preliminary blocks generated by the blockchain node itself to the entire network, and receive the preliminary blocks broadcast by other blockchain nodes.
  • the blockchain node 21 is taken as an example: When the blockchain node 21 determines that the corresponding random number string 1 matches the target number string, the blockchain node 21 may match the generated preliminary block Broadcast the whole network, so that the blockchain nodes 22-24 can receive the preliminary block.
  • the blockchain node 21 may generate the preliminary block at any time, for example, the preliminary block has been generated before step 310, or may generate the preliminary block when it is confirmed that the random number string 1 matches the target number string. This specification does not limit this.
  • the blockchain node 22 may receive the preliminary block broadcast by the above-mentioned blockchain node 21.
  • the blockchain node 23 can broadcast the generated preliminary block throughout the network, so that Blockchain nodes 21-22, 24, etc. can all receive the preliminary block. Among them, the blockchain node 23 can also receive the preliminary block broadcast by the above-mentioned blockchain node 21.
  • Step 312 Select the latest block and write it into the blockchain.
  • each of the blockchain nodes 21 to 24 and the like maintains a blockchain ledger locally.
  • Each blockchain node can determine the latest block separately and write the latest block to the block it maintains.
  • the content maintenance of the blockchain ledger is realized.
  • the blockchain node 21 can test the preliminary block B2, which can include:
  • the preliminary block B2 read the transaction corresponding to the transaction serial number and its transaction content from the blockchain.
  • the transaction content includes a random number string corresponding to the node 23 of the blockchain.
  • the block chain node 21 can check whether the random number string matches the target number string; if it does not match, the preliminary block B2 can be ignored.
  • the above transaction content includes the frozen asset certificate corresponding to the blockchain node 23
  • the random number string contained in the transaction content is considered valid; otherwise, the preliminary block B2 can be ignored.
  • the frozen asset certificate can also be issued to the blockchain through independent transactions, and its transaction serial number can be recorded in the above-mentioned preliminary block B2, so that the blockchain node 21 can obtain the blockchain node 23 accordingly. Corresponding frozen asset certificate.
  • the above transaction content includes the release time of the random number string.
  • the release time of the random number string should be earlier than the release time of the target number string.
  • the random number string contained in the above transaction content should not be used to compete for the accounting rights of other blocks, for example, the release time of the random number string should be later than the release time of the target number string corresponding to the previous block.
  • the blockchain node 21 can compare the release time of the random number string corresponding to the blockchain node 21 and the release time of the random number string corresponding to the blockchain node 23: when the random number corresponding to the blockchain node 21 is When the publishing time of the digital string is earlier than the publishing time of the random digital string corresponding to the blockchain node 23, the blockchain node 21 can write the preliminary block B1 into the blockchain ledger maintained by itself; otherwise, the blockchain The node 21 can write the prepared block B2 into the blockchain ledger maintained by itself.
  • the preliminary block B1 can also be prepared separately in the above manner.
  • Block B2 is checked, and based on the sequence of the release times of the random number strings corresponding to the blockchain node 21 and the blockchain node 23 respectively, it is determined that the prepared blocks that pass the test and are released first in the entire network are written into the area they maintain Blockchain ledger.
  • each blockchain node in the blockchain network can participate in the scramble for the right to account for each block through a method such as that shown in Figure 3, and since all data is public, immutable, Verifiable, which can ensure that each blockchain node writes the same content in the blockchain ledger maintained by itself, and achieves unified network-wide management and maintenance of the blockchain ledger.
  • FIG. 4 is a schematic structural diagram of a device according to an exemplary embodiment.
  • the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410.
  • the processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it to form a block issuing device on a logical level.
  • one or more embodiments of this specification do not exclude other implementations, such as a logic device or a combination of software and hardware, etc. That is to say, the execution body of the following processing flow is not limited to each A logic unit can also be a hardware or logic device.
  • the block publishing device may include:
  • the first publishing unit 52 publishes the random character sequence to the blockchain in association with the identity information of the blockchain node, wherein the publishing time of the random character sequence is earlier than that of the target character sequence;
  • the broadcasting unit 53 when the random character sequence matches the target character sequence, broadcasts the generated preliminary block within the blockchain on the entire network; wherein, when the random character sequence is verified as matching the When the target character sequence and the corresponding release time are the earliest in the entire network, the preliminary block is recorded as the latest block of the blockchain.
  • the first issuing unit 52 is specifically configured to:
  • the preliminary block includes a serial number of the transaction, so that a blockchain node receiving the preliminary block searches the transaction from the blockchain according to the serial number, so as to match the random characters. The sequence and its release time are verified.
  • the target character sequence is published to the blockchain by a predictor node.
  • the target character sequence is generated by a predictor node by calling the smart contract for generating a character sequence.
  • Optional also includes:
  • the second issuing unit 54 issues an asset freezing certificate associated with the random character sequence to the blockchain, where the asset freezing certificate indicates that the blockchain node holds not less than a preset amount of blocks Chain assets are frozen;
  • the random character sequence is determined as invalid information.
  • the blockchain asset corresponding to the asset freezing certificate is thawed and returned to the blockchain node;
  • a blockchain asset corresponding to the asset freezing certificate is deducted from the blockchain node.
  • the blockchain node has multiple corresponding random character sequences, and each random character sequence has a corresponding asset freezing certificate; the broadcasting unit 53 is specifically configured to:
  • the generated preliminary block is broadcasted on the entire network within the blockchain;
  • the preliminary block is recorded as the blockchain Latest block.
  • the system, device, module, or unit described in the foregoing embodiments may be specifically implemented by a computer chip or entity, or a product with a certain function.
  • a typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or a combination of any of these devices.
  • a computer includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
  • processors CPUs
  • input / output interfaces output interfaces
  • network interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information can be stored by any method or technology.
  • Information may be computer-readable instructions, data structures, modules of a program, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic disk storage, quantum memory, graphene-based storage media, or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices.
  • computer-readable media does not include temporary computer-readable media, such as modulated data signals and carrier waves.
  • first, second, third, etc. may be used to describe various information in one or more embodiments of the present specification, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” as used herein can be interpreted as “at” or "when” or "in response to determination”.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Economics (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Development Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

One or more embodiments of the present description provide a block release method and apparatus, and an electronic device, which are applied to a blockchain node. The method comprises: invoking a smart contract for generating a character sequence, the smart contract being used to generate a random character sequence for a blockchain node; releasing the random character sequence and identity information of the blockchain node to a blockchain in an associated manner, wherein the release time of the random character sequence is earlier than the release time of a target character sequence; and where the random character sequence matches the target character sequence, performing network-wide broadcast on a generated preparatory block in the blockchain, wherein when the random character sequence is verified to match the target character sequence and the corresponding release time is the earliest in the whole network, the preparatory block is recorded as the latest block of the blockchain.

Description

区块发布方法及装置、电子设备Block publishing method and device, and electronic equipment 技术领域Technical field
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种区块发布方法及装置、电子设备。One or more embodiments of the present specification relate to the field of blockchain technology, and in particular, to a method and device for issuing blocks, and electronic equipment.
背景技术Background technique
区块链中包含数量众多的区块链节点,共识机制用于在这些区块链节点之间达成一致,以确保这些区块链节点共同维护统一内容的区块链账本。在相关技术中,通常采用PoW(Proof of Work,工作量证明)算法在这些区块链节点之间达成共识;具体地,由所有区块链节点分别计算同一数学题的解,并由最先求得符合条件的解的区块链节点争得记账权,由该区块链节点生成区块链的最新区块,并且所有区块链节点都将该区块链节点生成的区块记录至区块链账本中。The blockchain contains a large number of blockchain nodes. The consensus mechanism is used to reach an agreement between these blockchain nodes to ensure that these blockchain nodes jointly maintain a blockchain ledger with unified content. In related technologies, a PoW (Proof of Work, Proof of Work) algorithm is commonly used to reach consensus among these blockchain nodes; specifically, all blockchain nodes calculate the solution to the same mathematical problem, and the first A blockchain node that finds a qualified solution contends for bookkeeping rights, the blockchain node generates the latest block of the blockchain, and all blockchain nodes generate a block record of the blockchain node To the blockchain ledger.
发明内容Summary of the Invention
有鉴于此,本说明书一个或多个实施例提供一种区块发布方法及装置、电子设备。In view of this, one or more embodiments of the present specification provide a method and device for issuing a block, and an electronic device.
为实现上述目的,本说明书一个或多个实施例提供技术方案如下:To achieve the above purpose, one or more embodiments of the present specification provide technical solutions as follows:
根据本说明书一个或多个实施例的第一方面,提出了一种区块发布方法,应用于区块链节点;所述方法包括:According to a first aspect of one or more embodiments of the present specification, a block publishing method is proposed, which is applied to a blockchain node; the method includes:
调用用于生成字符序列的智能合约,所述智能合约被用于为区块链节点生成随机字符序列;Calling a smart contract for generating a character sequence, the smart contract being used to generate a random character sequence for a blockchain node;
将所述随机字符序列与所述区块链节点的身份信息相关联地发布至区块链,其中所述随机字符序列的发布时刻早于目标字符序列的发布时刻;Publishing the random character sequence to the blockchain in association with the identity information of the blockchain node, wherein the publishing time of the random character sequence is earlier than the publishing time of the target character sequence;
在所述随机字符序列匹配于所述目标字符序列的情况下,将生成的预备区块在区块链内进行全网广播;其中,当所述随机字符序列被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早时,所述预备区块被记录为所述区块链的最新区块。In the case where the random character sequence matches the target character sequence, the generated preliminary block is broadcasted on the entire network within the blockchain; wherein, when the random character sequence is verified to match the target character When the sequence and corresponding release time is the earliest in the entire network, the preliminary block is recorded as the latest block of the blockchain.
根据本说明书一个或多个实施例的第二方面,提出了一种区块发布装置,应用于区 块链节点;所述装置包括:According to a second aspect of one or more embodiments of the present specification, a block publishing device is proposed and applied to a block chain node; the device includes:
调用单元,调用用于生成字符序列的智能合约,所述智能合约被用于为区块链节点生成随机字符序列;A calling unit for invoking a smart contract for generating a character sequence, the smart contract being used to generate a random character sequence for a blockchain node;
第一发布单元,将所述随机字符序列与所述区块链节点的身份信息相关联地发布至区块链,其中所述随机字符序列的发布时刻早于目标字符序列的发布时刻;A first publishing unit that publishes the random character sequence to the blockchain in association with the identity information of the blockchain node, wherein the publishing time of the random character sequence is earlier than the publishing time of the target character sequence;
广播单元,在所述随机字符序列匹配于所述目标字符序列的情况下,将生成的预备区块在区块链内进行全网广播;其中,当所述随机字符序列被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早时,所述预备区块被记录为所述区块链的最新区块。The broadcasting unit, when the random character sequence matches the target character sequence, broadcasts the generated preliminary block on the entire network within the blockchain; wherein, when the random character sequence is verified to match the target character sequence, When the target character sequence and the corresponding release time are the earliest on the entire network, the preliminary block is recorded as the latest block of the blockchain.
根据本说明书一个或多个实施例的第三方面,提出了一种电子设备,包括:According to a third aspect of one or more embodiments of the present specification, an electronic device is provided, including:
处理器;processor;
用于存储处理器可执行指令的存储器;Memory for storing processor-executable instructions;
其中,所述处理器通过运行所述可执行指令以实现如上述实施例中任一所述的区块发布方法。The processor executes the executable instructions to implement the block publishing method according to any one of the foregoing embodiments.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是一示例性实施例提供的一种区块发布方法的流程图。FIG. 1 is a flowchart of a block publishing method according to an exemplary embodiment.
图2是一示例性实施例提供的一种区块链网络的结构示意图。FIG. 2 is a schematic structural diagram of a blockchain network according to an exemplary embodiment.
图3是一示例性实施例提供的一种确定记账权的流程示意图。FIG. 3 is a schematic flowchart of determining a billing right according to an exemplary embodiment.
图4是一示例性实施例提供的一种设备的结构示意图。FIG. 4 is a schematic structural diagram of a device according to an exemplary embodiment.
图5是一示例性实施例提供的一种区块发布装置的框图。FIG. 5 is a block diagram of a block publishing apparatus according to an exemplary embodiment.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of the specification, as detailed in the appended claims.
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。It should be noted that, in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. In addition, a single step described in this specification may be divided into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for other embodiments. description.
图1是一示例性实施例提供的一种区块发布方法的流程图。如图1所示,该方法应用于区块链节点,可以包括以下步骤:FIG. 1 is a flowchart of a block publishing method according to an exemplary embodiment. As shown in Figure 1, the method is applied to a blockchain node and can include the following steps:
步骤102,调用用于生成字符序列的智能合约,所述智能合约被用于为区块链节点生成随机字符序列。In step 102, a smart contract for generating a character sequence is invoked, and the smart contract is used to generate a random character sequence for a blockchain node.
在一实施例中,智能合约中可以预先写入生成随机字符序列的处理逻辑,使得该智能合约被调用后,可以基于上述的处理逻辑自动为区块链节点生成随机字符序列。由于智能合约上的处理逻辑为公开内容,并且整个处理过程由智能合约自动完成、不存在人工干预,使得能够确保生成的随机字符序列的随机性,避免暗箱操作或作弊行为。In one embodiment, processing logic for generating a random character sequence may be written in the smart contract in advance, so that after the smart contract is called, a random character sequence may be automatically generated for a blockchain node based on the processing logic described above. Because the processing logic on the smart contract is public content, and the entire processing process is automatically completed by the smart contract, there is no manual intervention, so that the randomness of the generated random character sequence can be ensured, and the black box operation or cheating behavior is avoided.
在一实施例中,随机字符序列并非完全“随机”,仍然可以符合一定的预设规则,比如该预设规则可以包括字符数量、字符类型、字符的取值范围等,本说明书并不对此进行限制。例如,预设规则可以限制随机字符序列为8位数字,则智能合约生成的随机字符序列可以为“45614381”,而不会生成“ax0642f0”;又例如,预设规则可以限制随机字符序列为5位数字+3位字母,则智能合约生成的随机字符序列可以为“ax0642f0”,而不会生成序列“45614381”。其中,当随机字符序列符合上述的预设规则时,下述的目标字符序列同样符合该预设规则,以使得随机字符序列与目标字符序列在结构、形式上保持一致,确保随机字符序列与目标字符序列之间具有可比性。In an embodiment, the random character sequence is not completely “random” and can still meet certain preset rules. For example, the preset rule may include the number of characters, the character type, and the value range of the characters. This specification does not address this. limit. For example, the preset rule can limit the random character sequence to 8 digits, and the random character sequence generated by the smart contract can be "45614381" instead of "ax0642f0"; for example, the preset rule can limit the random character sequence to 5 Digit + 3 letters, the random character sequence generated by the smart contract can be "ax0642f0", and the sequence "45614381" will not be generated. Wherein, when the random character sequence conforms to the preset rule described above, the target character sequence described below also conforms to the preset rule, so that the random character sequence and the target character sequence are consistent in structure and form, and the random character sequence and the target are ensured. Character sequences are comparable.
在一实施例中,区块链中存在多个区块链节点,智能合约为不同区块链节点生成的随机字符序列应当相互区别,以避免不止一个区块链节点的随机字符序列与目标字符序列相匹配,确保仅一个区块链节点生成的预备区块被记录为区块链的最新区块。In one embodiment, there are multiple blockchain nodes in the blockchain, and the random character sequences generated by the smart contract for different blockchain nodes should be different from each other to avoid random character sequences and target characters for more than one blockchain node. The sequences match to ensure that only the preliminary blocks generated by one blockchain node are recorded as the latest block of the blockchain.
步骤104,将所述随机字符序列与所述区块链节点的身份信息相关联地发布至区块链,其中所述随机字符序列的发布时刻早于目标字符序列的发布时刻。Step 104: Publish the random character sequence to the blockchain in association with the identity information of the blockchain node, wherein the publishing time of the random character sequence is earlier than the publishing time of the target character sequence.
在一实施例中,区块链节点可以通过在区块链的客户端上创建交易,以基于该交易将所述随机字符序列与所述区块链节点的身份信息相关联地发布至区块链上,成为区块链的分布式数据库中的一笔数据。In an embodiment, the blockchain node may create a transaction on the blockchain client to publish the random character sequence and the identity information of the blockchain node to the block based on the transaction. On the chain, it becomes a piece of data in the distributed database of the blockchain.
需要指出的是:区块链中的交易,存在狭义的交易以及广义的交易之分。狭义的交易是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易可以是用户在区块链中发起的一笔转账。而广义的交易是指用户向区块链发布的一笔具有业务意图的业务数据;例如,运营方可以基于实际的业务需求搭建一个联盟链,依托于联盟链部署一些与价值转移无关的其它类型的在线业务(比如,事件预测、租房业务、车辆调度业务、保险理赔业务、信用服务、医疗服务等),而在这类联盟链中,交易可以是用户在联盟链中发布的一笔具有业务意图的业务消息或者业务请求。本说明书中的交易,应当倾向于理解为广义上的交易。It should be noted that: transactions in the blockchain are divided into narrow transactions and broad transactions. A narrow transaction refers to a value transfer issued by a user to the blockchain; for example, in a traditional Bitcoin blockchain network, a transaction can be a transfer initiated by a user in the blockchain. The generalized transaction refers to a piece of business data with business intent issued by the user to the blockchain; for example, the operator can build an alliance chain based on actual business needs, and rely on the alliance chain to deploy other types that are not related to value transfer. Online business (such as event forecasting, renting business, vehicle dispatching business, insurance claims business, credit service, medical service, etc.), and in this type of alliance chain, the transaction can be a transaction issued by the user in the alliance chain. Intent business message or business request. Transactions in this description should be interpreted as transactions in a broad sense.
在一实施例中,由于区块链采用分布式数据库,使得发布至区块链上的随机字符序列无法被篡改,从而可以对每个区块链节点对应的随机字符序列均实现可靠记录。In one embodiment, since the blockchain uses a distributed database, the random character sequences posted on the blockchain cannot be tampered with, so that the random character sequences corresponding to each blockchain node can be reliably recorded.
在一实施例中,本说明书可使区块链节点争夺区块链的最新区块的记账权,而区块链上的其他区块的记账权已经确定,那么可由这些具备记账权的区块链节点负责将上述包含随机字符序列和区块链节点的身份信息的交易写入相应的区块中,并发布至区块链。换言之,步骤104中并不一定由上述区块链节点直接将随机字符序列和其身份信息相关联地发布至区块链,也可能由其他区块链节点实施该发布操作,这取决于哪个区块链节点具备相关区块的记账权。In an embodiment, this specification enables a blockchain node to compete for the right to book the latest block of the blockchain, while the right to book other blocks on the blockchain has been determined, then these can have the right to book The blockchain node is responsible for writing the above transactions containing random character sequences and the identity information of the blockchain nodes into the corresponding blocks and publishing them to the blockchain. In other words, in step 104, the above-mentioned blockchain node does not necessarily directly publish the random character sequence and its identity information to the blockchain in association. It may also be implemented by other blockchain nodes, depending on which zone Blockchain nodes have accounting rights for related blocks.
在一实施例中,可以将所述随机字符序列反馈至所述区块链节点,由区块链节点确定是否需要采用该随机字符序列。在一种情况下,如果确认需要采用该随机字符序列,区块链节点可以将该随机字符序列与自身的身份信息相关联地发布至区块链。在另一种情况下,如果不认可当前生成的随机字符序列,区块链节点可以重新调用所述智能合约,由该智能合约重新生成一随机字符序列,以对该区块链节点对应的随机字符序列进行更新;当然,如果区块链仍然不认可,可以继续重新调用所述智能合约,直至得到满意的随机字符序列。In an embodiment, the random character sequence may be fed back to the blockchain node, and the blockchain node determines whether the random character sequence needs to be adopted. In one case, if it is determined that the random character sequence needs to be adopted, the blockchain node may publish the random character sequence to the blockchain in association with its own identity information. In another case, if the currently generated random character sequence is not recognized, the blockchain node can re-invoke the smart contract, and the smart contract regenerates a random character sequence to generate a random character corresponding to the blockchain node. The character sequence is updated; of course, if the blockchain still does not recognize it, the smart contract can continue to be called again until a satisfactory random character sequence is obtained.
在一实施例中,随机字符序列的发布时刻应当早于目标字符序列的发布时刻,否则将导致随机字符序列的随机性存疑,譬如可能是获取了目标字符序列的情况下,将相同的字符序列伪装为随机字符序列并发布至区块链,而并非真正由上述的智能合约所生成。In an embodiment, the release time of the random character sequence should be earlier than the release time of the target character sequence, otherwise the randomness of the random character sequence will be questioned. For example, if the target character sequence is obtained, the same character sequence will be Disguised as a sequence of random characters and posted to the blockchain, it is not really generated by the smart contract described above.
步骤106,在所述随机字符序列匹配于所述目标字符序列的情况下,将生成的预备区块在区块链内进行全网广播;其中,当所述随机字符序列被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早时,所述预备区块被记录为所述区块链的最新区块。In step 106, if the random character sequence matches the target character sequence, the generated preliminary block is broadcasted on the entire network within the blockchain; wherein, when the random character sequence is verified to match the target character sequence, When the target character sequence and the corresponding release time are the earliest on the entire network, the preliminary block is recorded as the latest block of the blockchain.
在一实施例中,当区块链节点A收到来自区块链节点B的预备区块时,通过将该区块链节点B对应的随机字符序列1与目标字符序列进行比较,即可确定该随机字符序列1是否匹配于目标字符序列。如果区块链节点A还收到来自区块链节点C的预备区块,并且该区块链节点C对应的随机字符序列2也匹配于目标字符序列,区块链节点A可以比较随机字符序列1与随机字符序列2的发布时刻,以确定相对更早发布的随机字符序列。通过上述方式,假定区块链节点A确定出区块链节点B对应的随机字符序列1匹配于目标字符序列,并且在所有匹配于目标字符序列的随机字符序列中,区块链节点B对应的随机字符序列1的发布时刻最早,即可判定该随机字符序列1符合“被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早”,因此区块链节点A可以将来自区块链节点B的预备区块记录为区块链的最新区块;类似地,其他区块链节点也可以基于上述方式将来自区块链节点B的预备区块记录为区块链的最新区块,相当于该区块链节点B争夺到了区块链中的记账权,实现了各个区块链节点之间的共识。In an embodiment, when the blockchain node A receives a preliminary block from the blockchain node B, it can be determined by comparing the random character sequence 1 corresponding to the blockchain node B with the target character sequence. Whether the random character sequence 1 matches the target character sequence. If the blockchain node A also receives a preliminary block from the blockchain node C, and the random character sequence 2 corresponding to the blockchain node C also matches the target character sequence, the blockchain node A can compare the random character sequence 1 and the random character sequence 2 at the moment of release to determine the random character sequence that was released relatively earlier. In the above manner, it is assumed that blockchain node A determines that the random character sequence 1 corresponding to blockchain node B matches the target character sequence, and that among all random character sequences matching the target character sequence, blockchain node B corresponds to The random character sequence 1 has the earliest release time, that is, it can be determined that the random character sequence 1 conforms to "verified as matching the target character sequence and the corresponding release time is the earliest in the entire network", so the blockchain node A can send the The preliminary block of the blockchain node B is recorded as the latest block of the blockchain; similarly, other blockchain nodes can also record the preliminary block from the blockchain node B as the latest area of the blockchain based on the above method. Block, which is equivalent to the blockchain node B vying for the right of bookkeeping in the blockchain, and achieving consensus among the various blockchain nodes.
在一实施例中,由于随机字符序列由智能合约随机生成,使得区块链节点之间的共识过程不依赖于各个区块链节点的算力,使得即便区块链节点掌握了全网51%或更多的算力,仍然无法掌控区块链内的记账权,避免算力强大的区块链节点作恶。In an embodiment, because the random character sequence is randomly generated by the smart contract, the consensus process between the blockchain nodes does not depend on the computing power of each blockchain node, so that even if the blockchain node has mastered 51% of the entire network Or more computing power, still unable to control the accounting rights in the blockchain, to avoid malicious blockchain nodes.
在一实施例中,可以将包含所述随机字符序列与所述区块链节点的身份信息的交易发布至区块链,从而使得该随机字符序列与该区块链节点的身份信息被相关联地发布至区块链。其中,所述预备区块中可以包含所述交易的流水号或其他特征标识,使接收到所述预备区块的区块链节点能够根据所述流水号或其他特征标识从区块链中查找所述交易,从而获取到所述随机字符序列及其发布时刻,并该随机字符序列与目标字符序列的发布顺序、匹配情况等进行验证。In an embodiment, a transaction containing the random character sequence and the identity information of the blockchain node may be published to the blockchain, so that the random character sequence and the identity information of the blockchain node are associated To the blockchain. The preliminary block may include a serial number or other characteristic identifier of the transaction, so that a blockchain node that receives the preliminary block can search the blockchain based on the serial number or other characteristic identifier. The transaction, thereby obtaining the random character sequence and its release time, and verifying the release order, matching situation, and the like of the random character sequence and the target character sequence.
在一实施例中,所述目标字符序列可以由预言机(Oracle)节点发布至所述区块链。由于预言机节点提供的数据被认为绝对可靠,因而可以确保该目标字符序列的真实性。In one embodiment, the target character sequence may be published to the blockchain by a Oracle node. Since the data provided by the oracle machine is considered absolutely reliable, the authenticity of the target character sequence can be ensured.
在一实施例中,预言机可以从链外对象处获取该目标字符序列,例如链外对象可以通过计算机随机生成该目标字符序列,或者链外对象可以控制实体设备依次随机释放若干球体、每一球体与字符之间一一对应,从而由各个球体的释放顺序及每个球体所对应的字符构成目标字符序列。In one embodiment, the oracle may obtain the target character sequence from an off-chain object. For example, the off-chain object may randomly generate the target character sequence by a computer, or the off-chain object may control the physical device to randomly release a number of spheres, each There is a one-to-one correspondence between spheres and characters, so that the target character sequence is formed by the release order of each sphere and the characters corresponding to each sphere.
在一实施例中,所述目标字符序列由预言机节点通过调用所述用于生成字符序列的智能合约而生成。由于上述的智能合约内置随机生成字符序列的处理逻辑,因而预言机节点可以通过调用该智能合约,使其随机生成目标字符序列。In an embodiment, the target character sequence is generated by a predictor node by calling the smart contract for generating a character sequence. Because the above-mentioned smart contract has built-in processing logic for randomly generating character sequences, the oracle node can generate the target character sequence randomly by calling the smart contract.
在一实施例中,预言机节点可以通过将目标字符序列在全网广播,以由具备记账权的区块链节点发布至区块链中。在另一实施例中,预言机节点可以默认为具备记账权,可以直接将目标字符序列发布至区块链中。In one embodiment, the oracle node may broadcast the target character sequence on the entire network to be published into the blockchain by a blockchain node with accounting rights. In another embodiment, the oracle node may default to a bookkeeping right, and may directly publish the target character sequence to the blockchain.
在一实施例中,可以向所述区块链发布与所述随机字符序列相关联的资产冻结凭证,所述资产冻结凭证表明所述区块链节点持有的不少于预设数额的区块链资产处于冻结状态;其中,当所述随机字符序列不存在相关联的资产冻结凭证时,所述随机字符序列被判定为无效信息。通过要求提供资产冻结凭证,可以对参与争夺记账权的区块链节点设置一定的参与门槛,排除持有的区块链资产不足的区块链节点(不法分子可能为了作恶而临时创建一些专用于参与争夺记账权的区块链节点,以此增加命中目标字符序列的概率),提高区块链节点的作恶成本。In an embodiment, an asset freezing certificate associated with the random character sequence may be issued to the blockchain, and the asset freezing certificate indicates an area of not less than a preset amount held by the blockchain node. Blockchain assets are in a frozen state; wherein, when there is no asset freezing certificate associated with the random character sequence, the random character sequence is determined as invalid information. By requiring the provision of asset freezing credentials, a certain threshold of participation can be set for the blockchain nodes participating in the competition for bookkeeping rights, and blockchain nodes with insufficient blockchain assets are excluded (illegal elements may temporarily create some special (To increase the probability of hitting the target character sequence on the blockchain nodes participating in the competition for bookkeeping rights) and increase the evil cost of the blockchain nodes.
在一实施例中,可以将随机字符序列、区块链节点的身份信息和资产冻结凭证包含于同一交易中,以表明该资产冻结凭证与随机字符序列之间的关联关系。在另一实施例中,可以在资产冻结凭证所处的交易中添加上述包含随机字符序列和区块链节点的身份信息的交易的流水号,或者在上述包含随机字符序列和区块链节点的身份信息的交易中添加资产冻结凭证所处的交易的流水号,这取决于这两个交易之间的发布顺序,即较早发布的交易的流水号可以被添加至较晚发布的交易中。In one embodiment, the random character sequence, the identity information of the blockchain node, and the asset freezing certificate can be included in the same transaction to indicate the association relationship between the asset freezing certificate and the random character sequence. In another embodiment, the serial number of the transaction containing the random character sequence and the identity information of the blockchain node may be added to the transaction where the asset freeze certificate is located, or the above-mentioned transaction containing the random character sequence and the blockchain node may be added to the transaction The transaction serial number of the asset freezing certificate is added to the transaction of the identity information, which depends on the publishing order between the two transactions, that is, the serial number of the earlier published transaction can be added to the later published transaction.
在一实施例中,在所述随机字符序列匹配于所述目标字符序列的情况下,所述资产冻结凭证对应的区块链资产被解冻并归还至所述区块链节点。In one embodiment, when the random character sequence matches the target character sequence, a blockchain asset corresponding to the asset freezing certificate is thawed and returned to the blockchain node.
在一实施例中,在所述随机字符序列不匹配于所述目标字符序列的情况下,所述资产冻结凭证对应的区块链资产被从所述区块链节点处扣除,以作为参与争夺记账权的成本。In an embodiment, in a case where the random character sequence does not match the target character sequence, a blockchain asset corresponding to the asset freezing certificate is deducted from the blockchain node to participate in the competition The cost of bookkeeping rights.
在一实施例中,所述区块链节点可以仅存在一个对应的随机字符序列,即每一区块链节点仅存在一次争夺记账权的机会,所有区块链节点争得记账权的概率一致。In an embodiment, the blockchain node may only have a corresponding random character sequence, that is, each blockchain node has only one chance to compete for the right to account, and all the blockchain nodes have the right to account for the right The probability is consistent.
在一实施例中,所述区块链节点可以存在多个对应的随机字符序列,每一随机字符序列分别存在对应的资产冻结凭证;换言之,区块链节点可以通过提供多份资产冻结凭证,以取得多个随机字符序列,有助于提升该区块链节点争得记账权的概率。其中,在所述区块链节点对应的任一随机字符序列匹配于所述目标字符序列的情况下,可以将生成的预备区块在区块链内进行全网广播;相应地,当所述区块链节点对应的任一随机字符序列被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早时,所述预备区 块被记录为所述区块链的最新区块。In one embodiment, the blockchain node may have a plurality of corresponding random character sequences, and each random character sequence has a corresponding asset freezing certificate; in other words, the blockchain node may provide multiple asset freezing certificates, In order to obtain multiple random character sequences, it helps to increase the probability that the blockchain node will compete for the right of account. Wherein, if any random character sequence corresponding to the blockchain node matches the target character sequence, the generated preliminary block can be broadcasted on the entire network within the blockchain; accordingly, when the When any random character sequence corresponding to a blockchain node is verified to match the target character sequence and the corresponding release time is the earliest on the entire network, the preliminary block is recorded as the latest block of the blockchain.
为了便于理解,下面以区块链内的区块链节点为例,对本说明书的区块发布方案进行描述。图2是一示例性实施例提供的一种区块链网络的结构示意图;如图2所示,假定区块链中存在区块链节点21、区块链节点22、区块链节点23和区块链节点24等,该区块链节点21~24之间可以相互通信,比如图2所示的两两节点之间均可以实现通信,也可能存在部分节点之间需要通过其他节点作为中继而实现通信,本说明书并不对此进行限制。在一实施例中,区块链节点21~23可以为普通节点,区块链节点24可以为预言机节点,区块链节点21~23在区块链中发布的交易被认为不可信,而作为预言机节点的区块链节点24在区块链中发布的交易被认为绝对可信。In order to facilitate understanding, the following describes a block publishing scheme in this specification by taking a blockchain node in the blockchain as an example. FIG. 2 is a schematic structural diagram of a blockchain network provided by an exemplary embodiment; as shown in FIG. 2, it is assumed that a blockchain node 21, a blockchain node 22, a blockchain node 23, and Blockchain node 24, etc., the blockchain nodes 21 to 24 can communicate with each other. For example, the two nodes shown in Figure 2 can communicate with each other, and there may be some nodes that need to pass other nodes as a medium. Communication is then achieved, and this specification does not limit this. In an embodiment, the blockchain nodes 21 to 23 may be ordinary nodes, the blockchain node 24 may be a oracle node, and transactions issued by the blockchain nodes 21 to 23 in the blockchain are considered unreliable, and The transactions issued by the blockchain node 24 as a oracle node in the blockchain are considered absolutely credible.
基于图2所示的区块链网络,图3是一示例性实施例提供的一种确定记账权的流程示意图。对于诸如上述区块链节点21~24等区块链网络中的任一区块链节点,可以通过如图3所示的方式争夺区块链中最新区块的记账权,该过程可以包括以下步骤:Based on the blockchain network shown in FIG. 2, FIG. 3 is a schematic flowchart of determining a billing right according to an exemplary embodiment. For any blockchain node in a blockchain network such as the above-mentioned blockchain nodes 21 to 24, the right to account for the latest block in the blockchain can be contested in the manner shown in Figure 3. This process can include The following steps:
步骤302,生成资产冻结凭证。Step 302: Generate asset freezing certificate.
在一实施例中,以区块链节点21为例:该区块链节点21可以对自身持有的预设数额的区块链资产进行冻结;例如,区块链节点21可以将该预设数额的区块链资产转入预定义的资产冻结账户,并获得相应的资产冻结凭证。In one embodiment, the blockchain node 21 is taken as an example: the blockchain node 21 can freeze a preset amount of blockchain assets held by itself; for example, the blockchain node 21 can freeze the preset amount The amount of blockchain assets is transferred to a predefined asset freezing account and the corresponding asset freezing certificate is obtained.
在一实施例中,区块链节点21可以将资产冻结凭证向区块链进行发布,使得该资产冻结凭证被记录至各个区块链节点分别维护、内容统一的区块链账本中。In one embodiment, the blockchain node 21 may issue the asset freezing certificate to the blockchain, so that the asset freezing certificate is recorded in a blockchain ledger maintained by each blockchain node and having a uniform content.
步骤304,获取随机数字串。Step 304: Obtain a random number string.
在一实施例中,以区块链节点21为例:该区块链节点21可以调用智能合约,该智能合约预先定义了生成随机数字串的功能逻辑,使得该智能合约可以基于该功能逻辑自动生成区块链节点21对应的随机数字串。智能合约中约束了随机数字串的长度,比如随机数字串可以为128位数字串。由于智能合约被发布于区块链上,使得智能合约中定义的功能逻辑为公开数据,从而确保对于随机数字串的生成结果客观、公平,避免人为干预造成的暗箱操作等情况。In one embodiment, a blockchain node 21 is taken as an example: The blockchain node 21 can call a smart contract, and the smart contract defines a function logic for generating a random number string in advance, so that the smart contract can automatically based on the function logic. Generate a random number string corresponding to the blockchain node 21. The length of the random number string is restricted in the smart contract. For example, the random number string can be a 128-bit number string. Since the smart contract is published on the blockchain, the functional logic defined in the smart contract is public data, so as to ensure that the generation result of the random number string is objective and fair, and avoid the black box operation caused by human intervention.
假定区块链节点21对应于随机数字串L1。其中,当区块链节点21对智能合约生成的随机数字串不满意时,可以通过多次反复调用该智能合约,直至获得满足的随机数字串,以作为上述的随机数字串L1。类似地,每一区块链节点均可以通过调用上述的智能合约,获得相应的随机数字串。It is assumed that the blockchain node 21 corresponds to the random number string L1. Among them, when the blockchain node 21 is not satisfied with the random number string generated by the smart contract, the smart contract can be repeatedly called until the satisfied random number string is obtained as the random number string L1 described above. Similarly, each blockchain node can obtain the corresponding random number string by calling the above-mentioned smart contract.
在一实施例中,区块链节点21可以将自身对应的随机数字串L1发布至区块链,以表明该区块链节点21与该随机数字串L1之间的对应关系,并且可以获取该随机数字串L1的发布时刻(通过时间戳表征)。那么,即便不同区块链节点对应的随机数字串L1相同,也可以通过发布时刻的差异进行比较,实现对记账权的争夺与确认。In an embodiment, the blockchain node 21 may publish its corresponding random number string L1 to the blockchain to indicate the correspondence between the blockchain node 21 and the random number string L1, and may obtain the Release time (characterized by time stamp) of the random number string L1. Then, even if the random number string L1 corresponding to different blockchain nodes is the same, it is possible to compare and determine the right to bookkeeping right through the difference of the publishing time.
步骤306,获取目标数字串。Step 306: Obtain a target digital string.
在一实施例中,可由预言机节点24获取目标数字串,并将该目标数字串发布至区块链;相应地,各个区块链节点可以从区块链上读取该目标数字串,从而获取该目标数字串。In one embodiment, the oracle machine node 24 can obtain the target digital string and publish the target digital string to the blockchain; correspondingly, each blockchain node can read the target digital string from the blockchain, thereby Get the target number string.
在一实施例中,预言机节点24可以通过调用上述的智能合约,使得该智能合约可以自动且随机生成一数字串,譬如一个8位数字串,以作为上述的目标数字串。在另一实施例中,预言机节点24可以接收链外对象传入的目标数字串,譬如该目标数字串可由链外对象通过随机算法生成。In one embodiment, the oracle node 24 may call the above-mentioned smart contract so that the smart contract can automatically and randomly generate a digital string, such as an 8-bit digital string, as the target digital string. In another embodiment, the oracle node 24 may receive a target number string passed in by an off-chain object, for example, the target number string may be generated by the off-chain object by a random algorithm.
步骤308,确定随机数字串与目标数字串是否相匹配。Step 308: Determine whether the random number string matches the target number string.
在一实施例中,每一区块链节点可以将自身对应的随机数字串与目标数字串进行比较,以确定两者是否相匹配;其中,当随机数字串与目标数字串相同时,可以判定为该随机数字串与目标数字串相匹配。In one embodiment, each blockchain node can compare its corresponding random number string with the target number string to determine whether the two match. If the random number string is the same as the target number string, it can determine Match the random number string to the target number string.
步骤310,当随机数字串与目标数字串相匹配时,向全网广播区块链节点自身生成的预备区块,并接收其他区块链节点广播的预备区块。Step 310: When the random number string matches the target number string, broadcast the preliminary blocks generated by the blockchain node itself to the entire network, and receive the preliminary blocks broadcast by other blockchain nodes.
在一实施例中,以区块链节点21为例:当区块链节点21确定自身对应的随机数字串1与目标数字串相匹配时,该区块链节点21可以将生成的预备区块进行全网广播,使得区块链节点22~24等均能够接收到该预备区块。其中,区块链节点21可以在任意时刻生成该预备区块,比如在步骤310之前已经生成该预备区块,或者可以在确认随机数字串1与目标数字串相匹配时生成该预备区块,本说明书并不对此进行限制。In one embodiment, the blockchain node 21 is taken as an example: When the blockchain node 21 determines that the corresponding random number string 1 matches the target number string, the blockchain node 21 may match the generated preliminary block Broadcast the whole network, so that the blockchain nodes 22-24 can receive the preliminary block. The blockchain node 21 may generate the preliminary block at any time, for example, the preliminary block has been generated before step 310, or may generate the preliminary block when it is confirmed that the random number string 1 matches the target number string. This specification does not limit this.
以区块链节点22为例:当区块链节点22确定自身对应的随机数字串2与目标数字串不匹配时,该区块链节点22可以忽略自身已生成的预备区块,或者终止原本正在或准备实施的预备区块生成操作。其中,区块链节点22可以接收到上述区块链节点21广播的预备区块。Take the blockchain node 22 as an example: when the blockchain node 22 determines that its corresponding random number string 2 does not match the target number string, the blockchain node 22 can ignore the preliminary block it has generated or terminate the original A preliminary block generation operation that is or is being implemented. Among them, the blockchain node 22 may receive the preliminary block broadcast by the above-mentioned blockchain node 21.
以区块链节点23为例:当区块链节点23确定自身对应的随机数字串3与目标数字串相匹配时,该区块链节点23可以将生成的预备区块进行全网广播,使得区块链节点 21-22、24等均能够接收到该预备区块。其中,区块链节点23还可以接收到上述区块链节点21广播的预备区块。Take the blockchain node 23 as an example: When the blockchain node 23 determines that its corresponding random number string 3 matches the target number string, the blockchain node 23 can broadcast the generated preliminary block throughout the network, so that Blockchain nodes 21-22, 24, etc. can all receive the preliminary block. Among them, the blockchain node 23 can also receive the preliminary block broadcast by the above-mentioned blockchain node 21.
步骤312,选取最新区块并写入区块链。Step 312: Select the latest block and write it into the blockchain.
在一实施例中,区块链节点21~24等分别在本地维护一区块链账本,每一区块链节点可以分别确定最新区块,并将该最新区块写入自身维护的区块链账本中,从而实现对该区块链账本的内容维护。In one embodiment, each of the blockchain nodes 21 to 24 and the like maintains a blockchain ledger locally. Each blockchain node can determine the latest block separately and write the latest block to the block it maintains. In the chain ledger, the content maintenance of the blockchain ledger is realized.
以区块链节点21为例:假定区块链节点21收到区块链节点23广播的预备区块;为了便于区分,可以设定该区块链节点21自身生成了预备区块B1、区块链节点23生成了预备区块B2。Take the blockchain node 21 as an example: Assume that the blockchain node 21 receives the preliminary block broadcast by the blockchain node 23; in order to facilitate the distinction, it can be set that the blockchain node 21 itself generates the preliminary block B1 and the area The blockchain node 23 generates a preliminary block B2.
一方面,区块链节点21可以对预备区块B2进行检验,可以包括:On the one hand, the blockchain node 21 can test the preliminary block B2, which can include:
1、根据预备区块B2中包含的交易流水号,从区块链中读取该交易流水号对应的交易及其交易内容,该交易内容包括该区块链节点23对应的随机数字串,区块链节点21可以检验该随机数字串是否与目标数字串相匹配;若不匹配,可以忽略预备区块B2。1. According to the transaction serial number contained in the preliminary block B2, read the transaction corresponding to the transaction serial number and its transaction content from the blockchain. The transaction content includes a random number string corresponding to the node 23 of the blockchain. The block chain node 21 can check whether the random number string matches the target number string; if it does not match, the preliminary block B2 can be ignored.
2、上述交易内容中如果包括区块链节点23对应的冻结资产凭证,则认为该交易内容包含的随机数字串有效;否则,可以忽略预备区块B2。当然,冻结资产凭证也可以通过独立的交易发布至区块链中,并且其交易流水号可以被记录于上述的预备区块B2中,从而使得区块链节点21据此获取区块链节点23对应的冻结资产凭证。2. If the above transaction content includes the frozen asset certificate corresponding to the blockchain node 23, the random number string contained in the transaction content is considered valid; otherwise, the preliminary block B2 can be ignored. Of course, the frozen asset certificate can also be issued to the blockchain through independent transactions, and its transaction serial number can be recorded in the above-mentioned preliminary block B2, so that the blockchain node 21 can obtain the blockchain node 23 accordingly. Corresponding frozen asset certificate.
3、上述交易内容包含随机数字串的发布时刻,该随机数字串的发布时刻应当早于目标数字串的发布时刻。3. The above transaction content includes the release time of the random number string. The release time of the random number string should be earlier than the release time of the target number string.
4、上述交易内容包含的随机数字串应当没有被用于争夺其他区块的记账权,比如该随机数字串的发布时刻应当晚于前一区块对应的目标数字串的发布时刻。4. The random number string contained in the above transaction content should not be used to compete for the accounting rights of other blocks, for example, the release time of the random number string should be later than the release time of the target number string corresponding to the previous block.
另一方面,区块链节点21可以对区块链节点21对应的随机数字串的发布时刻、区块链节点23对应的随机数字串的发布时刻进行比较:当区块链节点21对应的随机数字串的发布时刻早于区块链节点23对应的随机数字串的发布时刻时,区块链节点21可以将预备区块B1写入自身维护的区块链账本中;反之,则区块链节点21可以将预备区块B2写入自身维护的区块链账本中。On the other hand, the blockchain node 21 can compare the release time of the random number string corresponding to the blockchain node 21 and the release time of the random number string corresponding to the blockchain node 23: when the random number corresponding to the blockchain node 21 is When the publishing time of the digital string is earlier than the publishing time of the random digital string corresponding to the blockchain node 23, the blockchain node 21 can write the preliminary block B1 into the blockchain ledger maintained by itself; otherwise, the blockchain The node 21 can write the prepared block B2 into the blockchain ledger maintained by itself.
类似地,当区块链节点22分别收到区块链节点21广播的预备区块B1、区块链节点23广播的预备区块B2时,也可以通过上述方式分别对预备区块B1预备区块B2进行检 验,并基于区块链节点21、区块链节点23分别对应的随机数字串的发布时刻的顺序,确定将通过检验且全网最先发布的预备区块写入自身维护的区块链账本中。Similarly, when the blockchain node 22 separately receives the preliminary block B1 broadcasted by the blockchain node 21 and the preliminary block B2 broadcasted by the blockchain node 23, the preliminary block B1 can also be prepared separately in the above manner. Block B2 is checked, and based on the sequence of the release times of the random number strings corresponding to the blockchain node 21 and the blockchain node 23 respectively, it is determined that the prepared blocks that pass the test and are released first in the entire network are written into the area they maintain Blockchain ledger.
因此,区块链网络中的每一区块链节点分别通过诸如图3所示的方式,即可参与到对于各个区块的记账权的争夺,并且由于所有数据均为公开、不可篡改、可验证,从而能够确保各个区块链节点向自身维护的区块链账本中写入的区块具有相同内容,实现了对区块链账本的全网统一管理与维护。Therefore, each blockchain node in the blockchain network can participate in the scramble for the right to account for each block through a method such as that shown in Figure 3, and since all data is public, immutable, Verifiable, which can ensure that each blockchain node writes the same content in the blockchain ledger maintained by itself, and achieves unified network-wide management and maintenance of the blockchain ledger.
图4是一示例性实施例提供的一种设备的示意结构图。请参考图4,在硬件层面,该设备包括处理器402、内部总线404、网络接口406、内存408以及非易失性存储器410,当然还可能包括其他业务所需要的硬件。处理器402从非易失性存储器410中读取对应的计算机程序到内存408中然后运行,在逻辑层面上形成区块发布装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。FIG. 4 is a schematic structural diagram of a device according to an exemplary embodiment. Please refer to FIG. 4. At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410. Of course, it may also include hardware required by other services. The processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it to form a block issuing device on a logical level. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as a logic device or a combination of software and hardware, etc. That is to say, the execution body of the following processing flow is not limited to each A logic unit can also be a hardware or logic device.
请参考图5,在软件实施方式中,该区块发布装置可以包括:Please refer to FIG. 5. In a software implementation, the block publishing device may include:
调用单元51,调用用于生成字符序列的智能合约,所述智能合约被用于为区块链节点生成随机字符序列;A calling unit 51 for calling a smart contract for generating a character sequence, where the smart contract is used to generate a random character sequence for a blockchain node;
第一发布单元52,将所述随机字符序列与所述区块链节点的身份信息相关联地发布至区块链,其中所述随机字符序列的发布时刻早于目标字符序列的发布时刻;The first publishing unit 52 publishes the random character sequence to the blockchain in association with the identity information of the blockchain node, wherein the publishing time of the random character sequence is earlier than that of the target character sequence;
广播单元53,在所述随机字符序列匹配于所述目标字符序列的情况下,将生成的预备区块在区块链内进行全网广播;其中,当所述随机字符序列被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早时,所述预备区块被记录为所述区块链的最新区块。The broadcasting unit 53, when the random character sequence matches the target character sequence, broadcasts the generated preliminary block within the blockchain on the entire network; wherein, when the random character sequence is verified as matching the When the target character sequence and the corresponding release time are the earliest in the entire network, the preliminary block is recorded as the latest block of the blockchain.
可选的,所述第一发布单元52具体用于:Optionally, the first issuing unit 52 is specifically configured to:
将包含所述随机字符序列与所述区块链节点的身份信息的交易发布至区块链;Publishing a transaction containing the random character sequence and the identity information of the blockchain node to the blockchain;
其中,所述预备区块中包含所述交易的流水号,使接收到所述预备区块的区块链节点根据所述流水号从区块链中查找所述交易,以对所述随机字符序列及其发布时刻进行验证。Wherein, the preliminary block includes a serial number of the transaction, so that a blockchain node receiving the preliminary block searches the transaction from the blockchain according to the serial number, so as to match the random characters. The sequence and its release time are verified.
可选的,所述目标字符序列由预言机节点发布至所述区块链。Optionally, the target character sequence is published to the blockchain by a predictor node.
可选的,所述目标字符序列由预言机节点通过调用所述用于生成字符序列的智能合约而生成。Optionally, the target character sequence is generated by a predictor node by calling the smart contract for generating a character sequence.
可选的,还包括:Optional, also includes:
第二发布单元54,向所述区块链发布与所述随机字符序列相关联的资产冻结凭证,所述资产冻结凭证表明所述区块链节点持有的不少于预设数额的区块链资产处于冻结状态;The second issuing unit 54 issues an asset freezing certificate associated with the random character sequence to the blockchain, where the asset freezing certificate indicates that the blockchain node holds not less than a preset amount of blocks Chain assets are frozen;
其中,当所述随机字符序列不存在相关联的资产冻结凭证时,所述随机字符序列被判定为无效信息。Wherein, when there is no asset freezing certificate associated with the random character sequence, the random character sequence is determined as invalid information.
可选的,Optional,
在所述随机字符序列匹配于所述目标字符序列的情况下,所述资产冻结凭证对应的区块链资产被解冻并归还至所述区块链节点;In the case where the random character sequence matches the target character sequence, the blockchain asset corresponding to the asset freezing certificate is thawed and returned to the blockchain node;
在所述随机字符序列不匹配于所述目标字符序列的情况下,所述资产冻结凭证对应的区块链资产被从所述区块链节点处扣除。In a case where the random character sequence does not match the target character sequence, a blockchain asset corresponding to the asset freezing certificate is deducted from the blockchain node.
可选的,所述区块链节点存在多个对应的随机字符序列,每一随机字符序列分别存在对应的资产冻结凭证;所述广播单元53具体用于:Optionally, the blockchain node has multiple corresponding random character sequences, and each random character sequence has a corresponding asset freezing certificate; the broadcasting unit 53 is specifically configured to:
在所述区块链节点对应的任一随机字符序列匹配于所述目标字符序列的情况下,将生成的预备区块在区块链内进行全网广播;When any random character sequence corresponding to the blockchain node matches the target character sequence, the generated preliminary block is broadcasted on the entire network within the blockchain;
其中,当所述区块链节点对应的任一随机字符序列被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早时,所述预备区块被记录为所述区块链的最新区块。Wherein, when any random character sequence corresponding to the blockchain node is verified to match the target character sequence and the corresponding release time is the earliest on the entire network, the preliminary block is recorded as the blockchain Latest block.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The system, device, module, or unit described in the foregoing embodiments may be specifically implemented by a computer chip or entity, or a product with a certain function. A typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or a combination of any of these devices.
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computer includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机 可读介质的示例。Memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both permanent and non-persistent, removable and non-removable media. Information can be stored by any method or technology. Information may be computer-readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic disk storage, quantum memory, graphene-based storage media, or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. As defined herein, computer-readable media does not include temporary computer-readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "including," "including," or any other variation thereof are intended to encompass non-exclusive inclusion, so that a process, method, product, or device that includes a series of elements includes not only those elements but also Other elements not explicitly listed, or those that are inherent to such a process, method, product, or device. Without more restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, product or equipment including the elements.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The specific embodiments of the present specification have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and the desired result may still be achieved. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only, and is not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of the present specification, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present specification, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein can be interpreted as "at" or "when" or "in response to determination".
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。The above descriptions are merely preferred embodiments of one or more embodiments of the present specification, and are not intended to limit one or more embodiments of the present specification. Wherever within the spirit and principle of one or more embodiments of the present specification, Any modification, equivalent replacement, improvement, etc. should be included in the protection scope of one or more embodiments of this specification.

Claims (15)

  1. 一种区块发布方法,应用于区块链节点;所述方法包括:A block publishing method is applied to a blockchain node; the method includes:
    调用用于生成字符序列的智能合约,所述智能合约被用于为区块链节点生成随机字符序列;Calling a smart contract for generating a character sequence, the smart contract being used to generate a random character sequence for a blockchain node;
    将所述随机字符序列与所述区块链节点的身份信息相关联地发布至区块链,其中所述随机字符序列的发布时刻早于目标字符序列的发布时刻;Publishing the random character sequence to the blockchain in association with the identity information of the blockchain node, wherein the publishing time of the random character sequence is earlier than the publishing time of the target character sequence;
    在所述随机字符序列匹配于所述目标字符序列的情况下,将生成的预备区块在区块链内进行全网广播;其中,当所述随机字符序列被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早时,所述预备区块被记录为所述区块链的最新区块。In the case where the random character sequence matches the target character sequence, the generated preliminary block is broadcasted on the entire network within the blockchain; wherein, when the random character sequence is verified to match the target character When the sequence and corresponding release time is the earliest in the entire network, the preliminary block is recorded as the latest block of the blockchain.
  2. 根据权利要求1所述的方法,所述将所述随机字符序列与所述区块链节点的身份信息相关联地发布至区块链,包括:The method according to claim 1, wherein the publishing the random character sequence to the blockchain in association with the identity information of the blockchain node comprises:
    将包含所述随机字符序列与所述区块链节点的身份信息的交易发布至区块链;Publishing a transaction containing the random character sequence and the identity information of the blockchain node to the blockchain;
    其中,所述预备区块中包含所述交易的流水号,使接收到所述预备区块的区块链节点根据所述流水号从区块链中查找所述交易,以对所述随机字符序列及其发布时刻进行验证。Wherein, the preliminary block includes a serial number of the transaction, so that a blockchain node receiving the preliminary block searches the transaction from the blockchain according to the serial number, so as to match the random characters. The sequence and its release time are verified.
  3. 根据权利要求1所述的方法,所述目标字符序列由预言机节点发布至所述区块链。The method according to claim 1, wherein the target character sequence is published to the blockchain by a oracle node.
  4. 根据权利要求3所述的方法,所述目标字符序列由预言机节点通过调用所述用于生成字符序列的智能合约而生成。The method according to claim 3, the target character sequence is generated by a oracle node by invoking the smart contract for generating a character sequence.
  5. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    向所述区块链发布与所述随机字符序列相关联的资产冻结凭证,所述资产冻结凭证表明所述区块链节点持有的不少于预设数额的区块链资产处于冻结状态;Issuing to the blockchain an asset freezing certificate associated with the random character sequence, where the asset freezing certificate indicates that no less than a preset amount of blockchain assets held by the blockchain node is in a frozen state;
    其中,当所述随机字符序列不存在相关联的资产冻结凭证时,所述随机字符序列被判定为无效信息。Wherein, when there is no asset freezing certificate associated with the random character sequence, the random character sequence is determined as invalid information.
  6. 根据权利要求5所述的方法,The method according to claim 5,
    在所述随机字符序列匹配于所述目标字符序列的情况下,所述资产冻结凭证对应的区块链资产被解冻并归还至所述区块链节点;In the case where the random character sequence matches the target character sequence, the blockchain asset corresponding to the asset freezing certificate is thawed and returned to the blockchain node;
    在所述随机字符序列不匹配于所述目标字符序列的情况下,所述资产冻结凭证对应的区块链资产被从所述区块链节点处扣除。In a case where the random character sequence does not match the target character sequence, a blockchain asset corresponding to the asset freezing certificate is deducted from the blockchain node.
  7. 根据权利要求5所述的方法,所述区块链节点存在多个对应的随机字符序列,每一随机字符序列分别存在对应的资产冻结凭证;所述在所述随机字符序列匹配于所述 目标字符序列的情况下,将生成的预备区块在区块链内进行全网广播,包括:The method according to claim 5, wherein the blockchain node has a plurality of corresponding random character sequences, and each random character sequence has a corresponding asset freezing certificate; and the random character sequence matches the target. In the case of a character sequence, the generated preliminary block is broadcasted throughout the network within the blockchain, including:
    在所述区块链节点对应的任一随机字符序列匹配于所述目标字符序列的情况下,将生成的预备区块在区块链内进行全网广播;When any random character sequence corresponding to the blockchain node matches the target character sequence, the generated preliminary block is broadcasted on the entire network within the blockchain;
    其中,当所述区块链节点对应的任一随机字符序列被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早时,所述预备区块被记录为所述区块链的最新区块。Wherein, when any random character sequence corresponding to the blockchain node is verified to match the target character sequence and the corresponding release time is the earliest on the entire network, the preliminary block is recorded as the blockchain Latest block.
  8. 一种区块发布装置,应用于区块链节点;所述装置包括:A block publishing device is applied to a blockchain node; the device includes:
    调用单元,调用用于生成字符序列的智能合约,所述智能合约被用于为区块链节点生成随机字符序列;A calling unit for invoking a smart contract for generating a character sequence, the smart contract being used to generate a random character sequence for a blockchain node;
    第一发布单元,将所述随机字符序列与所述区块链节点的身份信息相关联地发布至区块链,其中所述随机字符序列的发布时刻早于目标字符序列的发布时刻;A first publishing unit that publishes the random character sequence to the blockchain in association with the identity information of the blockchain node, wherein the publishing time of the random character sequence is earlier than the publishing time of the target character sequence;
    广播单元,在所述随机字符序列匹配于所述目标字符序列的情况下,将生成的预备区块在区块链内进行全网广播;其中,当所述随机字符序列被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早时,所述预备区块被记录为所述区块链的最新区块。The broadcasting unit, when the random character sequence matches the target character sequence, broadcasts the generated preliminary block on the entire network within the blockchain; wherein, when the random character sequence is verified to match the target character sequence, When the target character sequence and the corresponding release time are the earliest on the entire network, the preliminary block is recorded as the latest block of the blockchain.
  9. 根据权利要求8所述的装置,所述第一发布单元具体用于:The apparatus according to claim 8, the first issuing unit is specifically configured to:
    将包含所述随机字符序列与所述区块链节点的身份信息的交易发布至区块链;Publishing a transaction containing the random character sequence and the identity information of the blockchain node to the blockchain;
    其中,所述预备区块中包含所述交易的流水号,使接收到所述预备区块的区块链节点根据所述流水号从区块链中查找所述交易,以对所述随机字符序列及其发布时刻进行验证。Wherein, the preliminary block includes a serial number of the transaction, so that a blockchain node receiving the preliminary block searches the transaction from the blockchain according to the serial number, so as to match the random characters. The sequence and its release time are verified.
  10. 根据权利要求8所述的装置,所述目标字符序列由预言机节点发布至所述区块链。The device according to claim 8, the target character sequence is published to the blockchain by a oracle node.
  11. 根据权利要求10所述的装置,所述目标字符序列由预言机节点通过调用所述用于生成字符序列的智能合约而生成。The device according to claim 10, the target character sequence is generated by a predictor node by invoking the smart contract for generating a character sequence.
  12. 根据权利要求8所述的装置,还包括:The apparatus according to claim 8, further comprising:
    第二发布单元,向所述区块链发布与所述随机字符序列相关联的资产冻结凭证,所述资产冻结凭证表明所述区块链节点持有的不少于预设数额的区块链资产处于冻结状态;The second issuing unit issues an asset freezing certificate associated with the random character sequence to the blockchain, where the asset freezing certificate indicates that the blockchain node holds a blockchain of not less than a preset amount Assets are frozen;
    其中,当所述随机字符序列不存在相关联的资产冻结凭证时,所述随机字符序列被判定为无效信息。Wherein, when there is no asset freezing certificate associated with the random character sequence, the random character sequence is determined as invalid information.
  13. 根据权利要求12所述的装置,The device according to claim 12,
    在所述随机字符序列匹配于所述目标字符序列的情况下,所述资产冻结凭证对应的区块链资产被解冻并归还至所述区块链节点;In the case where the random character sequence matches the target character sequence, the blockchain asset corresponding to the asset freezing certificate is thawed and returned to the blockchain node;
    在所述随机字符序列不匹配于所述目标字符序列的情况下,所述资产冻结凭证对应的区块链资产被从所述区块链节点处扣除。In a case where the random character sequence does not match the target character sequence, a blockchain asset corresponding to the asset freezing certificate is deducted from the blockchain node.
  14. 根据权利要求12所述的装置,所述区块链节点存在多个对应的随机字符序列,每一随机字符序列分别存在对应的资产冻结凭证;所述广播单元具体用于:The device according to claim 12, wherein the blockchain node has a plurality of corresponding random character sequences, and each random character sequence has a corresponding asset freezing certificate; the broadcasting unit is specifically configured to:
    在所述区块链节点对应的任一随机字符序列匹配于所述目标字符序列的情况下,将生成的预备区块在区块链内进行全网广播;When any random character sequence corresponding to the blockchain node matches the target character sequence, the generated preliminary block is broadcasted on the entire network within the blockchain;
    其中,当所述区块链节点对应的任一随机字符序列被验证为匹配于所述目标字符序列且对应的发布时刻为全网最早时,所述预备区块被记录为所述区块链的最新区块。Wherein, when any random character sequence corresponding to the blockchain node is verified to match the target character sequence and the corresponding release time is the earliest on the entire network, the preliminary block is recorded as the blockchain Latest block.
  15. 一种电子设备,包括:An electronic device includes:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory for storing processor-executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-7中任一项所述的区块发布方法。The processor executes the executable instructions to implement the method for issuing a block according to any one of claims 1-7.
PCT/CN2019/084379 2018-07-27 2019-04-25 Block release method and apparatus, and electronic device WO2020019792A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810848235.4 2018-07-27
CN201810848235.4A CN109242676B (en) 2018-07-27 2018-07-27 Block issuing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
WO2020019792A1 true WO2020019792A1 (en) 2020-01-30

Family

ID=65073162

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/084379 WO2020019792A1 (en) 2018-07-27 2019-04-25 Block release method and apparatus, and electronic device

Country Status (3)

Country Link
CN (1) CN109242676B (en)
TW (1) TWI699728B (en)
WO (1) WO2020019792A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112651745A (en) * 2020-12-30 2021-04-13 杭州趣链科技有限公司 Credit evaluation method of financial block chain, electronic equipment and storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109242676B (en) * 2018-07-27 2023-10-27 创新先进技术有限公司 Block issuing method and device and electronic equipment
CN109847365B (en) * 2019-01-24 2022-08-12 湖南天河国云科技有限公司 Anti-cheating method and system for block chain application
US11188521B2 (en) * 2019-06-05 2021-11-30 International Business Machines Corporation Flexible transaction validation
CN112148613B (en) * 2020-09-28 2024-10-18 财付通支付科技有限公司 Intelligent contract generation method and device for testing blockchain service

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107005574A (en) * 2016-12-23 2017-08-01 深圳前海达闼云端智能科技有限公司 Block generation method and device and block chain network
WO2017192837A1 (en) * 2016-05-04 2017-11-09 Silvio Micali Distributed transaction propagation and verification system
CN107438003A (en) * 2016-05-27 2017-12-05 索尼公司 Electronic equipment, method and information processing system for electronic equipment
CN109242676A (en) * 2018-07-27 2019-01-18 阿里巴巴集团控股有限公司 Block dissemination method and device, electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9608829B2 (en) * 2014-07-25 2017-03-28 Blockchain Technologies Corporation System and method for creating a multi-branched blockchain with configurable protocol rules
WO2018112949A1 (en) * 2016-12-23 2018-06-28 深圳前海达闼云端智能科技有限公司 Block chain mining method, device, and node apparatus
CN106651332B (en) * 2016-12-29 2020-11-06 成都质数斯达克科技有限公司 Method for generating new block in block chain and block chain
CN108270821A (en) * 2016-12-30 2018-07-10 深圳瀚德创客金融投资有限公司 For the block generation method and network node in block chain network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017192837A1 (en) * 2016-05-04 2017-11-09 Silvio Micali Distributed transaction propagation and verification system
CN107438003A (en) * 2016-05-27 2017-12-05 索尼公司 Electronic equipment, method and information processing system for electronic equipment
CN107005574A (en) * 2016-12-23 2017-08-01 深圳前海达闼云端智能科技有限公司 Block generation method and device and block chain network
CN109242676A (en) * 2018-07-27 2019-01-18 阿里巴巴集团控股有限公司 Block dissemination method and device, electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112651745A (en) * 2020-12-30 2021-04-13 杭州趣链科技有限公司 Credit evaluation method of financial block chain, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109242676B (en) 2023-10-27
TWI699728B (en) 2020-07-21
CN109242676A (en) 2019-01-18
TW202008270A (en) 2020-02-16

Similar Documents

Publication Publication Date Title
WO2020019792A1 (en) Block release method and apparatus, and electronic device
US11398914B2 (en) Blockchain-based data authorization method and apparatus
US20210160068A1 (en) Data sharing method, apparatus, and system, and electronic device
US11310051B2 (en) Blockchain-based data authorization method and apparatus
TWI762818B (en) Blockchain-based invoice creation method and device, electronic device
US10929198B2 (en) Blockchain-based resource allocation method and apparatus
TWI735820B (en) Asset management method and device, electronic equipment
TWI694390B (en) Blockchain-based transaction processing method and device, and electronic equipment
TWI771618B (en) Method and device for distribution of copyright of works based on blockchain
TWI709868B (en) Data storage method and device based on blockchain
WO2020019798A1 (en) Rights and interests distribution method and device and electronic device
TW202022754A (en) Invoice creating method and device based on block chain and electronic equipment
CN111539731A (en) Block chain-based federal learning method and device and electronic equipment
CN112650978B (en) Infringement detection method and device based on block chain and electronic equipment
TWI727284B (en) Block chain-based privacy transaction method, device and computer equipment, application method based on block chain privacy transaction and computer equipment
US11423473B2 (en) Blockchain-based leasing
US20220036354A1 (en) Blockchain-based offline resource transfer method and apparatus
CN110245942B (en) Receipt storage method and node combining user type and judgment condition
TW202016813A (en) Object selection method and device, and electronic equipment
TWI714414B (en) Method and device for obtaining block chain data in stages
US11093650B2 (en) Blockchain-based copyright distribution
WO2020233635A1 (en) Receipt storage method combining conditional restrictions of multiple types of dimensions and node
TW202024984A (en) Data reading and writing method and device and electronic equipment
TW202025057A (en) Field updating method and device and electronic equipment
WO2020082869A1 (en) Event prediction method and apparatus and electronic device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19840399

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19840399

Country of ref document: EP

Kind code of ref document: A1