Blockchain transaction processing method and related apparatus, and medium and product

The acquisition and verification of transactions in the blockchain hierarchical consensus system through the target consensus network solves the problem that local consensus networks find it difficult to query the results of target transactions on the chain, and realizes trustworthy interaction without reading blockchain information , improves the security and efficiency of transaction processing.

WO2024234627A1PCT designated stage expired Publication Date: 2024-11-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/137030
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-18
Filing Date
2023-12-07
Publication Date
2024-11-21

AI Technical Summary

Technical Problem

In the blockchain hierarchical consensus system, it is difficult for local consensus networks to verify and query the chained results of target transactions without reading target blockchain information, which affects the credibility and security of transactions.

Method used

The added target blocks are obtained through the target consensus network, the target transactions and block headers are obtained, and the verification is carried out on the chain based on the verification information. After the verification is successful, the transaction result data is sent to the subscription node for querying the local consensus network, which realizes that the unreadable Trusted interaction of the result on-chain in the case of obtaining the target blockchain information.

Benefits of technology

While ensuring the security of the target blockchain information, it realizes trusted interaction of transaction results by the local consensus network, improving the security and efficiency of transaction processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023137030_21112024_PF_FP_ABST
    Figure CN2023137030_21112024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present disclosure are a blockchain transaction processing method and a related apparatus, and a medium. The blockchain transaction processing method comprises: acquiring an added first target block from among first blocks of a first blockchain, wherein the first blockchain prohibits access from outside a target consensus network; acquiring a first target transaction and a first block header from the first target block; acquiring first verification information corresponding to the first target transaction; performing chaining verification of the first target transaction on the basis of the first target transaction, the first verification information and the first block header; if the chaining verification is successful, acquiring transaction result data of the first target transaction; and sending the transaction result data to a subscriber node, such that a local consensus network acquires the transaction result data from the subscriber node. By means of the embodiments of the present disclosure, trusted chaining result interaction can be performed without reading target blockchain information. The embodiments of the present disclosure can be applied to various scenarios such as blockchains, structured information processing and security techniques.
Need to check novelty before this filing date? Find Prior Art

Description

Blockchain transaction processing method, related devices and media, and products

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 18, 2023, with application number 2023105667701 and application name “Blockchain transaction processing method, related devices and media”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present disclosure relates to the field of blockchain, and in particular to blockchain transaction processing. Background Art

[0003] In current blockchain layered consensus systems, local consensus networks upload plaintext transactions generated locally to the blockchain. However, for security reasons, certain types of transactions do not want to be publicly visible to third parties on the blockchain. Therefore, transactions of the target type that are not intended to be publicly visible on the blockchain are sent to the target consensus network and recorded on the target blockchain, which prohibits external access. However, precisely because the target blockchain prohibits external access, local consensus networks are difficult to verify and query. Therefore, ensuring trustworthy interaction with on-chain results without accessing the target blockchain presents a challenge.

[0004] Summary of the Invention

[0005] The embodiments of the present disclosure provide a blockchain transaction processing method, related devices, and media, which can perform trusted on-chain result interaction without reading the target blockchain information.

[0006] According to one aspect of the present disclosure, a blockchain transaction processing method is provided. The blockchain transaction processing method is executed by a target consensus network, and the blockchain transaction processing method includes:

[0007] Obtaining an additional first target block from each first block of the first blockchain, wherein the first block is generated by the target consensus network and is used to record a first transaction of the target type from the local consensus network, and the first blockchain prohibits access from outside the target consensus network;

[0008] Obtaining a first target transaction and a first block header from the first target block;

[0009] Obtaining first verification information corresponding to the first target transaction;

[0010] Perform on-chain verification of the first target transaction based on the first target transaction, the first verification information, and the first block header;

[0011] If the on-chain verification is successful, obtain the transaction result data of the first target transaction;

[0012] The transaction result data is sent to the subscribing node for the local consensus network to obtain from the subscribing node.

[0013] According to one aspect of the present disclosure, a blockchain transaction processing device is provided. The blockchain transaction processing device is located in a target consensus network and includes:

[0014] a first acquiring unit, configured to acquire an additional first target block from each first block of a first blockchain, wherein the first block is generated by the target consensus network and is configured to record a first transaction of a target type from a local consensus network, and the first blockchain is prohibited from being accessed by anyone outside the target consensus network;

[0015] A second acquiring unit, configured to acquire a first target transaction and a first block header from the first target block;

[0016] a third acquiring unit, configured to acquire first verification information corresponding to the first target transaction;

[0017] an on-chain verification unit, configured to perform on-chain verification of the first target transaction based on the first target transaction, the first verification information, and the first block header;

[0018] A fourth acquiring unit, configured to acquire transaction result data of the first target transaction if the on-chain verification is successful;

[0019] The first sending unit is used to send the transaction result data to the subscription node, so that the local consensus network can obtain it from the subscription node.

[0020] According to one aspect of the present disclosure, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the blockchain transaction processing method as described above is implemented.

[0021] According to one aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the blockchain transaction processing method as described above is implemented.

[0022] According to one aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program is read and executed by a processor of a computer device, so that the computer device performs the blockchain transaction processing method as described above.

[0023] In the disclosed embodiment, the target consensus network obtains the first target transaction, the first verification information corresponding to the first target transaction, and the first block header from the first target block added to the first blockchain. Based on this information, the target consensus network verifies whether the first target transaction is truly on-chain. Upon successful verification, the target consensus network obtains the transaction result data and sends it to the subscribing node for query by the local consensus network. In this way, the local consensus network obtains the transaction result data without reading the target blockchain information or compromising the data security of the target blockchain, thus achieving trustworthy on-chain result interaction while ensuring the security of the target blockchain information.

[0024] Other features and advantages of the present disclosure will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present disclosure. The purposes and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] FIG1 is a schematic diagram of the system architecture of a blockchain layered consensus network to which an embodiment of the present disclosure is applied;

[0026] FIG2 is a schematic diagram of a blockchain transaction processing method according to an embodiment of the present disclosure applied to a resource transfer transaction on-chain;

[0027] FIG3 is a flowchart of a blockchain transaction processing method according to one embodiment of the present disclosure;

[0028] FIG4 is a first flow chart of obtaining a first target block using a first blockchain height counter in step 310 of FIG3 ;

[0029] FIG5A shows a schematic diagram of an implementation process of step 420 in FIG4 ;

[0030] FIG5B shows a schematic diagram of an implementation process of step 430 in FIG4 ;

[0031] FIG6 shows a second flow chart of obtaining the first target block using the first blockchain height counter in step 310 of FIG3 ;

[0032] FIG7 shows a schematic diagram of an implementation process of step 610 in FIG6 ;

[0033] FIG8 shows a flowchart of obtaining the first target block by using the subscription condition in step 310 of FIG3 ;

[0034] FIG9A shows a schematic diagram of a data structure of a first subscription request with a first subscription condition;

[0035] FIG9B shows a schematic diagram of a data structure of a first subscription request with a first subscription condition and a subscription period;

[0036] FIG10 is a flowchart of obtaining a first subscription request based on integration of multiple second subscription requests;

[0037] FIG11 shows a schematic diagram of a data structure of a second subscription request with a second subscription condition;

[0038] FIG12 shows a schematic diagram of an implementation process of generating a first subscription condition based on multiple second subscription conditions;

[0039] FIG13 shows a schematic diagram of an implementation process of sending transaction result data to subscription nodes corresponding to different transaction subtypes;

[0040] FIG14 shows a schematic diagram of an implementation process of sending transaction result data to subscription nodes corresponding to different object sets;

[0041] FIG15 is a flowchart of obtaining a first transaction based on a first priority and a second priority;

[0042] FIG16 is a schematic diagram showing an implementation process of obtaining a first transaction based on a first priority and a second priority;

[0043] FIG17 is a flowchart of an implementation process of step 1520 in FIG15 ;

[0044] FIG18 is a flowchart of an implementation process of step 340 in FIG3 ;

[0045] FIG19 is a schematic diagram showing an implementation process of performing the first sub-verification based on the first block header;

[0046] FIG20 is a flowchart of an implementation process of step 1830 in FIG18;

[0047] FIG21A shows a schematic diagram of an implementation process of generating a first tree in step 2010 in FIG20 ;

[0048] FIG21B is a schematic diagram showing the step 2020 of obtaining the first bypass feature of the first path in FIG20 ;

[0049] FIG22 is a flowchart of an implementation process of step 340 in FIG3 using a trusted execution environment;

[0050] FIG23 is a flowchart of an implementation process of step 360 in FIG3 ;

[0051] FIG24 is a flowchart of a blockchain transaction processing method according to another embodiment of the present disclosure;

[0052] FIG25 is a flowchart of a blockchain transaction processing method according to another embodiment of the present disclosure;

[0053] FIG26 is a flowchart of an implementation process of steps 2510-2520 in FIG25;

[0054] FIG27A shows a schematic diagram of an implementation process of generating a first tree in step 2610 in FIG26 ;

[0055] FIG27B is a schematic diagram showing the step 2620 of obtaining the first bypass feature of the first path in FIG26 ;

[0056] FIG28 is a flowchart of an implementation process of step 360 in FIG3 using a trusted execution environment;

[0057] FIG29 is a multi-terminal interaction diagram of a detailed embodiment of the present disclosure;

[0058] FIG30 is a module diagram of a blockchain transaction processing device according to one embodiment of the present disclosure;

[0059] FIG31 is a diagram illustrating a terminal structure for implementing the blockchain transaction processing method shown in FIG3 according to an embodiment of the present disclosure;

[0060] FIG32 is a diagram illustrating a server structure for implementing the blockchain transaction processing method shown in FIG3 according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not intended to limit the present disclosure.

[0062] Before further explaining the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are explained. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:

[0063] Artificial intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve desired outcomes. In other words, AI is a comprehensive field within computer science that seeks to understand the essence of intelligence and create new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making. AI technology is an interdisciplinary discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning. With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, robots, smart medical care, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0064] Blockchain: Blockchain is a new application model for computer technologies such as distributed data storage, peer-to-peer transmission (P2P networks), consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a series of data blocks linked using cryptographic methods. Each block contains information about a batch of transactions, used to verify the validity of the information (to prevent counterfeiting) and link it to the previous block.

[0065] P2P network: A peer-to-peer network. Based on a specific network protocol, P2P networks do not require a central node to maintain network status. Instead, each node maintains the overall network status or the connection status of its neighboring nodes through broadcast interactions with neighboring nodes.

[0066] The blockchain's layered consensus system consists of local consensus networks and global consensus networks. Consensus nodes in the local consensus network perform on-chain operations for locally generated transactions (for example, transactions generated by a group's subsidiaries), while the global consensus network performs on-chain operations for global transactions derived from local transactions (for example, group transactions derived from branch transactions). The local and global consensus networks operate on different blockchains, enabling hierarchical governance. This allows the global consensus network to focus on global governance without having to process a large number of local transactions.

[0067] In current blockchain layered consensus systems, local consensus networks upload plaintext transactions generated locally to the blockchain. However, for security reasons, certain types of transactions do not want to be publicly visible to third parties on the blockchain. Therefore, transactions of the target type that are not intended to be publicly visible on the blockchain are sent to the target consensus network and recorded on the target blockchain, which prohibits external access. However, precisely because the target blockchain prohibits external access, local consensus networks are difficult to verify and query. Therefore, ensuring trustworthy interaction with on-chain results without accessing the target blockchain presents a challenge.

[0068] System architecture and scenario description of the application of the embodiments of the present disclosure

[0069] Referring to the blockchain layered consensus network shown in Figure 1, the blockchain layered consensus network refers to the blockchain network used for layered consensus on transactions. This blockchain layered consensus network includes business nodes, a local consensus network, a core consensus network, a first relay node, and subscription nodes. Business nodes are nodes that generate local transactions and do not upload them to the blockchain, but witness their upload. Local transactions are transactions that only have a local impact. For example, a resource-related transaction involving a group's branch is a local transaction. The local consensus network is the network that reaches consensus and uploads local transactions to the blockchain. It includes multiple local consensus nodes. The core consensus network is the network that reaches consensus and uploads global transactions and target transactions to the blockchain. This core consensus network includes the global consensus network, the target consensus network, and the second relay node. The global consensus network is the network that reaches consensus and uploads global transactions derived from local transactions to the blockchain. It includes multiple global consensus nodes. Global transactions are transactions that have a global impact. For example, a transaction that aggregates resource transfers between a group's branches is a global transaction. The target consensus network is the network that reaches consensus on the target transaction and uploads it to the blockchain. It records the target transaction on the first blockchain. The target transaction is a transaction that is not intended to be accessible or known to third parties. The first blockchain is a blockchain dedicated to recording blocks of transactions that are not intended to be accessible or known to third parties. This first blockchain is not intended to be accessible to the outside world. To obtain verification information for blocks recorded on this first blockchain, one can only do so by requesting the target consensus node in the target consensus network that records the first blockchain.

[0070] Because the target transaction is one that is not intended to be accessible or known to third parties, the consent of the subject who generated it must be sought before it is uploaded to the blockchain. Specifically, when the subject generates the target transaction and sends it to the local consensus network for upload, a query box can be displayed to the subject, asking whether they agree to upload the target transaction to the blockchain. If the subject disagrees, the implementation method cannot be implemented, or only the portion of the transaction that they agree to upload will be uploaded to the blockchain.

[0071] The first relay node is the interface node between the local consensus node and the global consensus node. It forwards local transactions generated by the local consensus network to the global consensus network, which aggregates the local transactions into global transactions and uploads the global transactions to the blockchain. The second relay node is the interface node between the target consensus network and the global consensus network. It forwards the blockchain height information generated after the target consensus network records a local transaction of the target type to the global consensus network. The global consensus network then forwards it to the local consensus network to notify the local consensus network that the local transaction of the target type has been successfully uploaded to the blockchain. The subscription node is the interface node between the local consensus network and the target consensus network. It retrieves the transaction result data generated after the target local transaction is recorded on the target blockchain from the target consensus network and sends it to the local consensus network.

