Data uploading method and device based on blockchain

By introducing a post-consensus mechanism into the blockchain network, data is first carried out on the chain and then consensus is confirmed, the problem of low concurrency characteristics of the blockchain network is solved, and the rapid data rolling and timely triggering of business needs is achieved.

CN113643028BActive Publication Date: 2025-04-22LENOVO (BEIJING) LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110871437.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-30
Publication Date
2025-04-22
Estimated Expiration
2041-07-30

AI Technical Summary

Technical Problem

The existing blockchain consensus algorithm is inefficient, which restricts the concurrency characteristics of the blockchain network, resulting in delays in timeliness and business demands during data chaining.

Method used

A blockchain-based data penetration method is proposed. By obtaining transaction data, first on-chain processing is carried out, and then confirming consensus after the data is successfully uploaded, the post-consensus mechanism is realized, thereby realizing data preemption and opening and triggering business needs in advance.

Benefits of technology

Through the post-consensus mechanism, the concurrent processing capability of the blockchain network is improved, the rapid data rolling and timely triggering of business needs is achieved, and the waiting time is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113643028B_ABST
    Figure CN113643028B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a blockchain-based data uploading method and device, wherein the method includes: obtaining first transaction data; uploading the first transaction data to the chain; and when the first transaction data is successfully uploaded to the chain, confirming consensus on the first transaction data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to blockchain technology, and relate to but are not limited to a method and device for uploading data to a blockchain. Background Art

[0002] With the development of Internet technology, blockchain has been widely used in data storage and interaction due to its advantages such as decentralization, openness, security, and autonomy.

[0003] Blockchain realizes the distributed and reliable storage of data, and the consensus mechanism is the core technology of blockchain. Its goal is the consistency of distributed storage of ledgers, mainly the confirmation and arbitration of new ledgers (when there are multiple new ledgers, so-called forks), distribution and final consistency. A complete consensus mechanism also includes special cases such as full ledger synchronization of new online nodes and exception handling.

[0004] However, the efficiency of the current consensus algorithm directly restricts the concurrent characteristics of the blockchain network, so the consensus mechanism is also a hot topic of research in academia and industry. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a method and device for uploading data to a blockchain based on blockchain.

[0006] The technical solution of the embodiment of the present application is implemented as follows:

[0007] In a first aspect, an embodiment of the present application provides a method for uploading data to a blockchain based on blockchain, the method comprising:

[0008] Obtaining first transaction data;

[0009] Processing the first transaction data on a blockchain;

[0010] When the first transaction data is successfully uploaded to the chain, a confirmation consensus is reached on the first transaction data.

[0011] In a second aspect, an embodiment of the present application provides a data chain-up device based on blockchain, the device comprising:

[0012] A first acquisition unit, used to acquire first transaction data;

[0013] A first on-chain unit, used for performing on-chain processing on the first transaction data;

[0014] The first consensus unit is used to confirm the first transaction data and reach a consensus when the first transaction data is successfully uploaded to the chain.

[0015] The embodiment of the present application provides a blockchain-based data chain method and device, which obtains first transaction data; processes the first transaction data on the chain; and confirms the first transaction data when the first transaction data is successfully chained. In this way, a post-consensus mechanism can be provided to achieve preemptive chaining of data, thereby triggering subsequent business needs in advance. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 The following is a schematic diagram of the implementation process of the data upload method based on blockchain in the embodiment of this application. Figure 1 ;

[0017] Figure 2 The following is a schematic diagram of the implementation process of the data upload method based on blockchain in the embodiment of this application. Figure 2 ;

[0018] Figure 3 The following is a schematic diagram of the implementation process of the data upload method based on blockchain in the embodiment of this application. Figure 3 ;

[0019] Figure 4 The following is a schematic diagram of the implementation process of the data upload method based on blockchain in the embodiment of this application. Figure 4 ;

[0020] Figure 5 This is a schematic diagram of the composition structure of the data uploading device based on blockchain in an embodiment of the present application;

[0021] Figure 6 A hardware entity schematic diagram of a blockchain node device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] The technical solution of the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0023] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0024] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.

[0025] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are merely to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0026] An embodiment of the present application provides a blockchain-based data chain method, which is applied to a blockchain node device. The functions implemented by the method can be implemented by calling a program code through a processor in the blockchain node device. Of course, the program code can be stored in a storage medium of the blockchain node device. Figure 1 The following is a schematic diagram of the implementation process of the data upload method based on blockchain in the embodiment of this application. Figure 1 ,like Figure 1 As shown, the method includes:

[0027] Step S101, obtaining first transaction data;

