A data interaction method, device and storage medium
By receiving transaction requests, obtaining ledger information and determining asset status in the blockchain, the problem of poor reliability of node interaction events in the blockchain is solved, the rationality and legality of asset transfer are realized, and the application reliability of blockchain is improved.
Patent Information
- Application Number
- CN202111170408.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-08
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-10-08
AI Technical Summary
The poor reliability of node interaction events in the blockchain leads to errors in transferring asset data or privacy data.
By receiving the transaction request sent by the first node, obtaining its ledger information, determining the asset status, and generating a transaction license response when the asset status is tradable, ensuring the reasonable and legal transmission of transaction information between different sub-chains.
It improves the reliability of node interaction events in the blockchain, ensures the rationality and legality of asset transfers, and complies with the national regulatory mechanism.
Smart Images

Figure CN114049105B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a data interaction method, device and storage medium. Background Art
[0002] Blockchain technology is a new application model based on computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. It has been applied in many fields including finance, medical care, justice, education, supply chain, and electricity. However, with the popularization of applications, the disadvantages of blockchain in terms of privacy, scalability, and management have gradually emerged.
[0003] In the prior art, when data is exchanged between nodes in a blockchain, it is generally broadcast directly in the blockchain so that the corresponding nodes receive the information. However, the content of the information or the rationality or legality of the executable event of the interaction is not monitored, which may easily cause errors in the transfer of some user asset data or other private data. Summary of the invention
[0004] The present invention aims to solve the technical problem of poor reliability in the execution of node interaction events in the blockchain.
[0005] In order to solve the above technical problems, the present application discloses a data interaction method, which comprises the following steps:
[0006] Receive a transaction request sent by a first node, the transaction request carrying transaction information; the first node belongs to the first subchain;
[0007] Acquire the account book information of the first node according to the transaction information;
[0008] Determining the asset status of the first node according to the ledger information and the transaction information;
[0009] If the asset status is tradable, a first transaction permission response is generated;
[0010] The first transaction permission response is sent to the first node, the first transaction permission response is used to instruct the first node to send the first transaction permission information in the first transaction permission response to the second node, and the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; the second node belongs to the second subchain, the first subchain and the second subchain are located in the blockchain, and the first subchain and the second subchain have different consensus mechanisms.
[0011] Optionally, the transaction information includes a first node identifier and information about assets to be transferred; the information about assets to be transferred includes an amount to be transferred and transfer direction information; the transfer direction information includes direction information from the first node to the second node;
[0012] The ledger information includes transferable amounts;
[0013] The method further comprises: obtaining the account book information of the first node according to the transaction information; determining the asset status of the first node according to the account book information and the transaction information, and generating a first transaction permission response if the asset status is tradable, including:
[0014] Acquire the transferable amount according to the first node identifier;
[0015] Determine the status of the asset according to the transferable amount and the amount to be transferred;
[0016] If the asset status is tradable, the first transaction permission response is generated.
[0017] Optionally, the first subchain further includes a third node;
[0018] The first transaction permission response is used to instruct the first node to send first transaction permission information in the first transaction permission response to the second node, and the first transaction permission information is used to instruct the second node to obtain the to-be-transferred assets of the first node, including:
[0019] The target transaction permission response is used to instruct the first node to send the target transaction permission information to the second node, and the target transaction permission information is used to instruct the second node to obtain the transfer of the assets to be transferred of the first node; the target transaction permission response is determined based on the first transaction permission response and the second transaction permission response; the second transaction permission response is sent by the third node to the first node; the second transaction permission response carries the second transaction permission information; the target transaction permission information is determined based on the first transaction permission information and the second transaction permission information.
[0020] In another aspect, the present application also discloses a data interaction method, which comprises the following steps:
[0021] Generate a transaction request; the transaction request carries transaction information;
[0022] Send the transaction request to the audit node;
[0023] If a first transaction permission response from the audit node is received, the first transaction permission information in the first transaction permission response is sent to the second node; the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; the first node belongs to a first subchain, the second node belongs to a second subchain, the first subchain and the second subchain are located in the blockchain, and the first subchain and the second subchain have different consensus mechanisms.
[0024] Optionally, after sending the transaction request to the audit node, the method further includes:
[0025] Sending the transaction request to a third node, where the third node belongs to the first subchain;
[0026] If the first transaction permission response of the audit node is received, after sending the first transaction permission information in the first transaction permission response to the second node, the method further includes:
[0027] receiving a second transaction permission response sent by the third node; the second transaction permission response carries second transaction permission information;
[0028] generating target transaction permission information based on the first transaction permission information and the second transaction permission information;
[0029] sending the target transaction permission information to the second node;
[0030] The first transaction permission information is used to instruct the second node to obtain the to-be-transferred assets of the first node, including:
[0031] The target transaction permission information is used to instruct the second node to obtain the to-be-transferred assets of the first node.
[0032] Optionally, if the first transaction permission information of the audit node is received, after sending the first transaction permission information to the second node, the method further includes:
[0033] If the transfer success feedback information sent by the second node is received within the preset time, a transaction completion response is generated;
[0034] The transaction completion response is sent to the audit node; the transaction completion response carries transaction completion information, and the transaction completion information is used to instruct the audit node to update the account book information of the first node.
[0035] Optionally, before generating the transaction request, the following steps are also included:
[0036] Generate a chain building request, which carries the first node identifier, the third node identifier, the consensus type, and the supervisory node identifier;
[0037] Sending the chain building request to the supervisory node;
[0038] If the first chain-to-be-built permission information of the supervisory node is received, a first chain-building response is generated; the first chain-building response carries the first chain-building information, and the first chain-building information includes the first node signature and the permission information of the first chain-to-be-built; the permission information of the chain-to-be-built includes the supervisory node signature, the subchain name, the consensus type, the first node identifier, the third node identifier and the permission information; the permission information is determined based on the first node identifier, the third node identifier and the preset node list; the preset node list includes the node identifiers registered with the supervisor node;
[0039] If the second chain building information of the third node is received, a second chain to be built permission response is generated; the second chain to be built permission response carries the second chain to be built permission information, and the second chain building information includes the third node signature and the first chain to be built permission information;
[0040] Generate third chain building information based on the first chain building information and the second to-be-built chain permission information;
[0041] The third chain construction information is sent to the supervisory node; the third chain construction information is used to instruct the supervisor node to build the first subchain; the first subchain includes the first node and the third node.
[0042] The present application further discloses a data interaction device, which comprises:
[0043] A receiving module, configured to receive a transaction request sent by a first node, the transaction request carrying transaction information; the first node belongs to a first subchain;
[0044] An acquisition module, used to acquire the account book information of the first node according to the transaction information;
[0045] A determination module, configured to determine the asset status of the first node according to the ledger information and the transaction information;
[0046] A judgment module, configured to generate a first transaction permission response if the asset status is tradable;
[0047] A sending module is used to send the first transaction permission response to the first node, the first transaction permission response is used to instruct the first node to send the first transaction permission information in the first transaction permission response to the second node, and the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; the second node belongs to a second subchain, the first subchain and the second subchain are located in the blockchain, and the first subchain and the second subchain have different consensus mechanisms.
[0048] The present application further discloses a data interaction device, which comprises:
[0049] A generating module, used for generating a transaction request; the transaction request carries transaction information;
[0050] A sending module, used to send the transaction request to the audit node;
[0051] A judgment module is configured to send the first transaction permission information in the first transaction permission response to the second node if a first transaction permission response from the audit node is received; the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; the first node belongs to a first subchain, the second node belongs to a second subchain, the first subchain and the second subchain are located in a blockchain, and the first subchain and the second subchain have different consensus mechanisms.
[0052] On the other hand, the present application further discloses a computer storage medium, in which at least one instruction or at least one program is stored. The at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned data interaction method.
[0053] By adopting the above technical solution, the data interaction method provided by this application has the following beneficial effects:
[0054] Receive a transaction request sent by a first node, the transaction request carries transaction information; the first node belongs to the first subchain; obtain the account book information of the first node according to the transaction information; determine the asset status of the first node according to the account book information and the transaction information; if the asset status is tradable, generate a first transaction permission response; send the first transaction permission response to the first node, the first transaction permission response is used to instruct the first node to send the first transaction permission information in the first transaction permission response to the second node, the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; the second node belongs to the second subchain, the first subchain and the second subchain are located in the blockchain, and the first subchain and the second subchain have different consensus mechanisms. The audit node can review the interaction between nodes on subchains with different consensus mechanisms, which can not only expand the subchain and increase the application demand of the blockchain, but also effectively ensure the rationality and legality of the interaction, so that the transaction can be carried out in an orderly manner and comply with the national regulatory mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0056] Figure 1 A schematic diagram of an application environment of a data interaction method provided in this application;
[0057] Figure 2 It is a flowchart of a first optional data interaction method provided in an embodiment of the present application;
[0058] Figure 3 A schematic diagram of an optional ledger information for this application;
[0059] Figure 4 It is a flowchart of a second optional data interaction method provided in an embodiment of the present application;
[0060] Figure 5 It is a flowchart of a third optional data interaction method provided in an embodiment of the present application;
[0061] Figure 6 This is a schematic diagram of the structure of an optional data interaction device for this application;
[0062] Figure 7 This is a schematic diagram of the structure of another optional data interaction device of the present application;
[0063] Figure 8 A hardware structure block diagram of a server of a data interaction method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0065] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0066] 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 network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer and application service layer. Blockchain includes a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. The block records the record data submitted by the nodes in the blockchain system.
[0067] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and the maintenance of the correspondence between the user's real identity and the blockchain address (authority management), etc., and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first adapts the interface for parsing and authentication (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, monitoring network status, monitoring node equipment health status, etc. The platform product service layer provides the basic capabilities and implementation framework of typical applications. Developers can implement the business logic on the blockchain based on these basic capabilities and superimpose the characteristics of the business. The application service layer provides application services based on the blockchain solution for business participants to use.
[0068] See also Figure 1 , Figure 1A schematic diagram of the application environment of a data interaction method provided in this application. The data interaction system includes a first subchain 10, a second subchain 20 and a monitoring blockchain 30; the monitoring blockchain 30 includes an audit node 301, and the audit node 301 can use a subscription method to perform corresponding audits and monitoring on events on the first subchain 10 and the second subchain 20; the audit node 301 is used to receive a transaction request sent by the first node 101, and the transaction request carries transaction information; the first node 101 belongs to the first subchain 10; the account book information of the first node 101 is obtained according to the transaction information; the asset status of the first node 101 is determined according to the account book information and the transaction information; If the asset status is tradable, a first transaction permission response is generated; the first transaction permission response is sent to the first node 101, the first transaction permission response is used to instruct the first node 101 to send the first transaction permission information in the first transaction permission response to the second node 201, the first transaction permission information is used to instruct the second node 201 to obtain the assets to be transferred of the first node 101; the second node 201 belongs to the second subchain 20, the first subchain 10 and the second subchain 20 are located in the blockchain, and the first subchain 10 and the second subchain 20 have different consensus mechanisms. Thereby, the data interaction system based on the present application can improve the reliability of asset transfer, and can realize the scenario of multi-chain collaboration and avoid the generation of information islands.
[0069] Optionally, in this embodiment, the above-mentioned nodes (such as the first node, the second node and the audit node, etc.) can be a server or a terminal device, or a system composed of a server and a terminal device, wherein the terminal device mentioned above can be an electronic device, including but not limited to a mobile phone, a tablet computer, a desktop computer, a laptop computer, a PDA, a wearable device (such as a smart watch, a smart bracelet, etc.), an augmented reality / virtual reality (AR / VR) device, a helmet display, a smart speaker, a digital camera, a camera and other mobile internet devices (mobile internet device, MID) with network access capability, etc. Among them, the server mentioned above can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms, etc.
[0070] Optionally, the client and server may be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0071] The following describes a data interaction method based on blockchain in this application. Figure 2 This is a flowchart of the first optional data interaction method provided in the embodiment of the present application. This specification provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the system or product is actually executed, it can be executed in the order of the method shown in the embodiment or the drawings, or in parallel (for example, in a parallel processor or multi-threaded processing environment). Specifically, Figure 2 As shown, the method may include:
[0072] S201: Receive a transaction request sent by a first node, where the transaction request carries transaction information; the first node belongs to a first subchain.
[0073] Optionally, in the embodiments of the present application, the audit node will be used as the execution subject for explanation.
[0074] In an optional implementation, the transaction information includes a first node identifier and information about assets to be transferred; the information about assets to be transferred includes an amount to be transferred and transfer direction information; the transfer direction information includes direction information from the first node to the second node.
[0075] Optionally, the first node identifier may be an ID name of the first node, or may be IP address information of the first node, so as to be used to identify that the transaction request is sent by the first node.
[0076] Optionally, the first node as mentioned above is a node in the first sub-chain in the blockchain, and the node can be a client user or a server user.
[0077] Optionally, the first subchain can be the blockchain of Bank A; the second subchain can be the blockchain of Bank B; and the monitoring blockchain where the audit node is located can be the blockchain used by the central bank to supervise Bank A and Bank B. Of course, it can also be a blockchain established by other institutions with regulatory authority to achieve supervision of Bank A and Bank B and ensure the orderly conduct of their business; in another optional implementation, the first subchain and the second subchain can also be subchains established by two business departments under Bank A, and the monitoring blockchain can also be a blockchain established by the monitoring department under Bank A; the above examples are only for better describing the beneficial effects of the present application, but in actual application scenarios, the method can also be applied to multiple fields such as medical care, justice, education, supply chain and electricity; this architecture can be not limited to the fund transfer described in this application, but can also be specific assets.
[0078] Optionally, the data interaction system may include not only the two sub-chains mentioned above, but also three, four or N sub-chains as required, where N is an integer greater than or equal to 4.
[0079] Optionally, the first node and the second node may represent one node or multiple nodes, which is not limited here.
[0080] S202: Acquire the account information of the first node according to the transaction information.
[0081] Optionally, the ledger information includes a transferable amount.
[0082] Optionally, step S202 may be specifically described as: obtaining the transferable amount according to the first node identifier.
[0083] Optionally, the ledger information may be stored in the memory of the device where the audit node is located, or may be stored on other servers, that is, when the audit node needs to obtain the ledger information of the node, it may be directly retrieved based on the node identifier.
[0084] Optionally, the ledger information can be in the form of a list, see the attached Figure 3 , Figure 3 This is a schematic diagram of an optional ledger information of the present application, the ledger information may include multiple transaction records and account balances of the first node; each transaction record includes the transaction initiation time, completion time and transfer amount; the transferable amount is the account balance minus the transfer amount of the unfinished transaction; for example, see Figure 3 , the transferable amount is equal to 150; optionally, each transaction record may also only include transaction information of completed transactions.
[0085] Optionally, the current account balance may be equal to the previous account balance minus the transfer amount completed in the current transaction.
[0086] In order to avoid the situation where the audit node receives two transaction requests from the first node and makes judgments at the same time, which may easily cause transaction duplication, the time for the audit node to judge the request can be limited. The audit node can obtain the ledger information of the transaction requests at a preset time interval.
[0087] Optionally, in order to further improve the validity of the transaction, when the first node generates a transaction request, the amount to be transferred of the first node may be frozen.
[0088] S203: Determine the asset status of the first node according to the account book information and the transaction information.
[0089] Optionally, step S203 can be specifically described as: determining the asset status according to the transferable amount and the amount to be transferred; for example, the transferable amount on the account book information of the first node is 200 yuan, and the amount to be transferred is 100 yuan. Since the transferable amount is greater than the amount to be transferred, the asset status is tradable. Optionally, when the transferable amount is equal to the amount to be transferred, the asset status can also be confirmed as tradable.
[0090] S204: If the asset status is tradable, a first transaction permission response is generated.
[0091] Optionally, step S204 may be specifically described as: if the asset status is tradable, generating the first transaction permission response.
[0092] S205: Sending the first transaction permission response to the first node, the first transaction permission response is used to instruct the first node to send the first transaction permission information in the first transaction permission response to the second node, and the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; the second node belongs to the second subchain, the first subchain and the second subchain are located in the blockchain, and the first subchain and the second subchain have different consensus mechanisms.
[0093] Optionally, the first transaction permission information includes the first node identifier, the second node identifier, the assets to be transferred and the above transfer direction information.
[0094] At present, the consensus algorithms of the consensus mechanism in the blockchain include proof of work (POW), proof of stake (POS), delegated proof of stake (DPOS) and hybrid proof mechanism.
[0095] In order to further ensure the reliability of the transaction, in an optional implementation, the first subchain further includes a third node; the first transaction permission response in the above step S205 is used to instruct the first node to send the first transaction permission information in the first transaction permission response to the second node, and the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node, which can be specifically described as follows:
[0096] The target transaction permission response is used to instruct the first node to send the target transaction permission information to the second node, and the target transaction permission information is used to instruct the second node to obtain the transfer of the assets to be transferred of the first node; the target transaction permission response is determined based on the first transaction permission response and the second transaction permission response; the second transaction permission response is sent by the third node to the first node; the second transaction permission response carries the second transaction permission information; the target transaction permission information is determined based on the first transaction permission information and the second transaction permission information.
[0097] That is to say, both the third node and the audit node will audit the account information of the first node. Based on the transaction information, the two can determine the asset status of the first node. If the asset status is a tradable state, a corresponding transaction permission response will be generated, and the transaction permission response carries the transaction permission information.
[0098] Optionally, in step S205, the method for the second node to obtain the assets to be transferred of the first node may include the following two methods. The first method may be that after the second node receives the above-mentioned first transaction permission information, it may generate an asset acquisition instruction and send the instruction to the first node, and the asset acquisition instruction is used to instruct the first node to transfer the funds to be transferred to the second node; the second method may be that after the second node receives the above-mentioned first transaction permission information, it may call a corresponding program, such as a smart contract, so that the program transfers the assets to be transferred to the second node.
[0099] The above is an explanation of the data interaction method with the audit node as the execution subject. The following will be explained with the first node as the execution subject in order to better reflect the beneficial effects of the present application.
[0100] See also Figure 4 , Figure 4 1 is a flow chart of a second optional data interaction method provided in an embodiment of the present application. The present application also discloses a data interaction method, which includes the following steps:
[0101] S401: Generate a transaction request; the transaction request carries transaction information.
[0102] Optionally, the transaction information includes a first node identifier and information about assets to be transferred; the information about assets to be transferred includes an amount to be transferred and transfer direction information; the transfer direction information includes direction information from the first node to the second node.
[0103] S402: Send the transaction request to the audit node.
[0104] S403: If a first transaction permission response from the audit node is received, the first transaction permission information in the first transaction permission response is sent to the second node; the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; the first node belongs to a first subchain, the second node belongs to a second subchain, the first subchain and the second subchain are located in the blockchain, and the first subchain and the second subchain have different consensus mechanisms.
[0105] In order to further improve the reliability of the transaction, in an optional implementation, after step S402, the method further includes: sending the transaction request to a third node, where the third node belongs to the first subchain.
[0106] After step S403, the method further includes: receiving a second transaction permission response sent by the third node; the second transaction permission response carries second transaction permission information; generating target transaction permission information based on the first transaction permission information and the first transaction permission information; sending the target transaction permission information to the second node; the first transaction permission information in step S403 is used to instruct the second node to obtain the assets to be transferred of the first node, which can be specifically explained as: the target transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node.
[0107] In order to ensure the validity and efficiency of the transaction; in an optional implementation, after step S403, the method further includes: if the transfer success feedback information sent by the second node is received within a preset time, a transaction completion response is generated; the transaction completion response is sent to the audit node; the transaction completion response carries transaction completion information, and the transaction completion information is used to instruct the audit node to update the account information of the first node.
[0108] See also Figure 5 , Figure 5 4 is a flow chart of a third optional data interaction method provided in an embodiment of the present application. In an optional implementation, before step S401, the method further includes:
[0109] S501: Generate a chain building request, which carries a first node identifier, a third node identifier, a consensus type, and a supervisory node identifier.
[0110] It should be noted that this embodiment is explained with the first node as the execution subject. In fact, when the first node generates a chain building request, the third node will also generate a chain building request. The chain building requests of these two nodes will be sent to each other and the supervision node to confirm the nodes to be chained.
[0111] Optionally, the third node may be one node or multiple nodes.
[0112] Optionally, the supervisor node identifier may be a supervisor node ID or an IP address.
[0113] S502: Send the chain building request to the supervisory node.
[0114] S503: If the first chain-to-be-built permission information of the supervisory node is received, a first chain-building response is generated; the first chain-building response carries the first chain-building information, and the first chain-building information includes the first node signature and the permission information of the first chain-to-be-built; the permission information of the chain-to-be-built includes the supervisory node signature, the subchain name, the consensus type, the first node identifier, the third node identifier and the permission information; the permission information is determined based on the first node identifier, the third node identifier and the preset node list; the preset node list includes the node identifiers registered with the supervisor node.
[0115] Optionally, the first node signature may be the ID of the first node or other identifier that can confirm its identity.
[0116] Optionally, the above-mentioned first node and third node can be pre-registered at the regulator node. Optionally, taking the first node as an example, the first node can register the following information at the regulator node: the first node identifier, the third node identifier and the consensus mechanism type; in another optional implementation, the first node can also register the following information at the regulator node: the first node identifier, the name of the sub-chain to be constructed, and the consensus mechanism type; when the first method is adopted, the name of the sub-chain to be formed by the first node and the third node can be determined by the regulator.
[0117] Optionally, the above permission information is compared by the regulator node based on the received chain building request information and the preset node list. If the information in the chain building request is consistent with the preset node list, the chain building request is considered to be compliant and will be signed and authenticated.
[0118] It should be noted that the signature information generated above and below can be a 32-bit or 64-bit random string, which can be verified based on public and private key cryptography to confirm the content of the signature information.
[0119] S504: If the second chain building information of the third node is received, a second chain to be built permission response is generated; the second chain to be built permission response carries the second chain to be built permission information, and the second chain building information includes the third node signature and the first chain to be built permission information.
[0120] S505: Generate third chain building information based on the first chain building information and the second to-be-built chain permission information.
[0121] S506: Send the third chain building information to the supervisory node; the third chain building information is used to instruct the supervisor node to build the first subchain; the first subchain includes the first node and the third node.
[0122] To sum up, the data interaction method of the present application can realize chain construction and cross-chain interaction based on audit nodes and regulator nodes, especially the interaction between sub-chains with different consensus mechanisms. The setting of the above-mentioned audit nodes and regulator nodes can effectively guarantee the access rights of node information and avoid the leakage of privacy information. The regulator node can also publish policies and update events through smart contracts to realize the supervision of sub-chains, which meets the current management needs; furthermore, since the data interaction method of the present application can enable interaction between different sub-chains, the sub-chains can be expanded infinitely as needed, the node data in a single chain can be reduced, and the impact of chain performance on scalability is reduced.
[0123] See also Figure 6 , Figure 6 The present application also discloses a data interaction device, which includes:
[0124] The receiving module 601 is used to receive a transaction request sent by a first node, where the transaction request carries transaction information; the first node belongs to a first subchain;
[0125] An acquisition module 602 is used to acquire the account book information of the first node according to the transaction information;
[0126] A determination module 603, configured to determine the asset status of the first node according to the account information and the transaction information;
[0127] The judgment module 604 is used to generate a first transaction permission response if the asset status is tradable;
[0128] A sending module 605 is used to send the first transaction permission response to the first node, the first transaction permission response is used to instruct the first node to send the first transaction permission information in the first transaction permission response to the second node, and the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; the second node belongs to a second subchain, the first subchain and the second subchain are located in the blockchain, and the first subchain and the second subchain have different consensus mechanisms.
[0129] In an optional implementation, the transaction information includes a first node identifier and information about assets to be transferred; the information about assets to be transferred includes an amount to be transferred and transfer direction information; the transfer direction information includes direction information from the first node to the second node; the account information includes the transferable amount;
[0130] The acquisition module is used to acquire the transferable amount according to the first node identifier;
[0131] A determination module, used for determining the asset status according to the transferable amount and the amount to be transferred;
[0132] The judgment module is used to generate the first transaction permission response if the asset status is tradable.
[0133] In an optional implementation, the first subchain further includes a third node;
[0134] The first transaction permission response is used to instruct the first node to send the first transaction permission information in the first transaction permission response to the second node, and the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node, including: a target transaction permission response is used to instruct the first node to send the target transaction permission information to the second node, and the target transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; the target transaction permission response is determined based on the first transaction permission response and the second transaction permission response; the second transaction permission response is sent by the third node to the first node; the second transaction permission response carries the second transaction permission information; the target transaction permission information is determined based on the first transaction permission information and the second transaction permission information.
[0135] See also Figure 7 , Figure 7 The present application also discloses a data interaction device, which includes:
[0136] The generating module 701 is used to generate a transaction request; the transaction request carries transaction information;
[0137] A sending module 702, used to send the transaction request to an audit node;
[0138] The judgment module 703 is used to send the first transaction permission information in the first transaction permission response to the second node if the first transaction permission response of the audit node is received; the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; the first node belongs to the first subchain, the second node belongs to the second subchain, the first subchain and the second subchain are located in the blockchain, and the first subchain and the second subchain have different consensus mechanisms.
[0139] In an optional implementation, the sending module is used to send the transaction request to a third node, where the third node belongs to the first subchain;
[0140] The device also includes a receiving module;
[0141] The receiving module is used to receive a second transaction permission response sent by the third node; the second transaction permission response carries second transaction permission information;
[0142] The generating module is used to generate target transaction permission information based on the first transaction permission information and the second transaction permission information; and send the target transaction permission information to the second node;
[0143] The first transaction permission information is used to instruct the second node to obtain the to-be-transferred assets of the first node, including:
[0144] The target transaction permission information is used to instruct the second node to obtain the to-be-transferred assets of the first node.
[0145] In an optional implementation, the production module is also used to generate a transaction completion response if a transfer success feedback information sent by the second node is received within a preset time; the transaction completion response is sent to the audit node; the transaction completion response carries transaction completion information, and the transaction completion information is used to instruct the audit node to update the account book information of the first node.
[0146] In an optional implementation, the generation module is used to generate a chain building request, the chain building request carries a first node identifier, a third node identifier, a consensus type and a supervisory node identifier; and is also used to generate a first chain building response if the first chain to be built permission information of the supervisory node is received; the first chain building response carries the first chain building information, the first chain building information includes the first node signature and the first chain to be built permission information; the chain to be built permission information includes the supervisory node signature, the subchain name, the consensus type, the first node identifier, the third node identifier and permission information; the permission information is determined based on the first node identifier, the third node identifier and a preset node list; the preset node list includes node identifiers registered with the supervisor node; if the second chain building information of the third node is received, a second chain to be built permission response is generated; the second chain to be built permission response carries the second chain to be built permission information, the second chain building information includes the third node signature and the first chain to be built permission information; the third chain building information is generated based on the first chain building information and the second chain to be built permission information;
[0147] The sending module is used to send the chain building request to the supervisory node; send the third chain building information to the supervisory node; the third chain building information is used to instruct the supervisor node to build the first subchain; the first subchain includes the first node and the third node.
[0148] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a server or a similar computing device. Taking running on a server as an example, Figure 8 1 is a hardware structure diagram of a server of a data interaction method provided in an embodiment of the present application. Figure 8As shown, the server 800 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 810 (the central processing unit 810 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 830 for storing data, and one or more storage media 820 (such as one or more mass storage devices) for storing application programs 823 or data 822. Among them, the memory 830 and the storage medium 820 can be short-term storage or permanent storage. The program stored in the storage medium 820 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 810 can be configured to communicate with the storage medium 820 and execute a series of instruction operations in the storage medium 820 on the server 800. The server 800 may also include one or more power supplies 860, one or more wired or wireless network interfaces 850, one or more input and output interfaces 840, and / or one or more operating systems 821, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0149] The input / output interface 840 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 800. In one example, the input / output interface 840 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 840 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0150] It can be understood by those skilled in the art that Figure 8 The structure shown is for illustration only and does not limit the structure of the above electronic device. Figure 8 More or fewer components as shown, or with Figure 8 Different configurations are shown.
[0151] An embodiment of the present application also provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the data interaction method as described above.
[0152] An embodiment of the present application also provides a storage medium, which can be set in a server to store at least one instruction, at least one program, a code set or an instruction set related to a data interaction method in an implementation method embodiment. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the above-mentioned data interaction method.
[0153] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0154] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0155] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0156] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0157] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A data interaction method, characterized in that: The following steps are involved: receiving a transaction request sent by a first node, wherein the transaction request carries transaction information; the first node belongs to a first subchain; Acquire the account book information of the first node according to the transaction information; Determining the asset status of the first node according to the ledger information and the transaction information; If the asset status is tradable, generating a first transaction permission response; Sending the first transaction permission response to the first node, where the first transaction permission response is used to instruct the first node to send the first transaction permission information in the first transaction permission response to the second node, where the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; The second node belongs to a second subchain, the first subchain and the second subchain are located in a blockchain, and the first subchain and the second subchain have different consensus mechanisms; The first subchain also includes a third node; The first transaction permission response is used to instruct the first node to send the first transaction permission information in the first transaction permission response to the second node, and the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node, including: The target transaction permission response is used to instruct the first node to send the target transaction permission information to the second node, and the target transaction permission information is used to instruct the second node to obtain the to-be-transferred asset transfer of the first node; The target transaction permission response is determined based on the first transaction permission response and the second transaction permission response; the second transaction permission response is sent by the third node to the first node; the second transaction permission response carries second transaction permission information; the target transaction permission information is determined based on the first transaction permission information and the second transaction permission information.
2. The data interaction method according to claim 1, characterized in that: The transaction information includes the first node identifier and the asset information to be transferred; the asset information to be transferred includes the amount to be transferred and the transfer direction information; the transfer direction information includes the direction information from the first node to the second node; The account book information includes the transferable amount; The step of obtaining the account book information of the first node according to the transaction information; The asset status of the first node is determined according to the account book information and the transaction information, and if the asset status is tradable, a first transaction permission response is generated, including: Acquire the transferable amount according to the first node identifier; Determine the asset status according to the transferable amount and the amount to be transferred; If the asset status is tradable, the first transaction approval response is generated.
3. A data interaction method, characterized in that: The following steps are involved: Generate a transaction request; the transaction request carries transaction information; Sending the transaction request to an audit node; If the first transaction permission response from the audit node is received, the first transaction permission information in the first transaction permission response is sent to the second node; the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; The first node belongs to a first subchain, the second node belongs to a second subchain, the first subchain and the second subchain are located in a blockchain, and the first subchain and the second subchain have different consensus mechanisms; After sending the transaction request to the audit node, the method further includes: Sending the transaction request to a third node, where the third node belongs to the first subchain; If the first transaction permission response from the audit node is received, after the first transaction permission information in the first transaction permission response is sent to the second node, the method further includes: receiving a second transaction permission response sent by the third node; the second transaction permission response carries second transaction permission information; generating target transaction permission information based on the first transaction permission information and the first transaction permission information; sending the target transaction permission information to the second node; The first transaction permission information is used to instruct the second node to obtain the to-be-transferred assets of the first node, including: The target transaction permission information is used to instruct the second node to obtain the to-be-transferred assets of the first node.
4. The data interaction method according to claim 3, characterized in that: If the first transaction permission information of the audit node is received, after the first transaction permission information is sent to the second node, the method further includes: If the transfer success feedback information sent by the second node is received within the preset time, a transaction completion response is generated; The transaction completion response is sent to the audit node; the transaction completion response carries transaction completion information, and the transaction completion information is used to instruct the audit node to update the account book information of the first node.
5. The data interaction method according to claim 3, characterized in that: Before generating the transaction request, the method further includes: Generate a chain building request, wherein the chain building request carries a first node identifier, a third node identifier, a consensus type, and a supervisory node identifier; Sending the chain building request to the supervision node; If the first to-be-built chain permission information of the supervisory node is received, a first chain building response is generated; the first chain building response carries the first chain building information, and the first chain building information includes the first node signature and the first to-be-built chain permission information; the to-be-built chain permission information includes the supervisory node signature, the subchain name, the consensus type, the first node identifier, the third node identifier and permission information; the permission information is determined based on the first node identifier, the third node identifier and a preset node list; the preset node list includes node identifiers registered with the supervisory node; If the second chain building information of the third node is received, a second chain to be built permission response is generated; the second chain to be built permission response carries the second chain to be built permission information, and the second chain building information includes the third node signature and the first chain to be built permission information; Generate third chain building information based on the first chain building information and the second to-be-built chain permission information; The third chain construction information is sent to the supervisory node; the third chain construction information is used to instruct the supervisory node to build the first subchain; the first subchain includes the first node and the third node.
6. A data interaction device, characterized in that: include: A receiving module, configured to receive a transaction request sent by the first node, wherein the transaction request carries transaction information; The first node belongs to a first subchain; An acquisition module, configured to acquire the account book information of the first node according to the transaction information; A determination module, configured to determine the asset status of the first node according to the account book information and the transaction information; A judgment module, configured to generate a first transaction permission response if the asset status is tradable; a sending module, configured to send the first transaction permission response to the first node, wherein the first transaction permission response is used to instruct the first node to send the first transaction permission information in the first transaction permission response to a second node, wherein the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node; The second node belongs to a second subchain, the first subchain and the second subchain are located in a blockchain, and the first subchain and the second subchain have different consensus mechanisms; The first subchain also includes a third node; The first transaction permission response is used to instruct the first node to send the first transaction permission information in the first transaction permission response to the second node, and the first transaction permission information is used to instruct the second node to obtain the assets to be transferred of the first node, including: The target transaction permission response is used to instruct the first node to send the target transaction permission information to the second node, and the target transaction permission information is used to instruct the second node to obtain the to-be-transferred asset transfer of the first node; The target transaction permission response is determined based on the first transaction permission response and the second transaction permission response; the second transaction permission response is sent by the third node to the first node; the second transaction permission response carries second transaction permission information; the target transaction permission information is determined based on the first transaction permission information and the second transaction permission information.
7. A data interaction device, characterized in that: include: A generation module, used to generate a transaction request; The transaction request carries transaction information; A sending module, used to send the transaction request to an audit node; a judgment module, configured to send first transaction permission information in the first transaction permission response to a second node if a first transaction permission response from the audit node is received; the first transaction permission information is used to instruct the second node to obtain the assets to be transferred from the first node; The first node belongs to a first subchain, the second node belongs to a second subchain, the first subchain and the second subchain are located in a blockchain, and the first subchain and the second subchain have different consensus mechanisms; The sending module is further used to send the transaction request to a third node, where the third node belongs to the first subchain; The device also includes a receiving module; The receiving module is configured to receive a second transaction permission response sent by the third node; the second transaction permission response carries second transaction permission information; The generating module is configured to generate target transaction permission information based on the first transaction permission information and the first transaction permission information; and send the target transaction permission information to the second node; The first transaction permission information is used to instruct the second node to obtain the to-be-transferred assets of the first node, including: The target transaction permission information is used to instruct the second node to obtain the to-be-transferred assets of the first node.
8. A computer storage medium, characterized in that The computer storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the data interaction method as described in any one of claims 1-2 or any one of claims 3-5.
Citation Information
Patent Citations
Cross-chain transaction method and device of block chain and electronic equipment
CN111582845A