Block chain transaction processing method and device, electronic equipment and storage medium

By receiving and verifying transaction storage requests of target nodes in the second-layer blockchain network and updating the status of target nodes, the problem of low transaction security of layer two-layer blockchain network is solved, and higher security and decentralized management are achieved.

CN119884239APending Publication Date: 2025-04-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311394459.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-25
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the prior art, the security of using a layer two-layer blockchain network for transaction processing is low and is easily threatened by centralized nodes.

Method used

By receiving the target node application requests of multiple layer two network nodes, determining the target node, and receiving the transaction storage request sent by the target node, verifying the layer two network status information based on the transaction information, and updating the status information of the target node to improve security.

Benefits of technology

This method improves the security of layer 2 blockchain network transaction processing by decentralizing and identifies and manages malicious nodes, and avoids the problem of low security caused by centralization problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884239A_ABST
    Figure CN119884239A_ABST
Patent Text Reader

Abstract

The invention provides a block chain transaction processing method and device, electronic equipment and a storage medium. The block chain transaction processing method comprises the steps that target node application requests sent by a plurality of two-layer network nodes are received, the two-layer network nodes are nodes in a two-layer network in a block chain network, and the block chain network comprises a first-layer network used for transaction information storage and a second-layer network used for transaction execution; determining a target node in the plurality of two-layer network nodes according to the target node application request; receiving a transaction storage request sent by the target node, wherein the transaction storage request comprises to-be-stored target transaction information and two-layer network state information; verifying the two-layer network state information based on the target transaction information to obtain a verification result; and updating the state information of the target node according to the verification result. The embodiment of the invention can be applied to scenes such as block chains and virtual digital resources. According to the embodiment of the invention, the security of transaction processing by using a two-layer block chain network can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of blockchain, and in particular to a blockchain transaction processing method, device, electronic device and storage medium. Background Art

[0002] In the field of blockchain, the second-layer blockchain network plays an important role in blockchain expansion. The second-layer network in the second-layer blockchain network is responsible for executing transactions, and the first-layer network is responsible for storing transactions. In the process of transmitting transactions from the second-layer network to the first-layer network, a sequencer is usually used. The sequencer is used to sort and package transactions in the second-layer network. The packaged transactions are consensus-based and uploaded to the chain in the first-layer network.

[0003] However, in the related art, the security of transaction processing using the second-layer blockchain network is low. Summary of the invention

[0004] The embodiments of the present disclosure provide a blockchain transaction processing method, device, electronic device and storage medium, which can improve the security of transaction processing using a two-layer blockchain network.

[0005] According to one aspect of the present disclosure, a blockchain transaction processing method is provided, comprising:

[0006] Receiving target node application requests sent by multiple layer 2 network nodes, wherein the layer 2 network nodes are nodes in a layer 2 network in a blockchain network, and are used to execute transactions received by the layer 2 network, wherein the blockchain network includes a layer 1 network for storing transaction information and a layer 2 network for executing transactions;

[0007] Determining a target node from among the plurality of layer 2 network nodes according to the target node application request;

[0008] Receiving a transaction storage request sent by the target node, wherein the transaction storage request includes target transaction information to be stored and layer 2 network status information;

[0009] Verifying the layer 2 network status information based on the target transaction information to obtain a verification result;

[0010] The status information of the target node is updated according to the verification result.

[0011] According to one aspect of the present disclosure, a blockchain transaction processing device is provided, comprising:

[0012] A first receiving unit, configured to receive target node application requests sent by a plurality of layer 2 network nodes, wherein the layer 2 network nodes are nodes in a layer 2 network in a blockchain network, and are configured to execute transactions received by the layer 2 network, wherein the blockchain network includes a layer 1 network for storing transaction information and a layer 2 network for executing transactions;

[0013] A determination unit, configured to determine a target node from among the plurality of layer 2 network nodes according to the target node application request;

[0014] A second receiving unit, configured to receive a transaction storage request sent by the target node, wherein the transaction storage request includes target transaction information to be stored and layer 2 network status information;

[0015] A verification unit, configured to verify the layer 2 network state information based on the target transaction information to obtain a verification result;

[0016] An updating unit is used to update the status information of the target node according to the verification result.

[0017] Optionally, in some embodiments, the target node application request includes the number of pre-stored virtual resources of the layer 2 network node;

[0018] The determining unit is specifically used for:

[0019] Acquire the pre-stored virtual resource quantity from the target node application request of each of the layer 2 network nodes;

[0020] Based on the number of pre-stored virtual resources corresponding to each of the layer-2 network nodes, a target node is determined among the plurality of layer-2 network nodes.

[0021] Optionally, in some embodiments, the determining unit is specifically configured to:

[0022] Obtaining the total number of pre-stored virtual resources corresponding to each of the second-layer network nodes within a transaction storage period, wherein the transaction storage period is a time period during which the first-layer network stores transaction information;

[0023] The layer-2 network node with the largest total number is determined as the target node in the transaction storage cycle.

[0024] Optionally, in some embodiments, the layer 2 network state information is generated by the target node through a first transaction processing process based on the target transaction information;

[0025] The verification unit is specifically used for:

[0026] Based on the target transaction information, obtaining first verification status information through a second transaction processing process, wherein the first transaction processing process is the same as the second transaction processing process;

[0027] The first verification status information is compared with the layer 2 network status information to obtain a verification result.

[0028] Optionally, in some embodiments, the first-layer network includes a plurality of first-layer network nodes, and the first-layer network nodes are used to verify the second-layer network state information based on the target transaction information;

[0029] The verification unit is specifically used for:

[0030] If the first verification status information is inconsistent with the second layer network status information, obtaining second verification status information generated by a plurality of the first layer network nodes based on the target transaction information;

[0031] A verification result is obtained based on the first verification status information and the second verification status information.

[0032] Optionally, in some embodiments, the updating unit is specifically configured to:

[0033] Obtain verification results corresponding to the plurality of first-layer network nodes;

[0034] Based on the multiple verification results, the status information of the target node is updated.

[0035] Optionally, in some embodiments, the updating unit is specifically configured to:

[0036] If the verification result is a verification failure, generating a verification processing request corresponding to the first-layer network node, wherein the verification processing request includes the first verification status information;

[0037] If the number of identical first verification status information in multiple verification processing requests is greater than or equal to a verification threshold, the overall verification result is verification failure, and based on the overall verification result, the status information of the target node is updated.

[0038] Optionally, in some embodiments, the state information includes the number of pre-stored virtual resources corresponding to the layer 2 network node;

[0039] The updating unit is specifically used for:

[0040] If the verification result is a verification failure, the number of pre-stored virtual resources corresponding to the target node is updated.

[0041] The updating unit is specifically used for:

[0042] Reducing the number of pre-stored virtual resources corresponding to the target node according to a predetermined ratio;

[0043] The reduced amount of the pre-stored virtual resources of the target node is stored.

[0044] Optionally, in some embodiments, the state information further includes a node state of the layer 2 network node, the node state indicating whether the layer 2 network node is a target node;

[0045] The updating unit is specifically used for:

[0046] Based on the updated number of pre-stored virtual resources of the target node, the node state of the target node is updated.

[0047] Optionally, in some embodiments, the updating unit is specifically configured to:

[0048] Acquire the number of pre-stored virtual resources corresponding to a plurality of the layer-2 network nodes including the target node;

[0049] Determining a candidate target node based on the pre-stored virtual resource quantities of the plurality of layer-2 network nodes;

[0050] If the candidate target node is different from the target node, the node state of the target node is updated to a non-target node, and the node state of the candidate target node is updated to a target node.

[0051] According to one aspect of the present disclosure, a computer 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.

[0052] According to one aspect of the present disclosure, a 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.

[0053] According to one aspect of the present disclosure, a computer program product is provided, which includes a computer program, and 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 as described above.

[0054] The blockchain transaction processing method in the disclosed embodiment is applied to the transaction processing of the two-layer blockchain network, and the two-layer blockchain network includes a first-layer network for storing transaction information and a second-layer network for executing transactions. The method receives target node application requests sent by multiple second-layer network nodes from a first-layer network in the two-layer blockchain network, wherein the second-layer network node is a node in the second-layer network in the blockchain; determines the target node from multiple second-layer network nodes according to the target node application request; receives a transaction storage request sent by the target node, wherein the transaction storage request includes the target transaction information to be stored and the second-layer network status information; verifies the second-layer network status information based on the target transaction information to obtain a verification result; and updates the status information of the target node according to the verification result.

[0055] In this way, the blockchain transaction processing method of the embodiment of the present disclosure selects a target node from multiple second-layer network nodes based on the target node application request, and the target node processes the target transaction information to be stored and uploads it to the first-layer network for chain storage. This method avoids the centralization problem caused by using a fixed second-layer network node to process transaction storage requests and the further low security problem. In addition, this embodiment can also detect the behavior of the target node based on the target transaction information uploaded by the target node and the second-layer network status information, and manage the selected target node according to the detection result. Thereby, the security of the second-layer blockchain network transaction processing can be further improved.

[0056] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or be understood by practicing the present disclosure. The purpose 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

[0057] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.

[0058] Figure 1A-Figure 1D It is a system architecture diagram of the blockchain transaction processing method application according to an embodiment of the present disclosure;

[0059] Figure 2a-2k It is a schematic diagram of applying the blockchain transaction processing method according to an embodiment of the present disclosure to multiple virtual resource transfer transaction processing scenarios;

[0060] Figure 3 is a flowchart of a blockchain transaction processing method according to an embodiment of the present disclosure;

[0061] Figure 4It is a specific schematic diagram of generating a transaction storage request;

[0062] Figure 5 It is a structural diagram of the first layer network and the second layer network;

[0063] Figure 6 It is a schematic diagram of updating the node status based on the number of pre-stored virtual resources;