[0028] Here, the data chaining method provided in the embodiment of the present application can be executed by a chaining device for the data to be chained, or a server device, a physical host or UE (User Equipment) and other different types of blockchain node devices integrated with the device. Among them, the blockchain node device can be configured with the application involved in the blockchain platform and join the blockchain platform after being reviewed and approved. In addition, the blockchain node device is a device with a certain storage space and can be connected to the network. Of course, the blockchain node device can also be configured in the form of a device cluster. The UE can be a terminal device such as a smart phone, a tablet computer, a laptop, a PDA, a desktop computer or a PDA (Personal Digital Assistant).

[0029] Of course, the blockchain node device can be any blockchain node device in the blockchain network, and the embodiments of the present application do not limit this.

[0030] In the embodiment of the present application, the first transaction data may be any type of transaction data, or may be transaction data that meets a preset condition. For example, the first transaction data may be data with high real-time requirements, or data with certain attribute information matching a preset attribute type.

[0031] Step S102: uploading the first transaction data to a blockchain;

[0032] In the embodiment of the present application, after obtaining the first transaction data, the first transaction data will not be confirmed and agreed upon, but the first transaction data will be first processed on the chain. In the case of successful chaining, the first transaction data will be confirmed and agreed upon later, that is, first packaged, then chained, and then verified later. In this way, for some data with high real-time requirements, it is possible to seize the chain and continue to trigger subsequent business needs. For example, some businesses need to be processed after the first transaction data is chained. If there are a lot of data that need to be chained, and the time for each data to be verified is relatively long, then the time waiting for the first transaction data to be chained is very long. In this way, if the subsequent business demand is a business with relatively high timeliness requirements, it will have a great impact on it. However, the method in the embodiment of the present application can seize the chain and trigger the subsequent business demand in advance. Of course, the subsequent business demand can be other transactions related to the first transaction, or it can be other businesses other than transactions related to the first transaction.

[0033] Step S103: When the first transaction data is successfully uploaded to the chain, a consensus is confirmed on the first transaction data.

[0034] Here, the consensus confirmation of the first transaction data refers to confirming whether the first transaction data meets the consensus conditions, that is, verifying the authenticity and legality of the first transaction data.

[0035] In the embodiment of the present application, by obtaining the first transaction data; uploading the first transaction data to the chain; and confirming the consensus on the first transaction data when the first transaction data is successfully uploaded to the chain, a post-consensus mechanism can be provided to achieve preemptive uploading of data to the chain, thereby triggering subsequent business needs in advance.

[0036] Based on the foregoing embodiments, the present application further provides a method for uploading data to a blockchain based on the blockchain, the method being applied to a blockchain node device, the method comprising:

[0037] Step S111, obtaining first transaction data and second transaction data;

[0038] Here, the first transaction data and the second transaction data are both transaction data that need to be ultimately uploaded to the chain. In the embodiment of the present application, there is no restriction on the time point for obtaining the first transaction data and the second transaction data.

[0039] Step S112: uploading the first transaction data to a blockchain;

[0040] Step S113: Confirming consensus on the second transaction data;

[0041] In the embodiment of the present application, there is no restriction on the execution order of the step S112 and the step S113, and the on-chain processing of the first transaction data and the confirmation consensus of the second transaction data can be performed simultaneously, which can improve the overall efficiency of blockchain processing; of course, any one of the steps can be performed first, such as first on-chain processing of the first transaction data, or first confirmation consensus of the second transaction data.

[0042] Step S114: When the first transaction data is successfully uploaded to the chain and the second transaction data has completed confirmation consensus, confirm consensus on the first transaction data.

[0043] Here, it is necessary to confirm the consensus on the second transaction data first, and then confirm the consensus on the first transaction data. In some embodiments, the first transaction data is transaction data that can be post-consensused, and the second transaction data is transaction data that must be verified before being put on the chain. In some embodiments, the first transaction data is transaction data with high real-time requirements, and the second transaction data is transaction data with low real-time requirements.

[0044] For example, a certain blockchain node device obtains the first transaction data and the second transaction data at a certain moment, then the blockchain node device first sends the second transaction data to multiple verification nodes in the blockchain network for confirmation and consensus. While the multiple verification nodes confirm the consensus on the second transaction data, the blockchain node device puts the first transaction data on the chain. After the first transaction data is successfully put on the chain, the second transaction data has been verified, and the blockchain node device sends the first transaction data to the multiple verification nodes for confirmation and consensus. In this way, the blockchain can concurrently carry out the on-chain operations of the first transaction data and the second transaction data, and there is no need to first package, verify, and put the first transaction data on the chain, and then package, verify, and put the second transaction data on the chain. The data on-chain method in the embodiment of the present application greatly improves the concurrent processing capability of the blockchain.