[0072] It should be noted that the target consensus node, local consensus node, and global consensus node are all consensus nodes, also known as blockchain nodes. A consensus node or blockchain node can be a server in a blockchain network or a user terminal connected to the blockchain network. The specific form of a consensus node or blockchain node is not limited here. The first relay node and the second relay node are both interface nodes. The first relay node and the second relay node can be independent devices, such as separate computers or servers. They can also be parts of independent devices, such as a virtual machine partitioned from a server. The specific form of the first relay node and the second relay node is not limited here.

[0073] The embodiments of the present disclosure can be applied in various scenarios, such as the scenario of resource transfer transactions being put on-chain as shown in FIG2 .

[0074] See Figure 2. The difference between Figure 2 and Figure 1 is that Figure 2 also shows a second blockchain maintained by the local consensus network and a first blockchain maintained by the target consensus network. Both the second blockchain and the first blockchain are the same blockchains described above. The specific process for recording local transactions to the second blockchain is as follows:

[0075] Generally, a business node generates a local transaction based on the operational behavior of an object. It then sends the local transaction and the business node's digital signature to a neighboring local consensus node on the local consensus network, allowing the local consensus node to verify the authenticity of the local transaction. During verification, the local consensus node verifies the digital signature using the business node's public key, obtaining a first digest value for the local transaction. It then calculates a digest of the local transaction using a digest algorithm to obtain a second digest value for the local transaction. The first and second digest values ​​are compared. If they are identical, verification passes, and the local transaction is a genuine transaction generated by the business node.

[0076] After verification, the local transaction and other local transactions sent by the business node are accumulated. When the accumulation reaches a certain level (for example, the number of accumulated transactions reaches a certain threshold, or the accumulation time reaches a certain threshold), these local transactions are packaged into a local block and sent to other target consensus nodes in the local consensus network for consensus. After consensus is successful, each local consensus node records the local block on the second blockchain maintained by the local consensus node.

[0077] Continuing with Figure 2, the second blockchain consists of three local blocks. Local blocks 1-2 record two local transactions: "A001, Company A received 500 resources in May" and "A002, Company A received 300 resources in May." These two local transactions on the second blockchain are forwarded to the global consensus node of the global consensus network via the first relay node. The global consensus node then generates a global transaction based on these two local transactions, for example, "Company A received 800 resources in total invoice resources in May." This global transaction is then generated into a third block and recorded on the third blockchain. The specific process for recording global transactions on the third blockchain is similar to the process for recording local transactions on the second blockchain and will not be repeated here.

[0078] Continuing with Figure 2, the first blockchain consists of two first blocks. First blocks 1-2 record two target transactions: "Company A transferred 100 resources to Company B in May" and "Company A transferred 200 resources to Company C in May." Because these two target transactions involve resource transfers between different companies and are not permitted to be disclosed to the outside world, they are recorded on the first blockchain. This first blockchain is inaccessible to the outside world, enhancing the security of the target transactions. The specific process for recording the target transactions on the first blockchain is similar to the process for recording local transactions on the second blockchain, and will not be further described here.

[0079] However, due to the fact that the first blockchain prohibits external access, the local consensus network cannot communicate with the target consensus network about the on-chain results without leaking the first blockchain information. This means that the local consensus network cannot synchronize the on-chain results of the target transaction. Consequently, the party requesting the on-chain upload of the target transaction cannot determine whether the target transaction has been truly uploaded to the first blockchain by the target consensus network, affecting their confidence in the authenticity of the on-chain upload.

[0080] General description of the embodiments of the present disclosure

[0081] According to one embodiment of the present disclosure, a blockchain transaction processing method is provided.

[0082] This blockchain transaction processing method is generally used in business scenarios where transaction data is not intended to be known to the outside world, such as the scenario of resource transfer transactions on the chain shown in Figure 2. Transactions that are not intended to be known to the outside world are called target transactions. The disclosed embodiment provides a solution in which the target consensus network uniformly executes and records target transactions and sends transaction result data to subscribing nodes, which can improve the security of target transactions on the chain and realize the interaction of on-chain results. The blockchain transaction processing method is executed by the target consensus network, for example, by the target consensus node in the target consensus network.

[0083] As shown in FIG3 , a blockchain transaction processing method according to one embodiment of the present disclosure may include:

[0084] Step 310: Obtain an additional first target block from each first block of the first blockchain;

[0085] Step 320: Obtain a first target transaction and a first block header from the first target block;

[0086] Step 330: Obtain first verification information corresponding to the first target transaction;

[0087] Step 340: Based on the first target transaction, the first verification information, and the first block header, perform on-chain verification of the first target transaction.

[0088] Step 350: If the on-chain verification is successful, obtain the transaction result data of the first target transaction;

[0089] Step 360: Send the transaction result data to the subscribing node for the local consensus network to obtain from the subscribing node.

[0090] Steps 310 - 360 are described in detail below.

[0091] In step 310, a first blockchain is constructed from multiple first blocks, which are inaccessible to anyone outside the target consensus network. The target consensus network generates a first block to record a first transaction of the target type from the local consensus network. This first transaction of the target type is the target transaction described above. Each time the target consensus network generates a first block based on a first transaction of the target type, a first block is added to the first blockchain. The target consensus network then retrieves the first target block from the added first blocks. The specific process for retrieval of the first target block is described in detail below.

[0092] In step 320, each first target block includes a first block header and a first block body. The first block body stores multiple first transactions of the target type. Therefore, the first block header can be obtained from the first target block, and the first target transaction can be obtained from the multiple first transactions of the target type stored in the first block body.

[0093] In step 330, the first verification information is used to verify that the target consensus network actually puts the local transaction on the chain.

[0094] In some embodiments, the setting of the first verification information acquisition period includes but is not limited to the following situations:

[0095] (1) After discovering the target consensus network and obtaining the first target transaction, immediately obtain the first verification information;

[0096] (2) According to the acquisition cycle pre-set by the target consensus network, after the target consensus network acquires the first target transaction and after the acquisition cycle has passed, the first verification information is acquired. For example, if the acquisition cycle pre-set by the target consensus network is 1 hour, if the target consensus network acquires the first target transaction at 7:00 a.m. on the same day, the first verification information is acquired at 8:00 a.m. on the same day.

[0097] The method for obtaining the first verification information will be introduced together with step 340 in the detailed description of step 340 below.

[0098] In step 340, verification of the on-chain nature of the first target transaction refers to verifying whether the target consensus network has actually on-chained the first target transaction. The specific on-chain verification process will be described in detail in step 340 below.

[0099] At step 350, if the on-chain verification succeeds, it indicates that the target consensus network has actually on-chained the first target transaction. The target consensus network then obtains the transaction result data for the first target transaction. Transaction result data refers to the data generated after the target consensus network executes the first target transaction. This transaction result data can be a successful on-chain result, which indicates that the first target transaction has been successfully on-chained. For example, if the first target transaction is "Company A transfers 100 resources to Company B in May," the corresponding transaction result data would be "100 resources successfully transferred."

[0100] In step 360, the transaction result data is sent to the subscription node. The subscription node is located between the local consensus network and the target consensus network. It is a module that receives transaction result data from the target consensus network and forwards it to the local consensus network. The subscription node can be an independent device, such as a separate computer or server, or it can be part of an independent device, such as a virtual machine partitioned from a server.

[0101] In one embodiment, the local consensus network obtains transaction result data from the subscribing node in the following ways, including but not limited to:

[0102] (1) After the subscription node receives the transaction result data, the subscription node can actively send the transaction result data to the local consensus network so that the local consensus network can obtain the transaction result data.

[0103] (2) The local consensus network sends a transaction result data acquisition request to the subscribing node. After the subscribing node receives the transaction result data acquisition request, it sends the transaction result data to the local consensus network.

[0104] Through steps 310-360 above, the target consensus network obtains the first target transaction, the first verification information corresponding to the first target transaction, and the first block header from the first target block added to the first blockchain. Based on this information, the target consensus network verifies whether the first target transaction is truly on-chain. Upon successful verification, the target consensus network obtains the transaction result data and sends it to the subscribing node for query by the local consensus network. In this way, the local consensus network obtains the transaction result data without reading the target blockchain information or compromising the data security of the target blockchain, thus achieving trustworthy on-chain result interaction while ensuring the security of the target blockchain information.

[0105] The above is a general description of steps 310 to 360. The following will describe in detail the specific implementation of steps 310 to 360.

[0106] Detailed description of step 310

[0107] In step 310 , an added first target block is obtained from each first block of the first blockchain.

[0108] The present disclosure provides two decomposition methods for step 310. Each decomposition method provides a detailed description of step 310 from a different perspective. The first decomposition method will be described first.

[0109] In one embodiment, step 310 includes: in response to a predetermined condition being satisfied, obtaining an additional first target block from each first block of the first blockchain.

[0110] The predetermined condition includes at least one of the following: the difference between the current block height of the first blockchain and the block height of the last time the added first target block was obtained reaches a first threshold, and the time difference between the current time and the time point when the added first target block was obtained reaches a second threshold. For example, in response to the difference between the current block height of the first blockchain and the block height of the last time the added first target block was obtained reaching the first threshold, the target consensus network obtains the added first target block from each first block of the first blockchain. For another example, in response to the difference between the current time and the time point when the added first target block was obtained reaching the second threshold, the target consensus network obtains the added first target block from each first block of the first blockchain. For another example, in response to the difference between the current block height of the first blockchain and the block height of the last time the added first target block was obtained reaching the first threshold, and the time difference between the current time and the time point when the added first target block was obtained reaching the second threshold, the target consensus network obtains the added first target block from each first block of the first blockchain.

[0111] Under the above predetermined conditions, if only the difference in block height is considered to reach the first threshold, the timeliness of the acquisition will be affected, resulting in some transactions not being able to be verified on the chain for a long time. If only the time difference is considered to reach the second threshold, although timeliness is guaranteed, it may cause the number of first blocks included in the first target block to be too small each time, wasting network resources. Similarly, if both the difference in block height reaching the first threshold and the time difference reaching the second threshold are considered at the same time, there is a possibility that the time difference has met the second threshold, but the difference in block height has not been able to reach the first threshold, which still affects the timeliness of the acquisition. In addition, the target consensus network constantly detecting the height of the first blockchain is a waste of processing resources and is not conducive to improving processing efficiency.

[0112] Therefore, in one embodiment, referring to FIG. 4 , step 310 specifically includes:

[0113] Step 410: Setting a first blockchain height counter, wherein when a first block is added to the first blockchain, the first blockchain height counter is incremented by one;

[0114] Step 420: If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last obtained reaches a first threshold, obtain the first block on the first blockchain from the first block with a block height equal to the second value plus 1 to the first block with a block height equal to the first value as the first target block;

[0115] Step 430: If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last acquired does not reach the first threshold, but the time difference between the current time and the time point when the first target block was last acquired reaches the second threshold, the first block added within the time difference is acquired as the first target block.

[0116] Steps 410 - 430 are described in detail below.

[0117] In step 410, the first blockchain height counter is a module that counts the height of the first blockchain. The height of the first blockchain refers to the number of first blocks, and the first blockchain height counter represents the number of first blocks using a first value. For example, referring to FIG5A , if the first blockchain includes first blocks 1 and 2, the number of first blocks is 2, and the current first value of the first blockchain height counter is 2. After the first blockchain adds a first block, the first blockchain also includes first block 3, the number of first blocks is 3, and the current first value of the first blockchain height counter is 3.

[0118] In step 420, the first value refers to the current value of the height counter of the first blockchain, and the second value refers to the value when the first target block was last acquired. If the difference between the first value and the second value reaches a first threshold, it indicates that the target consensus network needs to verify the on-chain of the first target transaction, and therefore needs to acquire the first block on the first blockchain from the first block with a block height equal to the second value plus 1 to the first block with a block height equal to the first value as the first target block.

[0119] For example, referring to Figure 5A again, assume that the first threshold is 2 and the second value is 1 (that is, the first target block acquired last time is the first block 1). When the first blockchain includes the first block 1 and the first block 2, the first value is 2; the difference between the first value and the second value is 1 (2-1=1), which is less than 2, so the first threshold is not reached, and the first target block cannot be obtained. After the first block is added to the first blockchain, the first value is 3; the difference between the first value and the second value is 2 (3-1=2), which is equal to 2, so the first threshold is reached; then, the first block 2 and the first block 3 on the first blockchain need to be acquired as the first target block. Note that after acquiring the first block 3, the second value is updated to 3.

[0120] Next, in step 430, unlike step 420, which considers the first threshold, step 430 considers the effect of the time difference when the first threshold is not reached, thereby improving acquisition efficiency. Specifically, if the first threshold is not reached, but the time difference between the current time and the time point when the added first target block was last acquired reaches the second threshold, the first block added within the time difference is acquired as the first target block.

[0121] For example, referring to FIG5B , assuming that the first threshold is 3, the second threshold is 2 hours, the first value is 1, and the time point when the first target block was last acquired was 8:00 a.m. on the same day. Then, when the first blockchain includes the first block 1 and the first block 2, the difference between the first value and the second value (2-1) does not reach the first threshold (3), and the time difference between the current time (9:00 a.m. on the same day) and the time point when the first target block was last acquired (9-8=1 hour) does not reach the second threshold (2 hours), then the first target block cannot be acquired.

[0122] Continuing with FIG5B , after the first blockchain adds another first block, the first blockchain also includes first block 3. At this time, the difference between the first value and the second value (3-1) has not reached the first threshold (3), but the time difference between the current time and the time point when the added first block 1 was last obtained (10-8 = 2 hours) has reached the second threshold (2 hours). Therefore, it is necessary to obtain first block 2 and first block 3 on the first blockchain as the first target block. Note that after obtaining first block 3, the second value is updated to 3.

[0123] The advantage of this embodiment is that the height of the first blockchain is detected with the help of the first blockchain height counter, which saves the processing resources of the target consensus network; combined with the difference between the first value and the second value and the time difference, the number of first blocks obtained each time will not be too small, which will waste processing resources, and timeliness is taken into account, so that some first blocks will not be unable to be verified on the chain for a long time.

