Blockchain-based virtual resource intercommunication method, device and related equipment

By encrypting and verifying the conversion request information of virtual resources in the blockchain alliance chain, the problem of information leakage and resource loss during the virtual resource interoperability process in the centralized system is solved, and safe and privacy-protected virtual resource interoperability is achieved.

CN112116400BActive Publication Date: 2024-09-06PINGAN YIQIANBAO E COMMERCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011040633.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2024-09-06
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

The existing centralized virtual resource points system has risks of information leakage, virtual resource tampering, and 'double spending' during the interaction process, and the redemption process is complicated.

Method used

A decentralized virtual resource interoperability method based on blockchain is adopted to ensure information security and prevent resource loss by generating and verifying encrypted conversion request information in the alliance chain. Specific steps include receiving user conversion requests, encapsulating them into conversion request information, generating and encrypting symmetric keys, sending them to alliance chain nodes for verification and storage, and updating user virtual resource values.

Benefits of technology

It achieves safe interoperability of virtual resources, avoids information leakage and resource loss, simplifies the exchange process, and improves user privacy protection and system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112116400B
    Figure CN112116400B
Patent Text Reader

Abstract

The present invention discloses a method, device, computer equipment and storage medium for intercommunication of virtual resources based on blockchain, which is applied to the field of blockchain technology and is used to solve the technical problem that virtual resources of existing different platforms are prone to information leakage in the process of intercommunication. The method provided by the present invention includes: when receiving a conversion request of a user's virtual resource, obtaining a packaging element according to the conversion request, and packaging the packaging element into conversion request information; generating a symmetric key for the assembled conversion request information; encrypting the symmetric key by a pre-obtained public key; encrypting the assembled conversion request by the symmetric key; sending the encrypted symmetric key and the encrypted conversion request to the node of the alliance chain; when each node of the alliance chain verifies the encrypted conversion request, the encrypted symmetric key and the conversion request are saved in the node of the alliance chain, and the value of the user's virtual resource is updated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based virtual resource intercommunication method, device, computer equipment and storage medium. Background Art

[0002] Points are widely used in daily life. In order to promote consumption and improve user loyalty and satisfaction with the brand, merchants usually issue consumption points to users; in order to improve employee work enthusiasm, companies usually choose to issue points to employees as benefits. In some platforms, points can be spent as "money", and different points can be used for shopping, redemption, and cash reduction on different merchant platforms.

[0003] At present, there are more examples of virtual resources on the Internet than points, such as Bitcoin and virtual game coins in different regions. People are often troubled by some problems in the process of using virtual resources. Let's take points as an example. At present, basically all point systems are centralized. All merchants do not forget to mention when issuing points. The final right of interpretation belongs to the merchant. The centralized system cannot truly guarantee the rights and interests of users. The reason is that the centralized point systems are isolated from each other. Users may have a certain amount of points in each system, but because the amount is not large, it may not be consumed on each point platform, resulting in a waste of user points. When points can be spent as "money", it has certain digital asset attributes. Unlike physical assets, digital assets are always easier to tamper with and more likely to be damaged by the "double-spending" problem. At present, the exchange of points on different system platforms usually involves multiple different merchant platforms, and clearing, settlement and reconciliation are often very complicated.

[0004] In response to these shortcomings, there are now some virtual resource interoperability platforms based on blockchain technology, but these platforms often fail to take into account that building a decentralized virtual resource interoperability system also requires taking privacy into account. No merchant is willing to let other merchants or even rival merchants know their member user information and the details of the issuance, redemption or transaction of virtual resources. Summary of the invention

[0005] The embodiments of the present invention provide a blockchain-based virtual resource intercommunication method, device, computer equipment and storage medium to solve the technical problem that information leakage is easily caused in the process of intercommunication of virtual resources on different platforms.

[0006] A method for intercommunication of virtual resources based on blockchain, the method being applied to a computer device, the method comprising:

[0007] When receiving a conversion request for converting a user's virtual resources between different merchants in the same alliance chain, obtaining a packaging element according to the conversion request, and packaging the packaging element into conversion request information;

[0008] Generate a symmetric key for the assembled conversion request information;

[0009] The symmetric key is encrypted by using the pre-obtained public key to obtain an encrypted symmetric key;

[0010] Encrypting the assembled conversion request information by using the symmetric key to obtain encrypted conversion request information;

[0011] Sending the encrypted symmetric key and the encrypted conversion request information to the node of the alliance chain;

[0012] When the node of the alliance chain verifies the encrypted conversion request information, the encrypted symmetric key and the encrypted conversion request information are stored in the node of the alliance chain, and the value of the user's virtual resources in the different merchants is updated.

[0013] A virtual resource intercommunication device based on blockchain, the device comprising:

[0014] The encapsulation module is used to, when receiving a conversion request for converting a user's virtual resources between different merchants in the same alliance chain, obtain an encapsulation element according to the conversion request, and encapsulate the encapsulation element into conversion request information;

[0015] A key generation module, used for generating a symmetric key for the assembled conversion request information;

[0016] A first encryption module, used to encrypt the symmetric key by using a pre-obtained public key to obtain an encrypted symmetric key;

[0017] A second encryption module, used to encrypt the assembled conversion request information by using the symmetric key to obtain encrypted conversion request information;

