Disclosure of Invention
The invention aims to provide an APP payment method on a mobile terminal based on a block chain technology, which can effectively avoid the risk defect in the existing order system. By utilizing the characteristic of the block chain distributed account book, a monitoring mechanism can monitor all transactions in the system in real time, and the problems of secondary clearing and the like are avoided.
In order to achieve the purpose, the invention adopts the following technical scheme:
an APP payment method on a mobile terminal based on a block chain technology comprises the following steps:
s1, a generation step: the APP on the mobile terminal sends the received order information to an order system of a merchant to generate a payment request;
s2, submitting: the merchant order system is used as a payment request system to submit a payment request to any one node on the block chain, and at the moment, the node forms a receiving node;
s3, block chain processing step: after the block chain verifies the payment request, the verified payment request is blocked by a consensus algorithm, so that the payment request is recorded on the block chain;
s4, monitoring and paying steps: the method comprises the steps that a first known system monitors a payment request on a block chain of a node matched with the first known system, and sends the payment request to a payment channel; the payment channel processes the payment request and returns a payment response and a payment result to the precedent system in sequence; the known system returns payment response and payment result to the block chain in sequence through the matched block chain link points;
s5, payment result processing step: after the payment results are blocked by a consensus algorithm, the payment results are recorded on a block chain and are notified to an order system of a merchant;
s6, clearing: the payment channel settles the transaction fund to the settlement account of the merchant, sends the settlement result to the prior system, and packs the settlement result to the block chain through the block chain link matched with the prior system to complete the whole payment process;
and S7, ending the payment.
Further, the block chain processing step (S3) is specifically:
s3.1, the receiving node receives the payment request, verifies the payment request, broadcasts the payment request to other nodes of the block chain if the verification is successful, simultaneously stores the payment request in a transaction pool of the node, and goes to step S3.2; if the verification fails, directly discarding the payment request and ending the payment;
s3.2, after receiving the broadcasted payment request, other nodes of the block chain respectively carry out verification, if the verification is successful and the payment request is received for the first time, the other nodes broadcast the payment request and simultaneously store the payment request into a transaction pool of the node, otherwise, the node directly discards the payment request;
and S3.3, after the preset time, blocking the payment request through a consensus algorithm, and recording the block to a block chain.
Further, the step of monitoring and paying (S4) is specifically:
s4.1, monitoring a payment request on a block chain of a node matched with the payment request by a first-known system, verifying the payment request, if the verification is successful, sending the payment request to a payment channel, and entering the step S4.2, if the verification is failed, discarding the payment request, and ending the payment;
s4.2, the payment channel processes the payment request, and generates a payment response by calling information required by the payment of the APP on the mobile terminal and returns the payment response to the prior system;
s4.3, after the precedent system receives the payment response, the precedent system sends the payment response to the matched block chain node point, and the node receives the payment response and broadcasts the payment response to other nodes;
s4.4, after the preset time, the payment response is blocked through a consensus algorithm and is recorded on a block chain;
s4.5, the node which receives the payment request at the earliest returns the payment response on the block chain to the merchant order system;
s4.6, the merchant order system returns information required by calling the APP on the mobile terminal to the APP on the mobile terminal of the user according to the payment response;
s4.7, calling the APP on the mobile terminal to pay according to the returned information by the APP on the mobile terminal of the user mobile phone, and paying to generate a payment result;
s4.8, the payment channel sends the successful payment result to a priori knowledge system, the priori knowledge system verifies the payment result, and if the verification is successful, the payment result is written into the matched block chain link point; and if the verification fails, discarding the payment result and not recording.
Furthermore, after calling the APP on the mobile terminal for payment, a user password needs to be input before payment is performed.
Further, the payment result processing step (S5) is specifically:
s5.1, the block chain node matched with the priori knowledge system receives the payment result written by the priori knowledge system, verifies the payment result, if the verification is successful, sends the payment result to other nodes of the block chain, and simultaneously stores the payment result into a transaction pool of the node; if the verification fails, directly discarding the payment result, and entering step S7;
s5.2, after receiving the broadcasted payment result, the other nodes respectively carry out verification, if the verification is successful and the payment result is received for the first time, the payment result is broadcasted, and meanwhile, the payment result is stored in a transaction pool of the nodes; otherwise, directly discarding the payment result;
s5.3, after the preset time, recording the payment result on a block chain after the payment result is blocked by a consensus algorithm;
and S5.4, after the notification system monitors the payment result on the block chain of the node matched with the notification system, notifying the payment result to an order system of a merchant.
Further, the payment result processing step (S5) further includes:
and S5.5, after the merchant order system receives the payment result, displaying the payment result.
Further, in step S6, the packing the settlement result onto the block chain by the prior knowledge system specifically includes: the prior knowledge system verifies the settlement result, after the verification is successful, the settlement result is written into the block chain link point matched with the prior knowledge system, the node broadcasts the settlement result to other nodes, and after the preset time, the settlement result is blocked by a consensus algorithm and then recorded on a block chain.
Further, in step S1, the sending, by the APP on the mobile terminal, the received order information to the order system of the merchant specifically includes: the user selects the commodity to be purchased from the APP mall on the mobile terminal of the merchant, clicks the payment button, and the APP on the mobile terminal sends the order information to the order system of the merchant.
Further, in step S4.3, after receiving the payment response, the block chain link point matched with the pre-known system also verifies the payment response, sends the verification result to other nodes of the block chain after the verification is successful, and simultaneously stores the payment response in the transaction pool of the node; if the verification fails, directly discarding the payment response; after receiving the broadcasted payment response, other nodes respectively carry out verification, if the verification is successful and the payment response is received for the first time, broadcast the payment response and store the payment response into a transaction pool of the nodes; otherwise, the payment reply is discarded directly.
Further, the payment data which fails to be verified is processed by an error checking and processing system connected with the blockchain, wherein the payment data comprises data of a payment request, a payment response, a payment result and a settlement result.
In addition, in the invention, after other nodes of the block chain receive the broadcast, the node discards the payment data, which means that only the node with the verification failure discards the payment data, but not all the nodes discard the payment data, and the payment data also exists in a certain node or certain nodes of the block chain.
Detailed Description
The method for paying the APP on the mobile terminal based on the block chain technology according to the present invention is further explained and explained with reference to the drawings and the specific embodiments of the specification.
Example 1
The specific transaction flow of mobile payment is as follows:
the user submits an order: a user selects goods to be purchased from a mobile phone application mall of a merchant, clicks a payment button, and the mobile phone application sends order information to an order system of the merchant to generate a payment request;
the merchant system submits a payment request: the merchant order system submits the payment request to any node on the blockchain payment system;
the block chain broadcasts payment requests and blocks: the node receives a request of a merchant, verifies the request of the merchant, sends the request to other nodes of the block chain after the request is successfully verified, and simultaneously stores a payment request into a transaction pool of the node; if the verification fails, the payment request is discarded directly. After receiving the broadcasted payment request, other nodes respectively carry out verification, if the verification is successful and the payment request is received for the first time, broadcast the payment request and store the payment request into a transaction pool of the nodes; otherwise, the payment request is discarded directly. After a certain time, the payment request is packaged onto the blockchain according to consensus rules.
The first known system listens for a payment request: the first-known system monitors the payment request on the block chain of the matched node and verifies the transaction;
the precursor system sends a payment request: after the verification is successful, the pre-known system sends the payment request to a payment channel;
and the payment channel returns a payment response: the payment channel processes the payment request and generates a payment response for calling elements required by the mobile phone application payment and returns the payment response to the precedent system;
the precursor system returns a payment response: after the pre-known system receives the payment response, the payment response is sent to the node matched with the payment response;
block chains broadcast payment responses and block: the node receives the response of the pre-known system, verifies the response, sends the response to other nodes of the block chain after the response is verified successfully, and simultaneously stores the payment response into a transaction pool of the node; if the verification fails, the payment reply is discarded directly. After receiving the broadcasted payment response, other nodes respectively carry out verification, if the verification is successful and the payment response is received for the first time, broadcast the payment response and store the payment response into a transaction pool of the nodes; otherwise, the payment reply is discarded directly. After a certain time, the payment response is packed into a block chain according to a consensus regulation;
the blockchain returns a payment response: the node which receives the request earliest returns the payment response on the block chain to the merchant order system;
the merchant returns the calling parameter: the merchant order system returns information required for invoking the mobile phone application payment to the mobile phone application of the user according to the mobile phone application payment invoking information in the payment response;
the user pays the mobile phone application: the mobile phone application calls the mobile phone application payment according to the return information, and the user inputs a password to complete the payment;
and returning a payment result by the payment channel: the payment channel sends the successful transaction result to the advanced system;
the precursor system returns a payment result: firstly, after the verification of the system is successful, writing the payment result into the matched block chain link point;
the block chain broadcasts the payment result and blocks: the node receives the result of the prior known system, verifies the result, sends the result to other nodes of the block chain after the result is verified successfully, and simultaneously stores the payment result into a transaction pool of the node; if the verification fails, the payment result is directly discarded. After receiving the broadcasted payment result, the other nodes respectively carry out verification, broadcast the payment result and store the payment result into a transaction pool of the nodes, wherein the verification is successful and the payment result is received for the first time; otherwise, the payment result is directly discarded. After a certain time, the payment result is packed to a block chain according to a consensus regulation;
informing the system to answer the payment result: after the notification system monitors the payment result on the block chain of the matched node, the payment result is verified;
the notification system notifies the payment result: the notification system notifies the order system of the merchant of the payment result;
the merchant displays the payment result: after the order system of the merchant receives the payment result, the payment result is displayed to the user;
and (4) settlement of funds of a payment channel: on the settlement day, the payment channel settles the transaction funds to the settlement account of the merchant;
and the payment channel sends a settlement result: and sending the settlement result to a prior knowledge system;
the prior system returns a settlement result: after the first-known system receives the settlement result, the settlement result is sent to the node matched with the settlement result;
and broadcasting settlement results by the block chain and blocking: the node receives the result of the prior known system, verifies the result, sends the result to other nodes of the block chain after the result is verified successfully, and simultaneously stores the settlement result into a transaction pool of the node; if the verification fails, the settlement result is directly discarded. After receiving the broadcasted settlement results, other nodes respectively carry out verification, if the verification is successful and the settlement results are received for the first time, broadcast the settlement results and store the settlement results into the transaction pools of the nodes; otherwise, directly discarding the settlement result. After a certain time, the settlement results are packed into a blockchain according to consensus rules.
Example 2
An APP payment method on a mobile terminal based on a block chain technology comprises the following steps:
s1, a generation step: the APP on the mobile terminal sends the received order information to an order system of a merchant to generate a payment request;
s2, submitting: the merchant order system is used as a payment request system to submit a payment request to any one node on the block chain, and at the moment, the node forms a receiving node;
s3, block chain processing step: after the block chain verifies the payment request, the verified payment request is blocked by a consensus algorithm, so that the payment request is recorded on the block chain;
s4, monitoring and paying steps: the method comprises the steps that a first known system monitors a payment request on a block chain of a node matched with the first known system, and sends the payment request to a payment channel; the payment channel processes the payment request and returns a payment response and a payment result to the precedent system in sequence; the known system returns payment response and payment result to the block chain in sequence through the matched block chain link points;
s5, payment result processing step: after the payment results are blocked by a consensus algorithm, the payment results are recorded on a block chain and are notified to an order system of a merchant;
s6, clearing: the payment channel settles the transaction fund to the settlement account of the merchant, sends the settlement result to the advanced system, and packs the settlement result to the block chain through the block chain link points matched with the advanced system;
and S7, ending the payment.
Further, the block chain processing step (S3) is specifically:
s3.1, the receiving node receives the payment request, verifies the payment request, broadcasts the payment request to other nodes of the block chain if the verification is successful, simultaneously stores the payment request in a transaction pool of the node, and goes to step S3.2; if the verification fails, directly discarding the payment request and ending the payment;
s3.2, after receiving the broadcasted payment request, other nodes of the block chain respectively carry out verification, if the verification is successful and the payment request is received for the first time, the other nodes broadcast the payment request and simultaneously store the payment request into a transaction pool of the node, otherwise, the node directly discards the payment request;
and S3.3, after the preset time, blocking the payment request through a consensus algorithm, and recording the block to a block chain.
Further, the step of monitoring and paying (S4) is specifically:
s4.1, monitoring a payment request on a block chain of a node matched with the payment request by a first-known system, verifying the payment request, if the verification is successful, sending the payment request to a payment channel, and entering the step S4.2, if the verification is failed, discarding the payment request, and ending the payment;
s4.2, the payment channel processes the payment request, and generates a payment response by calling information required by the payment of the APP on the mobile terminal and returns the payment response to the prior system;
s4.3, after the precedent system receives the payment response, the precedent system sends the payment response to the matched block chain node point, and the node receives the payment response and broadcasts the payment response to other nodes;
s4.4, after the preset time, the payment response is blocked through a consensus algorithm and is recorded on a block chain;
s4.5, the node which receives the payment request at the earliest returns the payment response on the block chain to the merchant order system;
s4.6, the merchant order system returns information required by calling the APP on the mobile terminal to the APP on the mobile terminal of the user according to the payment response;
s4.7, calling the APP on the mobile terminal to pay according to the returned information by the APP on the mobile terminal of the user mobile phone, and paying to generate a payment result;
s4.8, the payment channel sends the successful payment result to a priori knowledge system, the priori knowledge system verifies the payment result, and if the verification is successful, the payment result is written into the matched block chain link point; and if the verification fails, discarding the payment result and not recording.
Furthermore, after calling the APP on the mobile terminal for payment, a user password needs to be input before payment is performed.
Further, the payment result processing step (S5) is specifically:
s5.1, the block chain node matched with the priori knowledge system receives the payment result written by the priori knowledge system, verifies the payment result, if the verification is successful, sends the payment result to other nodes of the block chain, and simultaneously stores the payment result into a transaction pool of the node; if the verification fails, directly discarding the payment result;
s5.2, after receiving the broadcasted payment result, the other nodes respectively carry out verification, if the verification is successful and the payment result is received for the first time, the payment result is broadcasted, and meanwhile, the payment result is stored in a transaction pool of the nodes; otherwise, directly discarding the payment result;
s5.3, after the preset time, recording the payment result on a block chain after the payment result is blocked by a consensus algorithm;
and S5.4, after the notification system monitors the payment result on the block chain of the node matched with the notification system, notifying the payment result to an order system of a merchant.
Further, the payment result processing step (S5) further includes:
and S5.5, after the merchant order system receives the payment result, displaying the payment result.
Further, in step S6, the packing the settlement result onto the block chain by the prior knowledge system specifically includes: the prior knowledge system verifies the settlement result, after the verification is successful, the settlement result is written into the block chain link point matched with the prior knowledge system, the node broadcasts the settlement result to other nodes, and after the preset time, the settlement result is blocked by a consensus algorithm and then recorded on a block chain.
Further, in step S1, the sending, by the APP on the mobile terminal, the received order information to the order system of the merchant specifically includes: the user selects the commodity to be purchased from the APP mall on the mobile terminal of the merchant, clicks the payment button, and the APP on the mobile terminal sends the order information to the order system of the merchant.
Further, in step S4.3, after receiving the payment response, the block chain link point matched with the pre-known system also verifies the payment response, sends the verification result to other nodes of the block chain after the verification is successful, and simultaneously stores the payment response in the transaction pool of the node; if the verification fails, directly discarding the payment response; after receiving the broadcasted payment response, other nodes respectively carry out verification, if the verification is successful and the payment response is received for the first time, broadcast the payment response and store the payment response into a transaction pool of the nodes; otherwise, the payment reply is discarded directly.
Further, the payment data which fails to be verified is processed by an error checking and processing system connected with the blockchain, wherein the payment data comprises data of a payment request, a payment response, a payment result and a settlement result.
Example 3
An APP payment method on a mobile terminal based on a block chain technology only comprises the following steps:
s1, a generation step: the APP on the mobile terminal sends the received order information to an order system of a merchant to generate a payment request;
s2, submitting: the merchant order system is used as a payment request system to submit a payment request to any one node on the block chain, and at the moment, the node forms a receiving node;
s3, block chain processing step: after the block chain verifies the payment request, the verified payment request is blocked by a consensus algorithm, so that the payment request is recorded on the block chain;
s4, monitoring and paying steps: the method comprises the steps that a first known system monitors a payment request on a block chain of a node matched with the first known system, and sends the payment request to a payment channel; the payment channel processes the payment request and returns a payment response and a payment result to the precedent system in sequence; the known system returns payment response and payment result to the block chain in sequence through the matched block chain link points;
s5, payment result processing step: after the payment results are blocked by a consensus algorithm, the payment results are recorded on a block chain and are notified to an order system of a merchant;
s6, clearing: the payment channel settles the transaction fund to the settlement account of the merchant, sends the settlement result to the advanced system, and packs the settlement result to the block chain through the block chain link points matched with the advanced system;
and S7, ending the payment.
In addition, in the invention, after other nodes of the block chain receive the broadcast, the node discards the payment data, which means that only the node with the verification failure discards the payment data, but not all the nodes discard the payment data, and the payment data also exists in a certain node or certain nodes of the block chain.
According to the transaction flow and blockchain features of the present invention, all nodes will have a complete non-tampered book. Therefore, the supervising mechanism can supervise all transactions through the account book of the node, and risk transactions are prevented from occurring.
The present invention is not limited to the above-described embodiments, and variations, modifications, additions and substitutions which can be made by those skilled in the art within the spirit of the invention are also within the scope of the invention.