Authorization code payment method, system, terminal and storage medium based on blockchain

By using smart contracts to verify and store authorization code data on the blockchain, the problems of data leakage, tampering and system failure in the existing authorization code payment technology are solved, achieving higher security and reliability, and improving user experience.

CN112488681BActive Publication Date: 2025-02-28GUANGDONG GUANGYU SCI & TECH DEV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011437571.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-11
Publication Date
2025-02-28
Estimated Expiration
2040-12-11

AI Technical Summary

Technical Problem

The existing authorization code payment technology has the risk of data breaches, tampering and system failures, resulting in the payment process being unsafe and unreliable.

Method used

The blockchain-based authorization code payment method is adopted to obtain and verify authorization code data through smart contracts, and distributed storage and encrypted signatures are carried out on the blockchain to ensure the security and immutability of data.

Benefits of technology

Effectively prevent data from being cracked and tampered during the authorization code payment process, improve the security and reliability of authorization code payment, and significantly improve the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112488681B_ABST
    Figure CN112488681B_ABST
Patent Text Reader

Abstract

The present invention provides a blockchain-based authorization code payment method, system, terminal and storage medium; the method includes: obtaining authorization code data to write a smart contract, and storing the smart contract in the blockchain; when the user end logs in to request the generation of the authorization code, obtaining the request authorization code data of the user end requesting the generation of the authorization code, and calling the smart contract to verify the validity of the request authorization code data; when the user end logs in to request the authorization code payment, obtaining the authorization code password 2 of the user end requesting the authorization code payment, encrypting the authorization code password 2 and the user login, and calling the smart contract to verify the validity of the authorization code password 2: when the verification authorization code password 2 is valid, the current authorization code payment is completed; the information and status of the authorization code amount in the authorization code data are updated, and the record of this payment is stored in the blockchain. The present invention can effectively prevent the authorization code payment data from being cracked and tampered with, thereby improving the security and reliability of the authorization code payment, and greatly improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and more specifically, to a blockchain-based authorization code payment method, system, terminal and storage medium. Background Art

[0002] Authorization code payment refers to the authorization code password generated according to the established unified payment rules and verification methods. The password sets the available electronic virtual quota according to the business scenario requirements. In the scenario where payment is required, this password is used to realize the withholding quota for payment. When the specified time or consumption quota is reached, the actual settlement of the relevant bill fees is automatically carried out through the bank system.

[0003] However, existing technologies use http and https protocols to transmit authorization codes, perform access control, and perform signature verification, as well as use traditional databases to store information related to authorization codes. When using authorization codes for payment, authorization codes and personal information may sometimes be leaked, causing unsafe risks in the authorization code limit. Even during the payment data transmission process, data may be intercepted, cracked, and tampered with by a third party, causing system insecurity and economic losses. Authorization verification services rely on limited server resources. Once these servers fail or are attacked, causing service unavailability, all consumer payment operations will be unable to proceed, causing economic losses. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings and deficiencies in the prior art and provide a blockchain-based authorization code payment method, which can effectively prevent data from being cracked and tampered with during the authorization code payment process, thereby improving the security and reliability of authorization code payment and greatly improving user experience.

[0005] The second object of the present invention is to provide an authorization code payment system based on blockchain.

[0006] A third object of the present invention is to provide an authorization code payment terminal.

[0007] A fourth object of the present invention is to provide a storage medium.

[0008] The first object of the present invention can be achieved by adopting the following technical solutions:

[0009] A blockchain-based authorization code payment method, characterized in that the method comprises:

[0010] Obtain authorization code data to write smart contracts and store the smart contracts in the blockchain;

[0011] When the user logs in and requests the authorization code to be generated, obtain the authorization code data requested by the user and call the smart contract to verify the validity of the authorization code data:

[0012] When the verification request authorization code data is valid, the request authorization code data is encrypted and stored in the blockchain, an authorization code password 1 is generated, and the authorization code password 1 is encrypted and sent to the user end;

[0013] When the verification request authorization code data is invalid, the authorization code application request fails, and the user is notified;

[0014] When the user logs in to request an authorization code payment, obtain the authorization code password 2 requested by the user, encrypt the authorization code password 2 and the user login, and call the smart contract to verify the validity of the authorization code password 2:

[0015] When the second authorization code password is verified to be valid, the authorization code payment is completed and the user is notified; the authorization code amount information and status in the authorization code data are updated, and the record of this payment is stored in the blockchain;

[0016] When the second verification authorization code password is invalid, the current authorization code payment request fails and the user is notified.

[0017] Furthermore, the authorization code data includes the authorization code amount, authorization code usage, user identity information and validity period.

[0018] Furthermore, obtaining authorization code data to write a smart contract and storing the smart contract in the blockchain means:

[0019] Use the solidity language to write smart contracts, compile them into binary files that can be read by EVM, and then deploy them to the blockchain for execution;

[0020] When a smart contract is deployed on the blockchain, a contract address will be assigned to it. Subsequent calls to the smart contract will use the contract address for calls.

[0021] Furthermore, the data for requesting the authorization code includes the amount of the requested authorization code, the purpose of the requested authorization code, the identity information of the requesting user and the validity period of the request.

[0022] Furthermore, the calling of the smart contract to verify the validity of the request authorization code data: when the verification request authorization code data is valid, the request authorization code data is encrypted and stored in the blockchain, an authorization code password 1 is generated, and the authorization code password 1 is encrypted and sent to the user end, which means:

[0023] The smart contract is called to verify the request authorization code data and the authorization code data. When the verification request authorization code data is valid, the request authorization code data is encrypted in the form of key-value through the blockchain hash algorithm and distributedly stored in all nodes of the blockchain network. At the same time, an 8-digit string containing letters and numbers is generated as the payment authorization code password one; finally, the authorization code password one is encrypted and signed using md5 and sent to the user end.

[0024] Further, the calling of the smart contract to verify the request authorization code data and the authorization code data means: calling the smart contract to verify the request authorization code data and the authorization code data according to the generation rules, and the generation rules meet the following conditions, then the verification request authorization code data is valid:

[0025] I. The requested authorization code amount is less than or equal to the authorization code amount;

[0026] II. The requested authorization code usage item matches the authorization code usage item;

[0027] III. Requesting user identity information matches the user identity information;

[0028] IV. The request is valid within the validity period.

[0029] Furthermore, the authorization code password 2 and the user login are encrypted, and the smart contract is called to verify the validity of the authorization code password 2: when the authorization code password 2 is verified to be valid, the authorization code payment is completed; the information and status of the authorization code amount in the authorization code data are updated, and the record of this payment is stored in the blockchain, which means:

[0030] The authorization code password 2 and user login information are passed to the smart contract through asymmetric encryption and MD5 encryption signature. The smart contract is called to verify the payment authorization code data and request authorization code data corresponding to the authorization code password 2 according to the verification rules. The payment authorization code data includes the payment authorization code amount, payment authorization code usage, payment user identity information and payment validity period. If the verification rules meet the following conditions, the verification authorization code password 2 is valid:

[0031] (1) The payment authorization code amount is less than or equal to the request authorization code amount;

[0032] (2) The payment authorization code usage item matches the request authorization code usage item;

[0033] (3) The identity information of the payment user matches the identity information of the requesting user;

[0034] (4) The payment validity period is within the request validity period;

[0035] When the second authorization code password is verified to be valid, the authorization code payment is completed and the user is notified; the information and status of the authorization code amount in the authorization code data are updated, and the record of this payment is stored in the blockchain.

[0036] The second object of the present invention can be achieved by adopting the following technical solutions:

[0037] A blockchain-based authorization code payment system, characterized by:

[0038] Smart contract generation module, used to obtain authorization code data to write smart contracts and store smart contracts in the blockchain;

[0039] The authorization code generation module is used to obtain the request authorization code data requested by the user end to generate the authorization code, and call the smart contract to verify the validity of the request authorization code data: when the verification request authorization code data is valid, the request authorization code data is encrypted and stored in the blockchain, and the authorization code password 1 is generated, and the authorization code password 1 is encrypted and sent to the user end; when the verification request authorization code data is invalid, the current authorization code application request fails, and the user end is notified;