[0124] While the block height and time difference are taken into account in Step 310, including Steps 410-430, the first transaction itself is not considered. For certain first transactions requiring priority on-chain verification, if the first block containing the first transaction is not promptly retrieved from the first blockchain and verified on-chain, the priority on-chain verification requirement for different first transactions cannot be met. Therefore, in one embodiment, Step 310 combines the priority setting flag of the first transaction and retrieves the first transaction with the set priority setting flag from the first block and performs on-chain verification first, thus meeting the priority on-chain verification requirement.

[0125] In a specific implementation of this embodiment, the first transaction includes a priority setting flag. Under this premise, referring to FIG. 6 , after step 420, step 310 further includes:

[0126] Step 610: If the difference between the current first value of the first blockchain height counter and the second value when the last increased first target block was obtained does not reach the first threshold, but the first block on the first blockchain from the first block with the block height of the second value plus 1 to the first block with the block height of the first value contains the first transaction with the priority set flag set, obtain the first block on the first blockchain from the first block with the block height of the second value plus 1 to the first block with the block height of the first value as the first target block.

[0127] For example, referring to FIG7 , assuming that the first threshold is 3 and the second value is 1 (that is, the first target block obtained and added last time is the first block 1). When the first blockchain includes the first block 1 and the first block 2, the first block 1 includes the first block header Q1 and the first transaction L1. The first transaction L1 includes a priority setting mark and transaction content, but the priority setting mark of the first transaction L1 is not set (for example, the priority position is marked as 0). Similarly, the first block 2 includes the first block header Q2 and the first transaction L2. The first transaction L2 includes a priority setting mark and transaction content, but the priority setting mark of the first transaction L2 is also not set (for example, the priority position is marked as 0). Therefore, when the first blockchain includes the first block 1 and the first block 2, the difference between the first value and the second value (2-1) does not reach the first threshold (3), and the priority setting mark is not set, then the first target block cannot be obtained.

[0128] Continuing with FIG7 , after the first block is added to the first blockchain, the first blockchain also includes a first block 3. The first block 3 includes a first block header Q3 and a first transaction L3. The first transaction L3 includes a priority setting flag and transaction content, but the priority setting flag of the first transaction L3 has been set (for example, the priority position is marked as 1, which is indicated by a bold black box in FIG7 ). At this time, the difference between the first value and the second value (3-1) does not reach the first threshold (3), but the priority setting flag of the first transaction L3 is set, so the first block 2 and the first block 3 on the first blockchain are obtained as the first target block. Note that after obtaining the first block 3, the second value is updated to 3.

[0129] The advantage of this embodiment is that the priority on-chain verification requirement of the first transaction is met with the help of the priority setting mark, thereby improving the flexibility of on-chain verification.

[0130] The above is a detailed description of the first decomposition method. The following is a detailed description of the second decomposition method.

[0131] In one embodiment, before step 310, the blockchain transaction processing method further includes:

[0132] Step 810: Receive a first subscription request from a subscription node, where the first subscription request has a first subscription condition.

[0133] Correspondingly, step 310 includes:

[0134] Step 820: Obtain the first block added to the first blockchain;

[0135] Step 830: If the added first block contains a first target transaction that meets the first subscription condition, obtain the added first block as the first target block.

[0136] Steps 810-830 are described in detail below.

[0137] In step 810, the first subscription request refers to a request sent by the subscription node to the target consensus network to subscribe to the first transaction. Referring to Figure 9A, the first subscription request contains a first source address, a first destination address, and a first subscription condition. The first source address refers to the address of the subscription node (for example, the identifier of the subscription node), and the first destination address refers to the address of the global consensus node in the target consensus network (for example, the identifier of the global consensus node). The first subscription condition refers to the personalized subscription condition of the subscription node for the first transaction recorded on the first blockchain. If the added first block contains the first target transaction that meets the first subscription condition, it means that the first block needs to be taken out and participate in the chain verification, so the first block is used as the first target block.

[0138] The specific implementation process of step 820 is similar to steps 410-430 above, and will not be repeated here to save space.

[0139] In step 830, if the added first block contains the first target transaction that meets the first subscription criteria, it indicates that the first block contains a transaction that requires on-chain verification. Therefore, the added first block is obtained as the first target block. This allows for timely on-chain verification, and after successful on-chain verification, the subscribing node can promptly obtain the transaction result data of the first target transaction.

[0140] The benefit of this embodiment is that by selecting the first block containing the first target transaction that meets the first subscription condition as the first target block, the number of first blocks required for on-chain verification can be reduced, saving processing resources. Furthermore, by determining the first subscription condition from the first subscription request sent by the subscribing node, the subscribing node's personalized subscription requirements for transactions requiring on-chain verification can be met.

[0141] 9B , the first subscription request shown in FIG9B includes not only the source address, the destination address, and the first subscription condition, but also a subscription period. In the case where the first subscription request also includes a subscription period, step 830 specifically includes:

[0142] Determining a valid subscription request in the first subscription request whose subscription period has not expired;

[0143] If the added first block contains the first target transaction that meets the first subscription condition of the valid subscription request, the added first block is obtained as the first target block.

[0144] Specifically, the subscription period refers to the deadline from when the first subscription request is valid to when it is invalid. If the subscription period has not expired, it means that the first subscription request is a valid subscription request; if the subscription period has expired, it means that the first subscription request is an invalid subscription request. For example, if the subscription period is February 1 of the current year, then from the time the first subscription request is received by the target consensus network to February 1 of the current year, the first subscription request is a valid subscription request. Then, if the added first block contains a first target transaction that meets the first subscription condition of a valid subscription request, it means that the first block contains a transaction that needs to be verified on the chain and the transaction meets the first subscription condition, so the added first block is obtained as the first target block.

[0145] The advantage of this embodiment is that the subscription period can be used to avoid on-chain verification of the first transaction that meets the first invalidation condition, thus saving processing resources. In addition, by determining the subscription period from the first subscription request sent by the subscribing node, the subscribing node's personalized subscription requirements for transactions requiring on-chain verification can be further met.

[0146] Referring to FIG10 , in one embodiment, the first subscription request is generated by the subscription node in the following manner:

[0147] Step 1011: Receive multiple second subscription requests from the local consensus network, each second subscription request having a second subscription condition associated with an object;

[0148] Step 1012: Integrate the second subscription conditions of the multiple associated objects in the multiple second subscription requests into a first subscription condition to generate a first subscription request.

[0149] Steps 1011-1012 are described in detail below.

[0150] In step 1011, the second subscription request refers to a request sent by the local consensus network to the subscribing node to subscribe to the first transaction. For example, referring to Figure 11, the second subscription request includes a second source address, a second destination address, a second subscription condition, and an associated object. The second source address refers to the address of a local consensus node in the local consensus network, such as the identifier of the local consensus node. The second destination address refers to the address of the subscribing node, such as the identifier of the subscribing node. The second subscription condition refers to the associated object's personalized subscription condition for the first transaction recorded on the first blockchain. The associated object refers to the object corresponding to the second subscription condition, such as the service node in Figure 1.

[0151] In step 1012, the subscription node integrates the second subscription conditions of the multiple associated objects into a first subscription condition. For example, referring to FIG12 , the subscription node receives second subscription conditions 1 to M, obtains second subscription conditions 1 to M from the second subscription conditions 1-M, integrates N (N is less than or equal to M) second subscription conditions to obtain a first subscription condition, which includes second subscription conditions 1 to N. Note that if N is less than M, the subscription node may integrate second subscription conditions N+1 to M to obtain a new first subscription condition, which includes second subscription conditions N+1 to M.

[0152] The advantage of this embodiment is that the first subscription condition is obtained by integrating multiple second subscription conditions and sending it to the target consensus network. This is equivalent to the subscription node sending multiple second subscription conditions to the target consensus network at once. Compared with the method of sending only one second subscription condition at a time through a single subscription node, the number of second subscription conditions is increased, saving network resources. At the same time, the target consensus network can process multiple second subscription conditions in batches, improving processing efficiency.

[0153] The above describes in detail two decomposition methods for step 310. However, in both decomposition methods, the blockchain layered consensus network is based on a single subscription node. After steps 310-350, the target consensus network obtains the transaction result data, and in step 360, all of this transaction result data is sent to the same subscription node. However, in another embodiment, the subscription nodes may be multiple subscription nodes corresponding to multiple transaction subtypes, and transaction result data for different transaction subtypes needs to be sent to the corresponding subscription nodes. For example, one subscription node may be specifically responsible for collecting transaction result data for e-invoice subtype transactions, while another subscription node may be specifically responsible for collecting transaction result data for resource subtype transactions.

[0154] In a specific implementation of this embodiment, the subscription nodes are multiple subscription nodes corresponding to multiple transaction subtypes, and the first subscription condition is the transaction subtype corresponding to the subscription node; accordingly, step 360 includes: sending the transaction result data to the subscription node corresponding to the transaction subtype.

[0155] For example, referring to FIG13 , FIG13 shows two subscription nodes, namely subscription node S1 and subscription node S2. Subscription node S1 corresponds to transaction subtype D1, for example, transaction subtype D1 is an electronic invoice subtype. Subscription node S2 corresponds to transaction subtype D2, for example, transaction subtype D2 is a resource subtype. FIG13 also shows a transaction result data. Before the transaction result data needs to be sent to the subscription node, the transaction subtype corresponding to the subscription node is first obtained through the first subscription condition, and then the transaction result data is sent to the subscription node corresponding to the transaction subtype. For example, if it is known from the first subscription condition that the transaction subtype is an electronic invoice subtype, the transaction result data is sent to subscription node S1. For another example, if it is known from the first subscription condition that the transaction subtype is a resource subtype, the transaction result data is sent to subscription node S2.

[0156] The benefit of this embodiment is that, through the mapping relationship between transaction subtypes and subscription nodes, transaction result data of the same transaction subtype is effectively sent to the same subscription node, fully satisfying the subscription node's personalized subscription requirements for the target consensus network based on the first subscription condition. At the same time, the possibility of sending transaction result data to other subscription nodes that do not meet the transaction subtype mapping relationship is reduced, reducing data leakage and further improving security.

[0157] In another embodiment, there are also multiple subscription nodes. However, unlike the above embodiment, the subscription nodes in this embodiment are multiple subscription nodes corresponding to multiple object sets. For example, one subscription node is specifically responsible for collecting transaction result data for associated objects C1-C10, and another subscription node is specifically responsible for collecting transaction result data for associated objects C11-C20.

[0158] In a specific implementation of this embodiment, the first transaction in the first block includes an associated object identifier, the subscription nodes are multiple subscription nodes corresponding to multiple object sets, and the first subscription condition is that the associated object identifier of the first transaction belongs to the object set corresponding to the subscription node; accordingly, step 360 includes: sending the transaction result data to the subscription node corresponding to the object set to which the associated object identifier belongs.

[0159] For example, referring to Figure 14, the first block shown in Figure 14 contains a block header and a first transaction, and the first transaction contains an associated object identifier and the content of the first transaction. The associated object identifier of the first transaction is C13. If the content of the first transaction is "Company A transferred 100 resources to Company B in May," the corresponding transaction result data is "100 resources successfully transferred." The first subscription condition shown in Figure 14 includes "Associated object identifiers C01 to C10 belong to object set J1 corresponding to subscription node S3" and "Associated object identifiers C11 to C20 belong to object set J2 corresponding to subscription node S4." The two subscription nodes shown in Figure 14 are subscription node S3 and subscription node S4. Subscription node S3 corresponds to object set J1, and subscription node S4 corresponds to object set J2.

[0160] Continuing with Figure 14 , before the transaction result data needs to be sent to the subscription node, the associated object identifier is known as C13 through the first block, and it is known through the first subscription condition that C13 belongs to object set J2, so subscription node S4 is determined. The transaction result data (the transaction result data is "100 resources have been successfully transferred") is then sent to subscription node S4 (shown in the bold black box in Figure 14 ). In another example, if the associated object identifier is C03, object set J1 is determined based on C03, and thus subscription node S3 is determined; then the transaction result data (the transaction result data is "100 resources have been successfully transferred") needs to be sent to subscription node S3.

[0161] The above is a detailed description of step 310 .

[0162] Detailed description of step 320

[0163] In the above step 310 decomposed into 810-830, step 830 is to obtain the added first block as the first target block when the first block contains the first target transaction that meets the first subscription condition; correspondingly, after step 310, step 320 includes: obtaining the first transaction that meets the first subscription condition from the multiple first transactions of the first target block as the first target transaction.

[0164] The advantage of doing this is that even if there are multiple first transactions in the first target block, not all of them need to be obtained, which can reduce the number of first transactions obtained; and by using the first subscription condition to screen the multiple first transactions again, the processing efficiency can be further improved.

[0165] Referring to FIG. 15 , in one embodiment, step 320 specifically includes:

[0166] Step 1540: If the number of first transactions that meet the first subscription condition among the multiple first transactions is greater than 1, obtain the first transactions that meet the first subscription condition in a predetermined order as the first target transactions;

[0167] The predetermined order is determined in the following manner:

[0168] Step 1510: Determine the first priority of the associated object of the first transaction;

[0169] Step 1520: Determine the second priority of the subscription node corresponding to the first subscription condition;

[0170] Step 1530: Determine a predetermined order based on the first priority and the second priority.

[0171] Steps 1510-1540 are described in detail below.

[0172] In step 1510, the first priority level may be determined in the following ways, but is not limited to:

[0173] (1) Obtain the first tag of the associated object from the first transaction, and search the first tag and first priority comparison table based on the first tag to determine the first priority. The first tag and first priority comparison table lists the correspondence between the first tag and the first priority. The following is an example of a first tag and first priority comparison table:

[0174] Table 1

[0175] As shown in Table 1, if the first mark is very important, it means that the associated object is a very important object, so the first priority is set to 5. Similarly, based on the different importance of each associated object, the first priority corresponding to the first mark of moderate importance is set to 3, and the first priority corresponding to the first mark of unimportant is set to 1.