[0018] A sending module, used for sending the encrypted symmetric key and the encrypted conversion request information to the node of the alliance chain;

[0019] The update module is used to save the encrypted symmetric key and the encrypted conversion request information in the node of the alliance chain when the node of the alliance chain verifies the encrypted conversion request information, and update the value of the user's virtual resources in the different merchants.

[0020] A computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned blockchain-based virtual resource intercommunication method when executing the computer program.

[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned blockchain-based virtual resource intercommunication method.

[0022] The blockchain-based virtual resource intercommunication method, device, computer equipment and storage medium proposed in the present invention, when receiving a conversion request for converting a user's virtual resources between different merchants in the same alliance chain, obtains an encapsulation element according to the conversion request, encapsulates the encapsulation element into conversion request information, generates a symmetric key for the assembled conversion request information, and then encrypts the symmetric key by using a pre-obtained public key to obtain an encrypted symmetric key, and then encrypts the assembled conversion request information by using the symmetric key to obtain the encrypted conversion request information, and sends the encrypted symmetric key and the encrypted conversion request information to the nodes of the alliance chain, so that each node of the alliance chain can verify the encrypted conversion request information, and when the virtual resource conversion is successful, the user can decrypt the encrypted symmetric key, and then decrypt the encrypted conversion request information by using the decrypted initial symmetric key to obtain the user's virtual resources in different merchants after the virtual resource conversion. The encrypted symmetric key and the encrypted conversion request information are stored in the nodes of the alliance chain when the node of the alliance chain verifies the encrypted conversion request information, and the values ​​of the virtual resources of the user in the different merchants are updated. The blockchain-based virtual resource intercommunication method, device, computer equipment and storage medium proposed in the present invention verify the encrypted conversion request information at each node of the alliance chain in the blockchain when realizing the conversion of virtual resources, and update the values ​​of the virtual resources of the user in the different merchants when the verification is passed, so as to avoid the virtual resources from being tampered with, and then avoid the virtual resources from being "double-spent" and causing resource loss. On the other hand, the conversion request of the virtual resource is stored in each node of the alliance chain in an encrypted form, so that even if others obtain the conversion request in the alliance chain, they cannot know the specific content contained in the conversion request, so that the virtual resources of different platforms will not cause information leakage in the process of intercommunication. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0024] Figure 1 It is a schematic diagram of an application environment of a method for intercommunication of virtual resources based on blockchain in one embodiment of the present invention;

[0025] Figure 2 It is a flow chart of a method for intercommunication of virtual resources based on blockchain in one embodiment of the present invention;

[0026] Figure 3 Embodiment of the present invention Figure 2 A further detailed flowchart of step S103;

[0027] Figure 4 Embodiment of the present invention Figure 2 A further detailed flowchart of step S101 in FIG.

[0028] Figure 5 It is a structural schematic diagram of a virtual resource intercommunication device based on blockchain in one embodiment of the present invention;

[0029] Figure 6 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] This application provides a blockchain-based virtual resource intercommunication method, which can be applied in Figure 1In the application environment, the blockchain is composed of several nodes that can communicate with each other. Each node can be regarded as a block storage. Each block storage is used to save data. Each data node contains all data. The block storage data has a complete historical record and can be quickly restored and expanded. The regional chain is divided into public chain, private chain and alliance chain. Any node in the public chain is open. Everyone can participate in the blockchain calculation, and anyone can download and obtain complete blockchain data. Private chain is that some blockchains do not want anyone to participate in this system. It is not open to the public. It is suitable for internal data management and auditing or open testing of specific institutions. Alliance chain means that the permissions of each node participating are completely equal. Everyone can achieve trusted data exchange without full mutual trust. Each node of the alliance chain usually has a corresponding entity organization. Only after authorization can they join and exit the network. In the process of using the entire blockchain backup system, digital signatures are required. Digital signatures design a hash function, the sender's public key, and the sender's private key. The blockchain has complete distributed storage characteristics. In fact, it is a larger network data storage and uses a data structure in the form of a "hash algorithm" to save basic data. The blockchain-based virtual resource intercommunication method proposed in this embodiment is applicable to alliance chains.

[0032] In one embodiment, if Figure 2 As shown, a method for intercommunication of virtual resources based on blockchain is provided, and the method is applied in Figure 1 Taking the computer device where the user who initiates the transaction request is located as an example, the method includes the following steps S101 to S106.

[0033] S101. When receiving a conversion request for converting a user's virtual resources between different merchants in the same alliance chain, obtain a packaging element according to the conversion request, and encapsulate the packaging element into conversion request information.

[0034] Blockchain is a distributed database with a specific structure. It is an ordered linked list in which each block is connected to the previous block. That is to say, blocks are stored in the order of insertion, and each block is connected to the previous block. Such a structure allows users to quickly obtain the latest block on the chain and efficiently retrieve a block through hashing. The architecture of the blockchain network in this solution is divided into three major layers and six sub-layers, including the data layer and network layer under the basic network layer, the consensus layer under the intermediate protocol layer, the incentive layer and the contract layer, and the application service layer.

