WO2020134574A1 - Blockchain-based invoice authenticity verification method, apparatus, and electronic device - Google Patents

Blockchain-based invoice authenticity verification method, apparatus, and electronic device Download PDF

Info

Publication number
WO2020134574A1
WO2020134574A1 PCT/CN2019/115357 CN2019115357W WO2020134574A1 WO 2020134574 A1 WO2020134574 A1 WO 2020134574A1 CN 2019115357 W CN2019115357 W CN 2019115357W WO 2020134574 A1 WO2020134574 A1 WO 2020134574A1
Authority
WO
WIPO (PCT)
Prior art keywords
invoice
blockchain
identified
digital
content
Prior art date
Application number
PCT/CN2019/115357
Other languages
French (fr)
Chinese (zh)
Inventor
肖汉松
阚文虎
张萍
刘勤
林亮荣
孙震
张翼翔
段金明
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2020134574A1 publication Critical patent/WO2020134574A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • G07CHECKING-DEVICES
    • G07DHANDLING OF COINS OR VALUABLE PAPERS, e.g. TESTING, SORTING BY DENOMINATIONS, COUNTING, DISPENSING, CHANGING OR DEPOSITING
    • G07D7/00Testing specially adapted to determine the identity or genuineness of valuable papers or for segregating those which are unacceptable, e.g. banknotes that are alien to a currency
    • G07D7/004Testing specially adapted to determine the identity or genuineness of valuable papers or for segregating those which are unacceptable, e.g. banknotes that are alien to a currency using digital security elements, e.g. information coded on a magnetic thread or strip
    • G07D7/0047Testing specially adapted to determine the identity or genuineness of valuable papers or for segregating those which are unacceptable, e.g. banknotes that are alien to a currency using digital security elements, e.g. information coded on a magnetic thread or strip using checkcodes, e.g. coded numbers derived from serial number and denomination