[0064] Figure 7 It is a flowchart of a blockchain transaction processing method according to an embodiment of the present disclosure applied to a layer 2 network;

[0065] Figure 8 is another flowchart of the blockchain transaction processing method provided by the present disclosure;

[0066] Figure 9A-9B It is a schematic diagram of the interaction of multiple nodes in a second-layer blockchain network using the blockchain transaction processing method provided by the present disclosure;

[0067] Fig.10 is a structural diagram of a blockchain transaction processing device according to an embodiment of the present disclosure;

[0068] Fig.11 is a terminal structure diagram for implementing various methods according to an embodiment of the present disclosure;

[0069] Fig.12 It is a server structure diagram for implementing various methods according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0070] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with 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 used to limit the present disclosure.

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

[0072] Blockchain: Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of transaction information, which is used to verify the validity of its information (anti-counterfeiting) and associate with the previous block.

[0073] Signature algorithm: The signature algorithm is an important part of blockchain security. The address, public key, private key, etc. of the blockchain are all related to the signature algorithm. The ownership of the blockchain is realized through the private key, blockchain address and digital signature. The private key is only owned by the object itself and is only stored in the object terminal. The authentication and management of ownership are based on the signature algorithm, so it can be said that the trust of the blockchain is based on the successful verification of the signature algorithm.

[0074] Smart contract: It is a piece of code written on the blockchain. Once the terms of the execution contract are triggered in the blockchain at a certain time, the code will be automatically executed.

[0075] Sequencer: A blockchain sequencer is a component that is responsible for sorting and packaging transactions in a blockchain network. On the Layer 2 network, the sequencer is responsible for sorting transactions according to certain rules and packaging them into batches for release. The sequencer can be trusted because it has a certain authority and reliability. However, malicious sequencers may also exist, and they may undermine the security of transaction processing.

[0076] In a two-layer blockchain network, the second-layer network is responsible for executing transactions, and the first-layer network is responsible for storing transactions. When executing transactions, the second-layer network usually uses a single node, but this node may be malicious. Therefore, using a single centralized node for transaction processing will threaten the security of the blockchain network. In this regard, the embodiment of the present disclosure provides a blockchain transaction processing method, in order to improve the security of transaction processing using a two-layer blockchain network in a decentralized manner.

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

[0078] Figure 1A What is shown is a blockchain data sharing system. The data sharing system 100 refers to a system for sharing data between nodes. The data sharing system may include multiple nodes 101, and the multiple nodes 101 may refer to each client in the data sharing system. Each node 101 can receive input information when performing normal work, and maintain the shared data in the data sharing system based on the received input information. In order to ensure the information intercommunication in the data sharing system, there may be an information connection between each node in the data sharing system, and information can be transmitted between nodes through the above information connection. For example, when any node in the data sharing system receives input information, other nodes in the data sharing system obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that the data stored on all nodes in the data sharing system are consistent.

[0079] Each node in the data sharing system has a corresponding node identifier, and each node in the data sharing system can store the node identifiers of other nodes in the data sharing system, so that the generated blocks can be broadcast to other nodes in the data sharing system according to the node identifiers of other nodes. A node identifier list as shown in the following table can be maintained in each node, and the node name and node identifier are stored in the node identifier list accordingly. Among them, the node identifier can be an IP (Internet Protocol, a protocol for interconnecting networks) address and any other information that can be used to identify the node. Table 1 only takes the IP address as an example for illustration.

[0080] Node Name Node ID Node 1 xxx.xxx.xxx.xxx Node 2 xxx.xxx.xxx.xxx … … Node N xxx.xxx.xxx.xxx

[0081] Each node in the data sharing system stores the same blockchain. The blockchain consists of multiple blocks, see Figure 1B The blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information characteristic value, version number, timestamp and difficulty value, and the block body stores the input information; the next block of the genesis block takes the genesis block as the parent block, and the next block also includes a block header and a block body. The block header stores the input information characteristic value of the current block, the block header characteristic value, version number, timestamp and difficulty value of the parent block, and so on, so that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.

[0082] When generating each block in the blockchain, see Figure 1C When the node where the blockchain is located receives the input information, it verifies the input information. After the verification is completed, the input information is stored in the memory pool and the hash tree used to record the input information is updated. After that, the update timestamp is updated to the time when the input information is received, and different random numbers are tried to calculate the eigenvalue multiple times so that the calculated eigenvalue can satisfy the following formula:

[0083] SHA256(SHA256(version+pre_hash+merkle_root+ntime+nbits+x)) <TARGET

[0084] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.

[0085] In this way, when the random number that satisfies the above formula is calculated, the information can be stored accordingly, the block header and block body can be generated, and the current block can be obtained. Subsequently, the node where the blockchain is located sends the newly generated block to other nodes in the data sharing system according to the node identification of other nodes in the data sharing system. Other nodes verify the newly generated block and add the newly generated block to the blockchain stored in them after the verification is completed.

[0086] Figure 1D It is a system architecture diagram applied by the blockchain transaction processing method according to an embodiment of the present disclosure. It includes a first-layer network 110, a second-layer network 120 and a terminal 130, wherein the second-layer network 120 includes a second-layer network node 121.

[0087] The first layer of network 110 is used to verify the transaction storage request. After the verification is passed, consensus is confirmed on the transaction to be stored in the transaction storage request and the transaction information is stored.

[0088] The layer 2 network 120 is used to execute transactions. The execution of transactions mainly utilizes the layer 2 network node 121 in the layer 2 network 120. The layer 2 network node 121 may be a sequencer, which is used to sort and package the transactions received by the layer 2 network 120.

[0089] Terminal 130 is a device for initiating blockchain transaction processing requests. Terminal 130 may include desktop computers, laptops, PDAs (personal digital assistants), mobile phones, vehicle-mounted terminals, home theater terminals, dedicated terminals, and other forms. In addition, it can be a single device or a collection of multiple devices. Blockchain transaction processing requests refer to transaction requests that need to be on-chain, such as requests for exchange or transfer of virtual resources, virtual resource queries, and other requests.

[0090] The embodiments of the present disclosure can be applied in various scenarios, such as Figure 2a-2k Multiple virtual resource transfer transaction processing scenarios shown, etc.

[0091] Blockchain can be used to transfer virtual resources between accounts of different objects. Since multiple virtual resource transfer transactions may occur within a period of time, the efficiency of consensus on the chain one by one is low. The two-layer blockchain network can achieve blockchain expansion and improve transaction processing efficiency. In the two-layer blockchain network, it is necessary to rely on the second-layer network nodes to process the virtual resource transfer transactions, and then consensus on the chain in the first-layer network. For example, the second-layer network nodes package multiple virtual resource transfer transactions, and after packaging, the first-layer network implements virtual resource transfer through the blockchain according to the packaged transactions. The node that packages the virtual resource transfer transactions in the second-layer network can be called a sequencing node or sequencer. If the sequencing node that packages the transaction is fixed, then if the sequencing node has malicious behavior, it will threaten the security of virtual resource data, such as problems such as the transfer quantity error or the transfer object error. The blockchain transaction processing method of the disclosed embodiment can manage the sequencing nodes in the second-layer network to improve the security of virtual resource data.

[0092] For example, object A wants to transfer 20 virtual resources to object B, and object B wants to transfer 50 virtual resources to object C.

[0093] like Figure 2a As shown in FIG. 1 , the terminal 130 of object A displays his account information, including the account name and the virtual resource account balance. Currently, the virtual resource account balance of object A is 100 virtual resources. After object A clicks "Virtual Resource Transfer", the interface becomes as follows: Figure 2b As shown, object A needs to input the target object to be transferred and the number of virtual resources to be transferred. As shown in the figure, object A wants to transfer 20 virtual resources to object B.

[0094] At the same time, Figure 2c As shown in FIG. 1 , the terminal 130 of object B displays his account information. Currently, the virtual resource account balance of the object is 80 virtual resources. After object B clicks “Virtual Resource Transfer”, as shown in FIG. Figure 2d As shown, the target object to be transferred is input as "object C" and the number of virtual resources to be transferred is "50".

[0095] After the virtual resource transfer transaction between object A and object B, Figure 2e As shown, a prompt message "Waiting for target node processing" pops up on the terminal 130. After the target node generates a transaction storage request based on the virtual resource transfer transaction submitted by object A and object B, the transaction storage request is sent to a layer of network. Figure 2f As shown, the interface of terminal 130 pops up a prompt message "Waiting for a layer of network verification". If the target node is a malicious node, the verification will fail, such as Figure 2gAs shown, a prompt message "Target node verification failed, updating the target node" pops up on the interface of terminal 130. After updating the target node, a layer of network is used to verify again. If the verification is successful, such as Figure 2h As shown, a prompt message "Verification successful, virtual resource transfer in progress" is popped up on the interface of terminal 130.

[0096] After the virtual resource transfer request is made according to the virtual resource transfer request, the balance of the virtual resource will also be fed back to the object to which the account belongs through the terminal 130. Figure 2i As shown in the figure, object A transfers 20 virtual resources to object B, and the current virtual resource account balance is 80 virtual resources. Figure 2j As shown, object B receives 20 transferred from object A and transfers 50 to object C. The current virtual resource account balance is 50 virtual resources. Figure 2k As shown, object C receives 50 virtual resources transferred from object B. Assuming that object C originally has 10 virtual resources, the current virtual resource account balance of object C is 60 virtual resources.

[0097] Through the above process, the embodiment of the present disclosure realizes decentralized management of the second-layer network nodes, timely identifies malicious nodes, and improves the data security of virtual resource transfer.

[0098] General description of the disclosed embodiments

[0099] According to one embodiment of the present disclosure, a blockchain transaction processing method is provided. The method can be used for Figure 2a-2k Multiple virtual resource transfer transaction processing scenarios shown, etc.