[0035] A consortium chain is a blockchain whose consensus process is controlled by pre-selected nodes. For example, a community of 15 financial institutions, each of which runs a node, needs to obtain confirmation from 10 of them (2 / 3 confirmation) for each block to take effect. The blockchain may allow everyone to read it, or it may be limited to participants, or it may take a hybrid route, such as the root hash of the block and its API (Application Programming Interface) being open to the public, and the API can be used by the outside world to make a limited number of queries and obtain information about the status of the blockchain. These consortium chains can be considered "partially decentralized."

[0036] In this step, the conversion request, for example, transaction request information generated when points are redeemed, can be obtained from the user account and the information bound to the user account. The information contained in the conversion request assembled in the encapsulation element includes, for example, but is not limited to, the user information of the user, the account information of the different merchants, the value of the converted virtual resources, etc.

[0037] Taking the virtual resource as points as an example, the assembled conversion request includes the user information initiating the points exchange, the merchant account information of both parties in the points exchange, the exchange transaction amount, etc.

[0038] Furthermore, the assembled conversion request carries the transaction sender, transaction receiver, transaction amount and transaction time. For example, during implementation, the assembled conversion request information is txInfo. The format of the assembled conversion request is, for example:

[0039] txInfo{fromAddress:{}; toAddress:{}; transAmount:{}; userInfo:{}};

[0040] Among them, fromAddress represents the transaction sender address, toAddress represents the transaction receiver address, transAmount represents the transaction amount, and userInfo represents the transaction user.

[0041] It can be seen that the conversion request information mainly assembles the sender of the transaction, the receiver of the transaction, the transaction amount and the user who initiated the transaction. Other information can also be assembled. According to what information needs to be obtained during subsequent decryption, the corresponding information can be assembled into the conversion request information at this time.

[0042] Figure 4 Embodiment of the present invention Figure 2In a further detailed flow chart of step S101 in FIG. 1 , in one embodiment, the package element includes a user account, an account of the first merchant bound to the user account, an account of the second merchant bound to the user account, and a transfer value of the virtual resource, such as Figure 4 As shown, the above step S101 further includes the following steps S401 and S403.

[0043] S401: Acquire the user account, the first merchant account bound to the user account, and the second merchant account bound to the user account.

[0044] The user's account may be a personal account of the user's points on a shopping platform, the account of the first merchant may be a points account of the first merchant, and the account of the second merchant may be a points account of the second merchant. When a user's account has points on different merchant system platforms at the same time, the user's account is bound to the accounts of each merchant system platform respectively.

[0045] S402: Receive a transfer value of the virtual resource input by a user.

[0046] In one embodiment, the transfer value of the virtual resource can be transferred from the account of the first merchant to the account of the second merchant, or from the account of the second merchant to the account of the first merchant, depending on the operation instruction input by the user. The virtual resource can be points, bitcoins, game coins, etc., and the transfer value of the virtual resource can be the specific value of the transferred points, bitcoins, or game coins.

[0047] S403: Encapsulate the user account, the first merchant account bound to the user account, the second merchant account bound to the user account, and the transfer value of the virtual resource in different fields of the conversion request information, respectively.

[0048] Furthermore, the step of respectively encapsulating the user account, the account of the first merchant bound to the user account, the account of the second merchant bound to the user account, and the transfer value of the virtual resource in different fields of the conversion request information in step S403 can be implemented in the following manner:

[0049] Acquire a mapping relationship between business data in the payload conversion request information and fields of the payload conversion request information, wherein the business data includes a user account, an account of the first merchant bound to the user account, an account of the second merchant bound to the user account, and a transfer value of the virtual resource;

[0050] According to the mapping relationship, the business data including the user account, the account of the first merchant bound to the user account, the account of the second merchant bound to the user account and the transfer value of the virtual resource are stored in corresponding fields respectively to obtain the conversion request information.

[0051] S102: Generate a symmetric key for the assembled conversion request information.

[0052] There are many algorithms for generating symmetric keys, such as DES (Data Encryption Standard) encryption algorithm, AES (Advanced Encryption Standard) encryption algorithm, etc. In this embodiment, the AES encryption algorithm is used to generate the symmetric key.

[0053] The symmetric key corresponds to each of the conversion requests, that is, a corresponding symmetric key will be generated for each of the conversion requests.

[0054] S103. Encrypt the symmetric key using the pre-obtained public key to obtain an encrypted symmetric key.

[0055] The principle of public key encryption is to use a pair of keys to complete encryption and decryption operations respectively, one is publicly released, that is, the public key (public key), and the other is saved by the node that generates the pair of keys, that is, the private key (private key). The sender of the information uses the public key to encrypt, and the receiver of the information uses the private key to decrypt.

[0056] Furthermore, the public key in this embodiment is the public key of the merchant that performs the points redemption. The symmetric key is used to decrypt the above conversion request information.

[0057] S104. Encrypt the assembled conversion request information using the symmetric key to obtain encrypted conversion request information.

[0058] The working principle of encrypting the symmetric key through the RSA algorithm is as follows:

[0059] RSA encryption: ciphertext = plaintext E mod N;

[0060] RSA decryption: plaintext = ciphertext D mod N;

[0061] Here, the combination of E and N, namely (N, e), is the public key of the corresponding merchant used for encryption, and the combination of D and N, namely (N, d), is the private key of the corresponding merchant used for decryption.

