Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with this specification one or more embodiment.Phase
Instead, they are only some aspects phases with the one or more embodiments of as detailed in the attached claim, this specification
The example of consistent device and method.
It should be understood that the sequence that might not show and describe according to this specification in other embodiments executes
The step of correlation method.In some other embodiments, step included by method can than described in this specification more
It is more or less.In addition, single step described in this specification, may be broken down into other embodiments multiple steps into
Row description;And multiple steps described in this specification, it may also be merged into single step progress in other embodiments
Description.
Fig. 1 is a kind of flow chart for invoice creation method based on block chain that an exemplary embodiment provides.Such as Fig. 1 institute
To show, this method is applied to block chain node, it may comprise steps of:
Step 102, the invoice request to create that user is submitted by client is received;Wherein, the invoice request to create packet
Include the invoice creation information of transaction ID and user's input.
In one embodiment, mobile phone, tablet computer, the smartwatch that client can use for transaction participant etc. is any
The electronic equipment of type, this specification are limited not to this.Transaction participant is registered by logging on an electronic device
Account can be interacted with the block chain link point for accessing the electronic equipment.
In one embodiment, transaction participant can be sent by client to block chain node after completing a transaction
Record request is so that the Transaction Information of the transaction is distributed to block chain by the block chain node.For example, Transaction Information can wrap
Include transaction ID, transaction platform, transaction amount, transaction content, transaction participant, exchange hour etc..Certainly, this specification is not
The particular content of Transaction Information is limited.
Step 104, in response to the invoice request to create, determine that card whether is deposited on block chain to be had and the transaction ID pair
The target transaction answered.
In one embodiment, there can be corresponding target transaction according to card whether is deposited on transaction ID lookup block chain.Change speech
It, need to determine it is corresponding with the transaction ID transaction whether objective reality.Further, if depositing card on block chain has the target
Transaction, then invoice can be created for the target transaction.By the way that Transaction Information is distributed to block chain, so that each block chain node
Record has a complete Transaction Information that will not influence entirety even when the problem of corrupted data occurs in some node
Data integrity;Meanwhile can make full use of block chain storing data can not tamper, thus prevent criminal malice repair
Change Transaction Information, ensure that the safety of recorded Transaction Information and transparent, trace to the source convenient for user.And based on Transaction Information on chain
Deposit card, when receiving the invoice request to create for target transaction, the invoice stated in intelligent contract creation can be called to patrol
Volume, invoice is created for the target transaction, is issued invoice to realize based on the transaction that block chain is an objective reality.
Step 106, if depositing card on the block chain has the target transaction, the invoice wound stated in intelligent contract is called
Logic is built, creating information according to the invoice is that the target transaction creates invoice, and the invoice of creation is distributed to the area
Block chain.
In one case, invoice creation information may include the new line information and transaction corresponding with transaction ID of invoice
Transaction Information (being inputted by user), block chain node after receiving invoice request to create will invoice create information in includes
The Transaction Information (corresponding with transaction ID) that card is deposited on Transaction Information and block chain compares, when comparing result is the two one
When cause, the Transaction Information for including in information is directly created according to invoice and new line information is that target transaction creates invoice.For example, area
Block chain node reads the Transaction Information for including in invoice creation information and is calculated first after receiving invoice request to create
Cryptographic Hash, will be deposited in first cryptographic Hash and block chain the second cryptographic Hash of the Transaction Information (corresponding with transaction ID) of card into
Row comparison, when the first cryptographic Hash is equal with the second cryptographic Hash, it may be determined that the Transaction Information of user's input is target transaction
Transaction Information, then can be directly that target transaction creates invoice according to the Transaction Information of user's input and new line information, without
Read the Transaction Information that the target transaction of card is deposited on block chain.
In another case, invoice creation information can only include the new line information of invoice, and block chain node is receiving
To invoice request to create and after determining that depositing card on block chain has target transaction, the target transaction that card is deposited on block chain is further read
Transaction Information, further according to the Transaction Information and invoice read new line information be target transaction create invoice.
In one embodiment, if depositing card on the block chain has the target transaction, the target can be further determined that
Whether transaction is effectively to trade;If so, calling the invoice creation logic stated in intelligent contract.By determining target friendship
After the easy transaction for an objective reality, further determine that whether target transaction is that (can be regarded as target transaction is for effective transaction
One transaction really occurred), user can be effectively prevent to write out falsely invoice.
And when whether determine target transaction is effectively to trade, using at least the one of the target transaction for depositing card on block chain
Kind key message.Participant trade after completing a transaction, in addition to Transaction Information, it is effective for being also used to indicate the transaction
At least one key message of transaction is also sent to block chain node, so that the key message is distributed to by the block chain node
Block chain.Further, the Transaction Information of transaction and key message can be associatedly distributed on block chain by block chain node.Base
Card is deposited in the above-mentioned key message to transaction, in one case, it may be determined that whether deposit to have demonstrate,proved on block chain and be used to indicate mesh
Mark transaction is at least one key message effectively traded, if so, can determine that target transaction is effectively transaction.In another feelings
Under condition, it can first determine whether to deposit on block chain and demonstrate,prove that be used to indicate target transaction be at least one key message effectively traded,
At least one key message has been demonstrate,proved if it is determined that depositing on block chain, can have been further determined that each at least one key message
Whether kind key message is complete, if so, can determine that target transaction is effectively transaction.Wherein, which can
To include at least one of: order record corresponding with target transaction, logistics record, payment record;And with target transaction
The identity information of corresponding participant.
It should be noted that whether above-mentioned determining target transaction is the operation effectively traded, it can be by block chain node itself
Execute, can also by be deployed on block chain in advance intelligent contract (statement has check logic, for determine it is any transaction whether be
Effectively transaction) Lai Zhihang, this specification limited not to this.
In one embodiment, a/d is being created for target transaction, can be further labeled as target transaction having created hair
Ticket state.Wherein, a field can be added in the field for depositing card target transaction for marking invoice creation state, can also additionally be existed
The invoice creation state for demonstrate,proving the target transaction is deposited in association on block chain, and this specification is limited not to this.It is handed over by record
Easy invoice creation state can first determine and the invoice when receiving the invoice request to create that user is submitted by client
The invoice creation state of the corresponding transaction of request to create;If invoice status has been created, then can directly be returned to client
Otherwise the prompting message to issue invoice enters the process of above-mentioned creation invoice.
In one embodiment, based on the invoice created and target transaction are associatedly distributed to block chain, intelligence can be disposed
Energy contract is used to carry out tax declaration to invoice, to realize the tax declaration based on block chain to invoice.Therefore, block chain node
It can receive the tax declaration request (tax declaration request includes that invoice identifies) that user is submitted by client, and received in response to this
Tax declares request, and the invoice stated in intelligent contract is called to declare logic, based on depositing card on block chain and invoice mark pair
The invoice answered completes tax declaration.Similar, after completing tax declaration, invoice corresponding with invoice mark can be labeled as
State is declared.Wherein, a field can be added in the field for depositing card invoice for marking invoice to declare state, can also additionally be existed
On block chain association deposit demonstrate,prove the transaction invoice declare state, this specification is limited not to this.Pass through record invoice
Invoice declares state, when receiving the tax declaration request that user is submitted by client, can first determine and the tax declaration
The invoice of corresponding invoice is requested to declare state;If the state of having declared, then can directly be mentioned to what client return had been declared
Show message, otherwise enters the process of above-mentioned tax declaration.
In one embodiment, above-mentioned block chain can be alliance's chain, and the member node of alliance's chain may include payment platform
And the tax authority.Wherein, the tax authority can be used as monitoring party and check the information such as the transaction for depositing card on block chain, invoice.
Fig. 2 is a kind of overall architecture schematic diagram for invoice creation scheme that an exemplary embodiment provides.As shown in Fig. 2,
Between transaction participant after completing a transaction, record request can be sent so that service to server 22 by client 21
The Transaction Information of the transaction is distributed to block chain by device 22.Further, when participant of trading has the demand to issue invoice,
Invoice request to create can be sent to server 22 by client 21, server 22 receive the invoice request to create (including
Transaction ID and user input invoice create information) after, determine whether deposited on block chain card have it is corresponding with the transaction ID
Target transaction, and call the invoice stated in intelligent contract to create logic in the case where depositing card on block chain and having target transaction and be
Target transaction creates invoice, and the invoice of creation is distributed to block chain.
In order to make it easy to understand, the operation realized during invoice creates respectively below for client 21, server 22
And function, it is described in detail in conjunction with the invoice creation scheme of Fig. 3-5 pairs of this specification.Fig. 3 is that an exemplary embodiment provides
Transaction cochain interaction schematic diagram.As shown in figure 3, the interactive process may comprise steps of:
Step 302, the foundation to binding relationship is realized between client 21 and server 22.
In one embodiment, the binding relationship of required foundation is the trade identity information of participant and the equipment of client 21
Binding relationship between information.Based on the binding relationship, so that server 22 is in the transaction for receiving the subsequent transmission of client 21
When record request, invoice request to create and tax declaration are requested, it can be confirmed that these requests correspond to the transaction participant.
For example, transaction participant can carry out account registration at server 22 in advance, and it is unique right with itself to obtain
The registered account answered.Then, transaction participant can be by logging in the registered account in client 21, and server 22
Based on the log-on message of the registered account in client 21, the registered account (corresponding to transaction participant) and visitor are determined
Binding relationship is established between family end 21.
Step 304, client 21 signs to transaction to be recorded and key message.
In one embodiment, it between transaction participant after completing transaction, can be submitted by client 21 to server 22
Transaction record request, so that the key message of Transaction Information to be recorded and the transaction is distributed to block chain by server 22
In.Wherein, transaction participant registered in advance can obtain unique corresponding digital identity, and the digital identity is by one group of public private key pair
It is characterized.Correspondingly, client 21 get transaction participant input Transaction Information and the transaction key message after,
Produce transaction record request (comprising Transaction Information and key message) and by the digital identity corresponding to transaction participant
Private key signs to transaction record request.
Step 306, client 21 submits transaction record request to server 22.
Step 308, the verifying of server 22 signature.
In one embodiment, the client for having block chain is run on server 22, so that the server 22 is configured as one
Block chain node.After receiving transaction record request, the binding relationship that can be established based on above-mentioned steps 302 is determined server 22
The identity of transaction participant out is asked to carry out sign test by the public key for corresponding to transaction participant with the determining transaction record
It asks and is authorized by the transaction participant, and not pretend to be the identity of the transaction participant to send by criminal.
In one embodiment, when sign test does not pass through, since client first passes through registered account and transaction participant in advance
Binding shows the identity for pretending to be transaction participant there may be criminal, then can trigger alarm operation and temporarily block visitor
Family terminates the permission into block chain node.
Step 310, Transaction Information and key message are distributed to block chain by server 22 in association.
For example, Transaction Information may include transaction ID, transaction platform, transaction amount, transaction content, transaction participation
Side, exchange hour etc.;Key message may include order record, logistics record, payment record, trade participant identity information
Deng.Wherein, order information can be the object of the contract, transaction signed between transaction participant (for example, commodity, technical support
Deng) detail content;Logistics record can be the logistics information of the object of transaction;Payment record can be between transaction participant
Payment and gathering detail, bank of deposit's title, bank of deposit's account etc.;Transaction participant identity information can be Business Name,
Taxpayer Identification Number, registered address etc..Certainly, this specification does not limit the particular content of Transaction Information and key message
System.
Fig. 4 is referred to, Fig. 4 is the flow chart for the invoice creation method based on block chain that an exemplary embodiment provides.
As shown in figure 4, this method is applied to block chain node (by taking server 22 as an example), may comprise steps of:
Step 402, it receives user and passes through the invoice request to create that client 21 is submitted.
In one embodiment, invoice request to create includes the invoice creation letter that transaction ID and user are inputted by client
Breath.
Step 404, if depositing card on block chain has target transaction, it is transferred to step 406B;Otherwise, it is transferred to step 406A.
Step 406A returns to the prompting message that transaction is not present to client 21.
In one embodiment, it can determine that card whether is deposited on block chain mesh corresponding with the transaction ID according to transaction ID
Mark transaction.When not depositing card target transaction on block chain, illustrate that client 21 requests the corresponding transaction of the invoice of creation (i.e. at this time
Target transaction) it is not the transaction of objective reality, therefore can return to the prompting message to remind customer transaction to be not present.
Step 406B is transferred to step if the target transaction for depositing card on block chain is marked as having created invoice status
408A;Otherwise, it is transferred to step 408B.
Step 408A returns to the prompting message that invoice has been issued to client 21.
Step 408B is transferred to step 410B if the key message that card has target transaction is deposited in association on block chain;Otherwise,
It is transferred to step 410A.
Step 410A returns to the prompting message of transaction invalid to client 21.
It is undertaken in step 408B, when the not associated key message for depositing card target transaction on block chain, illustrates client at this time
(i.e. target transaction is not a true hair for the not effective transaction of the corresponding transaction (i.e. target transaction) of invoice of 21 request creation of end
The transaction given birth to;In other words, there are deceptive information for target transaction), therefore can return to the prompting message to remind user's transaction
To trade in vain.
Be undertaken in step 410B, when on block chain association deposit card key message it is imperfect when, illustrate client 21 at this time
Requesting the not effective transaction of the corresponding transaction (i.e. target transaction) of invoice of creation, (i.e. target transaction is not one and really occurred
Transaction;In other words, there are at least part of deceptive information for target transaction), therefore can return to the prompting message to remind use
The family transaction is invalid transaction.For example, key message includes order record, logistics record, payment record and transaction participant
Identity information, it is assumed that when only the order record for having demonstrate,proved target transaction, payment record and transaction participant are deposited in association on block chain
Identity information, and and it is not associated deposit card payment record, then can determine that target transaction is invalid transaction.
Step 410B is transferred to step 412 if key message is complete;Otherwise, it is transferred to step 410A.
In one embodiment, whether above-mentioned determining target transaction is the operation (step 406B-410B) effectively traded, can be by
Server 22 itself executes, can also (statement has check logic, for determining by the intelligent contract that is deployed on block chain in advance
Whether any transaction is effectively to trade) Lai Zhihang, this specification limited not to this.As it can be seen that passing through above-mentioned judgement target
Whether transaction is the process effectively traded, and user can be effectively prevent to write out falsely invoice.
Step 412, the invoice creation logic stated in intelligent contract is called, information is created as target transaction wound according to invoice
Build invoice.
In one embodiment, which can be deployed in advance block chain by payment mechanism and the tax authority.
In one case, the invoice creation information of user's input may include the new line information and target transaction of invoice
Invoice is created the Transaction Information and block chain for including in information by Transaction Information, server 22 after receiving invoice request to create
On deposit the Transaction Information (corresponding with transaction ID) of card and compare, when comparing result both is consistent, directly according to hair
The Transaction Information and new line information for including in ticket creation information are that target transaction creates invoice.For example, server 22 is receiving
After invoice request to create, read invoice creation information in include Transaction Information and the first cryptographic Hash is calculated, by this first
The second cryptographic Hash that the Transaction Information (corresponding with transaction ID) of card is deposited in cryptographic Hash and block chain compares, when the first Kazakhstan
When uncommon value is equal with the second cryptographic Hash, it may be determined that the Transaction Information that user inputs is the Transaction Information of target transaction, then can
It is directly that target transaction creates invoice according to the Transaction Information of user's input and new line information, deposits card on block chain without reading
Target transaction Transaction Information, thus improve creation invoice efficiency.
In another case, the invoice creation information of user's input can only include the new line information of invoice, server
22 after receiving invoice request to create and determining that depositing card on block chain has target transaction, further read on block chain and deposit card
The Transaction Information of target transaction, the new line information further according to the Transaction Information and invoice read are target transaction creation hair
Ticket.
Step 414, the invoice of creation is distributed to block chain.
Step 416, target transaction is labeled as having created invoice status.
In one embodiment, can be in creation a/d just by target transaction labeled as having created invoice status, it can also be with
Again by target transaction labeled as invoice status has been created after the invoice of creation is distributed to block chain, this specification is not to this
It is limited.
In one embodiment, a field can be added in the field for depositing card target transaction to be used to mark invoice creation state,
The invoice creation state deposited and demonstrate,prove the target transaction can also be additionally associated on block chain, this specification is limited not to this.
Can first it be sentenced by the invoice creation state of record transaction when receiving the invoice request to create that user is submitted by client
The invoice creation state of fixed transaction corresponding with the invoice request to create;It, then can be directly to visitor if invoice status has been created
Family end returns to the prompting message to have issued invoice, otherwise enters the process of above-mentioned creation invoice.
Fig. 5 is referred to, Fig. 5 is the flow chart for the invoice declaration method based on block chain that an exemplary embodiment provides.
As shown in figure 5, this method is applied to block chain node (by taking server 22 as an example), may comprise steps of:
Step 502, the tax declaration request that user is submitted by client 21 is received.
In one embodiment, tax declaration request includes transaction ID.
Step 504, it if the invoice corresponding with invoice mark for depositing card on block chain is marked as the state of having declared, is transferred to
Step 510;Otherwise, it is transferred to step 506.
Step 506, the invoice stated in intelligent contract is called to declare logic, based on depositing identifying with invoice for card on block chain
Corresponding invoice completes tax declaration.
In one embodiment, which can be deployed in advance block chain by payment mechanism and the tax authority.
Step 508, invoice corresponding with invoice mark is labeled as having declared state.
In one embodiment, a field can be added in depositing the field for demonstrate,proving the invoice to be used to that invoice to be marked to declare state,
Can additionally on block chain association deposit demonstrate,prove the invoice invoice declare state, this specification is limited not to this.Pass through note
The invoice of record invoice declares state, when receiving the tax declaration request that user is submitted by client, can first determine and be somebody's turn to do
Tax declaration requests the invoice of corresponding invoice to declare state;If the state of having declared, then can directly be returned to client
Otherwise the prompting message declared enters the process of above-mentioned tax declaration.
Step 510, the prompting message that invoice has been declared is returned to client 21.
It should be noted that the transaction in block chain, there are points of the transaction of narrow sense and the transaction of broad sense.The friendship of narrow sense
Easily refer to the value Transfer that user issues to block chain;For example, in traditional bit coin block chain network, transaction can be with
It is that initiate in block chain one of user transfers accounts.And the transaction of broad sense refers to that one that user issues to block chain has business
The business datum of intention;For example, operator can build alliance's chain based on actual business demand, chain portion, alliance is relied on
Affix one's name to it is some it is unrelated with value Transfer it is other types of in line service (for example, business of renting a house, vehicle scheduling business, settlement of insurance claim
Business, credit services, medical services etc.), and in this kind of alliance's chain, transaction can be one that user issues in alliance's chain
The service message or service request being intended to business.
Fig. 6 is a kind of schematic configuration diagram for equipment that an exemplary embodiment provides.Referring to FIG. 6, in hardware view, it should
Equipment includes processor 602, internal bus 604, network interface 606, memory 608 and nonvolatile memory 610, is gone back certainly
It may include hardware required for other business.Processor 602 reads corresponding computer journey from nonvolatile memory 610
Then sequence is run into memory 608, the invoice creating device based on block chain is formed on logic level.Certainly, in addition to software
Except implementation, this specification one or more embodiment is not precluded other implementations, such as logical device or soft
Mode of combination of hardware etc., that is to say, that the executing subject of following process flow is not limited to each logic unit, can also
To be hardware or logical device.
Referring to FIG. 7, being somebody's turn to do the invoice creating device based on block chain may include: in Software Implementation
Receiving unit 71 receives the invoice request to create that user is submitted by client;Wherein, the invoice request to create
The invoice inputted including transaction ID and user creates information;
Determination unit 72 determines that card whether is deposited on block chain to be had and the trading standard in response to the invoice request to create
Know corresponding target transaction;
Creating unit 73 calls the hair stated in intelligent contract if depositing card on the block chain has the target transaction
Ticket creates logic, and creating information according to the invoice is that the target transaction creates invoice, and the invoice of creation is distributed to institute
State block chain.
Optionally, further includes:
The target transaction is labeled as having created invoice status by marking unit 74.
Optionally, the creating unit 73 is specifically used for:
If depositing card on the block chain has the target transaction, further determine that whether the target transaction is effectively to hand over
Easily;
If so, calling the invoice creation logic stated in intelligent contract.
Optionally, the creating unit 73 is further used for:
It determines whether to deposit on the block chain and has demonstrate,proved that be used to indicate the target transaction be that effectively trade at least one is closed
Key information;
If so, determining that the target transaction is effectively transaction.
Optionally, the creating unit 73 is further used for:
It determines whether to deposit on the block chain and has demonstrate,proved that be used to indicate the target transaction be that effectively trade at least one is closed
Key information;
At least one key message has been demonstrate,proved if it is determined that depositing on the block chain, has further determined that at least one
Whether the various key messages in key message are complete;
If so, determining that the target transaction is effectively transaction.
Optionally, at least one key message includes at least one of: order corresponding with the target transaction
Record, logistics record, payment record;And the identity information of participant corresponding with the target transaction.
Optionally, the block chain is alliance's chain;The member node of alliance's chain includes: payment platform, the tax authority.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of any several equipment.
In a typical configuration, computer includes one or more processors (CPU), input/output interface, network
Interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, based on graphene
Storage medium or other magnetic storage devices or any other non-transmission medium, can be used for storing can be accessed by a computing device
Information.As defined in this article, computer-readable medium does not include temporary computer readable media (transitory media),
Such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want
There is also other identical elements in the process, method of element, commodity or equipment.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims
It is interior.In some cases, the movement recorded in detail in the claims or step can be come according to the sequence being different from embodiment
It executes and desired result still may be implemented.In addition, process depicted in the drawing not necessarily require show it is specific suitable
Sequence or consecutive order are just able to achieve desired result.In some embodiments, multitasking and parallel processing be also can
With or may be advantageous.
The term that this specification one or more embodiment uses be only merely for for the purpose of describing particular embodiments, and
It is not intended to be limiting this specification one or more embodiment.In this specification one or more embodiment and the appended claims
Used in the "an" of singular, " described " and "the" be also intended to including most forms, unless context understands earth's surface
Show other meanings.It is also understood that term "and/or" used herein refers to and includes one or more associated list
Any or all of project may combine.
It will be appreciated that though this specification one or more embodiment may using term first, second, third, etc. come
Various information are described, but these information should not necessarily be limited by these terms.These terms are only used to same type of information area each other
It separates.For example, the first information can also be referred to as in the case where not departing from this specification one or more scope of embodiments
Two information, similarly, the second information can also be referred to as the first information.Depending on context, word as used in this is " such as
Fruit " can be construed to " ... when " or " when ... " or " in response to determination ".
The foregoing is merely the preferred embodiments of this specification one or more embodiment, not to limit this theory
Bright book one or more embodiment, all within the spirit and principle of this specification one or more embodiment, that is done is any
Modification, equivalent replacement, improvement etc. should be included within the scope of the protection of this specification one or more embodiment.