[0100] like Figure 3 As shown, a flowchart of the blockchain transaction processing method provided by the present disclosure is applied to a layer network in a blockchain network. The method can be applied to a blockchain transaction processing device. The blockchain transaction processing method may include:

[0101] Step 310: Receive target node application requests sent by multiple layer 2 network nodes.

[0102] In step 310, the blockchain network includes a first-layer network for storing transaction information and a second-layer network for executing transactions. The second-layer network node is a node in the second-layer network in the blockchain network, and is used to execute transactions in the second-layer network. There are multiple second-layer network nodes in the second-layer network, and the second-layer network nodes can be specifically used to process virtual resource transfer transactions. The second-layer network node can send a target node application request to the first-layer network, and the target node application request can specifically be a request to apply to become a sequencing node. As described above, the sequencing node can specifically be a node that packages and uploads virtual resource transfer transactions in the second-layer network to the first-layer network for storage. When the target node application request is passed and the second-layer network node becomes the target node, it can be used to package and upload virtual resource transfer transactions processed in the second-layer network.

[0103] The target node application request may include a node address of a layer 2 network node, so that the layer 1 network can find the layer 2 network node through the node address.

[0104] When sending a target node application request to the first-layer network, the second-layer network node can sign the target node application request to prevent malicious tampering or malicious acquisition during the request sending process. The signature can use a summary algorithm (such as a hash algorithm) to obtain a summary of the target node application request body, and then encrypt the summary with the private key (or public key) of the second-layer network node. After the signature is completed, the encrypted target node application request is sent to the first-layer network. After the first-layer network receives the target node application request sent by the second-layer network node, it needs to verify the signature. The signature verification can use the public key (or private key) of the second-layer network node to decrypt the signature, and then use the corresponding summary algorithm (such as a hash algorithm) to obtain a summary of the target node application request body, and compare the decryption result with the summary. If the two are consistent, the signature verification is successful. The above process can improve the security of the target node application.

[0105] Step 320: Determine a target node from among multiple layer 2 network nodes according to the target node application request.

[0106] In step 320, the first layer network determines a target node based on the target node application request of each second layer network node.

[0107] In one embodiment, the target node application request includes the number of pre-stored virtual resources of the second-layer network node. The number of pre-stored virtual resources refers to the number of virtual resources that the second-layer network node pre-stores in the first-layer network in order to apply to become a target node. The number of pre-stored virtual resources of each second-layer network node can be a preset fixed number, or it can be dynamically determined based on the computing power of the second-layer network node. The computing power is a comprehensive measurement indicator of various aspects of the performance of the second-layer network node. The higher the computing power, the higher the computing efficiency of the second-layer network node. Therefore, the stronger the computing power of the second-layer network node, the faster the efficiency of executing transactions, and the higher the number of pre-stored virtual resources can be.

[0108] Determine the target node from multiple Layer 2 network nodes according to the target node application request, including:

[0109] Obtaining the amount of pre-stored virtual resources from the target node application request of each layer 2 network node;

[0110] Based on the number of pre-stored virtual resources corresponding to each layer-2 network node, a target node is determined among the multiple layer-2 network nodes.

[0111] In this embodiment, the target node is determined based on the number of pre-stored virtual resources in the target node application request of the layer 2 network node.

[0112] First, it is necessary to obtain the number of pre-stored virtual resources corresponding to each layer 2 network node. In the aforementioned embodiment, the target node application request is sent to the layer 1 network after being signed by the layer 2 network node. Based on this, when obtaining the number of pre-stored virtual resource requests corresponding to each layer 2 network node, it is necessary to verify the signature of the target node application request, and obtain the number of pre-stored virtual resource requests in the target node application request after verification.

[0113] The target node is determined based on the number of pre-stored virtual resources of each second-layer network node, and the second-layer network node with the largest number of pre-stored virtual resources can be directly used as the target node. For example, the first-layer network receives target node application requests from the second-layer network node A, the second-layer network node B, and the second-layer network node C at the same time. The number of pre-stored virtual resources of the second-layer network node A is 80, the number of pre-stored virtual resources of the second-layer network node B is 90, and the number of pre-stored virtual resources of the second-layer network node C is 70. Then, the second-layer network node B can be used as the target node. That is, the second-layer network node with the largest number of pre-stored virtual resources can be selected as the sequencing node.

[0114] The first layer network may store transaction information according to a predetermined period, for example, once every 30 minutes or once every hour. Then, the second layer network also executes transactions according to the predetermined period of storing transaction information in the first layer network, and the target node also needs to execute transactions within a predetermined period. Therefore, in one embodiment, based on the number of pre-stored virtual resources corresponding to each second layer network node, the target node is determined from multiple second layer network nodes, including:

[0115] Obtaining the total number of pre-stored virtual resources corresponding to each layer 2 network node within a transaction storage period, where the transaction storage period is a time period for storing transaction information in a layer 1 network;

[0116] The second-layer network node with the largest total number is determined as the target node in the transaction storage cycle.

[0117] In this embodiment, the transaction storage cycle is a predetermined cycle for the first-layer network to store transaction information. During a transaction information storage cycle, a second-layer network node can send a target node application request to the first-layer network multiple times. This is because if the number of pre-stored virtual resources is dynamically determined based on the computing power of the second-layer network node, then the computing power of the second-layer network node may change during a transaction storage cycle. For example, a transaction storage cycle occurs in the time interval of 8:00-8:30. A second-layer network node is executing a computing task at 8:00. At this time, the number of pre-stored virtual resources in the target node application request issued based on the available computing power is 50. At 8:20, the computing task is completed. At this time, the number of pre-stored virtual resources that can be issued based on the available computing power is 70. Then the second-layer network node can send a target node application request to the first-layer network again, in which the number of pre-stored virtual resources is 20.

[0118] Therefore, in this embodiment, when a storage time point of a transaction storage cycle is reached, the target node application request sent by each layer 2 network node in the transaction storage cycle is obtained, and the number of pre-stored virtual resources is counted. For example, in a transaction storage cycle of 8:00-8:30, 8:30 is the storage time point of the cycle, then at 8:30, the total number of pre-stored virtual resources of each layer 2 network node is obtained. The layer 2 network node with the largest total number of pre-stored virtual resources is taken as the target node.

[0119] The advantage of this embodiment is that the target node is determined according to the total amount of pre-stored virtual resources in the transaction storage cycle, and the second-layer network node is given sufficient space to adjust the amount of pre-stored virtual resources according to its own situation, so that the amount of pre-stored virtual resources obtained at the storage time point can accurately reflect the current transaction execution capability of the second-layer network node, thereby improving the flexibility and accuracy of determining the target node based on the amount of pre-stored virtual resources.

[0120] The target node is determined based on the number of pre-stored virtual resources. The target node can be determined according to the transaction execution capability (computing power) of the second-layer network node, so that the second-layer network node with high transaction execution efficiency can be selected as the target node, thereby improving the transaction execution efficiency of the second-layer network node.

[0121] Step 330: Receive a transaction storage request sent by the target node.

[0122] In step 330, the transaction storage request sent by the target node includes the target transaction information to be stored and the layer 2 network status information, wherein the layer 2 network status information may be the result obtained after the target node executes the target transaction information to be stored, and the target transaction information to be stored and the layer 2 network status information are packaged to obtain the transaction storage request.

[0123] The layer 2 network status information is determined by the layer 2 network node executing tasks. For example, if the layer 2 network node is a sequencer, it needs to sort and package the received transactions. The layer 2 network status information is the state of the target node after sorting and packaging multiple target transactions to be stored.

[0124] In the above-mentioned embodiment, the first layer network performs transaction storage according to a predetermined transaction storage cycle, and the second layer network node performs transaction execution according to the same transaction storage cycle. Based on this, when the target node generates a transaction storage request, it can obtain the second layer network status information based on all transactions received within the transaction storage cycle; and generate a transaction storage request based on the transactions within the transaction storage cycle and the corresponding second layer network status information. The specific process can be as follows: Figure 4 As shown, in a transaction storage cycle, the second layer network receives transactions A, B, and C. The target node performs state transition based on these three transactions to obtain the second layer network state information. A transaction storage request is generated based on the second layer network state information and the transactions received in the transaction storage cycle. A serialization function, such as the DUMPS function, can be used to generate a transaction storage request.

[0125] The transaction storage request can also include the address of the target node. Based on the address of the target node, the first layer network can directly find the target node and feedback the transaction processing results.

[0126] In order to prevent the transaction storage request from being maliciously attacked during the transmission process, the target node needs to sign the transaction storage request. The signing process is the same as the signing process of the target node application request, which will not be repeated here. After receiving the transaction storage request sent by the target node, the first-layer network needs to verify the transaction storage request. The verification process is the same as the verification process of the target node application request in the aforementioned embodiment, which will not be repeated here. After the verification is passed, the first-layer network can store transactions based on the transaction storage request. Through this process, the security of the first-layer network receiving the transaction storage request is improved.

[0127] Step 340: Verify the layer 2 network status information based on the target transaction information to obtain a verification result;

[0128] Because the transaction storage request includes the target transaction information to be stored and the layer 2 network status information.

[0129] Therefore, before verifying the layer 2 network status information based on the target transaction information, the following may also be included:

[0130] The target transaction information and the layer 2 network status information to be stored are obtained from the transaction storage request.

[0131] The process of obtaining the target transaction information and the layer 2 network status information to be stored from the transaction storage request can directly use the inverse function corresponding to the process of generating the transaction storage request based on the target transaction information and the layer 2 network status information. For example, the DUMPS serialization function is used to generate the transaction storage request based on the target transaction information and the layer 2 network status information, and the LOADS deserialization function can be used to obtain the target transaction information and the layer 2 network status information to be stored based on the transaction storage request.

[0132] After obtaining the target transaction information and the second-layer network status information to be stored, the content of the target transaction information and the second-layer network status information itself can be verified. The verification result can be passed or failed.

[0133] Verifying the content of the target transaction information and the second-layer network status information itself can verify whether the target transaction information and the second-layer network status information are compliant. For the target transaction information, it can be verified whether the target transaction is a transaction that complies with regulations and can be executed. For example, the first-layer network stipulates that when executing a virtual resource transfer transaction, the number of virtual resources transferred at a time cannot be greater than 1000. If the target transaction is to transfer 1500 virtual resources, then the transaction does not comply with the first-layer network regulations and the verification fails. For the second-layer network status information, it can be verified whether the input format of the information is correct.

[0134] After verifying the contents of the target transaction information and the layer 2 network status information itself, the layer 2 network status information can be verified based on the target transaction information. The verification result can be a pass or a fail.

[0135] In one embodiment, the layer 2 network status information is generated by the target node through the first transaction processing process based on the target transaction information; the first transaction processing process is a process in which the target node obtains the layer 2 network status information based on the target transaction information. For example, the target node uses the EXEC() function to obtain the layer 2 network status information of the target node based on the target transaction information according to the previous network status information of the target node. The specific process is shown in Formula 1:

[0136] STATE i =EXEC(STATE i-1 ,TXs) (Formula 1)

[0137] As shown in Formula 1, STATE i-1 State information before the target node executes the target transaction, STATE i is the layer 2 network status information, and TXs is the target transaction information. Through the EXEC() function, the layer 2 network status information of the target node can be obtained.

[0138] Therefore, the second-layer network status information is verified based on the target transaction information to obtain the verification results, including:

[0139] Based on the target transaction information, obtaining first verification status information through a second transaction processing process;

[0140] The first verification status information is compared with the second layer network status information to obtain a verification result.

[0141] In this embodiment, the first transaction processing process is the same as the second transaction processing process, except that the execution subject of the first transaction processing process can be the target node, and the execution subject of the second transaction processing process can be a first-layer network node in the first-layer network, and the first-layer network node is used to execute the verification process of the target node. Specifically, the node in the first-layer network node used to execute the verification process of the target node can be called a lookout node, and the lookout node can be any node in the first-layer network. The node in the first-layer network can spontaneously initiate the verification of the target node in the second-layer network, that is, the aforementioned process of verifying the target transaction information uploaded by the target node and the second-layer network status information. At this time, the node that spontaneously initiates the verification of the target node in the second-layer network can be called a lookout node. When the lookout node verifies the target node and finds that the target node has an error or abnormal behavior, the lookout node can get a reward given by the blockchain, thereby encouraging the nodes in the first-layer network to actively verify the target node.

[0142] The first-layer network node obtains the first verification status information based on the target transaction information based on the second transaction processing process. For example, the process of the target node obtaining the second-layer network status information is shown in Formula 1, and the process of the first-layer network node obtaining the first verification status information is shown in Formula 2:

[0143] LocalSTATE i =EXEC(LocalSTATE i-1 ,TXs) (Formula 2)

[0144] As shown in Formula 2, LocalSTATE i-1 It is the state of a layer of network nodes before the target node is verified. LocalSTATE i It is the first verification status information obtained by the first layer of network nodes, and TXs is the target transaction information. Through the EXEC() function, the first verification status information of the first layer of network nodes can be obtained.

[0145] The first verification status information is compared with the second-layer network status information. When the first verification status information is consistent with the second-layer network status information, it can be considered that the second-layer network status obtained by the target node is normal and the verification is passed; otherwise, if they are inconsistent, the verification fails.

[0146] The above process occurs in a first-layer network node of the first-layer network. In another embodiment, the first-layer network includes multiple first-layer network nodes, and the first-layer network node is used to verify the second-layer network status information based on the target transaction information. Figure 5 As shown, the first-layer network includes multiple first-layer network nodes. The target node in the second-layer network can send a transaction storage request to each first-layer network node, and each first-layer network node can verify the second-layer network status information based on the target transaction information in the transaction storage request.

[0147] Therefore, the first verification status information is compared with the second layer network status information to obtain the verification result, including:

[0148] If the first verification status information is inconsistent with the layer 2 network status information, obtaining second verification status information generated by a plurality of layer 1 network nodes based on the target transaction information;

[0149] A verification result is obtained based on the first verification status information and the second verification status information.

[0150] In this embodiment, for a first-layer network node, if the first verification status information is inconsistent with the second-layer network status information, it connects to other first-layer network nodes and obtains the second verification status information of other first-layer network nodes. The second verification status information is obtained by other first-layer network nodes through the second transaction processing process based on the target transaction information. The specific process is the same as the process of obtaining the first verification status information in the above description, and will not be repeated here.

[0151] If a first-layer network node cannot obtain the second verification status information of another first-layer network node, it can propagate its own first verification status information to the other party to ensure that each first-layer network node in the first-layer network can obtain the result of verifying the second-layer network status information.

[0152] After obtaining the plurality of second verification status information, a verification result may be obtained based on the first verification status information and the second verification status information.

[0153] In one embodiment, if the number of second verification status information that is the same as the first verification status information reaches a predetermined threshold, the verification result of the second-layer network status information is a verification failure. For example, if the predetermined threshold is 1, then as long as there is one second verification status information that is the same as the first verification status information, the verification result of the second-layer network status information is a verification failure. The predetermined threshold can be determined based on the number of first-layer network nodes that have not obtained the second verification status information.

[0154] Since if a first-layer network node cannot obtain the second verification status information of another first-layer network node, it can propagate its own first verification status information to the other party, then the first verification status information of this first-layer network node must be consistent with the second verification status information of the propagated first-layer network node. If the predetermined threshold is less than the number of first-layer network nodes that have not obtained the second verification status information, then the verification result must be a verification failure. For example, the number of first-layer network nodes that have not obtained the second verification status information is 3. After propagating to these 3 first-layer network nodes, there must be 3 second verification status information that is the same as the first verification status information. If the predetermined threshold is set to 2, then the verification result is a verification failure, so that it is impossible to accurately obtain an accurate verification result through multiple first-layer network nodes. Therefore, the predetermined threshold can be determined based on the number of first-layer network nodes that have not obtained the second verification status information by adding one to the number of first-layer network nodes that have not obtained the second verification status information to obtain the predetermined threshold. For example, if the number of first-layer network nodes that have not obtained the second verification status information is 3, then the predetermined threshold is 4. Determining the predetermined threshold in this way can improve the accuracy of determining the verification result.

[0155] The advantage of determining the verification result based on a predetermined threshold is that the verification result can be obtained more efficiently.

[0156] In another embodiment, obtaining a verification result based on the first verification status information and the second verification status information includes:

[0157] Counting the number of states of each state information in the first verification state information and the second verification state information;

[0158] The verification result is obtained based on the number of states.

[0159] In this embodiment, the number of states of each state information is determined. For example, among the first verification state information and the plurality of second verification state information, there are 5 states A, 2 states B, and 3 states C. The verification result obtained based on the number of states can be determined by comparing the number of states corresponding to the first verification state information with the number of states corresponding to the second-layer network state information. For example, based on the number of states in the above example, the first verification state information is state C, and the second-layer network state information is state A, which means that 5 first-layer network nodes have obtained the same second-layer network state information as the target node, while only 3 first-layer network nodes (including the first-layer network nodes corresponding to the first verification state information) have obtained state C, which can represent that there are a majority of first-layer network nodes supporting the target node. Therefore, if the number of states corresponding to the first verification state information is less than the number of states corresponding to the second-layer network state information, the verification result is passed. The advantage of determining the verification result based on the number of states is that the verification result is determined by comprehensively considering the verification information obtained by each first-layer network node, thereby improving the accuracy of determining the verification result.

[0160] The advantage of determining the verification result based on the first verification status information and the second verification status information of multiple other first-layer network nodes is that the accuracy of determining the verification result is improved by obtaining the support of other first-layer network nodes to verify whether the first verification status information is correct.

[0161] Since a malicious target node can evade verification of the format of the Layer 2 network status information itself through malicious means, by obtaining the first verification status information to verify the Layer 2 network status information, it is possible to verify whether the target node obtains the correct Layer 2 network status information based on the target transaction information, making it difficult for the malicious target node to evade verification, thereby improving the accuracy of verifying the Layer 2 network status information.

[0162] Step 350: Update the status information of the target node according to the verification result.

[0163] The state information of the target node may include the node address of the target node, the number of pre-stored virtual resources, and the node state.

[0164] The verification result can be "verification passed" or "verification failed". If the verification result is "verification passed", the state information of the target node may not be changed, and the target node still has the execution right to execute transactions on the second-layer network. If the verification result is "verification failed", the state information of the target node needs to be changed.

[0165] Since in the above-mentioned embodiment, the first layer network includes multiple first layer network nodes, each first layer network node will verify the second layer network status information to obtain a verification result. Based on this, in one embodiment, the status information of the target node is updated according to the verification result, including:

[0166] Obtain verification results corresponding to multiple first-layer network nodes;

[0167] Based on the multiple verification results, the status information of the target node is updated.

[0168] In this embodiment, each first-layer network node can obtain a verification result of "verification passed" or "verification failed" after verifying the second-layer network status information. Since the verification process of the second-layer network status information occurs in a first-layer network node in a first-layer network, in order to update the status information of the target node based on the verification results of multiple first-layer network nodes, in one embodiment, the status information of the target node is updated based on multiple verification results, including:

[0169] Retrieve the verification contract;

[0170] Based on the verification contract, the overall verification result is obtained according to multiple verification results, and the status information of the target node is updated based on the overall verification result.

[0171] In this embodiment, the verification contract is a contract in a first-layer network node for collating the verification results of multiple first-layer network nodes, obtaining an overall verification result, and updating the status information of the target node based on the overall verification result.

