WO2020119287A1 - Blockchain-based invoice creation method and apparatus, and electronic device - Google Patents

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

Info

Publication number
WO2020119287A1
WO2020119287A1 PCT/CN2019/113422 CN2019113422W WO2020119287A1 WO 2020119287 A1 WO2020119287 A1 WO 2020119287A1 CN 2019113422 W CN2019113422 W CN 2019113422W WO 2020119287 A1 WO2020119287 A1 WO 2020119287A1
Authority
WO
WIPO (PCT)
Prior art keywords
invoice
transaction
blockchain
target transaction
information
Prior art date
Application number
PCT/CN2019/113422
Other languages
French (fr)
Chinese (zh)
Inventor
段金明
孙震
阚文虎
肖汉松
杜华兵
邓福喜
陈锐
潘强
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2020119287A1 publication Critical patent/WO2020119287A1/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
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/12Accounting
    • G06Q40/123Tax preparation or submission

Definitions

  • One or more embodiments of this specification relate to the field of blockchain technology, and in particular to a blockchain-based invoice creation method and device, and electronic equipment.
  • Blockchain technology also known as distributed ledger technology, is an emerging technology in which several computing devices jointly participate in "bookkeeping" and jointly maintain a complete distributed database.
  • Blockchain technology has the characteristics of decentralization, openness and transparency, each computing device can participate in database records, and data synchronization can be quickly performed between computing devices, making blockchain technology widely used in many fields. To apply.
  • one or more embodiments of this specification provide a blockchain-based invoice creation method and device, and electronic equipment.
  • a blockchain-based invoice creation method is proposed, which is applied to blockchain nodes.
  • the method includes:
  • a blockchain-based invoice creation device which is applied to a blockchain node.
  • the device includes:
  • the first receiving unit receives an invoice creation request submitted by a user through a client; wherein the invoice creation request includes a transaction identifier and invoice creation information input by the user;
  • a determining unit in response to the invoice creation request, determining whether a target transaction corresponding to the transaction identifier is deposited on the blockchain; and, at least one piece of key information for indicating that the target transaction is a valid transaction ;
  • the creation unit if it is determined that the target transaction and the key information are stored on the blockchain, call the invoice creation logic declared in the smart contract, create an invoice for the target transaction based on the invoice creation information, and The created invoice is posted to the blockchain.
  • an electronic device including:
  • Memory for storing processor executable instructions
  • the processor executes the executable instruction to implement the method as described in any one of the above embodiments.
  • FIG. 1 is a flowchart of a blockchain-based invoice creation method provided by an exemplary embodiment.
  • FIG. 2 is a schematic diagram of the overall architecture of an invoice creation solution provided by an exemplary embodiment.
  • FIG. 3 is a schematic diagram of interaction of transaction on-chain provided by an exemplary embodiment.
  • FIG. 4 is a flowchart of a blockchain-based invoice creation method provided by an exemplary embodiment.
  • FIG. 5 is a flowchart of a blockchain-based invoice declaration method provided by an exemplary embodiment.
  • FIG. 6 is a schematic structural diagram of an apparatus provided by an exemplary embodiment.
  • FIG. 7 is a block diagram of a blockchain-based invoice creation device provided by an exemplary embodiment.
  • the steps of the corresponding method are not necessarily performed in the order shown and described in this specification.
  • the method may include more or fewer steps than described in this specification.
  • the single step described in this specification may be decomposed into multiple steps for description in other embodiments; and the multiple steps described in this specification may also be combined into a single step in other embodiments. description.
  • FIG. 1 is a flowchart of a blockchain-based invoice creation method provided by an exemplary embodiment. As shown in Figure 1, this method is applied to blockchain nodes and can include the following steps:
  • Step 102 Receive an invoice creation request submitted by a user through a client; wherein the invoice creation request includes a transaction identifier and invoice creation information input by the user.
  • the client may be any type of electronic device such as a mobile phone, tablet computer, smart watch, etc. used by the transaction participants, which is not limited in this specification. Participants in the transaction can interact with the blockchain nodes connected to the electronic device by logging in the registered account on the electronic device.
  • the transaction participant may send a record request to the blockchain node through the client to enable the blockchain node to publish the transaction information of the transaction to the blockchain.
  • the transaction information may include transaction identification, transaction platform, transaction amount, transaction content, transaction participants, transaction time, etc.
  • this specification does not limit the specific content of the transaction information.
  • Step 104 In response to the invoice creation request, determine whether a target transaction corresponding to the transaction identifier is deposited on the blockchain; and, at least one piece of key information for indicating that the target transaction is a valid transaction .
  • the blockchain it is possible to find whether there is a corresponding target transaction on the blockchain based on the transaction identifier. In other words, it is necessary to determine whether the transaction corresponding to the transaction identifier exists objectively. Further, if the target transaction is stored on the blockchain, it is necessary to further determine whether the target transaction is a valid transaction; if so, call the invoice creation logic declared in the smart contract. By determining that the target transaction is an objectively existing transaction, and further determining whether the target transaction is a valid transaction (it can be understood that the target transaction is a transaction that has actually occurred), it can effectively prevent users from invoicing.
  • At least one kind of key information of the target transaction stored on the blockchain can be used.
  • a transaction participant completes a transaction, in addition to the transaction information, it can also send at least one kind of key information indicating that the transaction is a valid transaction to the blockchain node, so that the blockchain node uses the key Information is posted to the blockchain.
  • the blockchain node can publish the transaction information and key information of the transaction on the blockchain in association. Based on the above deposit of key information of the transaction, in one case, it can be determined whether at least one piece of key information indicating that the target transaction is a valid transaction is stored on the blockchain, and if so, the target transaction can be determined as Effective transaction.
  • the target transaction it may be determined whether at least one piece of key information indicating that the target transaction is a valid transaction is stored on the blockchain. If it is determined that the at least one piece of key information is stored on the blockchain, it may be It is further determined whether the various key information in the at least one key information is complete, and if so, the target transaction can be determined to be a valid transaction, and then the invoice creation logic declared in the smart contract can be called.
  • the at least one piece of key information may include at least one of the following: order records, logistics records, payment records corresponding to the target transaction; and identity information of the participant corresponding to the target transaction.
  • the above-mentioned operation to determine whether the target transaction is a valid transaction can be performed by the blockchain node itself, or it can be a smart contract (declared with verification logic, which is used to determine whether any transaction is pre-deployed on the blockchain) For effective transactions), this manual does not limit this.
  • Step 106 if it is determined that the target transaction and the key information are stored on the blockchain, call the invoice creation logic declared in the smart contract, create an invoice for the target transaction based on the invoice creation information, and The created invoice is posted to the blockchain.
  • the invoice creation information may include the header information of the invoice and the transaction information of the transaction corresponding to the transaction identifier (entered by the user), and the blockchain node receives the transaction included in the invoice creation information after receiving the invoice creation request The information is compared with the transaction information (corresponding to the transaction identifier) stored on the blockchain. When the comparison result is consistent, the invoice is directly created for the target transaction based on the transaction information and header information contained in the invoice creation information.
  • the blockchain node After receiving the invoice creation request, the blockchain node reads the transaction information contained in the invoice creation information and calculates the first hash value, and then compares the first hash value with the transaction information stored on the blockchain (Corresponding to the transaction identifier) the second hash value is compared, when the first hash value and the second hash value are equal, it can be determined that the transaction information entered by the user is the transaction information of the target transaction, then it can be directly The transaction information and header information entered by the user creates an invoice for the target transaction without reading the transaction information of the target transaction on the blockchain.
  • the invoice creation information may include only the header information of the invoice.
  • the blockchain node After receiving the invoice creation request and determining that there is a target transaction on the blockchain, the blockchain node further reads the certificate on the blockchain The transaction information of the target transaction, and then create an invoice for the target transaction based on the read transaction information and the header information of the invoice.
  • the target transaction after the invoice is created for the target transaction, the target transaction can be further marked as invoice created.
  • a field can be added to the field of the target transaction for certificate registration to mark the invoice creation status, and the invoice creation status of the target transaction can also be associated and stored on the blockchain. This specification does not limit this.
  • a smart contract can be deployed for tax declaration of the invoice, so as to realize the tax declaration of the invoice based on the blockchain. Therefore, the blockchain node can receive the tax declaration request submitted by the user through the client (the tax declaration request includes the invoice identifier), and in response to the tax declaration request, call the invoice declaration logic declared in the smart contract, based on the blockchain.
  • the invoice corresponding to the invoice identification is certified to complete the tax declaration.
  • the invoice corresponding to the invoice identifier can be marked as declared. Among them, you can add a field in the field of the certificate invoice to mark the invoice declaration status, or you can additionally link the certificate invoice declaration status of the transaction on the blockchain.
  • the above-mentioned blockchain can be an alliance chain, and the member nodes of the alliance chain can include a payment platform and a tax authority.
  • the tax authority can act as a supervisor to view information such as transactions and invoices on the blockchain.
  • FIG. 2 is a schematic diagram of the overall architecture of an invoice creation solution provided by an exemplary embodiment.
  • the client 21 can send a recording request to the server 22 to enable the server 22 to publish the transaction information of the transaction to the blockchain.
  • the client 21 can send an invoice creation request to the server 22, and after receiving the invoice creation request (including the transaction identifier and the invoice creation information input by the user), the server 22 Determine whether there is a target transaction corresponding to the transaction ID on the blockchain, and call the invoice creation logic declared in the smart contract to create an invoice for the target transaction when the target transaction is stored on the blockchain. Of invoices are posted to the blockchain.
  • FIG. 3 is a schematic diagram of interaction of transaction on-chain provided by an exemplary embodiment. As shown in FIG. 3, the interaction process may include the following steps:
  • step 302 a binding relationship is established between the client 21 and the server 22.
  • the binding relationship to be established is the binding relationship between the identity information of the transaction participant and the device information of the client 21. Based on the binding relationship, when the server 22 receives the transaction record request, the invoice creation request, and the tax declaration request subsequently sent by the client 21, it can confirm that these requests correspond to the transaction participant.
  • the transaction participant may register an account with the server 22 in advance to obtain a registered account uniquely corresponding to itself. Then, the transaction participant can log in to the registered account on the client 21, and the server 22 determines the registered account (corresponding to the transaction participant) and the client based on the login information of the registered account on the client 21 21 established a binding relationship.
  • step 304 the client 21 signs the recorded transaction and key information.
  • the client 21 may submit a transaction record request to the server 22, so that the server 22 publishes the transaction information to be recorded and the key information of the transaction to the blockchain in.
  • the transaction participants can register in advance to obtain a unique corresponding digital identity, which is characterized by a set of public and private key pairs.
  • the client 21 can generate a transaction record request (including transaction information and key information) and pass the private key corresponding to the digital identity of the transaction participant Sign the transaction record request.
  • step 306 the client 21 submits a transaction record request to the server 22.
  • step 308 the server 22 verifies the signature.
  • a blockchain client runs on the server 22, so that the server 22 is configured as a blockchain node.
  • the server 22 may determine the identity of the transaction participant based on the binding relationship established in the above step 302, so that the public key corresponding to the transaction participant may be checked to determine that the transaction record request has been issued.
  • the transaction participant authorizes it, and it is not sent by a criminal who pretends to be the identity of the transaction participant.
  • step 310 the server 22 publishes the transaction information and key information in association with the blockchain.
  • transaction information may include transaction identification, transaction platform, transaction amount, transaction content, transaction participants, transaction time, etc.
  • key information may include order records, logistics records, payment records, identity information of transaction participants, etc.
  • the order information can be the contract signed between the transaction participants, the details of the transaction objects (such as commodities, technical support, etc.);
  • the logistics record can be the logistics information of the transaction object;
  • the payment record can be the transaction participants Payment and collection details, the name of the account opening bank, account number of the account opening bank, etc.;
  • identity information of the transaction participants can be the company name, taxpayer identification number, registered address, etc.
  • this manual does not limit the specific content of transaction information and key information.
  • FIG. 4 is a flowchart of a blockchain-based invoice creation method provided by an exemplary embodiment. As shown in FIG. 4, this method is applied to blockchain nodes (taking server 22 as an example), and may include the following steps:
  • Step 402 Receive an invoice creation request submitted by a user through the client 21.
  • the invoice creation request includes the transaction identification and the invoice creation information input by the user through the client.
  • Step 404 if there is a target transaction on the blockchain, then go to step 406B; otherwise, go to step 406A.
  • Step 406A Return a prompt message to the client 21 that the transaction does not exist.
  • the target transaction is not stored on the blockchain, it means that the transaction corresponding to the invoice created by the client 21 at this time (ie, the target transaction) is not an objectively existing transaction, so the prompt message can be returned to remind the user that the transaction does not exist.
  • Step 406B if the target transaction on the blockchain is marked as invoice created, then go to step 408A; otherwise, go to step 408B.
  • Step 408A Return a prompt message to the client 21 that the invoice has been issued.
  • Step 408B if there is key information about the target transaction associated with the certificate on the blockchain, then go to step 410B; otherwise, go to step 410A.
  • step 410A a prompt message indicating that the transaction is invalid is returned to the client 21.
  • step 408B when the key information of the target transaction on the blockchain is not associated, it means that the transaction corresponding to the invoice created by the client 21 at this time (ie, the target transaction) is not a valid transaction (ie, the target transaction is not a real transaction The transaction that occurred; in other words, the target transaction has false information), so the prompt message can be returned to remind the user that the transaction is an invalid transaction.
  • the key information of the associated deposit certificate on the blockchain is incomplete, it means that the transaction corresponding to the invoice created by the client 21 at this time (ie, the target transaction) is not a valid transaction (ie, the target transaction is not a real occurrence In other words, there is at least a part of false information in the target transaction), so the prompt message can be returned to remind the user that the transaction is an invalid transaction.
  • the key information includes order records, logistics records, payment records, and identity information of transaction participants. It is assumed that when the blockchain only associates the order records, payment records, and identity information of transaction participants with the target transaction, and If the payment record is not associated with a certificate, the target transaction can be determined to be an invalid transaction.
  • Step 410B if the key information is complete, then go to step 412; otherwise, go to step 410A.
  • the above-mentioned operation of determining whether the target transaction is a valid transaction can be performed by the server 22 itself, or it can be a smart contract (declared with verification logic, used to pre-deploy on the blockchain) In order to determine whether any transaction is a valid transaction), this manual does not limit this. It can be seen that through the above process of determining whether the target transaction is a valid transaction, it can effectively prevent users from invoicing falsely.
  • step 412 the invoice creation logic declared in the smart contract is called, and an invoice is created for the target transaction according to the invoice creation information.
  • the smart contract can be pre-deployed on the blockchain by payment institutions and tax authorities.
  • the invoice creation information input by the user may include the header information of the invoice and the transaction information of the target transaction.
  • the server 22 deposits the transaction information contained in the invoice creation information with the blockchain certificate The transaction information (corresponding to the transaction ID) is compared.
  • the comparison result is consistent, the invoice is created directly for the target transaction based on the transaction information and header information contained in the invoice creation information.
  • the server 22 reads the transaction information contained in the invoice creation information and calculates the first hash value, and compares the first hash value with the transaction information stored on the blockchain (and The second hash value corresponding to the transaction ID is compared.
  • the transaction information entered by the user is the transaction information of the target transaction
  • the user can directly input
  • the transaction information and header information create an invoice for the target transaction without reading the transaction information of the target transaction on the blockchain, thereby improving the efficiency of creating invoices.
  • the invoice creation information entered by the user may include only the header information of the invoice.
  • the server 22 After receiving the invoice creation request and determining that there is a target transaction on the blockchain, the server 22 further reads the deposit on the blockchain. Confirm the transaction information of the target transaction, and then create an invoice for the target transaction based on the read transaction information and the header information of the invoice.
  • Step 414 Publish the created invoice to the blockchain.
  • step 416 the target transaction is marked as invoice created.
  • the target transaction can be marked as created invoice status after the invoice is created, or the target transaction can be marked as created invoice status after the created invoice is posted to the blockchain.
  • This specification is not correct. This is restricted.
  • a field may be added to the field of the target transaction for certificate registration to mark the invoice creation status, or an invoice creation status of the target transaction for certificate deposit may be additionally associated on the blockchain, which is not carried out in this specification limit.
  • FIG. 5 is a flowchart of a blockchain-based invoice declaration method provided by an exemplary embodiment. As shown in FIG. 5, this method is applied to blockchain nodes (taking server 22 as an example), and may include the following steps:
  • Step 502 Receive a tax declaration request submitted by a user through the client 21.
  • the tax declaration request includes the transaction identification.
  • Step 504 if the invoice corresponding to the invoice identifier stored on the blockchain is marked as declared, then go to step 510; otherwise, go to step 506.
  • step 506 the invoice declaration logic declared in the smart contract is invoked to complete the tax declaration based on the invoice corresponding to the invoice identifier stored on the blockchain.
  • the smart contract can be pre-deployed on the blockchain by payment institutions and tax authorities.
  • step 508 the invoice corresponding to the invoice identifier is marked as declared.
  • a field can be added in the field of depositing the invoice to mark the invoice declaration status, and the invoice declaration status of the invoice depositing the invoice can also be associated on the blockchain. This specification does not limit this .
  • step 510 a prompt message that the invoice has been declared is returned to the client 21.
  • the narrow sense of the 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 that have nothing to do with value transfer Online business (for example, rental business, vehicle scheduling business, insurance claims business, credit service, medical service, etc.), and in this type of alliance chain, the transaction can be a business with business intent issued by the user in the alliance chain Message or business request.
  • the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile memory 610. Of course, it may include hardware required for other services.
  • the processor 602 reads the corresponding computer program from the non-volatile memory 610 into the memory 608 and then runs it to form a blockchain-based invoice creation device at a logical level.
  • one or more embodiments of this specification do not exclude other implementations, such as a logic device or a combination of software and hardware, etc., that is to say, the execution body of the following processing flow is not limited to each
  • the logic unit may also be a hardware or logic device.
  • the blockchain-based invoice creation device may include:
  • the first receiving unit 71 receives an invoice creation request submitted by a user through a client; wherein the invoice creation request includes a transaction identifier and invoice creation information input by the user;
  • the determining unit 72 determines whether a target transaction corresponding to the transaction identifier is deposited on the blockchain; and, at least one key for indicating that the target transaction is a valid transaction information;
  • the creation unit 73 if it is determined that the target transaction and the key information are stored on the blockchain, invokes the invoice creation logic declared in the smart contract, creates an invoice for the target transaction based on the invoice creation information, and Publish the created invoice to the blockchain.
  • the creating unit 73 is specifically used to:
  • the at least one piece of key information includes at least one of the following: order records, logistics records, payment records corresponding to the target transaction; and identity information of the participant corresponding to the target transaction.
  • Optional also includes:
  • the second receiving unit 74 receives the tax declaration request submitted by the user through the client; wherein the tax declaration request includes an invoice identifier;
  • the declaration unit 75 in response to the tax declaration request, invokes the invoice declaration logic declared in the smart contract, and completes the tax declaration based on the invoice stored on the blockchain and corresponding to the invoice identifier.
  • Optional also includes:
  • the marking unit 76 marks the invoice corresponding to the invoice identifier as declared after the tax declaration is completed.
  • the blockchain is an alliance chain; the member nodes of the alliance chain include: a payment platform and a tax authority.
  • 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 with 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 computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory, random access memory (RAM) and/or non-volatile memory in computer-readable media, such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read only memory
  • flash RAM flash random access memory
  • Computer-readable media including permanent and non-permanent, removable and non-removable media, can store information by any method or technology.
  • the information may be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices.
  • computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
  • first, second, third, etc. may use the terms first, second, third, etc. 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 can be interpreted as "when" or "when" or "in response to a determination”.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A blockchain-based invoice creation method and apparatus and an electronic device; the method may comprise: receiving an invoice creation request submitted by a user by means of a client terminal, the invoice creation request comprising a transaction ID and invoice creation information inputted by the user (102); in response to the invoice creation request, determining whether evidence of a target transaction corresponding to the transaction ID and at least one item of key information used for indicating that the target transaction is a valid transaction are stored on a blockchain (104); and, if it is determined that evidence of the target transaction and the key information are stored on the blockchain, then invoking invoice creation logic stated in a smart contract, creating an invoice for the target transaction on the basis of the invoice creation information, and publishing the created invoice to the blockchain (106).

Description

基于区块链的发票创建方法及装置、电子设备Blockchain-based invoice creation method and device, and electronic equipment 技术领域Technical field
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种基于区块链的发票创建方法及装置、电子设备。One or more embodiments of this specification relate to the field of blockchain technology, and in particular to a blockchain-based invoice creation method and device, and electronic equipment.
背景技术Background technique
区块链技术,也被称之为分布式账本技术,是一种由若干台计算设备共同参与“记账”,共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化、公开透明、每台计算设备可以参与数据库记录、并且各计算设备之间可以快速的进行数据同步的特性,使得区块链技术已在众多的领域中广泛的进行应用。Blockchain technology, also known as distributed ledger technology, is an emerging technology in which several computing devices jointly participate in "bookkeeping" and jointly maintain a complete distributed database. Blockchain technology has the characteristics of decentralization, openness and transparency, each computing device can participate in database records, and data synchronization can be quickly performed between computing devices, making blockchain technology widely used in many fields. To apply.
发明内容Summary of the invention
有鉴于此,本说明书一个或多个实施例提供一种基于区块链的发票创建方法及装置、电子设备。In view of this, one or more embodiments of this specification provide a blockchain-based invoice creation method and device, and electronic equipment.
为实现上述目的,本说明书一个或多个实施例提供技术方案如下:To achieve the above purpose, one or more embodiments of this specification provide technical solutions as follows:
根据本说明书一个或多个实施例的第一方面,提出了一种基于区块链的发票创建方法,应用于区块链节点,所述方法包括:According to a first aspect of one or more embodiments of this specification, a blockchain-based invoice creation method is proposed, which is applied to blockchain nodes. The method includes:
接收用户通过客户端提交的发票创建请求;其中,所述发票创建请求包括交易标识和用户输入的发票创建信息;Receiving an invoice creation request submitted by a user through a client; wherein the invoice creation request includes a transaction identifier and invoice creation information input by the user;
响应于所述发票创建请求,确定所述区块链上是否存证了与所述交易标识对应的目标交易;以及,用于指示所述目标交易为有效交易的至少一种关键信息;In response to the invoice creation request, determining whether a target transaction corresponding to the transaction identifier is deposited on the blockchain; and, at least one piece of key information for indicating that the target transaction is a valid transaction;
如果确定所述区块链上存证了所述目标交易和所述关键信息,调用智能合约中声明的发票创建逻辑,根据所述发票创建信息为所述目标交易创建发票,并将创建的发票发布至所述区块链。If it is determined that the target transaction and the key information are stored on the blockchain, call the invoice creation logic declared in the smart contract, create an invoice for the target transaction based on the invoice creation information, and then create the invoice Publish to the blockchain.
根据本说明书一个或多个实施例的第二方面,提出了一种基于区块链的发票创建装置,应用于区块链节点,所述装置包括:According to a second aspect of one or more embodiments of this specification, a blockchain-based invoice creation device is proposed, which is applied to a blockchain node. The device includes:
第一接收单元,接收用户通过客户端提交的发票创建请求;其中,所述发票创建请 求包括交易标识和用户输入的发票创建信息;The first receiving unit receives an invoice creation request submitted by a user through a client; wherein the invoice creation request includes a transaction identifier and invoice creation information input by the user;
确定单元,响应于所述发票创建请求,确定所述区块链上是否存证了与所述交易标识对应的目标交易;以及,用于指示所述目标交易为有效交易的至少一种关键信息;A determining unit, in response to the invoice creation request, determining whether a target transaction corresponding to the transaction identifier is deposited on the blockchain; and, at least one piece of key information for indicating that the target transaction is a valid transaction ;
创建单元,如果确定所述区块链上存证了所述目标交易和所述关键信息,调用智能合约中声明的发票创建逻辑,根据所述发票创建信息为所述目标交易创建发票,并将创建的发票发布至所述区块链。The creation unit, if it is determined that the target transaction and the key information are stored on the blockchain, call the invoice creation logic declared in the smart contract, create an invoice for the target transaction based on the invoice creation information, and The created invoice is posted to the blockchain.
根据本说明书一个或多个实施例的第三方面,提出了一种电子设备,包括:According to a third aspect of one or more embodiments of this specification, an electronic device is provided, including:
处理器;processor;
用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
其中,所述处理器通过运行所述可执行指令以实现如上述任一实施例中所述的方法。Wherein, the processor executes the executable instruction to implement the method as described in any one of the above embodiments.
附图说明BRIEF DESCRIPTION
图1是一示例性实施例提供的一种基于区块链的发票创建方法的流程图。FIG. 1 is a flowchart of a blockchain-based invoice creation method provided by an exemplary embodiment.
图2是一示例性实施例提供的一种发票创建方案的整体架构示意图。FIG. 2 is a schematic diagram of the overall architecture of an invoice creation solution provided by an exemplary embodiment.
图3是一示例性实施例提供的交易上链的交互示意图。FIG. 3 is a schematic diagram of interaction of transaction on-chain provided by an exemplary embodiment.
图4是一示例性实施例提供的基于区块链的发票创建方法的流程图。4 is a flowchart of a blockchain-based invoice creation method provided by an exemplary embodiment.
图5是一示例性实施例提供的基于区块链的发票申报方法的流程图。FIG. 5 is a flowchart of a blockchain-based invoice declaration method provided by an exemplary embodiment.
图6是一示例性实施例提供的一种设备的结构示意图。6 is a schematic structural diagram of an apparatus provided by an exemplary embodiment.
图7是一示例性实施例提供的一种基于区块链的发票创建装置的框图。7 is a block diagram of a blockchain-based invoice creation device provided by an exemplary embodiment.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail here, examples of which are shown in the drawings. When referring to the drawings below, unless otherwise indicated, the same numerals in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相 应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. In addition, the single step described in this specification may be decomposed into multiple steps for description in other embodiments; and the multiple steps described in this specification may also be combined into a single step in other embodiments. description.
图1是一示例性实施例提供的一种基于区块链的发票创建方法的流程图。如图1所示,该方法应用于区块链节点,可以包括以下步骤:FIG. 1 is a flowchart of a blockchain-based invoice creation method provided by an exemplary embodiment. As shown in Figure 1, this method is applied to blockchain nodes and can include the following steps:
步骤102,接收用户通过客户端提交的发票创建请求;其中,所述发票创建请求包括交易标识和用户输入的发票创建信息。Step 102: Receive an invoice creation request submitted by a user through a client; wherein the invoice creation request includes a transaction identifier and invoice creation information input by the user.
在一实施例中,客户端可以为交易参与方使用的手机、平板电脑、智能手表等任意类型的电子设备,本说明书并不对此进行限制。交易参与方通过在电子设备上登录已注册账号,可与接入该电子设备的区块链节点进行交互。In an embodiment, the client may be any type of electronic device such as a mobile phone, tablet computer, smart watch, etc. used by the transaction participants, which is not limited in this specification. Participants in the transaction can interact with the blockchain nodes connected to the electronic device by logging in the registered account on the electronic device.
在一实施例中,交易参与方在完成一笔交易后,可通过客户端向区块链节点发送记录请求以使得该区块链节点将该交易的交易信息发布至区块链。例如,交易信息可以包括交易标识、交易平台、交易金额、交易内容、交易参与方、交易时间等。当然,本说明书并不对交易信息的具体内容进行限制。通过将交易信息发布至区块链,使得各个区块链节点均记录有一份完整的交易信息,那么即使某个节点出现数据损坏的问题,也不会影响整体的数据完整性;同时,可充分利用区块链存储数据的不可篡改性,从而防止不法分子恶意修改交易信息,保证了所记录交易信息的安全和透明,便于用户溯源。In an embodiment, after completing a transaction, the transaction participant may send a record request to the blockchain node through the client to enable the blockchain node to publish the transaction information of the transaction to the blockchain. For example, the transaction information may include transaction identification, transaction platform, transaction amount, transaction content, transaction participants, transaction time, etc. Of course, this specification does not limit the specific content of the transaction information. By publishing transaction information to the blockchain, each blockchain node records a complete transaction information, then even if a node has data corruption problems, it will not affect the overall data integrity; at the same time, it can be fully The non-tampering modification of the data stored on the blockchain prevents the criminals from maliciously modifying the transaction information, guarantees the security and transparency of the recorded transaction information, and facilitates the traceability of users.
步骤104,响应于所述发票创建请求,确定所述区块链上是否存证了与所述交易标识对应的目标交易;以及,用于指示所述目标交易为有效交易的至少一种关键信息。Step 104: In response to the invoice creation request, determine whether a target transaction corresponding to the transaction identifier is deposited on the blockchain; and, at least one piece of key information for indicating that the target transaction is a valid transaction .
在一实施例中,可根据交易标识查找区块链上是否存证有相应的目标交易。换言之,需确定与该交易标识对应的交易是否客观存在。进一步的,如果所述区块链上存证有所述目标交易,需进一步确定所述目标交易是否为有效交易;如果是,调用智能合约中声明的发票创建逻辑。通过在确定出目标交易为一笔客观存在的交易后,进一步确定目标交易是否为有效交易(可理解为目标交易为一笔真实发生过的交易),可有效防止用户虚开发票。In one embodiment, it is possible to find whether there is a corresponding target transaction on the blockchain based on the transaction identifier. In other words, it is necessary to determine whether the transaction corresponding to the transaction identifier exists objectively. Further, if the target transaction is stored on the blockchain, it is necessary to further determine whether the target transaction is a valid transaction; if so, call the invoice creation logic declared in the smart contract. By determining that the target transaction is an objectively existing transaction, and further determining whether the target transaction is a valid transaction (it can be understood that the target transaction is a transaction that has actually occurred), it can effectively prevent users from invoicing.
而在确定目标交易是否为有效交易时,可利用区块链上存证的目标交易的至少一种关键信息。交易参与方在完成一笔交易后,除交易信息外,还可将用于指示该交易为有效交易的至少一种关键信息也发送至区块链节点,以使得该区块链节点将该关键信息发 布至区块链。进一步的,区块链节点可将交易的交易信息和关键信息关联地发布至区块链上。基于上述对交易的关键信息的存证,在一种情况下,可确定区块链上是否存证了用于指示目标交易为有效交易的至少一种关键信息,如果是,可确定目标交易为有效交易。在另一种情况下,可先确定区块链上是否存证了用于指示目标交易为有效交易的至少一种关键信息,如果确定区块链上存证了该至少一种关键信息,可进一步确定该至少一种关键信息中的各种关键信息是否完整,如果是,可确定目标交易为有效交易,进而调用智能合约中声明的发票创建逻辑。其中,该至少一种关键信息可以包含以下至少之一:与目标交易对应的订单记录、物流记录、支付记录;以及,与目标交易对应的参与方的身份信息。When determining whether the target transaction is a valid transaction, at least one kind of key information of the target transaction stored on the blockchain can be used. After a transaction participant completes a transaction, in addition to the transaction information, it can also send at least one kind of key information indicating that the transaction is a valid transaction to the blockchain node, so that the blockchain node uses the key Information is posted to the blockchain. Further, the blockchain node can publish the transaction information and key information of the transaction on the blockchain in association. Based on the above deposit of key information of the transaction, in one case, it can be determined whether at least one piece of key information indicating that the target transaction is a valid transaction is stored on the blockchain, and if so, the target transaction can be determined as Effective transaction. In another case, it may be determined whether at least one piece of key information indicating that the target transaction is a valid transaction is stored on the blockchain. If it is determined that the at least one piece of key information is stored on the blockchain, it may be It is further determined whether the various key information in the at least one key information is complete, and if so, the target transaction can be determined to be a valid transaction, and then the invoice creation logic declared in the smart contract can be called. The at least one piece of key information may include at least one of the following: order records, logistics records, payment records corresponding to the target transaction; and identity information of the participant corresponding to the target transaction.
需要说明的是,上述确定目标交易是否为有效交易的操作,可由区块链节点自身执行,也可由预先部署于区块链上的智能合约(声明有校验逻辑,用于确定任一交易是否为有效交易)来执行,本说明书并不对此进行限制。It should be noted that the above-mentioned operation to determine whether the target transaction is a valid transaction can be performed by the blockchain node itself, or it can be a smart contract (declared with verification logic, which is used to determine whether any transaction is pre-deployed on the blockchain) For effective transactions), this manual does not limit this.
步骤106,如果确定所述区块链上存证了所述目标交易和所述关键信息,调用智能合约中声明的发票创建逻辑,根据所述发票创建信息为所述目标交易创建发票,并将创建的发票发布至所述区块链。 Step 106, if it is determined that the target transaction and the key information are stored on the blockchain, call the invoice creation logic declared in the smart contract, create an invoice for the target transaction based on the invoice creation information, and The created invoice is posted to the blockchain.
在一种情况下,发票创建信息可以包括发票的抬头信息和与交易标识对应的交易的交易信息(由用户输入),区块链节点在接收到发票创建请求后将发票创建信息中包含的交易信息与区块链上存证的交易信息(与交易标识相对应)进行对比,当对比结果为两者一致时,直接根据发票创建信息中包含的交易信息和抬头信息为目标交易创建发票。例如,区块链节点在接收到发票创建请求后,读取发票创建信息中包含的交易信息并计算得到第一哈希值,将该第一哈希值与区块链上存证的交易信息(与交易标识相对应)的第二哈希值进行对比,当第一哈希值与第二哈希值相等时,可确定用户输入的交易信息即为目标交易的交易信息,那么可直接根据用户输入的交易信息和抬头信息为目标交易创建发票,而无需读取区块链上存证的目标交易的交易信息。In one case, the invoice creation information may include the header information of the invoice and the transaction information of the transaction corresponding to the transaction identifier (entered by the user), and the blockchain node receives the transaction included in the invoice creation information after receiving the invoice creation request The information is compared with the transaction information (corresponding to the transaction identifier) stored on the blockchain. When the comparison result is consistent, the invoice is directly created for the target transaction based on the transaction information and header information contained in the invoice creation information. For example, after receiving the invoice creation request, the blockchain node reads the transaction information contained in the invoice creation information and calculates the first hash value, and then compares the first hash value with the transaction information stored on the blockchain (Corresponding to the transaction identifier) the second hash value is compared, when the first hash value and the second hash value are equal, it can be determined that the transaction information entered by the user is the transaction information of the target transaction, then it can be directly The transaction information and header information entered by the user creates an invoice for the target transaction without reading the transaction information of the target transaction on the blockchain.
在另一种情况下,发票创建信息可以仅包括发票的抬头信息,区块链节点在接收到发票创建请求并确定区块链上存证有目标交易后,进一步读取区块链上存证的目标交易的交易信息,再根据读取到的交易信息以及发票的抬头信息为目标交易创建发票。In another case, the invoice creation information may include only the header information of the invoice. After receiving the invoice creation request and determining that there is a target transaction on the blockchain, the blockchain node further reads the certificate on the blockchain The transaction information of the target transaction, and then create an invoice for the target transaction based on the read transaction information and the header information of the invoice.
在一实施例中,在为目标交易创建发票后,可进一步将目标交易标记为已创建发票状态。其中,可在存证目标交易的字段中添加一字段用于标记发票创建状态,也可额外在区块链上关联存证该目标交易的发票创建状态,本说明书并不对此进行限制。通过记 录交易的发票创建状态,当接收到用户通过客户端提交的发票创建请求时,可先判定与该发票创建请求对应的交易的发票创建状态;若为已创建发票状态,则可以直接向客户端返回已开具发票的提示消息,否则进入上述创建发票的流程。In one embodiment, after the invoice is created for the target transaction, the target transaction can be further marked as invoice created. Among them, a field can be added to the field of the target transaction for certificate registration to mark the invoice creation status, and the invoice creation status of the target transaction can also be associated and stored on the blockchain. This specification does not limit this. By recording the invoice creation status of the transaction, when receiving the invoice creation request submitted by the user through the client, you can first determine the invoice creation status of the transaction corresponding to the invoice creation request; if it is the invoice creation status, you can directly report to the customer The terminal will return a prompt message that an invoice has been issued, otherwise enter the above-mentioned invoice creation process.
在一实施例中,基于将所创建的发票与目标交易关联地发布至区块链,可部署智能合约用于对发票进行纳税申报,以实现基于区块链对发票的纳税申报。因此,区块链节点可接收用户通过客户端提交的纳税申报请求(纳税申报请求包括发票标识),并响应于该纳税申报请求,调用智能合约中声明的发票申报逻辑,基于区块链上存证的与该发票标识对应的发票完成纳税申报。类似的,在完成纳税申报后,可将与该发票标识对应的发票标记为已申报状态。其中,可在存证发票的字段中添加一字段用于标记发票申报状态,也可额外在区块链上关联存证该交易的发票申报状态,本说明书并不对此进行限制。通过记录发票的发票申报状态,当接收到用户通过客户端提交的纳税申报请求时,可先判定与该纳税申报请求对应的发票的发票申报状态;若为已申报状态,则可以直接向客户端返回已申报的提示消息,否则进入上述纳税申报的流程。In an embodiment, based on posting the created invoice to the blockchain in association with the target transaction, a smart contract can be deployed for tax declaration of the invoice, so as to realize the tax declaration of the invoice based on the blockchain. Therefore, the blockchain node can receive the tax declaration request submitted by the user through the client (the tax declaration request includes the invoice identifier), and in response to the tax declaration request, call the invoice declaration logic declared in the smart contract, based on the blockchain The invoice corresponding to the invoice identification is certified to complete the tax declaration. Similarly, after the tax declaration is completed, the invoice corresponding to the invoice identifier can be marked as declared. Among them, you can add a field in the field of the certificate invoice to mark the invoice declaration status, or you can additionally link the certificate invoice declaration status of the transaction on the blockchain. This manual does not limit this. By recording the invoice declaration status of the invoice, when receiving the tax declaration request submitted by the user through the client, you can first determine the invoice declaration status of the invoice corresponding to the tax declaration request; if it is the declared status, you can directly report to the client Return the notification message that has been declared, otherwise enter the above-mentioned tax declaration process.
在一实施例中,上述区块链可以为联盟链,联盟链的成员节点可以包括支付平台和税务机关。其中,税务机关可作为监管方查看区块链上存证的交易、发票等信息。In an embodiment, the above-mentioned blockchain can be an alliance chain, and the member nodes of the alliance chain can include a payment platform and a tax authority. Among them, the tax authority can act as a supervisor to view information such as transactions and invoices on the blockchain.
图2是一示例性实施例提供的一种发票创建方案的整体架构示意图。如图2所示,交易参与方之间在完成一笔交易后,可通过客户端21向服务器22发送记录请求以使得服务器22将该交易的交易信息发布至区块链。进一步的,当交易参与方存在开具发票的需求时,可通过客户端21向服务器22发送发票创建请求,服务器22在接收到该发票创建请求(包括交易标识和用户输入的发票创建信息)后,确定区块链上是否存证有与该交易标识对应的目标交易,并在区块链上存证有目标交易的情况下调用智能合约中声明的发票创建逻辑为目标交易创建发票,并将创建的发票发布至区块链。FIG. 2 is a schematic diagram of the overall architecture of an invoice creation solution provided by an exemplary embodiment. As shown in FIG. 2, after completing a transaction between transaction participants, the client 21 can send a recording request to the server 22 to enable the server 22 to publish the transaction information of the transaction to the blockchain. Further, when there is a demand for invoicing by the transaction participants, the client 21 can send an invoice creation request to the server 22, and after receiving the invoice creation request (including the transaction identifier and the invoice creation information input by the user), the server 22 Determine whether there is a target transaction corresponding to the transaction ID on the blockchain, and call the invoice creation logic declared in the smart contract to create an invoice for the target transaction when the target transaction is stored on the blockchain. Of invoices are posted to the blockchain.
为了便于理解,下面针对客户端21、服务器22分别在发票创建过程中实现的操作和功能,结合图3-5对本说明书的发票创建方案进行详细说明。图3是一示例性实施例提供的交易上链的交互示意图。如图3所示,该交互过程可以包括以下步骤:In order to facilitate understanding, the invoice creation scheme of this specification will be described in detail with reference to FIGS. 3-5 for the operations and functions implemented by the client 21 and the server 22 in the invoice creation process respectively. FIG. 3 is a schematic diagram of interaction of transaction on-chain provided by an exemplary embodiment. As shown in FIG. 3, the interaction process may include the following steps:
步骤302,客户端21与服务器22之间实现对绑定关系的建立。In step 302, a binding relationship is established between the client 21 and the server 22.
在一实施例中,所需建立的绑定关系为交易参与方的身份信息与客户端21的设备信息之间的绑定关系。基于该绑定关系,使得服务器22在接收到客户端21后续发送的交易记录请求、发票创建请求和纳税申报请求时,可以确认这些请求对应于该交易参与方。In an embodiment, the binding relationship to be established is the binding relationship between the identity information of the transaction participant and the device information of the client 21. Based on the binding relationship, when the server 22 receives the transaction record request, the invoice creation request, and the tax declaration request subsequently sent by the client 21, it can confirm that these requests correspond to the transaction participant.
举例而言,交易参与方可以预先在服务器22处进行账号注册,得到与自身唯一对应的已注册账号。然后,交易参与方可以通过在客户端21上登录该已注册账号,而服务器22基于该已注册账号在客户端21上的登录信息,确定该已注册账号(对应于交易参与方)与客户端21之间建立了绑定关系。For example, the transaction participant may register an account with the server 22 in advance to obtain a registered account uniquely corresponding to itself. Then, the transaction participant can log in to the registered account on the client 21, and the server 22 determines the registered account (corresponding to the transaction participant) and the client based on the login information of the registered account on the client 21 21 established a binding relationship.
步骤304,客户端21对待记录的交易和关键信息签名。In step 304, the client 21 signs the recorded transaction and key information.
在一实施例中,交易参与方之间在完成交易后,可通过客户端21向服务器22提交交易记录请求,以使得服务器22将待记录的交易信息和该交易的关键信息发布至区块链中。其中,交易参与方可以预先注册得到唯一对应的数字身份,该数字身份由一组公私钥对进行表征。相应地,客户端21在获取到交易参与方输入的交易信息和该交易的关键信息后,可生成交易记录请求(包含交易信息和关键信息)并通过对应于交易参与方的数字身份的私钥对交易记录请求进行签名。In an embodiment, after completing the transaction between the transaction participants, the client 21 may submit a transaction record request to the server 22, so that the server 22 publishes the transaction information to be recorded and the key information of the transaction to the blockchain in. Among them, the transaction participants can register in advance to obtain a unique corresponding digital identity, which is characterized by a set of public and private key pairs. Correspondingly, after obtaining the transaction information input by the transaction participants and the key information of the transaction, the client 21 can generate a transaction record request (including transaction information and key information) and pass the private key corresponding to the digital identity of the transaction participant Sign the transaction record request.
步骤306,客户端21向服务器22提交交易记录请求。In step 306, the client 21 submits a transaction record request to the server 22.
步骤308,服务器22验证签名。In step 308, the server 22 verifies the signature.
在一实施例中,服务器22上运行有区块链的客户端,使得该服务器22被配置为一区块链节点。服务器22在接收到交易记录请求后,可基于上述步骤302建立的绑定关系确定出交易参与方的身份,从而通过对应于交易参与方的公钥进行验签,以确定该交易记录请求已由该交易参与方进行授权,而并非由不法分子冒充该交易参与方的身份进行发送。In one embodiment, a blockchain client runs on the server 22, so that the server 22 is configured as a blockchain node. After receiving the transaction record request, the server 22 may determine the identity of the transaction participant based on the binding relationship established in the above step 302, so that the public key corresponding to the transaction participant may be checked to determine that the transaction record request has been issued. The transaction participant authorizes it, and it is not sent by a criminal who pretends to be the identity of the transaction participant.
在一实施例中,当验签未通过时,由于客户端预先通过已注册账号与交易参与方绑定,表明可能存在不法分子冒充交易参与方的身份,那么可触发报警操作并暂时封锁客户端接入区块链节点的权限。In one embodiment, when the verification fails, because the client is bound to the transaction participant through the registered account in advance, indicating that there may be a criminal who pretends to be the identity of the transaction participant, then an alarm operation can be triggered and the client is temporarily blocked Access to blockchain nodes.
步骤310,服务器22将交易信息和关键信息相关联地发布至区块链。In step 310, the server 22 publishes the transaction information and key information in association with the blockchain.
举例而言,交易信息可以包括交易标识、交易平台、交易金额、交易内容、交易参与方、交易时间等;关键信息可包括订单记录、物流记录、支付记录、交易参与方的身份信息等。其中,订单信息可以是交易参与方之间签署的合同、交易的对象(比如,商品、技术支持等)的明细内容;物流记录可以是交易的对象的物流信息;支付记录可以是交易参与方之间的付款和收款明细、开户行名称、开户行账号等;交易参与方的身份信息可以是公司名称、纳税人识别号、注册地址等。当然,本说明书并不对交易信息和关键信息的具体内容进行限制。For example, transaction information may include transaction identification, transaction platform, transaction amount, transaction content, transaction participants, transaction time, etc.; key information may include order records, logistics records, payment records, identity information of transaction participants, etc. Among them, the order information can be the contract signed between the transaction participants, the details of the transaction objects (such as commodities, technical support, etc.); the logistics record can be the logistics information of the transaction object; the payment record can be the transaction participants Payment and collection details, the name of the account opening bank, account number of the account opening bank, etc.; the identity information of the transaction participants can be the company name, taxpayer identification number, registered address, etc. Of course, this manual does not limit the specific content of transaction information and key information.
请参见图4,图4是一示例性实施例提供的基于区块链的发票创建方法的流程图。如图4所示,该方法应用于区块链节点(以服务器22为例),可以包括以下步骤:Please refer to FIG. 4, which is a flowchart of a blockchain-based invoice creation method provided by an exemplary embodiment. As shown in FIG. 4, this method is applied to blockchain nodes (taking server 22 as an example), and may include the following steps:
步骤402,接收用户通过客户端21提交的发票创建请求。Step 402: Receive an invoice creation request submitted by a user through the client 21.
在一实施例中,发票创建请求包括交易标识和用户通过客户端输入的发票创建信息。In one embodiment, the invoice creation request includes the transaction identification and the invoice creation information input by the user through the client.
步骤404,若区块链上存证有目标交易,则转入步骤406B;否则,转入步骤406A。 Step 404, if there is a target transaction on the blockchain, then go to step 406B; otherwise, go to step 406A.
步骤406A,向客户端21返回交易不存在的提示消息。 Step 406A: Return a prompt message to the client 21 that the transaction does not exist.
在一实施例中,可根据交易标识确定区块链上是否存证有与该交易标识对应的目标交易。当区块链上未存证目标交易时,说明此时客户端21请求创建的发票对应的交易(即目标交易)并非客观存在的交易,因此可返回该提示消息以提醒用户交易不存在。In one embodiment, it can be determined whether there is a target transaction corresponding to the transaction identifier on the blockchain according to the transaction identifier. When the target transaction is not stored on the blockchain, it means that the transaction corresponding to the invoice created by the client 21 at this time (ie, the target transaction) is not an objectively existing transaction, so the prompt message can be returned to remind the user that the transaction does not exist.
步骤406B,若区块链上存证的目标交易被标记为已创建发票状态,则转入步骤408A;否则,转入步骤408B。 Step 406B, if the target transaction on the blockchain is marked as invoice created, then go to step 408A; otherwise, go to step 408B.
步骤408A,向客户端21返回发票已开具的提示消息。 Step 408A: Return a prompt message to the client 21 that the invoice has been issued.
步骤408B,若区块链上关联存证有目标交易的关键信息,则转入步骤410B;否则,转入步骤410A。 Step 408B, if there is key information about the target transaction associated with the certificate on the blockchain, then go to step 410B; otherwise, go to step 410A.
步骤410A,向客户端21返回交易无效的提示消息。In step 410A, a prompt message indicating that the transaction is invalid is returned to the client 21.
承接于步骤408B,当区块链上未关联存证目标交易的关键信息时,说明此时客户端21请求创建的发票对应的交易(即目标交易)并非有效交易(即目标交易并非一笔真实发生过的交易;换言之,目标交易存在虚假信息),因此可返回该提示消息以提醒用户该交易为无效交易。In step 408B, when the key information of the target transaction on the blockchain is not associated, it means that the transaction corresponding to the invoice created by the client 21 at this time (ie, the target transaction) is not a valid transaction (ie, the target transaction is not a real transaction The transaction that occurred; in other words, the target transaction has false information), so the prompt message can be returned to remind the user that the transaction is an invalid transaction.
承接于步骤410B,当区块链上关联存证的关键信息不完整时,说明此时客户端21请求创建的发票对应的交易(即目标交易)并非有效交易(即目标交易并非一笔真实发生过的交易;换言之,目标交易存在至少一部分的虚假信息),因此可返回该提示消息以提醒用户该交易为无效交易。例如,关键信息包括订单记录、物流记录、支付记录和交易参与方的身份信息,假定当区块链上仅关联存证了目标交易的订单记录、支付记录和交易参与方的身份信息,而并未关联存证支付记录,则可判定目标交易为无效交易。Following step 410B, when the key information of the associated deposit certificate on the blockchain is incomplete, it means that the transaction corresponding to the invoice created by the client 21 at this time (ie, the target transaction) is not a valid transaction (ie, the target transaction is not a real occurrence In other words, there is at least a part of false information in the target transaction), so the prompt message can be returned to remind the user that the transaction is an invalid transaction. For example, the key information includes order records, logistics records, payment records, and identity information of transaction participants. It is assumed that when the blockchain only associates the order records, payment records, and identity information of transaction participants with the target transaction, and If the payment record is not associated with a certificate, the target transaction can be determined to be an invalid transaction.
步骤410B,若关键信息完整,则转入步骤412;否则,转入步骤410A。 Step 410B, if the key information is complete, then go to step 412; otherwise, go to step 410A.
在一实施例中,上述确定目标交易是否为有效交易的操作(步骤406B-410B),可由服务器22自身来执行,也可由预先部署于区块链上的智能合约(声明有校验逻辑, 用于确定任一交易是否为有效交易)来执行,本说明书并不对此进行限制。可见,通过上述判定目标交易是否为有效交易的过程,可有效防止用户虚开发票。In an embodiment, the above-mentioned operation of determining whether the target transaction is a valid transaction (steps 406B-410B) can be performed by the server 22 itself, or it can be a smart contract (declared with verification logic, used to pre-deploy on the blockchain) In order to determine whether any transaction is a valid transaction), this manual does not limit this. It can be seen that through the above process of determining whether the target transaction is a valid transaction, it can effectively prevent users from invoicing falsely.
步骤412,调用智能合约中声明的发票创建逻辑,根据发票创建信息为目标交易创建发票。In step 412, the invoice creation logic declared in the smart contract is called, and an invoice is created for the target transaction according to the invoice creation information.
在一实施例中,该智能合约可由支付机构和税务机关预先部署于区块链。In one embodiment, the smart contract can be pre-deployed on the blockchain by payment institutions and tax authorities.
在一种情况下,用户输入的发票创建信息可以包括发票的抬头信息和目标交易的交易信息,服务器22在接收到发票创建请求后将发票创建信息中包含的交易信息与区块链上存证的交易信息(与交易标识相对应)进行对比,当对比结果为两者一致时,直接根据发票创建信息中包含的交易信息和抬头信息为目标交易创建发票。例如,服务器22在接收到发票创建请求后,读取发票创建信息中包含的交易信息并计算得到第一哈希值,将该第一哈希值与区块链上存证的交易信息(与交易标识相对应)的第二哈希值进行对比,当第一哈希值与第二哈希值相等时,可确定用户输入的交易信息即为目标交易的交易信息,那么可直接根据用户输入的交易信息和抬头信息为目标交易创建发票,而无需读取区块链上存证的目标交易的交易信息,从而提高创建发票的效率。In one case, the invoice creation information input by the user may include the header information of the invoice and the transaction information of the target transaction. After receiving the invoice creation request, the server 22 deposits the transaction information contained in the invoice creation information with the blockchain certificate The transaction information (corresponding to the transaction ID) is compared. When the comparison result is consistent, the invoice is created directly for the target transaction based on the transaction information and header information contained in the invoice creation information. For example, after receiving the invoice creation request, the server 22 reads the transaction information contained in the invoice creation information and calculates the first hash value, and compares the first hash value with the transaction information stored on the blockchain (and The second hash value corresponding to the transaction ID is compared. When the first hash value and the second hash value are equal, it can be determined that the transaction information entered by the user is the transaction information of the target transaction, then the user can directly input The transaction information and header information create an invoice for the target transaction without reading the transaction information of the target transaction on the blockchain, thereby improving the efficiency of creating invoices.
在另一种情况下,用户输入的发票创建信息可以仅包括发票的抬头信息,服务器22在接收到发票创建请求并确定区块链上存证有目标交易后,进一步读取区块链上存证的目标交易的交易信息,再根据读取到的交易信息以及发票的抬头信息为目标交易创建发票。In another case, the invoice creation information entered by the user may include only the header information of the invoice. After receiving the invoice creation request and determining that there is a target transaction on the blockchain, the server 22 further reads the deposit on the blockchain. Confirm the transaction information of the target transaction, and then create an invoice for the target transaction based on the read transaction information and the header information of the invoice.
步骤414,将创建的发票发布至区块链。Step 414: Publish the created invoice to the blockchain.
步骤416,将目标交易标记为已创建发票状态。In step 416, the target transaction is marked as invoice created.
在一实施例中,可以在创建发票后便将目标交易标记为已创建发票状态,也可以在将创建的发票发布至区块链后再将目标交易标记为已创建发票状态,本说明书并不对此进行限制。In one embodiment, the target transaction can be marked as created invoice status after the invoice is created, or the target transaction can be marked as created invoice status after the created invoice is posted to the blockchain. This specification is not correct. This is restricted.
在一实施例中,可在存证目标交易的字段中添加一字段用于标记发票创建状态,也可额外在区块链上关联存证该目标交易的发票创建状态,本说明书并不对此进行限制。通过记录交易的发票创建状态,当接收到用户通过客户端提交的发票创建请求时,可先判定与该发票创建请求对应的交易的发票创建状态;若为已创建发票状态,则可以直接向客户端返回已开具发票的提示消息,否则进入上述创建发票的流程。In an embodiment, a field may be added to the field of the target transaction for certificate registration to mark the invoice creation status, or an invoice creation status of the target transaction for certificate deposit may be additionally associated on the blockchain, which is not carried out in this specification limit. By recording the invoice creation status of the transaction, when receiving the invoice creation request submitted by the user through the client, you can first determine the invoice creation status of the transaction corresponding to the invoice creation request; if it is the invoice creation status, you can directly report to the customer The terminal will return a prompt message that an invoice has been issued, otherwise enter the above-mentioned invoice creation process.
请参见图5,图5是一示例性实施例提供的基于区块链的发票申报方法的流程图。 如图5所示,该方法应用于区块链节点(以服务器22为例),可以包括以下步骤:Please refer to FIG. 5, which is a flowchart of a blockchain-based invoice declaration method provided by an exemplary embodiment. As shown in FIG. 5, this method is applied to blockchain nodes (taking server 22 as an example), and may include the following steps:
步骤502,接收用户通过客户端21提交的纳税申报请求。Step 502: Receive a tax declaration request submitted by a user through the client 21.
在一实施例中,纳税申报请求包括交易标识。In one embodiment, the tax declaration request includes the transaction identification.
步骤504,若区块链上存证的与发票标识对应的发票被标记为已申报状态,则转入步骤510;否则,转入步骤506。 Step 504, if the invoice corresponding to the invoice identifier stored on the blockchain is marked as declared, then go to step 510; otherwise, go to step 506.
步骤506,调用智能合约中声明的发票申报逻辑,基于区块链上存证的与发票标识对应的发票完成纳税申报。In step 506, the invoice declaration logic declared in the smart contract is invoked to complete the tax declaration based on the invoice corresponding to the invoice identifier stored on the blockchain.
在一实施例中,该智能合约可由支付机构和税务机关预先部署于区块链。In one embodiment, the smart contract can be pre-deployed on the blockchain by payment institutions and tax authorities.
步骤508,将与发票标识对应的发票标记为已申报状态。In step 508, the invoice corresponding to the invoice identifier is marked as declared.
在一实施例中,可在存证该发票的字段中添加一字段用于标记发票申报状态,也可额外在区块链上关联存证该发票的发票申报状态,本说明书并不对此进行限制。通过记录发票的发票申报状态,当接收到用户通过客户端提交的纳税申报请求时,可先判定与该纳税申报请求对应的发票的发票申报状态;若为已申报状态,则可以直接向客户端返回已申报的提示消息,否则进入上述纳税申报的流程。In one embodiment, a field can be added in the field of depositing the invoice to mark the invoice declaration status, and the invoice declaration status of the invoice depositing the invoice can also be associated on the blockchain. This specification does not limit this . By recording the invoice declaration status of the invoice, when receiving the tax declaration request submitted by the user through the client, you can first determine the invoice declaration status of the invoice corresponding to the tax declaration request; if it is the declared status, you can directly report to the client Return the notification message that has been declared, otherwise enter the above-mentioned tax declaration process.
步骤510,向客户端21返回发票已申报的提示消息。In step 510, a prompt message that the invoice has been declared is returned to the client 21.
需要说明的是,区块链中的交易,存在狭义的交易以及广义的交易之分。狭义的交易是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易可以是用户在区块链中发起的一笔转账。而广义的交易是指用户向区块链发布的一笔具有业务意图的业务数据;例如,运营方可以基于实际的业务需求搭建一个联盟链,依托于联盟链部署一些与价值转移无关的其它类型的在线业务(比如,租房业务、车辆调度业务、保险理赔业务、信用服务、医疗服务等),而在这类联盟链中,交易可以是用户在联盟链中发布的一笔具有业务意图的业务消息或者业务请求。It should be noted that there are narrow transactions and broad transactions in the transactions in the blockchain. The narrow sense of the 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 that have nothing to do with value transfer Online business (for example, rental business, vehicle scheduling business, insurance claims business, credit service, medical service, etc.), and in this type of alliance chain, the transaction can be a business with business intent issued by the user in the alliance chain Message or business request.
图6是一示例性实施例提供的一种设备的示意结构图。请参考图6,在硬件层面,该设备包括处理器602、内部总线604、网络接口606、内存608以及非易失性存储器610,当然还可能包括其他业务所需要的硬件。处理器602从非易失性存储器610中读取对应的计算机程序到内存608中然后运行,在逻辑层面上形成基于区块链的发票创建装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不 限定于各个逻辑单元,也可以是硬件或逻辑器件。6 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 6. At the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile memory 610. Of course, it may include hardware required for other services. The processor 602 reads the corresponding computer program from the non-volatile memory 610 into the memory 608 and then runs it to form a blockchain-based invoice creation device at a logical level. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as a logic device or a combination of software and hardware, etc., that is to say, the execution body of the following processing flow is not limited to each The logic unit may also be a hardware or logic device.
请参考图7,在软件实施方式中,该基于区块链的发票创建装置可以包括:Please refer to FIG. 7. In the software implementation, the blockchain-based invoice creation device may include:
第一接收单元71,接收用户通过客户端提交的发票创建请求;其中,所述发票创建请求包括交易标识和用户输入的发票创建信息;The first receiving unit 71 receives an invoice creation request submitted by a user through a client; wherein the invoice creation request includes a transaction identifier and invoice creation information input by the user;
确定单元72,响应于所述发票创建请求,确定所述区块链上是否存证了与所述交易标识对应的目标交易;以及,用于指示所述目标交易为有效交易的至少一种关键信息;The determining unit 72, in response to the invoice creation request, determines whether a target transaction corresponding to the transaction identifier is deposited on the blockchain; and, at least one key for indicating that the target transaction is a valid transaction information;
创建单元73,如果确定所述区块链上存证了所述目标交易和所述关键信息,调用智能合约中声明的发票创建逻辑,根据所述发票创建信息为所述目标交易创建发票,并将创建的发票发布至所述区块链。The creation unit 73, if it is determined that the target transaction and the key information are stored on the blockchain, invokes the invoice creation logic declared in the smart contract, creates an invoice for the target transaction based on the invoice creation information, and Publish the created invoice to the blockchain.
可选的,所述创建单元73具体用于:Optionally, the creating unit 73 is specifically used to:
如果确定所述区块链上存证了所述目标交易和所述至少一种关键信息,进一步确定所述至少一种关键信息中的各种关键信息是否完整;If it is determined that the target transaction and the at least one key information are stored on the blockchain, it is further determined whether the various key information in the at least one key information is complete;
如果是,调用智能合约中声明的发票创建逻辑。If yes, call the invoice creation logic declared in the smart contract.
可选的,所述至少一种关键信息包含以下至少之一:与所述目标交易对应的订单记录、物流记录、支付记录;以及,与所述目标交易对应的参与方的身份信息。Optionally, the at least one piece of key information includes at least one of the following: order records, logistics records, payment records corresponding to the target transaction; and identity information of the participant corresponding to the target transaction.
可选的,还包括:Optional, also includes:
第二接收单元74,接收用户通过客户端提交的纳税申报请求;其中,所述纳税申报请求包括发票标识;The second receiving unit 74 receives the tax declaration request submitted by the user through the client; wherein the tax declaration request includes an invoice identifier;
申报单元75,响应于所述纳税申报请求,调用智能合约中声明的发票申报逻辑,基于所述区块链上存证的与所述发票标识对应的发票完成纳税申报。The declaration unit 75, in response to the tax declaration request, invokes the invoice declaration logic declared in the smart contract, and completes the tax declaration based on the invoice stored on the blockchain and corresponding to the invoice identifier.
可选的,还包括:Optional, also includes:
标记单元76,在完成纳税申报后,将与所述发票标识对应的发票标记为已申报状态。The marking unit 76 marks the invoice corresponding to the invoice identifier as declared after the tax declaration is completed.
可选的,所述区块链为联盟链;所述联盟链的成员节点包括:支付平台、税务机关。Optionally, the blockchain is an alliance chain; the member nodes of the alliance chain include: a payment platform and a tax authority.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设 备或者这些设备中的任意几种设备的组合。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 with 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.
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory, random access memory (RAM) and/or non-volatile memory in computer-readable media, such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including permanent and non-permanent, removable and non-removable media, can store information by any method or technology. The information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. As defined in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个......”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements includes not only those elements, but also includes Other elements not explicitly listed, or include elements inherent to this process, method, commodity, or equipment. Without more restrictions, the element defined by the sentence "include one..." does not exclude that there are other identical elements in the process, method, commodity or equipment that includes the element.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order shown or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或 多个相关联的列出项目的任何或所有可能组合。The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only, and is not intended to limit one or more embodiments of this specification. The singular forms "a", "said" and "the" used in one or more embodiments of the present specification and the appended claims are also intended to include the majority 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 one or more embodiments in this specification may use the terms first, second, third, etc. 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 one or more embodiments of this specification, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein can be interpreted as "when..." or "when..." or "in response to a determination".
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。The above are only preferred embodiments of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. Anything within the spirit and principle of one or more embodiments of this specification, Any modifications, equivalent replacements, improvements, etc., should be included within the scope of protection of one or more embodiments of this specification.

Claims (13)

  1. 一种基于区块链的发票创建方法,应用于区块链节点,所述方法包括:A blockchain-based invoice creation method is applied to blockchain nodes. The method includes:
    接收用户通过客户端提交的发票创建请求;其中,所述发票创建请求包括交易标识和用户输入的发票创建信息;Receiving an invoice creation request submitted by a user through a client; wherein the invoice creation request includes a transaction identifier and invoice creation information input by the user;
    响应于所述发票创建请求,确定所述区块链上是否存证了与所述交易标识对应的目标交易;以及,用于指示所述目标交易为有效交易的至少一种关键信息;In response to the invoice creation request, determining whether a target transaction corresponding to the transaction identifier is deposited on the blockchain; and, at least one piece of key information for indicating that the target transaction is a valid transaction;
    如果确定所述区块链上存证了所述目标交易和所述关键信息,调用智能合约中声明的发票创建逻辑,根据所述发票创建信息为所述目标交易创建发票,并将创建的发票发布至所述区块链。If it is determined that the target transaction and the key information are stored on the blockchain, call the invoice creation logic declared in the smart contract, create an invoice for the target transaction based on the invoice creation information, and then create the invoice Publish to the blockchain.
  2. 根据权利要求1所述的方法,所述如果确定所述区块链上存证了所述目标交易和所述关键信息,调用智能合约中声明的发票创建逻辑,包括:According to the method of claim 1, if it is determined that the target transaction and the key information are certified on the blockchain, calling the invoice creation logic declared in the smart contract includes:
    如果确定所述区块链上存证了所述目标交易和所述至少一种关键信息,进一步确定所述至少一种关键信息中的各种关键信息是否完整;If it is determined that the target transaction and the at least one key information are stored on the blockchain, it is further determined whether the various key information in the at least one key information is complete;
    如果是,调用智能合约中声明的发票创建逻辑。If yes, call the invoice creation logic declared in the smart contract.
  3. 根据权利要求1所述的方法,所述至少一种关键信息包含以下至少之一:与所述目标交易对应的订单记录、物流记录、支付记录;以及,与所述目标交易对应的参与方的身份信息。The method according to claim 1, wherein the at least one key information includes at least one of the following: an order record, a logistics record, and a payment record corresponding to the target transaction; and, the participant's corresponding to the target transaction Identity Information.
  4. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    接收用户通过客户端提交的纳税申报请求;其中,所述纳税申报请求包括发票标识;Receive a tax declaration request submitted by a user through a client; wherein the tax declaration request includes an invoice identifier;
    响应于所述纳税申报请求,调用智能合约中声明的发票申报逻辑,基于所述区块链上存证的与所述发票标识对应的发票完成纳税申报。In response to the tax declaration request, the invoice declaration logic declared in the smart contract is invoked, and the tax declaration is completed based on the invoice stored on the blockchain and corresponding to the invoice identifier.
  5. 根据权利要求4所述的方法,还包括:The method of claim 4, further comprising:
    在完成纳税申报后,将与所述发票标识对应的发票标记为已申报状态。After completing the tax declaration, the invoice corresponding to the invoice identifier is marked as declared.
  6. 根据权利要求1所述的方法,所述区块链为联盟链;所述联盟链的成员节点包括:支付平台、税务机关。According to the method of claim 1, the blockchain is a consortium chain; the member nodes of the consortium chain include: payment platforms and tax authorities.
  7. 一种基于区块链的发票创建装置,应用于区块链节点,所述装置包括:A blockchain-based invoice creation device applied to blockchain nodes, the device includes:
    第一接收单元,接收用户通过客户端提交的发票创建请求;其中,所述发票创建请求包括交易标识和用户输入的发票创建信息;The first receiving unit receives the invoice creation request submitted by the user through the client; wherein the invoice creation request includes a transaction identifier and invoice creation information input by the user;
    确定单元,响应于所述发票创建请求,确定所述区块链上是否存证了与所述交易标识对应的目标交易;以及,用于指示所述目标交易为有效交易的至少一种关键信息;A determining unit, in response to the invoice creation request, determining whether a target transaction corresponding to the transaction identifier is deposited on the blockchain; and, at least one piece of key information for indicating that the target transaction is a valid transaction ;
    创建单元,如果确定所述区块链上存证了所述目标交易和所述关键信息,调用智能 合约中声明的发票创建逻辑,根据所述发票创建信息为所述目标交易创建发票,并将创建的发票发布至所述区块链。The creation unit, if it is determined that the target transaction and the key information are stored on the blockchain, call the invoice creation logic declared in the smart contract, create an invoice for the target transaction based on the invoice creation information, and The created invoice is posted to the blockchain.
  8. 根据权利要求7所述的装置,所述创建单元具体用于:The apparatus according to claim 7, the creation unit is specifically configured to:
    如果确定所述区块链上存证了所述目标交易和所述至少一种关键信息,进一步确定所述至少一种关键信息中的各种关键信息是否完整;If it is determined that the target transaction and the at least one key information are stored on the blockchain, it is further determined whether the various key information in the at least one key information is complete;
    如果是,调用智能合约中声明的发票创建逻辑。If yes, call the invoice creation logic declared in the smart contract.
  9. 根据权利要求7所述的装置,所述至少一种关键信息包含以下至少之一:与所述目标交易对应的订单记录、物流记录、支付记录;以及,与所述目标交易对应的参与方的身份信息。The apparatus according to claim 7, the at least one piece of key information includes at least one of the following: an order record, a logistics record, and a payment record corresponding to the target transaction; and, the participant's corresponding to the target transaction Identity Information.
  10. 根据权利要求7所述的装置,还包括:The apparatus according to claim 7, further comprising:
    第二接收单元,接收用户通过客户端提交的纳税申报请求;其中,所述纳税申报请求包括发票标识;The second receiving unit receives the tax declaration request submitted by the user through the client; wherein the tax declaration request includes an invoice identifier;
    申报单元,响应于所述纳税申报请求,调用智能合约中声明的发票申报逻辑,基于所述区块链上存证的与所述发票标识对应的发票完成纳税申报。The declaration unit, in response to the tax declaration request, invokes the invoice declaration logic declared in the smart contract, and completes the tax declaration based on the invoice stored on the blockchain and corresponding to the invoice identifier.
  11. 根据权利要求10所述的装置,还包括:The apparatus according to claim 10, further comprising:
    标记单元,在完成纳税申报后,将与所述发票标识对应的发票标记为已申报状态。The marking unit, after completing the tax declaration, marks the invoice corresponding to the invoice identifier as declared.
  12. 根据权利要求7所述的装置,所述区块链为联盟链;所述联盟链的成员节点包括:支付平台、税务机关。The device according to claim 7, wherein the blockchain is an alliance chain; member nodes of the alliance chain include: a payment platform and a tax authority.
  13. 一种电子设备,包括:An electronic device, including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-6中任一项所述的方法。Wherein, the processor executes the executable instruction to implement the method according to any one of claims 1-6.
PCT/CN2019/113422 2018-12-13 2019-10-25 Blockchain-based invoice creation method and apparatus, and electronic device WO2020119287A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811522366.X 2018-12-13
CN201811522366.XA CN110060112A (en) 2018-12-13 2018-12-13 Invoice creation method and device, electronic equipment based on block chain

Publications (1)

Publication Number Publication Date
WO2020119287A1 true WO2020119287A1 (en) 2020-06-18

Family

ID=67315406

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/113422 WO2020119287A1 (en) 2018-12-13 2019-10-25 Blockchain-based invoice creation method and apparatus, and electronic device

Country Status (3)

Country Link
CN (1) CN110060112A (en)
TW (1) TWI762818B (en)
WO (1) WO2020119287A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100588A (en) * 2020-09-10 2020-12-18 支付宝(杭州)信息技术有限公司 Block chain-based digital seal application method and device and electronic equipment
CN112256799A (en) * 2020-11-12 2021-01-22 腾讯科技(深圳)有限公司 Data processing method and device based on block chain, server and storage medium
CN112488777A (en) * 2020-10-31 2021-03-12 远光软件股份有限公司 Bill processing method and related device
CN112561679A (en) * 2020-12-08 2021-03-26 爱信诺征信有限公司 Credit investigation system, credit investigation method, electronic device and storage medium
CN114997877A (en) * 2021-08-25 2022-09-02 福建宏创科技信息有限公司 Network topology data analysis method of IP of virtual currency public link network transaction node, storage medium and electronic equipment
CN116228265A (en) * 2023-03-24 2023-06-06 北京中诺链捷数字科技有限公司 Invoice risk identification method, device and equipment

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110046945A (en) * 2018-12-13 2019-07-23 阿里巴巴集团控股有限公司 Invoice creation method and device, electronic equipment based on block chain
CN110060112A (en) * 2018-12-13 2019-07-26 阿里巴巴集团控股有限公司 Invoice creation method and device, electronic equipment based on block chain
CN111914023B (en) * 2019-07-31 2024-06-14 创新先进技术有限公司 Bill management method and device based on blockchain and electronic equipment
US10956903B2 (en) 2019-07-31 2021-03-23 Advanced New Technologies Co., Ltd. Obtaining a blockchain-based, real-name, electronic bill
US10789628B2 (en) 2019-07-31 2020-09-29 Alibaba Group Holding Limited Blockchain-based bill number allocation method, apparatus and electronic device
CN112581197A (en) * 2019-07-31 2021-03-30 创新先进技术有限公司 Bill number distribution method and device based on block chain and electronic equipment
CN110472914A (en) * 2019-08-15 2019-11-19 上海天地汇供应链科技有限公司 A kind of invoice management method and system based on block chain
CN110443660B (en) * 2019-08-15 2022-03-08 上海天地汇供应链科技有限公司 Block chain-based electronic invoice device, system and implementation method
CN110599268A (en) * 2019-09-16 2019-12-20 腾讯科技(深圳)有限公司 Electronic bill generating method, electronic bill generating device, computer equipment and storage medium
CN110599269A (en) * 2019-09-16 2019-12-20 腾讯科技(深圳)有限公司 Bill generation method and device, computer readable storage medium and computer equipment
CN110599273B (en) * 2019-09-20 2021-07-06 腾讯科技(深圳)有限公司 Data processing method, data processing device, node equipment and storage medium
CN110599272B (en) * 2019-09-20 2024-05-14 腾讯科技(深圳)有限公司 Method for issuing electronic invoice and related products
CN110599347A (en) * 2019-09-25 2019-12-20 腾讯科技(深圳)有限公司 Bill processing method, device, computer readable storage medium and computer equipment
CN110599275A (en) * 2019-09-27 2019-12-20 腾讯科技(深圳)有限公司 Data processing method and device based on block chain network and storage medium
CN110738471A (en) * 2019-10-14 2020-01-31 腾讯科技(深圳)有限公司 bill management method based on block chain network and related equipment
CN110807679B (en) * 2019-10-16 2024-04-05 腾讯科技(深圳)有限公司 Taxi invoice generation method and device based on blockchain
CN112787837A (en) * 2019-11-07 2021-05-11 华为技术有限公司 Data sharing method, device and system
CN110866755A (en) * 2019-11-19 2020-03-06 腾讯科技(深圳)有限公司 Processing method, equipment and medium for bill data
SG10202000173WA (en) * 2020-01-08 2020-07-29 Alipay Labs Singapore Pte Ltd Methods And Devices For Mitigating Invoice Financing Fraud
CN111339567A (en) * 2020-02-25 2020-06-26 四川长虹电器股份有限公司 Accounting method and accounting system based on block chain
CN111488348A (en) * 2020-04-08 2020-08-04 北京瑞策科技有限公司 Data storage method and device for service data block chain
CN117892354A (en) * 2024-03-11 2024-04-16 云账户技术(天津)有限公司 Electronic receipt management method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160371680A1 (en) * 2015-06-19 2016-12-22 Stanley Kevin Miles Systems and methods for secure payment
CN106952124A (en) * 2017-03-16 2017-07-14 北京牛链科技有限公司 Electronic bill management system and method based on distribution book keeping operation
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
CN110060112A (en) * 2018-12-13 2019-07-26 阿里巴巴集团控股有限公司 Invoice creation method and device, electronic equipment based on block chain

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202904768U (en) * 2012-10-10 2013-04-24 深圳桑达商用机器有限公司 Self-service invoice generation device
WO2017098519A1 (en) * 2015-12-08 2017-06-15 Tallysticks Limited A system and method for automated financial transaction validation, processing and settlement using blockchain smart contracts
KR102639537B1 (en) * 2016-10-28 2024-02-23 엔체인 홀딩스 리미티드 Systems and methods for implementing deterministic finite automata(dfas) via a blockchain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160371680A1 (en) * 2015-06-19 2016-12-22 Stanley Kevin Miles Systems and methods for secure payment
CN106952124A (en) * 2017-03-16 2017-07-14 北京牛链科技有限公司 Electronic bill management system and method based on distribution book keeping operation
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
CN110060112A (en) * 2018-12-13 2019-07-26 阿里巴巴集团控股有限公司 Invoice creation method and device, electronic equipment based on block chain

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100588A (en) * 2020-09-10 2020-12-18 支付宝(杭州)信息技术有限公司 Block chain-based digital seal application method and device and electronic equipment
CN112488777A (en) * 2020-10-31 2021-03-12 远光软件股份有限公司 Bill processing method and related device
CN112488777B (en) * 2020-10-31 2024-01-16 远光软件股份有限公司 Bill processing method and related device
CN112256799A (en) * 2020-11-12 2021-01-22 腾讯科技(深圳)有限公司 Data processing method and device based on block chain, server and storage medium
CN112561679A (en) * 2020-12-08 2021-03-26 爱信诺征信有限公司 Credit investigation system, credit investigation method, electronic device and storage medium
CN112561679B (en) * 2020-12-08 2024-02-13 爱信诺征信有限公司 Credit investigation system, method, electronic equipment and storage medium
CN114997877A (en) * 2021-08-25 2022-09-02 福建宏创科技信息有限公司 Network topology data analysis method of IP of virtual currency public link network transaction node, storage medium and electronic equipment
CN116228265A (en) * 2023-03-24 2023-06-06 北京中诺链捷数字科技有限公司 Invoice risk identification method, device and equipment

Also Published As

Publication number Publication date
TWI762818B (en) 2022-05-01
TW202022857A (en) 2020-06-16
CN110060112A (en) 2019-07-26

Similar Documents

Publication Publication Date Title
WO2020119287A1 (en) Blockchain-based invoice creation method and apparatus, and electronic device
WO2020119286A1 (en) Blockchain-based invoice creating method and apparatus, and electronic device
WO2020134699A1 (en) Blockchain-based invoice reimbursement method and device and electronic device
JP7429281B2 (en) Methods and systems for directing exchanges associated with tokens held anonymously on a blockchain
US11544794B2 (en) Claim settlement method and apparatus employing blockchain technology
WO2021017429A1 (en) Blockchain-based note real name claim method and apparatus, and electronic device
US10956903B2 (en) Obtaining a blockchain-based, real-name, electronic bill
WO2020155789A1 (en) Blockchain-based certificate storage method and apparatus
WO2021017438A1 (en) Blockchain-based electronic bill cancellation method and apparatus, and electronic device
TW202004633A (en) Blockchain transaction reconciliation method and apparatus, and electronic device
US20200074458A1 (en) Privacy preserving transaction system
WO2020220759A1 (en) Block chain-based payment method and device
TW201937436A (en) Blockchain based transaction execution method and device and electronic equipment
CN110032598B (en) Method and device for updating field and electronic equipment
US20200175588A1 (en) Blockchain-based payment
EP3905178A1 (en) Blockchain-based resource allocation method and apparatus, and electronic device
WO2020119293A1 (en) Content pushing method and apparatus, and electronic device
CN112200569B (en) Digital seal using method and device based on block chain and electronic equipment
WO2020082886A1 (en) Authentication method and apparatus as well as electronic device
WO2020220740A1 (en) Blockchain-based invoice creation method, apparatus and electronic device
WO2020019799A1 (en) Object selection method and device and electronic device
TW202016819A (en) Block-chain transaction method and device and electronic device
CN111402033A (en) Asset information management method and device based on block chain
CN111340628A (en) Asset information management method and device based on block chain
US20200175622A1 (en) Processing ledger transactions in a blockchain

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: 19897411

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: 19897411

Country of ref document: EP

Kind code of ref document: A1