[0176] (2) Obtain the associated object identifier from the first transaction, determine the identifier range based on the associated object identifier, and determine the first priority based on the identifier range by searching the identifier range and first priority comparison table. The identifier range and first priority comparison table lists the correspondence between the identifier range and the first priority. The following is an example of an identifier range and first priority comparison table:

[0177] Table 2

[0178] As shown in Table 2, for the associated object identifiers C01-C10, the associated objects within this identifier range are likely very important and should be immediately retrieved for the first transaction, so the first priority is set to 3. Similarly, based on the importance of each associated object, the first priority for the identifiers C11-C20 is set to 2, and the first priority for the identifiers C21-C30 is set to 1.

[0179] In step 1520, the second priority level may be determined in the following ways, but is not limited to:

[0180] (1) Obtaining the second priority from the content of the first subscription condition. For example, if the content of the first subscription condition includes "the second priority of the subscription node S4 is 3", then the second priority can be learned as 3 from the first subscription condition.

[0181] (2) Obtain the second tag of the subscribed node, search the second tag and second priority comparison table based on the second tag, and determine the second priority. The second tag and second priority comparison table lists the correspondence between the second tag and the second priority. The following is an example of a second tag and second priority comparison table:

[0182] Table 3

[0183] As shown in Table 3, if the second mark is "very important," it indicates that the subscription node is a very important node, so the second priority is set to 6. Similarly, depending on the importance of each subscription node, the second priority corresponding to the second mark being "generally important" is set to 4, and the second priority corresponding to the second mark being "unimportant" is set to 2.

[0184] After steps 1510 and 1520, the target consensus network has obtained the first priority and the second priority. In step 1530, the target consensus network determines a predetermined order based on the first priority and the second priority. In step 1540, the target consensus network obtains a first transaction that meets the first subscription condition from the plurality of first transactions based on the predetermined order as the first target transaction.

[0185] For example, referring to Figure 16, the target consensus network obtains three first transactions from the first target block, namely, the first transaction L1, the first transaction L2, and the first transaction L3. The first priority of the first transaction L1 is 3, and the second priority is 4. The first priority of the first transaction L2 is 5, and the second priority is 6. The first priority of the first transaction L3 is 1, and the second priority is 2. Based on the first and second priorities, the predetermined order of the first transaction L1 is 2, the predetermined order of the first transaction L2 is 1, and the predetermined order of the first transaction L3 is 3; then, the first target transactions are, in order, the first transaction L2, the first transaction L1, and the first transaction L3.

[0186] The benefit of this embodiment is that it satisfies the priority on-chain verification requirements of different first transactions according to associated objects and subscription nodes, improves the flexibility of on-chain verification, and thus improves the flexibility of on-chain verification of first transactions.

[0187] The above is a general description of steps 1510 to 1540. Step 1530 is described in detail below.

[0188] Referring to FIG. 17 , step 1530 includes:

[0189] Step 1710: Determine a first score for the first transaction based on the first priority.

[0190] Step 1720: Determine a second score for the first transaction based on the second priority.

[0191] Step 1730: Determine a total score of the first transaction based on the first score and the second score;

[0192] Step 1740: Determine a predetermined order based on the total score of the first transaction.

[0193] Steps 1710-1740 are described in detail below.

[0194] In step 1710, a first score is determined based on the first priority, which may be determined by looking up a comparison table of first priorities and first scores, or by using a formula.

[0195] (1) According to the first priority, the first priority and first score comparison table is searched (the first priority and first score comparison table lists the corresponding relationship between the first priority and the first score) to obtain the first score. The following is an example of a first priority and first score comparison table:

[0196] Table 4

[0197] For example, the first priority of the first transaction L1 is 3, and the corresponding first score obtained by looking up Table 4 is 60.

[0198] The above method of searching the comparison table of the first priority and the first score has the advantages of being simple and easy to implement and having low processing overhead.

[0199] (2) When the formula method is used, the first score can be set to be proportional to the first priority, for example:

[0200] F1=K1·G1 formula 1

[0201] Wherein, F1 represents the first score, G1 represents the first priority, and K1 is a preset constant that can be set according to actual needs. For example, if K1 = 20, after substituting G1 = 3, the first score F1 = 60.

[0202] The advantages of the above method of determining the first score by using a formula are high accuracy, and the formula can be adjusted as needed, which is highly flexible.

[0203] In step 1720, based on the second priority, a second score is determined, which may be determined by looking up a comparison table of second priorities and second scores, or by using a formula.

[0204] (1) According to the second priority, the second priority and second score comparison table is searched (the second priority and second score comparison table lists the corresponding relationship between the second priority and the second score) to obtain the second score. The following is an example of a second priority and first score comparison table:

[0205] Table 5

[0206] For example, the second priority of the first transaction L1 is 4, and the corresponding second score obtained by looking up Table 5 is 80.

[0207] The above method of searching the comparison table of the second priority and the second score has the advantages of being simple and easy to implement and having low processing overhead.

[0208] (2) When the formula method is used, the second score can be set to be proportional to the second priority, for example: F2 = K2·G2 Formula 2

[0209] Wherein, F2 represents the second score, G2 represents the first priority, and K2 is a preset constant that can be set according to actual needs. For example, if K2 = 20, after substituting G2 = 4, the second score F2 = 80.

[0210] The advantages of the above method of determining the second score by using a formula are high accuracy, and the formula can be adjusted as needed, which is highly flexible.

[0211] In step 1730 , based on the first score and the second score, a total score of the first transaction is determined, which may be achieved by calculating an average or a weighted average of the first score and the second score.

[0212] When calculating the total score as the average of the first and second scores, for example, if the first score of transaction L1 is 60 and the second score is 80, the total score is (60 + 80) / 2 = 70. The advantage of using the average to calculate the total score of the first transaction is that it can equally reflect the impact of the first priority and the second priority on the order of the first transaction among multiple first transactions.

[0213] When calculating the total score as the weighted average of the first and second scores, for example, if the transaction priority and difference are weighted as 0.6 and 0.4, respectively, and the first transaction L1 has a first score of 60 and a second score of 80, the total score is 60 × 0.6 + 80 × 0.4 = 68. The advantage of using the weighted average to calculate the total score is that different weights can be assigned to the first and second priorities, increasing flexibility in determining the order of the first transaction among multiple first transactions.

[0214] At step 1740, a predetermined order is determined based on the total score of the first transaction. In one embodiment, the order is determined in the following manner:

[0215] (1) Based on the total score, search the total score and the predetermined order comparison table (the total score and the predetermined order comparison table lists the correspondence between the total score and the predetermined order) to obtain the predetermined order. The following is an example of a total score and the predetermined order comparison table:

[0216] Table 6

[0217] Assuming that the total score of the first transaction L1 is 70, searching Table 6 yields a corresponding predetermined order of 3.

[0218] The advantages of the above method of searching the total score and the sequence comparison table are that it is simple and easy to implement and has low processing overhead.

[0219] (2) When using the formula method, the predetermined order can be set to be inversely proportional to the total score, for example: D = K3·F3+K4 Formula 3

[0220] Where D represents the order, F3 represents the total score, and K3 and K4 are preset constants that can be set according to actual needs. For example, if K3 = -2 / 70 and K4 = 5, then after substituting F3 = 70, D = 3.

[0221] The advantages of the above method of determining the order by formula are high accuracy, and the formula can be adjusted as needed, which is highly flexible.

[0222] The benefit of the embodiment of using the first priority and the second priority to determine the predetermined order in the above steps 1710-1740 is that by effectively evaluating the degree of need for priority processing of the first transaction, the first transaction with a higher degree of need is prioritized as the first target transaction, so that the target consensus network can prioritize processing the first target transaction, thereby improving the flexibility of processing the first target transaction.

[0223] The above is a detailed description of step 320 .

[0224] Detailed description of step 340

[0225] Step 340: Based on the first target transaction, the first verification information, and the first block header, perform on-chain verification of the first target transaction.

[0226] Referring to FIG. 18 , in one embodiment, the on-chain verification includes a first sub-verification and a second sub-verification. Step 340 specifically includes:

[0227] Step 1810: Obtain a second block header of a block next to the first target block on the first blockchain;

[0228] Step 1820: Perform a first sub-verification based on the first block header and the second block header of the next block.

[0229] Step 1830: Perform a second sub-verification based on the first target transaction, the first verification information, and the first block header.

[0230] Steps 1810-1830 are described in detail below.

[0231] In step 1810, among multiple blocks on the first blockchain, the subsequent block header is linked to the previous block header. Therefore, in order to perform the first sub-verification of step 1820, it is necessary to obtain the block header of the next block of the first target block as the second block header.

[0232] In step 1820, the first sub-verification involves performing security verification on the first target block where the first target transaction resides. The first blockchain consists of multiple first blocks. The block header of the genesis block in the multiple first blocks stores a first block body digest value, but no second block body digest value. Except for the block header in the genesis block, the remaining block headers of the multiple first blocks include a first block body digest value and a second block body digest value. For the same first block, the first block body digest value refers to the characteristic value of the first block, while the second block body digest value refers to the characteristic value of the previous block (also known as the parent block). For two adjacent first blocks, if the first block body digest value of the latter block is the same as the second digest value of the previous block, it indicates that the two first blocks are indeed linked, and the first sub-verification passes. If they are different, it indicates that one of the first blocks may have been tampered with, and the first sub-verification fails.

[0233] In one embodiment, the block header of the first block includes a first block body digest value of the first block and a second block body digest value of the previous block of the first block on the first blockchain. In a specific implementation of this embodiment, step 1820 includes:

[0234] If the first block body digest value in the first block header is the same as the second block body digest value in the second block header, it is determined that the first sub-verification is successful.

[0235] For example, see Figure 19, which shows the first block header and the second block header. The first block header's first body digest value is 9tta5acc, and the second block body digest value is ab50f328. The second block header's first body digest value is 7b50f329, and the second block body digest value is 9tta5acc. The first block header's first body digest value (9tta5acc) and the second block header's second body digest value (9tta5acc) are the same, indicating that the first block header and the second block header are indeed associated, and the first sub-verification passes.

[0236] In step 1830, the second sub-verification refers to performing security verification of the first target transaction itself. The specific process of the second sub-verification will be described in detail below.

[0237] The advantage of this embodiment is that, through the first sub-verification and the second sub-verification, not only the security of the first target block where the first target transaction is located is verified, but also the security of the first target transaction itself is verified, which greatly improves the credibility of the verification.

[0238] The above is a general description of steps 1810 to 1830. Step 1830 is described in detail below.

[0239] It should be noted that the second sub-verification in step 1830 needs to be based on the first verification information obtained in step 330. Therefore, step 1830 will be further described in detail below in conjunction with step 330.

[0240] Referring to FIG. 20 , in one embodiment, step 330 includes:

[0241] Step 2010: Generate a first tree, the first tree including multiple layers of features;

[0242] Step 2020: Obtain a first bypass feature of the first path as first verification information;

[0243] Correspondingly, step 1830 includes:

[0244] Step 2030: Determine the digest value of the first target transaction;

[0245] Step 2040: Determine a second root feature of the first tree based on the digest value of the first target transaction and the first verification information.

[0246] Step 2050: If the second tree root feature is consistent with the first block body digest value in the first block header, it is determined that the second sub-verification is successful.

[0247] Steps 2010-2050 are described in detail below.

[0248] In step 2010 , the bottom layer feature of the first tree is the digest value of a plurality of first transactions in the first target block, where the plurality of first transactions includes the first target transaction.

[0249] The order of the features at the bottom layer of the first tree can be the order in which the target consensus node receives the first transaction. For example, if the target consensus node first receives the first transaction L1 "Company A transfers 100 resources to Company B in May" and then receives the first transaction L2 "Company A transfers 200 resources to Company C in May", the first transaction L1 will be used as the first node of the bottom layer, and the first transaction L2 will be used as the second node of the bottom layer. The digest algorithm used for the digest value can be one of the following:

[0250] (1) The target consensus node pre-specifies a fixed digest algorithm that is the same for each entity to which the first transaction belongs. For example, the same digest algorithm is used for the resource transfer transaction between Company A and Company B and the resource transfer transaction between Company A and Company C;

[0251] (2) The target consensus node pre-specifies different digest algorithms for each entity to which the first transaction belongs. For example, different digest algorithms are pre-specified for Company B and Company C. When the first transaction is determined to be a transaction between Company A and Company B, the digest algorithm pre-specified for Company B is used; when the first transaction is determined to be a transaction between Company A and Company C, the digest algorithm pre-specified for Company C is used. This embodiment increases the difficulty of deciphering local transactions from the digest value by using different digest algorithms for different entities, thereby improving the security of the first transaction on-chain verification.

[0252] It should be noted that no matter which of the above digest algorithms is used, it is necessary to ensure that the digest algorithm used by the target consensus node when verifying according to the digest value of the first transaction and the first bypass feature is consistent with the above digest algorithm.

[0253] In this embodiment, two adjacent features in each layer of the first tree are connected to generate a feature in a higher layer until a first root feature of the first tree is generated, and the first root feature is the first block summary value.

[0254] The first tree of the disclosed embodiment is typically a binary tree, but may also be a multi-branch tree. The first tree possesses all the characteristics of a tree structure, which often includes multiple nodes (the first tree characteristic shown in FIG21A ), including at least one leaf node and a root node, and typically also includes multiple intermediate nodes between the leaf nodes and the root node.

[0255] The specific generation process of the first tree is as follows:

[0256] Referring to the first tree shown in FIG21A , the feature data of each first tree feature is used as a feature of the first tree. Therefore, the first tree contains multiple layers of features, wherein each bottom-layer feature of the first tree corresponds to the first transaction recorded on a single first blockchain, and each bottom-layer feature is the feature of the first transaction of the record (as shown in FIG21A , the feature of the first transaction is a summary value). Two adjacent features of each layer of the first tree are connected to generate a feature of a higher layer, that is, each feature in the higher layer is obtained by calculating the two adjacent features of the lower layer (as shown in FIG21A , the summary value of the feature in the higher layer can be obtained by performing a summary calculation on the summary values ​​of the two adjacent features of the lower layer). This process is repeated until the root feature of the first tree is generated, and the complete first tree is obtained. As shown in Figure 21A, the first tree feature 1 and the second tree feature 2 of the bottom layer are concatenated and then used to generate the first tree feature 7 of the second-to-last layer through a digest algorithm; the first tree feature 3 and the second tree feature 4 of the bottom layer are concatenated and then used to generate the first tree feature 8 of the second-to-last layer through a digest algorithm; the first tree feature 5 and the second tree feature of the bottom layer are concatenated and then used to generate the first tree feature 9 of the second-to-last layer through a digest algorithm; the first tree feature 7 and the second tree feature 8 of the second-to-last layer are concatenated and then used to generate the first tree feature 11 of the third-to-last layer through a digest algorithm; the first tree feature 9 and the second tree feature 10 of the second-to-last layer are concatenated and then used to generate the first tree feature 12 of the third-to-last layer through a digest algorithm; the first tree feature 11 and the second tree feature 12 of the third-to-last layer are concatenated and then used to generate the first tree feature 13, that is, the first tree root feature.

[0257] In step 2020, the first path is the path between the summary value of the first target transaction on the first tree and the first tree root feature, and the first bypass feature is the next layer feature to which other features on the first path except the summary value of the first target transaction are connected.

[0258] As shown in Figure 21B, assuming that the characteristics of the summary value of the first target transaction correspond to first tree feature 4, and the first root characteristic of the first tree corresponds to first tree feature 13, then the first path is the path between first tree feature 4 and first tree feature 13 on the first tree, where the first path covers the connection paths between first tree feature 4, first tree feature 8, first tree feature 11, and first tree feature 13. Since first tree feature 8 needs to be generated based on first tree feature 3 and first tree feature 4, when the characteristics of first tree feature 4 are known, the characteristics of first tree feature 3 also need to be obtained. Therefore, the characteristics of first tree feature 3 are determined to be bypass characteristics. Similarly, since first tree feature 11 needs to be generated based on first tree feature 7 and first tree feature 8, after generating first tree feature 8 based on first tree feature 3 and first tree feature 4 as a bypass characteristic, the characteristics of first tree feature 7 also need to be obtained. Therefore, the characteristics of first tree feature 7 are determined to be bypass characteristics. Similarly, since first tree feature 13 needs to be generated based on first tree feature 11 and first tree feature 12, after generating first tree feature 11 based on first tree feature 8 and first tree feature 7 as a bypass feature, the characteristics of first tree feature 12 need to be obtained. Therefore, the characteristics of first tree feature 12 are determined to be bypass features. Therefore, the first bypass feature of the above-mentioned first path includes the characteristics of first tree feature 3, first tree feature 7, and first tree feature 12. The first bypass feature is represented by a thick black solid box in Figure 21B. Other features in the first tree except the first bypass feature and the bottom-level feature corresponding to the first target transaction will not be provided to the target consensus node.

[0259] The benefit of steps 2010-2020 is that when the target consensus node performs the second sub-verification, the relevant information generated from the first tree root feature in the lowest layer corresponding to the summary value of the first target transaction is provided to the target consensus node, ensuring that the target consensus node can correctly perform the second sub-verification. At the same time, information unrelated to the generation of the first tree root feature in the lowest layer corresponding to the first tree feature in the target consensus node is avoided as much as possible from being provided to the target consensus node, thereby reducing information leakage from other transactions. Furthermore, even the first bypass feature is generally only provided in the form of a summary value, etc., to reduce the leakage of the actual information of the related transaction.

[0260] In step 2030, a digest algorithm can be used to digest the first target transaction to obtain a digest value of the first target transaction. It should be noted that the digest algorithm used in both steps 2030 and 2040 must be consistent with the digest algorithm used when generating the first tree in step 2010 to ensure the smooth execution of the second sub-verification.

[0261] Next, in step 2040, the target consensus node determines the second root feature of the first tree based on the summary value of the first target transaction and the first verification information.

[0262] The process of determining the second tree root feature of the first tree includes: determining the first tree feature corresponding to the summary value of the first target transaction, and then reproducing the first tree features on the first path of generating the first tree root feature layer by layer from the lowest layer of the first tree feature corresponding to the first target transaction in the first tree based on the first bypass feature (first verification information) and the first tree feature corresponding to the summary value of the first target transaction (such as the part circled by the curve in Figure 21B), thereby obtaining the second tree root feature.

[0263] As shown in FIG21B , when determining the second root feature of the first tree using the first bypass feature (first verification information) and the summary value of the first target transaction, assuming that the summary value of the first target transaction corresponds to the feature of the first tree feature 4, the extracted first bypass feature includes the features of the first tree feature 3, the first tree feature 7, and the first tree feature 12. At this time, the feature of the first tree feature 8 is generated based on the feature of the first tree feature 4 and the bypass feature of the first tree feature 3. The feature of the first tree feature 11 is generated based on the feature of the first tree feature 8 and the bypass feature of the first tree feature 7. The feature of the first tree feature 13 is generated based on the feature of the first tree feature 11 and the bypass feature of the first tree feature 12. In this way, the first tree features 8, 11, and 13 on the first path of generating the first tree feature 13 layer by layer from the lowest layer first tree feature 4 corresponding to the summary value of the first target transaction in the first tree are reproduced. The feature of the first tree feature 13 on the reproduced first path is used as the second root feature.

[0264] After obtaining the second root signature in step 2040, the target consensus node compares the second root signature with the first block body digest value (the first root signature). In step 2050, if the second root signature is consistent with the first block body digest value, the second sub-verification passes.

[0265] Through steps 2030-2050, the disclosed embodiment ensures that the target consensus node can accurately verify the first target transaction, thereby verifying that the first target transaction is authentically recorded and free of cheating. This also reduces the leakage of real information related to the transaction and improves security.

[0266] It should be noted that the execution environment of the target consensus node in the embodiment of the present disclosure is divided into two situations. One situation is that the target consensus node has a trusted execution environment, and the other situation is that the target consensus node does not have a trusted execution environment. Obviously, the target consensus node in the above embodiment belongs to the situation where it does not have a trusted execution environment. The following will expand on the detailed description of step 340 when the target consensus node has a trusted execution environment.

[0267] Before describing that the target consensus node has a trusted execution environment, the relevant content of the trusted execution environment is explained first.

[0268] Trusted Execution Environment (TEE): A hardware-based secure computing solution. It creates a secure enclave within the CPU through hardware and software methods, ensuring the confidentiality and integrity of loaded programs and data. The TEE partitions the system's hardware and software resources into two execution environments: a trusted portion and an untrusted portion (normal portion). These two environments are isolated, and the untrusted portion cannot access the storage and memory of the trusted portion.

[0269] Trusted Execution Environment hardware key: This is a hardware key burned into the CPU during Intel production. Its private key cannot be exported under any circumstances. Its public key can be exported in specific scenarios, but Intel does not recommend this practice.

[0270] Based on the content of the above-mentioned trusted execution environment, in one embodiment, when the target consensus network has a first trusted execution environment, the first trusted execution environment has a first secure execution space and a first key, the first secure execution space prohibits external access to the first secure execution space, and each first block of the first blockchain is encrypted with the first key.

[0271] In the specific implementation of this embodiment, referring to FIG. 22 , step 320 includes:

[0272] Step 2210: In the first secure execution space, decrypt the first target block using the first key to obtain a decrypted first target block, and obtain the first target transaction and the first block header from the decrypted first target block.

[0273] Correspondingly, step 340 includes:

[0274] Step 1810: Obtain a second block header of a block next to the first target block on the first blockchain;

[0275] Step 1820 includes: Step 2220, in the first secure execution space, calling the first sub-verification contract recorded on the first blockchain, and performing the first sub-verification based on the first block header and the second block header;

[0276] Step 1830 includes: Step 2230, in the first secure execution space, calling the second sub-verification contract recorded on the first blockchain, and performing the second sub-verification based on the first target transaction, the first verification information and the first block header.

[0277] Since step 1810 has been described in detail above, it will not be repeated here. The following describes steps 2210-2230 in detail.

[0278] In step 2210, since each first block of the first blockchain is encrypted with the first key, the target consensus network cannot directly read data from the first block after obtaining it from the first blockchain and must decrypt the first block. However, the target consensus network's decryption of the first block could be discovered by a third party, leading to information leakage and reduced security. Therefore, the target consensus network decrypts the first target block in the first secure execution space, which is built on a trusted execution environment and inaccessible to third parties, ensuring information security. After decrypting the first target block, the target consensus network can obtain the first target transaction and the first block header from the first target block.

[0279] In step 2220, similar to step 2210, the target consensus network performs the first sub-verification in the first secure execution space, ensuring information security, provided that third parties cannot access the first secure execution space. This step 2220 also calls the first verification contract, which verifies block headers. This first verification contract receives, verifies, and stores block header information. For example, if the height of the first target block is 100, the first block header is the 100 header. If the target consensus network also obtains the first block at height 101, the second block header is the 101 header. The first verification contract verifies the integrity of the 100 header, primarily checking whether the digest value of the 100 header matches the digest value of the parent block header in the 101 header, as well as the consensus information in the 100 header. After the first sub-verification passes, the data from the first verification contract is provided to the second verification contract for transaction data verification.

[0280] In step 2230, similar to step 2220, on the basis that a third party cannot access the first secure execution space, the target consensus network will perform a second sub-verification in the first secure execution space to ensure information security. In step 2230, the second verification contract is also called. The second verification contract refers to the contract that verifies the transaction. For example, assume that the second verification contract receives a first target transaction from the first target block (the height of the first target block is 100, then the first block header is the 100 block header). When the second verification contract is verified, it first calculates the summary value of the first target transaction based on the first target transaction, and calculates the first root feature together based on the first bypass feature of the first path in the first verification information. The first root feature is then used to obtain the second root feature in the 100 block header from the "first verification contract" for comparison. If the comparison is successful, the second sub-verification is passed.

[0281] The benefit of this embodiment is that it utilizes a trusted execution environment to ensure the security of on-chain verification. It also utilizes a first verification contract to perform security verification on the first target block where the first target transaction is located, and utilizes a second verification contract to perform security verification on the first target transaction itself, thereby ensuring the accuracy of on-chain verification.

[0282] The above is a detailed description of step 340 .

[0283] Detailed description of step 360

[0284] Step 360: Send the transaction result data to the subscribing node for the local consensus network to obtain from the subscribing node.

[0285] It is understood that after receiving the transaction result data from the target consensus network, the subscription node can proactively send the transaction result data to the local consensus network. The subscription node can also send the transaction result data to the local consensus network in response to receiving a request to obtain transaction result data from the local consensus network.

[0286] When a subscription node responds to a transaction result data acquisition request, the local consensus network is required to generate the transaction result data acquisition request based on actual needs. For example, after sending the first transaction of the target type to the target consensus network and after a certain period of time, the local consensus network generates a transaction result data acquisition request and sends it to the subscription node to obtain the transaction result data from the subscription node. However, when the subscription node receives the transaction result data acquisition request from the local consensus network, the subscription node may not have received the transaction result data sent by the target consensus network. In this case, the subscription node will be unable to reply to the local consensus network, resulting in a waste of processing resources. Therefore, the following provides an embodiment that can ensure that subscription nodes can respond to the local consensus network in a timely manner.

[0287] In the specific implementation of this embodiment, referring to FIG23 , after step 310, the blockchain transaction processing method (executed by the target consensus network) further includes:

[0288] Step 2310: Obtain first blockchain height information of the first blockchain;

[0289] Step 2320: Forward the first blockchain height information to the global consensus network so that the global consensus network synchronizes the first blockchain height information to the local consensus network.

[0290] Correspondingly, step 360 includes: step 2330, sending the transaction result data to the subscription node for the local consensus network to obtain from the subscription node when the first blockchain height information received from the global consensus network is inconsistent with the second blockchain height information received from the global consensus network last time.

[0291] Steps 2310-2330 are described in detail below.

[0292] In step 2310, the first blockchain height information refers to the height of the first blockchain, which refers to the number of first blocks. Referring to the first blockchain height counter set in step 410, the target consensus network can read the first blockchain height information from the first blockchain height counter. Other methods can also be used to obtain the first blockchain height information.

[0293] In step 2320, the target consensus network may directly forward the first blockchain height information to the global consensus network, which in turn forwards it to the local consensus network. The target consensus network may also directly forward the first blockchain height information to the global consensus network, which in turn forwards it to the local consensus network in response to a request from the local consensus network. For example, referring to FIG1 , the target consensus network may forward the first blockchain height information to a second relay node, which in turn forwards the first blockchain height information to the global consensus network, which in turn forwards the first blockchain height information to the first relay node, which in turn forwards the first blockchain height information to the local consensus network.

[0294] In step 2330, the target consensus network sends the transaction result data to the subscribing node, but the subscribing node does not actively forward the transaction result data to the local consensus network. Instead, the local consensus network needs to actively request the subscribing node. Moreover, the local consensus network only makes a request to the subscribing node when the height information of the first blockchain and the height information of the second blockchain are inconsistent. Note that if the height information of the first blockchain and the height information of the second blockchain are inconsistent, it means that the first transaction of the target type has been recorded on the first blockchain by the target consensus network, that is, the first transaction of the target type has been successfully uploaded to the chain. After the local consensus network knows that the first transaction of the target type has been successfully uploaded to the chain, it can naturally send a request to the subscribing node to obtain the transaction result data. At this time, the subscribing node can respond to the receipt of the transaction result data and promptly reply to the local consensus network with the transaction result data.

[0295] The advantage of this embodiment is that the success rate of the local consensus network requesting the subscription node to obtain transaction result data is improved based on the first blockchain height information.

[0296] The above is a detailed description of step 340 .

[0297] Detailed description of the first transaction of the target type in step 310