[0045] Based on the foregoing embodiments, the present application further provides a method for uploading data to a blockchain based on the blockchain, the method being applied to a blockchain node device, the method comprising:

[0046] Step S121, obtaining the first transaction data and the second transaction data;

[0047] Step S122: If the first transaction data is not confirmed by consensus, the first transaction data is put on the chain;

[0048] Here, confirming consensus on transaction data refers to verifying the authenticity and legality of transaction data.

[0049] Step S123: Confirming consensus on the second transaction data;

[0050] In the embodiment of the present application, there is no limitation on the execution order of step S122 and step S123.

[0051] Step S124: When the first transaction data is successfully uploaded to the blockchain and the second transaction data has completed confirmation consensus, confirm the first transaction data;

[0052] Step S125: When the second transaction data is confirmed to meet the consensus conditions, the second transaction data is put on the chain; wherein the attribute information of the first transaction data is different from that of the second transaction data.

[0053] In the embodiment of the present application, there is no limitation on the execution order of step S124 and step S125. In specific implementation, the two steps can be performed simultaneously, or one after the other.

[0054] Here, the attribute information may include the level of timeliness of the transaction data, for example, the first transaction data is transaction data with high real-time requirements, and the second transaction data is transaction data with low real-time requirements. The attribute information may also include the type of transaction data, for example, the type of the first transaction data indicates that the first transaction data is transaction data that can be post-consensus, and the type of the second transaction data indicates that the second transaction data is transaction data that must be verified before being put on the chain. Of course, the embodiment of the present application does not limit the specific form of expression of the attribute information.

[0055] In the embodiment of the present application, the method provided by steps S123 to S125 can greatly improve the concurrent processing capability of the blockchain.

[0056] Based on the above embodiments, the present application further provides a method for uploading data to a blockchain based on blockchain. Figure 2 The following is a schematic diagram of the implementation process of the data upload method based on blockchain in the embodiment of this application. Figure 2 ,like Figure 2 As shown, the method is applied to a blockchain node device, and the method includes:

[0057] Step S201, obtaining first transaction data;

[0058] Step S202: Uploading the first transaction data to the blockchain;

[0059] Step S203: Control the blockchain node that processes the first transaction data on the chain to be mortgaged, so that when the first transaction data is not confirmed by consensus, the business related to the first transaction data can be processed;

[0060] Here, since the first transaction data has not been confirmed as a consensus before being uploaded to the chain, that is, the authenticity and legality of the first transaction data have not been verified before being uploaded to the chain, it is necessary to control the blockchain node that uploads the first transaction data to the chain to be mortgaged (for example, mortgage a certain fee), so as to ensure the normal progress of subsequent business processing related to the first transaction data.

[0061] Step S204: When the first transaction data is successfully uploaded to the blockchain, a consensus is confirmed on the first transaction data;

[0062] Here, after the first transaction data is successfully uploaded to the chain, it is possible to wait for multiple verification nodes to complete verification of other transaction data before confirming the consensus on the first transaction data. It is also possible to wait for other transaction data related to the first transaction data to be obtained before confirming the consensus on the first transaction data. The embodiment of the present application does not limit this.

[0063] Step S205: After the mortgage is completed, if the first transaction data is confirmed to meet the consensus conditions, the mortgage is returned;

[0064] Step S206: After the mortgage is completed, if the first transaction data is confirmed not to meet the consensus conditions, the mortgage will be deducted.

[0065] In an embodiment of the present application, if the first transaction data is confirmed to be true and legal transaction data, the mortgage will be returned to the blockchain node that processes the first transaction data on the chain; if the first transaction data is confirmed to be illegal and untrue transaction data, the mortgage will be deducted.

[0066] In some embodiments, the step of performing on-chain processing on the first transaction data includes: performing on-chain processing on the first transaction data, storing the first transaction data in a first data area of ​​a designated block;

[0067] Correspondingly, when the first transaction data is successfully uploaded to the chain, after the first transaction data is confirmed to have reached a consensus, the step further includes: if the first transaction data is confirmed to meet the consensus conditions, moving the first transaction data from the first data area to the second data area of ​​the designated block.

[0068] Based on the above embodiments, the present application further provides a method for uploading data to a blockchain based on blockchain. Figure 3The following is a schematic diagram of the implementation process of the data upload method based on blockchain in the embodiment of this application. Figure 3 ,like Figure 3 As shown, the method is applied to a blockchain node device, and the method includes:

[0069] Step S301, obtaining first transaction data;

[0070] Step S302: Upload the first transaction data to the blockchain and store the first transaction data in the first data area of ​​the specified block;

[0071] In an embodiment of the present application, each block of the blockchain is divided into two data areas, namely a first data area and a second data area, the first data area is a post-consensus data area, and the second data area is a confirmed data area.

