A method and device for confirming data ownership
By applying data rights confirmation methods on the blockchain, using smart contracts and digital signature technology, the problem of easy tampering with the ownership of virtual pets and characters in AR games is solved, and the data is not tampered with and certainty of ownership rights is realized.
Patent Information
- Application Number
- CN201910894580.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-20
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2039-09-20
AI Technical Summary
There is a lack of effective way to confirm the rights of virtual pets and characters in existing AR games, which makes the ownership rights easy to be tampered with.
By applying data rights confirmation methods on the blockchain, using smart contracts and digital signature technology, pet data is packaged into data packets, and blocks are generated on the blockchain through a consensus mechanism to ensure the immutability of data and the certainty of ownership rights.
It realizes the tamper-proof confirmation of virtual pet data, prevents the ownership rights from being tampered with, and improves the security and reliability of the data.
Smart Images

Figure CN110598480B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for confirming data rights. Background Art
[0002] With the development of computer technology, augmented reality (AR) technology has become more and more mature. Augmented reality technology is a technology that cleverly integrates virtual information with the real world. It widely uses a variety of technical means such as multimedia, three-dimensional modeling, real-time tracking and registration, intelligent interaction, and sensing. It simulates computer-generated text, images, three-dimensional models, music, videos and other virtual information and applies them to the real world. The two types of information complement each other, thereby achieving "enhancement" of the real world.
[0003] At present, with the maturity of AR technology, many AR applications have been derived. For example, AR shopping, AR education, AR games, etc. For AR games, it is a new game mode developed by combining AR technology with traditional games. In AR games, there are mostly some virtual pets and / or characters, but there is currently no good way to confirm the ownership of these virtual pets and / or characters in AR games to prevent the ownership of these virtual pets and / or characters from being tampered with by others. Summary of the invention
[0004] The embodiments of the present application provide a data rights confirmation method and device, which can provide a good data rights confirmation method, thereby preventing pet data from being tampered with by others, and preventing the pet's ownership from being tampered with.
[0005] In a first aspect, an embodiment of the present application provides a data rights confirmation method, which can be applied on a blockchain. The data rights confirmation method may include:
[0006] The first node receives an uplink request sent by a first client, where the uplink request includes a first data packet packaged with first pet data;
[0007] The first node invokes the smart contract to digitally sign the first data packet using the private key of the first node to obtain a second data packet, and invokes the smart contract to broadcast the first data packet, the public key of the first node, and the second data packet to each node of the blockchain network, so that each node returns a consensus-reaching response when the data packet obtained by decrypting the second data packet based on the public key of the first node is the same as the first data packet;
[0008] When the first node receives the consensus-reaching responses returned by each node and the consensus condition is satisfied, it calls the smart contract to generate a block corresponding to the first data packet and adds the block to the blockchain;
[0009] The first node obtains the first address of the block generated by the smart contract and the first token required to access the first address, and returns an on-chain response to the first client in response to the on-chain request, where the on-chain response includes the first address and the first token.
[0010] In one possible design, the method further includes:
[0011] The first node receives a transaction request sent by the first client, where the transaction request includes the first token and a transaction identifier of the transaction request; the first node calls the smart contract to freeze the first token, and broadcasts the transaction identifier to each node of the blockchain network, where the transaction identifier is used to initiate a transaction in the blockchain network.
[0012] In one possible design, the method further includes:
[0013] The second node receives a transaction response sent by the second client, and the transaction response includes the transaction asset and the transaction identifier; the second node calls the smart contract to freeze the transaction asset, and sends the transaction response to the account of the first client through the first node; the first node receives a confirmation transaction request sent by the first client, and the confirmation transaction request includes the transaction identifier; the first node calls the smart contract to unfreeze the transaction asset, and transfers the unfrozen transaction asset from the account of the second client to the account of the first client; the first node calls the smart contract to unfreeze the first token, and transfers the unfrozen first token from the account of the first client to the account of the second client.
[0014] In one possible design, the method further includes:
[0015] The second node receives a read data request sent by the second client, wherein the read data request includes the first token; the second node accesses the first address through the first token, and obtains the first data packet from the block indicated by the first address; the second node returns the first data packet to the account of the second client in response to the read data request.
[0016] In a possible design, the first pet data includes one or more of a pet identification, three-dimensional image data, attributes, and skills, and the three-dimensional image data is a three-view image of the pet.
[0017] In one possible design, the blockchain network includes N nodes, and the method further includes: the first node counts the number of consensus-reaching responses received; when the number is greater than N / 2, the first node determines that the consensus-reaching responses received and returned by each node meet the consensus conditions.
[0018] In a possible design, calling the smart contract to generate a block corresponding to the first data packet includes:
[0019] The smart contract is called to encrypt the first data packet using the public key of the first node, and the smart contract is called to generate a block using the encrypted first data packet.
[0020] In a second aspect, an embodiment of the present application provides a data rights confirmation device, which can be applied on a first node. The data rights confirmation device may include:
[0021] A transceiver module, configured to receive an uplink request sent by a first client, wherein the uplink request includes a first data packet packaged with first pet data;
[0022] A digital signature module, used to call the smart contract to digitally sign the first data packet using a private key to obtain a second data packet;
[0023] A broadcast module, used to call the smart contract to broadcast the first data packet, the public key, and the second data packet to each node of the blockchain network, so that each node returns a consensus response when a data packet obtained by decrypting the second data packet based on the public key is the same as the first data packet;
[0024] A generation module, configured to, when receiving consensus-reaching responses returned by each node that meet the consensus conditions, call the smart contract to generate a block corresponding to the first data packet, and add the block to the blockchain;
[0025] An acquisition module, used to acquire a first address of the block generated by the smart contract and a first token required to access the first address;
[0026] The transceiver module is used to return an uplink response to the first client in response to the uplink request, and the uplink response includes the first address and the first token.
[0027] In a possible design, the data rights confirmation device also includes a freezing module. The transceiver module is also used to receive a transaction request sent by the first client, the transaction request includes the first token and a transaction identifier of the transaction request; the freezing module is used to call the smart contract to freeze the first token; the broadcast module is also used to broadcast the transaction identifier to each node of the blockchain network, and the transaction identifier is used to initiate a transaction in the blockchain network.
[0028] In a possible design, the data rights confirmation device also includes a thawing module and a transfer module. The above-mentioned transceiver module is also used to receive a transaction confirmation request sent by the first client, and the transaction confirmation request includes the transaction identifier; the thawing module is used to call the smart contract to thaw the transaction assets; the transfer module is used to transfer the thawed transaction assets from the account of the second client to the account of the first client; the thawing module is also used to thaw the first token; the transfer module is also used to transfer the thawed first token from the account of the first client to the account of the second client.
[0029] In a possible design, the first pet data includes one or more of a pet identification, three-dimensional image data, attributes, and skills, and the three-dimensional image data is a three-view image of the pet.
[0030] In one possible design, the blockchain network includes N nodes. The data rights confirmation device also includes a determination module. The determination module is used to count the number of consensus-reaching responses received; when the number is greater than N / 2, it is determined that the consensus-reaching responses returned by each node meet the consensus condition.
[0031] In one possible design, the generation module is specifically used to call the smart contract to encrypt the first data packet using the public key of the first node, and call the smart contract to generate a block from the encrypted first data packet, and add the block to the blockchain.
[0032] In a third aspect, an embodiment of the present application provides another data rights confirmation device, which can be applied on a second node. The data rights confirmation device may include:
[0033] The transceiver module is used to receive a transaction response sent by the second client, where the transaction response includes the transaction assets and the transaction identifier;
[0034] The freezing module is used to call the smart contract to freeze the transaction assets;
[0035] The above-mentioned transceiver module is also used to send the transaction response to the account of the first client through the first node.
[0036] In a possible design, the data right confirmation device further includes an acquisition module. The transceiver module is further used to receive a read data request sent by the second client, the read data request including the first token; the acquisition module is used to access the first address through the first token and obtain the first data packet from the block indicated by the first address; the transceiver module is further used to return the first data packet to the account of the second client in response to the read data request.
[0037] In a fourth aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory, and a transceiver;
[0038] The processor is connected to a memory and a transceiver respectively, wherein the memory is used to store program codes, the transceiver is used to communicate with each node and / or client in the blockchain network, and the transceiver is specifically used to receive a chain request sent by a first client, wherein the chain request includes a first data packet packaged with first pet data;
[0039] The processor is used to call the program code to perform the following operations:
[0040] Calling the smart contract to digitally sign the first data packet using the private key to obtain a second data packet, and calling the smart contract to broadcast the first data packet, the public key, and the second data packet to each node of the blockchain network, so that each node returns a consensus response when the data packet obtained by decrypting the second data packet based on the public key is the same as the first data packet;
[0041] When the consensus reaching responses returned by each node meet the consensus conditions, the smart contract is called to generate a block corresponding to the first data packet, and the block is added to the blockchain;
[0042] Obtaining a first address of the block generated by the smart contract and a first token required to access the first address;
[0043] The transceiver is further specifically configured to return an uplink response to the first client in response to the uplink request, wherein the uplink response includes the first address and the first token.
[0044] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the processor executes the program instructions, the data confirmation method of the first node in the first aspect of the embodiment of the present application is executed.
[0045] In a sixth aspect, an embodiment of the present application provides another computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the processor executes the program instructions, the data confirmation method of the second node in the first aspect of the embodiment of the present application is executed.
[0046] The embodiment of the present application can provide a good data right confirmation method by uploading the first data packet to the blockchain network for consensus, generating a block after the consensus is successful and adding it to the blockchain, thereby preventing the pet data from being tampered with by others and the ownership of the pet from being tampered with. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art 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 paying creative work.
[0048] Figure 1A This is a schematic diagram of a network architecture provided by an embodiment of the present application;
[0049] Figure 1B It is an optional schematic diagram of the block structure (Block Structure) provided in the embodiment of the present application;
[0050] Figure 2 It is a flowchart of a data rights confirmation method provided in an embodiment of the present application;
[0051] Figure 3 It is a flowchart of another data rights confirmation method provided in an embodiment of the present application;
[0052] Figure 4 It is a structural diagram of a data rights confirmation device provided in an embodiment of the present application;
[0053] Figure 5 It is a structural schematic diagram of another data rights confirmation device provided in an embodiment of the present application;
[0054] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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.
[0056] It should be understood that the term “and / or” used in the specification and appended claims of this application refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0057] The data rights confirmation method provided in the embodiment of this application can be applied to the blockchain. Figure 1A, is a schematic diagram of a network architecture provided in an embodiment of the present application. Among them, user 1 and user 2 may have different clients, such as Figure 1A As shown, the client where user 1 is located is client 1, and the client where user 2 is located is client 2. User 1 and user 2 can play AR games on their own clients respectively. The AR games on client 1 and client 2 can be the same or different AR games. Client 1 can communicate with node 1 on the blockchain network, and client 2 can communicate with node 2 on the blockchain network. The nodes on the blockchain network can also communicate with each other, such as node 1 can communicate with nodes 2, 3 and 4 in the blockchain network respectively, node 2 can communicate with nodes 1, 3 and 4 in the blockchain network respectively, node 3 can communicate with nodes 1, 2 and 4 in the blockchain network respectively, and node 4 can communicate with nodes 1, 2 and 3 in the blockchain network respectively. Nodes 1 to 4 can be any form of computing devices connected to the network, such as servers, user terminals, etc. In the blockchain network, any machine such as a server or a terminal can join and become a node. The node includes a hardware layer, an intermediate layer, an operating system layer and an application layer.
[0058] See also Figure 1A The functions of each node in the blockchain network shown include:
[0059] 1) Routing: a basic function of a node, used to support communication between nodes.
[0060] In addition to the routing function, the node can also have the following functions:
[0061] 2) Applications, which are deployed in the blockchain to implement specific businesses according to actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain network for other nodes to add the record data to the temporary block when they successfully verify the source and integrity of the record data.
[0062] For example, the services implemented by the application include:
[0063] 2.1) Wallet, used to provide the function of conducting electronic currency transactions, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain network. After successful verification by other nodes, as a response to acknowledge the validity of the transaction, the transaction record data is stored in the temporary block of the blockchain; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address;
[0064] 2.2) Shared ledger, which is used to provide functions such as storage, query and modification of account data. The record data of the operation on the account data is sent to other nodes in the blockchain network. After other nodes verify the validity, as a response to acknowledging the validity of the account data, the record data is stored in a temporary block, and a confirmation can also be sent to the node that initiated the operation.
[0065] 2.3) Smart contracts are computerized protocols that can execute the terms of a contract. They are implemented by deploying code on a shared ledger that is executed when certain conditions are met. The code is used to complete automated transactions based on actual business needs, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.
[0066] 3) Blockchain, including 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] See also Figure 1B , Figure 1B This is an optional schematic diagram of the block structure provided by the embodiment of the present application. Each block includes the hash value of the transaction record stored in this block (the hash value of this block) and the hash value of the previous block. Each block is connected by the hash value to form a blockchain. In addition, the block can also include information such as the timestamp when the block was generated. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains relevant information for verifying the validity of its information (anti-counterfeiting) and generating the next block.
[0068] In some feasible implementations, when user 1 plays an AR game on client 1, client 1 captures a new pet added to user 1's account (the pet mentioned in the embodiment of the present application refers to the virtual pet image in the AR game). Client 1 can package the pet data of the newly added pet to obtain a first data packet. For ease of description, the pet data of the newly added pet on the account of user 1 is referred to as the first pet data below. Client 1 can generate a chain request based on the first data packet, and can send the chain request to node 1, which can include the first data packet. Node 1 receives the chain request sent by client 1, and can call the smart contract to digitally sign the first data packet with the private key of node 1 to obtain a second data packet. Node 1 calls the smart contract to broadcast the first data packet, the public key of node 1, and the second data packet to each node of the blockchain network. After node 2, node 3, and node 4 receive the first data packet, the public key of node 1, and the second data packet, each node can respectively determine whether the data packet obtained by decrypting the second data packet using the public key of node 1 is the same as the first data packet. If the same, each node returns a consensus response. If a node determines that they are not the same, the node returns a consensus failure response. When node 1 receives the consensus response returned by each node and meets the consensus conditions, it can call the smart contract to generate the block corresponding to the first data packet, and can add the block to the blockchain. Node 1 can obtain the first address of the block generated by the smart contract and the first token required to access the first address, and return an on-chain response to client 1 for the above-mentioned on-chain request, and the on-chain response can include the first address and the first token.
[0069] The embodiment of the present application can achieve the confirmation of the ownership of the first pet data by uploading the first data packet containing the first pet data to the blockchain network and reaching a consensus on the first data packet, and at the same time confirm the ownership of the pet described by the first pet data, thereby preventing the pet data from being tampered with by others and the ownership of the pet from being tampered with. It can also be used to realize subsequent transactions on pets.
[0070] The following will be combined with the attached Figure 2 and attached Figure 3 , the data rights confirmation method provided by this application is explained in detail.
[0071] See also Figure 2 , is a flow chart of a data rights confirmation method provided in an embodiment of the present application. Figure 2 As shown, the data rights confirmation method may include the steps of:
[0072] S201: A first client sends an uplink request to a first node. Correspondingly, the first node receives the uplink request.
[0073] In some feasible implementations, the first user (eg Figure 1A User 1) can use the first client (such as Figure 1A Client 1) in the AR game. In the game, there are usually many raffles. Suppose the first user draws a pet (such as a pet Doraemon) in the raffle through the first client. When the pet is transferred from the lottery pool to the first user's account, the first client will capture a new pet in the first user's account. Alternatively, the first user performs a monster-killing task in the AR game. After the first user completes the monster-killing task, a pet falls from the game system. When the pet is transferred from the game system to the first user's account, the first client will also capture a new pet in the first user's account. The above description is only to illustrate the scenario in which the first client captures the newly added pet in the first account, and does not constitute a limitation on the data confirmation method provided in this application. In practice, there are many scenarios for adding new pets, which are not exemplified one by one here.
[0074] When the first client captures that a new pet has been added to the first user's account, the first client can package the first pet data of the pet to obtain a first data packet. The first pet data may include one or more of the pet's pet identification, three-dimensional image data, attributes, and skills, and the three-dimensional image data may be a three-view image or a 3D image of the pet. After the first client obtains the first data packet, it may send a chain request to the first node, and the chain request may include the first data packet. Accordingly, the first node receives the chain request sent by the first client. Among them, the first node can be any node in the blockchain network.
[0075] In some feasible implementations, the first client may encrypt the first pet data of the pet using the public key of the first user, and may package the encrypted first pet data to obtain a first data packet to improve data security. The first client may send an uplink request to the first node, and the uplink request may include the first data packet. Accordingly, the first node receives the uplink request sent by the first client.
[0076] S202, the first node calls the smart contract to digitally sign the first data packet with the private key of the first node to obtain the second data packet, and calls the smart contract to broadcast the first data packet, the public key of the first node and the second data packet to each node of the blockchain network.
[0077] In some feasible implementations, after receiving the above-mentioned on-chain request, the first node can extract the above-mentioned first data packet from the on-chain request. The first node can call a pre-agreed smart contract to digitally sign the first data packet using the private key of the first node to obtain a second data packet. The first node can call a smart contract to broadcast the first data packet, the public key of the first node, and the second data packet to each node of the blockchain network where the first node is located. After each node receives the first data packet, the public key of the first node, and the second data packet, it can use the public key of the first node to decrypt the second data packet to obtain a decrypted data packet. When the decrypted data packet of a node among the various nodes is the same as the first data packet, the node can return a consensus-reaching response to the first node. When the decrypted data packet of a node among the various nodes is different from the first data packet, the node can return a consensus-failed response to the first node.
[0078] For example, the blockchain network where the first node is located includes 4 nodes, namely nodes 1 to 4. Assume that the first node is node 1. Node 1 calls the smart contract to broadcast the first data packet, the public key of node 1, and the second data packet to nodes 2 to 4. After receiving the first data packet, the public key of node 1, and the second data packet, each of nodes 2 to 4 can use the public key of node 1 to decrypt the second data packet to obtain a decrypted data packet, and detect whether the decrypted data packet is the same as the first data packet. Assuming that the data packets decrypted by nodes 2 and 4 are the same as the first data packet, both nodes 2 and 4 return a consensus reached response to node 1. Assuming that the data packet decrypted by node 3 is not the same as the first data packet, node 3 returns a consensus failed response to node 1.
[0079] S203, when the first node receives the consensus-reaching responses returned by each node and the consensus conditions are met, it calls the smart contract to generate a block corresponding to the first data packet and adds the block to the blockchain.
[0080] In some feasible implementations, after receiving the consensus response returned by each of the above nodes, the first node can detect whether the consensus response returned by each node meets the consensus condition. When the consensus response returned by each node meets the consensus condition, it means that the first data packet has been recognized by most nodes in the blockchain network, and it also means that most nodes in the blockchain network recognize that the first data packet belongs to the first user. The first node can call the smart contract to generate a block corresponding to the first data packet, and can add the generated block to the blockchain.
[0081] In some feasible implementations, the blockchain network may include N nodes, and when the first node detects whether the consensus response returned by each node satisfies the consensus condition, the number of consensus responses received may be counted. When the number of consensus responses is greater than N / 2, it means that the consensus response returned by each node received by the first node satisfies the consensus condition, and the first node may call the smart contract to generate a block corresponding to the first data packet, and may add the generated block to the blockchain.
[0082] In some feasible implementations, when the first node calls the smart contract to generate a block corresponding to the first data packet, the first node can call the smart contract to encrypt the first data packet using the public key of the first node, and call the smart contract to generate a block from the encrypted first data packet. The embodiment of the present application encrypts the first data packet using the public key of the first node, which can prevent the data in the first data packet from being stolen.
[0083] S204, the first node obtains the first address of the block generated by the smart contract and the first token required to access the first address.
[0084] In some feasible implementations, after adding the block generated by calling the smart contract to the blockchain, the first node can obtain the first address of the block generated by the smart contract (i.e., the height of the block corresponding to the first data packet on the blockchain) and the first token required to access the first address. The first token can be a token or a pass to access the first address.
[0085] S205: The first node returns an uplink response to the first client in response to the uplink request. Accordingly, the first client receives the uplink response.
[0086] In some feasible implementations, the above-mentioned uplink response may include the above-mentioned first address and the above-mentioned first token.
[0087] S206: The first client stores the first address and the first token included in the on-chain response.
[0088] In some feasible implementations, the first client may store the first address and the first token included in the on-chain response for subsequent transactions. A user may have multiple pets, each of which may correspond to a block on the blockchain. When the client of the user captures that a new pet has been added to the user's account, the operations of steps S201 to S206 are performed to confirm the ownership of the pet.
[0089] In an embodiment of the present application, the first client sends a chain request to the first node. Accordingly, the first node receives the chain request. The first node calls the smart contract to digitally sign the first data packet with the private key of the first node to obtain the second data packet, and calls the smart contract to broadcast the first data packet, the public key of the first node and the second data packet to each node of the blockchain network. When the first node receives the consensus response returned by each node and meets the consensus conditions, it calls the smart contract to generate a block corresponding to the first data packet and adds the block to the blockchain. The first node obtains the first address of the block generated by the smart contract and the first token required to access the first address. The first node returns a chain response to the first client in response to the chain request. The first client stores the first address and the first token included in the chain response. A good data right confirmation method can be provided to prevent pet data from being tampered with by others and to prevent the ownership of the pet from being tampered with.
[0090] As an optional embodiment, Figure 2 After returning the on-chain response to the first client, the embodiment shown indicates that the pet described by the first pet data belongs to the first user, and the first user can trade with other users based on the received first token and first address. The user who trades with the first user can be a user in the same AR game as the first user, or a user in an AR game that does not belong to the first user, that is, the transaction can be conducted across games, that is, users in two different games can trade the pet described by the first pet data.
[0091] See also Figure 3 , is a flow chart of another data rights confirmation method provided by an embodiment of the present application. Figure 3 As shown, the data rights confirmation method may include the steps of:
[0092] S301: A first client sends an uplink request to a first node. Correspondingly, the first node receives the uplink request.
[0093] S302, the first node calls the smart contract to digitally sign the first data packet with the private key of the first node to obtain the second data packet, and calls the smart contract to broadcast the first data packet, the public key of the first node and the second data packet to each node of the blockchain network.
[0094] S303: When the first node receives the consensus-reaching responses returned by each node and the consensus conditions are met, it calls the smart contract to generate a block corresponding to the first data packet and adds the block to the blockchain.
[0095] S304, the first node obtains the first address of the block generated by the smart contract and the first token required to access the first address.
[0096] S305: The first node returns an uplink response to the first client in response to the uplink request. Accordingly, the first client receives the uplink response.
[0097] S306: The first client stores the first address and the first token included in the on-chain response.
[0098] In some feasible implementations, steps S301 to S306 in the embodiments of the present application can refer to Figure 2 Steps S201 to S206 of the illustrated embodiment are not described in detail here.
[0099] S307, the first client sends a transaction request to the first node. Correspondingly, the first node receives the transaction request.
[0100] In some feasible implementations, the first user can trade the pet that has been on the chain. For ease of understanding, the following will be described by taking the pet described by the first pet data that has been successfully on the chain as an example. In actual applications, the pet to be traded can also be a pet described by other pet data that has been on the chain, and this embodiment of the application does not limit this.
[0101] The first user may initiate a transaction for the pet described by the first pet data. When the first client receives a transaction initiated by the first user for the pet described by the first pet data, a transaction request may be generated. The transaction request may include a first token required to access the first address and a transaction identifier of the transaction request. The transaction identifier is used to uniquely identify the transaction request. The first client may send the transaction request to the first node, and the first node may receive the transaction request accordingly. The transaction request may also include an account identifier of the first user.
[0102] S308: The first node calls the smart contract to freeze the first token and broadcasts the transaction identifier to each node of the blockchain network.
[0103] In some feasible implementations, the first node may extract the first token and the transaction identifier from the received transaction request. The first node may call a smart contract to freeze the first token so that the first token is not stolen before the transaction is concluded, thereby improving the security of the transaction process. After freezing the first token, the first node may call a smart contract to broadcast the transaction identifier to each node of the blockchain network where the first node is located, so that each node in the blockchain network knows that the first client has initiated a transaction. The transaction identifier may be used to initiate a transaction in the blockchain network. After receiving the transaction identifier, each node may send it to the client associated with the node so that the user can view the transaction information initiated by the first client on the client.
[0104] S309, the second client sends a transaction response to the second node. Correspondingly, the second node receives the transaction response.
[0105] In some feasible implementations, the second user sees on the second client that the first user wants to sell the pet described by the first pet data, and decides to buy the pet. The second user can perform a purchase operation on the second client, such as clicking a purchase button for the pet. After the second client receives the purchase instruction generated by the purchase operation of the second user, a transaction response for the above-mentioned transaction identifier can be generated. The transaction response may include the transaction assets in the second user's account (here, the transaction assets for purchasing the pet) and the transaction identifier. The second client can send the transaction response to the second node, and accordingly, the second node receives the transaction response. The transaction response may also include the account identifier of the second user.
[0106] For example, assuming that the pet described by the first pet data is a Doraemon, the transaction information initiated by the first client and seen by the second user on the second client may be a message such as "Ddoraemon, on sale, 10 legal currency". After the second user clicks the purchase button for the Doraemon on the second client, the second client obtains the transaction asset (i.e., 10 legal currency) from the second user's account, and then generates a transaction response, which includes 10 legal currency and a transaction identifier.
[0107] S310, the second node calls the smart contract to freeze the transaction assets.
[0108] S311, the second node sends a transaction response to the account of the first client through the first node.
[0109] In some feasible implementations, the second node extracts the transaction assets from the transaction response, and can call the smart contract to freeze the transaction assets so that the transaction assets will not be misappropriated. The second node can call the smart contract to send the transaction response to the first node, and the first node receives the transaction response accordingly. The first node can forward the transaction response to the account of the first client. Among them, the account of the first client mentioned in the embodiment of the present application is the account of the first user mentioned above.
[0110] S312, the first client sends a transaction confirmation request to the first node. Correspondingly, the first node receives the transaction confirmation request.
[0111] In some feasible implementations, after the first client receives the transaction response, the first user can view the transaction response through the first client. The first client receives the request initiated by the first user to agree to trade with the second user, and generates a transaction confirmation request based on the user's transaction consent operation, and the transaction confirmation request may include the transaction identifier. The first client may send the transaction confirmation request to the first node, and the first node receives the transaction confirmation request accordingly. The transaction confirmation request may also include the account identifier of the second user.
[0112] S313: The first node calls the smart contract to unfreeze the transaction assets, and transfers the unfrozen transaction assets from the account of the second client to the account of the first client.
[0113] In some feasible implementations, after the first node receives the transaction confirmation request, it indicates that the transaction between the first user and the second user is completed, and the smart contract can be called to unfreeze the frozen transaction assets, and the smart contract can be called to transfer the unfrozen transaction assets from the second client's account to the first client's account. The second client's account mentioned in the embodiment of the present application is the second user's account.
[0114] For example, if the frozen transaction asset is 10 legal tenders, the first node will unfreeze the 10 legal tenders, and then transfer the unfrozen 10 legal tenders from the second user's account to the first user's account to realize the asset transfer.
[0115] S314: The first node calls the smart contract to unfreeze the first token, and transfers the unfrozen first token from the account of the first client to the account of the second client.
[0116] In some feasible implementations, the first node can call a smart contract to unfreeze the frozen first token, and can call a smart contract to transfer the unfrozen first token from the account of the first client to the account of the second client. When the transaction assets are transferred from the account of the second client to the account of the first client, and the first token is transferred from the account of the first client to the account of the second client, the transaction between the first user and the second user is completed. Since the first token is required to access the first address, after the account of the second client obtains the first token, it can obtain the first pet data.
[0117] In some feasible implementations, the execution order between step S313 and step S314 in the embodiment of the present application is not limited. For example, step S313 can be executed before step S314, step S313 can also be executed after step S314, step S313 can also be executed simultaneously with step S314, and so on.
[0118] In some feasible implementations, after the second client obtains the first token, the second user can read the data through the second client. The second client receives the instruction generated by the second user's data read operation and can generate a read data request. The read data request can include the first token. The second client sends the read data request to the second node, and the second node receives the read data request accordingly. The second node can access the above-mentioned first address through the first token in the read data request, and can call the smart contract to obtain the first data packet from the block indicated by the first address. The second node can return the first data packet to the account of the second client in response to the read data request.
[0119] In some feasible implementations, before the second node calls the smart contract to obtain the first data packet from the block indicated by the above-mentioned first address, the second node may send a key request to the first node, and the key request is used to request the private key of the first node. After the first node receives the key request, it can return the private key of the first node. After the second node receives the private key of the first node, it can call the smart contract to obtain the first data packet from the block indicated by the first address, and use the private key of the first node to decrypt the first data packet. The second node returns the decrypted first data packet to the account of the second client. Optionally, if the first pet data included in the first data packet is encrypted by the public key of the first user, the first client can send the private key of the first user to the second client after sending a confirmation transaction request to the first node. After the second client's account obtains the first data packet, it can use the private key of the first user to decrypt the first data packet to obtain the first pet data. The second client can display the pet described by the first pet data based on the obtained first pet data.
[0120] The embodiment of the present application realizes the confirmation of ownership of the first pet data in the first data packet by uploading the first data packet to the chain, and after the first pet data is confirmed, the transaction is carried out through the blockchain network, which can not only prevent the pet data from being tampered with by others, and prevent the ownership of the pet from being tampered with, but also improve the reliability and security of the transaction.
[0121] The above describes in detail the data rights confirmation method of the embodiment of the present application. In order to facilitate better implementation of the above scheme of the embodiment of the present application, the embodiment of the present application also provides corresponding devices and equipment.
[0122] See also Figure 4 , is a schematic diagram of the structure of a data rights confirmation device provided in an embodiment of the present application. The data rights confirmation device 100 can be applied in Figure 2 or Figure 3 In the first node shown, the data right confirmation device 100 may include:
[0123] The transceiver module 10 is used to receive an uplink request sent by a first client, where the uplink request includes a first data packet packaged with first pet data;
[0124] A digital signature module 20, used to call the smart contract to digitally sign the first data packet using a private key to obtain a second data packet;
[0125] A broadcast module 30 is used to call the smart contract to broadcast the first data packet, the public key and the second data packet to each node of the blockchain network, so that each node returns a consensus response when a data packet obtained by decrypting the second data packet based on the public key is the same as the first data packet;
[0126] A generation module 40 is used to call the smart contract to generate a block corresponding to the first data packet and add the block to the blockchain when the consensus reaching response returned by each node meets the consensus condition;
[0127] An acquisition module 50, configured to acquire a first address of the block generated by the smart contract and a first token required to access the first address;
[0128] The transceiver module 10 is used to return an uplink response to the first client in response to the uplink request, and the uplink response includes the first address and the first token.
[0129] In some feasible implementations, the data right confirmation device 100 further includes a freezing module 60. The transceiver module 10 is further used to receive a transaction request sent by the first client, the transaction request including the first token and a transaction identifier of the transaction request; the freezing module 60 is used to call the smart contract to freeze the first token; the broadcast module 30 is further used to broadcast the transaction identifier to each node of the blockchain network, and the transaction identifier is used to initiate a transaction in the blockchain network.
[0130] In some feasible implementations, the data rights confirmation device 100 further includes a thawing module 70 and a transfer module 80. The transceiver module 10 is further used to receive a transaction confirmation request sent by the first client, the transaction confirmation request including the transaction identifier; the thawing module 70 is used to call a smart contract to thaw the transaction asset; the transfer module 80 is used to transfer the thawed transaction asset from the account of the second client to the account of the first client; the thawing module 70 is further used to thaw the first token; the transfer module 80 is further used to transfer the thawed first token from the account of the first client to the account of the second client.
[0131] In some feasible implementations, the first pet data includes one or more of a pet identification, three-dimensional image data, attributes, and skills, and the three-dimensional image data is a three-view image of the pet.
[0132] In some feasible implementations, the blockchain network includes N nodes. The data rights confirmation device 100 also includes a determination module 90. The determination module 90 is used to count the number of consensus-reaching responses received; when the number is greater than N / 2, it is determined that the consensus-reaching responses returned by each node meet the consensus condition.
[0133] In some feasible implementations, the generation module 40 is specifically used to call the smart contract to encrypt the first data packet through the public key of the first node, and call the smart contract to generate a block from the encrypted first data packet, and add the block to the blockchain.
[0134] Among them, the digital signature module 20, the broadcast module 30, the generation module 40, the acquisition module 50, the freezing module 60, the thawing module 70, the transfer module 80 and the determination module 90 can be one module, such as a processing module.
[0135] In the specific implementation, the implementation of each module can also refer to Figure 2 or Figure 3 The corresponding description of the first node in the method embodiment shown executes the method and function performed by the first node in the above embodiment.
[0136] In an embodiment of the present application, the first client sends a chain request to the data confirmation device. Correspondingly, the data confirmation device receives the chain request. The data confirmation device calls the smart contract to digitally sign the first data packet with the private key of the data confirmation device to obtain the second data packet, and calls the smart contract to broadcast the first data packet, the public key of the data confirmation device and the second data packet to each node of the blockchain network. When the data confirmation device receives the consensus response returned by each node to meet the consensus conditions, it calls the smart contract to generate the block corresponding to the first data packet and adds the block to the blockchain. The data confirmation device obtains the first address of the block generated by the smart contract and the first token required to access the first address. The data confirmation device returns a chain response to the first client in response to the chain request. The first client stores the first address and the first token included in the chain response. A good data confirmation method can be provided to prevent pet data from being tampered with by others and to prevent the ownership of the pet from being tampered with.
[0137] See also Figure 5 , is a schematic diagram of the structure of another data rights confirmation device provided in an embodiment of the present application. The data rights confirmation device 200 can be applied in Figure 2 or Figure 3 In the second embodiment shown, the data authentication device 200 may include:
[0138] The transceiver module 201 is used to receive a transaction response sent by the second client, where the transaction response includes the transaction assets and the transaction identifier;
[0139] A freezing module 202 is used to call the smart contract to freeze the transaction assets;
[0140] The transceiver module 201 is further configured to send the transaction response to the account of the first client via the first node.
[0141] In some feasible implementations, the data right confirmation device 200 further includes an acquisition module 203. The transceiver module 201 is further used to receive a read data request sent by the second client, the read data request including the first token; the acquisition module 203 is used to access the first address through the first token and obtain the first data packet from the block indicated by the first address; the transceiver module 201 is further used to return the first data packet to the account of the second client in response to the read data request.
[0142] The freezing module 202 and the acquiring module 203 may be one module, such as a processing module.
[0143] In the specific implementation, the implementation of each module can also refer to Figure 2 or Figure 3 The corresponding description of the second node in the method embodiment shown executes the method and functions executed by the second node in the above embodiment.
[0144] See also Figure 6 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 1000 may include: a processor 1001, a memory 1002, and a transceiver 1003. In addition, the electronic device 1000 may also include at least one communication bus 1004. The communication bus 1004 is used to realize the connection and communication between these components. The memory 1002 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1002 may also be at least one storage device located away from the aforementioned processor 1001. Figure 6 As shown, the memory 1002 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application.
[0145] exist Figure 6In the electronic device 1000 shown, the transceiver 1003 is used to communicate with each node and / or client in the blockchain network. The transceiver 1003 is specifically used to receive a chain request sent by a first client, and the chain request includes a first data packet packaged with first pet data; and the processor 1001 can be used to call the device control application stored in the memory 1002 to achieve:
[0146] Calling the smart contract to digitally sign the first data packet using the private key to obtain a second data packet, and calling the smart contract to broadcast the first data packet, the public key, and the second data packet to each node of the blockchain network, so that each node returns a consensus response when the data packet obtained by decrypting the second data packet based on the public key is the same as the first data packet;
[0147] When the consensus-reaching responses returned by each node meet the consensus conditions, the smart contract is called to generate a block corresponding to the first data packet, and the block is added to the blockchain;
[0148] Obtaining a first address of the block generated by the smart contract and a first token required to access the first address;
[0149] The transceiver 1003 is further specifically configured to return an uplink response to the first client in response to the uplink request, where the uplink response includes the first address and the first token.
[0150] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the data right confirmation device 100 or the data right confirmation device 200 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the above-mentioned Figure 2 or Figure 3 The description of the data confirmation method in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0151] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0152] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data rights confirmation method, characterized in that: include: The first node receives an uplink request sent by a first client, where the uplink request includes a first data packet packaged with first pet data, where the first pet data is pet data of a virtual pet obtained by an account of the first client in an AR game; The first node invokes the smart contract to digitally sign the first data packet using the private key of the first node to obtain a second data packet, and invokes the smart contract to broadcast the first data packet, the public key of the first node, and the second data packet to each node of the blockchain network, so that each node returns a consensus-reaching response when the data packet obtained by decrypting the second data packet based on the public key of the first node is the same as the first data packet; When the first node receives the consensus reaching response returned by each node and the consensus condition is met, the first node calls the smart contract to generate a block corresponding to the first data packet, and adds the block to the blockchain; The first node obtains the first address of the block generated by the smart contract and a first token required to access the first address, and returns an on-chain response to the first client in response to the on-chain request, where the on-chain response includes the first address and the first token; The second node receives a read data request sent by a second client, where the read data request includes the first token obtained by the second client based on a transaction between the second node and the first node; The second node accesses the first address through the first token, and obtains the first data packet from the block indicated by the first address; The second node returns the first data packet to the account of the second client in response to the read data request, and the account of the second client does not belong to the AR game to which the account of the first client belongs.
2. The method according to claim 1, characterized in that The method further comprises: The first node receives a transaction request sent by the first client, where the transaction request includes the first token and a transaction identifier of the transaction request; The first node calls the smart contract to freeze the first token, and broadcasts the transaction identifier to each node of the blockchain network, where the transaction identifier is used to initiate a transaction in the blockchain network.
3. The method according to claim 2, characterized in that The method further comprises: The second node receives a transaction response sent by the second client, where the transaction response includes the transaction asset and the transaction identifier; The second node calls the smart contract to freeze the transaction assets, and sends the transaction response to the account of the first client through the first node; The first node receives a transaction confirmation request sent by the first client, where the transaction confirmation request includes the transaction identifier; The first node calls the smart contract to unfreeze the transaction assets, and transfers the unfrozen transaction assets from the account of the second client to the account of the first client; The first node calls the smart contract to unfreeze the first token, and transfers the unfrozen first token from the account of the first client to the account of the second client.
4. The method according to any one of claims 1 to 3, characterized in that: The first pet data includes one or more of a pet identification, three-dimensional image data, attributes, and skills, and the three-dimensional image data is a three-view image of the pet.
5. The method according to claim 1, characterized in that The blockchain network includes N nodes, and the method further includes: The first node counts the number of consensus-reaching responses received; When the number is greater than N / 2, the first node determines that the consensus-reaching responses returned by each node meet the consensus condition.
6. The method according to claim 1, characterized in that The calling of the smart contract to generate a block corresponding to the first data packet includes: The smart contract is called to encrypt the first data packet using the public key of the first node, and the smart contract is called to generate a block using the encrypted first data packet.
7. A data rights confirmation device, characterized in that: When the device is used for a first node, it includes: A transceiver module, configured to receive an uplink request sent by a first client, wherein the uplink request includes a first data packet packaged with first pet data, wherein the first pet data is pet data of a virtual pet obtained by an account of the first client in an AR game; A digital signature module, used to call the smart contract to digitally sign the first data packet using a private key to obtain a second data packet; A broadcast module, configured to call the smart contract to broadcast the first data packet, the public key, and the second data packet to each node of the blockchain network, so that each node returns a consensus response when a data packet obtained by decrypting the second data packet based on the public key is the same as the first data packet; A generation module, configured to, when receiving consensus-reaching responses returned by each node and satisfying the consensus conditions, call the smart contract to generate a block corresponding to the first data packet, and add the block to the blockchain; An acquisition module, used to acquire a first address of the block generated by the smart contract and a first token required to access the first address; The transceiver module is configured to return an uplink response to the first client in response to the uplink request, wherein the uplink response includes the first address and the first token; When the device is used for a second node, it includes: a transceiver module, configured to receive a read data request sent by a second client, wherein the read data request includes the first token acquired by the second client based on a transaction between the second node and the first node; an acquisition module, configured to access the first address through the first token, and acquire the first data packet from the block indicated by the first address; The transceiver module is used to return the first data packet to the account of the second client in response to the read data request, and the account of the second client does not belong to the AR game to which the account of the first client belongs.
8. An electronic device, characterized in that: include: processor, memory, and transceiver; The processor is connected to a memory and a transceiver respectively, wherein the memory is used to store program codes, the transceiver is used to communicate with each node and / or client in the blockchain network, and the transceiver is specifically used to receive a chain request sent by a first client, wherein the chain request includes a first data packet packaged with first pet data, and the first pet data is pet data of a virtual pet obtained by the account of the first client in an AR game; When the electronic device is used in a first node, the processor is used to call the program code to perform the following operations: Calling the smart contract to digitally sign the first data packet using the private key to obtain a second data packet, and calling the smart contract to broadcast the first data packet, the public key, and the second data packet to each node of the blockchain network, so that each node returns a consensus response when the data packet obtained by decrypting the second data packet based on the public key is the same as the first data packet; When the consensus reaching responses returned by each node meet the consensus conditions, the smart contract is called to generate a block corresponding to the first data packet, and the block is added to the blockchain; Obtaining a first address of the block generated by the smart contract and a first token required to access the first address; The transceiver is further specifically configured to return an uplink response to the first client in response to the uplink request, wherein the uplink response includes the first address and the first token; When the electronic device is used for a second node, the transceiver is used to receive a read data request sent by a second client, wherein the read data request includes the first token obtained by the second client based on a transaction between the second node and the first node; The processor is configured to access the first address through the first token and obtain the first data packet from the block indicated by the first address; The transceiver is used to return the first data packet to the account of the second client in response to the read data request, and the account of the second client does not belong to the AR game to which the account of the first client belongs.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When a processor executes the program instructions, the method according to any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Transaction method on block chain and equipment thereof
CN110189130A
Blockchain-based system, and electronic apparatus and method in the system
US20170346833A1