[0040] The authorization code payment module is used to obtain the authorization code password 2 requested by the user for authorization code payment, encrypt the authorization code password 2 and the user login, and call the smart contract to verify the validity of the authorization code password 2: when the verification authorization code password 2 is valid, complete the current authorization code payment and notify the user; update the information and status of the authorization code amount in the authorization code data, and store the record of this payment in the blockchain; when the verification authorization code password 2 is invalid, the current authorization code payment request fails and the user is notified.

[0041] The third object of the present invention can be achieved by adopting the following technical solutions:

[0042] An authorization code payment terminal includes a processor and a memory for storing a program executable by the processor, characterized in that: the above-mentioned blockchain-based authorization code payment method is implemented.

[0043] The fourth object of the present invention can be achieved by adopting the following technical solutions:

[0044] When the computer program is executed by a processor, the processor executes the above-mentioned blockchain-based authorization code payment method.

[0045] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0046] 1. The blockchain-based authorization code payment method of the present invention can effectively prevent data from being cracked and tampered with during the authorization code payment process, thereby improving the security and reliability of the authorization code payment and greatly improving the user experience.

[0047] 2. The present invention adopts blockchain cryptography technology to encrypt the request authorization code data, and also performs encrypted signature verification during the transmission of the authorization code password to prevent the data from being cracked.

[0048] 3. The present invention adopts blockchain decentralized technology to deploy services in a decentralized manner and distribute the authorization code information in all nodes of the blockchain network, ensuring that the authorization code information will not be lost and is available in real time, thereby improving the fault tolerance and anti-attack capabilities of the service and preventing data from being tampered with.

[0049] 4. The present invention adopts blockchain smart contract technology, and writes data into the blockchain block by writing a smart contract program. The smart contract defines the generation rules and verification rules of the authorization code, and all operations follow this set of rules. Once the rules are written into the blockchain, no one can modify them, and a truly trusted mechanism is realized. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a flow chart of smart contract generation in the blockchain-based authorization code payment method of the present invention;

[0051] Figure 2 It is a flow chart of the generation of the authorization code in the authorization code payment method based on blockchain of the present invention;

[0052] Figure 3 It is a flow chart of the authorization code payment in the authorization code payment method based on blockchain of the present invention; DETAILED DESCRIPTION

[0053] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0054] Embodiment 1

[0055] like Figures 1 to 3 As shown, a blockchain-based authorization code payment method includes:

[0056] (I) Obtain authorization code data to write a smart contract and store the smart contract in the blockchain. The authorization code data includes the authorization code amount, authorization code usage, user identity information and validity period.

[0057] According to the authorization code data, a smart contract is written and stored in the blockchain. The smart contract is written in solidity language and compiled into a binary file that can be read by EVM, and then deployed to the blockchain for execution; a smart contract deployed on the blockchain will be assigned a contract address, and subsequent calls to the smart contract will use the contract address for calling. Once the smart contract of the present invention is successfully deployed, stored and executed on the blockchain, the smart contract will not be modified by anyone, meeting the 100% trusted mechanism requirements. Subsequent authorization code generation and verification during authorization code payment are achieved by calling this smart contract through the contract address.

[0058] (ii) When the user logs in and requests the generation of an authorization code, obtain the request authorization code data of the user requesting the generation of the authorization code, and call the smart contract to verify the request authorization code data with the authorization code data:

[0059] 1. When the verification request authorization code data is valid, the request authorization code data is encrypted in the form of key-value through the blockchain hash algorithm and distributedly stored in all nodes of the blockchain network to ensure the security of the request authorization code data. At the same time, an 8-bit string containing letters and numbers is generated as the payment authorization code password 1. The most basic feature of the blockchain is decentralization. It no longer relies on centralized institutions and realizes the distributed recording, storage and updating of data. All nodes in the blockchain network have the right to keep accounts. The present invention uses the decentralized characteristics of the blockchain to store the request authorization code data in a distributed manner in all nodes of the blockchain network, ensuring that the request authorization code data will not be lost and is available in real time. Finally, the authorization code password 1 is encrypted and signed using md5 and sent to the user end to prevent data tampering.

[0060] 2. When the verification request authorization code data is invalid and the authorization code application request fails, the user end is notified.

[0061] Among them, calling the smart contract to verify the request authorization code data and the authorization code data means: the request authorization code data is the request authorization code amount, the request authorization code usage, the request user identity information and the request validity period. Calling the smart contract to verify the request authorization code data and the authorization code data according to the generation rules. If the generation rules meet the following conditions, the verification request authorization code data is valid:

[0062] I. The requested authorization code amount is less than or equal to the authorization code amount;

[0063] II. The requested authorization code usage item matches the authorization code usage item;

[0064] III. Requesting user identity information matches the user identity information;

[0065] IV. The request is valid within the validity period.

[0066] (III) When the user logs in and requests the authorization code payment, obtain the authorization code password 2 for the user requesting the authorization code payment, pass the authorization code password 2 and the user login information to the smart contract through asymmetric encryption and MD5 encryption signature, and call the smart contract to verify the payment authorization code data corresponding to the authorization code password 2 and the request authorization code data according to the verification rules, where the payment authorization code data includes the payment authorization code amount, the payment authorization code usage, the payment user identity information and the payment validity period; if the verification rules meet the following conditions, the verification authorization code password 2 is valid:

[0067] (1) The payment authorization code amount is less than or equal to the request authorization code amount;

[0068] (2) The payment authorization code usage item matches the request authorization code usage item;

[0069] (3) The identity information of the payment user matches the identity information of the requesting user;

[0070] (4) The payment validity period is within the request validity period;

[0071] 1. When the second authorization code password is verified to be valid, the authorization code payment is completed and the user is notified; the information and status of the authorization code amount in the authorization code data are updated, and the record of this payment is stored in the blockchain.

[0072] 2. When the second verification authorization code password is invalid, the current authorization code payment request fails and the user is notified.

[0073] Embodiment 2

[0074] In order to implement the blockchain-based authorization code payment method described in Example 1, this embodiment provides a blockchain-based authorization code payment system, which includes:

[0075] Smart contract generation module, used to obtain authorization code data to write smart contracts and store smart contracts in the blockchain;

[0076] The authorization code generation module is used to obtain the request authorization code data requested by the user end to generate the authorization code, and call the smart contract to verify the validity of the request authorization code data: when the verification request authorization code data is valid, the request authorization code data is encrypted and stored in the blockchain, and the authorization code password 1 is generated, and the authorization code password 1 is encrypted and sent to the user end; when the verification request authorization code data is invalid, the current authorization code application request fails, and the user end is notified;

[0077] The authorization code payment module is used to obtain the authorization code password 2 requested by the user for authorization code payment, encrypt the authorization code password 2 and the user login, and call the smart contract to verify the validity of the authorization code password 2: when the verification authorization code password 2 is valid, complete the current authorization code payment and notify the user; update the information and status of the authorization code amount in the authorization code data, and store the record of this payment in the blockchain; when the verification authorization code password 2 is invalid, the current authorization code payment request fails and the user is notified.

[0078] Embodiment 3

[0079] The present embodiment provides an authorization code payment terminal, including a processor and a memory for storing a program executable by the processor, and is characterized in that: the blockchain-based authorization code payment method described in the first embodiment is implemented.

[0080] Embodiment 4

[0081] This embodiment provides a storage medium, characterized in that: the storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the blockchain-based authorization code payment method described in Embodiment 1.