[0298] Based on the above, a detailed description of steps 310-360 has been completed. As mentioned in step 310, the first block is generated by the target consensus network. The first block is used to record the first transaction of the target type from the local consensus network. Referring to Figure 1, cross-chain information forwarding between the local consensus network and the target consensus network can be achieved by a first relay node. In one embodiment, the first relay node can obtain the first transaction of the target type from the local consensus network and then forward the first transaction of the target type to the target consensus network.

[0299] In the specific implementation of this embodiment, referring to FIG24 , the first transaction of the target type is obtained by the first relay node and sent to the target consensus network in the following manner:

[0300] Step 2411: Determine the transaction type of the first transaction generated by the local consensus network;

[0301] Step 2412: If the transaction type is a non-target type, the first transaction is kept in the local consensus network and recorded by the local consensus network to a second blockchain, which allows access outside the local consensus network.

[0302] Step 2413: If the transaction type is the target type, obtain the first transaction and send it to the target consensus network.

[0303] Steps 2411-2413 are described in detail below.

[0304] In step 2411, the transaction type includes a target type and a non-target type. The target type refers to a type of transaction that is not allowed to be known to the outside world. The non-target type refers to a type of transaction that is allowed to be known to the outside world.

[0305] The first relay node is a module for determining the type of the first transaction and forwarding the first transaction of the target type. The first relay node can be an independent device, such as a separate computer or server, or a part of an independent device, such as a virtual machine partitioned from a server.

[0306] In some embodiments, the type of the first transaction is determined in the following ways, including but not limited to:

[0307] (1) Extract key fields from the content of the first transaction and search the field type comparison table based on the key fields to determine the transaction type of the first transaction. The following is an example of a field and type comparison table:

[0308] Table 7

[0309] As shown in Table 7, for the key field "Invoice", the first transaction is not allowed to be disclosed to the outside world, so the transaction type of the first transaction is determined to be the target type. For the key field "Resource", the first transaction is also not allowed to be disclosed to the outside world, so the transaction type of the first transaction is determined to be the target type. However, for the key field "Weather", the first transaction is allowed to be disclosed to the outside world, so the transaction type of the first transaction is determined to be the non-target type.

[0310] For example, if the first transaction is "Convert 100 first resources into 10 second resources," and the first key field is "resource," the transaction type of the first transaction is determined to be a target type. For another example, if the first transaction is "Weather 10001: Sunny on XX month XX day," and the key field is "weather," the transaction type of the first transaction is determined to be a non-target type.

[0311] (2) Obtain a type identifier from the content of the first transaction, and determine the type of the first transaction according to the type identifier.

[0312] For example, if the content of a first transaction includes "100 first resources converted into 10 second resources; [target type]," then the transaction type of the first transaction is determined to be a target type based on the "[target type]" included in the content. For another example, if the content of a first transaction includes "Weather 10001: Sunny on XX month XX day; [non-target type]," then the transaction type of the first transaction is determined to be a non-target type based on the "[non-target type]" included in the content.

[0313] In step 2412, a standard business smart contract (e.g., the order smart contract described below) is run on the local consensus network, with the business logic publicly embodied in the contract code. The first transaction interacting with this standard business smart contract is executed on the local consensus node, and the execution results are recorded on the second blockchain maintained by the local consensus node. Furthermore, these execution results can also be transmitted back to the global consensus network within the core consensus network via the first relay node.

[0314] For example, suppose the first non-target transaction is "Order 10001: Purchase 50 office supplies." The local consensus node invokes the order smart contract to execute the first transaction, and the execution result is "Completed: Order 10001: Purchase 50 office supplies." This execution result is recorded by the local consensus node on the second blockchain, and nodes other than the local consensus node can access this second blockchain.

[0315] In step 2413, since the first transaction of the target type is a transaction that is not intended to be accessed or known by a third party, the first relay node sends the first transaction of the target type to the target consensus network. In response to receiving the first transaction of the target type, the target consensus network executes the first transaction and records it on the first blockchain. Note that since the target transaction is a transaction that is not intended to be accessed or known by a third party, before the first transaction is put on the chain, the consent of the object that generated the first transaction must be sought. Specifically, a query box can be displayed to the object, asking the object whether it agrees to put the first transaction of the target type on the chain. If the object does not agree, this implementation method cannot be implemented, or only the part of the transaction that agrees to be put on the chain will be put on the chain.

[0316] Through the above steps 2411-2413, the disclosed embodiment utilizes the ability of the local consensus network to execute a non-target first transaction and to transmit the target first transaction in the local consensus network via the first relay node, thereby achieving the separation of the first transaction and the secure on-chain transmission of the target first transaction. In other words, the target first transaction is executed and recorded in the target consensus network, and the specific calculation process and calculation logic, as well as the intermediate results, are all completed in the target consensus network. At the same time, the consensus of the target consensus network itself and the on-chain verification in the target consensus network can effectively utilize the tamper-proof nature of the blockchain to ensure the accuracy and credibility of the transaction.

[0317] Detailed description of the transaction result data in steps 350-360

[0318] In one embodiment, the transaction result data is a variable affected by the execution of the first target transaction.

[0319] In the specific implementation of this embodiment, referring to FIG. 25 , step 350 includes:

[0320] Step 2510: If the on-chain verification succeeds, obtain the variables affected by the execution of the first target transaction and the second verification information corresponding to the variables;

[0321] Correspondingly, step 360 includes:

[0322] Step 2520 includes: sending the variable and the second verification information to the subscribing node so that the subscribing node verifies the transaction result based on the variable and the second verification information, and after the transaction result verification is successful, storing the variable for the local consensus network to obtain from the subscribing node.

[0323] Steps 2510-2520 are described in detail below.

[0324] In step 2510, the variables affected by the execution of the first target transaction refer to parameters that may be affected by the execution of the first transaction, such as total resources or the number of items. For example, the first target transaction is "Reimburse electronic invoice 0001, amount 500." After this transaction is executed and uploaded to the blockchain, it will affect the total resources of the enterprise. Suppose the enterprise's original total resources were 5000. After the electronic invoice is reimbursed, the total resources become 4500. This total resources is the variable affected by the invoice reimbursement. For another example, the first target transaction is "Give Company A 600 movie tickets." After this transaction is executed, it will affect the number of movie tickets remaining at the cinema. Suppose the cinema originally had 5000 movie tickets. After this transaction is executed and uploaded to the blockchain, the number of movie tickets at the cinema becomes 4400. This number of movie tickets is the variable after the ticket donation transaction is executed. To verify the variable after the execution of the first target transaction, it is necessary to obtain the second verification information corresponding to the variable.

[0325] Referring to FIG. 26 , in one embodiment, obtaining the second verification information corresponding to the variable includes:

[0326] Step 2610: Generate a second tree, the second tree including multiple layers of features;

[0327] Step 2620: Obtain the second bypass feature of the second path, together with the third tree root feature, as the second verification information.

[0328] Steps 2610-2620 are described in detail below.

[0329] In step 2610, the bottom-level features of the second tree are the summary values ​​of the variables affected by the execution of each first transaction, each of which includes the first target transaction. The order of the bottom-level features in the second tree can be a pre-specified variable order. For example, the order of companies A, B, C, D, and so on can be used as the order of the bottom-level features in the second tree. When the target consensus network receives the first transaction 1, "Employee X reimburses 1,000 resources at Company B," this transaction causes a change in the total number of resources at Company B, bringing the total number of resources at Company B to 49,000. Therefore, the second feature in the bottom-level features, i.e., feature 2 in the second tree, is modified to a summary value of 49,000. When the target consensus network receives the first transaction 2, "Employee Y reimburses 500 resources at Company D," this transaction causes a change in the total number of resources at Company D, bringing the total number of resources at Company D to 24,500. Therefore, the fourth feature in the bottom-level features, i.e., feature 4 in the second tree, is modified to a summary value of 24,500. Similar to the embodiment of Figures 21A-B above, the digest value here can be a fixed digest algorithm that is pre-specified by the target consensus network and is the same for the entity to which each first transaction belongs, or it can be a different digest algorithm that is pre-specified by the target consensus network for the entity to which each first transaction belongs, so it is not repeated here.

[0330] Two adjacent features at each level of the second tree are connected to generate a feature at the next level, until the third root feature of the second tree is generated. The structure and generation process of the second tree are similar to those of the first tree. Therefore, the specific process of generating the second tree in conjunction with Figure 27A can be referred to the description of generating the first tree in conjunction with Figure 21A above, and will not be repeated here.

[0331] In step 2620, the second path is the path between the summary value of the variable affected by the execution of the first target transaction on the second tree and the root feature of the third tree, and the second bypass feature is the next layer feature to which other features on the second path other than the variable affected by the execution of the first target transaction are connected.

[0332] In the specific implementation of this embodiment, step 2620 is similar to the specific implementation process described above when the first tree feature is the digest value of the first transaction. The difference is that the second tree feature of the second tree in this embodiment is the variable affected by the execution of the first transaction, while the first tree feature of the first tree in the above embodiment is the digest value of the first transaction. To save space, this process is not further described.

[0333] As shown in Figure 27B, assuming that the feature of the summary value of the variable affected by the execution of the first transaction corresponds to second tree feature 4, and the third root feature of the second tree corresponds to second tree feature 13, then the second path is the path between second tree feature 4 and second tree feature 13 on the second tree, where this second path covers the connection paths between second tree feature 4, second tree feature 8, second tree feature 11, and second tree feature 13. The second bypass feature of the second path includes the features of second tree feature 3, second tree feature 7, and second tree feature 12. The second bypass feature is represented by a thick black solid box in Figure 27B. Features in the second tree other than the second bypass feature and the bottom-level feature corresponding to the summary value of the variable affected by the execution of the first transaction are not provided to the target consensus network.

[0334] The benefit of steps 2610-2620 is that they ensure the target consensus node can correctly perform the second sub-verification, while minimizing the provision of information to the target consensus node that is unrelated to the generation of the first tree root feature from the lowest level first tree feature corresponding to the target consensus node, thereby reducing information leakage from other transactions. Furthermore, even the first bypass feature is generally only provided in the form of a summary value, etc., to reduce the leakage of actual information related to the relevant transaction.

[0335] The above is a detailed description of step 2510.

[0336] Continuing to refer to Figure 25, step 2520 includes: 2520a, sending the variable and the second verification information to the subscribing node, 2520b, so that the subscribing node verifies the transaction result based on the variable and the second verification information, and 2520c, after the transaction result is successfully verified, storing the variable for the local consensus network to obtain from the subscribing node.

[0337] In one embodiment, referring to FIG. 26 , step 2520b includes:

[0338] Step 2630: Determine the fourth root feature of the second tree based on the summary value of the variable and the second bypass feature;

[0339] Step 2640: If the third tree root feature is consistent with the fourth tree root feature, it is determined that the transaction result verification is successful.

[0340] Steps 2630-2640 are described in detail below.

[0341] In step 2630, the process of determining the fourth root feature of the second tree includes determining the second tree feature corresponding to the summary value of the variable, and then reproducing each second tree feature on the second path from the bottom-level second tree feature corresponding to the summary value of the variable in the second tree (such as the circled portion in FIG. 27B ) to generate the second root feature layer by layer based on the second bypass feature and the second tree feature corresponding to the summary value of the variable, thereby obtaining the fourth root feature. The specific process of generating the fourth root feature in conjunction with FIG. 27B can be referred to the description of generating the second root feature in conjunction with FIG. 21B , and will not be repeated here.

[0342] After obtaining the fourth root feature in step 2630, the subscribing node compares the third root feature with the fourth root feature. In step 2640, if the third root feature is consistent with the fourth root feature, the transaction result is verified to be successful.

[0343] Through the above steps 2630-2640, the subscribing node can verify whether the transaction result data is authentic and reliable through the variables affected after the transaction is executed, thereby improving the security of information transmission.

[0344] Similar to the target consensus network, subscription nodes are also divided into two situations: with a trusted execution environment and without a trusted execution environment. The above embodiment belongs to the situation without a trusted execution environment. The following is a detailed description of the subscription node with a trusted execution environment.

[0345] In one embodiment, the subscription node has a second trusted execution environment, the second trusted execution environment has a second secure execution space and a second key, and the second secure execution space prohibits external access to the second secure execution space.

[0346] In the specific implementation of this embodiment, referring to FIG. 28 , step 360 includes:

[0347] Step 2810: Encrypt the transaction result data using the public key of the local consensus network to obtain first encrypted transaction result data;

[0348] Step 2820: Send the first encrypted transaction result data to the subscribing node, so that the subscribing node encrypts the first encrypted transaction result data with the second key in the second secure execution space to obtain second encrypted transaction result data, and in response to a transaction result data acquisition request from the local consensus network, decrypts the second encrypted transaction result data with the second key in the second secure execution space to obtain first decrypted transaction result data, and sends the first decrypted transaction result data to the local consensus network, which decrypts the first decrypted transaction result data using the private key of the local consensus network to obtain transaction result data.

[0349] The encryption and decryption process performed by the subscribing node based on the second trusted execution environment in steps 2810-2820 is similar to the encryption and decryption process performed by the target consensus network based on the first trusted execution environment in steps 2210-2230. The difference is that steps 2810-2820 use the second trusted execution environment to ensure the security of the transaction result data in the subscribing node, while steps 2210-2230 use the first trusted execution environment to ensure the security of the first target block. To save space, this will not be repeated here.

[0350] Implementation details of the blockchain transaction processing method of the disclosed embodiment

[0351] 29 , the implementation details of the blockchain transaction processing method according to the embodiment of the present disclosure will be described in detail.

[0352] At step 2411 (performed by the first relay node), determine the transaction type of the first transaction generated by the local consensus network;

[0353] At step 2412 (performed by the first relay node), if the transaction type is a non-target type, the first transaction is kept in the local consensus network and recorded by the local consensus network to a second blockchain, which allows access outside the local consensus network.

[0354] In step 2413 (performed by the first relay node), if the transaction type is the target type, the first transaction is obtained and sent to the target consensus network. The target consensus network generates a first block based on the first target, and the first block is recorded in the first blockchain.

