TWI734217B - Block chain-based invoice redemption method and device and electronic equipment - Google Patents

Block chain-based invoice redemption method and device and electronic equipment Download PDF

Info

Publication number
TWI734217B
TWI734217B TW108137039A TW108137039A TWI734217B TW I734217 B TWI734217 B TW I734217B TW 108137039 A TW108137039 A TW 108137039A TW 108137039 A TW108137039 A TW 108137039A TW I734217 B TWI734217 B TW I734217B
Authority
TW
Taiwan
Prior art keywords
invoice
blockchain
redemption
target
issuance
Prior art date
Application number
TW108137039A
Other languages
Chinese (zh)
Other versions
TW202026971A (en
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 TW202026971A publication Critical patent/TW202026971A/en
Application granted granted Critical
Publication of TWI734217B publication Critical patent/TWI734217B/en

Links

Images

Classifications

    • 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
    • G06Q30/00Commerce
    • G06Q30/04Billing or invoicing

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

本說明書實施例提供一種基於區塊鏈的發票沖紅方法及裝置和電子設備,所述區塊鏈中儲存有發票和發票的數位摘要之間的對應關係,所述方法包括:接收客戶端提交的針對待沖紅的發票的沖紅請求;響應於所述沖紅請求,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票;如果查詢到所述區塊鏈中儲存了與所述數位摘要對應的目標發票,調用發布在區塊鏈上的智慧合約中聲明的沖紅發票開立邏輯,開立針對所述目標發票的沖紅發票,並將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存。 The embodiment of this specification provides a method and device for redemption of invoices based on a blockchain, and electronic equipment. The blockchain stores the correspondence between invoices and digital summaries of the invoices. The method includes: receiving client submissions A redemption request for an invoice to be redeemed; in response to the redemption request, calculate a digital summary of the redemption invoice, and query whether the digital abstract is stored in the blockchain Target invoice; if it is found that the target invoice corresponding to the digital summary is stored in the blockchain, the redemption invoice issuance logic declared in the smart contract published on the blockchain is invoked, and the target invoice is issued for the target The redemption invoice of the invoice, and the corresponding relationship between the redemption invoice and the target invoice is stored in the blockchain.

Description

基於區塊鏈的發票沖紅方法及裝置和電子設備 Block chain-based invoice redemption method and device and electronic equipment

本說明書實施例涉及區塊鏈技術領域,尤其涉及一種基於區塊鏈的發票沖紅方法及裝置和電子設備。 The embodiments of the present specification relate to the field of blockchain technology, and in particular to a method and device for redemption of invoices based on a blockchain, and electronic equipment.

區塊鏈技術,也被稱之為分散式帳本技術,是一種由若干台計算設備共同參與“記帳”,共同維護一份完整的分散式資料庫的新興技術。由於區塊鏈技術具有去中心化、公開透明、每台計算設備可以參與資料庫記錄、並且各計算設備之間可以快速的進行資料同步的特性,使得區塊鏈技術在眾多的領域中廣泛的進行應用。 Blockchain technology, also known as distributed ledger technology, is an emerging technology in which several computing devices participate in "bookkeeping" and jointly maintain a complete distributed database. Because the blockchain technology has the characteristics of decentralization, openness and transparency, each computing device can participate in database recording, and the rapid data synchronization between computing devices, the blockchain technology is widely used in many fields. To apply.

本說明書實施例提供的一種基於區塊鏈的發票沖紅方法及裝置和電子設備:根據本說明書實施例的第一方面,提供一種基於區塊鏈的發票沖紅方法,所述區塊鏈中儲存有發票和發票的數位摘要之間的對應關係,所述方法包括:接收客戶端提交的針對待沖紅的發票的沖紅請求;響應於所述沖紅請求,計算所述待沖紅的發票的數位 摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票;如果查詢到所述區塊鏈中儲存了與所述數位摘要對應的目標發票,調用發布在區塊鏈上的智慧合約中聲明的沖紅發票開立邏輯,開立針對所述目標發票的沖紅發票,並將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存。 A blockchain-based invoice redemption method and device and electronic equipment provided by the embodiments of this specification: According to the first aspect of the embodiments of this specification, a blockchain-based invoice redemption method is provided. The corresponding relationship between the invoice and the digital summary of the invoice is stored, and the method includes: receiving a redemption request for an invoice to be redeemed submitted by a client; in response to the redemption request, calculating the redemption Number of invoices Summary, and query whether the target invoice corresponding to the digital summary is stored in the blockchain; if the target invoice corresponding to the digital summary is stored in the blockchain, call to publish on the blockchain The red-red invoice issuance logic stated in the smart contract on the above, issue red-red invoices for the target invoice, and store the corresponding relationship between the red-red invoice and the target invoice in the blockchain .

可選的,所述方法還包括:接收客戶端提交的發票開立請求;其中,所述發票開立請求包括用戶輸入的發票開立資訊;響應於所述發票開立請求,調用發布在區塊鏈上的智慧合約中聲明的發票開立邏輯,基於所述發票開立資訊開立發票;以及,計算所述發票的數位摘要,並將所述發票和所述發票的數位摘要的對應關係在所述區塊鏈中進行儲存。 Optionally, the method further includes: receiving an invoice issuance request submitted by the client; wherein, the invoice issuance request includes the invoice issuance information input by the user; The invoice issuance logic declared in the smart contract on the blockchain is to issue an invoice based on the invoice issuance information; and, calculate the digital summary of the invoice, and compare the corresponding relationship between the invoice and the digital summary of the invoice Store in the blockchain.

可選的,所述響應於所述沖紅請求,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票,包括:響應於所述沖紅請求,調用發布在區塊鏈上的智慧合約中聲明的發票驗證邏輯,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票。 Optionally, in response to the redemption request, calculating a digital summary of the invoice to be redeemed, and querying whether the target invoice corresponding to the digital summary is stored in the blockchain includes: responding In the redemption request, call the invoice verification logic declared in the smart contract published on the blockchain, calculate the digital summary of the redemption invoice, and query whether the blockchain is stored with the The target invoice corresponding to the digital summary.

可選的,所述發票的數位摘要包括:針對所述發票的發票內容;或者,所述發票內容中的 唯一性資訊進行雜湊(hash)計算得到的hash值。 Optionally, the digital summary of the invoice includes: invoice content for the invoice; or, in the invoice content The hash value obtained by hashing the unique information.

可選的,所述沖紅請求包括所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;所述計算所述待沖紅的發票的數位摘要,包括:獲取所述沖紅請求中的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;針對獲取到的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到hash值。 Optionally, the redemption request includes the invoice content of the invoice to be redeemed; or, unique information in the invoice content; and the calculation of the digital summary of the invoice to be redeemed includes: obtaining The invoice content of the invoice to be redeemed in the redemption request; or, the unique information in the invoice content; the invoice content for the obtained invoice to be redeemed; or, the invoice The unique information in the content is hashed to obtain the hash value.

可選的,所述區塊鏈為聯盟鏈。 Optionally, the blockchain is a consortium chain.

可選的,所述開立針對所述目標發票的沖紅發票,具體包括:開立與所述目標發票的發票金額相同的負金額發票。 Optionally, the issuance of a redemption invoice for the target invoice specifically includes: issuance of a negative invoice with the same invoice value as the target invoice.

可選的,所述將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存,具體包括以下中的任一:建立所述負金額發票與所述目標發票之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票與所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票、所述目標發票、以及所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存。 Optionally, the storing the corresponding relationship between the redemption invoice and the target invoice in the blockchain specifically includes any one of the following: establishing a relationship between the negative amount invoice and the target invoice And store the mapping relationship in the blockchain; establish the mapping relationship between the negative amount invoice and the digital summary of the target invoice, and store the mapping relationship in the Storing in the blockchain; establishing a mapping relationship between the negative amount invoice, the target invoice, and the digital summary of the target invoice, and storing the mapping relationship in the blockchain.

根據本說明書實施例的第二方面,提供一種基於區塊鏈的發票沖紅裝置,所述區塊鏈中儲存有發票和發票的數 位摘要之間的對應關係,所述裝置包括:接收單元,接收客戶端提交的針對待沖紅的發票的沖紅請求;查詢單元,響應於所述沖紅請求,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票;沖紅單元,如果查詢到所述區塊鏈中儲存了與所述數位摘要對應的目標發票,調用發布在區塊鏈上的智慧合約中聲明的沖紅發票開立邏輯,開立針對所述目標發票的沖紅發票,並將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存。 According to the second aspect of the embodiments of the present specification, there is provided an invoice redemption device based on a blockchain in which invoices and invoice numbers are stored. The corresponding relationship between the bit summaries, the device includes: a receiving unit that receives a redemption request for an invoice to be redeemed submitted by a client; a query unit, in response to the redemption request, calculates the redemption The digital summary of the invoice, and query whether the target invoice corresponding to the digital summary is stored in the blockchain; the redemption unit, if it is queried that the target invoice corresponding to the digital summary is stored in the blockchain , Call the redemption invoice issuance logic declared in the smart contract published on the blockchain, issue redemption invoices for the target invoice, and set the corresponding relationship between the redemption invoice and the target invoice in all Store in the block chain.

可選的,所述裝置還包括:開立請求接收單元,接收客戶端提交的發票開立請求;其中,所述發票開立請求包括用戶輸入的發票開立資訊;開立請求響應單元,響應於所述發票開立請求,調用發布在區塊鏈上的智慧合約中聲明的發票開立邏輯,基於所述發票開立資訊開立發票;以及,計算所述發票的數位摘要,並將所述發票和所述發票的數位摘要的對應關係在所述區塊鏈中進行儲存。 Optionally, the device further includes: an issuance request receiving unit that receives an invoice issuance request submitted by the client; wherein the invoice issuance request includes invoice issuance information input by the user; an issuance request response unit that responds In the invoice issuance request, the invoice issuance logic declared in the smart contract published on the blockchain is invoked, and the invoice is issued based on the invoice issuance information; and, the digital summary of the invoice is calculated, and the The corresponding relationship between the invoice and the digital summary of the invoice is stored in the blockchain.

可選的,所述查詢單元,包括:響應於所述沖紅請求,調用發布在區塊鏈上的智慧合約中聲明的發票驗證邏輯,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對 應的目標發票。 Optionally, the query unit includes: in response to the redemption request, invoking the invoice verification logic declared in the smart contract published on the blockchain, calculates the digital summary of the redemption invoice, and queries Whether the digital digest pair is stored in the blockchain The corresponding target invoice.

可選的,所述發票的數位摘要包括:針對所述發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到的hash值。 Optionally, the digital summary of the invoice includes: the invoice content of the invoice; or, the hash value obtained by hashing the unique information in the invoice content.

可選的,所述沖紅請求包括所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;所述查詢單元中,計算所述待沖紅的發票的數位摘要,包括:獲取所述沖紅請求中的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;針對獲取到的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到hash值。 Optionally, the redemption request includes the invoice content of the invoice to be redeemed; or, unique information in the invoice content; in the query unit, a digital summary of the invoice to be redeemed is calculated , Including: obtaining the invoice content of the invoice to be redeemed in the redemption request; or, the unique information in the invoice content; the invoice content for the obtained invoice to be redeemed; or , The unique information in the invoice content is hashed to obtain the hash value.

可選的,所述區塊鏈為聯盟鏈。 Optionally, the blockchain is a consortium chain.

可選的,所述沖紅單元中,開立針對所述目標發票的沖紅發票,具體包括:開立與所述目標發票的發票金額相同的負金額發票。 Optionally, in the redemption unit, issuing a redemption invoice for the target invoice specifically includes: issuing a negative amount invoice that is the same as the invoice amount of the target invoice.

可選的,所述沖紅單元中,將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存,具體包括以下中的任一:建立所述負金額發票與所述目標發票之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票與所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存; 建立所述負金額發票、所述目標發票、以及所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存。 Optionally, in the redemption unit, the corresponding relationship between the redemption invoice and the target invoice is stored in the blockchain, which specifically includes any one of the following: establishing the negative amount invoice and The mapping relationship between the target invoices, and the mapping relationship is stored in the blockchain; the mapping relationship between the negative amount invoice and the digital summary of the target invoice is established, and the The mapping relationship is stored in the blockchain; Establish a mapping relationship between the negative amount invoice, the target invoice, and the digital summary of the target invoice, and store the mapping relationship in the blockchain.

根據本說明書實施例的第五方面,提供一種電子設備,包括:處理器;用於儲存處理器可執行指令的記憶體;其中,所述處理器被配置為上述任一項基於區塊鏈的發票沖紅方法。 According to a fifth aspect of the embodiments of the present specification, there is provided an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured as any one of the above-mentioned blockchain-based Invoice flushing method.

本說明書實施例,提供了一種基於區塊鏈的發票沖紅方案,透過將發票和發票的數位摘要上鏈進行存證;由於區塊鏈中儲存的資料存在不可篡改的特徵,以及數位摘要具有的唯一特徵(即一個數位摘要對應一個原始資料);因此,當發現某張發票出現錯誤時可以基於區塊鏈中儲存的發票的數位摘要確定該錯誤發票(即待沖紅的發票)對應在鏈上的目標發票;進而可以開立與該目標發票關聯的沖紅發票並將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存;如此,就可以抵消該錯誤發票的發票金額。 The embodiment of this specification provides a block chain-based invoice redemption scheme, which is certified by uploading the digital summaries of invoices and invoices to the chain; because the data stored in the block chain has the characteristics of non-tampering, and the digital summaries have The unique feature of (that is, a digital summary corresponds to one original data); therefore, when an error is found in an invoice, it can be determined based on the digital summary of the invoice stored in the blockchain that the wrong invoice (that is, the invoice to be redeemed) corresponds to The target invoice on the chain; in turn, a redemption invoice associated with the target invoice can be issued and the corresponding relationship between the redemption invoice and the target invoice can be stored in the blockchain; in this way, the redemption invoice can be offset The invoice amount of the wrong invoice.

110:步驟 110: Step

120:步驟 120: Step

130:步驟 130: steps

210:接收單元 210: receiving unit

220:查詢單元 220: Query unit

230:沖紅單元 230: Red unit

[圖1]是本說明書一實施例提供的基於區塊鏈的發票沖紅方法的流程圖;[圖2]是本說明書一實施例提供的發票沖紅的示意 圖。 [Figure 1] is a flowchart of a blockchain-based invoice redemption method provided by an embodiment of this specification; [Figure 2] is a schematic diagram of an invoice redemption provided by an embodiment of this specification picture.

[圖3]是本說明書一實施例提供的基於區塊鏈的發票沖紅裝置的硬體結構圖;[圖4]是本說明書一實施例提供的基於區塊鏈的發票沖紅裝置的模組示意圖。 [Figure 3] is a hardware structure diagram of a blockchain-based invoice redemption device provided by an embodiment of this specification; [Figure 4] is a model of a blockchain-based invoice redemption device provided by an embodiment of this specification Group diagram.

這裡將詳細地對示例性實施例進行說明,其示例表示在圖式中。下面的描述涉及圖式時,除非另有表示,不同圖式中的相同數字表示相同或相似的元件。以下示例性實施例中所描述的實施方式並不代表與本說明書相一致的所有實施方式。相反,它們僅是與如所附申請專利範圍中所詳述的、本說明書的一些方面相一致的裝置和方法的例子。 The exemplary embodiments will be described in detail here, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with this specification. On the contrary, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the scope of the appended application.

在本說明書使用的術語是僅僅出於描述特定實施例的目的,而非旨在限制本說明書。在本說明書和所附申請專利範圍中所使用的單數形式的“一種”、“所述”和“該”也旨在包括多數形式,除非上下文清楚地表示其他含義。還應當理解,本文中使用的術語“和/或”是指並包含一個或多個相關聯的列出項目的任何或所有可能組合。 The terms used in this specification are only for the purpose of describing specific embodiments, and are not intended to limit the specification. The singular forms of "a", "said" and "the" used in this specification and the scope of the appended applications are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and/or" as used herein refers to and includes 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 can also be It is called the second information, and similarly, the second information can also be called the first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "when" or "in response to determination".

發票(Invoice)可以是指一切單位或個人在購銷商品、提供或接受服務以及從事其他經營活動中,所開具和收取的業務憑證。發票通常是會計核算的原始依據,也是審計機關、稅務機關執法檢查的重要依據。對於公司來講,發票主要是公司做帳的依據,同時也是繳稅的費用憑證;而對於員工來講,發票主要可以用來報銷。 Invoices can refer to business vouchers issued and received by all units or individuals in purchasing and selling commodities, providing or receiving services, and engaging in other business activities. Invoices are usually the original basis for accounting and are also an important basis for law enforcement inspections by auditing agencies and taxation agencies. For the company, the invoice is mainly the basis for the company to make accounts, and it is also an expense certificate for tax payment; for the employee, the invoice is mainly used for reimbursement.

發票沖紅是針對發現發票有誤或因為其它原因需更正時,重新開具的發票調整帳目手段。當發票已經入帳,如果發票有誤,需要重新開具一張跟原來發票金額相同的負金額發票,用於入帳抵消。 Invoice redemption is a method of re-issuing an invoice when it is found that the invoice is wrong or needs to be corrected for other reasons. When the invoice has been entered, if the invoice is incorrect, a new negative invoice with the same amount as the original invoice needs to be reissued to offset the entry.

由於區塊鏈技術存在不可篡改的特徵,因此可以透過將發票上鏈進行存證,從而可以基於區塊鏈中儲存的發票進行相關發票業務。然而,上鏈的發票已經屬於入帳的發票,如果上鏈的發票發現存在錯誤,同樣無法透過刪除該發票抵消入帳;因此,需要提供區塊鏈中發票沖紅的方案。 Due to the non-tamperable characteristics of blockchain technology, the invoice can be stored on the chain to perform related invoice business based on the invoice stored in the blockchain. However, the invoice on the chain already belongs to the invoice that is entered. If the invoice on the chain is found to have errors, the invoice cannot be deleted to offset the entry; therefore, it is necessary to provide a solution for the redemption of the invoice in the blockchain.

本說明書提出了一種基於區塊鏈的發票沖紅方案,提供了一種基於區塊鏈的發票沖紅方案,如果上鏈的發票發現存在錯誤,可以透過產生一張與該發票關聯的沖紅發票的方式,抵消該錯誤發票的發票金額。 This manual proposes a blockchain-based invoice redemption scheme, and provides a blockchain-based invoice redemption scheme. If errors are found in the invoice on the chain, you can generate a redemption invoice associated with the invoice Way to offset the invoice amount of the wrong invoice.

請參考圖1,圖1為本說明書一實施例提供的基於區塊 鏈的發票沖紅方法的流程圖,所述區塊鏈中儲存有發票和發票的數位摘要之間的對應關係,所述方法包括:步驟110:接收客戶端提交的針對待沖紅的發票的沖紅請求;步驟120:響應於所述沖紅請求,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票;步驟130:如果查詢到所述區塊鏈中儲存了與所述數位摘要對應的目標發票,調用發布在區塊鏈上的智慧合約中聲明的沖紅發票開立邏輯,開立針對所述目標發票的沖紅發票,並將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存。 Please refer to Figure 1. Figure 1 is a block-based block diagram provided by an embodiment of this specification. The flow chart of the method for redemption of the invoice of the chain, the corresponding relationship between the invoice and the digital summary of the invoice is stored in the blockchain, and the method includes: Step 110: receiving the invoice submitted by the client for the redemption of the invoice Redemption request; Step 120: In response to the redemption request, calculate a digital summary of the invoice to be redeemed, and query whether the target invoice corresponding to the digital summary is stored in the blockchain; Step 130 : If it is queried that the target invoice corresponding to the digital summary is stored in the blockchain, call the red-red invoice issuance logic declared in the smart contract published on the blockchain to issue an invoice for the target invoice Flushing the red invoice, and storing the corresponding relationship between the red red invoice and the target invoice in the blockchain.

在本說明書所描述的區塊鏈,具體可以包括私有鏈、共有鏈以及聯盟鏈等,在本說明書中不進行特別限定。 The blockchain described in this specification may specifically include a private chain, a public chain, and an alliance chain, etc., which are not particularly limited in this specification.

例如,在一個場景中,上述區塊鏈具體可以是由總部機構、分支機構、代理機構等作為聯盟成員組成的一個聯盟鏈;該聯盟鏈的營運方可以依托於該聯盟鏈,來部署相應的業務;而以上所描述的作為聯盟成員的總部機構、分支機構、代理機構都可以作為上述業務的一個業務節點。各個業務節點可以將自身所產生或者接收到的與上述發票的第一數位摘要以交易的形式在聯盟鏈中進行發布,並在該交易經過聯盟鏈中的共識節點的共識處理之後,在聯盟鏈中的分散式資料庫進行儲存,完成上述交易資訊的“上鏈”存證。 For example, in a scenario, the above-mentioned blockchain may specifically be a consortium chain composed of headquarters organizations, branches, agencies, etc. as alliance members; the operator of the consortium chain can rely on the consortium chain to deploy corresponding Business; and the headquarters, branches, and agencies that are members of the alliance described above can all 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 consortium chain in the form of a transaction, and after the transaction is processed by the consensus node in the consortium chain, in the consortium chain Stored in the distributed database in, complete the "chain" deposit of the above transaction information.

其中,需要說明的是,在本說明書中所描述的交易(Transaction),是指透過區塊鏈的客戶端開立,並需要最終發布至區塊鏈的分散式資料庫中的一筆資料。 Among them, it should be noted that the transaction described in this manual refers to a piece of data that is opened through 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 transactions in the blockchain. A transaction in a narrow sense refers to a transfer of value issued by a user to the blockchain; for example, in a traditional Bitcoin blockchain network, a transaction can be a transfer initiated by the user in the blockchain. In a broad sense, a transaction refers to a piece of business data with business intentions released by a user to the blockchain; for example, an operator can build a consortium chain based on actual business needs, and rely on the consortium chain to deploy some other types that have nothing to do with value transfer. Online business (such as deposit certificate business, authenticity verification business, invoice redemption business, etc.), and in this type of alliance chain, the transaction can be a business message or business request with business intent issued by the user in the alliance chain.

上述客戶端,可以包括任意類型的以區塊鏈中儲存的底層業務資料作為資料支撑,來實現特定的業務功能的上層應用。 The above client may include any type of upper-level 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 on the block. For example, operations such as storage, modification, and deletion in the blockchain all need to rely on smart contracts. The smart contract may be a computer protocol that is designed to be deployed on the blockchain to disseminate, verify, or execute the contract in an information-based manner. The corresponding operations can be implemented by declaring business logic in the smart contract. Smart contracts allow credible transactions without a third party. These transactions are traceable and irreversible. Smart contracts can provide security that is superior to traditional contract methods. And reduce other transaction costs related to the contract. Generally, a smart contract can be deployed locally on a blockchain node. When the node needs to perform a certain action, the corresponding smart contract can be called, and the smart contract can be run to execute the business logic declared in the smart contract to obtain the execution result.

本說明書中所述的數位摘要,可以是指基於原始資料進行雜湊(hash,也稱為散列)計算後得到的hash值。具體地,所述發票的數位摘要包括:針對所述發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到的hash值。 The digital abstract described in this specification may refer to a hash value obtained by hashing (also called a hash) calculation based on the original data. Specifically, the digital summary of the invoice includes: the invoice content of the invoice; or, the hash value obtained by hashing the unique information in the invoice content.

其中,所述發票內容可以包含唯一性資訊。例如,發票內容可以包括發票號碼、發票代碼;通常發票號碼和發票代碼均是唯一性資訊;對應的,發票的數位摘要可以記為hash(發票號碼+發票代碼)。當然,發票內容還可以包括非唯一性資訊,例如發票日期、不含稅金額;對應的,發票的數位摘要即可以記為hash(發票號碼+發票代碼+發票日期+不含稅金額)。 Wherein, the invoice content may include unique information. For example, the content of an invoice can include an invoice number and an invoice code; usually, both the invoice number and the 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 the invoice date and tax excluding amount; correspondingly, the digital summary of the invoice can be recorded as a hash (invoice number + invoice code + invoice date + tax excluding amount).

相應地,所述沖紅請求包括所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;所述計算所述待沖紅的發票的數位摘要,包括:獲取所述沖紅請求中的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;針對獲取到的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到hash值。 Correspondingly, the redemption request includes the invoice content of the invoice to be redeemed; or, the unique information in the invoice content; and the calculation of the digital summary of the invoice to be redeemed includes: obtaining The invoice content of the invoice to be redeemed in the redemption request; or, the unique information in the invoice content; the invoice content for the obtained invoice to be redeemed; or, the invoice content The unique information in is hashed to obtain the hash value.

值得一提的是,待識別發票和發票均採用相同的雜湊 演算法。 It’s worth mentioning that both the to-be-identified invoice and the invoice use the same hash Algorithm.

如前所述,本說明書可以預先將發票進行上鏈,在一實施例中,所述方法還包括:接收客戶端提交的發票開立請求;其中,所述發票開立請求包括用戶輸入的發票開立資訊;響應於所述發票開立請求,調用發布在區塊鏈上的智慧合約中聲明的發票開立邏輯,基於所述發票開立資訊開立發票;以及,計算所述發票的數位摘要,並將所述發票和所述發票的數位摘要的對應關係在所述區塊鏈中進行儲存。 As mentioned above, this specification can pre-wind the invoice. In one embodiment, the method further includes: receiving an invoice issuance request submitted by the client; wherein, the invoice issuance request includes the invoice input by the user. Issuing information; in response to the invoice issuance request, call the invoice issuance logic declared in the smart contract published on the blockchain to issue an invoice based on the invoice issuance information; and, calculate the digits of the invoice Abstract, and store the correspondence between the invoice and the digital summary of the invoice in the blockchain.

以下結合圖2所示的發票上鏈的示意圖加以說明: The following is an explanation with reference to the schematic diagram of the invoice on the chain shown in Figure 2:

在本實施例中,用戶在需要在該區塊鏈中開立發票時,可以透過其所使用的客戶端發起一筆用於開立發票的交易,即透過客戶端發起發票開立請求。具體地,該用戶可以透過該客戶端提供的發票開立頁面,輸入待開立的目標發票的發票開立資訊;例如,發票的抬頭、金額等資訊。在該用戶完成發票開立資訊的輸入後,該客戶端可以基於用戶輸入的發票開立資訊來產生對應的發票開立請求,並將該發票開立請求發送至該區塊鏈中的節點設備。 In this embodiment, when the user needs to open an invoice in the blockchain, he can initiate a transaction for issuing an invoice through the client terminal he uses, that is, initiate an invoice issuance request through the client terminal. Specifically, the user can enter the invoice issuance information of the target invoice to be issued through the invoice issuance page provided by the client terminal; for example, information such as the title and amount of the invoice. After the user completes the input of the invoice issuance information, the client can generate a corresponding invoice issuance request based on the invoice issuance information input by the user, and send the invoice issuance request to the node device in the blockchain .

該區塊鏈中的節點設備在接收到該發票開立請求後,可以對該發票開立請求進行響應。調用發布在區塊鏈上的智慧合約中聲明的發票開立邏輯,基於所述發票開立請求中的發票開立資訊開立發票;以及在完成發票開立後,可以進一步計算所述發票的數位摘要,並將所述發票和所述 發票的數位摘要的對應關係在所述區塊鏈中進行儲存。 After receiving the invoice issuance request, the node device in the blockchain can respond to the invoice issuance request. Call the invoice issuance logic declared in the smart contract published on the blockchain, and issue an invoice based on the invoice issuance information in the invoice issuance request; and after completing the invoice issuance, the invoice can be further calculated Digital summary, and combine the invoice and the The corresponding relationship of the digital summary of the invoice is stored in the blockchain.

在一實施例中,響應於所述發票開立請求的節點設備,還可以先確定與該發票開立請求對應的發票開具方的發票開立額度是否充足。 In an embodiment, the node device responding to the invoice issuance request may also first determine whether the invoice issuance amount of the invoice issuance party corresponding to the invoice issuance request is sufficient.

舉例來說,可以從該發票開立請求中該用戶輸入的發票開立資訊中,獲取發票開具方的納稅人識別號,並基於該納稅人識別號確定對應的發票開具方,該發票開具方即為該發票開立請求對應的發票開具方。後續,可以先確定該發票開具方的發票開立額度是否充足。 For example, from the invoice issuance information entered by the user in the invoice issuance request, the taxpayer identification number of the invoice issuing party can be obtained, and the corresponding invoice issuing party can be determined based on the taxpayer identification number. It is the invoice issuing party corresponding to the invoice issuance request. Later, you can first determine whether the invoice issuer's invoice quota is sufficient.

在示出的一種實施方式中,可以由該節點設備調用部署在該區塊鏈上的智慧合約中聲明的額度檢查邏輯,確定該發票開具方的發票開立額度是否充足。 In the illustrated embodiment, the node device may call the quota check logic declared in the smart contract deployed on the blockchain to determine whether the invoice issuance quota of the invoice issuer is sufficient.

其中,額度檢查邏輯具體可以是聲明在該智慧合約中的,與檢查發票開具方的發票開立額度的執行邏輯相關的程式碼(例如:一些可供調用的程式方法或者函數)。 Wherein, the quota check logic may specifically be the code (for example, some callable program methods or functions) related to the execution logic of checking the invoice issuance quota declared in the smart contract.

或者,也可以由該節點設備調用第三方的可信服務,將該發票開立請求發送給該第三方的可信服務。其中,第三方的可信服務可以是部署在第三方的可信服務設備上的,與檢查發票開具方的發票開立額度的執行邏輯相關的程式碼。舉例來說,該第三方的可信服務設備可以是在稅務局內網中的設備,由此可以提高資料安全性。 Alternatively, the node device may call the trusted service of the third party, and send the invoice issuance request to the trusted service of the third party. Among them, the trusted service of the third party may be a program code that is deployed on the trusted service device of the third party and is related to the execution logic of checking the invoice issuance limit of the invoice issuing party. For example, the third-party trusted service device 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 issuance limit of the invoice issuance party is sufficient, and return the determination result to the node device. The node device can determine based on the determination result returned by the third-party trusted service Determine whether the invoice issuer's invoice quota is sufficient.

具體地,該第三方的可信服務可以在確定該發票開具方的發票開立額度充足時,向該節點設備返回該發票開具方的發票開立額度充足的確定結果。該節點設備在接收到該確定結果後,可以確定該發票開具方的發票開立額度充足。或者,該第三方的可信服務可以在確定該發票開具方的發票開立額度不充足時,向該節點設備返回該發票開具方的發票開立額度不充足的確定結果。該節點設備在接收到該確定結果後,可以確定該發票開具方的發票開立額度不充足。 Specifically, the trusted service of the third party may return to the node device a determination result that the invoice issuance limit of the invoice issuance party is sufficient when it is determined that the invoice issuance limit of the invoice issuance party is sufficient. After receiving the determination result, the node device can determine that the invoice issuance amount of the invoice issuance party is sufficient. Alternatively, the trusted service of the third party may return to the node device a determination result that the invoice issuance limit of the invoice issuance party is insufficient when it is determined that the invoice issuance limit of the invoice issuance party is insufficient. After receiving the determination result, the node device can determine that the invoice issuance amount of the invoice issuance party is insufficient.

如果確定該發票開具方的發票開立額度充足,則可以調用部署在該區塊鏈上的智慧合約中聲明的發票開立邏輯,基於該發票開立請求中用戶輸入的發票開立資訊,開立目標發票。 If it is determined that the invoice issuance limit of the invoice issuance party is sufficient, the invoice issuance logic declared in the smart contract deployed on the blockchain can be invoked, based on the invoice issuance information entered by the user in the invoice issuance request. Create a target invoice.

其中,發票開立邏輯具體可以是聲明在該智慧合約中的,與開立發票的執行邏輯相關的程式碼。 Among them, the invoice issuance logic may specifically be a code that is declared in the smart contract and is related to the execution logic of the invoice issuance.

在另一實施例中,所述發票可以是由原始產生發票的機構提供的。例如可以是由國家稅務局將發票的第一發票資料直接或間接上傳給區塊鏈。具體地,當一開發票設備開具一張發票後,該發票也記錄在稅務局的系統上,該稅務局的稅務系統可以同步將發票上鏈存證。其中所述上鏈存證的過程如前所述實施例相同,這裡不再進行贅述。 In another embodiment, the invoice may be provided by the institution that originally generated the invoice. For example, the first invoice data of the invoice can be directly or indirectly uploaded to the blockchain by the State Administration of Taxation. 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 synchronize the invoice on the chain for deposit. The process of uploading the evidence is the same as the previous embodiment, and will not be repeated here.

舉例說明,發票A、發票B和發票C上鏈後,在區塊鏈中就可以記錄有發票A hash和發票A資料的映射關係;發 票B hash和發票B資料的映射關係;發票C hash和發票C資料的映射關係。 For example, after invoice A, invoice B, and invoice C are on the chain, 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; the mapping relationship between invoice C hash and invoice C data.

值得一提的是,如圖2所述,區塊鏈中可以劃分有存放發票的空間以及存放紅票(即沖紅發票)的空間。發票與紅票之間透過建立對應關係以實現發票沖紅。 It is worth mentioning that, as shown in Figure 2, the blockchain can be divided into space for storing invoices and space for storing red invoices (that is, red invoices). The corresponding relationship between the invoice and the red note is established to realize the redemption of the invoice.

以下介紹本說明書中發票沖紅的過程: The following describes the process of redemption of invoices in this manual:

用戶在發現發票存在錯誤後,需要對區塊鏈中儲存的錯誤發票進行沖紅以抵消該錯誤發票。首先,用戶可以將該錯誤發票作為待沖紅的發票,並可以透過客戶端向區塊鏈提交針對待沖紅的發票的沖紅請求,來調用在區塊鏈上部署的用於發票沖紅的智慧合約,針對待識別的發票進行沖紅。 After the user finds that the invoice has an error, he needs to flush the error invoice stored in the blockchain to offset the error invoice. First, the user can use the wrong invoice as an invoice to be redeemed, and can submit a redemption request for the invoice to be redeemed to the blockchain through the client to call the invoice redemption deployed on the blockchain Smart contract for redemption for the invoice to be identified.

在一種實現方式中,如前開立發票類似的,用戶可以在客戶端上輸入待沖紅的發票的發票內容或者發票內容中的唯一性資訊(以下將發票內容或者發票內容中的唯一性資訊簡稱為發票資料),並將輸入的發票資料攜帶在客戶端發送的沖紅請求中;發送給區塊鏈中的節點設備,來觸發區塊鏈中的節點設備調用部署的智慧合約,針對待識別的發票進行沖紅。因此,區塊鏈中節點設備可以直接接收到發票資料。 In one implementation method, similar to the previous invoice, the user can enter the invoice content or the unique information in the invoice content of the invoice to be redeemed on the client (the following will be the invoice content or the unique information in the invoice content (Referred to as invoice data), and carry the input invoice data in the redemption request sent by the client; send it to the node device in the block chain to trigger the node device in the block chain to call the deployed smart contract, aiming at the waiting The recognized invoice is flushed. Therefore, the node device in the blockchain can directly receive the invoice data.

在另一種實現方式中,用戶可以對待沖紅的發票進行拍照,採集待沖紅的發票的發票影像,並在客戶端上或者第三方識別系統上對採集到的發票影像進行影像識別,來識別出發票資料,並將透過影像識別得到的發票資料攜帶 在客戶端發送的沖紅請求中,發送給區塊鏈中的節點設備,來觸發區塊鏈中的節點設備調用部署的智慧合約,針對待識別的發票進行沖紅。因此,區塊鏈中節點直接就可以接收到發票資料。 In another implementation, the user can take a photo of the invoice to be redeemed, collect the invoice image of the invoice to be redeemed, and perform image recognition on the collected invoice image on the client or a third-party recognition system to identify Invoice data, and carry the invoice data obtained through image recognition In the redemption request sent by the client, it is sent to the node device in the blockchain to trigger the node device in the blockchain to call the deployed smart contract and redistribute the invoice to be recognized. Therefore, nodes in the blockchain can directly receive invoice data.

其中,對採集到的發票的影像資料進行影像識別,具體可以由部署在區塊鏈中的智慧合約來完成,也可以透過調用第三方的可信服務來完成。 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 it can be completed by calling a third-party trusted service.

在一種實現中,根據影像識別演算法,識別所述發票影像中的發票資料。該實施例中,智慧合約自身具有影像識別的合約邏輯,可以在節點本地識別出發票影像中的發票資料。 In one implementation, the invoice data in the invoice image is recognized 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 recognized locally at the node.

在另一種實現中,所述方法還包括:節點設備也可以透過調用第三方的可信服務(比如第三方的影像識別機構),將防偽驗證請求中的發票影像發送給第三方可信服務,由第三方可信服務基於搭載的影像識別演算法,對發票影像進行影像識別獲取上述發票資料,而節點設備可以獲取所述第三方影像識別機構返回的發票資料。該實施例中,可以將影像識別交由第三方影像識別機構完成,從而降低對節點性能的要求(並非所有節點都可以具備影像識別所需的計算資源)。 In another implementation, 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 calling a third-party trusted service (such as a third-party image recognition agency). The third-party trusted service performs image recognition on the invoice image based on the onboard image recognition algorithm to obtain the above-mentioned invoice data, and the node device can obtain the invoice data returned by the third-party image recognition agency. In this embodiment, image recognition can be completed by a third-party image recognition agency, thereby reducing the requirements for node performance (not all nodes may have the computing resources required for image recognition).

在一實施例中,節點設備在獲取到沖紅請求中的發票資料後,可以調用發布在區塊鏈上的智慧合約中聲明的發票驗證邏輯,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發 票。 In one embodiment, after obtaining the invoice data in the redemption request, the node device can call the invoice verification logic declared in the smart contract published on the blockchain to calculate the digital summary of the redemption invoice. And query whether the target post corresponding to the digital summary is stored in the blockchain ticket.

該實施例計算所述待沖紅的發票的數位摘要是基於智慧合約計算得到的,需要說明的是,也可以是響應於所述沖紅請求的節點設備在本地基於預設演算法計算得到的(不依賴智慧合約);具體可以根據業務需求人為配置或者程式自動選擇。 In this embodiment, the calculation of the digital summary of the redemption invoice is calculated based on a smart contract. It should be noted that it may also be calculated locally based on a preset algorithm by the node device in response to the redemption request. (Does not rely on smart contracts); the specifics can be configured manually or automatically selected by the program according to business needs.

本說明書中,在查詢到所述區塊鏈中儲存了與所述數位摘要對應的目標發票之後,節點設備需要調用發布在區塊鏈上的智慧合約中聲明的沖紅發票開立邏輯,開立針對所述目標發票的沖紅發票,並將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存。 In this manual, after querying that the target invoice corresponding to the digital summary is stored in the blockchain, the node device needs to call the red invoice issuance logic declared in the smart contract published on the blockchain to issue Create a redemption invoice for the target invoice, and store the corresponding relationship between the redemption invoice and the target invoice in the blockchain.

在一實施例中,所述步驟130中開立針對所述目標發票的沖紅發票,具體包括:開立與所述目標發票的發票金額相同的負金額發票。 In an embodiment, issuing a redemption invoice for the target invoice in step 130 specifically includes: issuing a negative invoice with the same invoice amount as the target invoice.

所述將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存,具體包括以下中的任一:建立所述負金額發票與所述目標發票之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票與所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票、所述目標發票、以及所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存。 The storing the corresponding relationship between the redemption invoice and the target invoice in the blockchain specifically includes any one of the following: establishing a mapping relationship between the negative amount invoice and the target invoice , And store the mapping relationship in the blockchain; establish a mapping relationship between the negative amount invoice and the digital summary of the target invoice, and store the mapping relationship in the blockchain Storing; establishing a mapping relationship between the negative amount invoice, the target invoice, and the digital summary of the target invoice, and storing the mapping relationship in the blockchain.

在稅務操作中入帳的發票是不能刪掉的,那麽針對入帳錯誤的發票,實踐中可以再入帳一張與錯誤發票金額相同的負金額的發票,從而抵消該錯誤發票的影響。在區塊鏈中,首先確定待沖紅的發票對於的目標發票,然後可以開立與所述目標發票的發票金額相同的負金額發票;此時的負金額發票雖然開立了但在區塊鏈中還需要建立所述負金額發票與所述目標發票和/或所述目標發票的數位摘要之間的映射關係,如此就可以透過映射關係,確定錯誤發票是否已完成沖紅。 Invoices entered in the tax operation cannot be deleted, so for the incorrectly entered invoice, in practice, you can enter a negative invoice with the same amount as the incorrect invoice to offset the effect of the incorrect invoice. In the blockchain, first determine the target invoice for the red invoice, and then you can issue a negative invoice with the same invoice amount as the target invoice; at this time, the negative invoice is issued in the block The chain also needs to establish a mapping relationship between the negative amount invoice and the target invoice and/or the digital summary of the target invoice, so that the mapping relationship can be used to determine whether the erroneous invoice has been flushed.

如圖2所示,區塊鏈節點在接收到針對待沖紅的發票a的沖紅請求後,可以調用預設的智慧合約,查詢區塊鏈中是否存在這張發票a,即本說明書中所述的目標發票;並在查詢到存在發票a後,在區塊鏈中產生針對發票a的沖紅發票a,以及在區塊鏈上建立該沖紅發票a與發票a之間的映射關係。所述建立的映射關係,可以表示發票a已經被沖紅。所述沖紅發票a是與發票a的發票金額相同的負金額。例如,發票a的發票金額為100元,則沖紅發票a的發票金額為-100元。 As shown in Figure 2, after the blockchain node receives the redemption request for the redemption invoice a, it can call the preset smart contract to query whether the invoice a exists in the blockchain, that is, in this manual The target invoice; and after the existence of the invoice a is queried, a redemption invoice a for the invoice a is generated in the blockchain, and the mapping relationship between the redemption invoice a and the invoice a is established on the blockchain . The established mapping relationship may indicate that the invoice a has been flushed out. The red-red invoice a is the same negative amount as the invoice amount of the 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 manual provides a blockchain-based invoice redemption solution, which is certified by uploading the digital summaries of invoices and invoices to the chain; because the data stored in the blockchain has the characteristics of non-tampering and the unique characteristics of the digital summaries (That is, a digital summary corresponds to one original data); therefore, when an error is found in an invoice, it can be determined based on the digital summary of the invoice stored in the blockchain that the wrong invoice (i.e. the invoice to be redeemed) corresponds to the on-chain Item A standard invoice; in turn, a red-red invoice associated with the target invoice can be issued and the corresponding relationship between the red-red invoice and the target invoice can be stored in the blockchain; in this way, the error of the invoice can be offset The invoice amount.

與前述基於區塊鏈的發票沖紅方法實施例相對應,本說明書還提供了基於區塊鏈的發票沖紅裝置的實施例。所述裝置實施例可以透過軟體實現,也可以透過硬體或者軟硬體結合的方式實現。以軟體實現為例,作為一個邏輯意義上的裝置,是透過其所在設備的處理器將非易失性記憶體中對應的電腦業務程式指令讀取到記憶體中運行形成的。從硬體層面而言,如圖3所示,為本說明書基於區塊鏈的發票沖紅裝置所在設備的一種硬體結構圖,除了圖3所示的處理器、網路介面、記憶體以及非易失性記憶體之外,實施例中裝置所在的設備通常根據基於區塊鏈的發票沖紅實際功能,還可以包括其他硬體,對此不再贅述。 Corresponding to the foregoing embodiment of the blockchain-based invoice redemption method, this specification also provides an embodiment of the blockchain-based invoice redemption device. The device embodiments can be implemented through software, or through hardware or a combination of software and hardware. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer business program instructions in the non-volatile memory into the memory through the processor of the device where it is located. From the perspective of hardware, as shown in Figure 3, a hardware structure diagram of the device where the blockchain-based invoice redemption device is located in this manual, except for the processor, network interface, memory, and In addition to the non-volatile memory, the device where the device is located in the embodiment usually redistributes the actual function based on the blockchain-based invoice, and may also include other hardware, which will not be repeated here.

請參見圖4,為本說明書一實施例提供的基於區塊鏈的發票沖紅裝置的模組圖,所述裝置對應了圖1所示實施例,所述區塊鏈中儲存有發票和發票的數位摘要之間的對應關係,所述裝置包括:接收單元210,接收客戶端提交的針對待沖紅的發票的沖紅請求;查詢單元220,響應於所述沖紅請求,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票;沖紅單元230,如果查詢到所述區塊鏈中儲存了與所 述數位摘要對應的目標發票,調用發布在區塊鏈上的智慧合約中聲明的沖紅發票開立邏輯,開立針對所述目標發票的沖紅發票,並將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存。 Please refer to FIG. 4, which is a block diagram of a block chain-based invoice redemption device provided by an embodiment of this specification. The device corresponds to the embodiment shown in FIG. 1, and the block chain stores invoices and invoices. The apparatus includes: a receiving unit 210, which receives a redemption request for a redemption invoice submitted by a client; and a query unit 220, which calculates the redemption request in response to the redemption request Redistribute the digital summary of the invoice, and query whether the target invoice corresponding to the digital summary is stored in the blockchain; the redemption unit 230, if the query finds that the blockchain stores the relevant The target invoice corresponding to the digital summary is called, the redemption invoice issuance logic declared in the smart contract published on the blockchain is called, the redemption invoice is issued for the target invoice, and the redemption invoice is combined with the redemption invoice. The corresponding relationship of the target invoice is stored in the blockchain.

可選的,所述裝置還包括:開立請求接收單元,接收客戶端提交的發票開立請求;其中,所述發票開立請求包括用戶輸入的發票開立資訊;開立請求響應單元,響應於所述發票開立請求,調用發布在區塊鏈上的智慧合約中聲明的發票開立邏輯,基於所述發票開立資訊開立發票;以及,計算所述發票的數位摘要,並將所述發票和所述發票的數位摘要的對應關係在所述區塊鏈中進行儲存。 Optionally, the device further includes: an issuance request receiving unit that receives an invoice issuance request submitted by the client; wherein the invoice issuance request includes invoice issuance information input by the user; an issuance request response unit that responds In the invoice issuance request, the invoice issuance logic declared in the smart contract published on the blockchain is invoked, and the invoice is issued based on the invoice issuance information; and, the digital summary of the invoice is calculated, and the The corresponding relationship between the invoice and the digital summary of the invoice is stored in the blockchain.

可選的,所述查詢單元220,包括:響應於所述沖紅請求,調用發布在區塊鏈上的智慧合約中聲明的發票驗證邏輯,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票。 Optionally, the query unit 220 includes: in response to the redemption request, invoking the invoice verification logic declared in the smart contract published on the blockchain, calculates the digital summary of the redemption invoice, and Query whether the target invoice corresponding to the digital summary is stored in the blockchain.

可選的,所述發票的數位摘要包括:針對所述發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到的hash值。 Optionally, the digital summary of the invoice includes: the invoice content of the invoice; or, the hash value obtained by hashing the unique information in the invoice content.

可選的,所述沖紅請求包括所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;所述查詢單元220中,計算所述待沖紅的發票的數位 摘要,包括:獲取所述沖紅請求中的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;針對獲取到的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到hash值。 Optionally, the redemption request includes the invoice content of the invoice to be redeemed; or, the unique information in the invoice content; in the query unit 220, the number of the invoice to be redeemed is calculated The summary includes: obtaining the invoice content of the invoice to be redeemed in the redemption request; or, the unique information in the invoice content; and the invoice content for the obtained invoice to be redeemed; Alternatively, the unique information in the invoice content is hashed to obtain a hash value.

可選的,所述區塊鏈為聯盟鏈。 Optionally, the blockchain is a consortium chain.

可選的,所述沖紅單元230中,開立針對所述目標發票的沖紅發票,具體包括:開立與所述目標發票的發票金額相同的負金額發票。 Optionally, in the redemption unit 230, issuing a redemption invoice for the target invoice specifically includes: issuing a negative amount invoice that is the same as the invoice amount of the target invoice.

可選的,所述沖紅單元230中,將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存,具體包括以下中的任一:建立所述負金額發票與所述目標發票之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票與所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票、所述目標發票、以及所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存。 Optionally, in the redemption unit 230, the corresponding relationship between the redemption invoice and the target invoice is stored in the blockchain, which specifically includes any one of the following: creating the negative amount invoice The mapping relationship between the target invoice and the target invoice, and the mapping relationship is stored in the blockchain; the mapping relationship between the negative amount invoice and the digital summary of the target invoice is established, and the The mapping relationship is stored in the block chain; the mapping relationship between the negative amount invoice, the target invoice, and the digital summary of the target invoice is established, and the mapping relationship is stored in the block Store in the chain.

上述實施例闡明的系統、裝置、模組或單元,具體可以由電腦晶片或實體實現,或者由具有某種功能的產品來實現。一種典型的實現設備為電腦,電腦的具體形式可以是個人電腦、膝上型電腦、蜂巢式電話、相機電話、智慧 電話、個人數位助理、媒體播放器、導航設備、電子郵件收發設備、遊戲控制台、平板電腦、穿戴式設備或者這些設備中的任意幾種設備的組合。 The systems, devices, modules, or units explained in the above embodiments may be implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. The specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, and a smart phone. Phones, personal digital assistants, media players, navigation devices, email receiving and sending devices, game consoles, tablets, wearable devices, or a combination of any of these devices.

上述裝置中各個單元的功能和作用的實現過程具體詳見上述方法中對應步驟的實現過程,在此不再贅述。 For the implementation process of the functions and roles of each unit in the above-mentioned device, please refer to the implementation process of the corresponding steps in the above-mentioned 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 refer to the part of the description of the method embodiment. The device embodiments described above are merely illustrative. 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, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in this specification. Those of ordinary skill in the art can understand and implement without creative work.

以上圖4描述了基於區塊鏈的發票沖紅裝置的內部功能模組和結構示意,其實質上的執行主體可以為一種電子設備,包括:處理器;用於儲存處理器可執行指令的記憶體;其中,所述處理器被配置為:接收客戶端提交的針對待沖紅的發票的沖紅請求;響應於所述沖紅請求,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票;其中,所述區塊鏈中儲存有發票和發票的 數位摘要之間的對應關係;如果查詢到所述區塊鏈中儲存了與所述數位摘要對應的目標發票,調用發布在區塊鏈上的智慧合約中聲明的沖紅發票開立邏輯,開立針對所述目標發票的沖紅發票,並將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存。 The above Figure 4 depicts the internal functional modules and structure of the blockchain-based invoice redemption device. The actual execution body can be an electronic device, including: a processor; a memory used to store executable instructions of the processor Body; wherein the processor is configured to: receive a redemption request submitted by the client for an invoice to be redeemed; in response to the redemption request, calculate a digital summary of the redemption invoice, and query Whether the target invoice corresponding to the digital summary is stored in the block chain; wherein, the block chain stores invoices and invoices Correspondence between the digital summaries; if the target invoice corresponding to the digital summaries is stored in the block chain, call the red-red invoice issuance logic declared in the smart contract published on the block chain to issue Create a redemption invoice for the target invoice, and store the corresponding relationship between the redemption invoice and the target invoice in the blockchain.

可選的,還包括:接收客戶端提交的發票開立請求;其中,所述發票開立請求包括用戶輸入的發票開立資訊;響應於所述發票開立請求,調用發布在區塊鏈上的智慧合約中聲明的發票開立邏輯,基於所述發票開立資訊開立發票;以及,計算所述發票的數位摘要,並將所述發票和所述發票的數位摘要的對應關係在所述區塊鏈中進行儲存。 Optionally, it further includes: receiving an invoice issuance request submitted by the client; wherein, the invoice issuance request includes the invoice issuance information input by the user; in response to the invoice issuance request, calling and publishing on the blockchain The invoice issuance logic declared in the smart contract is to issue an invoice based on the invoice issuance information; and, calculate the digital summary of the invoice, and put the corresponding relationship between the invoice and the digital summary of the invoice in the Store in the blockchain.

可選的,所述響應於所述沖紅請求,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票,包括:響應於所述沖紅請求,調用發布在區塊鏈上的智慧合約中聲明的發票驗證邏輯,計算所述待沖紅的發票的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票。 Optionally, in response to the redemption request, calculating a digital summary of the invoice to be redeemed, and querying whether the target invoice corresponding to the digital summary is stored in the blockchain includes: responding In the redemption request, call the invoice verification logic declared in the smart contract published on the blockchain, calculate the digital summary of the redemption invoice, and query whether the blockchain is stored with the The target invoice corresponding to the digital summary.

可選的,所述發票的數位摘要包括:針對所述發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到的hash值。 Optionally, the digital summary of the invoice includes: the invoice content of the invoice; or, the hash value obtained by hashing the unique information in the invoice content.

可選的,所述沖紅請求包括所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;所述計算所述待沖紅的發票的數位摘要,包括:獲取所述沖紅請求中的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;針對獲取到的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到hash值。 Optionally, the redemption request includes the invoice content of the invoice to be redeemed; or, unique information in the invoice content; and the calculation of the digital summary of the invoice to be redeemed includes: obtaining The invoice content of the invoice to be redeemed in the redemption request; or, the unique information in the invoice content; the invoice content for the obtained invoice to be redeemed; or, the invoice The unique information in the content is hashed to obtain the hash value.

可選的,所述區塊鏈為聯盟鏈。 Optionally, the blockchain is a consortium chain.

可選的,所述開立針對所述目標發票的沖紅發票,具體包括:開立與所述目標發票的發票金額相同的負金額發票。 Optionally, the issuance of a redemption invoice for the target invoice specifically includes: issuance of a negative invoice with the same invoice value as the target invoice.

可選的,所述將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存,具體包括以下中的任一:建立所述負金額發票與所述目標發票之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票與所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票、所述目標發票、以及所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存。 Optionally, the storing the corresponding relationship between the redemption invoice and the target invoice in the blockchain specifically includes any one of the following: establishing a relationship between the negative amount invoice and the target invoice And store the mapping relationship in the blockchain; establish the mapping relationship between the negative amount invoice and the digital summary of the target invoice, and store the mapping relationship in the Storing in the blockchain; establishing a mapping relationship between the negative amount invoice, the target invoice, and the digital summary of the target invoice, and storing the mapping relationship in the blockchain.

在上述電子設備的實施例中,應理解,該處理器可以是中央處理單元(英文:Central Processing Unit,簡稱:CPU),還可以是其他通用處理器、數位信號處理器(英 文:Digital Signal Processor,簡稱:DSP)、專用積體電路(英文:Application Specific Integrated Circuit,簡稱:ASIC)等。通用處理器可以是微處理器或者該處理器也可以是任何常規的處理器等,而前述的記憶體可以是唯讀記憶體(英文:read-only memory,縮寫:ROM)、隨機存取記憶體(英文:random access memory,簡稱:RAM)、快閃記憶體、硬碟或者固態硬碟。結合本發明實施例所公開的方法的步驟可以直接體現為硬體處理器執行完成,或者用處理器中的硬體及軟體模組組合執行完成。 In the above embodiment 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 may be other general-purpose processors, digital signal processors (English: Central Processing Unit, CPU for short), Text: Digital Signal Processor, referred to as DSP), dedicated integrated circuit (English: Application Specific Integrated Circuit, referred to as ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., and the aforementioned memory can be read-only memory (English: read-only memory, abbreviation: ROM), random access memory Body (English: random access memory, abbreviated as: RAM), flash memory, hard disk or solid state drive. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.

本說明書中的各個實施例均採用漸進的方式描述,各個實施例之間相同相似的部分互相參見即可,每個實施例重點說明的都是與其他實施例的不同之處。尤其,對於電子設備實施例而言,由於其基本相似於方法實施例,所以描述的比較簡單,相關之處參見方法實施例的部分說明即可。 The various embodiments in this specification are described in a gradual manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the electronic device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.

本領域技術人員在考慮說明書及實踐這裡公開的發明後,將容易想到本說明書的其它實施方案。本說明書旨在涵蓋本說明書的任何變型、用途或者適應性變化,這些變型、用途或者適應性變化遵循本說明書的一般性原理並包括本說明書未公開的本技術領域中的公知常識或慣用技術手段。說明書和實施例僅被視為示例性的,本說明書的真正範圍和精神由下面的申請專利範圍指出。 After considering the specification and practicing the invention disclosed herein, those skilled in the art will easily think of other embodiments of the specification. This specification is intended to cover any variations, uses, or adaptive changes of this specification. These variations, uses, or adaptive changes follow the general principles of this specification and include common knowledge or conventional technical means in the technical field that are not disclosed in this specification. . The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the specification are pointed out by the following patent application scope.

應當理解的是,本說明書並不局限於上面已經描述並在圖式中示出的精確結構,並且可以在不脫離其範圍進行 各種修改和改變。本說明書的範圍僅由所附的申請專利範圍來限制。 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 can be carried out without departing from its scope. Various modifications and changes. The scope of this specification is only limited by the scope of the attached patent application.

Claims (15)

一種基於區塊鏈的發票沖紅方法,所述區塊鏈中儲存有發票和發票的數位摘要之間的對應關係,所述方法包括:接收客戶端提交的針對待沖紅的發票的沖紅請求,其中,所述沖紅請求包括對待沖紅的發票進行拍照所採集到的發票影像;響應於所述沖紅請求,調用發布在區塊鏈上的智慧合約中聲明的影像識別邏輯,根據影像識別演算法,識別出所述發票影像的發票資料;以及發票驗證邏輯,計算所述發票資料對應的數位摘要,並查詢所述區塊鏈中是否儲存了與所述數位摘要對應的目標發票;如果查詢到所述區塊鏈中儲存了與所述數位摘要對應的目標發票,調用發布在區塊鏈上的智慧合約中聲明的沖紅發票開立邏輯,開立針對所述目標發票的沖紅發票,並將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存。 A method for redemption of invoices based on a blockchain, wherein the corresponding relationship between the invoice and the digital summary of the invoice is stored in the blockchain, and the method includes: receiving redemption of the invoice submitted by the client for the redemption of the invoice Request, wherein the redemption request includes an image of the invoice collected by taking a photo of the invoice to be redacted; in response to the redemption request, the image recognition logic declared in the smart contract published on the blockchain is invoked, according to The image recognition algorithm identifies the invoice data of the invoice image; and the invoice verification logic calculates the digital summary corresponding to the invoice data, and queries whether the target invoice corresponding to the digital summary is stored in the blockchain ; If it is queried that the target invoice corresponding to the digital summary is stored in the blockchain, call the red-red invoice issuance logic declared in the smart contract published on the blockchain to issue an invoice for the target invoice Flushing the red invoice, and storing the corresponding relationship between the red red invoice and the target invoice in the blockchain. 根據申請專利範圍第1項所述的方法,所述方法還包括:接收客戶端提交的發票開立請求;其中,所述發票開立請求包括用戶輸入的發票開立資訊;響應於所述發票開立請求,調用發布在區塊鏈上的智 慧合約中聲明的發票開立邏輯,基於所述發票開立資訊開立發票;以及,計算所述發票的數位摘要,並將所述發票和所述發票的數位摘要的對應關係在所述區塊鏈中進行儲存。 According to the method described in item 1 of the scope of patent application, the method further includes: receiving an invoice issuance request submitted by a client; wherein the invoice issuance request includes invoice issuance information input by the user; in response to the invoice Open a request and call the smart card published on the blockchain The invoice issuance logic declared in the smart contract is to issue an invoice based on the invoice issuance information; and, calculate the digital summary of the invoice, and place the correspondence between the invoice and the digital summary of the invoice in the area Store in the block chain. 根據申請專利範圍第2項所述的方法,其中所述發票的數位摘要包括:針對所述發票的發票內容;或者,所述發票內容中的唯一性資訊進行雜湊(hash)計算得到的hash值。 According to the method described in item 2 of the scope of patent application, the digital summary of the invoice includes: the invoice content of the invoice; or, the hash value obtained by hashing the unique information in the invoice content . 根據申請專利範圍第3項所述的方法,其中所述沖紅請求包括所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;所述計算所述待沖紅的發票的數位摘要,包括:獲取所述沖紅請求中的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;針對獲取到的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到hash值。 The method according to item 3 of the scope of patent application, wherein the redemption request includes the invoice content of the invoice to be redeemed; or, the unique information in the invoice content; the calculation of the redemption The digital summary of the invoice, including: obtaining the invoice content of the invoice to be redeemed in the redemption request; or, the unique information in the invoice content; for the obtained invoice to be redeemed The content of the invoice; or, the unique information in the content of the invoice is hashed to obtain the hash value. 根據申請專利範圍第1項所述的方法,其中所述區塊鏈為聯盟鏈。 According to the method described in item 1 of the scope of patent application, the blockchain is a consortium chain. 根據申請專利範圍第1項所述的方法,其中所述開立針對所述目標發票的沖紅發票,具體包括: 開立與所述目標發票的發票金額相同的負金額發票。 According to the method described in item 1 of the scope of patent application, the issuance of a redemption invoice for the target invoice specifically includes: Issue a negative amount invoice that is the same as the invoice amount of the target invoice. 根據申請專利範圍第6項所述的方法,其中所述將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存,具體包括以下中的任一:建立所述負金額發票與所述目標發票之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票與所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票、所述目標發票、以及所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存。 The method according to item 6 of the scope of patent application, wherein the storing the correspondence between the redemption invoice and the target invoice in the blockchain specifically includes any one of the following: establishing the A mapping relationship between a negative amount invoice and the target invoice, and storing the mapping relationship in the blockchain; establishing a mapping relationship between the negative amount invoice and the digital summary of the target invoice, And store the mapping relationship in the blockchain; establish the mapping relationship between the negative amount invoice, the target invoice, and the digital summary of the target invoice, and store the mapping relationship in the Store in the block chain. 一種基於區塊鏈的發票沖紅裝置,所述區塊鏈中儲存有發票和發票的數位摘要之間的對應關係,所述裝置包括:接收單元,接收客戶端提交的針對待沖紅的發票的沖紅請求,其中,所述沖紅請求包括對待沖紅的發票進行拍照所採集到的發票影像;查詢單元,響應於所述沖紅請求,調用發布在區塊鏈上的智慧合約中聲明的影像識別邏輯,根據影像識別演算法,識別出所述發票影像的發票資料;以及發票驗證邏輯,計算所述發票資料對應的數位摘要,並查詢所述區塊 鏈中是否儲存了與所述數位摘要對應的目標發票;沖紅單元,如果查詢到所述區塊鏈中儲存了與所述數位摘要對應的目標發票,調用發布在區塊鏈上的智慧合約中聲明的沖紅發票開立邏輯,開立針對所述目標發票的沖紅發票,並將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存。 A block chain-based invoice redemption device, wherein the corresponding relationship between the invoice and the digital summary of the invoice is stored in the block chain, and the device includes: a receiving unit for receiving an invoice submitted by a client for redemption Redemption request, wherein the redemption request includes the invoice image collected by taking a photo of the invoice to be redeemed; the query unit, in response to the redemption request, calls the statement in the smart contract published on the blockchain The image recognition logic of, according to the image recognition algorithm, recognizes the invoice data of the invoice image; and the invoice verification logic, calculates the digital summary corresponding to the invoice data, and queries the block Whether the target invoice corresponding to the digital summary is stored in the chain; the redemption unit, if the target invoice corresponding to the digital summary is stored in the blockchain, call the smart contract published on the blockchain The redemption invoice issuance logic stated in, issues a redemption invoice for the target invoice, and stores the corresponding relationship between the redemption invoice and the target invoice in the blockchain. 根據申請專利範圍第8項所述的裝置,所述裝置還包括:開立請求接收單元,接收客戶端提交的發票開立請求;其中,所述發票開立請求包括用戶輸入的發票開立資訊;開立請求響應單元,響應於所述發票開立請求,調用發布在區塊鏈上的智慧合約中聲明的發票開立邏輯,基於所述發票開立資訊開立發票;以及,計算所述發票的數位摘要,並將所述發票和所述發票的數位摘要的對應關係在所述區塊鏈中進行儲存。 According to the device described in item 8 of the scope of patent application, the device further includes: an issuance request receiving unit that receives an invoice issuance request submitted by the client; wherein the invoice issuance request includes the invoice issuance information input by the user The issuance request response unit, in response to the invoice issuance request, calls the invoice issuance logic declared in the smart contract published on the blockchain, and issues an invoice based on the invoice issuance information; and, calculates the The digital summary of the invoice, and the corresponding relationship between the invoice and the digital summary of the invoice is stored in the blockchain. 根據申請專利範圍第9項所述的裝置,其中所述發票的數位摘要包括:針對所述發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到的hash值。 The device according to item 9 of the scope of patent application, wherein the digital summary of the invoice includes: the invoice content of the invoice; or, the hash value obtained by hashing the unique information in the invoice content. 根據申請專利範圍第10項所述的裝置,其中所述沖紅 請求包括所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;所述查詢單元中,計算所述待沖紅的發票的數位摘要,包括:獲取所述沖紅請求中的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊;針對獲取到的所述待沖紅的發票的發票內容;或者,所述發票內容中的唯一性資訊進行hash計算得到hash值。 The device according to item 10 of the scope of patent application, wherein the flushing The request includes the invoice content of the invoice to be redeemed; or, the unique information in the invoice content; in the query unit, calculating the digital summary of the invoice to be redeemed includes: obtaining the redemption The invoice content of the invoice to be redeemed in the request; or, the unique information in the invoice content; the invoice content for the obtained invoice to be redeemed; or, the only one in the invoice content Sex information is hashed to get the hash value. 根據申請專利範圍第8項所述的裝置,其中所述區塊鏈為聯盟鏈。 The device according to item 8 of the scope of patent application, wherein the blockchain is a consortium chain. 根據申請專利範圍第8項所述的裝置,其中所述沖紅單元中,開立針對所述目標發票的沖紅發票,具體包括:開立與所述目標發票的發票金額相同的負金額發票。 According to the device described in item 8 of the scope of patent application, in the redemption unit, issuing redemption invoices for the target invoice specifically includes: issuing a negative amount invoice with the same invoice amount as the target invoice . 根據申請專利範圍第13項所述的裝置,其中所述沖紅單元中,將所述沖紅發票與所述目標發票的對應關係在所述區塊鏈中進行儲存,具體包括以下中的任一:建立所述負金額發票與所述目標發票之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存;建立所述負金額發票與所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存; 建立所述負金額發票、所述目標發票、以及所述目標發票的數位摘要之間的映射關係,並將所述映射關係在所述區塊鏈中進行儲存。 The device according to item 13 of the scope of patent application, wherein in the redemption unit, the corresponding relationship between the redemption invoice and the target invoice is stored in the blockchain, which specifically includes any of the following One: Establish a mapping relationship between the negative amount invoice and the target invoice, and store the mapping relationship in the blockchain; establish a digital summary of the negative amount invoice and the target invoice And store the mapping relationship in the blockchain; A mapping relationship between the negative amount invoice, the target invoice, and the digital summary of the target invoice is established, and the mapping relationship is stored in the blockchain. 一種電子設備,包括:處理器;用於儲存處理器可執行指令的記憶體;其中,所述處理器被配置為上述申請專利範圍第1-7項中任一項所述的方法。 An electronic device comprising: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured as the method described in any one of items 1-7 in the scope of the aforementioned patent application.
TW108137039A 2018-12-25 2019-10-15 Block chain-based invoice redemption method and device and electronic equipment TWI734217B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811593717.6 2018-12-25
CN201811593717.6A CN110020900A (en) 2018-12-25 2018-12-25 Invoice based on block chain rushes red method and device and electronic equipment

Publications (2)

Publication Number Publication Date
TW202026971A TW202026971A (en) 2020-07-16
TWI734217B true TWI734217B (en) 2021-07-21

Family

ID=67188681

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108137039A TWI734217B (en) 2018-12-25 2019-10-15 Block chain-based invoice redemption method and device and electronic equipment

Country Status (3)

Country Link
CN (1) CN110020900A (en)
TW (1) TWI734217B (en)
WO (1) WO2020134606A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020900A (en) * 2018-12-25 2019-07-16 阿里巴巴集团控股有限公司 Invoice based on block chain rushes red method and device and electronic equipment
CN110443612B (en) * 2019-07-31 2020-12-22 创新先进技术有限公司 Block chain-based reimbursement expense segmentation method and device and electronic equipment
CN110458538B (en) * 2019-07-31 2021-09-24 创新先进技术有限公司 State machine maintenance method and device based on block chain, electronic equipment and storage medium
CN110471985A (en) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 Electronic bill based on block chain cancels method and device, electronic equipment
US11250438B2 (en) 2019-07-31 2022-02-15 Advanced New Technologies Co., Ltd. Blockchain-based reimbursement splitting
CN112465575A (en) * 2019-09-09 2021-03-09 辽宁政税科技有限公司 Invoice management system and method based on block chain technology
CN111984734A (en) * 2020-09-02 2020-11-24 深圳壹账通智能科技有限公司 Data processing method, device and equipment based on block chain and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107451874A (en) * 2017-07-27 2017-12-08 武汉天喻信息产业股份有限公司 Electronic invoice integrated conduct method and system based on block chain
US20180075527A1 (en) * 2016-09-14 2018-03-15 Royal Bank Of Canada Credit score platform
CN108305106A (en) * 2018-01-31 2018-07-20 复旦大学 A kind of electronic invoice register method based on block chain
US20180268479A1 (en) * 2016-07-01 2018-09-20 Wells Fargo Bank, N.A. International trade finance blockchain system
CN108648066A (en) * 2018-04-28 2018-10-12 济南浪潮高新科技投资发展有限公司 A kind of managing bill system and method based on block chain
CN108922012A (en) * 2018-07-11 2018-11-30 北京大账房网络科技股份有限公司 The invoice checking method of raw information is not revealed based on block chain technology

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106997554A (en) * 2016-01-26 2017-08-01 航天信息股份有限公司 A kind of credit note information table processing method and processing system
US10657225B2 (en) * 2016-12-29 2020-05-19 Red Hat, Inc. Providing blockchain-based subscription-as-a-service management
CN106952124A (en) * 2017-03-16 2017-07-14 北京牛链科技有限公司 Electronic bill management system and method based on distribution book keeping operation
CN108242000A (en) * 2017-10-27 2018-07-03 北京车和家信息技术有限公司 Invoice management method, system, computer installation and computer readable storage medium
CN108961030B (en) * 2018-08-15 2023-01-03 深圳市智税链科技有限公司 Data processing method, apparatus, system, medium, and device for electronic ticket
CN110020900A (en) * 2018-12-25 2019-07-16 阿里巴巴集团控股有限公司 Invoice based on block chain rushes red method and device and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180268479A1 (en) * 2016-07-01 2018-09-20 Wells Fargo Bank, N.A. International trade finance blockchain system
US20180075527A1 (en) * 2016-09-14 2018-03-15 Royal Bank Of Canada Credit score platform
CN107451874A (en) * 2017-07-27 2017-12-08 武汉天喻信息产业股份有限公司 Electronic invoice integrated conduct method and system based on block chain
CN108305106A (en) * 2018-01-31 2018-07-20 复旦大学 A kind of electronic invoice register method based on block chain
CN108648066A (en) * 2018-04-28 2018-10-12 济南浪潮高新科技投资发展有限公司 A kind of managing bill system and method based on block chain
CN108922012A (en) * 2018-07-11 2018-11-30 北京大账房网络科技股份有限公司 The invoice checking method of raw information is not revealed based on block chain technology

Also Published As

Publication number Publication date
TW202026971A (en) 2020-07-16
WO2020134606A1 (en) 2020-07-02
CN110020900A (en) 2019-07-16

Similar Documents

Publication Publication Date Title
TWI734217B (en) Block chain-based invoice redemption method and device and electronic equipment
TWI714308B (en) Block chain-based invoice authenticity verification method and device and electronic equipment
WO2020134575A1 (en) Blockchain-based resource allocation method and apparatus, and electronic device
WO2020119287A1 (en) Blockchain-based invoice creation method and apparatus, and electronic device
WO2020119286A1 (en) Blockchain-based invoice creating method and apparatus, and electronic device
JP6975101B2 (en) Methods, devices and non-temporary computer-readable storage media for transaction execution and validation in the blockchain (transaction execution and validation in the blockchain)
US10733176B2 (en) Detecting phantom items in distributed replicated database
US11693840B2 (en) Database storing authenticated skill-based attributes
TW201937436A (en) Blockchain based transaction execution method and device and electronic equipment
TWI709934B (en) Block chain-based invoice creation method and device, and electronic equipment
KR20180115778A (en) Integrated block chain-based data transfer control method and system
WO2020220764A1 (en) Blockchain-based data compression and query method and apparatus, and electronic device
WO2020220740A1 (en) Blockchain-based invoice creation method, apparatus and electronic device
JP2022504353A (en) Blockchain Timestamp Agreement
WO2020155811A1 (en) Block chain intelligent contract execution method, device and electronic apparatus
TWI717660B (en) Method and device for generating capital flow report and electronic equipment
US11087371B2 (en) Blockchain-based invoice creation method apparatus, and electronic device
US11032083B2 (en) Atomic transactional processing
US20200082349A1 (en) Blockchain Timeclock System
WO2020119302A1 (en) Blockchain-based invoice creation method and apparatus, and electronic device
EP3905172A1 (en) Blockchain-based invoice voiding method and apparatus, and electronic device
TWI706348B (en) Method and device for detecting fund transaction path in electronic payment process
WO2024060759A1 (en) Supply chain financial asset auditing method and apparatus, and device and medium
WO2023201359A2 (en) Method, controller, and computer readable medium for detecting expiration of a unique cryptographic identifier on a distributed transfer network
EP4348441A1 (en) Systems and methods for ensuring quality of search system data