[0082] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A blockchain-based authorization code payment method, characterized by: The method comprises: Obtain authorization code data to write smart contracts and store the smart contracts in the blockchain; When the user logs in and requests the authorization code to be generated, obtain the authorization code data requested by the user and call the smart contract to verify the validity of the authorization code data: When the verification request authorization code data is valid, the request authorization code data is encrypted and stored in the blockchain, an authorization code password 1 is generated, and the authorization code password 1 is encrypted and sent to the user end; When the verification request authorization code data is invalid, the authorization code application request fails, and the user is notified; When the user logs in to request an authorization code payment, obtain the authorization code password 2 requested by the user, encrypt the authorization code password 2 and the user login, and call the smart contract to verify the validity of the authorization code password 2: When the second authorization code password is verified to be valid, the authorization code payment is completed and the user is notified; the authorization code amount information and status in the authorization code data are updated, and the record of this payment is stored in the blockchain; When the second verification authorization code password is invalid, the current authorization code payment request fails and the user is notified; The obtaining of authorization code data to write a smart contract and storing the smart contract in the blockchain refers to: Use the solidity language to write smart contracts, compile them into binary files that can be read by EVM, and then deploy them to the blockchain for execution; When a smart contract is deployed on the blockchain, a contract address will be assigned to it. Subsequent calls to the smart contract will use the contract address for calls. The authorization code data includes the authorization code amount, authorization code usage, user identity information and validity period; The authorization code request data includes the authorization code request amount, the authorization code request usage, the requesting user identity information and the request validity period; The calling of the smart contract to verify the validity of the request authorization code data: when the verification request authorization code data is valid, the request authorization code data is encrypted and stored in the blockchain, an authorization code password 1 is generated, and the authorization code password 1 is encrypted and sent to the user end, which means: The smart contract is called to verify the request authorization code data and the authorization code data. When the verification request authorization code data is valid, the request authorization code data is encrypted in the form of key-value through the blockchain hash algorithm and distributedly stored in all nodes of the blockchain network. At the same time, an 8-digit string containing letters and numbers is generated as the payment authorization code password 1; finally, the authorization code password 1 is encrypted and signed using md5 and sent to the user end; The calling of the smart contract to verify the request authorization code data and the authorization code data means: calling the smart contract to verify the request authorization code data and the authorization code data according to the generation rules, and the generation rules meet the following conditions, then the verification request authorization code data is valid: Ⅰ. The requested authorization code amount is less than or equal to the authorization code amount; Ⅱ. The purpose of the requested authorization code matches the purpose of the authorization code; III. The identity information of the user requesting the use of the information matches the identity information of the user using the information; IV. The request is valid within the validity period.

2. The blockchain-based authorization code payment method according to claim 1, characterized in that: The encryption of the authorization code password 2 and the user login, calling the smart contract to verify the validity of the authorization code password 2: when the authorization code password 2 is verified to be valid, the current authorization code payment is completed; the information and status of the authorization code amount in the authorization code data are updated, and the record of this payment is stored in the blockchain, which means: The authorization code password 2 and user login information are passed to the smart contract through asymmetric encryption and MD5 encryption signature. The smart contract is called to verify the payment authorization code data and request authorization code data corresponding to the authorization code password 2 according to the verification rules. The payment authorization code data includes the payment authorization code amount, payment authorization code usage, payment user identity information and payment validity period. If the verification rules meet the following conditions, the verification authorization code password 2 is valid: (1) The payment authorization code amount is less than or equal to the request authorization code amount; (2) The payment authorization code usage item matches the request authorization code usage item; (3) The identity information of the payment user matches the identity information of the requesting user; (4) The payment validity period is within the request validity period; When the second authorization code password is verified to be valid, the authorization code payment is completed and the user is notified; the information and status of the authorization code amount in the authorization code data are updated, and the record of this payment is stored in the blockchain.

3. A blockchain-based authorization code payment system, using the blockchain-based authorization code payment method according to claim 1, characterized in that: include: Smart contract generation module, used to obtain authorization code data to write smart contracts and store smart contracts in the blockchain; The authorization code generation module is used to obtain the request authorization code data requested by the user end to generate the authorization code, and call the smart contract to verify the validity of the request authorization code data: when the verification request authorization code data is valid, the request authorization code data is encrypted and stored in the blockchain, and the authorization code password 1 is generated, and the authorization code password 1 is encrypted and sent to the user end; when the verification request authorization code data is invalid, the current authorization code application request fails, and the user end is notified; The authorization code payment module is used to obtain the authorization code password 2 requested by the user for authorization code payment, encrypt the authorization code password 2 and the user login, and call the smart contract to verify the validity of the authorization code password 2: when the verification authorization code password 2 is valid, complete the current authorization code payment and notify the user; update the information and status of the authorization code amount in the authorization code data, and store the record of this payment in the blockchain; when the verification authorization code password 2 is invalid, the current authorization code payment request fails and the user is notified.

4. An authorization code payment terminal, comprising a processor and a memory for storing a program executable by the processor, characterized in that: Implement the blockchain-based authorization code payment method described in claim 1 or 2.

5. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, causes the processor to execute the blockchain-based authorization code payment method according to claim 1 or 2.

Citation Information

Patent Citations

  • Block chain-based payment method and system and computer readable storage medium

    CN108197913A

  • Payment token application method, device, system and server

    CN111861457A