[0072] Here, after the first transaction data is uploaded to the chain, since the first transaction data has not yet been confirmed and agreed upon, the first transaction data can be stored in the post-consensus data area of ​​the newly opened block in the blockchain.

[0073] Step S303: When the first transaction data is successfully uploaded to the blockchain, a consensus is confirmed on the first transaction data;

[0074] Step S304: If the first transaction data is confirmed to satisfy the consensus condition, the first transaction data is moved from the first data area to the second data area of ​​the designated block.

[0075] Here, if the first transaction data is confirmed to satisfy the consensus condition in a subsequent process, that is, is verified to be legal transaction data, the first transaction data is moved from the post-consensus data area to the confirmed data area.

[0076] Based on the foregoing embodiments, the present application further provides a method for uploading data to a blockchain based on the blockchain, the method being applied to a blockchain node device, the method comprising:

[0077] Step S311, obtaining first transaction data;

[0078] Step S312: Upload the first transaction data to the blockchain and store the first transaction data in the first data area of ​​the specified block;

[0079] Step S313: When the first transaction data is successfully uploaded to the blockchain, obtain third transaction data; wherein the third transaction data is associated with the first transaction data;

[0080] For example, the first transaction data is that A lends a certain amount of money to B, and the third transaction data may be that B uses the certain amount of money to do a certain operation, or the third transaction data may be that B lends the certain amount of money to C. In the embodiment of the present application, the specific content of the association relationship is not limited.

[0081] Step S314: The third transaction data is put on the chain. If the first transaction data is not confirmed by consensus, the third transaction data is stored in the first data area of ​​the designated block;

[0082] Here, when the third transaction data is processed on the chain, if the first transaction data has not been confirmed by consensus at this time, the third transaction data will be stored in the post-consensus data area of ​​the newly opened block in the blockchain.

[0083] Step S315: Associating the first transaction data with the third transaction data.

[0084] Here, the first transaction data and the third transaction data can be associated by indicating the identifier of the first transaction data in the block corresponding to the third transaction data. Of course, the first transaction data and the third transaction data can also be associated by other methods, which are not limited in the embodiment of the present application.

[0085] Step S316: When the first transaction data is successfully uploaded to the blockchain, a consensus is confirmed on the first transaction data;

[0086] Step S317: If the first transaction data is confirmed to satisfy the consensus condition, the first transaction data is moved from the first data area to the second data area of ​​the designated block.

[0087] In some embodiments, the method further comprises:

[0088] Step S31: when the third transaction data has been successfully uploaded to the blockchain, if the first transaction data has not been confirmed by consensus, determine a preset amount of fees based on the association information between the first transaction data and the third transaction data;

[0089] Step S32: Control the blockchain node that processes the third transaction data on the chain to pledge the preset amount of fees.

[0090] Based on the foregoing embodiments, the present application further provides a method for uploading data to a blockchain based on the blockchain, the method being applied to a blockchain node device, the method comprising:

[0091] Step S321, obtaining first transaction data;

[0092] Step S322: Upload the first transaction data to the blockchain and store the first transaction data in the first data area of ​​the designated block;

[0093] Step S323: When the first transaction data is successfully uploaded to the blockchain, obtain third transaction data; wherein the third transaction data is associated with the first transaction data;

[0094] Step S324: The third transaction data is put on the chain. If the first transaction data is not confirmed by consensus, the third transaction data is stored in the first data area of ​​the designated block;

[0095] Step S325: Associating the first transaction data with the third transaction data;

[0096] Step S326: The third transaction data is processed on the chain. If the first transaction data is confirmed to meet the consensus condition and the third transaction data does not need to be confirmed by consensus, the third transaction data is stored in the second data area of ​​the designated block;

[0097] In the embodiment of the present application, the steps S324 to S325 are different from the step S326 in that the third transaction data is processed on the chain. During use, the actual data can be matched with the conditions in step S324 or step S326, and different processing methods can be selected according to the matching results.

[0098] Here, when the third transaction data is processed on the chain, if the first transaction data has been confirmed to meet the consensus conditions at this time, and the third transaction data is data that does not need to be verified, the third transaction data will be stored in the confirmed data area of ​​the newly opened block in the blockchain.

[0099] Step S327: When the first transaction data is successfully uploaded to the blockchain, a consensus is confirmed on the first transaction data;

[0100] Step S328: If the first transaction data is confirmed to satisfy the consensus condition, the first transaction data is moved from the first data area to the second data area of ​​the designated block.

[0101] Based on the foregoing embodiments, the present application further provides a method for uploading data to a blockchain based on the blockchain, the method being applied to a blockchain node device, the method comprising:

[0102] Step S331, obtaining first transaction data;

[0103] Step S332: Upload the first transaction data to the blockchain and store the first transaction data in the first data area of ​​the specified block;

[0104] Step S333: When the first transaction data is successfully uploaded to the blockchain, obtain third transaction data; wherein the third transaction data is associated with the first transaction data;

[0105] Step S334: The third transaction data is put on the chain. If the first transaction data is not confirmed by consensus, the third transaction data is stored in the first data area of ​​the designated block;

[0106] Step S335: Associating the first transaction data with the third transaction data;

[0107] Step S336: The third transaction data is processed on the chain. If the first transaction data is confirmed to meet the consensus condition and the third transaction data does not need to be confirmed by consensus, the third transaction data is stored in the second data area of ​​the designated block;

[0108] Step S337: The third transaction data is processed on the chain. If the first transaction data is confirmed to meet the consensus condition and the third transaction data is not confirmed to meet the consensus, the third transaction data is stored in the first data area of ​​the designated block;

[0109] In the embodiment of the present application, the steps S334 to S335, the step S336, and the step S337 are three different ways of processing the third transaction data on the chain. During use, the actual data can be matched with the conditions in step S334, step S336, or step S337, and different processing methods can be selected according to the matching results.

[0110] Here, when the third transaction data is processed on the chain, if the first transaction data has been confirmed to meet the consensus conditions at this time, and the third transaction data is data that needs to be verified, and the third transaction data has not been verified, then the third transaction data is stored in the post-consensus data area of ​​the newly opened block in the blockchain. Similarly, when the third transaction data is processed on the chain, if the first transaction data has been confirmed to meet the consensus conditions at this time, and the third transaction data is data that needs to be verified, and the third transaction data has been verified to be legal, then the third transaction data is stored in the confirmed data area of ​​the newly opened block in the blockchain.

[0111] Step S338: When the first transaction data is successfully uploaded to the blockchain, a consensus is confirmed for the first transaction data;

[0112] Step S339: If the first transaction data is confirmed to satisfy the consensus condition, the first transaction data is moved from the first data area to the second data area of ​​the designated block.

[0113] Based on the above embodiments, the present application further provides a method for uploading data to a blockchain based on blockchain. Figure 4 The following is a schematic diagram of the implementation process of the data upload method based on blockchain in the embodiment of this application. Figure 4 ,like Figure 4 As shown, the method is applied to a blockchain node device, and the method includes:

[0114] Step S401, obtaining first transaction data;

[0115] Step S402: Uploading the first transaction data to the blockchain;

[0116] Step S403: When the first transaction data is successfully uploaded to the blockchain, a consensus is confirmed on the first transaction data;

[0117] Here, after the step S403 is executed, you can choose to execute the following step S404, or execute the following step S405.

[0118] Step S404: if the first transaction data is confirmed to not satisfy the consensus condition, mark the block where the first transaction data is located to indicate that the first transaction data is invalid;

[0119] Step S405: If the first transaction data is confirmed to not meet the consensus condition, the block where the first transaction data is located is deleted.

[0120] In the embodiment of the present application, a method for uploading data to the chain first and then verifying it is proposed. By controlling the uploading nodes to mortgage, the risks brought by the above method are avoided and the interests of subsequent participants are protected. Furthermore, if the data that is first uploaded to the chain and then verified is verified to be illegal in the subsequent process, that is, the confirmation consensus fails, the block where the data is located is marked to indicate that the first transaction data is invalid, or that the block where the data is located is a block where illegal data is located. Alternatively, if the confirmation consensus fails, the block where the data is located in the blockchain can also be deleted. Of course, based on the characteristics of the current blockchain, it is impossible to delete the data, so it can be flexibly adjusted in the specific implementation of the solution.

[0121] At present, the existing consensus of blockchain is generally divided into two stages, namely the new ledger confirmation stage and the distribution stage;

[0122] The determination of new ledgers is quite different between public chains and consortium chains. New ledgers in public chains are usually provided by competition, with the winning nodes providing new ledgers, such as PoW (Proof of Work) and PoS (Proof of Stake). Consortium chains usually use endorsements (to determine the validity of ledgers) and submissions to specific nodes (or multiple nodes), and algorithms and mechanisms for determining new ledgers based on time sorting. In the distribution stage, for efficient distribution, a P2P (Peer-to-Peer) mechanism is generally used. Considering that the differences between various algorithms in the distribution stage are relatively small, the general consensus algorithm also specifically refers to the first stage, that is, how to determine the stage of new ledgers.

[0123] The reason why the public chain has low performance is that it adopts a competitive mechanism, and only one node can generate a new ledger in a single time slice. Although the alliance chain can generate new ledgers on multiple nodes, the bottleneck is often in the endorsement and time sorting links.