[0062] S105. Send the encrypted symmetric key and the encrypted conversion request information to the node of the alliance chain.

[0063] Since different merchants are located in the same alliance chain of the blockchain, the encrypted symmetric key and the encrypted conversion request information are sent to the node of the alliance chain. Further, in the above step S105, sending the encrypted symmetric key and the encrypted conversion request information to the node of the alliance chain specifically includes:

[0064] The encrypted symmetric key corresponding to the first merchant and the encrypted symmetric key corresponding to the second merchant are both sent to the node of the alliance chain.

[0065] The symmetric key corresponding to the first merchant is used by the service node of the first merchant to decrypt the encrypted symmetric key according to the private key of the first merchant to obtain the original symmetric key; the symmetric key corresponding to the second merchant is used by the service node of the second merchant to decrypt the encrypted symmetric key according to the private key of the second merchant to obtain the original symmetric key. Furthermore, the service node of the first merchant and the service node of the second merchant are both nodes in the alliance chain.

[0066] S106. When the node of the alliance chain verifies the encrypted conversion request information, the encrypted symmetric key and the encrypted conversion request information are stored in the node of the alliance chain, and the value of the virtual resources of the user in the different merchants is updated.

[0067] When the nodes of the alliance chain verify the encrypted conversion request information, the encrypted conversion request information and the encrypted symmetric key can be verified and propagated to each node in the alliance chain, so that each node in the entire network can verify the correctness of the recording results of other nodes while participating in the recording. Only when most nodes (or even all nodes) of the entire network verify the conversion request message correctly at the same time, or all nodes participating in the conversion request message unanimously pass the comparison results, can the authenticity of the record be recognized by the entire network and the recorded data can be written into the block.

[0068] Due to the distributed architecture of the alliance chain, the information of value exchange is transmitted to the entire network in the alliance chain through distributed transmission, and the content of the information data is determined by distributed bookkeeping. The block data is generated by timestamp and then transmitted to each node through distributed transmission to realize the dissemination and distributed storage of conversion request information.

[0069] There are many ways to verify each node. For example, in the popular public chain Ethereum, the verification is successful if more than half of the nodes on the alliance chain pass the verification. The consensus used for verification is the raft consensus. As long as the master node passes the verification, the verification is successful. The advantage of using the raft consensus for verification is that it is fast. The process of verifying the conversion request is actually to verify the legitimacy of the transaction. For example, in the points transaction, the verification process in each node of the alliance chain includes:

[0070] Verify whether the sender's balance is greater than the transaction amount. If so, verify whether the sender and receiver of the transaction are in the merchant whitelist. If so, verify whether the balance of the merchant and the user after the transaction is correct. If so, the verification is considered successful.

[0071] When the node of the alliance chain verifies the encrypted conversion request information, the balance of the user bound to the user account is updated to the converted value, the balance in the first merchant bound to the user account is updated, and the balance in the second merchant bound to the user account is updated. The updated values ​​of the user's virtual resources in the different merchants and the user's balance are stored in each node of the alliance chain.

[0072] The blockchain-based virtual resource intercommunication method proposed in this embodiment, when receiving a conversion request for converting a user's virtual resources between different merchants in the same alliance chain, obtains a packaging element according to the conversion request, encapsulates the packaging element into conversion request information, generates a symmetric key for the assembled conversion request information, and then encrypts the symmetric key by using a pre-obtained public key to obtain an encrypted symmetric key, and then encrypts the assembled conversion request information by using the symmetric key to obtain the encrypted conversion request information, and sends the encrypted symmetric key and the encrypted conversion request information to the nodes of the alliance chain, so that each node of the alliance chain can verify the encrypted conversion request information, and when the virtual resource conversion is successful, the user can decrypt the encrypted symmetric key, and then decrypt the encrypted conversion request information by using the decrypted initial symmetric key to obtain the value and usage of the user's virtual resources in different merchants after the virtual resource conversion. The encrypted conversion request information is verified by the node of the alliance chain, and the encrypted symmetric key and the encrypted conversion request information are stored in the node of the alliance chain, and the value of the virtual resources of the user in the different merchants is updated. The blockchain-based virtual resource intercommunication method, device, computer equipment and storage medium proposed in the present invention verify the encrypted conversion request information at each node of the alliance chain in the blockchain when realizing the conversion of virtual resources, and update the value of the virtual resources of the user in the different merchants when the verification is passed, so as to avoid the virtual resources from being tampered with, and further avoid the virtual resources from being "double-spent" and causing resource loss. On the other hand, the virtual resource conversion request is stored in each node of the alliance chain in an encrypted form, so that even if others obtain the conversion request in the alliance chain, they cannot know the specific content contained in the conversion request, so that the virtual resources of different platforms will not cause information leakage in the process of intercommunication.

[0073] Figure 3 Embodiment of the present invention Figure 2 A further detailed flowchart of step S103 is shown in FIG. Figure 3 As shown, the above step S103 further includes the following steps S301 and S302.

[0074] S301. Encrypt the symmetric key with the pre-obtained public key of the first merchant to obtain the encrypted symmetric key corresponding to the first merchant.

[0075] Optionally, the public key of the first merchant is generated by RSA (Ron Rivest, Adi Shamir, Leonard Adleman) algorithm, which specifically includes the following steps (1) to (4):

[0076] (1) Arbitrarily select two large prime numbers p1 and q1, p1 is not equal to q1, and calculate N1=p1*q1;

[0077] (2) According to the Euler function ψ(N1) = ψ(p1)*ψ(q1) = (p1-1)*(q1-1);

[0078] (3) Select an integer e1, e1<ψ(N1) and e1 is relatively prime to ψ(N1), and find the modular inverse element d1 of e1 with respect to ψ(N1);

[0079] (4) (N1, e1) represents the public key, and (N1, d1) represents the private key. The 16-bit public key pub_A of the first merchant and the private key pri_A of the first merchant can be obtained through bit encoding.

[0080] The conversion request information encrypted by the first merchant's public key pub_A can only be decrypted by the first merchant's private key pri_A.

[0081] Among them, the public key pub_A and private key pri_A of the first merchant are generated at the service node of the first merchant. After the public key pub_A and private key pri_A are generated, the public key pub_A will be sent to the blockchain, and other nodes in the same alliance chain can obtain the public key pub_A, while the private key pri_A is stored locally in the first merchant, and other nodes in the blockchain cannot directly obtain the private key pri_A.

[0082] S302: Encrypt the symmetric key with the pre-obtained public key of the second merchant to obtain an encrypted symmetric key corresponding to the second merchant.

[0083] The method for generating the public key of the second merchant is similar to the step of generating the public key of the first merchant, and specifically includes the following steps (5) to (8):

[0084] (5) Arbitrarily select two large prime numbers p2 and q2, p2 is not equal to q2, and calculate N2=p2*q2;

[0085] (6) According to the Euler function ψ(N2) = ψ(p2)*ψ(q2) = (p2-1)*(q2-1);

[0086] (7) Select an integer e2, e2<ψ(N2) and e2 is relatively prime to ψ(N2), and find the modular inverse element d2 of e2 with respect to ψ(N2);

[0087] (8) (N2, e2) represents the public key, (N2, d2) represents the private key, and the 16-bit public key pub_B of the second merchant and the private key pri_B of the first merchant can be obtained through bit encoding.

[0088] The conversion request information encrypted by the public key pub_B of the second merchant can only be decrypted by the private key pri_B of the second merchant.

[0089] Furthermore, the public key pub_B and private key pri_B of the second merchant are generated at the service node of the second merchant. After the public key pub_B and private key pri_B are generated, the public key pub_B will be sent to the blockchain, and other nodes in the same alliance chain can obtain the public key pub_B, while the private key pri_B is stored locally in the second merchant, and other nodes in the blockchain cannot directly obtain the private key pri_B.

[0090] Optionally, after the above step S106, the blockchain-based virtual resource intercommunication method further includes the following steps:

[0091] Obtaining the encrypted symmetric key corresponding to the first merchant and the encrypted conversion request information from the alliance chain;

[0092] Sending the encrypted symmetric key corresponding to the first merchant to the first merchant service node;

[0093] Receiving the symmetric key responded by the first merchant service node, where the symmetric key is obtained by the first merchant service node decrypting the encrypted symmetric key corresponding to the first merchant using the private key of the first merchant;

[0094] The encrypted conversion request information is decrypted using the symmetric key to obtain conversion information of the user's virtual resources between different merchants.

[0095] This embodiment proposes a method in which a user can obtain conversion information of the user's virtual resources between different merchants by decrypting the conversion request information, that is, by sending a request message to a first merchant service node, requesting the merchant service node to decrypt the encrypted symmetric key corresponding to the first merchant by the private key of the first merchant, and then decrypting the encrypted conversion request information by the decrypted symmetric key to obtain the conversion information of the user's virtual resources between different merchants, so as to facilitate the user to understand the exchange status of virtual resources in the system account and improve the user experience.

[0096] In other embodiments, after the above step S106, the blockchain-based virtual resource intercommunication method further includes the following steps:

[0097] Obtaining the encrypted symmetric key corresponding to the second merchant and the encrypted conversion request information from the alliance chain;

[0098] Sending the encrypted symmetric key corresponding to the second merchant to the second merchant service node;

[0099] receiving the symmetric key responded by the second merchant service node, where the symmetric key is obtained by the second merchant service node decrypting the encrypted symmetric key corresponding to the second merchant by using the private key of the second merchant;

[0100] The encrypted conversion request information is decrypted by using the symmetric key to obtain conversion information of the user's virtual resources between different merchants.

[0101] This embodiment proposes another way in which a user can obtain conversion information of the user's virtual resources between different merchants by decrypting the conversion request information. The conversion information of the user's virtual resources between different merchants is obtained by requesting the second merchant service node to parse the conversion request according to the symmetric key. On the one hand, it effectively prevents the double-spending problem that may be caused by transaction tampering, and on the other hand, it facilitates both parties to the transaction to understand the details of the transaction.