[0172] Each layer of network nodes transmits the verification results to the verification contract, and the verification contract obtains the overall verification results. For example, if the number of "verification failures" in multiple verification results is greater than the number of "passed verifications", it means that the overall verification result obtained based on multiple layer-one network nodes is "verification failure", and the status information of the target node needs to be updated.

[0173] When each layer of network nodes transmits the verification result to the verification contract, it needs to sign the verification result to prevent the verification result from being maliciously attacked. After receiving the encrypted verification result, the verification contract needs to verify the verification result. After the verification is passed, the verification result can be obtained. The specific process of signing and verifying is the same as in the previous embodiment, and will not be repeated here.

[0174] The advantage of using the verification contract to obtain the overall verification result and updating the status information of the target node based on the overall verification result is that the verification results of each layer of network nodes are uniformly managed, thereby improving the accuracy of the target node status update.

[0175] Since when the verification result is "verification passed", there is no need to update the state information of the target node, therefore, when updating the state information of the target node based on multiple verification results, only the verification result of "verification failed" needs to be considered. Therefore, in one embodiment, updating the state information of the target node based on multiple verification results includes:

[0176] If the verification result is a verification failure, a verification processing request corresponding to a layer of network nodes is generated;

[0177] If the number of identical first verification status information in multiple verification processing requests is greater than or equal to the verification threshold, the overall verification result is verification failure, and the status information of the target node is updated based on the overall verification result.

[0178] In this embodiment, when the verification result of a layer of network nodes is "verification failed", a verification processing request can be generated based on the verification result. Since in the aforementioned embodiment, a layer of network nodes obtains the verification result by generating first verification status information. Therefore, the verification processing request can also include the first verification status information corresponding to the layer of network nodes. In order to prevent the first verification status information from being maliciously attacked, the generated verification processing request can be obtained by encrypting the first verification status information. In one embodiment, generating a verification processing request includes:

[0179] Use the node public key to sign the first verification status information;

[0180] Use the node private key to perform a second-layer signature on the first-layer signature result to generate a verification processing request.

[0181] The overall encryption process can be shown as formula 3:

[0182] Q x =SIGN( <LocalSTATE i ,Pubkey x >,Prikey x ) (Formula 3)

[0183] In formula 3, LocalSTATE i The first verification status information corresponding to the first layer of blockchain nodes; Pubkey x Prikey is the node public key; xis the node private key; SIGN() is the signature algorithm; Q x Based on Formula 3, the first verification status information is first signed with a first layer using the node public key, and then the result of the first layer signature is signed with a second layer using the node private key to obtain a verification processing request.

[0184] The advantage of using multiple signatures to obtain verification processing requests is that it improves the security of the first verification status information of the failed verification transmission of the first layer of block nodes.

[0185] In the aforementioned embodiment, the verification contract is used to obtain the overall verification result, and the state information of the target node is updated based on the overall verification result. Therefore, in this embodiment, after generating a verification processing request, a layer of network nodes can also send the verification processing request to the verification contract, and the verification contract updates the state information of the target node according to the verification processing request. Based on the verification contract, the first verification state information in multiple verification processing requests can be classified, and the same first verification state information can be aggregated. If the number of a certain first verification state information is greater than or equal to the verification threshold, the verification result is verification failure. For example, the first verification state information in the received verification processing request is: state A, state C, state A, state B, state C, state A, then the number of state A is 3, the number of state B is 1, and the number of state C is 2. If the verification threshold is 3, then the number of state A is equal to the verification threshold, the verification result is verification failure, and the state information of the target node needs to be updated.

[0186] The advantage of updating the status information of the target node based on the verification processing request generated by the layer of network nodes whose verification results are failed is that the layer of network nodes whose verification results are passed are not taken into consideration, thereby improving the efficiency of updating the status information of the target node; the verification result is determined according to the number of identical first verification status information in the verification processing request, and the status information of the target node is updated, thereby improving the verification accuracy.

[0187] The advantage of updating the state information of the target node based on the verification results corresponding to the multiple first-layer network nodes is that the verification results of the multiple first-layer network nodes are comprehensively considered, thereby improving the accuracy of updating the state information of the target node.

[0188] In one embodiment, the state information includes the number of pre-stored virtual resources corresponding to the layer 2 network node. Therefore, the state information of the target node is updated according to the verification result, including:

[0189] If the verification result is a verification failure, the number of pre-stored virtual resources corresponding to the target node is updated.

[0190] If the verification result is a verification failure, the number of pre-stored virtual resources corresponding to the target node may be reduced. In one embodiment, if the verification result is a verification failure, updating the number of pre-stored virtual resources corresponding to the target node includes:

[0191] Reduce the number of pre-stored virtual resources corresponding to the target node according to a predetermined ratio;

[0192] The amount of pre-stored virtual resources that are reduced by the storage target node.

[0193] In this embodiment, if the verification result is a verification failure, the number of pre-stored virtual resources of the target node is reduced according to a predetermined ratio. For example, the predetermined ratio is 0.2, if the initial number of pre-stored virtual resources of the target node is 100, then the number of pre-stored virtual resources that need to be reduced after the verification fails is 100*0.2=20, and the number of pre-stored virtual resources remaining in the status information is 100-20=80.

[0194] The predetermined ratio can be set based on the severity of the verification failure. The severity of the verification failure can be determined based on the similarity between the second-layer network status information and the first verification status information. The higher the similarity, the closer the second-layer network status information is to the first verification status information, and the lower the severity of the verification failure. Conversely, the difference between the second-layer network status information and the first verification status information is large, and the higher the severity of the verification failure. The severity of the verification failure can also be determined based on the number of verification results of multiple first-layer network nodes that are verification failures. The more verification failures there are in the verification results, the higher the severity of the verification failure. Conversely, the lower the severity of the verification failure. The higher the severity of the verification failure, the higher the predetermined ratio, and the more the number of pre-stored virtual resources that the target node reduces.

[0195] After reducing the number of pre-stored virtual resources corresponding to the target node, the reduced part of the pre-stored virtual resources is stored.

[0196] Since in the aforementioned embodiment, a layer network includes multiple layer network nodes, the state information of the target node is updated based on the verification results of the multiple layer network nodes. Based on this, in one embodiment, storing the reduced number of pre-stored virtual resources of the target node includes:

[0197] Based on the verification results of multiple first-layer network nodes, the reduced amount of pre-stored virtual resources of the target node is divided into multiple parts;

[0198] Each pre-stored virtual resource is stored in a corresponding layer of network nodes.

[0199] In this embodiment, it is necessary to divide the number of pre-stored virtual resources of the target node into multiple copies. The contributions of verification results of different first-layer network nodes to the update of the target node status information are different, where contribution refers to the degree of influence of the verification results of a first-layer network node on the update of the target node status information. For example, a first-layer network node with a verification result of "verification failed" prompts the update of the target node status information, so the contribution of these first-layer network nodes to the update of the target node status information is relatively large, but a first-layer network node with a verification result of "verification passed" does not cause the target node status information to be updated, and the contribution of these first-layer network nodes to the update of the target node status information is relatively small. Therefore, in one embodiment, the number of pre-stored virtual resources of the target node that is reduced is divided into multiple copies based on the verification results of multiple first-layer network nodes, including:

[0200] Determine the number of first-layer network nodes for which verification results are verification failures;

[0201] The number of pre-stored virtual resources is divided into multiple parts according to the number of the first-layer network nodes whose verification results are failed verification.

[0202] For example, the number of first-layer network nodes whose verification result is verification failure is 4, the number of pre-stored virtual resources reduced by the target node is 20, the number of pre-stored virtual resources is divided into 4 parts, the number of virtual resources in each part is 5, and each first-layer network node whose verification result is verification failure can obtain one virtual resource.

[0203] The advantage of directly allocating the pre-stored virtual resources to the layer of network nodes that failed verification is that the allocation efficiency is high and the state information of the target node is updated quickly.

[0204] In the aforementioned embodiment, if the verification result of a first-layer network node is a verification failure, a verification processing request is generated; based on the verification processing request, the state information of the target node is updated. In this embodiment, not all first-layer network nodes with verification results of verification failure contribute to the update of the state information of the target node. Only when there are multiple identical first verification state information exceeding the verification threshold in multiple verification processing requests, the overall verification result is a verification failure, and the state information of the target node is updated. According to this embodiment, based on the verification results of multiple first-layer network nodes, the number of pre-stored virtual resources reduced by the target node is divided into multiple parts, including:

[0205] Determine a layer of network nodes corresponding to a plurality of identical first verification status information whose number exceeds a verification threshold;

[0206] The number of pre-stored virtual resources is divided into multiple parts according to the number of network nodes in one layer.

[0207] For example, if the first verification status information exceeding the threshold is status A, and there are 4 corresponding first-layer network nodes, the number of pre-stored virtual resources will be divided into 4 parts, and each first-layer network node whose first verification status information is status A can obtain a pre-stored virtual resource.

[0208] The advantage of determining the allocation of pre-stored virtual resources based on the first verification status information is that the pre-stored virtual resources can be allocated to a layer of network nodes that contributes to updating the status information of the target node, which is conducive to motivating a layer of network nodes to improve the accuracy of verification of the target node.

[0209] The number of pre-stored virtual resources can be divided into multiple parts by average distribution. For example, the number of pre-stored virtual resources is 100 and needs to be distributed to 5 first-layer network nodes. Then, the number of pre-stored virtual resources obtained by each first-layer network node is 20. The average distribution method does not need to limit the correspondence between the first-layer network nodes and the pre-stored virtual resource groups, because the number of pre-stored virtual resources obtained by each first-layer network node is the same. Therefore, the advantage of average distribution is that each first-layer network node obtains the same number of virtual resources, which improves the fairness of the distribution process, does not need to store the correspondence between the first-layer network nodes and a certain pre-stored virtual resource group, and reduces the memory usage in the first-layer network.

