WO2020134606A1 - 基于区块链的发票冲红方法及装置和电子设备 - Google Patents
基于区块链的发票冲红方法及装置和电子设备 Download PDFInfo
- Publication number
- WO2020134606A1 WO2020134606A1 PCT/CN2019/115670 CN2019115670W WO2020134606A1 WO 2020134606 A1 WO2020134606 A1 WO 2020134606A1 CN 2019115670 W CN2019115670 W CN 2019115670W WO 2020134606 A1 WO2020134606 A1 WO 2020134606A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- invoice
- blockchain
- red
- target
- digital summary
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION 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
- G06Q30/00—Commerce
- G06Q30/04—Billing or invoicing
Definitions
- the embodiments of the present specification relate to the field of blockchain technology, and in particular to a blockchain-based method and device for invoice redemption 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.
- a method for invoice flushing based on a blockchain stores the correspondence between invoices and digital summaries of invoices.
- the method includes:
- the target invoice corresponding to the digital summary is stored in the blockchain, call the red flush invoice creation logic declared in the smart contract published on the blockchain to create a red flush invoice for the target invoice And store the corresponding relationship between the red flush invoice and the target invoice in the blockchain.
- the method further includes:
- calculating a digital summary of the invoice to be red flushed, and querying whether a target invoice corresponding to the digital digest is stored in the blockchain includes:
- the digital summary of the invoice includes:
- the red flush request includes the invoice content of the invoice to be red flushed; or, the unique information in the invoice content;
- the blockchain is an alliance chain.
- creating a red flush invoice for the target invoice specifically including:
- the correspondence between the red flush invoice and the target invoice is stored in the blockchain, specifically including any of the following:
- an invoice redemption 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 red flush request submitted by the client for the invoice to be red flushed
- the query unit in response to the red flush request, calculates a digital summary of the invoice to be red flushed, and queries whether a target invoice corresponding to the digital digest is stored in the blockchain;
- the red flush unit if it is found that the target invoice corresponding to the digital summary is stored in the blockchain, call the red flush invoice creation logic declared in the smart contract published on the blockchain to create a target invoice The red invoice and store the correspondence between the red invoice and the target invoice 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;
- a creation request 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 query unit includes:
- the digital summary of the invoice includes:
- the red flush request includes the invoice content of the invoice to be red flushed; or, the unique information in the invoice content;
- calculating the digital summary of the invoice to be flushed includes:
- the unique information in the invoice content is hashed to obtain a hash value.
- the blockchain is an alliance chain.
- creating a red flush invoice for the target invoice specifically includes:
- the correspondence between the red flush invoice and the target invoice is stored in the blockchain, specifically including any of the following:
- an electronic device including:
- Memory for storing processor executable instructions
- the processor is configured as any of the above-mentioned blockchain-based invoice redemption methods.
- the embodiment of this specification provides a blockchain-based invoice redemption solution, which is to deposit certificates by uploading invoices and digital summaries of invoices; due to the immutable characteristics of the data stored in the blockchain and the digital summaries
- the only characteristic that is, a digital summary corresponds to a raw data
- the corresponding invoice that is, the invoice to be red
- the target invoice on the chain in turn, you can create a red flush invoice associated with the target invoice and store the corresponding relationship between the red flush invoice and the target invoice in the blockchain; in this way, you can offset this The invoice amount of the wrong invoice.
- FIG. 1 is a flowchart of a blockchain-based invoice redemption method provided by an embodiment of this specification
- FIG. 2 is a schematic diagram of invoice flushing provided by an embodiment of the present specification.
- FIG. 3 is a hardware structure diagram of a blockchain-based invoice redemption device provided by an embodiment of this specification.
- FIG. 4 is a schematic block diagram of a blockchain-based invoice redemption 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 audit 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.
- Invoice flushing is a means to adjust the accounts of reissued invoices if the invoices are found to be incorrect or need to be corrected for other reasons.
- the invoice has been recorded, if the invoice is incorrect, a new negative invoice with the same amount as the original invoice needs to be reissued for offsetting.
- This specification proposes a blockchain-based invoice redemption scheme, and provides a blockchain-based invoice redemption scheme. If there is an error in the invoice on the chain, you can generate a redemption associated with the invoice. The red invoice will offset the invoice amount of the wrong invoice.
- FIG. 1 is a flowchart of a block chain-based invoice redemption method provided by an embodiment of the present specification.
- the block chain stores the correspondence between invoices and digital summaries of invoices. Methods include:
- Step 110 Receive a redemption request submitted by the client for the invoice to be redeemed
- Step 120 In response to the red flush request, calculate a digital digest of the invoice to be flushed, and query whether the target invoice corresponding to the digital digest is stored in the blockchain;
- Step 130 If it is found that the target invoice corresponding to the digital summary is stored in the blockchain, call the red flush invoice creation logic declared in the smart contract published on the blockchain to create the target invoice Red flush the invoice, and store the corresponding relationship between the red flush invoice and the target invoice in the blockchain.
- the blockchain described in this specification may specifically include private chains, shared chains, and 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 first digital summary of the invoice generated or received by itself in the alliance chain in the form of a transaction, and after the transaction has been processed by the consensus node in the alliance chain, the alliance chain
- the distributed database in 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 (for example, certificate deposit service, authenticity verification service, invoice redemption service, etc.), and in this type of alliance chain, the transaction can be a business message or business published by the user in the alliance chain with business intent request.
- 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 obtained by performing hash (hash, also called hash) calculation on the original data.
- hash also called hash
- the digital summary of the invoice includes:
- 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 red flush request includes the invoice content of the invoice to be red flushed; or, the unique information in the invoice content;
- both the invoice to be identified and the invoice use the same hash algorithm.
- 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.
- Call the invoice creation logic declared in the smart contract published on the blockchain create an invoice based on the invoice creation information in the invoice creation request; and after completing the invoice creation, the digital summary of the invoice can be further calculated and the 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 synchronize the invoice on-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 C hash and Mapping relationship of invoice C data.
- the blockchain can be divided into a space for storing invoices and a space for storing red tickets (ie red invoices). Correspondence between the invoice and the red ticket is established to achieve red flushing of the invoice.
- the user After discovering that there is an error in the invoice, the user needs to flush the error invoice stored in the blockchain to offset the error invoice.
- the user can use the wrong invoice as the invoice to be redeemed, and can submit the redemption request for the invoice to be redeemed to the blockchain through the client to call the redemption for invoice redemption deployed on the blockchain
- the smart contract is used to flush the invoice to be identified.
- the user can enter the invoice content or unique information in the invoice content of the invoice to be red on the client (the invoice content or the unique information in the invoice content will be described below (Referred to as invoice data for short), and carry the entered invoice data in the red flush 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.
- the identified invoice is flushed. Therefore, the node device in the blockchain can directly receive the invoice data.
- the user can take a photo of the invoice to be flushed, collect the invoice image of the invoice to be flushed, 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 red flush 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, Red flush the invoice to be identified. Therefore, the nodes in the blockchain can directly receive the invoice data.
- 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 mechanism to reduce 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 to calculate the digital summary of the invoice to be redeemed, And query whether the target invoice corresponding to the digital summary is stored in the blockchain.
- the digital summary of the invoice to be redeemed is calculated based on a smart contract.
- the node device that responds to the redemption request may be calculated locally based on a preset algorithm ( (Does not rely on smart contracts); the specific can be manually configured according to business needs or automatically selected by programs.
- the node device needs to call the red invoice creation logic declared in the smart contract published on the blockchain to create The red invoice of the target invoice, and the correspondence between the red invoice and the target invoice is stored in the blockchain.
- the step 130 creates a red invoice for the target invoice, specifically including:
- the corresponding relationship between the red flush invoice and the target invoice is stored in the blockchain, specifically including any of the following:
- the blockchain node can call the preset smart contract to query whether the invoice a exists in the blockchain, that is, in this specification The target invoice; and after inquiring about the existence of invoice a, generate a red flush invoice a for invoice a in the blockchain, and establish the mapping relationship between the red flush invoice a and invoice a on the blockchain .
- the established mapping relationship may indicate that invoice a has been flushed.
- the red invoice a is the same negative amount as the invoice amount of invoice a. For example, if the invoice amount of invoice a is 100 yuan, the invoice amount of red invoice a is -100 yuan.
- This specification provides a blockchain-based invoice redemption scheme.
- the invoice and the digital summary of the invoice are stored on the chain for certification; due to the immutable characteristics of the data stored in the blockchain and the uniqueness of the digital summary Features (that is, one digital summary corresponds to one original data); therefore, when an error is found in an invoice, the wrong invoice (that is, the invoice to be red) can be determined on the chain based on the digital summary of the invoice stored in the blockchain Target invoice; in turn, you can create a red flush invoice associated with the target invoice and store the corresponding relationship between the red flush invoice and the target invoice in the blockchain; in this way, you can offset the wrong invoice Invoice amount.
- this specification also provides an embodiment of the blockchain-based invoice redemption 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 redemption device is located, except for the processor, network interface, memory and non-volatile shown in Figure 3
- the device where the device is located in the embodiment usually flushes the actual function based on the blockchain-based invoice, and may also include other hardware, which will not be repeated here.
- FIG. 4 is a block diagram of a blockchain-based invoice redemption 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 device includes:
- the receiving unit 210 receives the redemption request submitted by the client for the invoice to be redeemed
- the query unit 220 in response to the red flush request, calculates a digital summary of the invoice to be red flushed, and queries whether a target invoice corresponding to the digital digest is stored in the blockchain;
- the red flush unit 230 if it is found that the target invoice corresponding to the digital summary is stored in the blockchain, call the red flush invoice creation logic declared in the smart contract published on the blockchain to create a target for the target The red invoice of the invoice, and the correspondence between the red invoice and the target invoice 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;
- a creation request 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 query unit 220 includes:
- the digital summary of the invoice includes:
- the red flush request includes the invoice content of the invoice to be red flushed; or, the unique information in the invoice content;
- calculating the digital summary of the invoice to be red including:
- the blockchain is an alliance chain.
- creating a red flush invoice for the target invoice specifically includes:
- the correspondence between the red flush invoice and the target invoice is stored in the blockchain, specifically including any of the following:
- 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 schematics, 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 One place, or it can be 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 above describes the internal functional modules and structural schematics of the blockchain-based invoice redemption device.
- the actual execution subject may be an electronic device, including:
- Memory for storing processor executable instructions
- the processor is configured to:
- the target invoice corresponding to the digital summary is stored in the blockchain, call the red flush invoice creation logic declared in the smart contract published on the blockchain to create a red flush invoice for the target invoice And store the corresponding relationship between the red flush invoice and the target invoice in the blockchain.
- Optional also includes:
- calculating a digital summary of the invoice to be red flushed, and querying whether a target invoice corresponding to the digital digest is stored in the blockchain includes:
- the digital summary of the invoice includes:
- the red flush request includes the invoice content of the invoice to be red flushed; or, the unique information in the invoice content;
- the blockchain is an alliance chain.
- the creating a red flush invoice for the target invoice specifically includes:
- the correspondence between the red flush invoice and the target invoice is stored in the blockchain, specifically including any of the following:
- 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.
Landscapes
- Business, Economics & Management (AREA)
- Development Economics (AREA)
- Accounting & Taxation (AREA)
- Economics (AREA)
- Finance (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
一种基于区块链的发票冲红方法及装置和电子设备,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述方法包括:接收客户端提交的针对待冲红的发票的冲红请求(110);响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票(120);如果查询到所述区块链中存储了与所述数字摘要对应的目标发票,调用发布在区块链上的智能合约中声明的冲红发票创建逻辑,创建针对所述目标发票的冲红发票,并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储(130)。
Description
本说明书实施例涉及区块链技术领域,尤其涉及一种基于区块链的发票冲红方法及装置和电子设备。
区块链技术,也被称之为分布式账本技术,是一种由若干台计算设备共同参与“记账”,共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化、公开透明、每台计算设备可以参与数据库记录、并且各计算设备之间可以快速的进行数据同步的特性,使得区块链技术在众多的领域中广泛的进行应用。
发明内容
本说明书实施例提供的一种基于区块链的发票冲红方法及装置和电子设备:
根据本说明书实施例的第一方面,提供一种基于区块链的发票冲红方法,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述方法包括:
接收客户端提交的针对待冲红的发票的冲红请求;
响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;
如果查询到所述区块链中存储了与所述数字摘要对应的目标发票,调用发布在区块链上的智能合约中声明的冲红发票创建逻辑,创建针对所述目标发票的冲红发票,并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储。
可选的,所述方法还包括:
接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;
响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,
计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所 述区块链中进行存储。
可选的,所述响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票,包括:
响应于所述冲红请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。
可选的,所述发票的数字摘要包括:
针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到的hash值。
可选的,所述冲红请求包括所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;
计算所述待冲红的发票的数字摘要,包括:
获取所述冲红请求中的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;
针对获取到的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。
可选的,所述区块链为联盟链。
可选的,创建针对所述目标发票的冲红发票,具体包括:
创建与所述目标发票的发票金额相同的负金额发票。
可选的,将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储,具体包括以下中的任一:
建立所述负金额发票与所述目标发票之间的映射关系,并将所述映射关系在所述区块链中进行存储;
建立所述负金额发票与所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储;
建立所述负金额发票、所述目标发票、以及所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储。
根据本说明书实施例的第二方面,提供一种基于区块链的发票冲红装置,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述装置包括:
接收单元,接收客户端提交的针对待冲红的发票的冲红请求;
查询单元,响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;
冲红单元,如果查询到所述区块链中存储了与所述数字摘要对应的目标发票,调用发布在区块链上的智能合约中声明的冲红发票创建逻辑,创建针对所述目标发票的冲红发票,并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储。
可选的,所述装置还包括:
创建请求接收单元,接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;
创建请求响应单元,响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。
可选的,所述查询单元,包括:
响应于所述冲红请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。
可选的,所述发票的数字摘要包括:
针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到的hash值。
可选的,所述冲红请求包括所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;
所述查询单元中,计算所述待冲红的发票的数字摘要,包括:
获取所述冲红请求中的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;
针对获取到的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信 息进行hash计算得到hash值。
可选的,所述区块链为联盟链。
可选的,所述冲红单元中,创建针对所述目标发票的冲红发票,具体包括:
创建与所述目标发票的发票金额相同的负金额发票。
可选的,所述冲红单元中,将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储,具体包括以下中的任一:
建立所述负金额发票与所述目标发票之间的映射关系,并将所述映射关系在所述区块链中进行存储;
建立所述负金额发票与所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储;
建立所述负金额发票、所述目标发票、以及所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储。
根据本说明书实施例的第五方面,提供一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为上述任一项基于区块链的发票冲红方法。
本说明书实施例,提供了一种基于区块链的发票冲红方案,通过将发票和发票的数字摘要上链进行存证;由于区块链中存储的数据存在不可篡改的特征,以及数字摘要具有的唯一特征(即一个数字摘要对应一个原始数据);因此,当发现某张发票出现错误时可以基于区块链中存储的发票的数字摘要确定该错误发票(即待冲红的发票)对应在链上的目标发票;进而可以创建与该目标发票关联的冲红发票并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储;如此,就可以抵消该错误发票的发票金额。
图1是本说明书一实施例提供的基于区块链的发票冲红方法的流程图;
图2是本说明书一实施例提供的发票冲红的示意图。
图3是本说明书一实施例提供的基于区块链的发票冲红装置的硬件结构图;
图4是本说明书一实施例提供的基于区块链的发票冲红装置的模块示意图。
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书的一些方面相一致的装置和方法的例子。
在本说明书使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书。在本说明书和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本说明书可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
发票(Invoice)可以是指一切单位或个人在购销商品、提供或接受服务以及从事其他经营活动中,所开具和收取的业务凭证。发票通常是会计核算的原始依据,也是审计机关、税务机关执法检查的重要依据。对于公司来讲,发票主要是公司做账的依据,同时也是缴税的费用凭证;而对于员工来讲,发票主要可以用来报销。
发票冲红是针对发现发票有误或因为其它原因需更正时,重新开具的发票调整账目手段。当发票已经入账,如果发票有误,需要重新开具一张跟原来发票金额相同的负金额发票,用于入账抵消。
由于区块链技术存在不可篡改的特征,因此可以通过将发票上链进行存证,从而可以基于区块链中存储的发票进行相关发票业务。然而,上链的发票已经属于入账的发票,如果上链的发票发现存在错误,同样无法通过删除该发票抵消入账;因此,需要提供区块链中发票冲红的方案。
本说明书提出了一种基于区块链的发票冲红方案,提供了一种基于区块链的发票 冲红方案,如果上链的发票发现存在错误,可以通过生成一张与该发票关联的冲红发票的方式,抵消该错误发票的发票金额。
请参考图1,图1为本说明书一实施例提供的基于区块链的发票冲红方法的流程图,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述方法包括:
步骤110:接收客户端提交的针对待冲红的发票的冲红请求;
步骤120:响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;
步骤130:如果查询到所述区块链中存储了与所述数字摘要对应的目标发票,调用发布在区块链上的智能合约中声明的冲红发票创建逻辑,创建针对所述目标发票的冲红发票,并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储。
在本说明书所描述的区块链,具体可以包括私有链、共有链以及联盟链等,在本说明书中不进行特别限定。
例如,在一个场景中,上述区块链具体可以是由总部机构、分支机构、代理机构等作为联盟成员组成的一个联盟链;该联盟链的运营方可以依托于该联盟链,来部署相应的业务;而以上所描述的作为联盟成员的总部机构、分支机构、代理机构都可以作为上述业务的一个业务节点。各个业务节点可以将自身所产生或者接收到的与上述发票的第一数字摘要以交易的形式在联盟链中进行发布,并在该交易经过联盟链中的共识节点的共识处理之后,在联盟链中的分布式数据库进行存储,完成上述交易信息的“上链”存证。
其中,需要说明的是,在本说明书中所描述的交易(Transaction),是指通过区块链的客户端创建,并需要最终发布至区块链的分布式数据库中的一笔数据。
区块链中的交易,通常存在狭义的交易以及广义的交易之分。狭义的交易是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易可以是用户在区块链中发起的一笔转账。而广义的交易是指用户向区块链发布的一笔具有业务意图的业务数据;例如,运营方可以基于实际的业务需求搭建一个联盟链,依托于联盟链部署一些与价值转移无关的其它类型的在线业务(比如,存证业务、真伪验证业务、发票冲红业务等),而在这类联盟链中,交易可以是用户在联盟链中发布的一笔具有业务意图的业务消息或者业务请求。
上述客户端,可以包括任意类型的以区块链中存储的底层业务数据作为数据支撑, 来实现特定的业务功能的上层应用。
在区块链技术中,区块链中节点对区块进行操作通常需要依赖相应的智能合约(Smart contract)。例如在区块链中存储、修改、删除等操作均需要依赖智能合约。所述智能合约可以是一种旨在应用在可以部署在区块链上的以信息化方式传播、验证或执行合同的计算机协议。通过在智能合约中声明业务逻辑可以实现执行相应操作。智能合约允许在没有第三方的情况下进行可信交易。这些交易可追踪且不可逆转。智能合约能够提供优于传统合同方法的安全,并减少与合同相关的其他交易成本。通常,智能合约可以是部署在区块链节点本地的,当节点需要执行某个动作时可以调用相应的智能合约,运行智能合约以执行智能合约中声明的业务逻辑,从而得到执行结果。
本说明书中所述的数字摘要,可以是指基于原始数据进行哈希(hash,也称为散列)计算后得到的hash值。具体地,所述发票的数字摘要包括:
针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到的hash值。
其中,所述发票内容可以包含唯一性信息。例如,发票内容可以包括发票号码、发票代码;通常发票号码和发票代码均是唯一性信息;对应的,发票的数字摘要可以记为hash(发票号码+发票代码)。当然,发票内容还可以包括非唯一性信息,例如发票日期、不含税金额;对应的,发票的数字摘要即可以记为hash(发票号码+发票代码+发票日期+不含税金额)。
相应地,所述冲红请求包括所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;
计算所述待冲红的发票的数字摘要,包括:
获取所述冲红请求中的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;
针对获取到的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。
值得一提的是,待识别发票和发票均采用相同的哈希算法。
如前所述,本说明书可以预先将发票进行上链,在一实施例中,所述方法还包括:
接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票 创建信息;
响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,
计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。
以下结合图2所示的发票上链的示意图加以说明:
在本实施例中,用户在需要在该区块链中创建发票时,可以通过其所使用的客户端发起一笔用于创建发票的交易,即通过客户端发起发票创建请求。具体地,该用户可以通过该客户端提供的发票创建页面,输入待创建的目标发票的发票创建信息;例如,发票的抬头、金额等信息。在该用户完成发票创建信息的输入后,该客户端可以基于用户输入的发票创建信息来生成对应的发票创建请求,并将该发票创建请求发送至该区块链中的节点设备。
该区块链中的节点设备在接收到该发票创建请求后,可以对该发票创建请求进行响应。调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建请求中的发票创建信息创建发票;以及在完成发票创建后,可以进一步计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。
在一实施例中,响应于所述发票创建请求的节点设备,还可以先确定与该发票创建请求对应的发票开具方的发票创建额度是否充足。
举例来说,可以从该发票创建请求中该用户输入的发票创建信息中,获取发票开具方的纳税人识别号,并基于该纳税人识别号确定对应的发票开具方,该发票开具方即为该发票创建请求对应的发票开具方。后续,可以先确定该发票开具方的发票创建额度是否充足。
在示出的一种实施方式中,可以由该节点设备调用部署在该区块链上的智能合约中声明的额度检查逻辑,确定该发票开具方的发票创建额度是否充足。
其中,额度检查逻辑具体可以是声明在该智能合约中的,与检查发票开具方的发票创建额度的执行逻辑相关的程序代码(例如:一些可供调用的程序方法或者函数)。
或者,也可以由该节点设备调用第三方的可信服务,将该发票创建请求发送给该第三方的可信服务。其中,第三方的可信服务可以是部署在第三方的可信服务设备上的, 与检查发票开具方的发票创建额度的执行逻辑相关的程序代码。举例来说,该第三方的可信服务设备可以是在税务局内网中的设备,由此可以提高数据安全性。
该第三方的可信服务可以确定该发票开具方的发票创建额度是否充足,并将确定结果返回至该节点设备。该节点设备可以基于该第三方的可信服务返回的确定结果,确定该发票开具方的发票创建额度是否充足。
具体地,该第三方的可信服务可以在确定该发票开具方的发票创建额度充足时,向该节点设备返回该发票开具方的发票创建额度充足的确定结果。该节点设备在接收到该确定结果后,可以确定该发票开具方的发票创建额度充足。或者,该第三方的可信服务可以在确定该发票开具方的发票创建额度不充足时,向该节点设备返回该发票开具方的发票创建额度不充足的确定结果。该节点设备在接收到该确定结果后,可以确定该发票开具方的发票创建额度不充足。
如果确定该发票开具方的发票创建额度充足,则可以调用部署在该区块链上的智能合约中声明的发票创建逻辑,基于该发票创建请求中用户输入的发票创建信息,创建目标发票。
其中,发票创建逻辑具体可以是声明在该智能合约中的,与创建发票的执行逻辑相关的程序代码。
在另一实施例中,所述发票可以是由原始生成发票的机构提供的。例如可以是由国家税务局将发票的第一发票数据直接或间接上传给区块链。具体地,当一开发票设备开具一张发票后,该发票也记录在税务局的系统上,该税务局的税务系统可以同步将发票上链存证。其中所述上链存证的过程如前所述实施例相同,这里不再进行赘述。
举例说明,发票A、发票B和发票C上链后,在区块链中就可以记录有发票A hash和发票A数据的映射关系;发票B hash和发票B数据的映射关系;发票C hash和发票C数据的映射关系。
值得一提的是,如图2所述,区块链中可以划分有存放发票的空间以及存放红票(即冲红发票)的空间。发票与红票之间通过建立对应关系以实现发票冲红。
以下介绍本说明书中发票冲红的过程:
用户在发现发票存在错误后,需要对区块链中存储的错误发票进行冲红以抵消该错误发票。首先,用户可以将该错误发票作为待冲红的发票,并可以通过客户端向区块链提交针对待冲红的发票的冲红请求,来调用在区块链上部署的用于发票冲红的智能合 约,针对待识别的发票进行冲红。
在一种实现方式中,如前创建发票类似的,用户可以在客户端上输入待冲红的发票的发票内容或者发票内容中的唯一性信息(以下将发票内容或者发票内容中的唯一性信息简称为发票数据),并将输入的发票数据携带在客户端发送的冲红请求中;发送给区块链中的节点设备,来触发区块链中的节点设备调用部署的智能合约,针对待识别的发票进行冲红。因此,区块链中节点设备可以直接接收到发票数据。
在另一种实现方式中,用户可以对待冲红的发票进行拍照,采集待冲红的发票的发票图像,并在客户端上或者第三方识别系统上对采集到的发票图像进行图像识别,来识别出发票数据,并将通过图像识别得到的发票数据携带在客户端发送的冲红请求中,发送给区块链中的节点设备,来触发区块链中的节点设备调用部署的智能合约,针对待识别的发票进行冲红。因此,区块链中节点直接就可以接收到发票数据。
其中,对采集到的发票的图像数据进行图像识别,具体可以由部署在区块链中的智能合约来完成,也可以通过调用第三方的可信服务来完成。
在一种实现中,根据图像识别算法,识别所述发票图像中的发票数据。该实施例中,智能合约自身具有图像识别的合约逻辑,可以在节点本地识别出发票图像中的发票数据。
在另一种实现中,所述方法还包括:
节点设备也可以通过调用第三方的可信服务(比如第三方的图像识别机构),将防伪验证请求中的发票图像发送给第三方可信服务,由第三方可信服务基于搭载的图像识别算法,对发票图像进行图像识别获取上述发票数据,而节点设备可以获取所述第三方图像识别机构返回的发票数据。该实施例中,可以将图像识别交由第三方图像识别机构完成,从而降低对节点性能的要求(并非所有节点都可以具备图像识别所需的计算资源)。
在一实施例中,节点设备在获取到冲红请求中的发票数据后,可以调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。
该实施例计算所述待冲红的发票的数字摘要是基于智能合约计算得到的,需要说明的是,也可以是响应于所述冲红请求的节点设备在本地基于预设算法计算得到的(不依赖智能合约);具体可以根据业务需求人为配置或者程序自动选择。
本说明书中,在查询到所述区块链中存储了与所述数字摘要对应的目标发票之后,节点设备需要调用发布在区块链上的智能合约中声明的冲红发票创建逻辑,创建针对所述目标发票的冲红发票,并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储。
在一实施例中,所述步骤130中创建针对所述目标发票的冲红发票,具体包括:
创建与所述目标发票的发票金额相同的负金额发票。
所述将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储,具体包括以下中的任一:
建立所述负金额发票与所述目标发票之间的映射关系,并将所述映射关系在所述区块链中进行存储;
建立所述负金额发票与所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储;
建立所述负金额发票、所述目标发票、以及所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储。
在税务操作中入账的发票是不能删掉的,那么针对入账错误的发票,实践中可以再入账一张与错误发票金额相同的负金额的发票,从而抵消该错误发票的影响。在区块链中,首先确定待冲红的发票对于的目标发票,然后可以创建与所述目标发票的发票金额相同的负金额发票;此时的负金额发票虽然创建了但在区块链中还需要建立所述负金额发票与所述目标发票和/或所述目标发票的数字摘要之间的映射关系,如此就可以通过映射关系,确定错误发票是否已完成冲红。
如图2所示,区块链节点在接收到针对待冲红的发票a的冲红请求后,可以调用预设的智能合约,查询区块链中是否存在这张发票a,即本说明书中所述的目标发票;并在查询到存在发票a后,在区块链中生成针对发票a的冲红发票a,以及在区块链上建立该冲红发票a与发票a之间的映射关系。所述建立的映射关系,可以表示发票a已经被冲红。所述冲红发票a是与发票a的发票金额相同的负金额。例如,发票a的发票金额为100元,则冲红发票a的发票金额为-100元。
本说明书提供的一种基于区块链的发票冲红方案,通过将发票和发票的数字摘要上链进行存证;由于区块链中存储的数据存在不可篡改的特征,以及数字摘要具有的唯一特征(即一个数字摘要对应一个原始数据);因此,当发现某张发票出现错误时可以 基于区块链中存储的发票的数字摘要确定该错误发票(即待冲红的发票)对应在链上的目标发票;进而可以创建与该目标发票关联的冲红发票并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储;如此,就可以抵消该错误发票的发票金额。
与前述基于区块链的发票冲红方法实施例相对应,本说明书还提供了基于区块链的发票冲红装置的实施例。所述装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在设备的处理器将非易失性存储器中对应的计算机业务程序指令读取到内存中运行形成的。从硬件层面而言,如图3所示,为本说明书基于区块链的发票冲红装置所在设备的一种硬件结构图,除了图3所示的处理器、网络接口、内存以及非易失性存储器之外,实施例中装置所在的设备通常根据基于区块链的发票冲红实际功能,还可以包括其他硬件,对此不再赘述。
请参见图4,为本说明书一实施例提供的基于区块链的发票冲红装置的模块图,所述装置对应了图1所示实施例,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述装置包括:
接收单元210,接收客户端提交的针对待冲红的发票的冲红请求;
查询单元220,响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;
冲红单元230,如果查询到所述区块链中存储了与所述数字摘要对应的目标发票,调用发布在区块链上的智能合约中声明的冲红发票创建逻辑,创建针对所述目标发票的冲红发票,并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储。
可选的,所述装置还包括:
创建请求接收单元,接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;
创建请求响应单元,响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。
可选的,所述查询单元220,包括:
响应于所述冲红请求,调用发布在区块链上的智能合约中声明的发票验证逻辑, 计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。
可选的,所述发票的数字摘要包括:
针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到的hash值。
可选的,所述冲红请求包括所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;
所述查询单元220中,计算所述待冲红的发票的数字摘要,包括:
获取所述冲红请求中的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;
针对获取到的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。
可选的,所述区块链为联盟链。
可选的,所述冲红单元230中,创建针对所述目标发票的冲红发票,具体包括:
创建与所述目标发票的发票金额相同的负金额发票。
可选的,所述冲红单元230中,将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储,具体包括以下中的任一:
建立所述负金额发票与所述目标发票之间的映射关系,并将所述映射关系在所述区块链中进行存储;
建立所述负金额发票与所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储;
建立所述负金额发票、所述目标发票、以及所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或 者这些设备中的任意几种设备的组合。
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上图4描述了基于区块链的发票冲红装置的内部功能模块和结构示意,其实质上的执行主体可以为一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为:
接收客户端提交的针对待冲红的发票的冲红请求;
响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;其中,所述区块链中存储有发票和发票的数字摘要之间的对应关系;
如果查询到所述区块链中存储了与所述数字摘要对应的目标发票,调用发布在区块链上的智能合约中声明的冲红发票创建逻辑,创建针对所述目标发票的冲红发票,并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储。
可选的,还包括:
接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;
响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,
计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。
可选的,所述响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票,包括:
响应于所述冲红请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。
可选的,所述发票的数字摘要包括:
针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到的hash值。
可选的,所述冲红请求包括所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;
所述计算所述待冲红的发票的数字摘要,包括:
获取所述冲红请求中的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;
针对获取到的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。
可选的,所述区块链为联盟链。
可选的,所述创建针对所述目标发票的冲红发票,具体包括:
创建与所述目标发票的发票金额相同的负金额发票。
可选的,所述将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储,具体包括以下中的任一:
建立所述负金额发票与所述目标发票之间的映射关系,并将所述映射关系在所述区块链中进行存储;
建立所述负金额发票与所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储;
建立所述负金额发票、所述目标发票、以及所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储。
在上述电子设备的实施例中,应理解,该处理器可以是中央处理单元(英文:Central Processing Unit,简称:CPU),还可以是其他通用处理器、数字信号处理器(英文:Digital Signal Processor,简称:DSP)、专用集成电路(英文:Application Specific Integrated Circuit,简称:ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,而前述的存储器可以是只读存储器(英文:read-only memory,缩写:ROM)、随机存取存储器(英文:random access memory,简称:RAM)、快闪存储器、硬盘或者固态硬盘。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于电子设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本说明书的其它实施方案。本说明书旨在涵盖本说明书的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本说明书的一般性原理并包括本说明书未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本说明书的真正范围和精神由下面的权利要求指出。
应当理解的是,本说明书并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本说明书的范围仅由所附的权利要求来限制。
Claims (17)
- 一种基于区块链的发票冲红方法,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述方法包括:接收客户端提交的针对待冲红的发票的冲红请求;响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;如果查询到所述区块链中存储了与所述数字摘要对应的目标发票,调用发布在区块链上的智能合约中声明的冲红发票创建逻辑,创建针对所述目标发票的冲红发票,并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储。
- 根据权利要求1所述的方法,所述方法还包括:接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。
- 根据权利要求1所述的方法,所述响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票,包括:响应于所述冲红请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。
- 根据权利要求2所述的方法,所述发票的数字摘要包括:针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到的hash值。
- 根据权利要求4所述的方法,所述冲红请求包括所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;所述计算所述待冲红的发票的数字摘要,包括:获取所述冲红请求中的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;针对获取到的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。
- 根据权利要求1所述的方法,所述区块链为联盟链。
- 根据权利要求1所述的方法,创建针对所述目标发票的冲红发票,具体包括:创建与所述目标发票的发票金额相同的负金额发票。
- 根据权利要求7所述的方法,将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储,具体包括以下中的任一:建立所述负金额发票与所述目标发票之间的映射关系,并将所述映射关系在所述区块链中进行存储;建立所述负金额发票与所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储;建立所述负金额发票、所述目标发票、以及所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储。
- 一种基于区块链的发票冲红装置,所述区块链中存储有发票和发票的数字摘要之间的对应关系,所述装置包括:接收单元,接收客户端提交的针对待冲红的发票的冲红请求;查询单元,响应于所述冲红请求,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票;冲红单元,如果查询到所述区块链中存储了与所述数字摘要对应的目标发票,调用发布在区块链上的智能合约中声明的冲红发票创建逻辑,创建针对所述目标发票的冲红发票,并将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储。
- 根据权利要求9所述的装置,所述装置还包括:创建请求接收单元,接收客户端提交的发票创建请求;其中,所述发票创建请求包括用户输入的发票创建信息;创建请求响应单元,响应于所述发票创建请求,调用发布在区块链上的智能合约中声明的发票创建逻辑,基于所述发票创建信息创建发票;以及,计算所述发票的数字摘要,并将所述发票和所述发票的数字摘要的对应关系在所述区块链中进行存储。
- 根据权利要求9所述的装置,所述查询单元,包括:响应于所述冲红请求,调用发布在区块链上的智能合约中声明的发票验证逻辑,计算所述待冲红的发票的数字摘要,并查询所述区块链中是否存储了与所述数字摘要对应的目标发票。
- 根据权利要求10所述的装置,所述发票的数字摘要包括:针对所述发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得 到的hash值。
- 根据权利要求12所述的装置,所述冲红请求包括所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;所述查询单元中,计算所述待冲红的发票的数字摘要,包括:获取所述冲红请求中的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息;针对获取到的所述待冲红的发票的发票内容;或者,所述发票内容中的唯一性信息进行hash计算得到hash值。
- 根据权利要求9所述的装置,所述区块链为联盟链。
- 根据权利要求9所述的装置,所述冲红单元中,创建针对所述目标发票的冲红发票,具体包括:创建与所述目标发票的发票金额相同的负金额发票。
- 根据权利要求15所述的装置,所述冲红单元中,将所述冲红发票与所述目标发票的对应关系在所述区块链中进行存储,具体包括以下中的任一:建立所述负金额发票与所述目标发票之间的映射关系,并将所述映射关系在所述区块链中进行存储;建立所述负金额发票与所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储;建立所述负金额发票、所述目标发票、以及所述目标发票的数字摘要之间的映射关系,并将所述映射关系在所述区块链中进行存储。
- 一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为上述权利要求1-9中任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811593717.6 | 2018-12-25 | ||
| CN201811593717.6A CN110020900A (zh) | 2018-12-25 | 2018-12-25 | 基于区块链的发票冲红方法及装置和电子设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020134606A1 true WO2020134606A1 (zh) | 2020-07-02 |
Family
ID=67188681
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/115670 Ceased WO2020134606A1 (zh) | 2018-12-25 | 2019-11-05 | 基于区块链的发票冲红方法及装置和电子设备 |
Country Status (3)
| Country | Link |
|---|---|
| CN (1) | CN110020900A (zh) |
| TW (1) | TWI734217B (zh) |
| WO (1) | WO2020134606A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114596090A (zh) * | 2020-12-03 | 2022-06-07 | 航天信息股份有限公司 | 一种基于区块链的海运费结算方法、装置、设备及介质 |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110020900A (zh) * | 2018-12-25 | 2019-07-16 | 阿里巴巴集团控股有限公司 | 基于区块链的发票冲红方法及装置和电子设备 |
| CN110458538B (zh) * | 2019-07-31 | 2021-09-24 | 创新先进技术有限公司 | 基于区块链的状态机维护方法及装置、电子设备、存储介质 |
| US11250438B2 (en) | 2019-07-31 | 2022-02-15 | Advanced New Technologies Co., Ltd. | Blockchain-based reimbursement splitting |
| CN110471985A (zh) * | 2019-07-31 | 2019-11-19 | 阿里巴巴集团控股有限公司 | 基于区块链的电子票据作废方法及装置、电子设备 |
| CN112819632B (zh) * | 2019-07-31 | 2024-11-08 | 蚂蚁链技术有限公司 | 一种基于区块链的报销费用分割方法、装置及电子设备 |
| CN112465575A (zh) * | 2019-09-09 | 2021-03-09 | 辽宁政税科技有限公司 | 一种基于区块链技术的发票管理系统及方法 |
| CN111984734A (zh) * | 2020-09-02 | 2020-11-24 | 深圳壹账通智能科技有限公司 | 一种基于区块链的数据处理方法、装置、设备及存储介质 |
| CN114626947A (zh) * | 2022-03-21 | 2022-06-14 | 中国银行股份有限公司 | 基于区块链的开票交易信息处理方法及装置 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106952124A (zh) * | 2017-03-16 | 2017-07-14 | 北京牛链科技有限公司 | 基于分布式记账的电子发票管理系统和方法 |
| CN108242000A (zh) * | 2017-10-27 | 2018-07-03 | 北京车和家信息技术有限公司 | 发票管理方法、系统、计算机装置及计算机可读存储介质 |
| CN108922012A (zh) * | 2018-07-11 | 2018-11-30 | 北京大账房网络科技股份有限公司 | 基于区块链技术不泄露原始信息的发票查验方法 |
| CN108961030A (zh) * | 2018-08-15 | 2018-12-07 | 腾讯科技(深圳)有限公司 | 关于电子票据的数据处理方法、装置、系统、介质和设备 |
| CN110020900A (zh) * | 2018-12-25 | 2019-07-16 | 阿里巴巴集团控股有限公司 | 基于区块链的发票冲红方法及装置和电子设备 |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106997554A (zh) * | 2016-01-26 | 2017-08-01 | 航天信息股份有限公司 | 一种红字发票信息表处理方法和处理系统 |
| EP3479333A4 (en) * | 2016-07-01 | 2019-12-18 | Wells Fargo Bank N.A. | FINANCIAL BLOCKCHAIN SYSTEM FOR INTERNATIONAL TRADE |
| CA3036725A1 (en) * | 2016-09-14 | 2018-03-22 | Royal Bank Of Canada | Credit score platform |
| US10657225B2 (en) * | 2016-12-29 | 2020-05-19 | Red Hat, Inc. | Providing blockchain-based subscription-as-a-service management |
| CN107451874A (zh) * | 2017-07-27 | 2017-12-08 | 武汉天喻信息产业股份有限公司 | 基于区块链的电子发票综合处理方法及系统 |
| CN108305106A (zh) * | 2018-01-31 | 2018-07-20 | 复旦大学 | 一种基于区块链的电子发票登记方法 |
| CN108648066A (zh) * | 2018-04-28 | 2018-10-12 | 济南浪潮高新科技投资发展有限公司 | 一种基于区块链的发票管理系统及方法 |
-
2018
- 2018-12-25 CN CN201811593717.6A patent/CN110020900A/zh active Pending
-
2019
- 2019-10-15 TW TW108137039A patent/TWI734217B/zh active
- 2019-11-05 WO PCT/CN2019/115670 patent/WO2020134606A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106952124A (zh) * | 2017-03-16 | 2017-07-14 | 北京牛链科技有限公司 | 基于分布式记账的电子发票管理系统和方法 |
| CN108242000A (zh) * | 2017-10-27 | 2018-07-03 | 北京车和家信息技术有限公司 | 发票管理方法、系统、计算机装置及计算机可读存储介质 |
| CN108922012A (zh) * | 2018-07-11 | 2018-11-30 | 北京大账房网络科技股份有限公司 | 基于区块链技术不泄露原始信息的发票查验方法 |
| CN108961030A (zh) * | 2018-08-15 | 2018-12-07 | 腾讯科技(深圳)有限公司 | 关于电子票据的数据处理方法、装置、系统、介质和设备 |
| CN110020900A (zh) * | 2018-12-25 | 2019-07-16 | 阿里巴巴集团控股有限公司 | 基于区块链的发票冲红方法及装置和电子设备 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114596090A (zh) * | 2020-12-03 | 2022-06-07 | 航天信息股份有限公司 | 一种基于区块链的海运费结算方法、装置、设备及介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| TWI734217B (zh) | 2021-07-21 |
| CN110020900A (zh) | 2019-07-16 |
| TW202026971A (zh) | 2020-07-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020134606A1 (zh) | 基于区块链的发票冲红方法及装置和电子设备 | |
| US11588651B2 (en) | Blockchain timestamp agreement | |
| TWI714308B (zh) | 基於區塊鏈的發票真偽驗證方法及裝置和電子設備 | |
| WO2020134575A1 (zh) | 基于区块链的资源分配方法、装置和电子设备 | |
| EP3864817B1 (en) | Blockchain timestamp agreement | |
| US11924360B2 (en) | Blockchain timestamp agreement | |
| CN110494876B (zh) | 用于在分布式网络节点内发布和追踪数字令牌的系统和方法 | |
| US12147435B2 (en) | Blockchain implementing reliability database | |
| US10805094B2 (en) | Blockchain timestamp agreement | |
| US11663197B2 (en) | Convolutional and ephemeral datachains with conditional period | |
| US20200013025A1 (en) | Conditional deferred transactions for blockchain | |
| CN110163691B (zh) | 基于区块链的发票创建方法和装置、电子设备 | |
| TW201937436A (zh) | 基於區塊鏈的交易執行方法及裝置、電子設備 | |
| US12443927B2 (en) | Privacy-preserving gridlock resolution | |
| US11669532B2 (en) | Blockchain implementing reliability database | |
| US11032083B2 (en) | Atomic transactional processing | |
| CN112966311B (zh) | 智能合约校验方法及装置和电子设备 | |
| CN111753009A (zh) | 包括快速路径服务的分散式数据库中的信息管理 | |
| CN110060155A (zh) | 区块链的智能合约执行方法及装置和电子设备 | |
| CN110046900A (zh) | 基于区块链的发票作废方法和装置、电子设备 | |
| CN118586662A (zh) | 业务处理方法、装置、存储介质及电子设备 | |
| WO2022251238A1 (en) | Systems and methods for ensuring quality of search system data | |
| HK40011339A (zh) | 基於区块链的发票冲红方法及装置和电子设备 | |
| HK40010755A (zh) | 基於区块链的发票真伪验证方法及装置和电子设备 | |
| HK40010754A (zh) | 基於区块链的资源分配方法及装置和电子设备 |
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: 19903358 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: 19903358 Country of ref document: EP Kind code of ref document: A1 |