Definitions

  • the embodiments of the present specification relate to the field of blockchain technology, and in particular to a blockchain-based invoice authenticity verification method, device, and electronic equipment.
  • Blockchain technology also known as distributed ledger technology, is an emerging technology in which several computing devices jointly participate in "bookkeeping" and jointly maintain a complete distributed database. Because blockchain technology is decentralized, open and transparent, each computing device can participate in database records, and data synchronization can be quickly performed between computing devices, making blockchain technology widely implemented in many fields. application.
  • An embodiment of this specification provides a method, device and electronic device for authenticating invoices based on blockchain:
  • a method for verifying the authenticity of an invoice based on a blockchain is provided.
  • the blockchain stores the correspondence between the invoice and the digital summary of the invoice.
  • the method includes:
  • the method further includes:
  • calculating a digital digest of the invoice to be identified, and querying whether a target invoice corresponding to the digital digest is stored in the blockchain includes:
  • the method further includes:
  • the target invoice is returned to the client.
  • the digital summary of the invoice includes:
  • the anti-counterfeiting verification request includes the invoice content of the to-be-identified invoice; or, the unique information in the invoice content;
  • the uniqueness information in the invoice content is hashed to obtain a hash value.
  • the blockchain is an alliance chain.
  • an invoice authenticity verification device based on a blockchain in which the correspondence between invoices and digital summaries of invoices is stored, and the device includes:
  • the receiving unit receives the anti-counterfeiting verification request for the invoice to be identified submitted by the client;
  • the verification unit in response to the anti-counterfeit verification request, calculates a digital digest of the invoice to be identified, and queries whether a target invoice corresponding to the digital digest is stored in the blockchain;
  • the return unit if a target invoice corresponding to the digital digest is stored in the blockchain, returns a verification result that the to-be-identified invoice is true to the client.
  • the device further includes:
  • a creation request receiving unit receiving an invoice creation request submitted by a client; wherein the invoice creation request includes invoice creation information input by a user;
  • An invoice creation response unit in response to the invoice creation request, invokes the invoice creation logic declared in the smart contract published on the blockchain, creates an invoice based on the invoice creation information; and, calculates a digital summary of the invoice, and The correspondence between the invoice and the digital summary of the invoice is stored in the blockchain.
  • the verification unit specifically includes:
  • the device further includes:
  • the query returning unit returns the target invoice to the client if the target data corresponding to the digital summary is stored in the blockchain.
  • the digital summary of the invoice includes:
  • the anti-counterfeiting verification request includes the invoice content of the to-be-identified invoice; or, the unique information in the invoice content;
  • the uniqueness information in the invoice content is hashed to obtain a hash value.
  • the blockchain is an alliance chain.
  • an electronic device including:
  • Memory for storing processor executable instructions
  • the processor is configured as any of the above-mentioned blockchain based invoice authenticity verification methods.
  • the embodiment of this specification provides a blockchain-based invoice authenticity verification scheme, which stores invoices and digital summaries of invoices in the blockchain in advance; due to the immutable characteristics of the data stored in the blockchain, and The unique feature of digital digest (that is, one digital digest corresponds to one original data); therefore, anti-counterfeiting verification can be performed based on the digital digest of the invoice stored in the blockchain.
  • the user only needs to upload the invoice to be identified. If the target invoice corresponding to the digital summary of the invoice to be identified stored in the blockchain can be queried, the invoice to be identified and the target invoice can be indicated to be identical 'S invoice is true, otherwise it is false.
  • FIG. 1 is a flowchart of a blockchain-based invoice authenticity verification method provided by an embodiment of this specification
  • FIG. 2 is a schematic diagram of an invoice on-chain provided by an embodiment of this specification.
  • FIG. 3 is a hardware structure diagram of a blockchain-based invoice authenticity verification device provided by an embodiment of this specification
  • FIG. 4 is a schematic block diagram of a blockchain-based invoice authenticity verification device provided by an embodiment of the present specification.
  • first, second, third, etc. may be used in this specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” as used herein may be interpreted as "when” or “when” or “in response to a determination”.
  • Invoice can refer to the business vouchers issued and received by all units or individuals in the purchase and sale of commodities, the provision or acceptance of services, and other business activities. Invoices are usually the original basis for accounting, and also an important basis for law enforcement inspections by auditing and tax authorities.
  • the invoice is mainly the basis for the company to make an account, and it is also the voucher for paying taxes; for the employee, the invoice can mainly be used for reimbursement.
  • This specification provides a blockchain-based invoice authenticity verification method by storing invoices and digital summaries of invoices in the blockchain in advance; due to the immutable characteristics of the data stored in the blockchain and the digital summaries
  • the only characteristic that is, one digital digest corresponds to one original data
  • anti-counterfeiting verification can be performed based on the digital digest of the invoice stored in the blockchain.
  • the user only needs to upload the invoice to be identified. If the target invoice corresponding to the digital summary of the invoice to be identified stored in the blockchain can be queried, the invoice to be identified and the target invoice can be indicated to be identical 'S invoice is true, otherwise it is false.
  • FIG. 1 is a flowchart of a blockchain-based invoice authenticity verification method provided by an embodiment of the present specification.
  • the blockchain stores the correspondence between invoices and digital summaries of invoices. The methods described include:
  • Step 110 Receive the anti-counterfeiting verification request for the invoice to be identified submitted by the client;
  • Step 120 In response to the anti-counterfeit verification request, calculate a digital digest of the invoice to be identified, and query whether the target invoice corresponding to the digital digest is stored in the blockchain;
  • Step 130 If the target invoice corresponding to the digital digest is stored in the blockchain, return a verification result that the to-be-identified invoice is true to the client.
  • the blockchain described in this specification may specifically include private chains, public chains, alliance chains, etc., and is not particularly limited in this specification.
  • the above-mentioned blockchain may specifically be an alliance chain composed of headquarters organizations, branches, agencies, etc. as alliance members; the operator of the alliance chain may rely on the alliance chain to deploy the corresponding Business; and the headquarters, branches, and agencies as members of the alliance described above can be used as a business node of the above business.
  • Each business node can publish the invoices and digital summaries generated or received by itself in the form of a transaction in the alliance chain, and after the transaction has been processed by the consensus nodes in the alliance chain, the distribution in the alliance chain
  • the database is stored to complete the "on-chain" deposit of the above transaction information.
  • Transaction refers to a piece of data that is created by the client of the blockchain and needs to be finally released to the distributed database of the blockchain.
  • a narrowly defined transaction refers to a value transfer issued by the user to the blockchain; for example, in the traditional Bitcoin blockchain network, the transaction can be a transfer initiated by the user in the blockchain.
  • the generalized transaction refers to a piece of business data with business intent published by the user to the blockchain; for example, the operator can build an alliance chain based on actual business needs, relying on the alliance chain to deploy some other types not related to value transfer Online services (such as certificate storage services, anti-counterfeiting verification services, etc.), and in this type of alliance chain, a transaction can be a business message or business request issued by a user with business intent in the alliance chain.
  • the above client may include any type of upper-layer application that uses the underlying business data stored in the blockchain as data support to implement specific business functions.
  • the nodes in the blockchain usually need to rely on the corresponding smart contract to operate the block.
  • operations such as storage, modification, and deletion in the blockchain all rely on smart contracts.
  • the smart contract may be a computer protocol intended to be applied on the blockchain to propagate, verify or execute the contract in an information manner.
  • By declaring business logic in the smart contract the corresponding operation can be performed.
  • Smart contracts allow trusted transactions without third parties. These transactions are traceable and irreversible. Smart contracts can provide better security than traditional contract methods and reduce other transaction costs associated with contracts.
  • the smart contract can be deployed locally on the blockchain node. When the node needs to perform an action, it can call the corresponding smart contract and run the smart contract to execute the business logic declared in the smart contract, thereby obtaining the execution result.
  • the digital digest described in this specification may refer to a hash value (hash value) obtained by performing a hash (hash, also called hash) calculation on the original data.
  • the digital summary of the invoice includes:
  • the unique information in the invoice content is hashed (hash value).
  • the content of the invoice may contain unique information.
  • the invoice content can include the invoice number and invoice code; usually the invoice number and invoice code are unique information; correspondingly, the digital summary of the invoice can be recorded as hash (invoice number + invoice code).
  • the invoice content can also include non-unique information, such as invoice date and tax-free amount; correspondingly, the digital summary of the invoice can be recorded as hash (invoice number + invoice code + invoice date + tax-free amount).
  • the anti-counterfeiting verification request includes the invoice content of the invoice to be identified; or, the unique information in the invoice content;
  • the uniqueness information in the invoice content is hashed to obtain a hash value.
  • the method further includes:
  • the user when a user needs to create an invoice in the blockchain, the user can initiate a transaction for creating an invoice through the client used by the client, that is, an invoice creation request is initiated through the client.
  • the user can input the invoice creation information of the target invoice to be created through the invoice creation page provided by the client; for example, the information such as the header and amount of the invoice.
  • the client can generate a corresponding invoice creation request based on the invoice creation information input by the user, and send the invoice creation request to the node device in the blockchain.
  • the node device in the blockchain can respond to the invoice creation request, and call the invoice creation logic declared in the smart contract published on the blockchain, based on the invoice in the invoice creation request.
  • the creation information creates an invoice; and after the invoice creation is completed, the digital summary of the invoice can be further calculated, and the correspondence between the invoice and the digital summary of the invoice is stored in the blockchain.
  • the node device that responds to the invoice creation request may first determine whether the invoice creation quota of the invoice issuer corresponding to the invoice creation request is sufficient.
  • the taxpayer identification number of the invoice issuer is The invoice issuer corresponding to the invoice creation request. Subsequently, you can first determine whether the invoice creation quota of the invoice issuer is sufficient.
  • the node device can call the quota check logic declared in the smart contract deployed on the blockchain to determine whether the invoice creation quota of the invoice issuer is sufficient.
  • the quota check logic may specifically be the program code (for example, some program methods or functions that can be called) that is declared in the smart contract and is related to the execution logic for checking the invoice creation quota of the invoice issuer.
  • the node device may call a third-party trusted service and send the invoice creation request to the third-party trusted service.
  • the third-party trusted service may be a program code that is deployed on the third-party trusted service device and is related to the execution logic of checking the invoice creation quota of the invoice issuer.
  • the trusted service device of the third party may be a device in the intranet of the tax bureau, thereby improving data security.
  • the trusted service of the third party can determine whether the invoice creation quota of the invoice issuer is sufficient, and return the determination result to the node device.
  • the node device may determine whether the invoice creation quota of the invoice issuer is sufficient based on the determination result returned by the trusted service of the third party.
  • the trusted service of the third party may return the determination result that the invoice creation quota of the invoice issuer is sufficient to the node device when it is determined that the invoice creation quota of the invoice issuer is sufficient.
  • the node device may determine that the invoice creation party's invoice creation quota is sufficient.
  • the trusted service of the third party may return the determination result that the invoice creation quota of the invoice issuer is insufficient when it is determined that the invoice creation quota of the invoice issuer is insufficient.
  • the node device may determine that the invoice creation quota of the invoice issuer is insufficient.
  • the invoice creation logic declared in the smart contract deployed on the blockchain can be called to create the target invoice based on the invoice creation information entered by the user in the invoice creation request.
  • invoice creation logic may specifically be the program code declared in the smart contract and related to the execution logic of creating the invoice.
  • the invoice may be provided by the organization that originally generated the invoice.
  • the national tax bureau may directly or indirectly upload the first invoice data of the invoice to the blockchain.
  • the invoice is also recorded on the system of the tax bureau, and the tax system of the tax bureau can simultaneously synchronize the invoices on the chain and deposit certificates.
  • the process of depositing certificates on the chain is the same as that in the foregoing embodiment, and details are not repeated here.
  • the mapping relationship between invoice A hash and invoice A data can be recorded in the blockchain; the mapping relationship between invoice B hash and invoice B data; invoice The mapping relationship between C hash and invoice C data.
  • the user After the user receives the invoice, if he needs to know the authenticity of the invoice, he can use the invoice as the invoice to be identified, and can submit the anti-counterfeiting verification request for the invoice to be identified to the blockchain through the client to call the deployment on the blockchain
  • the smart contract used for invoice anti-counterfeiting verification verifies the authenticity of the invoice to be identified.
  • the user can enter the invoice content of the invoice to be verified or the unique information in the invoice content on the client (hereinafter the invoice content or the unique information in the invoice content is simply referred to as Invoice data), and carry the entered invoice data in the anti-counterfeiting verification request sent by the client; send it to the node device in the blockchain to trigger the node device in the blockchain to call the deployed smart contract to verify the invoice to be identified Authenticity.
  • the node device in the blockchain can directly receive the invoice data.
  • the user can take a picture of the invoice to be identified, collect the invoice image of the invoice to be identified, and perform image recognition on the collected invoice image on the client or a third-party identification system to identify the invoice data , And carry the invoice data obtained by image recognition in the anti-counterfeiting verification request sent by the client, and send it to the node device in the blockchain to trigger the node device in the blockchain to call the deployed smart contract to verify the invoice to be identified Authenticity.
  • the image recognition of the collected image data of the invoice can be specifically completed by a smart contract deployed in the blockchain, or by calling a third-party trusted service.
  • invoice data in the invoice image is identified according to an image recognition algorithm.
  • the smart contract itself has contract logic for image recognition, and the invoice data in the invoice image can be identified locally at the node.
  • the method further includes:
  • the node device can also send the invoice image in the anti-counterfeiting verification request to the third-party trusted service by invoking a third-party trusted service (such as a third-party image recognition agency), which is based on the onboard image recognition algorithm , Perform image recognition on the invoice image to obtain the invoice data, and the node device can obtain the invoice data returned by the third-party image recognition organization.
  • a third-party trusted service such as a third-party image recognition agency
  • the image recognition can be handed over to a third-party image recognition agency, thereby reducing the performance requirements of the nodes (not all nodes can have the computing resources required for image recognition).
  • the node device may call the invoice verification logic declared in the smart contract published on the blockchain, calculate the digital summary of the invoice to be identified, and query Whether the target invoice corresponding to the digital digest is stored in the blockchain.
  • the target invoice corresponding to the digital digest is stored in the blockchain, it indicates that the invoice to be identified has been deposited in the blockchain; therefore, the verification result that the invoice to be identified is true can be returned to the client ; Further, if the target data corresponding to the digital summary is stored in the blockchain, return the target invoice to the client for the client to view.
  • the target invoice corresponding to the digital abstract cannot be queried in the blockchain, it means that the invoice to be identified is not stored on the blockchain, so the verification result that the invoice to be identified is false can be returned to the customer end.
  • This specification proposes a blockchain-based invoice authenticity verification scheme by storing invoices and digital summaries of invoices in the blockchain in advance; due to the immutable characteristics of the data stored in the blockchain and the digital summaries
  • the only characteristic that is, one digital digest corresponds to one original data
  • anti-counterfeiting verification can be performed based on the digital digest of the invoice stored in the blockchain.
  • the user only needs to upload the invoice to be identified. If the target invoice corresponding to the digital summary of the invoice to be identified stored in the blockchain can be queried, the invoice to be identified and the target invoice can be indicated to be identical 'S invoice is true, otherwise it is false.
  • this specification also provides an embodiment of the blockchain-based invoice authenticity verification device.
  • the device embodiments may be implemented by software, or by hardware or a combination of hardware and software. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer service program instructions in the non-volatile memory into the memory through the processor of the device where it is located and running.
  • FIG. 3 it is a hardware structure diagram of the device where the blockchain-based invoice authenticity verification device is located, except for the processor, network interface, memory and non-easy
  • the device where the device is located in the embodiment usually verifies the actual function based on the authenticity of the invoice based on the blockchain, and may also include other hardware, which will not be repeated here.
  • FIG. 4 is a block diagram of a blockchain-based invoice authenticity verification device provided by an embodiment of the present specification.
  • the device corresponds to the embodiment shown in FIG. 1.
  • the blockchain stores invoices and invoices.
  • the corresponding relationship between the digital abstracts of the device includes:
  • the receiving unit 210 receives the anti-counterfeiting verification request for the to-be-identified invoice submitted by the client;
  • the verification unit 220 in response to the anti-counterfeiting verification request, calculates a digital digest of the invoice to be identified, and inquires whether a target invoice corresponding to the digital digest is stored in the blockchain;
  • the returning unit 230 returns the verification result that the invoice to be identified is true if the target invoice corresponding to the digital digest is stored in the blockchain.
  • the device further includes:
  • a creation request receiving unit receiving an invoice creation request submitted by a client; wherein the invoice creation request includes invoice creation information input by a user;
  • An invoice creation response unit in response to the invoice creation request, invokes the invoice creation logic declared in the smart contract published on the blockchain, creates an invoice based on the invoice creation information; and, calculates a digital summary of the invoice, and The correspondence between the invoice and the digital summary of the invoice is stored in the blockchain.
  • the verification unit 220 specifically includes:
  • the device further includes:
  • the query returning unit returns the target invoice to the client if the target data corresponding to the digital summary is stored in the blockchain.
  • the digital summary of the invoice includes:
  • the anti-counterfeiting verification request includes the invoice content of the to-be-identified invoice; or, the unique information in the invoice content;
  • the uniqueness information in the invoice content is hashed to obtain a hash value.
  • the blockchain is an alliance chain.
  • the system, device, module or unit explained in the above embodiments may be specifically implemented by a computer chip or entity, or implemented by a product having a certain function.
  • a typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or any combination of these devices.
  • the relevant part can be referred to the description of the method embodiment.
  • the device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or Distributed to multiple network elements. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solution in this specification. Those of ordinary skill in the art can understand and implement without paying creative labor.
  • FIG. 4 describes the internal functional modules and structural schematics of the blockchain-based invoice authenticity verification device.
  • the actual execution subject may be an electronic device, including:
  • Memory for storing processor executable instructions
  • the processor is configured to:
  • Optional also includes:
  • calculating a digital digest of the invoice to be identified, and querying whether a target invoice corresponding to the digital digest is stored in the blockchain includes:
  • Optional also includes:
  • the target invoice is returned to the client.
  • the digital summary of the invoice includes:
  • the anti-counterfeiting verification request includes the invoice content of the to-be-identified invoice; or, the unique information in the invoice content;
  • the uniqueness information in the invoice content is hashed to obtain a hash value.
  • the blockchain is an alliance chain.
  • the processor may be a central processing unit (English: Central Processing Unit, abbreviated as: CPU), or other general-purpose processors, digital signal processors (English: Digital Signal Processor) , Referred to as DSP), application specific integrated circuit (English: Application Specific Integrated Circuit, referred to as ASIC), etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the aforementioned memory may be a read-only memory (English: read-only memory, abbreviation: ROM), a random access memory (English) : Random access memory (RAM for short), flash memory, hard disk or solid state drive.
  • the steps of the method disclosed in conjunction with the embodiments of the present invention may be directly implemented and completed by a hardware processor, or may be implemented and completed by a combination of hardware and software modules in the processor.

Abstract

Provided are a blockchain-based invoice authenticity verification method, an apparatus, and an electronic device, correspondence relationships between invoices and digital summaries of the invoices being stored in said blockchain. The method comprises: an anti-fraud verification request submitted by a client in regard to an invoice to be identified is received; in response to the anti-fraud verification request, a digital summary of the invoice to be identified is calculated, and whether a target invoice corresponding to the digital summary is stored in a blockchain is queried; and if such an invoice is stored in the blockchain, a verification result that the invoice to be identified is authentic is returned to the client.

Description

基于区块链的发票真伪验证方法、装置和电子设备Invoice authenticity verification method, device and electronic equipment based on blockchain 技术领域Technical field
本说明书实施例涉及区块链技术领域,尤其涉及一种基于区块链的发票真伪验证方法、装置和电子设备。The embodiments of the present specification relate to the field of blockchain technology, and in particular to a blockchain-based invoice authenticity verification method, device, and electronic equipment.
背景技术Background technique
区块链技术,也被称之为分布式账本技术,是一种由若干台计算设备共同参与“记账”,共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化、公开透明、每台计算设备可以参与数据库记录、并且各计算设备之间可以快速的进行数据同步的特性,使得区块链技术在众多的领域中广泛的进行应用。Blockchain technology, also known as distributed ledger technology, is an emerging technology in which several computing devices jointly participate in "bookkeeping" and jointly maintain a complete distributed database. Because blockchain technology is decentralized, open and transparent, each computing device can participate in database records, and data synchronization can be quickly performed between computing devices, making blockchain technology widely implemented in many fields. application.
发明内容Summary of the invention
本说明书实施例提供的一种基于区块链的发票真伪验证方法、装置和电子设备:An embodiment of this specification provides a method, device and electronic device for authenticating invoices based on blockchain:
根据本说明书实施例的第一方面,提供一种基于区块链的发票真伪验证方法,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述方法包括:According to a first aspect of the embodiments of the present specification, a method for verifying the authenticity of an invoice based on a blockchain is provided. The blockchain stores the correspondence between the invoice and the digital summary of the invoice. The method includes:
接收客户端提交的针对待识别发票的防伪验证请求;Receive the anti-counterfeiting verification request for the invoice to be identified submitted by the client;
响应于所述防伪验证请求,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;In response to the anti-counterfeiting verification request, calculate a digital digest of the invoice to be identified, and query whether the target invoice corresponding to the digital digest is stored in the blockchain;
如果所述区块链中存储了与所述数字摘要对应的目标发票,向所述客户端返回所述待识别发票为真的验证结果。If the target invoice corresponding to the digital digest is stored in the blockchain, a verification result that the to-be-identified invoice is true is returned to the client.
可选的,所述方法还包括:Optionally, the method further includes:
接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;Receiving an invoice creation request submitted by a client; wherein the invoice creation request includes invoice creation information input by a user;
响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,In response to the invoice creation request, call the invoice creation logic declared in the smart contract published on the blockchain to create an invoice based on the invoice creation information; and,
计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。Calculate the digital summary of the invoice, and store the correspondence between the invoice and the digital summary of the invoice in the blockchain.
可选的,所述响应于所述防伪验证请求,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票,包括:Optionally, in response to the anti-counterfeiting verification request, calculating a digital digest of the invoice to be identified, and querying whether a target invoice corresponding to the digital digest is stored in the blockchain includes:
响应于所述防伪验证请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。In response to the anti-counterfeit verification request, call the invoice verification logic declared in the smart contract published on the blockchain, calculate the digital summary of the invoice to be identified, and query whether the digital data is stored in the blockchain The target invoice corresponding to the summary.
可选的,所述方法还包括:Optionally, the method further includes:
如果所述区块链中存储了与所述数字摘要对应的目标数据,向所述客户端返回所述目标发票。If the target data corresponding to the digital digest is stored in the blockchain, the target invoice is returned to the client.
可选的,所述发票的数字摘要包括:Optionally, the digital summary of the invoice includes:
针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到的hash值。For the invoice content of the invoice; or a hash value calculated by hashing the unique information in the invoice content.
可选的,所述防伪验证请求包括所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;Optionally, the anti-counterfeiting verification request includes the invoice content of the to-be-identified invoice; or, the unique information in the invoice content;
所述计算所述待识别发票的数字摘要,包括:The calculation of the digital summary of the invoice to be identified includes:
获取所述防伪验证请求中的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;Obtaining the invoice content of the to-be-identified invoice in the anti-counterfeiting verification request; or, the unique information in the invoice content;
针对获取到的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。Regarding the acquired invoice content of the invoice to be identified; or, the uniqueness information in the invoice content is hashed to obtain a hash value.
可选的,所述区块链为联盟链。Optionally, the blockchain is an alliance chain.
根据本说明书实施例的第二方面,提供一种基于区块链的发票真伪验证装置,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述装置包括:According to a second aspect of the embodiments of the present specification, there is provided an invoice authenticity verification device based on a blockchain in which the correspondence between invoices and digital summaries of invoices is stored, and the device includes:
接收单元,接收客户端提交的针对待识别发票的防伪验证请求;The receiving unit receives the anti-counterfeiting verification request for the invoice to be identified submitted by the client;
验证单元,响应于所述防伪验证请求,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;The verification unit, in response to the anti-counterfeit verification request, calculates a digital digest of the invoice to be identified, and queries whether a target invoice corresponding to the digital digest is stored in the blockchain;
返回单元,如果所述区块链中存储了与所述数字摘要对应的目标发票,向所述客户端返回所述待识别发票为真的验证结果。The return unit, if a target invoice corresponding to the digital digest is stored in the blockchain, returns a verification result that the to-be-identified invoice is true to the client.
可选的,所述装置还包括:Optionally, the device further includes:
创建请求接收单元,接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;A creation request receiving unit, receiving an invoice creation request submitted by a client; wherein the invoice creation request includes invoice creation information input by a user;
发票创建响应单元,响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。An invoice creation response unit, in response to the invoice creation request, invokes the invoice creation logic declared in the smart contract published on the blockchain, creates an invoice based on the invoice creation information; and, calculates a digital summary of the invoice, and The correspondence between the invoice and the digital summary of the invoice is stored in the blockchain.
可选的,所述验证单元,具体包括:Optionally, the verification unit specifically includes:
响应于所述防伪验证请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。In response to the anti-counterfeit verification request, call the invoice verification logic declared in the smart contract published on the blockchain, calculate the digital summary of the invoice to be identified, and query whether the digital data is stored in the blockchain The target invoice corresponding to the summary.
可选的,所述装置还包括:Optionally, the device further includes:
查询返回单元,如果所述区块链中存储了与所述数字摘要对应的目标数据,向所述客户端返回所述目标发票。The query returning unit returns the target invoice to the client if the target data corresponding to the digital summary is stored in the blockchain.
可选的,所述发票的数字摘要包括:Optionally, the digital summary of the invoice includes:
针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到的hash值。For the invoice content of the invoice; or a hash value calculated by hashing the unique information in the invoice content.
可选的,所述防伪验证请求包括所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;Optionally, the anti-counterfeiting verification request includes the invoice content of the to-be-identified invoice; or, the unique information in the invoice content;
所述计算所述待识别发票的数字摘要,包括:The calculation of the digital summary of the invoice to be identified includes:
获取所述防伪验证请求中的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;Obtaining the invoice content of the to-be-identified invoice in the anti-counterfeiting verification request; or, the unique information in the invoice content;
针对获取到的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。Regarding the acquired invoice content of the invoice to be identified; or, the uniqueness information in the invoice content is hashed to obtain a hash value.
可选的,所述区块链为联盟链。Optionally, the blockchain is an alliance chain.
根据本说明书实施例的第五方面,提供一种电子设备,包括:According to a fifth aspect of the embodiments of the present specification, an electronic device is provided, including:
处理器;processor;
用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
其中,所述处理器被配置为上述任一项基于区块链的发票真伪验证方法。Wherein, the processor is configured as any of the above-mentioned blockchain based invoice authenticity verification methods.
本说明书实施例,提供了一种基于区块链的发票真伪验证方案,预先将发票和发票的数字摘要存储到区块链中;由于区块链中存储的数据存在不可篡改的特征,以及数字摘要具有的唯一特征(即一个数字摘要对应一个原始数据);因此,可以基于区块链中存储的发票的数字摘要进行防伪验证。具体地,用户只需要上传待识别发票,如果可以查询到所述区块链中存储有待识别发票的数字摘要对应的目标发票,就可以说明待识别发票与目标发票相同,进而就可以说明待识别的发票为真,反之为假。The embodiment of this specification provides a blockchain-based invoice authenticity verification scheme, which stores invoices and digital summaries of invoices in the blockchain in advance; due to the immutable characteristics of the data stored in the blockchain, and The unique feature of digital digest (that is, one digital digest corresponds to one original data); therefore, anti-counterfeiting verification can be performed based on the digital digest of the invoice stored in the blockchain. Specifically, the user only needs to upload the invoice to be identified. If the target invoice corresponding to the digital summary of the invoice to be identified stored in the blockchain can be queried, the invoice to be identified and the target invoice can be indicated to be identical 'S invoice is true, otherwise it is false.
附图说明BRIEF DESCRIPTION
图1是本说明书一实施例提供的基于区块链的发票真伪验证方法的流程图;FIG. 1 is a flowchart of a blockchain-based invoice authenticity verification method provided by an embodiment of this specification;
图2是本说明书一实施例提供的发票上链的示意图;2 is a schematic diagram of an invoice on-chain provided by an embodiment of this specification;
图3是本说明书一实施例提供的基于区块链的发票真伪验证装置的硬件结构图;3 is a hardware structure diagram of a blockchain-based invoice authenticity verification device provided by an embodiment of this specification;
图4是本说明书一实施例提供的基于区块链的发票真伪验证装置的模块示意图。4 is a schematic block diagram of a blockchain-based invoice authenticity verification device provided by an embodiment of the present specification.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail here, examples of which are shown in the drawings. When referring to the drawings below, unless otherwise indicated, the same numerals in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.
在本说明书使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书。在本说明书和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in this specification is for the purpose of describing particular embodiments only, and is not intended to limit this specification. The singular forms "a", "said" and "the" used in this specification and the appended claims are also intended to include most forms unless the context clearly indicates other meanings. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more associated listed items.
应当理解,尽管在本说明书可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to a determination".
发票(Invoice)可以是指一切单位或个人在购销商品、提供或接受服务以及从事其他经营活动中,所开具和收取的业务凭证。发票通常是会计核算的原始依据,也是审 计机关、税务机关执法检查的重要依据。对于公司来讲,发票主要是公司做账的依据,同时也是缴税的费用凭证;而对于员工来讲,发票主要可以用来报销。Invoice (Invoice) can refer to the business vouchers issued and received by all units or individuals in the purchase and sale of commodities, the provision or acceptance of services, and other business activities. Invoices are usually the original basis for accounting, and also an important basis for law enforcement inspections by auditing and tax authorities. For the company, the invoice is mainly the basis for the company to make an account, and it is also the voucher for paying taxes; for the employee, the invoice can mainly be used for reimbursement.
发票由于涉及到缴税、报销等相关利益,因此现实生活中提供或收到假发票的情况下时有发生。一般的税务局可以提供发票真伪的查验,然而由于受到专业知识限制,普通用户并不会到税务局进行查验;这就容易被一些不法商家利用,这些商家为了逃税会提供假发票给用户。可见,需要提供一种简单可靠的发票防伪验证方案供用户随时查询发票的真伪。Since invoices involve taxes, reimbursement and other related interests, real-life situations in which false invoices are provided or received often occur. The general taxation bureau can provide the verification of the authenticity of invoices. However, due to the limitation of professional knowledge, ordinary users will not go to the taxation bureau for verification; this is easy to be used by some illegal businesses. These businesses will provide fake invoices to users for tax evasion. It can be seen that a simple and reliable invoice anti-counterfeiting verification scheme needs to be provided for users to check the authenticity of invoices at any time.
本说明书提供了一种基于区块链的发票真伪验证方法,通过预先将发票和发票的数字摘要存储到区块链中;由于区块链中存储的数据存在不可篡改的特征,以及数字摘要具有的唯一特征(即一个数字摘要对应一个原始数据);因此,可以基于区块链中存储的发票的数字摘要进行防伪验证。具体地,用户只需要上传待识别发票,如果可以查询到所述区块链中存储有待识别发票的数字摘要对应的目标发票,就可以说明待识别发票与目标发票相同,进而就可以说明待识别的发票为真,反之为假。This specification provides a blockchain-based invoice authenticity verification method by storing invoices and digital summaries of invoices in the blockchain in advance; due to the immutable characteristics of the data stored in the blockchain and the digital summaries The only characteristic (that is, one digital digest corresponds to one original data); therefore, anti-counterfeiting verification can be performed based on the digital digest of the invoice stored in the blockchain. Specifically, the user only needs to upload the invoice to be identified. If the target invoice corresponding to the digital summary of the invoice to be identified stored in the blockchain can be queried, the invoice to be identified and the target invoice can be indicated to be identical 'S invoice is true, otherwise it is false.
请参考图1,图1为本说明书一实施例提供的基于区块链的发票真伪验证方法的流程图,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述方法包括:Please refer to FIG. 1, which is a flowchart of a blockchain-based invoice authenticity verification method provided by an embodiment of the present specification. The blockchain stores the correspondence between invoices and digital summaries of invoices. The methods described include:
步骤110:接收客户端提交的针对待识别发票的防伪验证请求;Step 110: Receive the anti-counterfeiting verification request for the invoice to be identified submitted by the client;
步骤120:响应于所述防伪验证请求,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;Step 120: In response to the anti-counterfeit verification request, calculate a digital digest of the invoice to be identified, and query whether the target invoice corresponding to the digital digest is stored in the blockchain;
步骤130:如果所述区块链中存储了与所述数字摘要对应的目标发票,向所述客户端返回所述待识别发票为真的验证结果。Step 130: If the target invoice corresponding to the digital digest is stored in the blockchain, return a verification result that the to-be-identified invoice is true to the client.
在本说明书所描述的区块链,具体可以包括私有链、公有链以及联盟链等,在本说明书中不进行特别限定。The blockchain described in this specification may specifically include private chains, public chains, alliance chains, etc., and is not particularly limited in this specification.
例如,在一个场景中,上述区块链具体可以是由总部机构、分支机构、代理机构等作为联盟成员组成的一个联盟链;该联盟链的运营方可以依托于该联盟链,来部署相应的业务;而以上所描述的作为联盟成员的总部机构、分支机构、代理机构都可以作为上述业务的一个业务节点。各个业务节点可以将自身所产生或者接收到的与发票以及数字摘要以交易的形式在联盟链中进行发布,并在该交易经过联盟链中的共识节点的共识处理之后,在联盟链中的分布式数据库进行存储,完成上述交易信息的“上链”存证。For example, in a scenario, the above-mentioned blockchain may specifically be an alliance chain composed of headquarters organizations, branches, agencies, etc. as alliance members; the operator of the alliance chain may rely on the alliance chain to deploy the corresponding Business; and the headquarters, branches, and agencies as members of the alliance described above can be used as a business node of the above business. Each business node can publish the invoices and digital summaries generated or received by itself in the form of a transaction in the alliance chain, and after the transaction has been processed by the consensus nodes in the alliance chain, the distribution in the alliance chain The database is stored to complete the "on-chain" deposit of the above transaction information.
其中,需要说明的是,在本说明书中所描述的交易(Transaction),是指通过区块 链的客户端创建,并需要最终发布至区块链的分布式数据库中的一笔数据。Among them, it should be noted that the transaction (Transaction) described in this specification refers to a piece of data that is created by the client of the blockchain and needs to be finally released to the distributed database of the blockchain.
区块链中的交易,通常存在狭义的交易以及广义的交易之分。狭义的交易是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易可以是用户在区块链中发起的一笔转账。而广义的交易是指用户向区块链发布的一笔具有业务意图的业务数据;例如,运营方可以基于实际的业务需求搭建一个联盟链,依托于联盟链部署一些与价值转移无关的其它类型的在线业务(比如,存证业务、防伪验证业务等),而在这类联盟链中,交易可以是用户在联盟链中发布的一笔具有业务意图的业务消息或者业务请求。There are usually narrow transactions and broad transactions in the transactions in the blockchain. A narrowly defined transaction refers to a value transfer issued by the user to the blockchain; for example, in the traditional Bitcoin blockchain network, the transaction can be a transfer initiated by the user in the blockchain. The generalized transaction refers to a piece of business data with business intent published by the user to the blockchain; for example, the operator can build an alliance chain based on actual business needs, relying on the alliance chain to deploy some other types not related to value transfer Online services (such as certificate storage services, anti-counterfeiting verification services, etc.), and in this type of alliance chain, a transaction can be a business message or business request issued by a user with business intent in the alliance chain.
上述客户端,可以包括任意类型的以区块链中存储的底层业务数据作为数据支撑,来实现特定的业务功能的上层应用。The above client may include any type of upper-layer application that uses the underlying business data stored in the blockchain as data support to implement specific business functions.
在区块链技术中,区块链中节点对区块进行操作通常需要依赖相应的智能合约(Smart contract)。例如在区块链中存储、修改、删除等操作均需要依赖智能合约。所述智能合约可以是一种旨在应用在可以部署在区块链上的以信息化方式传播、验证或执行合同的计算机协议。通过在智能合约中声明业务逻辑可以实现执行相应操作。智能合约允许在没有第三方的情况下进行可信交易。这些交易可追踪且不可逆转。智能合约能够提供优于传统合同方法的安全,并减少与合同相关的其他交易成本。通常,智能合约可以是部署在区块链节点本地的,当节点需要执行某个动作时可以调用相应的智能合约,运行智能合约以执行智能合约中声明的业务逻辑,从而得到执行结果。In the blockchain technology, the nodes in the blockchain usually need to rely on the corresponding smart contract to operate the block. For example, operations such as storage, modification, and deletion in the blockchain all rely on smart contracts. The smart contract may be a computer protocol intended to be applied on the blockchain to propagate, verify or execute the contract in an information manner. By declaring business logic in the smart contract, the corresponding operation can be performed. Smart contracts allow trusted transactions without third parties. These transactions are traceable and irreversible. Smart contracts can provide better security than traditional contract methods and reduce other transaction costs associated with contracts. Generally, the smart contract can be deployed locally on the blockchain node. When the node needs to perform an action, it can call the corresponding smart contract and run the smart contract to execute the business logic declared in the smart contract, thereby obtaining the execution result.
本说明书中所述的数字摘要,可以是指基于原始数据进行哈希(hash,也称为散列)计算后得到的哈希值(hash值)。The digital digest described in this specification may refer to a hash value (hash value) obtained by performing a hash (hash, also called hash) calculation on the original data.
具体地,所述发票的数字摘要包括:Specifically, the digital summary of the invoice includes:
针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行哈希计算得到的(hash值)。For the invoice content of the invoice; or, the unique information in the invoice content is hashed (hash value).
其中,所述发票内容可以包含唯一性信息。例如,发票内容可以包括发票号码、发票代码;通常发票号码和发票代码均是唯一性信息;对应的,发票的数字摘要可以记为hash(发票号码+发票代码)。当然,发票内容还可以包括非唯一性信息,例如发票日期、不含税金额;对应的,发票的数字摘要即可以记为hash(发票号码+发票代码+发票日期+不含税金额)。Wherein, the content of the invoice may contain unique information. For example, the invoice content can include the invoice number and invoice code; usually the invoice number and invoice code are unique information; correspondingly, the digital summary of the invoice can be recorded as hash (invoice number + invoice code). Of course, the invoice content can also include non-unique information, such as invoice date and tax-free amount; correspondingly, the digital summary of the invoice can be recorded as hash (invoice number + invoice code + invoice date + tax-free amount).
相应地,所述防伪验证请求包括所述待识别发票的发票内容;或者,所述发票内 容中的唯一性信息;Correspondingly, the anti-counterfeiting verification request includes the invoice content of the invoice to be identified; or, the unique information in the invoice content;
计算所述待识别发票的数字摘要,包括:Calculating the digital summary of the invoice to be identified includes:
获取所述防伪验证请求中的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;Obtaining the invoice content of the to-be-identified invoice in the anti-counterfeiting verification request; or, the unique information in the invoice content;
针对获取到的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。Regarding the acquired invoice content of the invoice to be identified; or, the uniqueness information in the invoice content is hashed to obtain a hash value.
如前所述,本说明书预先将发票进行上链,在一实施例中,所述方法还包括:As mentioned above, this specification pre-chains the invoice. In an embodiment, the method further includes:
接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;Receiving an invoice creation request submitted by a client; wherein the invoice creation request includes invoice creation information input by a user;
响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,In response to the invoice creation request, call the invoice creation logic declared in the smart contract published on the blockchain to create an invoice based on the invoice creation information; and,
计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。Calculate the digital summary of the invoice, and store the correspondence between the invoice and the digital summary of the invoice in the blockchain.
值得一提的是,前述计算所述待识别发票的数字摘要和创建发票时计算发票的数字摘要采用的是相同的哈希算法。It is worth mentioning that the aforementioned calculation of the digital digest of the invoice to be identified and the calculation of the digital digest of the invoice when creating the invoice use the same hash algorithm.
以下结合图2所示的发票上链的示意图加以说明:The following is combined with the schematic diagram of the invoice on-chain shown in Figure 2:
在本实施例中,用户在需要在该区块链中创建发票时,可以通过其所使用的客户端发起一笔用于创建发票的交易,即通过客户端发起发票创建请求。具体地,该用户可以通过该客户端提供的发票创建页面,输入待创建的目标发票的发票创建信息;例如,发票的抬头、金额等信息。在该用户完成发票创建信息的输入后,该客户端可以基于用户输入的发票创建信息来生成对应的发票创建请求,并将该发票创建请求发送至该区块链中的节点设备。In this embodiment, when a user needs to create an invoice in the blockchain, the user can initiate a transaction for creating an invoice through the client used by the client, that is, an invoice creation request is initiated through the client. Specifically, the user can input the invoice creation information of the target invoice to be created through the invoice creation page provided by the client; for example, the information such as the header and amount of the invoice. After the user completes the input of the invoice creation information, the client can generate a corresponding invoice creation request based on the invoice creation information input by the user, and send the invoice creation request to the node device in the blockchain.
该区块链中的节点设备在接收到该发票创建请求后,可以对该发票创建请求进行响应,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于发票创建请求中的发票创建信息创建发票;以及在完成发票创建后,可以进一步计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。After receiving the invoice creation request, the node device in the blockchain can respond to the invoice creation request, and call the invoice creation logic declared in the smart contract published on the blockchain, based on the invoice in the invoice creation request The creation information creates an invoice; and after the invoice creation is completed, the digital summary of the invoice can be further calculated, and the correspondence between the invoice and the digital summary of the invoice is stored in the blockchain.
在一实施例中,响应于所述发票创建请求的节点设备,还可以先确定与该发票创建请求对应的发票开具方的发票创建额度是否充足。In an embodiment, the node device that responds to the invoice creation request may first determine whether the invoice creation quota of the invoice issuer corresponding to the invoice creation request is sufficient.
举例来说,可以从该发票创建请求中该用户输入的发票创建信息中,获取发票开具方的纳税人识别号,并基于该纳税人识别号确定对应的发票开具方,该发票开具方即为该发票创建请求对应的发票开具方。后续,可以先确定该发票开具方的发票创建额度是否充足。For example, you can obtain the taxpayer identification number of the invoice issuer from the invoice creation information entered by the user in the invoice creation request, and determine the corresponding invoice issuer based on the taxpayer identification number. The invoice issuer is The invoice issuer corresponding to the invoice creation request. Subsequently, you can first determine whether the invoice creation quota of the invoice issuer is sufficient.
在示出的一种实施方式中,可以由该节点设备调用部署在该区块链上的智能合约中声明的额度检查逻辑,确定该发票开具方的发票创建额度是否充足。In one embodiment shown, the node device can call the quota check logic declared in the smart contract deployed on the blockchain to determine whether the invoice creation quota of the invoice issuer is sufficient.
其中,额度检查逻辑具体可以是声明在该智能合约中的,与检查发票开具方的发票创建额度的执行逻辑相关的程序代码(例如:一些可供调用的程序方法或者函数)。The quota check logic may specifically be the program code (for example, some program methods or functions that can be called) that is declared in the smart contract and is related to the execution logic for checking the invoice creation quota of the invoice issuer.
或者,也可以由该节点设备调用第三方的可信服务,将该发票创建请求发送给该第三方的可信服务。其中,第三方的可信服务可以是部署在第三方的可信服务设备上的,与检查发票开具方的发票创建额度的执行逻辑相关的程序代码。举例来说,该第三方的可信服务设备可以是在税务局内网中的设备,由此可以提高数据安全性。Alternatively, the node device may call a third-party trusted service and send the invoice creation request to the third-party trusted service. Among them, the third-party trusted service may be a program code that is deployed on the third-party trusted service device and is related to the execution logic of checking the invoice creation quota of the invoice issuer. For example, the trusted service device of the third party may be a device in the intranet of the tax bureau, thereby improving data security.
该第三方的可信服务可以确定该发票开具方的发票创建额度是否充足,并将确定结果返回至该节点设备。该节点设备可以基于该第三方的可信服务返回的确定结果,确定该发票开具方的发票创建额度是否充足。The trusted service of the third party can determine whether the invoice creation quota of the invoice issuer is sufficient, and return the determination result to the node device. The node device may determine whether the invoice creation quota of the invoice issuer is sufficient based on the determination result returned by the trusted service of the third party.
具体地,该第三方的可信服务可以在确定该发票开具方的发票创建额度充足时,向该节点设备返回该发票开具方的发票创建额度充足的确定结果。该节点设备在接收到该确定结果后,可以确定该发票开具方的发票创建额度充足。或者,该第三方的可信服务可以在确定该发票开具方的发票创建额度不充足时,向该节点设备返回该发票开具方的发票创建额度不充足的确定结果。该节点设备在接收到该确定结果后,可以确定该发票开具方的发票创建额度不充足。Specifically, the trusted service of the third party may return the determination result that the invoice creation quota of the invoice issuer is sufficient to the node device when it is determined that the invoice creation quota of the invoice issuer is sufficient. After receiving the determination result, the node device may determine that the invoice creation party's invoice creation quota is sufficient. Alternatively, the trusted service of the third party may return the determination result that the invoice creation quota of the invoice issuer is insufficient when it is determined that the invoice creation quota of the invoice issuer is insufficient. After receiving the determination result, the node device may determine that the invoice creation quota of the invoice issuer is insufficient.
如果确定该发票开具方的发票创建额度充足,则可以调用部署在该区块链上的智能合约中声明的发票创建逻辑,基于该发票创建请求中用户输入的发票创建信息,创建目标发票。If it is determined that the invoice creation quota of the invoice issuer is sufficient, the invoice creation logic declared in the smart contract deployed on the blockchain can be called to create the target invoice based on the invoice creation information entered by the user in the invoice creation request.
其中,发票创建逻辑具体可以是声明在该智能合约中的,与创建发票的执行逻辑相关的程序代码。Wherein, the invoice creation logic may specifically be the program code declared in the smart contract and related to the execution logic of creating the invoice.
在另一实施例中,所述发票可以是由原始生成发票的机构提供的。例如可以是由国家税务局将发票的第一发票数据直接或间接上传给区块链。具体地,当一开发票设备开具一张发票后,该发票也记录在税务局的系统上,该税务局的税务系统可以同步将发 票上链存证。其中所述上链存证的过程如前所述实施例相同,这里不再进行赘述。In another embodiment, the invoice may be provided by the organization that originally generated the invoice. For example, the national tax bureau may directly or indirectly upload the first invoice data of the invoice to the blockchain. Specifically, when an invoice is issued by an invoicing device, the invoice is also recorded on the system of the tax bureau, and the tax system of the tax bureau can simultaneously synchronize the invoices on the chain and deposit certificates. The process of depositing certificates on the chain is the same as that in the foregoing embodiment, and details are not repeated here.
如图2所示,发票A、发票B和发票C上链后,在区块链中就可以记录有发票A hash和发票A数据的映射关系;发票B hash和发票B数据的映射关系;发票C hash和发票C数据的映射关系。As shown in Figure 2, after invoice A, invoice B, and invoice C are chained, the mapping relationship between invoice A hash and invoice A data can be recorded in the blockchain; the mapping relationship between invoice B hash and invoice B data; invoice The mapping relationship between C hash and invoice C data.
以下介绍本说明书中发票防伪验证的过程:The following describes the invoice anti-counterfeiting verification process in this manual:
用户在收到发票后,如果需要知道发票真伪,可以将该发票作为待识别发票,并可以通过客户端向区块链提交针对待识别发票的防伪验证请求,来调用在区块链上部署的用于发票防伪验证的智能合约,验证该待识别发票的真伪。After the user receives the invoice, if he needs to know the authenticity of the invoice, he can use the invoice as the invoice to be identified, and can submit the anti-counterfeiting verification request for the invoice to be identified to the blockchain through the client to call the deployment on the blockchain The smart contract used for invoice anti-counterfeiting verification verifies the authenticity of the invoice to be identified.
在一种实现方式中,如前述创建发票类似的,用户可以在客户端上输入待验证发票的发票内容或者发票内容中的唯一性信息(以下将发票内容或者发票内容中的唯一性信息简称为发票数据),并将输入的发票数据携带在客户端发送的防伪验证请求中;发送给区块链中的节点设备,来触发区块链中的节点设备调用部署的智能合约,验证待识别发票的真伪。也就是说,区块链中节点设备可以直接接收到发票数据。In one implementation, similar to the aforementioned invoice creation, the user can enter the invoice content of the invoice to be verified or the unique information in the invoice content on the client (hereinafter the invoice content or the unique information in the invoice content is simply referred to as Invoice data), and carry the entered invoice data in the anti-counterfeiting verification request sent by the client; send it to the node device in the blockchain to trigger the node device in the blockchain to call the deployed smart contract to verify the invoice to be identified Authenticity. In other words, the node device in the blockchain can directly receive the invoice data.
在另一种实现方式中,用户可以对待识别发票进行拍照,采集待识别发票的发票图像,并在客户端上或者第三方识别系统上对采集到的发票图像进行图像识别,来识别出发票数据,并将通过图像识别得到的发票数据携带在客户端发送的防伪验证请求中,发送给区块链中的节点设备,来触发区块链中的节点设备调用部署的智能合约,验证待识别发票的真伪。In another implementation, the user can take a picture of the invoice to be identified, collect the invoice image of the invoice to be identified, and perform image recognition on the collected invoice image on the client or a third-party identification system to identify the invoice data , And carry the invoice data obtained by image recognition in the anti-counterfeiting verification request sent by the client, and send it to the node device in the blockchain to trigger the node device in the blockchain to call the deployed smart contract to verify the invoice to be identified Authenticity.
其中,对采集到的发票的图像数据进行图像识别,具体可以由部署在区块链中的智能合约来完成,也可以通过调用第三方的可信服务来完成。Among them, the image recognition of the collected image data of the invoice can be specifically completed by a smart contract deployed in the blockchain, or by calling a third-party trusted service.
在一实施例中,根据图像识别算法,识别所述发票图像中的发票数据。该实施例中,智能合约自身具有图像识别的合约逻辑,可以在节点本地识别出发票图像中的发票数据。In one embodiment, invoice data in the invoice image is identified according to an image recognition algorithm. In this embodiment, the smart contract itself has contract logic for image recognition, and the invoice data in the invoice image can be identified locally at the node.
在一实施例中,所述方法还包括:In an embodiment, the method further includes:
节点设备也可以通过调用第三方的可信服务(比如第三方的图像识别机构),将防伪验证请求中的发票图像发送给第三方可信服务,由第三方可信服务基于搭载的图像识别算法,对发票图像进行图像识别获取上述发票数据,而节点设备可以获取所述第三方图像识别机构返回的发票数据。该实施例中,可以将图像识别交由第三方图像识别机构完成,从而降低对节点性能的要求(并非所有节点都可以具备图像识别所需的计算资 源)。The node device can also send the invoice image in the anti-counterfeiting verification request to the third-party trusted service by invoking a third-party trusted service (such as a third-party image recognition agency), which is based on the onboard image recognition algorithm , Perform image recognition on the invoice image to obtain the invoice data, and the node device can obtain the invoice data returned by the third-party image recognition organization. In this embodiment, the image recognition can be handed over to a third-party image recognition agency, thereby reducing the performance requirements of the nodes (not all nodes can have the computing resources required for image recognition).
在一实施例中,节点设备在获取到防伪验证请求中的发票数据后,可以调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。In one embodiment, after obtaining the invoice data in the anti-counterfeiting verification request, the node device may call the invoice verification logic declared in the smart contract published on the blockchain, calculate the digital summary of the invoice to be identified, and query Whether the target invoice corresponding to the digital digest is stored in the blockchain.
如果所述区块链中存储了与所述数字摘要对应的目标发票,说明待识别发票已在区块链存证;因此可以将所述待识别发票为真的验证结果返回给所述客户端;进一步的,如果所述区块链中存储了与所述数字摘要对应的目标数据,向所述客户端返回所述目标发票,以供客户端查看。If the target invoice corresponding to the digital digest is stored in the blockchain, it indicates that the invoice to be identified has been deposited in the blockchain; therefore, the verification result that the invoice to be identified is true can be returned to the client ; Further, if the target data corresponding to the digital summary is stored in the blockchain, return the target invoice to the client for the client to view.
如果所述区块链中查询不到所述数字摘要对应的目标发票,说明待识别发票没有在区块链上存证,因此可以将所述待识别发票为假的验证结果返回给所述客户端。If the target invoice corresponding to the digital abstract cannot be queried in the blockchain, it means that the invoice to be identified is not stored on the blockchain, so the verification result that the invoice to be identified is false can be returned to the customer end.
本说明书提出了一种基于区块链的发票真伪验证方案,通过预先将发票和发票的数字摘要存储到区块链中;由于区块链中存储的数据存在不可篡改的特征,以及数字摘要具有的唯一特征(即一个数字摘要对应一个原始数据);因此,可以基于区块链中存储的发票的数字摘要进行防伪验证。具体地,用户只需要上传待识别发票,如果可以查询到所述区块链中存储有待识别发票的数字摘要对应的目标发票,就可以说明待识别发票与目标发票相同,进而就可以说明待识别的发票为真,反之为假。This specification proposes a blockchain-based invoice authenticity verification scheme by storing invoices and digital summaries of invoices in the blockchain in advance; due to the immutable characteristics of the data stored in the blockchain and the digital summaries The only characteristic (that is, one digital digest corresponds to one original data); therefore, anti-counterfeiting verification can be performed based on the digital digest of the invoice stored in the blockchain. Specifically, the user only needs to upload the invoice to be identified. If the target invoice corresponding to the digital summary of the invoice to be identified stored in the blockchain can be queried, the invoice to be identified and the target invoice can be indicated to be identical 'S invoice is true, otherwise it is false.
与前述基于区块链的发票真伪验证方法实施例相对应,本说明书还提供了基于区块链的发票真伪验证装置的实施例。所述装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在设备的处理器将非易失性存储器中对应的计算机业务程序指令读取到内存中运行形成的。从硬件层面而言,如图3所示,为本说明书基于区块链的发票真伪验证装置所在设备的一种硬件结构图,除了图3所示的处理器、网络接口、内存以及非易失性存储器之外,实施例中装置所在的设备通常根据基于区块链的发票真伪验证实际功能,还可以包括其他硬件,对此不再赘述。Corresponding to the foregoing embodiment of the blockchain-based invoice authenticity verification method, this specification also provides an embodiment of the blockchain-based invoice authenticity verification device. The device embodiments may be implemented by software, or by hardware or a combination of hardware and software. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer service program instructions in the non-volatile memory into the memory through the processor of the device where it is located and running. From the hardware level, as shown in Figure 3, it is a hardware structure diagram of the device where the blockchain-based invoice authenticity verification device is located, except for the processor, network interface, memory and non-easy In addition to the volatile memory, the device where the device is located in the embodiment usually verifies the actual function based on the authenticity of the invoice based on the blockchain, and may also include other hardware, which will not be repeated here.
请参见图4,为本说明书一实施例提供的基于区块链的发票真伪验证装置的模块图,所述装置对应了图1所示实施例,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述装置包括:Please refer to FIG. 4, which is a block diagram of a blockchain-based invoice authenticity verification device provided by an embodiment of the present specification. The device corresponds to the embodiment shown in FIG. 1. The blockchain stores invoices and invoices. The corresponding relationship between the digital abstracts of the device includes:
接收单元210,接收客户端提交的针对待识别发票的防伪验证请求;The receiving unit 210 receives the anti-counterfeiting verification request for the to-be-identified invoice submitted by the client;
验证单元220,响应于所述防伪验证请求,计算所述待识别发票的数字摘要,并查 询所述区块链中是否存储了与所述数字摘要对应的目标发票;The verification unit 220, in response to the anti-counterfeiting verification request, calculates a digital digest of the invoice to be identified, and inquires whether a target invoice corresponding to the digital digest is stored in the blockchain;
返回单元230,如果所述区块链中存储了与所述数字摘要对应的目标发票,向所述客户端返回所述待识别发票为真的验证结果。The returning unit 230 returns the verification result that the invoice to be identified is true if the target invoice corresponding to the digital digest is stored in the blockchain.
可选的,所述装置还包括:Optionally, the device further includes:
创建请求接收单元,接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;A creation request receiving unit, receiving an invoice creation request submitted by a client; wherein the invoice creation request includes invoice creation information input by a user;
发票创建响应单元,响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。An invoice creation response unit, in response to the invoice creation request, invokes the invoice creation logic declared in the smart contract published on the blockchain, creates an invoice based on the invoice creation information; and, calculates a digital summary of the invoice, and The correspondence between the invoice and the digital summary of the invoice is stored in the blockchain.
可选的,所述验证单元220,具体包括:Optionally, the verification unit 220 specifically includes:
响应于所述防伪验证请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。In response to the anti-counterfeit verification request, call the invoice verification logic declared in the smart contract published on the blockchain, calculate the digital summary of the invoice to be identified, and query whether the digital data is stored in the blockchain The target invoice corresponding to the summary.
可选的,所述装置还包括:Optionally, the device further includes:
查询返回单元,如果所述区块链中存储了与所述数字摘要对应的目标数据,向所述客户端返回所述目标发票。The query returning unit returns the target invoice to the client if the target data corresponding to the digital summary is stored in the blockchain.
可选的,所述发票的数字摘要包括:Optionally, the digital summary of the invoice includes:
针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到的hash值。For the invoice content of the invoice; or a hash value calculated by hashing the unique information in the invoice content.
可选的,所述防伪验证请求包括所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;Optionally, the anti-counterfeiting verification request includes the invoice content of the to-be-identified invoice; or, the unique information in the invoice content;
所述计算所述待识别发票的数字摘要,包括:The calculation of the digital summary of the invoice to be identified includes:
获取所述防伪验证请求中的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;Obtaining the invoice content of the to-be-identified invoice in the anti-counterfeiting verification request; or, the unique information in the invoice content;
针对获取到的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。Regarding the acquired invoice content of the invoice to be identified; or, the uniqueness information in the invoice content is hashed to obtain a hash value.
可选的,所述区块链为联盟链。Optionally, the blockchain is an alliance chain.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The system, device, module or unit explained in the above embodiments may be specifically implemented by a computer chip or entity, or implemented by a product having a certain function. A typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or any combination of these devices.
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。For the implementation process of the functions and functions of each unit in the above device, please refer to the implementation process of the corresponding steps in the above method for details, which will not be repeated here.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者不是物理上分开的,作为单元显示的部件可以是或者不是物理单元,即可以位于一个地方,或者分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。For the device embodiment, since it basically corresponds to the method embodiment, the relevant part can be referred to the description of the method embodiment. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or Distributed to multiple network elements. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solution in this specification. Those of ordinary skill in the art can understand and implement without paying creative labor.
以上图4描述了基于区块链的发票真伪验证装置的内部功能模块和结构示意,其实质上的执行主体可以为一种电子设备,包括:The above FIG. 4 describes the internal functional modules and structural schematics of the blockchain-based invoice authenticity verification device. The actual execution subject may be an electronic device, including:
处理器;processor;
用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
其中,所述处理器被配置为:Wherein, the processor is configured to:
接收客户端提交的针对待识别发票的防伪验证请求;Receive the anti-counterfeiting verification request for the invoice to be identified submitted by the client;
响应于所述防伪验证请求,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;其中,所述区块链中存储有发票和发票的数字摘要之间的对应关系;In response to the anti-counterfeiting verification request, calculate a digital digest of the invoice to be identified, and query whether the target invoice corresponding to the digital digest is stored in the blockchain; wherein, invoices are stored in the blockchain Correspondence between the digital summary of the invoice;
如果所述区块链中存储了与所述数字摘要对应的目标发票,向所述客户端返回所述待识别发票为真的验证结果。If the target invoice corresponding to the digital digest is stored in the blockchain, a verification result that the to-be-identified invoice is true is returned to the client.
可选的,还包括:Optional, also includes:
接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;Receiving an invoice creation request submitted by a client; wherein the invoice creation request includes invoice creation information input by a user;
响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻 辑,基于所述发票创建信息创建发票;以及,In response to the invoice creation request, call the invoice creation logic declared in the smart contract published on the blockchain, and create an invoice based on the invoice creation information; and,
计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。Calculate the digital summary of the invoice, and store the correspondence between the invoice and the digital summary of the invoice in the blockchain.
可选的,所述响应于所述防伪验证请求,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票,包括:Optionally, in response to the anti-counterfeiting verification request, calculating a digital digest of the invoice to be identified, and querying whether a target invoice corresponding to the digital digest is stored in the blockchain includes:
响应于所述防伪验证请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。In response to the anti-counterfeit verification request, call the invoice verification logic declared in the smart contract published on the blockchain, calculate the digital summary of the invoice to be identified, and query whether the digital data is stored in the blockchain The target invoice corresponding to the summary.
可选的,还包括:Optional, also includes:
如果所述区块链中存储了与所述数字摘要对应的目标数据,向所述客户端返回所述目标发票。If the target data corresponding to the digital digest is stored in the blockchain, the target invoice is returned to the client.
可选的,所述发票的数字摘要包括:Optionally, the digital summary of the invoice includes:
针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到的hash值。For the invoice content of the invoice; or a hash value calculated by hashing the unique information in the invoice content.
可选的,所述防伪验证请求包括所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;Optionally, the anti-counterfeiting verification request includes the invoice content of the to-be-identified invoice; or, the unique information in the invoice content;
所述计算所述待识别发票的数字摘要,包括:The calculation of the digital summary of the invoice to be identified includes:
获取所述防伪验证请求中的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;Obtaining the invoice content of the to-be-identified invoice in the anti-counterfeiting verification request; or, the unique information in the invoice content;
针对获取到的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。Regarding the acquired invoice content of the invoice to be identified; or, the uniqueness information in the invoice content is hashed to obtain a hash value.
可选的,所述区块链为联盟链。Optionally, the blockchain is an alliance chain.
在上述电子设备的实施例中,应理解,该处理器可以是中央处理单元(英文:Central Processing Unit,简称:CPU),还可以是其他通用处理器、数字信号处理器(英文:Digital Signal Processor,简称:DSP)、专用集成电路(英文:Application Specific Integrated Circuit,简称:ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,而前述的存储器可以是只读存储器(英文:read-only memory,缩写:ROM)、随机存取存储器(英文:random access memory,简称:RAM)、快闪存储器、硬盘或 者固态硬盘。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。In the above embodiments of the electronic device, it should be understood that the processor may be a central processing unit (English: Central Processing Unit, abbreviated as: CPU), or other general-purpose processors, digital signal processors (English: Digital Signal Processor) , Referred to as DSP), application specific integrated circuit (English: Application Specific Integrated Circuit, referred to as ASIC), etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc., and the aforementioned memory may be a read-only memory (English: read-only memory, abbreviation: ROM), a random access memory (English) : Random access memory (RAM for short), flash memory, hard disk or solid state drive. The steps of the method disclosed in conjunction with the embodiments of the present invention may be directly implemented and completed by a hardware processor, or may be implemented and completed by a combination of hardware and software modules in the processor.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于电子设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The embodiments in this specification are described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from the other embodiments. In particular, for the embodiment of the electronic device, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method embodiment.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本说明书的其它实施方案。本说明书旨在涵盖本说明书的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本说明书的一般性原理并包括本说明书未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本说明书的真正范围和精神由下面的权利要求指出。After considering the description and practicing the invention disclosed herein, those skilled in the art will easily think of other embodiments of the description. This specification is intended to cover any variations, uses, or adaptations of this specification. These variations, uses, or adaptations follow the general principles of this specification and include common general knowledge or common technical means in the technical field not disclosed in this specification. . The description and examples are to be considered exemplary only, and the true scope and spirit of this description are pointed out by the following claims.
应当理解的是,本说明书并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本说明书的范围仅由所附的权利要求来限制。It should be understood that this specification is not limited to the precise structure that has been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of this description is limited only by the appended claims.

Claims (15)

  1. 一种基于区块链的发票真伪验证方法,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述方法包括:A blockchain-based method for verifying the authenticity of invoices. The blockchain stores the correspondence between invoices and digital summaries of invoices. The method includes:
    接收客户端提交的针对待识别发票的防伪验证请求;Receive the anti-counterfeiting verification request for the invoice to be identified submitted by the client;
    响应于所述防伪验证请求,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;In response to the anti-counterfeiting verification request, calculate a digital digest of the invoice to be identified, and query whether the target invoice corresponding to the digital digest is stored in the blockchain;
    如果所述区块链中存储了与所述数字摘要对应的目标发票,向所述客户端返回所述待识别发票为真的验证结果。If the target invoice corresponding to the digital digest is stored in the blockchain, a verification result that the to-be-identified invoice is true is returned to the client.
  2. 根据权利要求1所述的方法,所述方法还包括:The method according to claim 1, further comprising:
    接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;Receiving an invoice creation request submitted by a client; wherein the invoice creation request includes invoice creation information input by a user;
    响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,In response to the invoice creation request, call the invoice creation logic declared in the smart contract published on the blockchain to create an invoice based on the invoice creation information; and,
    计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。Calculate the digital summary of the invoice, and store the correspondence between the invoice and the digital summary of the invoice in the blockchain.
  3. 根据权利要求1所述的方法,所述响应于所述防伪验证请求,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票,包括:According to the method of claim 1, in response to the anti-counterfeiting verification request, calculating a digital digest of the invoice to be identified and querying whether a target invoice corresponding to the digital digest is stored in the blockchain, include:
    响应于所述防伪验证请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。In response to the anti-counterfeit verification request, call the invoice verification logic declared in the smart contract published on the blockchain, calculate the digital summary of the invoice to be identified, and query whether the digital data is stored in the blockchain The target invoice corresponding to the summary.
  4. 根据权利要求1所述的方法,所述方法还包括:The method according to claim 1, further comprising:
    如果所述区块链中存储了与所述数字摘要对应的目标数据,向所述客户端返回所述目标发票。If the target data corresponding to the digital digest is stored in the blockchain, the target invoice is returned to the client.
  5. 根据权利要求2所述的方法,所述发票的数字摘要包括:According to the method of claim 2, the digital summary of the invoice includes:
    针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行哈希计算得到的哈希值。The invoice content of the invoice; or a hash value obtained by hashing the unique information in the invoice content.
  6. 根据权利要求5所述的方法,所述防伪验证请求包括所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;According to the method of claim 5, the anti-counterfeiting verification request includes the invoice content of the invoice to be identified; or, the unique information in the invoice content;
    所述计算所述待识别发票的数字摘要,包括:The calculation of the digital summary of the invoice to be identified includes:
    获取所述防伪验证请求中的所述待识别发票的发票内容;或者,所述发票内容中的 唯一性信息;Obtain the invoice content of the invoice to be identified in the anti-counterfeiting verification request; or, the unique information in the invoice content;
    针对获取到的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息进行哈希计算得到哈希值。For the obtained invoice content of the invoice to be identified; or, the uniqueness information in the invoice content is hashed to obtain a hash value.
  7. 根据权利要求1所述的方法,所述区块链为联盟链。The method of claim 1, the blockchain is a consortium chain.
  8. 一种基于区块链的发票真伪验证装置,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述装置包括:An invoice authenticity verification device based on a blockchain, where the correspondence between invoices and digital summaries of invoices is stored in the blockchain, the device includes:
    接收单元,接收客户端提交的针对待识别发票的防伪验证请求;The receiving unit receives the anti-counterfeiting verification request for the invoice to be identified submitted by the client;
    验证单元,响应于所述防伪验证请求,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;The verification unit, in response to the anti-counterfeit verification request, calculates a digital digest of the invoice to be identified, and queries whether a target invoice corresponding to the digital digest is stored in the blockchain;
    返回单元,如果所述区块链中存储了与所述数字摘要对应的目标发票,向所述客户端返回所述待识别发票为真的验证结果。The return unit, if a target invoice corresponding to the digital digest is stored in the blockchain, returns a verification result that the to-be-identified invoice is true to the client.
  9. 根据权利要求8所述的装置,所述装置还包括:The device according to claim 8, further comprising:
    创建请求接收单元,接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;A creation request receiving unit, receiving an invoice creation request submitted by a client; wherein the invoice creation request includes invoice creation information input by a user;
    发票创建响应单元,响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。An invoice creation response unit, in response to the invoice creation request, invokes the invoice creation logic declared in the smart contract published on the blockchain, creates an invoice based on the invoice creation information; and, calculates a digital summary of the invoice, and The correspondence between the invoice and the digital summary of the invoice is stored in the blockchain.
  10. 根据权利要求8所述的装置,所述验证单元,具体包括:The apparatus according to claim 8, the verification unit specifically comprising:
    响应于所述防伪验证请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待识别发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。In response to the anti-counterfeit verification request, call the invoice verification logic declared in the smart contract published on the blockchain, calculate the digital summary of the invoice to be identified, and query whether the digital data is stored in the blockchain The target invoice corresponding to the summary.
  11. 根据权利要求8所述的装置,所述装置还包括:The device according to claim 8, further comprising:
    查询返回单元,如果所述区块链中存储了与所述数字摘要对应的目标数据,向所述客户端返回所述目标发票。The query returning unit returns the target invoice to the client if the target data corresponding to the digital summary is stored in the blockchain.
  12. 根据权利要求9所述的装置,所述发票的数字摘要包括:The apparatus of claim 9, the digital summary of the invoice includes:
    针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行哈希计算得到的哈希值。The invoice content of the invoice; or a hash value obtained by hashing the unique information in the invoice content.
  13. 根据权利要求12所述的装置,所述防伪验证请求包括所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息;The device according to claim 12, wherein the anti-counterfeiting verification request includes invoice content of the invoice to be identified; or, unique information in the invoice content;
    所述计算所述待识别发票的数字摘要,包括:The calculation of the digital summary of the invoice to be identified includes:
    获取所述防伪验证请求中的所述待识别发票的发票内容;或者,所述发票内容中的 唯一性信息;Obtain the invoice content of the invoice to be identified in the anti-counterfeiting verification request; or, the unique information in the invoice content;
    针对获取到的所述待识别发票的发票内容;或者,所述发票内容中的唯一性信息进行哈希计算得到哈希值。For the obtained invoice content of the invoice to be identified; or, the uniqueness information in the invoice content is hashed to obtain a hash value.
  14. 根据权利要求8所述的装置,所述区块链为联盟链。The device of claim 8, the blockchain is a consortium chain.
  15. 一种电子设备,包括:An electronic device, including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
    其中,所述处理器被配置为上述权利要求1-7中任一项所述的方法。Wherein, the processor is configured as the method according to any one of claims 1-7 above.
PCT/CN2019/115357 2018-12-25 2019-11-04 Blockchain-based invoice authenticity verification method, apparatus, and electronic device WO2020134574A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811595313.0 2018-12-25
CN201811595313.0A CN110019326A (en) 2018-12-25 2018-12-25 True from false of bills verification method and device and electronic equipment based on block chain

Publications (1)

Publication Number Publication Date
WO2020134574A1 true WO2020134574A1 (en) 2020-07-02

Family

ID=67188687

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/115357 WO2020134574A1 (en) 2018-12-25 2019-11-04 Blockchain-based invoice authenticity verification method, apparatus, and electronic device

Country Status (3)

Country Link
CN (1) CN110019326A (en)
TW (1) TWI714308B (en)
WO (1) WO2020134574A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019326A (en) * 2018-12-25 2019-07-16 阿里巴巴集团控股有限公司 True from false of bills verification method and device and electronic equipment based on block chain
US11049115B2 (en) 2019-07-31 2021-06-29 Advanced New Technologies Co., Ltd. Blockchain-based bill write-off method, apparatus, electronic device, and storage medium
CN110598479A (en) * 2019-09-20 2019-12-20 腾讯科技(深圳)有限公司 Data processing method and device and computer readable storage medium
CN110597886A (en) * 2019-09-24 2019-12-20 腾讯科技(深圳)有限公司 Data processing method and device and computer storage medium
CN111292464B (en) * 2020-03-03 2022-05-24 苏州区盟链数字科技有限公司 Online evaluation system for cash machines and gold labels
TWI792034B (en) * 2020-08-10 2023-02-11 虹光精密工業股份有限公司 Electronic device with unique ticket and information processing method using unique ticket
CN113626775A (en) * 2021-07-31 2021-11-09 西南电子技术研究所(中国电子科技集团公司第十研究所) Credible scientific and technological information evidence chain tracing method
CN117273974B (en) * 2023-11-21 2024-02-06 中国人寿保险股份有限公司上海数据中心 Large enterprise expense reimbursement data generation and verification method based on block chain consensus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108269351A (en) * 2018-01-15 2018-07-10 中链科技有限公司 A kind of digital ticket information processing method and system
CN108830109A (en) * 2018-06-11 2018-11-16 腾讯科技(深圳)有限公司 E-seal application, client realization method, system and equipment, storage medium
CN108961030A (en) * 2018-08-15 2018-12-07 腾讯科技(深圳)有限公司 About the data processing method of electronic bill, device, system, medium and equipment
CN110019326A (en) * 2018-12-25 2019-07-16 阿里巴巴集团控股有限公司 True from false of bills verification method and device and electronic equipment based on block chain

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201741955A (en) * 2016-05-18 2017-12-01 碩網資訊股份有限公司 An electronic ticket system using block chain and method thereof
TW201801009A (en) * 2016-06-30 2018-01-01 神通資訊科技股份有限公司 Method for storing electronic invoices by using blockchain improving the security of the electronic invoices and avoiding forgery, tampering, impersonation and double delivery
WO2018112945A1 (en) * 2016-12-23 2018-06-28 深圳前海达闼云端智能科技有限公司 Method and device for querying state information about electronic ticket, and block chain node
US11468439B2 (en) * 2017-01-12 2022-10-11 American Express Travel Related Services Company, Inc. Systems and methods for blockchain based proof of payment
CN106952124A (en) * 2017-03-16 2017-07-14 北京牛链科技有限公司 Electronic bill management system and method based on distribution book keeping operation
CN108305106A (en) * 2018-01-31 2018-07-20 复旦大学 A kind of electronic invoice register method based on block chain
CN110400188B (en) * 2018-08-16 2021-08-13 深圳市智税链科技有限公司 Electronic bill generating method, electronic bill generating device, storage medium and computer equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108269351A (en) * 2018-01-15 2018-07-10 中链科技有限公司 A kind of digital ticket information processing method and system
CN108830109A (en) * 2018-06-11 2018-11-16 腾讯科技(深圳)有限公司 E-seal application, client realization method, system and equipment, storage medium
CN108961030A (en) * 2018-08-15 2018-12-07 腾讯科技(深圳)有限公司 About the data processing method of electronic bill, device, system, medium and equipment
CN110019326A (en) * 2018-12-25 2019-07-16 阿里巴巴集团控股有限公司 True from false of bills verification method and device and electronic equipment based on block chain