[0102] This embodiment decentralizes the traditional points system. The decentralized points system protects the rights and interests of users. Since the system in this embodiment includes different merchants in the same alliance chain, the points under different merchants can be exchanged or converted, which solves the problem that the points of users at different merchants are scattered and cannot be used completely. Since the data on the blockchain cannot be tampered with, the points voucher that has reached a certain state cannot be changed to the initial state, resulting in repeated spending of points. Moreover, the source and destination of any points issued and traded can be traced, which effectively prevents the abuse of points. The points transaction is encrypted, and only the two parties to the transaction can decrypt the transaction, which guarantees the privacy and security of merchants and users in the decentralized system.

[0103] Compared with the traditional points intercommunication system, in the blockchain-based virtual resource intercommunication method implemented in this embodiment, each merchant only needs to connect once to communicate points with all merchants on the blockchain. Due to the blockchain distributed ledger, real-time reconciliation and flexible settlement can be achieved. Compared with the current blockchain points system, the function of privacy protection is added, and the advantages of blockchain are fully utilized without making major changes to the existing points system, and the technical cost is low.

[0104] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0105] In one embodiment, a virtual resource intercommunication device based on blockchain is provided, and the virtual resource intercommunication device based on blockchain corresponds to the virtual resource intercommunication method based on blockchain in the above embodiment. Figure 5 As shown, the blockchain-based virtual resource intercommunication device 100 includes an encapsulation module 11, a key generation module 12, a first encryption module 13, a second encryption module 14, a sending module 15 and an update module 16. The functional modules are described in detail as follows:

[0106] The encapsulation module 11 is used to, when receiving a conversion request for converting a user's virtual resources between different merchants in the same alliance chain, obtain encapsulation elements according to the conversion request and encapsulate the encapsulation elements into conversion request information.

[0107] The key generation module 12 is used to generate a symmetric key for the assembled conversion request information.

[0108] The first encryption module 13 is used to encrypt the symmetric key using a pre-obtained public key to obtain an encrypted symmetric key.

[0109] The second encryption module 14 is used to encrypt the assembled conversion request information by using the symmetric key to obtain the encrypted conversion request information.

[0110] The sending module 15 is used to send the encrypted symmetric key and the encrypted conversion request information to the node of the alliance chain.

[0111] The updating module 16 is used to save the encrypted symmetric key and the encrypted conversion request information in the node of the alliance chain when the node of the alliance chain verifies the encrypted conversion request information, and updates the value of the virtual resources of the user in the different merchants.

[0112] In one embodiment, the first encryption module specifically includes:

[0113] A first encryption unit, used to encrypt the symmetric key with a pre-obtained public key of the first merchant to obtain an encrypted symmetric key corresponding to the first merchant;

[0114] The second encryption unit is used to encrypt the symmetric key with the pre-obtained public key of the second merchant to obtain the encrypted symmetric key corresponding to the second merchant.

[0115] Furthermore, the encapsulation module specifically includes:

[0116] An account acquisition unit, used to acquire the user account, the account of the first merchant bound to the user account, and the account of the second merchant bound to the user account;

[0117] A transfer value receiving unit, used for receiving a transfer value of the virtual resource input by a user;

[0118] The encapsulation unit is used to encapsulate the user account, the account of the first merchant bound to the user account, the account of the second merchant bound to the user account, and the transfer value of the virtual resource in different fields of the conversion request information respectively.

[0119] Furthermore, the packaging unit specifically includes:

[0120] a mapping relationship acquisition unit, configured to acquire a mapping relationship between business data in the payload conversion request information and a field of the payload conversion request information, wherein the business data includes a user account, an account of the first merchant bound to the user account, an account of the second merchant bound to the user account, and a transfer value of the virtual resource;

[0121] A storage unit is used to store the business data including the user account, the account of the first merchant bound to the user account, the account of the second merchant bound to the user account, and the transfer value of the virtual resource in corresponding fields according to the mapping relationship to obtain the conversion request information.

[0122] Furthermore, the sending module 15 is specifically used to send the encrypted symmetric key corresponding to the first merchant and the encrypted symmetric key corresponding to the second merchant to the node of the alliance chain.

[0123] Optionally, the blockchain-based virtual resource intercommunication device 100 further includes:

[0124] A first acquisition module, used to obtain the encrypted symmetric key corresponding to the first merchant and the encrypted conversion request information from the alliance chain;

[0125] A first sending module, configured to send an encrypted symmetric key corresponding to the first merchant to a first merchant service node;

[0126] The first receiving module is used to receive the symmetric key responded by the first merchant service node, where the symmetric key is obtained by the first merchant service node decrypting the encrypted symmetric key corresponding to the first merchant using the private key of the first merchant.

[0127] The third decryption module is used to decrypt the encrypted conversion request information using the symmetric key received by the first receiving module to obtain conversion information of the user's virtual resources between different merchants.

[0128] Furthermore, the blockchain-based virtual resource intercommunication device 100 further includes:

[0129] A second acquisition module, used to acquire the encrypted symmetric key corresponding to the second merchant and the encrypted conversion request information from the alliance chain;

[0130] A second sending module, configured to send the encrypted symmetric key corresponding to the second merchant to a second merchant service node;

[0131] A second receiving module, configured to receive the symmetric key responded by the second merchant service node, where the symmetric key is obtained by the second merchant service node decrypting the encrypted symmetric key corresponding to the second merchant using the private key of the second merchant;