[0355] At step 1011 (performed by the subscription node), a plurality of second subscription requests are received from the local consensus network, each second subscription request having a second subscription condition associated with the object;

[0356] At step 1012 (performed by the subscription node), the second subscription conditions of the multiple associated objects in the multiple second subscription requests are integrated into a first subscription condition to generate a first subscription request;

[0357] In step 330, it is divided into steps 810-830;

[0358] At step 810 (performed by the target consensus node), a first subscription request from a subscription node is received, wherein the first subscription request has a first subscription condition;

[0359] At step 820 (performed by the target consensus node), a first block added to the first blockchain is obtained;

[0360] In step 830 (performed by the target consensus node), if the added first block contains the first target transaction that meets the first subscription condition, the added first block is obtained as the first target block;

[0361] At step 320 (performed by the target consensus node), obtain the first target transaction and the first block header from the first target block;

[0362] At step 330 (performed by the target consensus node), first verification information corresponding to the first target transaction is obtained;

[0363] In step 340 (performed by the target consensus node), based on the first target transaction, the first verification information, and the first block header, the first target transaction is verified on the blockchain.

[0364] In step 350 (performed by the target consensus node), if the on-chain verification is successful, the transaction result data of the first target transaction is obtained;

[0365] At step 2310 (performed by the target consensus node), first blockchain height information of the first blockchain is obtained;

[0366] At step 2320 (performed by the target consensus node), forward the first blockchain height information to the global consensus network so that the global consensus network synchronizes the first blockchain height information to the local consensus network;

[0367] In step 2330 (performed by the target consensus node), the transaction result data is sent to the subscribing node for the local consensus network to obtain from the subscribing node when the first blockchain height information received from the global consensus network is inconsistent with the second blockchain height information received from the global consensus network last time.

[0368] The advantages of this embodiment include, but are not limited to: based on a multi-layer chain framework, it is suitable for large-scale businesses such as blockchain electronic invoicing; the multi-layer chain structure facilitates hierarchical business governance, ensuring that each local blockchain can run local-level businesses relatively independently, without the need to aggregate the entire business alliance's traffic into the global blockchain; it provides data isolation, business privacy isolation, and legal compliance, while ensuring that the global consensus network does not need to carry a large number of segmented businesses and can focus on key tasks and global governance; the first transaction of the target type is executed and recorded in the target consensus network, and the specific calculation process and calculation logic, as well as the intermediate results, are all completed in the target consensus network and are inaccessible to the outside world, thereby improving the security of transaction on-chain; multiple second subscription conditions are sent simultaneously through a single subscription request, saving network resources, and the target consensus network can batch process multiple second subscription conditions, improving processing efficiency; by using the first block containing the first target transaction that meets the first subscription condition as the first target block, the number of first blocks undergoing on-chain verification can be reduced, saving processing resources; the use of the first blockchain height information improves the success rate of the local consensus network requesting transaction result data from the subscribing node; and trusted on-chain result interaction can be carried out without reading the first blockchain information.

[0369] Description of the apparatus and device of the present disclosure

[0370] It is to be understood that, although the steps in the above-mentioned flowcharts are shown in sequence according to the arrow representations, these steps are not necessarily performed in sequence according to the order represented by the arrows. Unless otherwise specified in the present embodiment, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned flowcharts may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.

[0371] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object, such as the target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of such data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the attribute information of the target object, the target object's separate permission or separate consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the target object's separate permission or separate consent, the necessary target object-related data for the normal operation of the embodiment of the present application will be obtained.

[0372] FIG30 is a schematic diagram of the structure of a blockchain transaction apparatus 3000 provided in an embodiment of the present disclosure. The blockchain transaction processing apparatus is located in the target consensus network. Referring to FIG30 , the blockchain transaction processing apparatus 3000 includes:

[0373] A first acquisition unit 3010 is configured to acquire an additional first target block from each first block of the first blockchain, wherein the first block is generated by the target consensus network and is configured to record a first transaction of the target type from the local consensus network, and the first blockchain prohibits access from outside the target consensus network;

[0374] A second acquiring unit 3020 is configured to acquire a first target transaction and a first block header from the first target block;

[0375] The third obtaining unit 3030 is configured to obtain first verification information corresponding to the first target transaction;

[0376] An on-chain verification unit 3040 is configured to perform on-chain verification of the first target transaction based on the first target transaction, the first verification information, and the first block header;

[0377] The fourth obtaining unit 3050 is configured to obtain transaction result data of the first target transaction if the on-chain verification is successful;

[0378] The first sending unit 3060 is used to send the transaction result data to the subscription node, so that the local consensus network can obtain it from the subscription node.

[0379] Optionally, the on-chain verification includes a first sub-verification and a second sub-verification;

[0380] The on-chain verification unit 3040 is specifically used to:

[0381] Obtain a second block header of a block next to the first target block on the first blockchain;

[0382] Perform a first sub-verification based on the first block header and the second block header;

[0383] Perform a second sub-verification based on the first target transaction, the first verification information, and the first block header.

[0384] Optionally, the block header of the first block includes a first block body digest value of the first block and a second block body digest value of a previous block of the first block on the first blockchain;

[0385] The on-chain verification unit 3040 is further specifically used to:

[0386] If the first block body digest value in the first block header is the same as the second block body digest value in the second block header, it is determined that the first sub-verification is successful.

[0387] Optionally, the third obtaining unit 3030 is specifically configured to:

[0388] Generate a first tree, the first tree including multiple layers of features, wherein the bottom layer of the first tree is the summary value of multiple first transactions in the first target block, the multiple first transactions including the first target transaction; two adjacent features in each layer of the first tree are connected to and generate a feature in a higher layer, until a first root feature of the first tree is generated, and the first root feature is the summary value of the first block body;

[0389] Obtaining a first bypass feature of a first path as first verification information, wherein the first path is a path between the digest value of the first target transaction on the first tree and the first tree root feature, and the first bypass feature is a next-layer feature to which other features on the first path, except for the digest value of the first target transaction, are connected;

[0390] The on-chain verification unit 3040 is further specifically used to:

[0391] determining a digest value of the first target transaction;

[0392] Determining a second root feature of the first tree based on the digest value of the first target transaction and the first verification information;

[0393] If the second tree root feature is consistent with the first block body digest value in the first block header, it is determined that the second sub-verification is successful.

[0394] Optionally, the target consensus network has a first trusted execution environment, the first trusted execution environment has a first secure execution space and a first key, the first secure execution space prohibits external access to the first secure execution space, and each first block of the first blockchain is encrypted using the first key;

[0395] The second acquisition unit 3020 is specifically configured to: decrypt the first target block using the first key in the first secure execution space to obtain the decrypted first target block, and obtain the first target transaction and the first block header from the decrypted first target block;

[0396] The on-chain verification unit 3040 is further specifically configured to: in the first secure execution space, call the first sub-verification contract recorded on the first blockchain, and perform the first sub-verification based on the first block header and the second block header;

[0397] The on-chain verification unit 3040 is also specifically used to: in the first secure execution space, call the second sub-verification contract recorded on the first blockchain, and perform the second sub-verification based on the first target transaction, the first verification information and the first block header.

[0398] Optionally, after obtaining the added first target block from each first block of the first blockchain, the blockchain transaction processing apparatus 3000 further includes:

[0399] a fifth acquiring unit (not shown), configured to acquire first blockchain height information of the first blockchain;

[0400] A second sending unit (not shown), configured to forward the first blockchain height information to the global consensus network, so that the global consensus network synchronizes the first blockchain height information to the local consensus network;

[0401] The first sending unit 3060 is specifically used to send the transaction result data to the subscription node, so that the local consensus network can obtain it from the subscription node when the first blockchain height information received from the global consensus network is inconsistent with the second blockchain height information received from the global consensus network last time.

[0402] Optionally, the first transaction of the target type is obtained by the first relay node and sent to the target consensus network in the following manner:

[0403] Determining the transaction type of a first transaction generated by the local consensus network;

[0404] If the transaction type is a non-target type, the first transaction is kept in the local consensus network, and the local consensus network records the first transaction to the second blockchain, which allows access outside the local consensus network.

[0405] If the transaction type is the target type, obtain the first transaction and send it to the target consensus network.

[0406] Optionally, the first acquiring unit 3010 is specifically configured to:

[0407] Setting a first blockchain height counter, wherein when a first block is added to the first blockchain, the first blockchain height counter is incremented by 1;

[0408] If the difference between the current first value of the first blockchain height counter and the second value when the last increased first target block was obtained reaches a first threshold, the first block on the first blockchain from the first block with a block height equal to the second value plus 1 to the first block with a block height equal to the first value is obtained as the first target block;

[0409] If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last acquired does not reach the first threshold, but the time difference between the current time and the time point when the first target block was last acquired reaches the second threshold, the first block added within the time difference is acquired as the first target block.

[0410] Optionally, before obtaining the added first target block from each first block of the first blockchain, the blockchain transaction processing apparatus 3000 further includes:

[0411] A first receiving unit (not shown), configured to receive a first subscription request from a subscription node, wherein the first subscription request includes a first subscription condition;

[0412] The first acquiring unit 3010 is further specifically configured to:

[0413] Obtain the first block added to the first blockchain;

[0414] If the added first block contains the first target transaction that meets the first subscription condition, the added first block is obtained as the first target block.

[0415] Optionally, the first subscription request further includes a subscription period;

[0416] The first acquiring unit 3010 is further specifically configured to:

[0417] Determining a valid subscription request in the first subscription request whose subscription period has not expired;

[0418] If the added first block contains the first target transaction that meets the first subscription condition of the valid subscription request, the added first block is obtained as the first target block.

[0419] Optionally, before receiving the first subscription request from the subscription node, the blockchain transaction processing apparatus 3000 further includes:

[0420] A second receiving unit (not shown) is configured to receive a registration request from a subscription node, the registration request including a private key of the subscription node; and record the private key of the subscription node on the first blockchain;

[0421] The first subscription request contains the private key of the subscribing node;

[0422] After receiving the first subscription request from the subscription node, the blockchain transaction processing apparatus 3000 further includes:

[0423] A private key verification unit (not shown) is used to verify that the private key included in the first subscription request is consistent with the private key recorded on the first blockchain.

[0424] Optionally, the subscription nodes are multiple subscription nodes corresponding to multiple transaction subtypes, and the first subscription condition is the transaction subtype corresponding to the subscription node;

[0425] The first sending unit 3060 is further specifically configured to send the transaction result data to a subscription node corresponding to the transaction subtype.

[0426] Optionally, the first transaction in the first block includes an associated object identifier, the subscription nodes are multiple subscription nodes corresponding to the multiple object sets, and the first subscription condition is that the associated object identifier of the first transaction belongs to the object set corresponding to the subscription node;

[0427] The first sending unit 3060 is further specifically configured to send the transaction result data to a subscription node corresponding to the associated object identifier.

[0428] Optionally, the second acquiring unit 3020 is further configured to: if the number of first transactions that meet the first subscription condition among the multiple first transactions is greater than one, acquire the first transactions that meet the first subscription condition in a predetermined order as the first target transactions, wherein the predetermined order is determined by:

[0429] Determining a first priority of an associated object of the first transaction;

[0430] Determine a second priority of the subscription node corresponding to the first subscription condition;

[0431] According to the first priority and the second priority, a predetermined order is determined.

[0432] Optionally, the second acquiring unit 3020 is further specifically configured to:

[0433] determining a first score for the first transaction according to the first priority;

[0434] determining a second score for the first transaction based on the second priority;

[0435] determining an overall score for the first transaction based on the first score and the second score;

[0436] Based on the total score of the first transaction, a predetermined order is determined.

[0437] Optionally, the transaction result data is a variable affected after the execution of the first target transaction;

[0438] The fourth obtaining unit 3050 is specifically configured to: if the on-chain verification succeeds, obtain the variables affected by the execution of the first target transaction and the second verification information corresponding to the variables;

[0439] The first sending unit 3060 is further specifically configured to send the variable and the second verification information to the subscribing node, so that the subscribing node verifies the transaction result based on the variable and the second verification information, and after the transaction result verification is successful, stores the variable for the local consensus network to obtain from the subscribing node.

[0440] Optionally, the fourth acquiring unit 3050 is further specifically configured to:

[0441] Generate a second tree, the second tree including multiple layers of features, wherein the bottom layer of features in the second tree are summary values ​​of variables affected after execution of each first transaction, each first transaction including the first target transaction; two adjacent features in each layer of the second tree are connected to and generate a feature in a higher layer, until a third root feature of the second tree is generated;

[0442] Obtain a second bypass feature of the second path, together with the third root feature, as the second verification information, wherein the second path is the path from the summary value of the variable affected by the execution of the first target transaction on the second tree to the third root feature, and the second bypass feature is the next layer feature to which other features on the second path, excluding the variable affected by the execution of the first target transaction, are connected;

[0443] The first sending unit 3060 is further specifically configured to:

[0444] Determining a fourth root feature of the second tree according to the summary value of the variable and the second bypass feature;

[0445] If the third tree root feature is consistent with the fourth tree root feature, it is determined that the transaction result verification is successful.

[0446] Optionally, the subscription node has a second trusted execution environment, the second trusted execution environment has a second secure execution space and a second key, and the second secure execution space prohibits external access to the second secure execution space;

[0447] The first sending unit 3060 is further specifically configured to:

[0448] Encrypting the transaction result data using the public key of the local consensus network to obtain first encrypted transaction result data;

[0449] The first encrypted transaction result data is sent to the subscribing node, so that the subscribing node encrypts the first encrypted transaction result data with the second key in the second secure execution space to obtain the second encrypted transaction result data, and in response to the transaction result data acquisition request from the local consensus network, decrypts the second encrypted transaction result data with the second key in the second secure execution space to obtain the first decrypted transaction result data, and sends the first decrypted transaction result data to the local consensus network, which decrypts the first decrypted transaction result data using the private key of the local consensus network to obtain the transaction result data.

[0450] 31 , which is a block diagram of a terminal for implementing the blockchain transaction processing method according to an embodiment of the present disclosure, includes components such as a radio frequency (RF) circuit 3110, a memory 3115, an input unit 3130, a display unit 3140, a sensor 3150, an audio circuit 3160, a wireless fidelity (WiFi) module 3170, a processor 3180, and a power supply 3190. Those skilled in the art will appreciate that the terminal structure shown in FIG31 does not limit the scope of a mobile phone or computer, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0451] The RF circuit 3110 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving downlink information from the base station, it is sent to the processor 3180 for processing; in addition, the designed uplink data is sent to the base station.

[0452] The memory 3115 may be used to store software programs and modules. The processor 3180 executes various functional applications and data processing of the target terminal by running the software programs and modules stored in the memory 3115 .

[0453] The input unit 3130 may be configured to receive input digital or character information and generate key signal input related to the setting and function control of the target terminal. Specifically, the input unit 3130 may include a touch panel 3131 and other input devices 3132.

[0454] The display unit 3140 may be configured to display input information or provided information and various menus of the target terminal. The display unit 3140 may include a display panel 3141.

[0455] The audio circuit 3160 , the speaker 3161 , and the microphone 3162 may provide an audio interface.

[0456] In this embodiment, the processor 3180 included in the terminal can execute the blockchain transaction processing method of the previous embodiment.

[0457] The terminals of the embodiments of the present disclosure include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including but not limited to data security, blockchain, data storage, information technology, etc.

[0458] Figure 32 is a block diagram of a portion of a server implementing the blockchain transaction processing method according to an embodiment of the present disclosure. Servers can vary significantly depending on their configuration or performance, and may include one or more central processing units (CPUs) 3222 (e.g., one or more processors), memory 3232, and one or more storage media 3230 (e.g., one or more mass storage devices) storing applications 3242 or data 3244. Memory 3232 and storage media 3230 may be either transient or persistent storage. The program stored in storage media 3230 may include one or more modules (not shown), each of which may include a series of instructions for operating on the server. Furthermore, CPU 3222 may be configured to communicate with storage media 3230 to execute the series of instructions stored in storage media 3230 on the server.

[0459] The server may also include one or more power supplies 3226, one or more wired or wireless network interfaces 3250, one or more input and output interfaces 3258, and / or one or more operating systems 3241, such as Windows Server 2003. TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM etc.

[0460] The central processor 3222 in the server can be used to execute the blockchain transaction processing method of the embodiment of the present disclosure.

[0461] The embodiments of the present disclosure also provide a computer-readable storage medium, which is used to store program code, and the program code is used to execute the blockchain transaction processing method of each of the aforementioned embodiments.

[0462] The present disclosure also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, causing the computer device to implement the above-mentioned blockchain transaction processing method.

[0463] The terms "first," "second," "third," "fourth," and the like (if any) in the specification of the present disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present disclosure described herein, for example, can be implemented in orders other than those illustrated or described herein. In addition, the terms "comprises" and "comprising," and any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or apparatus.

[0464] It should be understood that in the present disclosure, "at least one (item)" refers to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0465] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to exclude the number itself, and above, below, within, etc. are understood to include the number itself.

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

[0467] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0468] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0469] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0470] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.

[0471] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.

Claims

1. A blockchain transaction processing method, the blockchain transaction processing method being executed by a target consensus network, the blockchain transaction processing method comprising: Obtaining an added first target block from each first block of the first blockchain, wherein the first block is generated by the target consensus network and is used to record a first transaction of a target type from a local consensus network, and the first blockchain prohibits access from outside the target consensus network; Obtaining a first target transaction and a first block header from the first target block; Acquire first verification information corresponding to the first target transaction; Based on the first target transaction, the first verification information and the first block header, perform on-chain verification of the first target transaction; If the on-chain verification is successful, obtaining the transaction result data of the first target transaction; The transaction result data is sent to a subscribing node so that the local consensus network can obtain it from the subscribing node.

2. The blockchain transaction processing method according to claim 1, wherein the on-chain verification includes a first sub-verification and a second sub-verification; The performing on-chain verification of the first target transaction based on the first target transaction, the first verification information and the first block header includes: Obtaining a second block header of a next block of the first target block on the first blockchain; Perform a first sub-verification based on the first block header and the second block header; Perform a second sub-verification based on the first target transaction, the first verification information, and the first block header.

3. The blockchain transaction processing method according to claim 2, wherein the block header of the first block includes a first block body digest value of the first block and a second block body digest value of a previous block of the first block on the first blockchain; The performing a first sub-verification based on the first block header and the second block header includes: If the first block body digest value in the first block header is the same as the second block body digest value in the second block header, it is determined that the first sub-verification is successful.

4. The blockchain transaction processing method according to claim 3, wherein the step of obtaining first verification information corresponding to the first target transaction comprises: Generate a first tree, the first tree includes multiple layers of features, wherein the bottom layer of features of the first tree is the summary value of multiple first transactions in the first target block, the multiple first transactions include the first target transaction; two adjacent features of each layer of the first tree are connected to and generate a feature of a higher layer, until a first tree root feature of the first tree is generated, the first tree root feature is the summary value of the first block body; Acquire a first bypass feature of a first path as the first verification information, wherein the first path is a path between the summary value of the first target transaction on the first tree and the first tree root feature, and the first bypass feature is a next-layer feature to which other features on the first path except the summary value of the first target transaction are connected; The performing a second sub-verification based on the first target transaction, the first verification information and the first block header includes: determining a digest value of the first target transaction; Determine a second tree root feature of the first tree based on the summary value of the first target transaction and the first verification information; If the second tree root feature is consistent with the first block body digest value in the first block header, it is determined that the second sub-verification is successful.

5. The blockchain transaction processing method according to claim 2, wherein the target consensus network has a first trusted execution environment, the first trusted execution environment has a first secure execution space and a first key, the first secure execution space prohibits external access to the first secure execution space, and each first block of the first blockchain is encrypted with the first key; The obtaining the first target transaction and the first block header from the first target block includes: decrypting the first target block using the first key in the first secure execution space to obtain a decrypted first target block, and obtaining the first target transaction and the first block header from the decrypted first target block; The performing a first sub-verification based on the first block header and the second block header includes: in the first secure execution space, calling a first sub-verification contract recorded on the first blockchain, and performing a first sub-verification based on the first block header and the second block header; The performing a second sub-verification based on the first target transaction, the first verification information and the first block header includes: in the first secure execution space, calling a second sub-verification contract recorded on the first blockchain, and performing a second sub-verification based on the first target transaction, the first verification information and the first block header.

6. The blockchain transaction processing method according to claim 1, after obtaining the added first target block from each first block of the first blockchain, the blockchain transaction processing method further comprises: Obtain first blockchain height information of the first blockchain; Forwarding the first blockchain height information to the global consensus network so that the global consensus network synchronizes the first blockchain height information to the local consensus network; The sending of the transaction result data to a subscription node for the local consensus network to obtain from the subscription node includes: sending the transaction result data to a subscription node for the local consensus network to obtain from the subscription node when the first blockchain height information received from the global consensus network is inconsistent with the second blockchain height information last received from the global consensus network.

7. The blockchain transaction processing method according to claim 1, wherein the first transaction of the target type is obtained by the first relay node and sent to the target consensus network in the following manner: Determining a transaction type of the first transaction generated by the local consensus network; If the transaction type is a non-target type, keeping the first transaction in the local consensus network, and recording the first transaction in a second blockchain by the local consensus network, wherein the second blockchain allows access outside the local consensus network; If the transaction type is the target type, the first transaction is obtained and sent to the target consensus network.

8. The blockchain transaction processing method according to claim 1, wherein the step of obtaining the added first target block from each first block of the first blockchain comprises: Setting a first blockchain height counter, wherein when one of the first blocks is added to the first blockchain, the first blockchain height counter increases by 1; If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last obtained reaches a first threshold, the first block on the first blockchain from the first block height of the second value plus 1 to the first block with the first value as the first target block is obtained as the first target block; If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last acquired does not reach the first threshold, but the time difference between the current time and the time point when the first target block was last acquired reaches the second threshold, the first block added within the time difference is acquired as the first target block.

9. The blockchain transaction processing method according to claim 1, before obtaining the added first target block from each first block of the first blockchain, the blockchain transaction processing method further comprises: receiving a first subscription request from the subscription node, wherein the first subscription request has a first subscription condition; The obtaining the added first target block from each first block of the first blockchain includes: Obtaining the first block added to the first blockchain; If the added first block contains a first target transaction that meets the first subscription condition, the added first block is obtained as the first target block.

10. The blockchain transaction processing method according to claim 9, wherein the first subscription request also includes a subscription period; If the added first block contains a first target transaction that meets the first subscription condition, acquiring the added first block as the first target block includes: Determine a valid subscription request in which the subscription period has not expired in the first subscription request; If the added first block contains a first target transaction that meets the first subscription condition of the valid subscription request, the added first block is obtained as the first target block.

11. The blockchain transaction processing method according to claim 9, before receiving the first subscription request from the subscription node, the blockchain transaction processing method further comprises: receiving a registration request from the subscription node, wherein the registration request carries a private key of the subscription node; Recording the private key of the subscription node on the first blockchain; The first subscription request includes the private key of the subscription node; After receiving the first subscription request from the subscription node, the blockchain transaction processing method further includes: verifying that the private key included in the first subscription request is consistent with the private key recorded on the first blockchain.

12. The blockchain transaction processing method according to claim 9, wherein obtaining the first target transaction from the first target block comprises: If the number of the first transactions that meet the first subscription condition among the plurality of first transactions is greater than 1, the first transactions that meet the first subscription condition are obtained in a predetermined order as the first target transactions, wherein the predetermined order is determined in the following manner: Determining a first priority of an object associated with the first transaction; Determine a second priority of the subscription node corresponding to the first subscription condition; The predetermined order is determined according to the first priority and the second priority.

13. The blockchain transaction processing method according to claim 12, wherein determining the predetermined order according to the first priority and the second priority comprises: determining a first score for the first transaction according to the first priority; determining a second score for the first transaction according to the second priority; determining a total score for the first transaction based on the first score and the second score; The predetermined order is determined based on the total score of the first transaction.

14. The blockchain transaction processing method according to claim 1, wherein the transaction result data is a variable affected by the execution of the first target transaction; If the on-chain verification is successful, obtaining the transaction result data of the first target transaction includes: If the on-chain verification succeeds, obtain the variables affected by the execution of the first target transaction and the second verification information corresponding to the variables; The sending of the transaction result data to the subscription node for the local consensus network to obtain from the subscription node includes: sending the variable and the second verification information to the subscription node, so that the subscription node verifies the transaction result based on the variable and the second verification information, and after the transaction result verification is successful, storing the variable for the local consensus network to obtain from the subscription node.

15. The blockchain transaction processing method according to claim 14, wherein the obtaining the second verification information corresponding to the variable comprises: Generate a second tree, the second tree includes multiple layers of features, wherein the bottom layer of features of the second tree is a summary value of the variable affected after each of the first transactions is executed, and each of the first transactions includes the first target transaction; two adjacent features of each layer of the second tree are connected to and generate a feature of a higher layer, until a third root feature of the second tree is generated; Acquire a second bypass feature of a second path, together with the third tree root feature, as the second verification information, wherein the second path is a path from the summary value of the variable affected by the execution of the first target transaction on the second tree to the third tree root feature, and the second bypass feature is a next-layer feature to which other features on the second path, except for the variable affected by the execution of the first target transaction, are connected; The verifying the transaction result based on the variable and the second verification information includes: Determining a fourth tree root feature of the second tree according to the summary value of the variable and the second bypass feature; If the third tree root feature is consistent with the fourth tree root feature, it is determined that the transaction result verification is successful.

16. The blockchain transaction processing method according to claim 1, wherein the subscription node has a second trusted execution environment, the second trusted execution environment has a second secure execution space and a second key, and the second secure execution space prohibits external access to the second secure execution space; The sending of the transaction result data to a subscription node, so that the local consensus network can obtain the transaction result data from the subscription node, includes: Encrypting the transaction result data using the public key of the local consensus network to obtain first encrypted transaction result data; The first encrypted transaction result data is sent to the subscription node, so that the subscription node encrypts the first encrypted transaction result data with the second key in the second secure execution space to obtain second encrypted transaction result data, and in response to a transaction result data acquisition request from the local consensus network, decrypts the second encrypted transaction result data with the second key in the second secure execution space to obtain first decrypted transaction result data, and sends the first decrypted transaction result data to the local consensus network, which decrypts the first decrypted transaction result data using the private key of the local consensus network to obtain the transaction result data.

17. A blockchain transaction processing device, the blockchain transaction processing device being located in a target consensus network, the blockchain transaction processing device comprising: A first acquisition unit is configured to acquire an added first target block from each first block of a first blockchain, wherein the first block is generated by the target consensus network and is configured to record a first transaction of a target type from a local consensus network, and the first blockchain is prohibited from being accessed by anyone outside the target consensus network; A second acquisition unit, configured to acquire a first target transaction and a first block header from the first target block; A third acquisition unit, configured to acquire first verification information corresponding to the first target transaction; An on-chain verification unit, configured to perform on-chain verification of the first target transaction based on the first target transaction, the first verification information, and the first block header; A fourth acquisition unit, configured to acquire transaction result data of the first target transaction if the on-chain verification is successful; The first sending unit is used to send the transaction result data to the subscription node, so that the local consensus network can obtain it from the subscription node.

18. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the blockchain transaction processing method according to any one of claims 1 to 16.

19. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the blockchain transaction processing method according to any one of claims 1 to 16.

20. A computer program product, comprising a computer program, wherein the computer program is read and executed by a processor of a computer device, so that the computer device executes the blockchain transaction processing method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • Cross-blockchain authentication method, device and electronic device

    CN108683630A

  • Green electricity tracing method and system based on R-PBFT consensus algorithm and timestamp

    CN113438084A

  • External data source state monitoring method and device, equipment and medium

    CN114328132A

  • Method and apparatus for storing blockchain state data and electronic device

    US20200167345A1

  • Subscription service for networks

    US20210297271A1