[0210] The number of pre-stored virtual resources can also be divided into multiple parts and allocated according to the weight of the first-layer network node. For example, the number of pre-stored virtual resources is 100, which needs to be allocated to 4 first-layer network nodes, where the weight of the first-layer network node A is 0.3, the weight of the first-layer network node B is 0.1, the weight of the first-layer network node C is 0.4, and the weight of the first-layer network node D is 0.2. Then the number of pre-stored virtual resources allocated to the first-layer network node A is 100*0.3=30, the number of pre-stored virtual resources allocated to the first-layer network node B is 100*0.1=10, the number of pre-stored virtual resources allocated to the first-layer network node C is 100*0.4=40, and the number of pre-stored virtual resources allocated to the first-layer network node D is 100*0.2=20. After the number of pre-stored virtual resources is divided into multiple parts according to the weight of the first-layer network node, each part is allocated to the corresponding first-layer network node. The weight corresponding to each first-layer network node can be determined based on the time when the first-layer network node obtains the verification result. The shorter the time required for a first-layer network node to receive a transaction storage request and obtain a verification result, the higher the verification efficiency of the node. Therefore, a higher weight can be set for a first-layer network node with high verification efficiency, which is conducive to motivating each first-layer network node to improve verification efficiency. The advantage of allocating the number of pre-stored virtual resources according to the weight of the first-layer network node is that different weights can be set for the first-layer network node according to the actual verification effect, which improves the flexibility of pre-stored virtual resource allocation and promotes the development of the first-layer network node towards higher verification efficiency and more accurate verification results.

[0211] This embodiment divides the reduced number of pre-stored virtual resources of the target node into multiple parts based on the verification results of multiple first-layer network nodes, and stores each pre-stored virtual resource in the corresponding first-layer network node, so that each first-layer network node that makes a significant contribution to the update of the target node status information can obtain part of the pre-stored virtual resources of the target node, which encourages the first-layer network node to obtain more accurate verification results in the subsequent verification process of the target node.

[0212] The number of pre-stored virtual resources corresponding to the target node is reduced according to a predetermined ratio. The corresponding penalty can be imposed according to the severity of the target node verification failure. The amount of pre-stored virtual resources reduced by the target node is stored as a reward for the first-layer network node identifying the risk of the target node. Through this process, the management of the target node is achieved, and the first-layer network node is encouraged to improve the verification efficiency.

[0213] Updating the number of pre-stored virtual resources corresponding to the target node is a penalty for the failure of target node verification. Through such a management method, the centralization of target nodes is avoided and the security of transaction processing is improved.

[0214] In another embodiment, the state information further includes a node state of the layer 2 network node, and the node state indicates whether the layer 2 network node is a target node. When the layer 2 network node is selected as the target node in step 320, the node state of the layer 2 network node can be marked as 1, and the node state of other layer 2 network nodes that are not selected as target nodes can be marked as 0.

[0215] If the verification result is a verification failure, after updating the number of pre-stored virtual resources corresponding to the target node, the method further includes:

[0216] Based on the updated number of pre-stored virtual resources of the target node, the node state of the target node is updated.

[0217] Since in one embodiment of step 320, the target node is determined based on the number of pre-stored virtual resources corresponding to each layer 2 network node according to the target node application request, therefore, when the number of pre-stored virtual resources corresponding to the target node is updated, the number of pre-stored virtual resources of the layer 2 network node currently serving as the target node may not be able to support it to continue serving as the target node. Therefore, after updating the number of pre-stored virtual resources corresponding to the target node, it is also necessary to determine whether the layer 2 network node can continue to serve as the target node based on the updated number of pre-stored virtual resources. If yes, the node status remains 1, and if not, the node status needs to be updated to 0.

[0218] In one embodiment, updating the node state of the target node based on the updated number of pre-stored virtual resources of the target node includes:

[0219] Obtain the number of pre-stored virtual resources corresponding to multiple layer 2 network nodes including the target node;

[0220] Determine candidate target nodes based on the number of pre-stored virtual resources of multiple layer 2 network nodes;

[0221] If the candidate target node is different from the target node, the node state of the target node is updated to a non-target node, and the node state of the candidate target node is updated to the target node.

[0222] In this embodiment, the current pre-stored virtual resource quantities of multiple layer 2 network nodes are obtained, and candidate target nodes are determined based on the current pre-stored virtual resource quantities. The process of determining the candidate target nodes is the same as the process of determining the target node among multiple layer 2 network nodes based on the pre-stored virtual resource quantity corresponding to each layer 2 network node in the aforementioned embodiment, and will not be repeated here.

[0223] Determine whether the candidate target node is the same as the current target node. If they are different, update the node state of the current target node to a non-target node, which may be to change the corresponding parameter to 0, and update the node state of the candidate target node to the target node, which may be to change the corresponding parameter to 1. The specific process is as follows: Figure 6 As shown, the initial pre-stored virtual resource quantities of the second-layer network node A-the second-layer network node D are 100, 150, 120, and 80, respectively. The second-layer network node B is selected as the target node, and the node state of the second-layer network node B is updated to 1 as the target node; after the verification of the second-layer network node B fails, the pre-stored virtual resource quantity becomes 110; at this time, the second-layer network node C is determined as the candidate target node from the second-layer network node A-the second-layer network node B, and the candidate target node is different from the original target node, so the node state of the second-layer network node B is updated to 0, and the node state of the second-layer network node C is updated to 1.

[0224] The advantage of this embodiment is that the target node is updated based on the pre-stored virtual resource quantities of multiple layer 2 network nodes, and the currently most preferred one is used as the new target node, thereby improving the security of layer 2 blockchain network transaction processing.

[0225] The advantage of updating the node status of the target node is that it determines whether the current number of pre-stored virtual resources of the target node can support it to continue to serve as the target node, so as to adjust the target node in time, avoid the centralization problem caused by a single second-layer network node, and improve the security of transaction processing.

[0226] The above steps 310-350 are a process of applying the embodiment of the present disclosure to a layer 1 network. The embodiment of the present disclosure can also be applied to a layer 2 network, such as Figure 7 As shown, a flowchart of the blockchain transaction processing method provided by the present disclosure is applied to a second-layer network in a blockchain network, wherein the second-layer network includes multiple second-layer network nodes. The blockchain transaction processing method may include:

[0227] Step 710: Multiple layer 2 network nodes send target node application requests to the layer 1 network, so that the layer 1 network determines the target node from the multiple layer 2 network nodes.

[0228] Step 720: The target node generates layer 2 network status information based on the target transaction information to be stored, and generates a transaction storage request based on the target transaction information and the layer 2 network status information.

[0229] Step 730: Send the transaction storage request to the first-layer network so that the first-layer network verifies the second-layer network status information based on the target transaction information, obtains the verification result, and updates the status information of the target node based on the verification result.

[0230] Steps 710-730 are a process in which the blockchain transaction processing method provided by the present disclosure is applied to the second-layer network side of the second-layer blockchain network, the specific details of which have been described in detail in the aforementioned steps 310-350 and will not be repeated here.

[0231] The embodiments of the present disclosure are described in detail in combination with specific application scenarios.

[0232] like Figure 8 As shown, it is another flowchart of the blockchain transaction processing method provided by the present disclosure. In the embodiment of the present disclosure, the blockchain transaction processing method provided by the present disclosure is introduced in detail in the interaction mode between the first layer network and the second layer network in the two-layer blockchain network. The method specifically includes the following steps:

[0233] Step 801: Multiple layer 2 network nodes in a layer 2 network send target node application requests to a layer 1 network.

[0234] The target node application request sent by the second-layer network node to the first-layer network is shown in Formula 4:

[0235] STAKE i = <Addr i ,Value i > (Formula 4)

[0236] In formula 4, STAKE i Indicates the target node application request issued by the i-th layer 2 network node in the layer 2 network, Addr i Indicates the node address of the layer 2 network node, Value i Indicates the number of pre-stored virtual resources of the Layer 2 network node.

[0237] Step 802: The first layer network determines a target node from multiple second layer network nodes based on multiple target node application requests.

[0238] The first-layer network determines the target node from multiple second-layer network nodes based on the number of pre-stored virtual resources in the target node application request of each second-layer network node within a first-layer network storage cycle. The second-layer network node with the largest number of pre-stored virtual resources within a first-layer network storage cycle can be determined as the target node, which is specifically expressed as Formula 5:

[0239] Addr Selected =Addr i ,MAX(STAKE i .Value i ) (Formula 5)

[0240] In formula 5, Addr SelectedThe meaning of Formula 5 is to use the node address of the layer 2 network node with the largest number of pre-stored virtual resources in the target node application request as the target node address, that is, to use this layer 2 network node as the target node.

[0241] Step 803: The target node executes transactions within a period of time every one layer of network storage cycle and obtains a state transition result.

[0242] The process of the target node obtaining the state transition result according to the transaction is shown in Formula 1 and will not be repeated here.

[0243] Step 804: The target node sends the state conversion result, the transaction and the target node address to the first layer network.

[0244] Step 805: The second-layer network contract in the first-layer network registers the state transition result, transaction and target node address sent by the target node, and generates a transaction package to be verified. The DUMPS() function can be used to generate the transaction package to be verified, which can be specifically expressed as Formula 6:

[0245] PACK i =DUMPS( <STATE i ,TXs,Addr Selected >) (Formula 6)

[0246] In formula 6, PACK i For the transaction package to be verified, use the DUMPS() function to convert the state transition result (STATE i ), the transactions (TXs) that occurred during the layer 1 network storage cycle and the target node address (Addr Selected ) is serialized to obtain the transaction package to be verified. After the transaction package to be verified is generated, it needs to be signed with the node private key of the target node to ensure security.

