CN114022150B - Resource transfer method, device, electronic equipment and storage medium - Google Patents

Resource transfer method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114022150B
CN114022150B CN202210012567.5A CN202210012567A CN114022150B CN 114022150 B CN114022150 B CN 114022150B CN 202210012567 A CN202210012567 A CN 202210012567A CN 114022150 B CN114022150 B CN 114022150B
Authority
CN
China
Prior art keywords
resource
information
transaction
terminal
condition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210012567.5A
Other languages
Chinese (zh)
Other versions
CN114022150A (en
Inventor
杨文韬
杨珍
麻路宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Bixin Internet Technology Co ltd
Original Assignee
Beijing Bixin Internet Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Bixin Internet Technology Co ltd filed Critical Beijing Bixin Internet Technology Co ltd
Priority to CN202210012567.5A priority Critical patent/CN114022150B/en
Publication of CN114022150A publication Critical patent/CN114022150A/en
Application granted granted Critical
Publication of CN114022150B publication Critical patent/CN114022150B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • G06Q20/4014Identity check for transactions

Abstract

The invention provides a resource transfer method, a resource transfer device, electronic equipment and a storage medium, wherein the resource transfer method comprises the following steps: sending a resource transaction request of a first resource; responding to the confirmation operation, and sending a resource locking request to a resource trading platform; receiving encryption information sent by a second terminal; decrypting the encrypted information by using a local private key, sending decryption result information to a second terminal so as to enable the second terminal to receive transaction confirmation operation based on the decryption result information, responding to the transaction confirmation operation, sending a confirmation transaction request to a resource transaction platform so as to enable the resource transaction platform to broadcast locking information of a first resource and a second resource, and transferring the first resource by using a transaction channel based on the locking information, wherein the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal. The method can improve the resource transfer efficiency.

Description

Resource transfer method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a resource transfer method and apparatus, an electronic device, and a storage medium.
Background
With the development of computer technology, the blockchain technology has been developed as a new technology extending from computer technology. With the continuous development of blockchain technology, the demand for blockchain cross-chain technology is increasing. The inter-chain technology refers to value exchange between block chains, for example, users on different block chain nodes perform resource transfer, and due to the technical characteristics of the block chains, data communication between heterogeneous block chain networks cannot be performed or is low in efficiency, so that individual data islands are finally formed, and interconnection and intercommunication between block chains and modern internet of value transfer cannot be realized.
The resource transfer method in the prior art often has the problem of low transfer efficiency.
Disclosure of Invention
The invention provides a resource transfer method, a resource transfer device, electronic equipment and a storage medium, which are used for solving the defect of low resource transfer efficiency in the prior art and achieving the purpose of improving the resource transfer efficiency.
The invention provides a resource transfer method, which comprises the following steps: sending a resource transaction request of a first resource, wherein the resource transaction request carries transaction channel information, the transaction channel information comprises encrypted information, and the encrypted information is obtained by encrypting the transaction channel by using a public key of a second terminal; the second terminal decrypts the encrypted information by using a private key and then joins the encrypted information into the transaction channel; responding to the confirmation operation, and sending a resource locking request to a resource trading platform; the resource transaction platform locks the first resource based on the public key of the second terminal, and sends transaction information to the local terminal and the second terminal, wherein the confirmation operation is a confirmation operation on first resource information, and the first resource information is information of the first resource; receiving encrypted information sent by the second terminal, wherein the encrypted information is information obtained by encrypting the transaction information; decrypting the encrypted information by using a local private key, sending decryption result information to the second terminal so as to enable the second terminal to receive transaction confirmation operation based on the decryption result information, responding to the transaction confirmation operation, sending a transaction confirmation request to the resource transaction platform so as to enable the resource transaction platform to broadcast locking information of the first resource and the second resource, and transferring the first resource by using the transaction channel based on the locking information, wherein the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal.
The invention also provides a resource transfer method, which comprises the following steps: receiving the resource transaction request, wherein the resource transaction request carries transaction channel information, the transaction channel information comprises encrypted information, and the encrypted information is obtained by encrypting the transaction channel by using a public key of a local terminal; decrypting the encrypted information by using a local private key, and adding the decrypted information into the transaction channel; sending a channel join success message to a first terminal, so that the first terminal responds to a confirmation operation based on the join success message, sends a resource locking request to a resource transaction platform, so that the resource transaction platform locks a first resource based on a public key of the local terminal, and sends transaction information to the local terminal and the first terminal, wherein the confirmation operation is a confirmation operation on the first resource information, and the first resource information is information of the first resource; sending encryption information to the first terminal, wherein the encryption information is information obtained by encrypting the transaction information; the first terminal decrypts the encrypted information by using a private key and sends decryption result information to the home terminal; receiving the decryption result information, receiving a transaction confirmation operation based on the decryption result information, sending the transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, and transferring the second resource by using the transaction channel based on the locking information, wherein the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of a local terminal.
The invention also provides a resource transfer method, which comprises the following steps: receiving a resource locking request; locking the first resource based on the public key of the second terminal, and sending transaction information to the first terminal and the second terminal; enabling the first terminal to receive encrypted information sent by the second terminal, wherein the encrypted information is information obtained by encrypting the transaction information; decrypting the encrypted information by using a private key of the first terminal, sending decryption result information to the second terminal so that the second terminal receives transaction confirmation operation based on the decryption result information, and sending the transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation; receiving the transaction confirmation request, broadcasting locking information of the first resource and the second resource based on the transaction confirmation request, and transferring the first resource and the second resource based on the locking information by using the transaction channel, wherein the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal.
According to a resource transfer method provided by the present invention, the transferring the first resource and the second resource based on the locking information includes: sending private key signature information to the first terminal and the second terminal; receiving first signature confirmation information and second signature confirmation information, wherein the first signature confirmation information is the signature confirmation information sent by the first terminal, and the second signature confirmation information is the signature confirmation information sent by the second terminal; checking the lock information based on the first signature confirmation information and the second signature confirmation information; and under the condition that the locking information check is correct, transferring the first resource to the second terminal and transferring the second resource to the first terminal based on a resource unlocking condition.
According to the invention, the resource transfer method is provided, the unlocking condition comprises at least one of a time condition, a fund condition and a transaction environment condition, the transfer of the first resource to the second terminal and the transfer of the second resource to the first terminal based on the resource unlocking condition comprises the following steps: under the condition that the time condition is met, judging the fund condition; under the condition that the fund condition is not met, judging the transaction environment condition; and under the condition that the transaction environment condition is met, calling a transaction contract, transferring the first resource to the second terminal, and transferring the second resource to the first terminal.
According to a resource transfer method provided by the invention, the method further comprises the following steps: confirming the deposit to be paid under the condition that the fund condition is met; confirming a transaction environment congestion fee under the condition that the transaction environment condition is not met; adjusting the first resource and the second resource based on the deposit and the congestion cost of the transaction environment to obtain a first transaction adjustment resource and a second transaction adjustment resource; invoking the trade contract, transferring the first trade adjustment resource to the second terminal, and transferring the second trade adjustment resource to the first terminal.
The invention also provides a resource transfer device, comprising: the system comprises a first processing module, a second processing module and a third processing module, wherein the first processing module is used for sending a resource transaction request of a first resource, the resource transaction request carries transaction channel information, the transaction channel information comprises encrypted information, and the encrypted information is obtained by encrypting a transaction channel by using a public key of a second terminal; the second terminal decrypts the encrypted information by using a private key and then joins the encrypted information into the transaction channel; the second processing module is used for responding to the confirmation operation and sending a resource locking request to the resource trading platform; the resource transaction platform locks the first resource based on the public key of the second terminal, and sends transaction information to the local terminal and the second terminal, wherein the confirmation operation is a confirmation operation on first resource information, and the first resource information is information of the first resource; the third processing module is used for receiving encrypted information sent by the second terminal, wherein the encrypted information is information obtained by encrypting the transaction information; the fourth processing module is configured to decrypt the encrypted information by using a local private key, send decryption result information to the second terminal, so that the second terminal receives a transaction confirmation operation based on the decryption result information, send the transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, and transfer the second resource by using the transaction channel based on the locking information, where the transaction confirmation operation is an operation of confirming second resource information, where the second resource information is information of the second resource, and the second resource is a resource of the second terminal.
The invention also provides a resource transfer device, comprising: a fifth processing module, configured to receive the resource transaction request, where the resource transaction request carries transaction channel information, the transaction channel information includes encrypted information, and the encrypted information is obtained by encrypting the transaction channel by using a public key of a local terminal; the sixth processing module is used for decrypting the encrypted information by using a local private key and then adding the decrypted information into the transaction channel; a seventh processing module, configured to send a channel join success message to a first terminal, so that the first terminal sends a resource locking request to a resource transaction platform in response to a confirmation operation based on the join success message, so that the resource transaction platform locks a first resource based on a public key of a home terminal, and sends transaction information to the home terminal and the first terminal, where the confirmation operation is a confirmation operation on the first resource information, and the first resource information is information of the first resource; the eighth processing module is configured to send encrypted information to the first terminal, where the encrypted information is information obtained by encrypting the transaction information; the first terminal decrypts the encrypted information by using a private key and sends decryption result information to the home terminal; a ninth processing module, configured to receive the decryption result information, receive a transaction confirmation operation based on the decryption result information, send, in response to the transaction confirmation operation, the confirmation transaction request to the resource transaction platform, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, and transfer, based on the locking information, the first resource by using the transaction channel, where the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of a local end.
The invention also provides a resource transfer device, comprising: a tenth processing module, configured to receive a resource locking request; the eleventh processing module is used for locking the first resource based on the public key of the second terminal and sending the transaction information to the first terminal and the second terminal; enabling the first terminal to receive encrypted information sent by the second terminal, wherein the encrypted information is information obtained by encrypting the transaction information; decrypting the encrypted information by using a private key of the first terminal, sending decryption result information to the second terminal so that the second terminal receives transaction confirmation operation based on the decryption result information, and sending the transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation; a twelfth processing module, configured to receive the transaction confirmation request, broadcast locking information of the first resource and the second resource based on the transaction confirmation request, and transfer the first resource and the second resource based on the locking information by using the transaction channel, where the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal.
The present invention also provides an electronic device, including 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 resource transfer method as described in any one of the above when executing the program.
The invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the resource transfer method as any one of the above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of the resource transfer method as described in any one of the above.
The resource transfer method, the resource transfer device, the electronic equipment and the storage medium provided by the invention send the resource transaction request of the first resource, wherein the resource transaction request carries transaction channel information, the transaction channel information comprises encrypted information, and the encrypted information is obtained by encrypting the transaction channel by using a public key of a second terminal; the second terminal decrypts the encrypted information by using the private key and then joins the transaction channel; responding to the confirmation operation, and sending a resource locking request to a resource trading platform; the resource transaction platform locks the first resource based on the public key of the second terminal and sends transaction information to the local terminal and the second terminal, wherein the confirmation operation is a confirmation operation on the first resource information, and the first resource information is the information of the first resource; receiving encrypted information sent by a second terminal, wherein the encrypted information is information obtained by encrypting transaction information; the encrypted information is decrypted by using a local private key, decryption result information is sent to a second terminal, so that the second terminal receives transaction confirmation operation based on the decryption result information, a transaction confirmation request is sent to a resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts a first resource and locking information of a second resource, the first resource is transferred by using a transaction channel based on the locking information, the transaction confirmation operation is an operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is a resource of a second user on the second terminal. After a resource transaction request is initiated through the first terminal, an encrypted transaction channel is established, transaction queuing is not needed on the basis of the transaction channel, and the transfer of the first resource and the second resource is completed, so that the resource transfer efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flow chart of a resource transfer method provided by the present invention;
FIG. 2 is a second flowchart of a resource transfer method provided by the present invention;
FIG. 3 is a third flowchart of a resource transfer method provided by the present invention;
FIG. 4 is a fourth flowchart of the resource transfer method provided by the present invention;
FIG. 5 is a fifth flowchart illustrating a resource transfer method provided by the present invention;
FIG. 6 is a sixth flowchart of a resource transfer method provided by the present invention;
FIG. 7 is an interaction diagram of a resource transfer method provided by the present invention;
FIG. 8 is a second schematic diagram of the interaction of the resource transfer method provided by the present invention;
FIG. 9 is a schematic structural diagram of a resource transfer apparatus provided in the present invention;
fig. 10 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The resource transfer method of the present invention is described below in conjunction with fig. 1-6.
In an embodiment, as shown in fig. 1, a resource transfer method is provided, which is described by taking the method as an example for being applied to a first terminal, and includes the following steps:
102, sending a resource transaction request of a first resource, wherein the resource transaction request carries transaction channel information, the transaction channel information comprises encryption information, and the encryption information is obtained by encrypting a transaction channel by using a public key of a second terminal; and the second terminal is added into the transaction channel after decrypting the encrypted information by using the private key.
The transaction channel is a channel for performing transaction between the first terminal and the second terminal, and the channel is a virtual channel through which resource transfer between the first terminal and the second terminal can be completed; the first terminal may be considered to be the terminal where the first user is located and the second terminal may be considered to be the terminal where the second user is located. For example, in a cross-blockchain transaction, a user a is in a blockchain 1, a user B is in a blockchain 2, the user a is a virtual product provider and the user B is a virtual product purchaser, and during the resource transfer process between the user a and the user B, the virtual product of the user a can be transferred to the user B through the transaction channel, and the fund of the user B is transferred to the user a through the resource transaction platform.
Specifically, when a first user at a first terminal needs to perform resource transaction with a second user at a second terminal, the first terminal sends a resource transaction request of a first resource to the second terminal, and sends the request to the second terminal where the second user is located, so that the second terminal decrypts encrypted information by using a private key and then joins a transaction channel. It should be noted that, after the second terminal decrypts the encrypted information by using the private key, if the decrypted result is not the public key of the second user, the transaction channel is not added.
Step 104, responding to the confirmation operation, and sending a resource locking request to a resource trading platform; and locking the first resource by the resource transaction platform based on the public key of the second terminal, and sending transaction information to the local terminal and the second terminal, wherein the confirmation operation is a confirmation operation on the first resource information, and the first resource information is the information of the first resource.
The resource locking request refers to a request for locking a resource. A resource trading platform refers to a platform that is capable of providing resource transfer for a first user on a first terminal and a second user on a second terminal.
Specifically, after the second user successfully joins in the transaction channel, a confirmation operation of information such as the category, the quantity or the amount of money of the first resource is received on the first terminal where the first user is located, and the first terminal sends a resource locking request to the resource transaction platform in response to the confirmation operation. It can be understood that the information of the category, the amount or the amount of money of the first resource requested to be locked by the resource transaction platform in the resource locking request is consistent with the information confirmed by the confirmation operation performed on the first terminal.
And 106, receiving the encrypted information sent by the second terminal, wherein the encrypted information is the information obtained by encrypting the transaction information.
Specifically, after the resource transaction platform locks the first resource, the transaction is broadcasted in the resource transaction systems on the first terminal and the second terminal respectively; at this time, the second user on the second terminal sets the encrypted information by using the public key of the first user, and sends the encrypted information to the first user on the first terminal, and correspondingly, the first terminal where the first user is located receives the encrypted information sent by the second terminal.
And 108, decrypting the encrypted information by using the local private key, sending decryption result information to the second terminal so as to enable the second terminal to receive transaction confirmation operation based on the decryption result information, sending a transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation so as to enable the resource transaction platform to broadcast locking information of the first resource and the second resource, and transferring the first resource by using a transaction channel based on the locking information, wherein the transaction confirmation operation is an operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal.
The decryption result information refers to information about whether decryption is successful or not, for example, the information may be "decryption success" and "decryption failure", and the information may be "decryption failure". The locking information is a message for locking the first resource and the second resource in the resource trading platform, for example, the type of the resource to be transferred by the user a is the electronic money, the quantity of the resource is 1000, the type of the resource to be transferred by the user B is the virtual goods, the quantity of the virtual goods is 5, and the above information is the locking information.
Specifically, after the first terminal receives the encrypted information sent by the second terminal, the encrypted information is decrypted by using the local private key, if the decryption result is successful, the second user is successfully joined in the transaction channel and is a transaction object which needs to be authenticated by the first user on the first terminal, the first terminal sends the decryption result information to the second terminal, so that the second terminal receives the transaction confirmation operation based on the decryption result information, transmits a confirmation transaction request to the resource transaction platform in response to the transaction confirmation operation, so that the resource trading platform broadcasts the locking information of the first resource and the second resource, transfers the first resource by utilizing the trading channel based on the locking information, the transaction confirmation operation is an operation of confirming second resource information, which is information of a second resource that is a resource of the second terminal. It should be noted that, after the decryption of the encrypted information by the local private key fails, the second terminal does not perform the response of the transaction confirmation operation and the subsequent steps if the decryption result information is sent to the second terminal.
In the resource transfer method, a resource transaction request of a first resource is sent, the resource transaction request carries transaction channel information, the transaction channel information comprises encrypted information, and the encrypted information is obtained by encrypting a transaction channel by using a public key of a second terminal; the second terminal decrypts the encrypted information by using the private key and then joins the transaction channel; responding to the confirmation operation, and sending a resource locking request to a resource trading platform; the resource transaction platform locks the first resource based on the public key of the second terminal and sends transaction information to the local terminal and the second terminal, wherein the confirmation operation is a confirmation operation on the first resource information, and the first resource information is information of the first resource; receiving encrypted information sent by a second terminal, wherein the encrypted information is information obtained by encrypting transaction information; the encrypted information is decrypted by using a local private key, decryption result information is sent to the second terminal, so that the second terminal receives transaction confirmation operation based on the decryption result information, a transaction confirmation request is sent to the resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, the first resource is transferred by using a transaction channel based on the locking information, the transaction confirmation operation is an operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is a resource of a second user on the second terminal. After a resource transaction request is initiated through the first terminal, an encrypted transaction channel is established, transaction queuing is not needed on the basis of the transaction channel, and the transfer of the first resource and the second resource is completed, so that the resource transfer efficiency is improved.
In an embodiment, as shown in fig. 2, a resource transfer method is provided, which is described by taking the method as an example for being applied to a second terminal, and includes the following steps:
step 202, receiving a resource transaction request, where the resource transaction request carries transaction channel information, the transaction channel information includes encrypted information, and the encrypted information is obtained by encrypting a transaction channel by using a public key of a home terminal.
Specifically, after a resource transaction request is sent by a first terminal, a resource transaction request is correspondingly received by a second terminal, the resource transaction request carries transaction channel information, the transaction channel information includes encrypted information, and the encrypted information is obtained by encrypting a transaction channel by using a public key of a home terminal.
And step 204, decrypting the encrypted information by using the local private key, and adding the decrypted information into a transaction channel.
Specifically, after the second terminal receives the resource transaction request, because the resource transaction request carries transaction channel information, the transaction channel information includes encrypted information, and after a second user of the second terminal decrypts the encrypted information by using a local private key, the second user joins the transaction channel after decryption succeeds. When the decrypted encrypted information is consistent with the encrypted information content encrypted by the first user on the first terminal by using the public key of the second user, the decryption can be considered to be successful. In case the decryption is successful, the second user joins the transaction channel.
And step 206, sending a channel join success message to the first terminal, so that the first terminal sends a resource locking request to the resource transaction platform in response to the confirmation operation based on the join success message, so that the resource transaction platform locks the first resource based on the public key of the local terminal, and sends transaction information to the local terminal and the first terminal, wherein the confirmation operation is a confirmation operation on the first resource information, and the first resource information is information of the first resource.
Specifically, after the second terminal decrypts the encrypted information by using the local private key, and adds the encrypted information into a transaction channel, a channel addition success message is sent to the first terminal, after the first terminal receives the channel addition success message, a confirmation operation of the first user is received, the first terminal sends a resource locking request to the resource transaction platform in response to the confirmation operation, and after the resource transaction platform receives the resource locking request sent by the first terminal, the first resource which is required to be transacted or transferred by the first user is locked by using the public key of the second user of the second terminal.
Step 208, sending encryption information to the first terminal, wherein the encryption information is information obtained by encrypting the transaction information; so that the first terminal decrypts the encrypted information by using the private key and sends decryption result information to the home terminal.
Specifically, after the resource transaction platform locks the first resource, the resource transaction platform broadcasts the transaction at the first terminal of the first user and the second terminal of the second user, and after the second terminal receives the transaction broadcast by the resource transaction platform, the second user of the second terminal needs to verify the identity of the first user of the first terminal, and sends encrypted information to the first terminal, where the encrypted information is information obtained by encrypting the transaction information. And after the first terminal receives the encrypted information, decrypting the encrypted information by using the private key of the first user of the first terminal, and if the decryption result information is successful, namely the decrypted information content is consistent with the information content sent to the first terminal by the second user through the second terminal, considering the decryption result information as successful. At this time, the first terminal sends the decryption result information to the second terminal through the transaction channel.
Step 210, receiving the decryption result information, receiving a transaction confirmation operation based on the decryption result information, sending a transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, and transferring the second resource by using the transaction channel based on the locking information, wherein the transaction confirmation operation is an operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is a local resource.
Specifically, after the first terminal sends the decryption result information to the second terminal through the transaction channel, the second terminal receives the decryption result information, under the condition that the decryption result information is successfully decrypted, the second user inputs the resource type, the quantity or other related information of the second resource which the second user needs to correspondingly trade on the resource trading system of the second terminal, the second terminal receives the trade confirmation operation and sends the confirmed trade request to the resource trading platform, and after receiving the confirmed trade request, the resource trading platform locks the second resource confirmed by the second user by using the public key of the first user, and broadcasting the locking information of the first resource and the second resource in a resource transaction system on the first terminal and a resource transaction system on the second terminal, and transferring the first resource and the second resource by using a transaction channel based on the locking information.
In the embodiment, by receiving the resource transaction request, decrypting the encrypted information by using the local private key, adding the encrypted information into the transaction channel, sending a channel join success message to the first terminal, sending the encrypted information to the first terminal, receiving the decryption result information, receiving a transaction confirmation operation based on the decryption result information, responding to the transaction confirmation operation, sending the transaction confirmation request to the resource transaction platform, and achieving the effect that the second terminal safely confirms the second resource to be transacted.
In one embodiment, as shown in fig. 3, a resource transfer method is provided, which is described by taking the method as an example of being applied to a resource trading platform, and includes the following steps:
step 302, a resource lock request is received.
Specifically, after a first user of a first terminal sends a resource locking request, a resource trading platform receives the resource locking request.
Step 304, locking the first resource based on the public key of the second terminal, and sending transaction information to the first terminal and the second terminal, so that the first terminal receives encrypted information sent by the second terminal, wherein the encrypted information is information obtained by encrypting the transaction information; and decrypting the encrypted information by using a private key of the first terminal, sending decryption result information to the second terminal so that the second terminal receives transaction confirmation operation based on the decryption result information, and sending a transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation.
Specifically, after the resource transaction platform receives the resource locking request, the first resource is locked based on the public key of the second terminal, and the transaction information is sent to the resource transaction system of the first terminal and the resource transaction system of the second terminal. And when the second terminal receives the decryption result information sent by the first terminal successfully, the transaction confirmation operation is received in the resource transaction system of the second terminal, and the transaction confirmation request is sent to the resource transaction platform in response to the transaction confirmation operation.
Step 306, receiving the transaction confirmation request, broadcasting locking information of the first resource and the second resource based on the transaction confirmation request, and transferring the first resource and the second resource based on the locking information by using the transaction channel, wherein the transaction confirmation operation is an operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal.
Specifically, after the second terminal sends a confirmation transaction request to the resource transaction platform, the resource transaction platform receives the confirmation transaction request, locks the second resource by using the public key of the first user based on the confirmation transaction request, broadcasts the locking condition of the first resource and the second resource in the resource transaction system of the first user of the first terminal and the resource transaction system of the second user of the second terminal, and transfers the first resource and the second resource after the confirmation of the first user and the second user.
In this embodiment, the first resource is locked based on the public key of the second terminal by receiving the resource locking request, the transaction information is sent to the first terminal and the second terminal, the confirmation transaction request is received, the locking information of the first resource information and the second resource information is broadcast based on the confirmation transaction request, the first resource and the second resource are transferred based on the locking information by using the transaction channel, and the purpose of safely and efficiently transferring the first resource and the second resource can be achieved.
In one embodiment, as shown in FIG. 4, transferring the first resource and the second resource based on the lock information includes:
step 402, sending private key signature information to the first terminal and the second terminal.
Specifically, after the resource transaction platform locks the first resource and the second resource, the private key signature information of the first user is automatically sent to the first user of the first terminal by using the intelligent contract, and the private key signature information of the second user is automatically sent to the second user of the second terminal
Step 404, receiving first signature confirmation information and second signature confirmation information, where the first signature confirmation information is the signature confirmation information sent by the first terminal, and the second signature confirmation information is the signature confirmation information sent by the second terminal.
Specifically, after a first user receives private key signature information of the first user sent by a resource transaction platform, the private key signature information is verified, and when the information is confirmed to be correct information, namely the verification is passed, first signature confirmation information is sent to the resource transaction platform; and after the second user receives the private key signature information of the second user sent by the resource transaction platform, verifying the private key signature information, and sending second signature confirmation information to the resource transaction platform when the information is confirmed to be correct information, namely the verification is passed. Accordingly, the resource trading platform receives the first signature confirmation message and the second signature confirmation message.
Step 406, checking the locking information based on the first signature confirmation information and the second signature confirmation information.
Specifically, after the resource transaction platform receives the first signature confirmation information and the second signature confirmation information, the locked first resource is checked based on the first signature confirmation information, and the locked second resource is checked based on the second signature confirmation information.
In step 408, the first resource is transferred to the second terminal and the second resource is transferred to the first terminal based on the resource unlock condition under the condition that the lock information check is correct.
The resource unlocking condition refers to a condition capable of unlocking the locked first resource and the locked second resource, and the condition may be a time condition, a fund condition, or other conditions capable of triggering the locked resource to be unlocked.
Specifically, the resource transaction platform may unlock the first resource and the second resource locked by the local terminal based on the resource unlocking condition when the locking information is checked correctly, transmit the unlocked first resource and the unlocked second resource to both parties of the transaction, and update the broadcast resource on the resource transaction system on the first terminal and the resource transaction system on the second terminal.
In this embodiment, by sending private key signature information to the first terminal and the second terminal, receiving the first signature confirmation information and the second signature confirmation information, checking the lock information based on the first signature confirmation information and the second signature confirmation information, and transferring the first resource to the second terminal and transferring the second resource to the first terminal based on the resource unlocking condition under the condition that the lock information is correctly checked, the security of transferring the first resource and the second resource by using the resource transaction platform can be improved.
In one embodiment, as shown in fig. 5, the unlocking condition includes at least one of a time condition, a fund condition and a transaction environment condition, and the transferring the first resource to the second terminal and the transferring the second resource to the first terminal based on the resource unlocking condition includes:
step 502, under the condition of meeting the time condition, judging the fund condition.
Specifically, in order to improve the transaction efficiency, the order of condition judgment is performed among a plurality of conditions included in the unlocking condition, whether unlocking is performed is preliminarily judged through a time condition, and when the time condition meets the unlocking condition, a fund condition is judged. For example, if the time condition is that the transaction is completed within 30 minutes after the resource is locked, the next determination of the fund condition may be made if the time condition is satisfied.
And step 504, under the condition that the fund condition is not met, judging the transaction environment condition.
The fund condition refers to a condition related to the fund, for example, a performance guarantee paid by the first user a.
Specifically, when the resource transaction platform judges the fund condition, under the condition that the fund condition is not met, namely under the condition that the performance guarantee deposit does not need to be paid, the resource transaction platform judges the transaction environment condition. It should be noted that, in the case that the fund condition is satisfied, the fund needs to be specifically calculated, so that in the case that one user performs a default, the fund is compensated to the other user as a default fund.
Step 506, under the condition that the transaction environment condition is met, calling a transaction contract, transferring the first resource to the second terminal, and transferring the second resource to the first terminal.
The transaction environment condition refers to a network congestion condition of the transaction.
Specifically, under the condition that the transaction environment is met and the network is not congested, a transaction contract is called, the first resource is transferred to the second terminal, and the second resource is transferred to the first terminal. And under the condition of network congestion, both transaction parties need additional payment, and after the two transaction parties successfully pay the additional payment, a transaction contract is called to transfer the first resource to the second terminal and transfer the second resource to the first terminal.
In the embodiment, the fund condition is judged under the condition that the time condition is met, the transaction environment condition is judged under the condition that the fund condition is not met, the transaction contract is called under the condition that the transaction environment condition is met, the first resource is transferred to the second terminal, and the second resource is transferred to the first terminal, so that the purpose of accurately and efficiently performing the first resource and the second resource through the fund unlocking condition can be achieved.
In one embodiment, as shown in fig. 6, the resource transfer method further includes:
step 602, confirming the deposit to be paid under the condition of meeting the fund condition.
Specifically, the resource transaction platform judges the first user and the second user, and confirms the deposit to be paid under the condition that a certain user meets the fund condition, namely under the condition that the deposit needs to be paid. For example, in the case that it is determined that the first user needs to pay the deposit, 4% of the transaction resources needed by the first user are used as the deposit, and 96% of the transaction resources are used as the resources needed to be transacted.
And step 604, under the condition that the transaction environment condition is not met, confirming the transaction environment congestion fee.
Specifically, under the condition that the transaction environment condition is network congestion, the resource transaction platform confirms the transaction environment congestion cost required to be paid by the first user and the second user.
Step 606, based on the deposit and the transaction environment congestion cost, adjusting the first resource and the second resource to obtain a first transaction adjustment resource and a second transaction adjustment resource.
Specifically, after the resource trading platform confirms the deposit to be paid and the trading environment congestion cost, the first resource and the second resource can be adjusted according to the actual scene to obtain the first trading adjustment resource and the second trading adjustment resource. For example, under the condition that the guarantee deposit is not needed to be paid but the transaction environment congestion cost is needed to be paid, the first resource is adjusted, the resource consumed by the transaction environment congestion cost is removed, and the residual resource is used as the first transaction adjustment resource; under the condition that the deposit is required to be paid and the congestion cost of the transaction environment is not required to be paid, the first resource is adjusted under the condition that the first user defaults, the resource consumed by the payment of the deposit is removed, and the residual resource is used as the first transaction adjustment resource; under the condition that the deposit is required to be paid and the transaction environment congestion cost is also required to be paid, the first resource is adjusted under the condition that the first user defaults, the resource consumed by the payment of the deposit and the payment of the transaction environment congestion cost is removed, and the residual resource is used as the first transaction adjustment resource and the like. Similarly, the second resource of the second user can be adjusted to obtain a second transaction adjusted resource.
Step 608, invoke the trade contract, transfer the first trade adjustment resource to the second terminal, and transfer the second trade adjustment resource to the first terminal.
Specifically, after the resource trading platform obtains the first trading adjustment resource and the second trading adjustment resource, a trading contract is called, the first trading adjustment resource is transferred to the second terminal, and the second trading adjustment resource is transferred to the first terminal. And broadcasting the change information of the first resource and the second resource in the resource transaction system of the first terminal and the resource transaction system of the second terminal.
In the embodiment, the method comprises the steps of confirming the deposit to be paid under the condition that the fund condition is met, confirming the transaction environment congestion cost under the condition that the transaction environment condition is not met, adjusting the first resource and the second resource based on the deposit and the transaction environment congestion cost to obtain the first transaction adjustment resource and the second transaction adjustment resource, calling a transaction contract, transferring the first transaction adjustment resource to the second terminal, transferring the second transaction adjustment resource to the first terminal, adjusting the resource to be transferred in real time according to the actual resource unlocking condition, and improving the efficiency and the rationality of resource transfer.
In one embodiment, as shown in fig. 7, the node user a and the node user B on different block chains are used for resource transfer as an example. Where user a is on a first terminal and user B is on a second terminal. When a user A needs to perform resource transaction with a user B, the user A initiates a resource transaction request of a local first resource, an encrypted transaction channel is established by using a public key of the user B, when the user B receives encrypted information of the transaction channel, the encrypted information is decrypted, if the decryption result is correct, namely the decryption is successful, the encrypted information is added into the transaction channel, and a channel addition success message is sent to the user A through the transaction channel; after receiving the channel join success message sent by the user B, the user A inputs the type, the quantity or other information of the first resource in the resource transaction system where the user A is located, and sends a transaction confirmation request of the information to the resource transaction platform, the resource transaction platform locks the first resource which is about to be transacted by the user A by using the public key of the user B, and broadcasts the transaction in the resource transaction system where the user A is located and the resource transaction system where the user B is located. After the user B determines the transaction, the identity of the user A needs to be verified, at this time, the user B sets a piece of encrypted information by using a public key of the user A and sends the piece of encrypted information to the user A through the transaction channel, the user A decrypts the piece of encrypted information by using a private key of a local terminal after receiving the piece of encrypted information, when a decryption result is correct, namely the decryption is successful, the decryption success information is sent to the user B through the transaction channel, and after receiving the decryption success information sent by the user A, the user B confirms the type, the quantity or other information of a second resource which the user B needs to perform the transaction in a resource transaction system where the user B is located. And sending a confirmation transaction request of the information to a resource transaction platform, locking the second resource by the resource transaction platform based on the public key of the user A, and broadcasting the locking information of the first resource and the second resource in the resource transaction system of the user A and the resource transaction system of the user B, thereby realizing the successful locking of the first resource and the second resource. It will be appreciated that the first resource and the second resource are equivalent value resources agreed upon by both user a and user B.
In one embodiment, after the resource trading platform confirms that the first resource and the second resource are locked, the transfer of the first resource and the second resource may be completed according to the unlocking flow shown in fig. 8. Specifically, after the resource transaction platform confirms that the first resource and the second resource are locked, corresponding intelligent contracts can be called to automatically issue private key signature information to the user A and the user B, the user A and the user B check the locking condition of the first resource and the second resource according to the respective private key signature information, if the unlocking time condition is met, for example, the unlocking time condition is less than or equal to the maximum duration of the transaction, the fund condition of the user A and the user B is judged, if the deposit is required to be paid, the proportion of the first resource or the second resource occupied by the deposit is calculated, if the deposit is not required to be paid, the transaction environment condition is continuously judged, when the network is congested, the congestion fee is calculated, wherein the congestion fee requires the user A and the user B to pay according to the agreement, and when the network is not congested, the congestion fee is not required to be calculated. After the deposit and the congestion fee are confirmed, the first resource or the second resource can be deducted by a corresponding proportion according to an actual scene, at the moment, the resource trading platform calls an unlocking contract, the first resource needing to be actually transferred is transferred to the user B, the second resource needing to be actually transferred is transferred to the user A, and resource updating information is broadcasted in the resource trading system of the user A and the resource trading system of the user B.
The resource transfer apparatus provided by the present invention is described below, and the resource transfer apparatus described below and the resource transfer method described above may be referred to correspondingly.
In one embodiment, as shown in fig. 9, there is provided a resource transfer apparatus 900, including: a first processing module 902, a second processing module 904, a third processing module 906, and a fourth processing module 908, wherein: the first processing module 902 is configured to send a resource transaction request of a first resource, where the resource transaction request carries transaction channel information, the transaction channel information includes encrypted information, and the encrypted information is obtained by encrypting a transaction channel by using a public key of a second terminal; the second terminal decrypts the encrypted information by using the private key and then joins the transaction channel; a second processing module 904, configured to send a resource locking request to the resource trading platform in response to the confirmation operation; the resource transaction platform locks the first resource based on the public key of the second terminal, sends transaction information to the local terminal and the second terminal, and the confirmation operation is the confirmation operation of the first resource information which is the information of the first resource; a third processing module 906, configured to receive encrypted information sent by the second terminal, where the encrypted information is information obtained by encrypting the transaction information; the fourth processing module 908 is configured to decrypt the encrypted information with the local private key, send decryption result information to the second terminal, so that the second terminal receives a transaction confirmation operation based on the decryption result information, send a transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, and transfers the first resource based on the locking information and by using the transaction channel, where the transaction confirmation operation is an operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal.
In one embodiment, there is also provided a resource transfer apparatus, including: a fifth processing module, a sixth processing module, a seventh processing module, an eighth processing module, and a ninth processing module, wherein: the fifth processing module is used for receiving a resource transaction request, wherein the resource transaction request carries transaction channel information, the transaction channel information comprises encrypted information, and the encrypted information is obtained by encrypting the transaction channel by using a public key of a home terminal; the sixth processing module is used for decrypting the encrypted information by using the local private key and adding the decrypted information into the transaction channel; a seventh processing module, configured to send a channel join success message to the first terminal, so that the first terminal sends a resource locking request to the resource transaction platform in response to a confirmation operation based on the join success message, so that the resource transaction platform locks the first resource based on a public key of the local terminal, and sends transaction information to the local terminal and the first terminal, where the confirmation operation is a confirmation operation on the first resource information, and the first resource information is information of the first resource; the eighth processing module is used for sending encrypted information to the first terminal, wherein the encrypted information is information obtained by encrypting the transaction information; the first terminal decrypts the encrypted information by using the private key and sends decryption result information to the home terminal; and the ninth processing module is used for receiving the decryption result information, receiving a transaction confirmation operation based on the decryption result information, responding to the transaction confirmation operation, sending a transaction confirmation request to the resource transaction platform so that the resource transaction platform broadcasts locking information of the first resource and the second resource, and transferring the second resource by using the transaction channel based on the locking information, wherein the transaction confirmation operation is an operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is a local resource.
In one embodiment, there is also provided a resource transfer apparatus, including: a tenth processing module, an eleventh processing module, and a twelfth processing module, wherein: a tenth processing module, configured to receive a resource locking request; the eleventh processing module is used for locking the first resource based on the public key of the second terminal and sending the transaction information to the first terminal and the second terminal; enabling the first terminal to receive the encrypted information sent by the second terminal, wherein the encrypted information is information obtained by encrypting the transaction information; decrypting the encrypted information by using a private key of the first terminal, sending decryption result information to the second terminal so that the second terminal receives transaction confirmation operation based on the decryption result information, and sending a transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation; and the twelfth processing module is used for receiving the transaction confirmation request, broadcasting locking information of the first resource and the second resource based on the transaction confirmation request, and transferring the first resource and the second resource based on the locking information by using the transaction channel, wherein the transaction confirmation operation is an operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal.
In one embodiment, the twelfth processing module is configured to send private key signature information to the first terminal and the second terminal; receiving first signature confirmation information and second signature confirmation information, wherein the first signature confirmation information is the signature confirmation information sent by the first terminal, and the second signature confirmation information is the signature confirmation information sent by the second terminal; checking the lock information based on the first signature confirmation information and the second signature confirmation information; in the case where the lock information check is correct, the first resource is transferred to the second terminal and the second resource is transferred to the first terminal based on the resource unlock condition.
In one embodiment, the twelfth processing module is configured to determine the fund condition when the time condition is met; under the condition that the fund condition is not met, judging the transaction environment condition; and under the condition that the transaction environment condition is met, calling a transaction contract, transferring the first resource to the second terminal, and transferring the second resource to the first terminal.
In one embodiment, the twelfth processing module is used for confirming the deposit to be paid if the fund condition is met; under the condition that the transaction environment condition is not met, confirming the transaction environment congestion fee; adjusting the first resource and the second resource based on the deposit and the transaction environment congestion cost to obtain a first transaction adjustment resource and a second transaction adjustment resource; invoking the transaction contract, transferring the first transaction adjustment resource to the second terminal, and transferring the second transaction adjustment resource to the first terminal.
Fig. 10 illustrates a physical structure diagram of an electronic device, and as shown in fig. 10, the electronic device may include: a processor (processor)1010, a communication Interface (Communications Interface)1020, a memory (memory)1030, and a communication bus 1040, wherein the processor 1010, the communication Interface 1020, and the memory 1030 communicate with each other via the communication bus 1040. Processor 1010 may invoke logic instructions in memory 1030 to perform a resource transfer method comprising: sending a resource transaction request of a first resource, wherein the resource transaction request carries transaction channel information, the transaction channel information comprises encryption information, and the encryption information is obtained by encrypting a transaction channel by using a public key of a second terminal; the second terminal decrypts the encrypted information by using the private key and then joins the transaction channel; responding to the confirmation operation, and sending a resource locking request to a resource trading platform; the resource transaction platform locks the first resource based on the public key of the second terminal, sends transaction information to the local terminal and the second terminal, and the confirmation operation is the confirmation operation of the first resource information which is the information of the first resource; receiving encrypted information sent by a second terminal, wherein the encrypted information is information obtained by encrypting transaction information; the encrypted information is decrypted by using a local private key, decryption result information is sent to the second terminal, so that the second terminal receives transaction confirmation operation based on the decryption result information, a transaction confirmation request is sent to the resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, the first resource is transferred by using a transaction channel based on the locking information, the transaction confirmation operation is operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is the resource of the second terminal.
Furthermore, the logic instructions in the memory 1030 can be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer-readable storage medium, the computer program being capable of executing, when executed by a processor, the resource transfer method provided by the above methods, the method including: sending a resource transaction request of a first resource, wherein the resource transaction request carries transaction channel information, the transaction channel information comprises encryption information, and the encryption information is obtained by encrypting a transaction channel by using a public key of a second terminal; the second terminal decrypts the encrypted information by using the private key and then joins the transaction channel; responding to the confirmation operation, and sending a resource locking request to a resource trading platform; the resource transaction platform locks the first resource based on the public key of the second terminal, sends transaction information to the local terminal and the second terminal, and the confirmation operation is the confirmation operation of the first resource information which is the information of the first resource; receiving encrypted information sent by a second terminal, wherein the encrypted information is information obtained by encrypting transaction information; the encrypted information is decrypted by using a local private key, decryption result information is sent to the second terminal, so that the second terminal receives transaction confirmation operation based on the decryption result information, a transaction confirmation request is sent to the resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, the first resource is transferred by using a transaction channel based on the locking information, the transaction confirmation operation is operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is the resource of the second terminal.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing a resource transfer method provided by the above methods, the method including: sending a resource transaction request of a first resource, wherein the resource transaction request carries transaction channel information, the transaction channel information comprises encryption information, and the encryption information is obtained by encrypting a transaction channel by using a public key of a second terminal; the second terminal decrypts the encrypted information by using the private key and then joins the transaction channel; responding to the confirmation operation, and sending a resource locking request to a resource trading platform; the resource transaction platform locks the first resource based on the public key of the second terminal, sends transaction information to the local terminal and the second terminal, and the confirmation operation is the confirmation operation of the first resource information which is the information of the first resource; receiving encrypted information sent by a second terminal, wherein the encrypted information is information obtained by encrypting transaction information; the encrypted information is decrypted by using a local private key, decryption result information is sent to the second terminal, so that the second terminal receives transaction confirmation operation based on the decryption result information, a transaction confirmation request is sent to the resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, the first resource is transferred by using a transaction channel based on the locking information, the transaction confirmation operation is operation of confirming the second resource information, the second resource information is information of the second resource, and the second resource is the resource of the second terminal.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A resource transfer method is applied to a first terminal, and is characterized by comprising the following steps:
sending a resource transaction request of a first resource, wherein the resource transaction request carries transaction channel information, the transaction channel information comprises encrypted information, and the encrypted information is obtained by encrypting the transaction channel by using a public key of a second terminal; the second terminal decrypts the encrypted information by using a private key and then joins the encrypted information into the transaction channel; the transaction channel is a virtual channel;
responding to the confirmation operation, and sending a resource locking request to a resource trading platform; the resource transaction platform locks the first resource based on the public key of the second terminal, and sends transaction information to the local terminal and the second terminal, wherein the confirmation operation is a confirmation operation on first resource information, and the first resource information is information of the first resource;
receiving encrypted information sent by the second terminal, wherein the encrypted information is information obtained by encrypting the transaction information;
decrypting the encrypted information by using a local private key, sending decryption result information to the second terminal so as to enable the second terminal to receive transaction confirmation operation based on the decryption result information, responding to the transaction confirmation operation, sending a transaction confirmation request to the resource transaction platform so as to enable the resource transaction platform to broadcast locking information of the first resource and the second resource, and transferring the first resource by using the transaction channel based on the locking information, wherein the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal; the transferring the first resource based on the lock information includes: sending private key signature information to the first terminal and the second terminal; receiving first signature confirmation information and second signature confirmation information, wherein the first signature confirmation information is the signature confirmation information sent by the first terminal, and the second signature confirmation information is the signature confirmation information sent by the second terminal; checking the lock information based on the first signature confirmation information and the second signature confirmation information; transferring the first resource to the second terminal based on a resource unlocking condition under the condition that the locking information check is correct; the unlocking condition comprises at least one of a time condition, a fund condition and a transaction environment condition, and the transferring the first resource to the second terminal based on the resource unlocking condition comprises the following steps: under the condition that the time condition is met, judging the fund condition; under the condition that the fund condition is not met, judging the transaction environment condition; under the condition that the transaction environment condition is met, calling a transaction contract, and transferring the first resource to the second terminal; the fund condition is a condition related to fund.
2. A resource transfer method is applied to a second terminal, and is characterized by comprising the following steps:
receiving the resource transaction request, wherein the resource transaction request carries transaction channel information, the transaction channel information comprises encrypted information, and the encrypted information is obtained by encrypting a transaction channel by using a public key of a local terminal; the transaction channel is a virtual channel;
decrypting the encrypted information by using a local private key, and adding the decrypted information into the transaction channel;
sending a channel join success message to a first terminal, so that the first terminal responds to a confirmation operation based on the join success message, sends a resource locking request to a resource transaction platform, so that the resource transaction platform locks a first resource based on a public key of the local terminal, and sends transaction information to the local terminal and the first terminal, wherein the confirmation operation is a confirmation operation on the first resource information, and the first resource information is information of the first resource;
sending encryption information to the first terminal, wherein the encryption information is information obtained by encrypting the transaction information; the first terminal decrypts the encrypted information by using a private key and sends decryption result information to the home terminal;
receiving the decryption result information, receiving a transaction confirmation operation based on the decryption result information, sending a transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation so that the resource transaction platform broadcasts locking information of the first resource and the second resource, and transferring the second resource by using the transaction channel based on the locking information, wherein the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a local resource; the transferring the second resource based on the lock information includes: sending private key signature information to the first terminal and the second terminal; receiving first signature confirmation information and second signature confirmation information, wherein the first signature confirmation information is the signature confirmation information sent by the first terminal, and the second signature confirmation information is the signature confirmation information sent by the second terminal; checking the lock information based on the first signature confirmation information and the second signature confirmation information; transferring a second resource to the first terminal based on a resource unlocking condition under the condition that the locking information check is correct; the unlocking condition comprises at least one of a time condition, a fund condition and a transaction environment condition, and the transferring of the second resource to the first terminal based on the resource unlocking condition comprises the following steps: under the condition that the time condition is met, judging the fund condition; under the condition that the fund condition is not met, judging the transaction environment condition; under the condition that the transaction environment condition is met, calling a transaction contract, and transferring the second resource to the first terminal; the fund condition is a condition related to fund.
3. A resource transfer method is applied to a resource transaction platform and is characterized by comprising the following steps:
receiving a resource locking request;
locking the first resource based on the public key of the second terminal, and sending transaction information to the first terminal and the second terminal; enabling the first terminal to receive encrypted information sent by the second terminal, wherein the encrypted information is information obtained by encrypting the transaction information; decrypting the encrypted information by using a private key of the first terminal, sending decryption result information to the second terminal so that the second terminal receives transaction confirmation operation based on the decryption result information, and sending a transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation;
receiving the transaction confirmation request, broadcasting locking information of the first resource and the second resource based on the transaction confirmation request, and transferring the first resource and the second resource based on the locking information by using the transaction channel, wherein the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal; the transferring the first resource and the second resource based on the lock information includes: sending private key signature information to the first terminal and the second terminal; receiving first signature confirmation information and second signature confirmation information, wherein the first signature confirmation information is the signature confirmation information sent by the first terminal, and the second signature confirmation information is the signature confirmation information sent by the second terminal; checking the lock information based on the first signature confirmation information and the second signature confirmation information; transferring a first resource to the second terminal and transferring a second resource to the first terminal based on a resource unlocking condition under the condition that the lock information check is correct; the unlocking condition includes at least one of a time condition, a fund condition and a transaction environment condition, and the transferring the first resource to the second terminal and the transferring the second resource to the first terminal based on the resource unlocking condition includes: under the condition that the time condition is met, judging the fund condition; under the condition that the fund condition is not met, judging the transaction environment condition; under the condition that the transaction environment condition is met, calling a transaction contract, transferring the first resource to the second terminal, and transferring the second resource to the first terminal; the transaction channel is a virtual channel; the fund condition is a condition related to fund.
4. The method of claim 3, further comprising:
confirming the deposit to be paid under the condition that the fund condition is met;
confirming a transaction environment congestion fee under the condition that the transaction environment condition is not met;
adjusting the first resource and the second resource based on the deposit and the congestion cost of the transaction environment to obtain a first transaction adjustment resource and a second transaction adjustment resource;
invoking the trade contract, transferring the first trade adjustment resource to the second terminal, and transferring the second trade adjustment resource to the first terminal.
5. A resource transfer apparatus applied to a first terminal, comprising:
the system comprises a first processing module, a second processing module and a third processing module, wherein the first processing module is used for sending a resource transaction request of a first resource, the resource transaction request carries transaction channel information, the transaction channel information comprises encrypted information, and the encrypted information is obtained by encrypting a transaction channel by using a public key of a second terminal; the second terminal decrypts the encrypted information by using a private key and then joins the encrypted information into the transaction channel;
the second processing module is used for responding to the confirmation operation and sending a resource locking request to the resource trading platform; the resource transaction platform locks the first resource based on the public key of the second terminal, and sends transaction information to the local terminal and the second terminal, wherein the confirmation operation is a confirmation operation on first resource information, and the first resource information is information of the first resource;
the third processing module is used for receiving encrypted information sent by the second terminal, wherein the encrypted information is information obtained by encrypting the transaction information;
a fourth processing module, configured to decrypt the encrypted information by using a local private key, send decryption result information to the second terminal, so that the second terminal receives a transaction confirmation operation based on the decryption result information, send a transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, and transfers the first resource based on the locking information by using the transaction channel, where the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal; the transferring the first resource based on the lock information includes: sending private key signature information to the first terminal and the second terminal; receiving first signature confirmation information and second signature confirmation information, wherein the first signature confirmation information is the signature confirmation information sent by the first terminal, and the second signature confirmation information is the signature confirmation information sent by the second terminal; checking the lock information based on the first signature confirmation information and the second signature confirmation information; transferring the first resource to the second terminal based on a resource unlocking condition under the condition that the locking information check is correct; the unlocking condition comprises at least one of a time condition, a fund condition and a transaction environment condition, and the transferring the first resource to the second terminal based on the resource unlocking condition comprises the following steps: under the condition that the time condition is met, judging the fund condition; under the condition that the fund condition is not met, judging the transaction environment condition; and under the condition that the transaction environment condition is met, calling a transaction contract, and transferring the first resource to the second terminal.
6. A resource transfer apparatus applied to a second terminal, comprising:
a fifth processing module, configured to receive the resource transaction request, where the resource transaction request carries transaction channel information, the transaction channel information includes encrypted information, and the encrypted information is obtained by encrypting the transaction channel by using a public key of a local terminal;
the sixth processing module is used for decrypting the encrypted information by using a local private key and then adding the decrypted information into the transaction channel;
a seventh processing module, configured to send a channel join success message to a first terminal, so that the first terminal sends a resource locking request to a resource transaction platform in response to a confirmation operation based on the join success message, so that the resource transaction platform locks a first resource based on a public key of a home terminal, and sends transaction information to the home terminal and the first terminal, where the confirmation operation is a confirmation operation on the first resource information, and the first resource information is information of the first resource;
the eighth processing module is configured to send encrypted information to the first terminal, where the encrypted information is information obtained by encrypting the transaction information; the first terminal decrypts the encrypted information by using a private key and sends decryption result information to the home terminal;
a ninth processing module, configured to receive the decryption result information, receive a transaction confirmation operation based on the decryption result information, send a transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation, so that the resource transaction platform broadcasts locking information of the first resource and the second resource, and transfer the second resource based on the locking information by using the transaction channel, where the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of a local terminal; the transferring the second resource based on the lock information includes: sending private key signature information to the first terminal and the second terminal; receiving first signature confirmation information and second signature confirmation information, wherein the first signature confirmation information is the signature confirmation information sent by the first terminal, and the second signature confirmation information is the signature confirmation information sent by the second terminal; checking the lock information based on the first signature confirmation information and the second signature confirmation information; transferring a second resource to the first terminal based on a resource unlocking condition under the condition that the locking information check is correct; the unlocking condition comprises at least one of a time condition, a fund condition and a transaction environment condition, and the transferring of the second resource to the first terminal based on the resource unlocking condition comprises the following steps: under the condition that the time condition is met, judging the fund condition; under the condition that the fund condition is not met, judging the transaction environment condition; and under the condition that the transaction environment condition is met, calling a transaction contract, transferring the first resource to the second terminal, and transferring the second resource to the first terminal.
7. A resource transfer device is applied to a resource transaction platform and is characterized by comprising:
a tenth processing module, configured to receive a resource locking request;
the eleventh processing module is used for locking the first resource based on the public key of the second terminal and sending the transaction information to the first terminal and the second terminal; enabling the first terminal to receive encrypted information sent by the second terminal, wherein the encrypted information is information obtained by encrypting the transaction information; decrypting the encrypted information by using a private key of the first terminal, sending decryption result information to the second terminal so that the second terminal receives transaction confirmation operation based on the decryption result information, and sending a transaction confirmation request to the resource transaction platform in response to the transaction confirmation operation;
a twelfth processing module, configured to receive the transaction confirmation request, broadcast locking information of the first resource and the second resource based on the transaction confirmation request, and transfer the first resource and the second resource based on the locking information by using the transaction channel, where the transaction confirmation operation is an operation of confirming second resource information, the second resource information is information of the second resource, and the second resource is a resource of the second terminal; the transferring the first resource and the second resource based on the lock information includes: sending private key signature information to the first terminal and the second terminal; receiving first signature confirmation information and second signature confirmation information, wherein the first signature confirmation information is the signature confirmation information sent by the first terminal, and the second signature confirmation information is the signature confirmation information sent by the second terminal; checking the lock information based on the first signature confirmation information and the second signature confirmation information; transferring a first resource to the second terminal and transferring a second resource to the first terminal based on a resource unlocking condition under the condition that the lock information check is correct; the unlocking condition includes at least one of a time condition, a fund condition and a transaction environment condition, and the transferring the first resource to the second terminal and the transferring the second resource to the first terminal based on the resource unlocking condition includes: under the condition that the time condition is met, judging the fund condition; under the condition that the fund condition is not met, judging the transaction environment condition; and under the condition that the transaction environment condition is met, calling a transaction contract, transferring the first resource to the second terminal, and transferring the second resource to the first terminal.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the resource transfer method according to any of claims 1 to 4 are implemented when the program is executed by the processor.
9. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the resource transfer method according to any one of claims 1 to 4.
CN202210012567.5A 2022-01-07 2022-01-07 Resource transfer method, device, electronic equipment and storage medium Active CN114022150B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210012567.5A CN114022150B (en) 2022-01-07 2022-01-07 Resource transfer method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210012567.5A CN114022150B (en) 2022-01-07 2022-01-07 Resource transfer method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114022150A CN114022150A (en) 2022-02-08
CN114022150B true CN114022150B (en) 2022-04-22

Family

ID=80069598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210012567.5A Active CN114022150B (en) 2022-01-07 2022-01-07 Resource transfer method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114022150B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115599773B (en) * 2022-12-09 2023-03-31 南方电网数字电网研究院有限公司 Distributed resource transfer method, device and system and computer equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019100865A1 (en) * 2017-11-23 2019-05-31 阿里巴巴集团控股有限公司 Resource transfer and capital transfer method and apparatus

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109064324A (en) * 2018-06-15 2018-12-21 重庆金融资产交易所有限责任公司 Method of commerce, electronic device and readable storage medium storing program for executing based on alliance's chain
CN111311412B (en) * 2020-02-24 2023-03-10 腾讯科技(深圳)有限公司 Decentralized transaction confirmation method and device and server
CN110992040A (en) * 2020-03-03 2020-04-10 支付宝(杭州)信息技术有限公司 Transaction processing method, device and equipment
CN111340631B (en) * 2020-05-15 2020-12-01 支付宝(杭州)信息技术有限公司 Asset transfer method, device, equipment and system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019100865A1 (en) * 2017-11-23 2019-05-31 阿里巴巴集团控股有限公司 Resource transfer and capital transfer method and apparatus

Also Published As

Publication number Publication date
CN114022150A (en) 2022-02-08

Similar Documents

Publication Publication Date Title
CN110958110B (en) Block chain private data management method and system based on zero knowledge proof
CN112994892B (en) Cross-chain interaction method, device, system and electronic equipment
CN111444273B (en) Data authorization method and device based on block chain
CN109741068B (en) Online banking cross-row signing method, device and system
CN110930153B (en) Block chain privacy data management method and system based on hidden third party account
CN109300038B (en) Resource flow transaction system
CN101351027A (en) Method and system for processing service authentication
CN108768618B (en) IP soft core authorization method, device and medium based on block chain
CN110619222A (en) Authorization processing method, device, system and medium based on block chain
CN113255014B (en) Data processing method based on block chain and related equipment
CN114022150B (en) Resource transfer method, device, electronic equipment and storage medium
CN111339509A (en) Block chain cross-chain identity authentication method based on side chain
CN113987526A (en) Resource exchange method, device and equipment based on block chain and readable storage medium
CN113689216A (en) Cross-chain transaction processing method and device, equipment, storage medium and program product
CN114553480B (en) Cross-domain single sign-on method and device, electronic equipment and readable storage medium
CN113839768B (en) Cross-link communication method based on satellite link relay
CN113810391A (en) Cross-machine-room communication bidirectional authentication and encryption method
CN112926983A (en) Block chain-based deposit certificate transaction encryption system and method
CN114331705B (en) Block chain-based telecommunication service contract consistency guarantee method
CN111898112B (en) Intellectual property trading platform based on block chain technology
CN110532741B (en) Personal information authorization method, authentication center and service provider
CN117057921B (en) Method, device and system for transaction of calculation force, electronic equipment and storage medium
CN113449343B (en) Trusted computing system based on quantum technology
CN114493603A (en) Transaction method and device based on block chain network and electronic equipment
CN115801778A (en) Cross-chain electric power transaction method and cross-chain electric power transaction system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant