IP Library Granted Patent US 11,126,739
Granted Patent B2
US 11,126,739 · App. 17/160,254 · Granted Sep 21, 2021

Invoice access method and apparatus based on blockchain, and electronic device

Inventors: Hansong Xiao (Zhejiang, CN); Ping Zhang (Zhejiang, CN); Wenhu Kan (Zhejiang, CN); Qin Liu (Zhejiang, CN); Liangrong Lin (Zhejiang, CN); Fuxi Deng (Zhejiang, CN); Yixiang Zhang (Zhejiang, CN); Rui Chen (Zhejiang, CN); Jinming Duan (Zhejiang, CN)
Assignee: Advanced New Technologies Co., Ltd.
G06F21/6218G06F21/602H04L9/0618H04L9/08H04L2209/38
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,126,739
App. No.
17/160,254
Granted
Sep 21, 2021
Kind
B2
Abstract

One or more implementations of the present specification provide an invoice access method and apparatus based on a blockchain, and an electronic device. The method includes: receiving an access request initiated by an access user for a target invoice by using a client, the target invoice being encrypted and stored in the blockchain; determining, in response to the access request, whether the access user has an authority to access the target invoice; and in response to that the access user has the authority to access the target invoice, invoking decryption logic provided in a predetermined smart contract to decrypt ciphertext data of the target invoice stored in the blockchain, and returning decrypted plaintext data of the target invoice to the client.

Claims (91)

1. A method based on a blockchain, comprising:

receiving a creation request initiated by a creation user for a target invoice through a client of the creation user;

determining an invoice issuer and an invoice receiver of the target invoice in response to the creation request;

invoking an encryption logic provided in a smart contract to separately encrypt plaintext data of the target invoice based on keys corresponding to the invoice issuer and the invoice receiver, and adding encrypted ciphertext data of the target invoice and user identifiers of the invoice issuer and the invoice receiver of the target invoice to the blockchain;

receiving an access request initiated by an access user for accessing the target invoice through a client of the access user;

determining, in response to the access request, whether the access user has an authority to access the target invoice; and

in response to the access user having the authority to access the target invoice, invoking a decryption logic provided in the smart contract to decrypt the ciphertext data of the target invoice stored in the blockchain, and returning decrypted plaintext data of the target invoice to the client.

2. The method according to claim 1 , wherein:

the smart contract provides an access authority verification logic for the access user; and

the determining whether the access user has the authority to access the target invoice includes:

invoking the access authority verification logic provided in the smart contract to determine whether the access user has the authority to access the target invoice.

3. The method according to claim 1 , wherein the separately encrypting the plaintext data of the target invoice based on the keys corresponding to the invoice issuer and the invoice receiver includes:

encrypting plaintext data of the target invoice based on a first key corresponding to the invoice issuer to obtain first ciphertext data;

encrypting the plaintext data of the target invoice based on a second key corresponding to the invoice receiver to obtain second ciphertext data; and

the adding the encrypted ciphertext data of the target invoice and the user identifiers of the invoice issuer and the invoice receiver of the target invoice to the blockchain for storage includes:

adding a corresponding relationship between the first ciphertext data and a user identifier of the invoice issuer to the blockchain for storage; and

adding a corresponding relationship between the second ciphertext data and a user identifier of the invoice receiver to the blockchain for storage.

4. The method according to claim 1 , wherein:

the access request includes a user identifier of the access user; and

the determining whether the access user has the authority to access the target invoice includes:

obtaining the user identifiers of the invoice issuer and the invoice receiver of the target invoice;

determining whether the user identifier of the access user matches at least one of the user identifiers of the invoice issuer or the invoice receiver; and

in response to that the user identifier of the access user matching at least one of the user identifiers of the invoice issuer or the invoice receiver, determining that the access user has the authority to access the target invoice.

5. The method according to claim 1 , wherein the decrypting the ciphertext data of the target invoice stored in the blockchain includes:

decrypting, based on a key corresponding to the access user, the ciphertext data of the target invoice stored in the blockchain.

6. The method according to claim 1 , wherein:

the smart contract further provides a key distribution logic; and

the method comprises:

receiving a registration request initiated by a user by using a client; and

invoking the key distribution logic in the smart contract in response to the registration request, and writing a corresponding relationship between a user identifier of the user and a key distributed to the user into the smart contract.

7. An electronic device, comprising:

a processor; and

a memory storing machine-executable instructions,

wherein by reading and executing the machine-executable instructions that are stored in the memory, the processor is enabled to implement acts including:

receiving a creation request initiated by a creation user for a target invoice through a client of the creation user;

determining an invoice issuer and an invoice receiver of the target invoice in response to the creation request; and

separately encrypting plaintext data of the target invoice based on keys corresponding to the invoice issuer and the invoice receiver, and adding encrypted ciphertext data of the target invoice and user identifiers of the invoice issuer and the invoice receiver of the target invoice to a blockchain;

receiving an access request initiated by an access user for accessing the target invoice through a client of the access user;

determining, in response to the access request, whether the access user has an authority to access the target invoice; and

in response to the access user having the authority to access the target invoice, decrypting the ciphertext data of the target invoice stored in the blockchain, and returning decrypted plaintext data of the target invoice to the client.

8. The electronic device according to claim 7 , wherein

the determining whether the access user has the authority to access the target invoice includes:

invoking a smart contract to determine whether the access user has the authority to access the target invoice.

9. The electronic device according to claim 7 , wherein the separately encrypting the plaintext data of the target invoice based on the keys corresponding to the invoice issuer and the invoice receiver includes:

encrypting plaintext data of the target invoice based on a first key corresponding to the invoice issuer to obtain first ciphertext data;

encrypting the plaintext data of the target invoice based on a second key corresponding to the invoice receiver to obtain second ciphertext data; and

the adding the encrypted ciphertext data of the target invoice and the user identifiers of the invoice issuer and the invoice receiver of the target invoice to the blockchain for storage includes:

adding a corresponding relationship between the first ciphertext data and a user identifier of the invoice issuer to the blockchain for storage; and

adding a corresponding relationship between the second ciphertext data and a user identifier of the invoice receiver to the blockchain for storage.

10. The electronic device according to claim 7 , wherein:

the access request includes a user identifier of the access user; and

the determining whether the access user has the authority to access the target invoice includes:

obtaining the user identifiers of the invoice issuer and the invoice receiver of the target invoice;

determining whether the user identifier of the access user matches at least one of the user identifiers of the invoice issuer or the invoice receiver; and

in response to the user identifier of the access user matching at least one of the user identifiers of the invoice issuer or the invoice receiver, determining that the access user has the authority to access the target invoice.

11. The electronic device according to claim 7 , wherein the decrypting the ciphertext data of the target invoice stored in the blockchain includes:

decrypting, based on a key corresponding to the access user, the ciphertext data of the target invoice stored in the blockchain.

12. The electronic device according to claim 7 , wherein:

the acts include:

receiving a registration request initiated by a user by using a client; and

in response to the registration request, invoking a smart contract to distribute a key to the user and writing a corresponding relationship between a user identifier of the user and the key distributed to the user into the smart contract.

13. A non-transitory computer-readable storage medium storing computer-executable instructions, which when executed by a processor, configure the processor to implement acts including:

receiving a creation request initiated by a creation user for a target invoice through a client of the creation user;

determining an invoice issuer and an invoice receiver of the target invoice in response to the creation request; and

invoking an encryption logic provided in a smart contract to separately encrypt plaintext data of the target invoice based on keys corresponding to the invoice issuer and the invoice receiver, and adding encrypted ciphertext data of the target invoice and user identifiers of the invoice issuer and the invoice receiver of the target invoice to a blockchain;

receiving an access request initiated by an access user for accessing the target invoice through a client of the access user;

determining, in response to the access request, whether the access user has an authority to access the target invoice; and

in response to the access user having the authority to access the target invoice, invoking a decryption logic provided in the smart contract to decrypt the ciphertext data of the target invoice stored in the blockchain, and returning decrypted plaintext data of the target invoice to the client.

14. The non-transitory computer-readable storage medium according to claim 13 , wherein:

the smart contract provides an access authority verification logic for the access user; and

the determining whether the access user has the authority to access the target invoice includes:

invoking the access authority verification logic provided in the smart contract to determine whether the access user has the authority to access the target invoice.

15. The non-transitory computer-readable storage medium according to claim 13 , wherein the separately encrypting the plaintext data of the target invoice based on the keys corresponding to the invoice issuer and the invoice receiver includes:

encrypting plaintext data of the target invoice based on a first key corresponding to the invoice issuer to obtain first ciphertext data;

encrypting the plaintext data of the target invoice based on a second key corresponding to the invoice receiver to obtain second ciphertext data; and

the adding the encrypted ciphertext data of the target invoice and the user identifiers of the invoice issuer and the invoice receiver of the target invoice to the blockchain for storage includes:

adding a corresponding relationship between the first ciphertext data and a user identifier of the invoice issuer to the blockchain for storage; and

adding a corresponding relationship between the second ciphertext data and a user identifier of the invoice receiver to the blockchain for storage.

16. The non-transitory computer-readable storage medium according to claim 13 , wherein:

the access request includes a user identifier of the access user; and

the determining whether the access user has the authority to access the target invoice includes:

obtaining the user identifiers of the invoice issuer and the invoice receiver of the target invoice;

determining whether the user identifier of the access user matches at least one of the user identifiers of the invoice issuer or the invoice receiver; and

in response to the user identifier of the access user matching at least one of the user identifiers of the invoice issuer or the invoice receiver, determining that the access user has the authority to access the target invoice.

17. The non-transitory computer-readable storage medium according to claim 13 , wherein the decrypting the ciphertext data of the target invoice stored in the blockchain includes:

decrypting, based on a key corresponding to the access user, the ciphertext data of the target invoice stored in the blockchain.

18. The non-transitory computer-readable storage medium according to claim 13 , wherein:

the smart contract further provides a key distribution logic; and

the acts include:

receiving a registration request initiated by a user by using a client; and

invoking the key distribution logic in the smart contract in response to the registration request, and writing a corresponding relationship between a user identifier of the user and a key distributed to the user into the smart contract.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 19, 2021
From: XIAO, HANSONG; ZHANG, PING; KAN, WENHU; LIU, QIN; LIN, LIANGRONG; DENG, FUXI; ZHANG, YIXIANG; CHEN, RUI; DUAN, JINMING
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 056292/0394 →
Priority Claims (1)
CN 201811519422.4 · Dec 12, 2018 · national
Continuity (2)
Continuation PCTCN2019114308 · Oct 30, 2019
Related Publication 20210150046A1 · May 20, 2021