[0124] Based on this, the embodiment of the present application provides a data chain method based on blockchain, that is, a new consensus algorithm and mechanism (referred to as a post-consensus mechanism) is proposed, which can produce blocks with zero confirmation, thereby improving the concurrency characteristics of the blockchain network. At the same time, the embodiment of the present application proposes a new blockchain system for this mechanism. The blockchain system includes a blockchain network, and multiple blockchain node devices connected to the network, and any device of the multiple blockchain node devices can implement the data chain method in the embodiment of the present application.

[0125] The post-consensus mechanism is mainly implemented in the following ways:

[0126] (1) Partition the blockchain data into confirmed transactions (corresponding to the confirmed transaction data area) and pending transactions (i.e., post-consensus transactions, corresponding to the post-consensus transaction data area).

[0127] Here, the blockchain node can choose to add post-consensus transaction data in addition to the traditional confirmation (or endorsement) transaction data for the data to be uploaded to the blockchain. Similarly, when distributing data uploaded to the blockchain, in addition to distributing confirmed transaction data, there is also post-consensus transaction data. Of course, in some cases, the node can only send post-consensus transaction data.

[0128] (2) For the above-mentioned post-consensus transaction data, when it is subsequently used, the node can adopt certain mechanisms to process it as needed.

[0129] Mechanism 1: Put the new associated transaction together with the previous post-consensus transaction into the post-consensus transaction data area, and indicate the module number of its previous post-consensus transaction.

[0130] Here, if a new related transaction needs to be put on the chain, and the previous post-consensus transaction has not been confirmed (if the previous post-consensus transaction data is not confirmed, it is put into the post-consensus transaction data area), then the new related transaction is also put into the post-consensus transaction data area. The "put together" means that both are put into the post-consensus transaction data area. Of course, the new related transaction and the previous post-consensus transaction are not put at the same time point, and they are put into the post-consensus transaction data area of ​​different blocks.

[0131] Mechanism 2: Put the new related transaction together with the previous post-consensus transaction into the confirmed transaction data area. This is mainly for the previous post-consensus transaction that has reached the consensus condition, or meets the consensus condition under the current node confirmation, and the new related transaction does not need to be confirmed.

[0132] Here, if a new related transaction needs to be put on the chain, and the previous post-consensus transaction has been confirmed to meet the consensus conditions, the previous post-consensus transaction needs to be moved from the post-consensus transaction data area to the confirmed transaction data area. At the same time, if the new related transaction does not need to be confirmed, the new related transaction is placed in the confirmed transaction data area. The "together" placement means that all the transactions are placed in the confirmed transaction data area. Of course, the new related transaction and the previous post-consensus transaction are not placed at the same time point, and are placed in the confirmed transaction data areas of different blocks.

[0133] Mechanism 3: Put new related transactions in the post-consensus transaction data area, and put the previous post-consensus transactions in the confirmed transaction data area. This is mainly for the previous post-consensus transactions that have reached the consensus conditions, or meet the consensus conditions under the current node confirmation, but the new related transactions need to be confirmed and agreed upon.

[0134] Here, if a new related transaction needs to be put on the chain, and the previous post-consensus transaction has been confirmed to meet the consensus conditions, the previous post-consensus transaction needs to be moved from the post-consensus transaction data area to the confirmed transaction data area. At the same time, if a new related transaction needs to be confirmed but has not been confirmed to be legal, the new related transaction will be placed in the post-consensus transaction data area.

[0135] In the embodiment of the present application, the post-consensus transaction data does not need to be confirmed or endorsed by the transaction party in advance in the on-chain data block, and is only included as possible transaction content. In addition, the post-consensus transaction data is gradually confirmed (or endorsed) in subsequent data blocks. When the consensus conditions are met, the post-consensus transaction data can be moved from the post-consensus transaction data area to the confirmed transaction data area (i.e., the normal blockchain data area).

[0136] (3) Add a GAS mechanism to the above post-consensus transaction data.

[0137] Here, we can add a GAS mechanism to the above post-consensus transaction data (GAS is a unit of measurement in the Ethereum network, and is an indicator designed to quantify computing power consumption). That is, the submitting node pre-mortgages part of the token (i.e., token) as an endorsement to ensure that the data is executed. If the subsequent verification transaction is normal, the GAS will be returned to the submitting node, otherwise it will be deducted.

[0138] Of course, in the above GAS mechanism, when the previous post-consensus transaction is still in the post-consensus transaction data area, in the subsequent new associated transactions, the submitting node can be controlled to increase or decrease GAS.