[0247] Step 806: Multiple first-layer network nodes in the first-layer network read the transaction package to be verified in the second-layer network contract.

[0248] A layer of network nodes in a layer of network can be set through a protocol or derived based on other election mechanisms, and is responsible for verifying the status of the target node.

[0249] Step 807: A network node of a layer 1 obtains the state transition result, transaction and target node address sent by the target node based on the transaction packet to be verified.

[0250] For each layer of network nodes, after obtaining the transaction package to be verified, the private key of the target node is used to verify the signature of the transaction package to be verified; after the signature verification is successful, the deserialization function, such as LOADS(), is used to obtain the state transition result, transaction and target node address sent by the target node, which can be specifically expressed as Formula 7:

[0251] STATE i ,TXs,Addr Selected =LOADS(PACK i ) (Formula 7)

[0252] Formula 7 is the inverse process of Formula 6.

[0253] Step 808: A first-layer network node performs state conversion locally based on the transaction to obtain a first-layer network node state conversion result.

[0254] The first-layer network node performs state transition locally based on the transaction TXs that occurs within the first-layer network storage cycle, and obtains the state transformation result of the first-layer network node, which can be specifically expressed as Formula 2.

[0255] Step 809: compare the state transition result of the first layer network node with the state transition result of the target node. If they are consistent, the verification is successful. If they are inconsistent, execute step 810.

[0256] That is, using the STATE of the target node i LocalState of a layer of network nodes i Compare to determine whether they are consistent.

[0257] Step 810: A first-layer network node is connected to another first-layer network node to obtain the state conversion result of the other first-layer network node.

[0258] If the target node's STATE i LocalState of a layer of network nodes i If they are inconsistent, you need to connect to another layer of network nodes and obtain the LocalState of another layer of network nodes. i .

[0259] If you cannot obtain the LocalState of another layer of network nodes i Or other network nodes fail to obtain LocalState i , then its own LocalState i Broadcasting.

[0260] Step 811: If the state conversion result of at least one layer of network nodes is the same as the state conversion result obtained by itself, execute step 812.

[0261] Step 812: Encrypt the state conversion result using the node public key and the node private key, generate a verification processing request, and send it to the verification contract. The encryption process can use the node public key to perform a layer of encryption on the state conversion result, and then use the node private key to sign the first layer of encryption result to form a second layer of encryption. The specific process is shown in Formula 3, which will not be repeated here.

[0262] Step 813: Use the public key and signature to verify the verification processing request, and obtain state conversion results corresponding to multiple first-layer network nodes.

[0263] Step 814: Count the verification processing requests received in the first-layer network storage cycle to determine whether there are multiple identical state transition results whose number exceeds the verification threshold. If so, execute step 815.

[0264] The verification contract will be from the LocalState of the verification processing request from the different layer network nodes i Perform statistics on the LocalState corresponding to different layers of network nodes i May be the same, the same LocalState i Count them together to determine whether there is a LocalState i The number of is greater than or equal to the verification threshold, as shown in Formula 8:

[0265] COUNT(LocalState i )≥N (Formula 8)

[0266] In formula 8, N represents the verification threshold. If there are LocalStates with a number greater than or equal to the verification threshold i , execute step 815. If the target node disagrees with the verification result, it can question the first-layer network node in the second-layer network contract, and other first-layer network nodes will verify that the state transition result is a LocalState with a number greater than or equal to the verification threshold. i The first layer of network nodes votes to determine whether the verification result is correct.

[0267] Step 815: Reduce the number of pre-stored virtual resources corresponding to the target node according to a predetermined ratio.

[0268] Once there are LocalStates with a number greater than or equal to the validation threshold i , according to the ratio set by the protocol, the number of pre-stored virtual resources of the target node is reduced and transferred to a layer of network nodes, which can be specifically expressed as formula 9:

[0269] NewValue i = Valuei *k,0≤k<1 (Formula 9)

[0270] In formula 9, NewValue i is the pre-stored virtual resources after deducting the predetermined ratio, and k is the virtual resource reservation coefficient. For example, if the original number of pre-stored virtual resources is 100 and the reservation coefficient k is 0.8, then the number of pre-stored virtual resources remaining in the target node is 100*0.8=80. At this time, the state of the target node changes from formula 4 to formula 10:

[0271] STAKE i = <Addr i ,NewValue i >(Formula 10)

[0272] Step 816: Re-determine the target node based on the current number of pre-stored virtual resources.

[0273] When the state of the target node changes, it is necessary to re-determine the target node from multiple Layer 2 network nodes. The process of determining the target node is shown in Formula 11:

[0274] Addr re =Addr i ,MAX(STAKE i .Value i )(Formula 11)

[0275] In formula 11, Addr re The node address of the Layer 2 network node determined based on the current number of pre-stored virtual resources. If Addr re Not equal to Addr selected , then reset the network storage cycle, revoke the transaction execution permission of the current target node, and change the node address to Addr re The second-layer network node of is taken as the target node.

[0276] The interaction relationship between the nodes in the embodiment of the present disclosure is as follows: Figure 9A-9B As shown, Fig.9A The interactive relationship between the first-layer network nodes, the second-layer network nodes, the second-layer network contracts and the verification contracts mainly includes:

[0277] Step 911: The layer 2 network node sends a target node application request to the layer 2 network contract;

[0278] Step 912: The target node in the layer 2 network node performs transaction processing;

[0279] Step 913: The target node sends the transaction processing result to the Layer 2 network contract;

[0280] Step 914: The first-layer network node performs a verification process on the target node based on the transaction processing result in the second-layer network contract;

[0281] Step 915: A first-layer network node sends a verification processing request to the verification contract;

[0282] Step 916: The verification contract redefines the target node in the layer 2 network node based on the verification processing request.

[0283] Fig. 9B for Fig.9A Detailed interaction diagram of step 914 and step 915 in the first layer network. The first layer network includes a first layer network node A, a first layer network node B and a first layer network node C. Each first layer network node obtains the transaction processing result in the second layer network contract, and generates corresponding verification status information A, verification status information B and verification status information C based on the transaction processing result; the first layer network nodes can communicate with each other, and determine whether to send a verification processing request to the verification contract based on the result of mutual communication; each layer network node can use its own node private key to sign the verification status information, and send the verification processing request to the verification contract after signing.

[0284] Through the above steps 801-816, the disclosed embodiment realizes the management of the second-layer network nodes, avoiding the problem of low security of the second-layer blockchain network transaction processing caused by the centralization of the second-layer network nodes. At the same time, the disclosed embodiment can promote the first-layer network nodes to actively verify the target nodes, thereby improving the verification efficiency and accuracy of the first-layer network nodes for the target nodes.

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

[0286] It is to be understood that, although the steps in the above-mentioned flowcharts are sequentially displayed according to the characterization of arrows, these steps are not necessarily executed in sequence according to the order of arrow characterization. Unless there is a clear description in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the above-mentioned flowcharts can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.

[0287] It should be noted that in each specific embodiment of the present disclosure, 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 these data will comply with the relevant laws, regulations and standards of the relevant region. In addition, when the embodiment of the present application needs to obtain the attribute information of the target object, the separate permission or separate consent of the target object will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the separate permission or separate consent of the target object, the necessary target object-related data used to enable the normal operation of the embodiment of the present application will be obtained.

[0288] Fig.10 A schematic diagram of the structure of a blockchain transaction processing device 1000 provided in an embodiment of the present disclosure. The blockchain transaction processing device 1000 includes:

[0289] The first receiving unit 1010 is used to receive target node application requests sent by multiple layer 2 network nodes, where the layer 2 network nodes are nodes in the layer 2 network in the blockchain network, and are used to execute transactions received by the layer 2 network. The blockchain network includes a layer 1 network for storing transaction information and a layer 2 network for executing transactions.

[0290] A determination unit 1020, configured to determine a target node from among a plurality of layer 2 network nodes according to a target node application request;

[0291] The second receiving unit 1030 is configured to receive a transaction storage request sent by a target node, where the transaction storage request includes target transaction information to be stored and layer 2 network status information;

[0292] The verification unit 1040 is used to verify the layer 2 network state information based on the target transaction information to obtain a verification result;

[0293] The updating unit 1050 is used to update the state information of the target node according to the verification result.

[0294] Optionally, in some embodiments, the target node application request includes the number of pre-stored virtual resources of the layer 2 network node;

[0295] The determining unit 1020 is specifically configured to:

[0296] Obtaining the amount of pre-stored virtual resources from the target node application request of each layer 2 network node;

[0297] Based on the number of pre-stored virtual resources corresponding to each layer-2 network node, a target node is determined among the multiple layer-2 network nodes.

[0298] Optionally, in some embodiments, the determining unit 1020 is specifically configured to:

[0299] Obtaining the total number of pre-stored virtual resources corresponding to each layer 2 network node within a transaction storage period, where the transaction storage period is a time period for storing transaction information in a layer 1 network;

[0300] The second-layer network node with the largest total number is determined as the target node in the transaction storage cycle.

[0301] Optionally, in some embodiments, the layer 2 network state information is generated by the target node through a first transaction processing process based on the target transaction information;

[0302] The verification unit 1040 is specifically used for:

[0303] Based on the target transaction information, first verification status information is obtained through a second transaction processing process, where the first transaction processing process is the same as the second transaction processing process;

[0304] The first verification status information is compared with the second layer network status information to obtain a verification result.

[0305] Optionally, in some embodiments, the first-layer network includes a plurality of first-layer network nodes, and the first-layer network nodes are used to verify the second-layer network state information based on the target transaction information;

[0306] The verification unit 1040 is specifically used for:

[0307] If the first verification status information is inconsistent with the layer 2 network status information, obtaining second verification status information generated by a plurality of layer 1 network nodes based on the target transaction information;