Also Published As

Publication number Publication date
CN110019326A (en) 2019-07-16
TWI714308B (en) 2020-12-21
TW202024954A (en) 2020-07-01

Similar Documents

Publication Publication Date Title
WO2020134574A1 (en) Blockchain-based invoice authenticity verification method, apparatus, and electronic device
WO2020134575A1 (en) Blockchain-based resource allocation method and apparatus, and electronic device
CN110494876B (en) System and method for issuing and tracking digital tokens within distributed network nodes
CN110494877B (en) System and method for issuing and tracking digital tokens within distributed network nodes
WO2020134606A1 (en) Method and device for invoice correction based on blockchain, and electronic equipment
US11836723B2 (en) Blockchain based account funding and distribution
KR102332031B1 (en) Systems and Methods for Implementing Blockchain-Based Digital Certificates
WO2020119294A1 (en) Data sharing method, apparatus, and system, and electronic device
WO2020119287A1 (en) Blockchain-based invoice creation method and apparatus, and electronic device
WO2020155789A1 (en) Blockchain-based certificate storage method and apparatus
CN109559224B (en) Credit investigation evaluation method and device and electronic equipment
KR102404284B1 (en) Systems and methods for creating digital marks
US11062294B2 (en) Cognitive blockchain for customized interchange determination
WO2020119286A1 (en) Blockchain-based invoice creating method and apparatus, and electronic device
EP3864817B1 (en) Blockchain timestamp agreement
TW202040447A (en) Credit recording and inquiring method and device based on block chain and electronic equipment
JP2021524978A (en) How to register data as a digital file in the blockchain database
WO2020220764A1 (en) Blockchain-based data compression and query method and apparatus, and electronic device
US20200311695A1 (en) Privacy-preserving gridlock resolution
US11397960B2 (en) Direct marketing via chained interactions in a blockchain
WO2020220740A1 (en) Blockchain-based invoice creation method, apparatus and electronic device
WO2020134614A1 (en) Blockchain-based invoice voiding method and apparatus, and electronic device
US11900337B1 (en) Distributed ledger receipt wallet system and method
TW201816676A (en) Method and device facilitating expansion of primary payment instruments
US20190370791A1 (en) Distributing cryptographic asset returns

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19905233

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19905233

Country of ref document: EP

Kind code of ref document: A1