[0132] The third decryption module is further used to decrypt the encrypted conversion request information using the symmetric key received by the second receiving module to obtain conversion information of the user's virtual resources between different merchants.

[0133] The meaning of "first" and "second" in the above modules / units is only to distinguish different modules / units, and is not used to define which module / unit has a higher priority or other limiting meanings. 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 device that includes a series of steps or modules is not necessarily limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices. The division of modules in this application is only a logical division, and there may be other division methods when implemented in actual applications.

[0134] For the specific definition of the intercommunication device of virtual resources based on blockchain, please refer to the definition of the intercommunication method of virtual resources based on blockchain above, which will not be repeated here. Each module in the above-mentioned intercommunication device of virtual resources based on blockchain can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0135] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server through a network connection. When the computer program is executed by the processor, a method for intercommunication of virtual resources based on blockchain is implemented.

[0136] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for intercommunication of virtual resources based on blockchain in the above embodiment are implemented, such as Figure 2 Steps 101 to 106 shown in the figure and other extensions of the method and extensions of related steps. Alternatively, when the processor executes the computer program, the functions of each module / unit of the intercommunication device of virtual resources based on blockchain in the above embodiment are realized, for example Figure 5 The functions of modules 11 to 16 are shown in Figure 1. To avoid repetition, they will not be described here.

[0137] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and various interfaces and lines are used to connect various parts of the entire computer device.

[0138] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the computer device by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, video data, etc.), etc.

[0139] The memory may be integrated into the processor or may be arranged separately from the processor.

[0140] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for intercommunication of virtual resources based on blockchain in the above embodiment are implemented, such as Figure 2 Steps 101 to 106 shown in the figure and other extensions of the method and extensions of related steps. Alternatively, when the computer program is executed by the processor, the functions of each module / unit of the intercommunication device of virtual resources based on blockchain in the above embodiment are realized, for example Figure 5 The functions of modules 11 to 16 are shown in Figure 1. To avoid repetition, they will not be described here.

[0141] The blockchain-based virtual resource intercommunication method, device, computer equipment and storage medium proposed in this embodiment, when receiving a conversion request for converting a user's virtual resources between different merchants in the same alliance chain, obtains a packaging element according to the conversion request, encapsulates the packaging element into conversion request information, generates a symmetric key for the assembled conversion request information, and then encrypts the symmetric key with a pre-obtained public key to obtain an encrypted symmetric key, and then encrypts the assembled conversion request information with the symmetric key to obtain the encrypted conversion request information, and sends the encrypted symmetric key and the encrypted conversion request information to the nodes of the alliance chain. On the one hand, each node of the alliance chain verifies the encrypted conversion request information. On the other hand, when the virtual resource conversion is successful, the user can decrypt the encrypted symmetric key, and then decrypt the encrypted conversion request information with the decrypted initial symmetric key to obtain the user's virtual resources in different merchants after the virtual resource conversion. The encrypted symmetric key and the encrypted conversion request information are stored in the nodes of the alliance chain when the node of the alliance chain verifies the encrypted conversion request information, and the values ​​of the virtual resources of the user in the different merchants are updated. The blockchain-based virtual resource intercommunication method, device, computer equipment and storage medium proposed in the present invention verify the encrypted conversion request information at each node of the alliance chain in the blockchain when realizing the conversion of virtual resources, and update the values ​​of the virtual resources of the user in the different merchants when the verification is passed, so as to avoid the virtual resources from being tampered with, and further avoid the virtual resources from being "double-spent" and causing resource loss. On the other hand, the conversion request of the virtual resource is stored in each node of the alliance chain in an encrypted form, so that even if others obtain the conversion request in the alliance chain, they cannot know the specific content contained in the conversion request, so that the virtual resources of different platforms will not cause information leakage in the process of intercommunication.

[0142] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0143] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0144] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for intercommunication of virtual resources based on blockchain, characterized in that: The method is applied to a computer device, and the method comprises: When receiving a conversion request for converting a user's virtual resources between different merchants in the same alliance chain, obtaining a packaging element according to the conversion request, and packaging the packaging element into conversion request information; Generating a symmetric key for the assembled conversion request information; The symmetric key is encrypted by using a pre-obtained public key to obtain an encrypted symmetric key; the step of encrypting the symmetric key by using a pre-obtained public key to obtain an encrypted symmetric key comprises: Encrypting the symmetric key with the pre-obtained public key of the first merchant to obtain an encrypted symmetric key corresponding to the first merchant; Encrypting the symmetric key with the pre-obtained public key of the second merchant to obtain an encrypted symmetric key corresponding to the second merchant; Encrypting the assembled conversion request information by using the symmetric key to obtain encrypted conversion request information; Sending the encrypted symmetric key and the encrypted conversion request information to the node of the alliance chain; When the node of the alliance chain verifies the encrypted conversion request information, the encrypted symmetric key and the encrypted conversion request information are stored in the node of the alliance chain, and the values ​​of the virtual resources of the user in the different merchants are updated; After the step of updating the values ​​of the user's virtual resources in different merchants, the method further includes: Obtaining the encrypted symmetric key corresponding to the first merchant and the encrypted conversion request information from the alliance chain; Sending the encrypted symmetric key corresponding to the first merchant to the first merchant service node; receiving the symmetric key responded by the first merchant service node, where the symmetric key is obtained by the first merchant service node decrypting the encrypted symmetric key corresponding to the first merchant using the private key of the first merchant; Decrypting the encrypted conversion request information by using the symmetric key to obtain conversion information of the user's virtual resources between different merchants; After the step of updating the values ​​of the user's virtual resources in different merchants, the method further includes: Obtaining the encrypted symmetric key corresponding to the second merchant and the encrypted conversion request information from the alliance chain; Sending the encrypted symmetric key corresponding to the second merchant to the second merchant service node; receiving the symmetric key responded by the second merchant service node, where the symmetric key is obtained by the second merchant service node decrypting the encrypted symmetric key corresponding to the second merchant by using the private key of the second merchant; The encrypted conversion request information is decrypted by using the symmetric key to obtain conversion information of the user's virtual resources between different merchants.

2. The method for intercommunication of virtual resources based on blockchain according to claim 1, characterized in that: The encapsulation elements include a user account, an account of the first merchant bound to the user account, an account of the second merchant bound to the user account, and a transfer value of the virtual resource. The step of obtaining the encapsulation elements according to the conversion request and encapsulating the encapsulation elements into conversion request information includes: Acquire the user account, the account of the first merchant bound to the user account, and the account of the second merchant bound to the user account; receiving a transfer value of the virtual resource input by a user; The user account, the account of the first merchant bound to the user account, the account of the second merchant bound to the user account, and the transfer value of the virtual resource are respectively encapsulated in different fields of the conversion request information.

3. The method for intercommunication of virtual resources based on blockchain according to claim 2 is characterized in that: The step of respectively encapsulating the user account, the account of the first merchant bound to the user account, the account of the second merchant bound to the user account, and the transfer value of the virtual resource in different fields of the conversion request information further includes: Acquire a mapping relationship between business data in the payload conversion request information and fields of the payload conversion request information, wherein the business data includes a user account, an account of the first merchant bound to the user account, an account of the second merchant bound to the user account, and a transfer value of the virtual resource; According to the mapping relationship, the business data including the user account, the account of the first merchant bound to the user account, the account of the second merchant bound to the user account and the transfer value of the virtual resource are stored in corresponding fields respectively to obtain the conversion request information.

4. The method for intercommunication of virtual resources based on blockchain according to claim 1, characterized in that: The step of sending the encrypted symmetric key and the encrypted conversion request information to the node of the alliance chain further includes: The encrypted symmetric key corresponding to the first merchant and the encrypted symmetric key corresponding to the second merchant are both sent to the node of the alliance chain.

5. A virtual resource intercommunication device based on blockchain, characterized in that: The device comprises: The encapsulation module is used to, when receiving a conversion request for converting a user's virtual resources between different merchants in the same alliance chain, obtain encapsulation elements according to the conversion request, and encapsulate the encapsulation elements into conversion request information; A key generation module, used for generating a symmetric key for the assembled conversion request information; A first encryption module, used to encrypt the symmetric key by using a pre-obtained public key to obtain an encrypted symmetric key; The first encryption module specifically includes: A first encryption unit, used to encrypt the symmetric key with a pre-obtained public key of the first merchant to obtain an encrypted symmetric key corresponding to the first merchant; A second encryption unit, used to encrypt the symmetric key with a pre-obtained public key of the second merchant to obtain an encrypted symmetric key corresponding to the second merchant; A second encryption module, used to encrypt the assembled conversion request information by using the symmetric key to obtain the encrypted conversion request information; A sending module, used to send the encrypted symmetric key and the encrypted conversion request information to the node of the alliance chain; An updating module, configured to store the encrypted symmetric key and the encrypted conversion request information in the node of the alliance chain when the node of the alliance chain verifies the encrypted conversion request information, and update the value of the virtual resource of the user in the different merchants; The device also includes: A first acquisition module, used to obtain the encrypted symmetric key corresponding to the first merchant and the encrypted conversion request information from the alliance chain; A first sending module, configured to send an encrypted symmetric key corresponding to the first merchant to a first merchant service node; A first receiving module, configured to receive the symmetric key responded by the first merchant service node, where the symmetric key is obtained by the first merchant service node decrypting the encrypted symmetric key corresponding to the first merchant using the private key of the first merchant; A third decryption module, used to decrypt the encrypted conversion request information by using the symmetric key received by the first receiving module to obtain conversion information of the user's virtual resources between different merchants; The device also includes: A second acquisition module, used to acquire the encrypted symmetric key corresponding to the second merchant and the encrypted conversion request information from the alliance chain; A second sending module, configured to send the encrypted symmetric key corresponding to the second merchant to a second merchant service node; A second receiving module, configured to receive the symmetric key responded by the second merchant service node, where the symmetric key is obtained by the second merchant service node decrypting the encrypted symmetric key corresponding to the second merchant using the private key of the second merchant; The third decryption module is further used to decrypt the encrypted conversion request information using the symmetric key received by the second receiving module to obtain conversion information of the user's virtual resources between different merchants.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the blockchain-based virtual resource intercommunication method as described in any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the blockchain-based virtual resource intercommunication method as described in any one of claims 1 to 4 are implemented.