[0308] A verification result is obtained based on the first verification status information and the second verification status information.

[0309] Optionally, in some embodiments, the updating unit 1050 is specifically configured to:

[0310] Obtain verification results corresponding to multiple first-layer network nodes;

[0311] Based on the multiple verification results, the status information of the target node is updated.

[0312] Optionally, in some embodiments, the updating unit 1050 is specifically configured to:

[0313] If the verification result is a verification failure, generating a verification processing request corresponding to a layer of network nodes, the verification processing request including first verification status information;

[0314] If the number of identical first verification status information in multiple verification processing requests is greater than or equal to the verification threshold, the overall verification result is verification failure, and the status information of the target node is updated based on the overall verification result.

[0315] Optionally, in some embodiments, the state information includes the number of pre-stored virtual resources corresponding to the layer 2 network node;

[0316] The updating unit 1050 is specifically used for:

[0317] If the verification result is a verification failure, the number of pre-stored virtual resources corresponding to the target node is updated.

[0318] The updating unit 1050 is specifically used for:

[0319] Reduce the number of pre-stored virtual resources corresponding to the target node according to a predetermined ratio;

[0320] The amount of pre-stored virtual resources that are reduced by the storage target node.

[0321] Optionally, in some embodiments, the state information further includes a node state of the layer 2 network node, the node state indicating whether the layer 2 network node is a target node;

[0322] The updating unit 1050 is specifically used for:

[0323] Based on the updated number of pre-stored virtual resources of the target node, the node state of the target node is updated.

[0324] Optionally, in some embodiments, the updating unit 1050 is specifically configured to:

[0325] Obtain the number of pre-stored virtual resources corresponding to multiple layer 2 network nodes including the target node;

[0326] Determine candidate target nodes based on the number of pre-stored virtual resources of multiple layer 2 network nodes;

[0327] If the candidate target node is different from the target node, the node state of the target node is updated to a non-target node, and the node state of the candidate target node is updated to the target node.

[0328] Reference Fig.11 , Fig.11 The structural block diagram of the terminal 130 for implementing the blockchain transaction processing method of the embodiment of the present disclosure is as follows: the terminal 130 includes: a radio frequency (RF) circuit 1110, a memory 1115, an input unit 1130, a display unit 1140, a sensor 1150, an audio circuit 1160, a wireless fidelity (WiFi) module 1170, a processor 1180, and a power supply 1190. Those skilled in the art can understand that Fig.11The structure of the terminal 130 shown does not constitute a limitation on a mobile phone or a computer, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0329] The RF circuit 1110 may be used for receiving and sending signals during information transmission or communication. In particular, after receiving downlink information from the base station, the information is sent to the processor 1180 for processing. In addition, the uplink data is sent to the base station.

[0330] The memory 1115 may be used to store software programs and modules. The processor 1180 executes various functional applications of the terminal and identifies lane change points by running the software programs and modules stored in the memory 1115 .

[0331] The input unit 1130 may be used to receive input digital or character information and generate key signal input related to the terminal's settings and function control. Specifically, the input unit 1130 may include a touch panel 1131 and other input devices 1132 .

[0332] The display unit 1140 may be used to display input information or provided information and various menus of the terminal. The display unit 1140 may include a display panel 1141 .

[0333] The audio circuit 1160 , the speaker 1161 , and the microphone 1162 may provide an audio interface.

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

[0335] The terminal 130 of the embodiment of the present disclosure includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiment of the present invention can be applied to various scenarios, including but not limited to blockchain, virtual digital resources, security technology, etc.

[0336] Fig.12A block diagram of the structure of a portion of a server for implementing the blockchain transaction processing method of an embodiment of the present disclosure. The server may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 1222 (e.g., one or more processors) and storage devices 1232, and one or more storage media 1230 (e.g., one or more massive storage devices) storing application programs 1242 or data 1244. Among them, the storage device 1232 and the storage medium 1230 may be short-term storage or persistent storage. The program stored in the storage medium 1230 may include one or more modules (not shown in the figure), each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 1222 may be configured to communicate with the storage medium 1230 and execute a series of instruction operations in the storage medium 1230 on the server.

[0337] The server may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input and output interfaces 1258, and / or one or more operating systems 1241, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

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

[0339] The disclosed embodiments also provide a 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.

[0340] 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, so that the computer device executes and implements the above-mentioned blockchain transaction processing method.

[0341] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order 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, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0342] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means 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 objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single 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.

[0343] 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 not include the number, and above, below, within, etc. are understood to include the number.

[0344] 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 only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, 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.

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

[0346] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0347] 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 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. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform 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 (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0348] 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.

[0349] 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. Technical personnel familiar with the art can also 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, characterized in that: The method comprises: Receiving target node application requests sent by multiple layer 2 network nodes, wherein the layer 2 network nodes are nodes in a layer 2 network in a blockchain network, wherein the blockchain network includes a layer 1 network for storing transaction information and a layer 2 network for executing transactions; Determine a target node among the plurality of the second-layer network nodes according to the target node application request, the target node being a node that uploads transaction data in the second-layer network to the first-layer network for storage; Receiving a transaction storage request sent by the target node, wherein the transaction storage request includes target transaction information to be stored and layer 2 network status information; Verifying the layer 2 network status information based on the target transaction information to obtain a verification result; The status information of the target node is updated according to the verification result.

2. The method according to claim 1, characterized in that The step of determining a target node from among the plurality of layer 2 network nodes according to the target node application request comprises: Acquire the number of pre-stored virtual resources from the target node application request of each of the layer 2 network nodes; Based on the number of pre-stored virtual resources corresponding to each of the layer-2 network nodes, a target node is determined among the plurality of layer-2 network nodes.

3. The method according to claim 2, characterized in that The determining a target node among the plurality of layer-2 network nodes based on the number of pre-stored virtual resources corresponding to each layer-2 network node comprises: Obtaining the total number of pre-stored virtual resources corresponding to each of the second-layer network nodes within a transaction storage period, wherein the transaction storage period is a time period during which the first-layer network stores transaction information; The layer-2 network node with the largest total number is determined as the target node in the transaction storage cycle.

4. The method according to claim 1, characterized in that: The layer 2 network state information is generated by the target node through a first transaction processing process based on the target transaction information; The verifying the layer 2 network status information based on the target transaction information to obtain a verification result includes: Based on the target transaction information, obtaining first verification status information through a second transaction processing process, wherein the first transaction processing process is the same as the second transaction processing process; The first verification status information is compared with the layer 2 network status information to obtain a verification result.

5. The method according to claim 4, characterized in that The first layer network includes a plurality of first layer network nodes, and the first layer network nodes are used to verify the second layer network state information based on the target transaction information; The comparing the first verification status information with the layer 2 network status information to obtain a verification result includes: If the first verification status information is inconsistent with the second layer network status information, obtaining second verification status information generated by a plurality of the first layer network nodes based on the target transaction information; A verification result is obtained based on the first verification status information and the second verification status information.

6. The method according to claim 5, characterized in that The updating of the state information of the target node according to the verification result includes: Obtain verification results corresponding to the plurality of first-layer network nodes; Based on the multiple verification results, the status information of the target node is updated.

7. The method according to claim 6, characterized in that The updating of the state information of the target node based on the multiple verification results includes: If the verification result is a verification failure, generating a verification processing request corresponding to the first-layer network node, wherein the verification processing request includes the first verification status information; If the number of identical first verification status information in multiple verification processing requests is greater than or equal to a verification threshold, the overall verification result is verification failure, and based on the overall verification result, the status information of the target node is updated.

8. The method according to claim 1, characterized in that The state information includes the number of pre-stored virtual resources corresponding to the layer 2 network node; The updating of the state information of the target node according to the verification result includes: If the verification result is a verification failure, the number of pre-stored virtual resources corresponding to the target node is updated.

9. The method according to claim 8, characterized in that If the verification result is a verification failure, updating the number of pre-stored virtual resources corresponding to the target node includes: Reducing the number of pre-stored virtual resources corresponding to the target node according to a predetermined ratio; The reduced amount of the pre-stored virtual resources of the target node is stored.

10. The method according to claim 8, characterized in that The state information further includes a node state of the layer 2 network node, wherein the node state indicates whether the layer 2 network node is a target node; If the verification result is a verification failure, after updating the number of pre-stored virtual resources corresponding to the target node, the method further includes: Based on the updated number of pre-stored virtual resources of the target node, the node state of the target node is updated.

11. The method according to claim 10, characterized in that: The updating the node state of the target node based on the updated pre-stored virtual resource quantity of the target node includes: Acquire the number of pre-stored virtual resources corresponding to a plurality of the layer-2 network nodes including the target node; Determining a candidate target node based on the pre-stored virtual resource quantities of the plurality of layer-2 network nodes; If the candidate target node is different from the target node, the node state of the target node is updated to a non-target node, and the node state of the candidate target node is updated to a target node.

12. A blockchain transaction processing device, characterized in that: include: A first receiving unit is used to receive target node application requests sent by multiple layer 2 network nodes, where the layer 2 network nodes are nodes in a layer 2 network in a blockchain network, and the blockchain network includes a layer 1 network for storing transaction information and a layer 2 network for executing transactions; a determining unit, configured to determine a target node from among the plurality of layer 2 network nodes according to the target node application request, the target node being a node that uploads transaction data in the layer 2 network to the layer 1 network for storage; A second receiving unit, configured to receive a transaction storage request sent by the target node, wherein the transaction storage request includes target transaction information to be stored and layer 2 network status information; A verification unit, configured to verify the layer 2 network state information based on the target transaction information to obtain a verification result; An updating unit is used to update the status information of the target node according to the verification result.

13. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the blockchain transaction processing method according to any one of claims 1 to 11 is implemented.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the blockchain transaction processing method according to any one of claims 1 to 11 is implemented.

15. 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 11.