CN109242676B - Block issuing method and device and electronic equipment - Google Patents

Block issuing method and device and electronic equipment Download PDF

Info

Publication number
CN109242676B
CN109242676B CN201810848235.4A CN201810848235A CN109242676B CN 109242676 B CN109242676 B CN 109242676B CN 201810848235 A CN201810848235 A CN 201810848235A CN 109242676 B CN109242676 B CN 109242676B
Authority
CN
China
Prior art keywords
character sequence
blockchain
block
random character
random
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810848235.4A
Other languages
Chinese (zh)
Other versions
CN109242676A (en
Inventor
陆旭明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ant Chain Technology Co ltd
Original Assignee
Advanced New Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201810848235.4A priority Critical patent/CN109242676B/en
Priority to TW108101814A priority patent/TWI699728B/en
Publication of CN109242676A publication Critical patent/CN109242676A/en
Priority to PCT/CN2019/084379 priority patent/WO2020019792A1/en
Application granted granted Critical
Publication of CN109242676B publication Critical patent/CN109242676B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Bioethics (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Technology Law (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (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 disclosure provide a block publishing method and apparatus, and an electronic device, which are applied to a block chain node; the method comprises the following steps: invoking a smart contract for generating character sequences, the smart contract being used to generate random character sequences for block link points; issuing the random character sequence to a blockchain in association with identity information of the blockchain node, wherein the issuing time of the random character sequence is earlier than the issuing time of a target character sequence; under the condition that the random character sequence is matched with the target character sequence, performing full-network broadcasting on the generated preparation block in a block chain; when the random character sequence is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.

Description

Block issuing method and device and electronic equipment
Technical Field
One or more embodiments of the present disclosure relate to the field of blockchain technologies, and in particular, to a method and an apparatus for issuing a block, and an electronic device.
Background
The blockchain includes a plurality of blockchain nodes, and a consensus mechanism is used to agree among the blockchain nodes to ensure that the blockchain nodes together maintain a unified blockchain ledger. In the related art, a PoW (Proof of Work) algorithm is generally adopted to reach consensus among the blockchain nodes; specifically, solutions of the same mathematical problem are calculated by all the blockchain nodes respectively, accounting rights are contended by the blockchain nodes of the solutions meeting the conditions which are obtained first, the latest block of the blockchain is generated by the blockchain node, and all the blockchain nodes record the blocks generated by the blockchain node into a blockchain account book.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a block distribution method and apparatus, and an electronic device.
In order to achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments of the present disclosure, a block publishing method is provided, which is applied to a blockchain node; the method comprises the following steps:
invoking a smart contract for generating character sequences, the smart contract being used to generate random character sequences for block link points;
issuing the random character sequence to a blockchain in association with identity information of the blockchain node, wherein the issuing time of the random character sequence is earlier than the issuing time of a target character sequence;
under the condition that the random character sequence is matched with the target character sequence, performing full-network broadcasting on the generated preparation block in a block chain; when the random character sequence is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.
According to a second aspect of one or more embodiments of the present specification, a block publishing device is provided, which is applied to a block chain node; the device comprises:
a calling unit for calling an intelligent contract for generating character sequences, wherein the intelligent contract is used for generating random character sequences for block chain link points;
a first issuing unit that issues the random character sequence to a blockchain in association with identity information of the blockchain node, wherein a timing of issuance of the random character sequence is earlier than a timing of issuance of a target character sequence;
a broadcasting unit for performing full-network broadcasting on the generated preparation block in a block chain under the condition that the random character sequence is matched with the target character sequence; when the random character sequence is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.
According to a third aspect of one or more embodiments of the present specification, there is provided an electronic device comprising:
a processor;
a memory for storing processor-executable instructions;
the processor executes the executable instructions to implement the block issuing method according to any of the foregoing embodiments.
Drawings
Fig. 1 is a flowchart of a block distribution method according to an exemplary embodiment.
Fig. 2 is a schematic diagram of a blockchain network in accordance with an exemplary embodiment.
Fig. 3 is a flow chart of determining billing rights provided by an exemplary embodiment.
Fig. 4 is a schematic diagram of an apparatus according to an exemplary embodiment.
Fig. 5 is a block diagram of a block distribution device according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to 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 apparatus and methods consistent with aspects of one or more embodiments of the present description as detailed in the accompanying 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. Furthermore, individual steps described in this specification, in other embodiments, may be described as being split into multiple steps; while various steps described in this specification may be combined into a single step in other embodiments.
Fig. 1 is a flowchart of a block distribution method according to an exemplary embodiment. As shown in fig. 1, the method applied to a blockchain node may include the steps of:
step 102, a smart contract for generating character sequences is invoked, the smart contract being used to generate random character sequences for block link points.
In one embodiment, processing logic for generating the random character sequence may be pre-written in the smart contract, such that after the smart contract is invoked, the random character sequence may be automatically generated for the block link points based on the processing logic described above. Because the processing logic on the intelligent contract is the disclosure, and the whole processing process is automatically completed by the intelligent contract without manual intervention, the randomness of the generated random character sequence can be ensured, and the camera bellows operation or cheating behavior is avoided.
In an embodiment, the random character sequence is not completely "random", but may still conform to a certain preset rule, for example, the preset rule may include the number of characters, the type of characters, the value range of the characters, and the like, which is not limited in this specification. For example, the preset rule may limit the random character sequence to 8 digits, and the smart contract generated random character sequence may be "45614381" without generating "ax0642f0"; for another example, the preset rule may limit the random character sequence to 5 digits +3 letters, and the smart contract may generate a random character sequence of "ax0642f0" without generating the sequence of "45614381". When the random character sequence accords with the preset rule, the target character sequence also accords with the preset rule, so that the random character sequence and the target character sequence keep consistent in structure and form, and the comparability between the random character sequence and the target character sequence is ensured.
In one embodiment, there are multiple blockchain nodes in the blockchain, and random character sequences generated by intelligently combining the blockchain nodes should be distinguished from each other to avoid matching the random character sequences of more than one blockchain node with the target character sequences, ensuring that only the prepared block generated by one blockchain node is recorded as the latest block of the blockchain.
Step 104, issuing the random character sequence to the blockchain in association with the identity information of the blockchain node, wherein the issuing time of the random character sequence is earlier than the issuing time of the target character sequence.
In one embodiment, a blockchain link point may be created by creating a transaction on a client of the blockchain to issue the random character sequence onto the blockchain in association with the identity information of the blockchain node based on the transaction as a piece of data in a distributed database of the blockchain.
It should be noted that: there are narrow transactions and broad transaction divisions for transactions in blockchains. A narrow transaction refers to a transfer of value issued by a user to a blockchain; for example, in a traditional bitcoin blockchain network, the transaction may be a transfer initiated by the user in the blockchain. And generalized transaction refers to a business data with business intention issued by a user to a blockchain; for example, an operator may build a federation chain based on actual business requirements, rely on the federation chain to deploy some other types of online business (e.g., event prediction, rental business, vehicle dispatch business, insurance claim business, credit service, medical service, etc.) that is unrelated to value transfer, and in such federation chains, the transaction may be a business message or business request with business intent issued by the user in the federation chain. A transaction in this specification should be understood to be a transaction in a broad sense.
In an embodiment, the blockchain adopts a distributed database, so that the random character sequence issued to the blockchain cannot be tampered, and reliable recording can be realized on the random character sequence corresponding to each blockchain node.
In one embodiment, the specification may have the blockchain link points contend for the accounting rights of the latest block of the blockchain, while the accounting rights of other blocks on the blockchain have been determined, and then these accounting-enabled blockchain nodes may be responsible for writing the transactions described above that include the random character sequence and the blockchain node's identity information into the corresponding block and issuing to the blockchain. In other words, the random character sequence and its identity information are not necessarily issued directly to the blockchain by the blockchain node in step 104, but may be performed by other blockchain nodes, depending on which blockchain node has the accounting rights of the associated block.
In one embodiment, the random character sequence may be fed back to the blockchain node, which determines whether the random character sequence needs to be employed. In one case, if it is determined that the random character sequence needs to be employed, the blockchain node may issue 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 approved, the blockchain node can recall the smart contract, and the smart contract regenerates a random character sequence to update the random character sequence corresponding to the blockchain node; of course, if the blockchain is still not approved, the smart contract may continue to be recalled until a satisfactory random character sequence is obtained.
In one embodiment, the timing of the release of the random character sequence should be earlier than the timing of the release of the target character sequence, which would otherwise lead to doubt about the randomness of the random character sequence, such as if the target character sequence were obtained, the same character sequence would be disguised as a random character sequence and released to the blockchain, rather than actually being generated by the smart contract described above.
Step 106, in the case that the random character sequence is matched with the target character sequence, performing full-network broadcasting on the generated preparation block in a block chain; when the random character sequence is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.
In one embodiment, when a blockchain node a receives a preliminary block from a blockchain node B, it can determine whether the random character sequence 1 matches the target character sequence by comparing the random character sequence 1 corresponding to the blockchain node B with 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 release times of the random character sequence 1 and the random character sequence 2 to determine a random character sequence released relatively earlier. In the above manner, assuming that the blockchain node a determines that the random character sequence 1 corresponding to the blockchain node B matches the target character sequence, and that the release time of the random character sequence 1 corresponding to the blockchain node B is earliest among all the random character sequences matching the target character sequence, it can be determined that the random character sequence 1 accords with "is verified to match the target character sequence and the corresponding release time is the earliest of the whole network", so that the blockchain node a can record a preparation block from the blockchain node B as the latest block of the blockchain; similarly, other blockchain nodes may record a spare block from a blockchain node B as the latest block of the blockchain based on the above manner, equivalent to the blockchain node B contending for accounting rights in the blockchain, enabling consensus among the blockchain nodes.
In one embodiment, since the random character sequence is randomly generated by the intelligent contract, the consensus process between the blockchain nodes is independent of the computing power of each blockchain node, so that even if the blockchain nodes master 51% or more of the computing power of the whole network, the accounting rights in the blockchain cannot be controlled, and the block chain nodes with strong computing power are prevented from being wrongly charged.
In one embodiment, a transaction including the random character sequence and identity information of the blockchain node may be issued to the blockchain such that the random character sequence is issued to the blockchain in association with the identity information of the blockchain node. The preparation block may include a serial number or other feature identifier of the transaction, so that a blockchain node receiving the preparation block may search the transaction from a blockchain according to the serial number or other feature identifier, thereby obtaining the random character sequence and the release time thereof, and verifying the release sequence, the matching condition, and the like of the random character sequence and the target character sequence.
In one embodiment, the target character sequence may be issued to the blockchain by a predictor (Oracle) node. Since the data provided by the predictor node is considered to be absolutely reliable, the authenticity of the target character sequence can be ensured.
In an embodiment, the predictor may obtain the target character sequence from the out-of-chain object, for example, the out-of-chain object may randomly generate the target character sequence through a computer, or the out-of-chain object may control the entity device to randomly release a plurality of spheres in turn, and each sphere corresponds to a character one by one, so that the release sequence of each sphere and the character corresponding to each sphere form the target character sequence.
In an embodiment, the target character sequence is generated by a propulsor node by invoking the smart contract for generating the character sequence. Because the intelligent contract is internally provided with the processing logic for randomly generating the character sequence, the predictor node can randomly generate the target character sequence by calling the intelligent contract.
In one embodiment, the predictor node may broadcast the target character sequence across the network for distribution into the blockchain by the blockchain node with accounting rights. In another embodiment, the predictor node may default to having billing rights and may issue the target character sequence directly into the blockchain.
In an embodiment, an asset freeze credential associated with the random character sequence may be issued to the blockchain, the asset freeze credential indicating that no less than a preset amount of blockchain assets held by the blockchain node are in a frozen state; wherein the random character sequence is determined to be invalid information when the random character sequence does not have an associated asset freeze credential. By requiring the provision of asset freezing vouchers, a certain participation threshold can be set for blockchain nodes participating in competing for accounting rights, blockchain nodes with insufficient blockchain assets in possession can be excluded (lawbreakers may temporarily create some blockchain nodes dedicated to participating in competing for accounting rights in order to disqualify, thereby increasing the probability of hitting target character sequences), and the disqualifying costs of blockchain nodes.
In one embodiment, the random character sequence, the identity information of the blockchain node, and the asset freeze credential may be included in the same transaction to indicate an association between the asset freeze credential 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 in which the asset freeze voucher is located, or the serial number of the transaction in which the asset freeze voucher is located may be added to the transaction containing the random character sequence and the identity information of the blockchain node, depending on the order of release between the two transactions, i.e. the serial number of the transaction released earlier may be added to the transaction released later.
In one embodiment, in the event that the random character sequence matches the target character sequence, the blockchain asset corresponding to the asset freeze credential is thawed and returned to the blockchain node.
In one embodiment, in the event that the random character sequence does not match the target character sequence, the blockchain asset corresponding to the asset freeze credential is deducted from the blockchain node as a cost of participating in the contending for accounting.
In one embodiment, the blockchain nodes may have only one corresponding random sequence of characters, i.e., each blockchain node has only one opportunity to contend for the accounting rights, and the probabilities of all blockchain nodes contending for the accounting rights are consistent.
In one embodiment, the blockchain node may have a plurality of corresponding random character sequences, each random character sequence having a corresponding asset freeze credential; in other words, a blockchain node may be able to obtain a plurality of random character sequences by providing a plurality of asset freeze credentials to help promote the probability that the blockchain node contends for accounting. Under the condition that any random character sequence corresponding to the blockchain node is matched with the target character sequence, the generated preparation block can be broadcasted in the whole network in the blockchain; accordingly, when any random character sequence corresponding to the block link point is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.
For ease of understanding, the block distribution scheme of the present specification is described below using blockchain nodes within a blockchain as an example. FIG. 2 is a schematic diagram of a blockchain network in accordance with an exemplary embodiment; as shown in fig. 2, assuming that there are a blockchain node 21, a blockchain node 22, a blockchain node 23, a blockchain node 24, and the like in the blockchain, the blockchain nodes 21 to 24 may communicate with each other, for example, communication may be implemented between every two nodes as shown in fig. 2, and there may be a case where communication is required between some nodes through other nodes as relays, which is not limited in this specification. In one embodiment, the blockchain nodes 21-23 may be regular nodes, the blockchain node 24 may be a predictor node, transactions issued by the blockchain nodes 21-23 in the blockchain are considered untrusted, and transactions issued by the blockchain node 24 as a predictor node in the blockchain are considered to be absolutely trusted.
Based on the blockchain network shown in fig. 2, fig. 3 is a flow chart of determining billing rights provided by an exemplary embodiment. For any blockchain node in a blockchain network, such as blockchain nodes 21-24 described above, accounting rights for the latest block in the blockchain may be contended for in the manner shown in fig. 3, the process may include the steps of:
at step 302, asset freeze credentials are generated.
In one embodiment, the blockchain node 21 is taken as an example: the blockchain node 21 may freeze a preset amount of blockchain assets held by itself; for example, the blockchain node 21 may transfer the preset amount of blockchain asset into a predefined asset curtailment account and obtain a corresponding asset curtailment credential.
In one embodiment, blockchain node 21 may issue asset freeze credentials to the blockchain such that the asset freeze credentials are recorded in a blockchain ledger maintained, respectively, in uniform content by each blockchain point.
Step 304, a random number string is obtained.
In one embodiment, the blockchain node 21 is taken as an example: the blockchain node 21 may invoke a smart contract that predefines the functional logic that generates the random number string such that the smart contract may automatically generate the random number string corresponding to the blockchain node 21 based on the functional logic. The length of the random number string is constrained in the smart contract, for example, the random number string may be a 128-bit number string. Because the intelligent contract is issued on the blockchain, the functional logic defined in the intelligent contract is public data, thereby ensuring objective and fair generation results of the random number strings and avoiding conditions such as camera bellows operation caused by human intervention.
Assume that blockchain node 21 corresponds to random number string L1. When the blockchain node 21 is not satisfied with the random number string generated by the smart contract, the smart contract may be repeatedly called a plurality of times until the satisfied random number string is obtained as the random number string L1. Similarly, each blockchain node may obtain a corresponding string of random numbers by invoking the smart contract described above.
In one embodiment, the blockchain node 21 may publish its own 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 time of publication (characterized by a timestamp) of the random number string L1. Then, even if the random number strings L1 corresponding to different block chain nodes are the same, the comparison can be performed through the difference of the release time, so that the contention and the confirmation of the accounting right can be realized.
Step 306, a target number string is obtained.
In one embodiment, the target string of numbers may be obtained by the predictor node 24 and published to the blockchain; accordingly, each blockchain node may read the target string from the blockchain to obtain the target string.
In one embodiment, the predictor node 24 may invoke the smart contract described above to automatically and randomly generate a string of digits, such as an 8-bit string of digits, as the target string of digits. In another embodiment, the predictor node 24 may receive a target string of digits that is entered by an off-chain object, such as the target string of digits may be generated by the off-chain object by a random algorithm.
Step 308, determines whether the random number string matches the target number string.
In one embodiment, each blockchain node may compare its corresponding random number string to the target number string to determine if the two match; wherein, when the random number string is identical to the target number string, it can be determined that the random number string matches the target number string.
Step 310, when the random number string matches the target number string, the prepared block generated by the blockchain node is broadcasted to the whole network and the prepared blocks broadcasted by other blockchain nodes are received.
In one embodiment, the blockchain node 21 is taken as an example: when the blockchain node 21 determines that the random number string 1 corresponding to itself matches the target number string, the blockchain node 21 may broadcast the generated preliminary block over the whole network so that the blockchain nodes 22 to 24 and the like can each receive the preliminary block. The blockchain node 21 may generate the spare block at any time, for example, the spare block has been generated before step 310, or may generate the spare block when it is confirmed that the random number string 1 matches the target number string, which is not limited in this specification.
Taking 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 may ignore itself generated preliminary blocks or terminate preliminary block generation operations that were otherwise being or are ready to be performed. The blockchain node 22 may receive the spare block broadcast by the blockchain node 21.
Taking 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 may broadcast the generated preliminary block over the whole network so that the blockchain nodes 21-22, 24, etc. can each receive the preliminary block. The blockchain node 23 may also receive the spare block broadcast by the blockchain node 21.
In step 312, the latest block is selected and written into the blockchain.
In an embodiment, the blockchain nodes 21 to 24 respectively maintain a blockchain ledger locally, each blockchain node can respectively determine the latest block and write the latest block into the blockchain ledger maintained by itself, thereby realizing the content maintenance of the blockchain ledger.
Taking blockchain node 21 as an example: assume that blockchain node 21 receives a preliminary block broadcast by blockchain node 23; for convenience of distinction, it may be set that the blockchain node 21 itself generates the spare block B1 and the blockchain node 23 generates the spare block B2.
In one aspect, the blockchain node 21 may verify the preliminary block B2, and may include:
1. reading a transaction corresponding to the transaction serial number and transaction content thereof from a blockchain according to the transaction serial number contained in the preparation block B2, wherein the transaction content comprises a random number string corresponding to the blockchain node 23, and the blockchain node 21 can check whether the random number string is matched with a target number string; if not, the preliminary block B2 may be omitted.
2. If the transaction content includes the frozen asset certificate corresponding to the blockchain node 23, the random number string included in the transaction content is considered to be valid; otherwise, the preliminary block B2 may be omitted. Of course, the frozen asset credential may also be issued to the blockchain through an independent transaction, and its transaction serial number may be recorded in the above-mentioned preparation block B2, so that the blockchain node 21 obtains the frozen asset credential corresponding to the blockchain node 23 accordingly.
3. The transaction content includes a release time of a random number string, which should be earlier than a release time of a target number string.
4. The random number string contained in the transaction content should not be used to contend 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.
On the other hand, the blockchain node 21 may compare the release time of the random number string corresponding to the blockchain node 21 with the release time of the random number string corresponding to the blockchain node 23: when the release time of the random number string corresponding to the blockchain node 21 is earlier than the release time of the random number string corresponding to the blockchain node 23, the blockchain node 21 can write the preparation block B1 into the blockchain ledger maintained by itself; otherwise, blockchain node 21 may write the prepared block B2 into the blockchain ledger maintained by itself.
Similarly, when the blockchain node 22 receives the spare blocks B1 and B2 broadcast by the blockchain node 21 and 23, respectively, the spare blocks B1 and B2 may be checked in the above manner, and based on the order of the release moments of the random number strings corresponding to the blockchain node 21 and 23, respectively, the checked and first released spare blocks are determined to be written into the blockchain ledger maintained by itself.
Therefore, each blockchain node in the blockchain network can participate in the contending of the accounting right of each block in a mode such as shown in fig. 3, and as all data are public, non-tamperable and verifiable, the blocks written in the blockchain account book maintained by each blockchain node to the blockchain node have the same content, so that the unified management and maintenance of the whole network of the blockchain account book are realized.
Fig. 4 is a schematic block diagram of an apparatus according to an exemplary embodiment. Referring 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 nonvolatile memory 410, although other hardware required by other services is possible. The processor 402 reads the corresponding computer program from the nonvolatile memory 410 into the memory 408 and then runs to form a block distribution device on a logic level. Of course, in addition to software implementation, one or more embodiments of the present disclosure do not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or a logic device.
Referring to fig. 5, in a software implementation, the block distribution device may include:
a calling unit 51 that calls a smart contract for generating character sequences, the smart contract being used to generate random character sequences for block link points;
a first issuing unit 52 that issues the random character sequence to a blockchain in association with the identity information of the blockchain node, wherein the timing of the issuance of the random character sequence is earlier than the timing of the issuance of the target character sequence;
a broadcasting unit 53 that performs a full-network broadcast of the generated preliminary block within a blockchain in a case where the random character sequence matches the target character sequence; when the random character sequence is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.
Optionally, the first distributing unit 52 is specifically configured to:
issuing a transaction to a blockchain that includes the random character sequence and identity information of the blockchain node;
the preparation block comprises a serial number of the transaction, and the blockchain node which receives the preparation block searches the transaction from the blockchain according to the serial number so as to verify the random character sequence and the release time of the random character sequence.
Optionally, the target character sequence is published to the blockchain by a predictor node.
Optionally, the target character sequence is generated by the predictor node by invoking the smart contract for generating the character sequence.
Optionally, the method further comprises:
a second issuing unit 54 that issues an asset freeze credential associated with the random character sequence to the blockchain, the asset freeze credential indicating that a blockchain asset held by the blockchain node that is not less than a preset amount is in a frozen state;
wherein the random character sequence is determined to be invalid information when the random character sequence does not have an associated asset freeze credential.
Alternatively to this, the method may comprise,
under the condition that the random character sequence is matched with the target character sequence, thawing and returning the blockchain asset corresponding to the asset freezing certificate to the blockchain node;
in the event that the random character sequence does not match the target character sequence, a blockchain asset corresponding to the asset freeze credential is deducted from the blockchain node.
Optionally, the blockchain node has a plurality of corresponding random character sequences, each random character sequence having a corresponding asset freezing credential; the broadcasting unit 53 is specifically configured to:
under the condition that any random character sequence corresponding to the block chain node is matched with the target character sequence, performing full-network broadcasting on the generated preparation block in a block chain;
when any random character sequence corresponding to the block chain link point is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer 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), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by the computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The terminology used in the one or more embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the specification. As used in this specification, one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses 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 in one or more embodiments of the present description to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
The foregoing description of the preferred embodiment(s) is (are) merely intended to illustrate the embodiment(s) of the present invention, and it is not intended to limit the embodiment(s) of the present invention to the particular embodiment(s) described.

Claims (14)

1. A block release method is applied to block chain nodes; the method comprises the following steps:
invoking a smart contract for generating a sequence of characters, the smart contract being used to generate a sequence of random characters for a block link point according to pre-written processing logic that generates the sequence of random characters;
issuing the random character sequence to a blockchain in association with identity information of the blockchain node, wherein the issuing time of the random character sequence is earlier than the issuing time of a target character sequence, and the target character sequence is issued to the blockchain by a predictor node;
under the condition that the random character sequence is matched with the target character sequence, performing full-network broadcasting on the generated preparation block in a block chain; when the random character sequence is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.
2. The method of claim 1, the publishing the random character sequence to a blockchain in association with identity information of the blockchain node, comprising:
issuing a transaction to a blockchain that includes the random character sequence and identity information of the blockchain node;
the preparation block comprises a serial number of the transaction, and the blockchain node which receives the preparation block searches the transaction from the blockchain according to the serial number so as to verify the random character sequence and the release time of the random character sequence.
3. The method of claim 1, the target character sequence being generated by a predictor node by invoking the smart contract for generating character sequences.
4. The method of claim 1, further comprising:
issuing asset freeze credentials associated with the random character sequence to the blockchain, the asset freeze credentials indicating that blockchain assets held by the blockchain node that are not less than a preset amount are in a frozen state;
wherein the random character sequence is determined to be invalid information when the random character sequence does not have an associated asset freeze credential.
5. The method according to claim 4, wherein the method comprises,
under the condition that the random character sequence is matched with the target character sequence, thawing and returning the blockchain asset corresponding to the asset freezing certificate to the blockchain node;
in the event that the random character sequence does not match the target character sequence, a blockchain asset corresponding to the asset freeze credential is deducted from the blockchain node.
6. The method of claim 4, the blockchain node having a plurality of corresponding random character sequences, each random character sequence having a corresponding asset freeze credential; and if the random character sequence is matched with the target character sequence, performing full-network broadcasting on the generated preparation block in a block chain, wherein the method comprises the following steps:
under the condition that any random character sequence corresponding to the block chain node is matched with the target character sequence, performing full-network broadcasting on the generated preparation block in a block chain;
when any random character sequence corresponding to the block chain link point is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.
7. A block publishing device, which is applied to a block chain node; the device comprises:
a calling unit for calling an intelligent contract for generating a character sequence, wherein the intelligent contract is used for generating the random character sequence for the block chain link point according to the processing logic of pre-writing to generate the random character sequence;
a first issuing unit that issues the random character sequence to a blockchain in association with identity information of the blockchain node, wherein an issue time of the random character sequence is earlier than an issue time of a target character sequence issued to the blockchain by a predictor node;
a broadcasting unit for performing full-network broadcasting on the generated preparation block in a block chain under the condition that the random character sequence is matched with the target character sequence; when the random character sequence is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.
8. The apparatus of claim 7, the first distribution unit is specifically configured to:
issuing a transaction to a blockchain that includes the random character sequence and identity information of the blockchain node;
the preparation block comprises a serial number of the transaction, and the blockchain node which receives the preparation block searches the transaction from the blockchain according to the serial number so as to verify the random character sequence and the release time of the random character sequence.
9. The apparatus of claim 7, the target character sequence generated by a predictor node by invoking the smart contract for generating character sequences.
10. The apparatus of claim 7, further comprising:
a second issuing unit that issues an asset freeze credential associated with the random character sequence to the blockchain, the asset freeze credential indicating that a blockchain asset held by the blockchain node that is not less than a preset amount is in a frozen state;
wherein the random character sequence is determined to be invalid information when the random character sequence does not have an associated asset freeze credential.
11. The device according to claim 10,
under the condition that the random character sequence is matched with the target character sequence, thawing and returning the blockchain asset corresponding to the asset freezing certificate to the blockchain node;
in the event that the random character sequence does not match the target character sequence, a blockchain asset corresponding to the asset freeze credential is deducted from the blockchain node.
12. The apparatus of claim 10, the blockchain node having a plurality of corresponding random character sequences, each random character sequence having a corresponding asset freeze credential; the broadcasting unit is specifically configured to:
under the condition that any random character sequence corresponding to the block chain node is matched with the target character sequence, performing full-network broadcasting on the generated preparation block in a block chain;
when any random character sequence corresponding to the block chain link point is verified to be matched with the target character sequence and the corresponding release time is the earliest of the whole network, the preparation block is recorded as the latest block of the block chain.
13. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the block distribution method of any of claims 1-6 by executing the executable instructions.
14. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of any of claims 1-6.
CN201810848235.4A 2018-07-27 2018-07-27 Block issuing method and device and electronic equipment Active CN109242676B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201810848235.4A CN109242676B (en) 2018-07-27 2018-07-27 Block issuing method and device and electronic equipment
TW108101814A TWI699728B (en) 2018-07-27 2019-01-17 Block publishing method and device, and electronic equipment
PCT/CN2019/084379 WO2020019792A1 (en) 2018-07-27 2019-04-25 Block release method and apparatus, and electronic device

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN109242676A CN109242676A (en) 2019-01-18
CN109242676B true CN109242676B (en) 2023-10-27

Family

ID=65073162

Family Applications (1)

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

Country Status (3)

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

Families Citing this family (5)

* 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 湖南天河国云科技有限公司 An anti-cheating method and system for blockchain applications
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
CN112651745A (en) * 2020-12-30 2021-04-13 杭州趣链科技有限公司 Credit evaluation method of financial block chain, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106651332A (en) * 2016-12-29 2017-05-10 先锋支付有限公司 Block chain and method for generating new block in block chain
CN107078903A (en) * 2016-12-23 2017-08-18 深圳前海达闼云端智能科技有限公司 Digging ore deposit method, device and the node device of block chain
CN108270821A (en) * 2016-12-30 2018-07-10 深圳瀚德创客金融投资有限公司 For the block generation method and network node in block chain network

Family Cites Families (5)

* 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
MA44883A (en) * 2016-05-04 2021-03-24 Algorand Inc DISTRIBUTED TRANSACTION PROPAGATION AND VERIFICATION SYSTEM
CN107438003B (en) * 2016-05-27 2022-08-09 索尼公司 Electronic device, method for electronic device, and information processing system
EP3454519B1 (en) * 2016-12-23 2021-07-21 CloudMinds (Shanghai) Robotics Co., Ltd. Block generation method and device, and blockchain network
CN109242676B (en) * 2018-07-27 2023-10-27 创新先进技术有限公司 Block issuing method and device and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107078903A (en) * 2016-12-23 2017-08-18 深圳前海达闼云端智能科技有限公司 Digging ore deposit method, device and the node device of block chain
CN106651332A (en) * 2016-12-29 2017-05-10 先锋支付有限公司 Block chain and method for generating new block in block chain
CN108270821A (en) * 2016-12-30 2018-07-10 深圳瀚德创客金融投资有限公司 For the block generation method and network node in block chain network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李赫等.智能合约如何可信地与外部世界交互.《区块链技术 金融应用实践》.2017,161-165页. *

Also Published As

Publication number Publication date
CN109242676A (en) 2019-01-18
TWI699728B (en) 2020-07-21
TW202008270A (en) 2020-02-16
WO2020019792A1 (en) 2020-01-30

Similar Documents

Publication Publication Date Title
CN109242676B (en) Block issuing method and device and electronic equipment
CN111737654B (en) Infringement detection method and device based on block chain and electronic equipment
CN109067791B (en) User identity authentication method and device in network
CN111539731A (en) Block chain-based federal learning method and device and electronic equipment
EP3779815A1 (en) Rights and interests distribution method and device and electronic device
US11100284B2 (en) Blockchain-based text similarity detection method, apparatus and electronic device
CN111898360A (en) Text similarity detection method and device based on block chain and electronic equipment
CN111818095B (en) Tax refunding method and device based on block chain and electronic equipment
CN111966538B (en) Block chain data recovery method and device
CN112015823B (en) Block chain data deleting method and device
CN112200567A (en) Resource management method and device based on block chain and electronic equipment
CN112015822B (en) Block chain data deleting method and device
CN111818185A (en) Method and device for starting intelligent contract, electronic equipment and storage medium
CN113886135A (en) Block chain data recovery method and device
CN109146146A (en) Event prediction method and device, electronic equipment
CN111461691A (en) Flow statistical system, method and device based on block chain
CN113469815A (en) Data management method and device
CN110443612B (en) Block chain-based reimbursement expense segmentation method and device and electronic equipment
CN110033367A (en) Based on the contract record method and device of block chain, electronic equipment
CN114546636B (en) A data interaction system and decentralized edge model training and verification method
CN111383008B (en) Block chain transfer method and device based on account model
CN109146147A (en) Event prediction method and device, electronic equipment
US10726049B2 (en) Obtaining blockchain data in stages
HK40003289A (en) Block issuing method and apparatus, electronic apparatus
HK40038365A (en) Infringement detection method and device based on block chain and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40003289

Country of ref document: HK

TA01 Transfer of patent application right

Effective date of registration: 20200925

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200925

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240914

Address after: Guohao Times City # 20-01, 128 Meizhi Road, Singapore

Patentee after: Ant Chain Technology Co.,Ltd.

Country or region after: Singapore

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Innovative advanced technology Co.,Ltd.

Country or region before: Cayman Islands

TR01 Transfer of patent right