[0139] In the embodiment of the present application, with the above mechanism, a lot of data with high real-time requirements can be preemptively uploaded to the chain without confirmation or endorsement, so that after the data is quickly uploaded to the chain, subsequent business needs can be triggered in advance. Of course, there may be certain risks for subsequent operations of unconfirmed transactions (if the transaction is false or illegal), so the interests of subsequent participants can be ensured by pre-mortgaging fees (currency used for circulation in the blockchain).

[0140] Based on the foregoing embodiments, the embodiments of the present application provide a data chain device based on blockchain, which includes the units included and the sub-units included in each unit, which can be implemented by a processor in a blockchain node device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a CPU (Central Processing Unit), MPU (Microprocessor Unit), DSP (Digital Signal Processing) or FPGA (Field Programmable Gate Array), etc.

[0141] Figure 5 This is a schematic diagram of the structure of the data on-chain device based on blockchain in the embodiment of the present application. Figure 5 As shown, the device 500 includes:

[0142] A first acquisition unit 501 is used to acquire first transaction data;

[0143] A first on-chain unit 502, configured to process the first transaction data on a chain;

[0144] The first consensus unit 503 is used to confirm the first transaction data and reach a consensus when the first transaction data is successfully uploaded to the chain.

[0145] In some embodiments, the apparatus further comprises:

[0146] A second acquisition unit, used to acquire second transaction data;

[0147] A second consensus unit, used to confirm the second transaction data and reach a consensus;

[0148] Correspondingly, the first consensus unit 503 includes:

[0149] The first consensus subunit is used to confirm the first transaction data and reach a consensus when the first transaction data is successfully uploaded to the chain and the second transaction data has completed the confirmation consensus.

[0150] In some embodiments, the apparatus further comprises:

[0151] A second on-chain unit, configured to, when the second transaction data is confirmed to satisfy a consensus condition, perform on-chain processing on the second transaction data;

[0152] The first transaction data and the second transaction data have different attribute information.

[0153] In some embodiments, the apparatus further comprises:

[0154] A mortgage unit, used to control the blockchain node that processes the first transaction data on the chain to mortgage, so that when the first transaction data is not confirmed by consensus, the business related to the first transaction data can be processed;

[0155] A return unit, used to return the mortgage after the mortgage is completed if the first transaction data is confirmed to meet the consensus condition;

[0156] The deduction unit is used to deduct the mortgage if the first transaction data is confirmed to not meet the consensus conditions after the mortgage is completed.

[0157] In some embodiments, the first uplink unit 502 includes:

[0158] A first on-chain subunit, configured to perform on-chain processing on the first transaction data and store the first transaction data in a first data area of ​​a designated block;

[0159] Correspondingly, the device further includes:

[0160] A moving unit is used to move the first transaction data from the first data area to the second data area of ​​the designated block if the first transaction data is confirmed to satisfy the consensus condition.

[0161] In some embodiments, the apparatus further comprises:

[0162] A third acquisition unit, configured to acquire third transaction data when the first transaction data is successfully uploaded to the blockchain; wherein the third transaction data is associated with the first transaction data;

[0163] A third on-chain unit is used to process the third transaction data on-chain, and if the first transaction data is not confirmed by consensus, store the third transaction data in the first data area of ​​a designated block;

[0164] An associating unit, configured to associate the first transaction data with the third transaction data.

[0165] In some embodiments, the third on-chain unit is also used to perform on-chain processing on the third transaction data. If the first transaction data is confirmed to meet the consensus conditions and the third transaction data does not need to be confirmed by consensus, the third transaction data is stored in the second data area of ​​the designated block.

[0166] In some embodiments, the third on-chain unit is also used to perform on-chain processing on the third transaction data. If the first transaction data is confirmed to meet the consensus conditions and the third transaction data is not confirmed to meet the consensus, the third transaction data is stored in the first data area of ​​the designated block.

[0167] In some embodiments, the apparatus further comprises:

[0168] A marking unit is used to mark the block where the first transaction data is located if the first transaction data is confirmed to not meet the consensus condition, so as to indicate that the first transaction data is invalid.

[0169] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0170] It should be noted that in the embodiments of the present application, if the above-mentioned blockchain-based data chain method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for an electronic device (which can be a personal computer, server, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM (Read Only Memory), disk or optical disk, etc. Various media that can store program codes. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0171] Correspondingly, an embodiment of the present application provides a blockchain node device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the blockchain-based data chain method provided in the above embodiment are implemented.

[0172] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned blockchain-based data chain method are implemented.

[0173] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0174] It should be noted that Figure 6 A schematic diagram of a hardware entity of a blockchain node device according to an embodiment of the present application is shown in FIG. Figure 6 As shown, the hardware entity of the blockchain node device 600 includes: a processor 601, a communication interface 602 and a memory 603, wherein

[0175] The processor 601 generally controls the overall operation of the blockchain node device 600.

[0176] The communication interface 602 may enable the blockchain node device 600 to communicate with other blockchain node devices or servers through a network.

[0177] The memory 603 is configured to store instructions and applications executable by the processor 601, and can also cache data to be processed or processed by the processor 601 and various modules in the blockchain node device 600 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through FLASH (flash memory) or RAM (Random Access Memory).

[0178] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0179] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0180] In addition, all functional units in the embodiments of the present application can be integrated into one processing module, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.

[0181] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0182] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0183] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0184] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for uploading data to a blockchain, characterized in that: The method comprises: Obtaining first transaction data; Processing the first transaction data on a blockchain; When the first transaction data is successfully uploaded to the blockchain, a consensus is reached on the first transaction data; Acquiring second transaction data; Confirming consensus on the second transaction data; Correspondingly, when the first transaction data is successfully uploaded to the chain, the first transaction data is confirmed to have a consensus, including: When the first transaction data is successfully uploaded to the blockchain and the second transaction data has completed confirmation consensus, confirm the first transaction data; The uploading of the first transaction data to a blockchain includes: The first transaction data is processed on the chain and stored in the first data area of ​​the specified block.

2. The method according to claim 1, characterized in that Before the first transaction data is put on the chain, the first transaction data has not been confirmed by consensus; after the second transaction data is confirmed by consensus, the method further includes: When the second transaction data is confirmed to satisfy the consensus condition, the second transaction data is uploaded to the chain; The first transaction data and the second transaction data have different attribute information.

3. The method according to claim 1, characterized in that After the first transaction data is put on-chain, the method further includes: Controlling the blockchain node that processes the first transaction data on the chain to be mortgaged, so that when the first transaction data is not confirmed by consensus, the business related to the first transaction data can be processed; After the pledge is completed, if the first transaction data is confirmed to meet the consensus conditions, the pledge will be returned; or, After the mortgage is completed, if the first transaction data is confirmed to not meet the consensus conditions, the mortgage will be deducted.

4. The method according to any one of claims 1 to 3, characterized in that: In the case where the first transaction data is successfully uploaded to the chain, after the first transaction data is confirmed and a consensus is reached, the method further includes: If the first transaction data is confirmed to satisfy the consensus condition, the first transaction data is moved from the first data area to the second data area of ​​the designated block.

5. The method according to claim 4, characterized in that The method further comprises: When the first transaction data is successfully uploaded to the blockchain, third transaction data is obtained; wherein the third transaction data is associated with the first transaction data; The third transaction data is processed on the chain. If the first transaction data is not confirmed by consensus, the third transaction data is stored in the first data area of ​​the specified block; The first transaction data is associated with the third transaction data.

6. The method according to claim 5, characterized in that In the case where the first transaction data is successfully uploaded to the chain, after obtaining the third transaction data, the method further includes: The third transaction data is processed on the chain. If the first transaction data is confirmed to meet the consensus conditions and the third transaction data does not need to be confirmed by consensus, the third transaction data is stored in the second data area of ​​the designated block.

7. The method according to claim 6, characterized in that In the case where the first transaction data is successfully uploaded to the chain, after obtaining the third transaction data, the method further includes: The third transaction data is processed on the chain. If the first transaction data is confirmed to meet the consensus conditions and the third transaction data is not confirmed by consensus, the third transaction data is stored in the first data area of ​​the specified block.

8. The method according to claim 1, characterized in that: In the case where the first transaction data is successfully uploaded to the chain, after the first transaction data is confirmed and a consensus is reached, the method further includes: If the first transaction data is confirmed to not satisfy the consensus condition, the block where the first transaction data is located is marked to indicate that the first transaction data is invalid.

9. A data uploading device based on blockchain, characterized in that: The device comprises: A first acquisition unit, used to acquire first transaction data; A first on-chain unit, used for performing on-chain processing on the first transaction data; A first consensus unit, configured to confirm and reach consensus on the first transaction data when the first transaction data is successfully uploaded to the chain; A second acquisition unit, used to acquire second transaction data; A second consensus unit, used to confirm the second transaction data and reach a consensus; The first consensus unit is specifically configured to confirm the first transaction data when the first transaction data is successfully uploaded to the chain and the second transaction data has completed the confirmation consensus; The first on-chain unit is specifically used to perform on-chain processing on the first transaction data and store the first transaction data in a first data area of ​​a designated block.

Citation Information

Patent Citations

  • Block data processing method and apparatus, device and storage medium

    CN108846673A

  • Data storage method and device, data query method and device, server and medium

    CN111538757A