Summary of the invention
A kind of invoice based on block chain that this specification embodiment provides rushes red method and device and electronic equipment:
According to this specification embodiment in a first aspect, providing a kind of invoice based on block chain rushes red method, the area
The corresponding relationship being stored in block chain between invoice and the digital digest of invoice, which comprises
Receive that client submits rushes red request for wait rush red invoice;
Red request is rushed in response to described, calculating is described wait rush the digital digest of red invoice, and inquires in the block chain
Whether with the digital digest corresponding target invoice is stored;
If inquiring and storing target invoice corresponding with the digital digest in the block chain, call publication in area
That states in the intelligent contract on block chain rushes red invoice creation logic, and creation is directed to the red invoice that rushes of the target invoice, and will
The corresponding relationship for rushing red invoice and the target invoice is stored in the block chain.
Optionally, the method also includes:
Receive the invoice request to create that client is submitted;Wherein, the invoice request to create includes the invoice of user's input
Create information;
In response to the invoice request to create, the invoice creation for calling publication to state in the intelligent contract on block chain is patrolled
Volume, information creating invoice is created based on the invoice;And
The digital digest of the invoice is calculated, and by the corresponding relationship of the invoice and the digital digest of the invoice in institute
It states and is stored in block chain.
Optionally, described to rush red request in response to described, calculating is described wait rush the digital digest of red invoice, and inquires institute
It states and whether stores target invoice corresponding with the digital digest in block chain, comprising:
Red request is rushed in response to described, the invoice validation logic for calling publication to state in the intelligent contract on block chain,
Calculate it is described wait rush the digital digest of red invoice, and inquire in the block chain whether store it is corresponding with the digital digest
Target invoice.
Optionally, the digital digest of the invoice includes:
For the invoice content of the invoice;It is calculated alternatively, the unique information in the invoice content carries out hash
The hash value arrived.
Optionally, described to rush the red invoice content requested including described wait rush red invoice;Alternatively, in the invoice content
Unique information;
Wait rush the digital digest of red invoice described in the calculating, comprising:
Obtain the invoice content wait rush red invoice rushed in red request;Alternatively, in the invoice content
Unique information;
For the invoice content described in getting wait rush red invoice;Alternatively, the uniqueness in the invoice content is believed
Breath carries out hash and hash value is calculated.
Optionally, the block chain is alliance's chain.
Optionally, the creation rushes red invoice for the target invoice, specifically includes:
Create negative amount of money invoice identical with the invoice amount of the target invoice.
Optionally, described to deposit the corresponding relationship for rushing red invoice and the target invoice in the block chain
Storage, specifically includes any in following:
The mapping relations between the negative amount of money invoice and the target invoice are established, and by the mapping relations described
It is stored in block chain;
Establish the mapping relations between the negative amount of money invoice and the digital digest of the target invoice, and by the mapping
Relationship is stored in the block chain;
Establish the mapping between the digital digest of the negative amount of money invoice, the target invoice and the target invoice
Relationship, and the mapping relations are stored in the block chain.
According to the second aspect of this specification embodiment, a kind of invoice based on block chain is provided rushes attire and set, the area
The corresponding relationship being stored between invoice and the digital digest of invoice in block chain, described device include:
Receiving unit, receive that client submits rushes red request for wait rush red invoice;
Query unit rushes red request in response to described, calculates the digital digest wait rush red invoice, and described in inquiry
Whether with the digital digest corresponding target invoice is stored in block chain;
Clearance permit member is rushed, stores target invoice corresponding with the digital digest in the block chain if inquired, is adjusted
Red invoice creation logic is rushed with what publication was stated in the intelligent contract on block chain, creation is red for rushing for the target invoice
Invoice, and the corresponding relationship for rushing red invoice and the target invoice is stored in the block chain.
Optionally, described device further include:
Request to create receiving unit receives the invoice request to create that client is submitted;Wherein, the invoice request to create packet
Include the invoice creation information of user's input;
Request to create response unit calls intelligent contract of the publication on block chain in response to the invoice request to create
The invoice of middle statement creates logic, creates information creating invoice based on the invoice;And it calculates the number of the invoice and plucks
It wants, and the corresponding relationship of the invoice and the digital digest of the invoice is stored in the block chain.
Optionally, the query unit, comprising:
Red request is rushed in response to described, the invoice validation logic for calling publication to state in the intelligent contract on block chain,
Calculate it is described wait rush the digital digest of red invoice, and inquire in the block chain whether store it is corresponding with the digital digest
Target invoice.
Optionally, the digital digest of the invoice includes:
For the invoice content of the invoice;It is calculated alternatively, the unique information in the invoice content carries out hash
The hash value arrived.
Optionally, described to rush the red invoice content requested including described wait rush red invoice;Alternatively, in the invoice content
Unique information;
In the query unit, the digital digest wait rush red invoice is calculated, comprising:
Obtain the invoice content wait rush red invoice rushed in red request;Alternatively, in the invoice content
Unique information;
For the invoice content described in getting wait rush red invoice;Alternatively, the uniqueness in the invoice content is believed
Breath carries out hash and hash value is calculated.
Optionally, the block chain is alliance's chain.
Optionally, described to rush in clearance permit member, creation rushes red invoice for the target invoice, specifically includes:
Create negative amount of money invoice identical with the invoice amount of the target invoice.
Optionally, described to rush in clearance permit member, by the corresponding relationship for rushing red invoice and the target invoice in the area
It is stored in block chain, specifically includes any in following:
The mapping relations between the negative amount of money invoice and the target invoice are established, and by the mapping relations described
It is stored in block chain;
Establish the mapping relations between the negative amount of money invoice and the digital digest of the target invoice, and by the mapping
Relationship is stored in the block chain;
Establish the mapping between the digital digest of the negative amount of money invoice, the target invoice and the target invoice
Relationship, and the mapping relations are stored in the block chain.
According to the 5th of this specification embodiment the aspect, a kind of electronic equipment is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to any of the above-described rushes red method based on the invoice of block chain.
This specification embodiment provides a kind of invoice based on block chain and rushes red case, by by invoice and invoice
Digital digest cochain carries out depositing card;Because there is the feature that can not be distorted and digital digest tool in the data stored in block chain
Some unique features (i.e. the corresponding initial data of a digital digest);Therefore, when discovery, certain invoice when the error occurs may be used
Determine that the incorrect invoice (i.e. wait rush red invoice) is corresponding on chain with the digital digest based on the invoice stored in block chain
Target invoice;And then it can create and the target invoice is associated rushes red invoice and rush red invoice and the target invoice for described
Corresponding relationship stored in the block chain;In this way, the invoice amount of the incorrect invoice can be offset.
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.On the contrary, they are only and such as institute
The example of the consistent device and method of some aspects be described in detail in attached claims, this specification.
It is only to be not intended to be limiting this explanation merely for for the purpose of describing particular embodiments in the term that this specification uses
Book.The "an" of used singular, " described " and "the" are also intended to packet in this specification and in the appended claims
Most forms are included, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein is
Refer to and includes that one or more associated any or all of project listed may combine.
It will be appreciated that though various information may be described using term first, second, third, etc. in this specification, but
These information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not taking off
In the case where this specification range, the first information can also be referred to as the second information, and similarly, the second information can also be claimed
For the first information.Depending on context, word as used in this " if " can be construed to " ... when " or
" when ... " or " in response to determination ".
Invoice (Invoice) can refer to all units or individual in purchasing and selling commodities, offer or receive service and be engaged in
In other business activities, the business voucher issuing and collect.Invoice is usually the original foundation of accounting, and audit machine
It closes, the important evidence of tax authority's examination of law enforcement.For company, invoice is mainly the foundation that account is done by company, is also simultaneously
The expense voucher paid taxes;And for employee, invoice can mainly be used to submit an expense account.
It is when being directed to find that invoice is wrong or need to correct because of other reasons that invoice, which rushes red, and the invoice issued again adjusts account
Mesh means.When invoice has kept accounts, if invoice is wrong, need to issue again one with original invoice amount the identical negative amount of money
Invoice is offset for keeping accounts.
Because there is the feature that can not distort in block chain technology, can by the way that invoice cochain is carried out to deposit card, thus
Relevant invoice business can be carried out based on the invoice stored in block chain.However, the invoice of cochain already belongs to the invoice to keep accounts,
If there are mistakes for the invoice discovery of cochain, can not equally be kept accounts by deleting invoice counteracting;Accordingly, it is desirable to provide block chain
Middle invoice rushes red scheme.
This description presents a kind of invoices based on block chain to rush red case, provides a kind of invoice based on block chain
Rush red case, if the invoice discovery of cochain there are mistake, can by generate one with the invoice is associated rushes red invoice
Mode offsets the invoice amount of the incorrect invoice.
Referring to FIG. 1, Fig. 1 is the process that the invoice based on block chain that one embodiment of this specification provides rushes red method
Scheme, the corresponding relationship being stored in the block chain between invoice and the digital digest of invoice, which comprises
Step 110: receive that client submits rushes red request for wait rush red invoice;
Step 120: rushing red request in response to described, calculate the digital digest wait rush red invoice, and described in inquiry
Whether with the digital digest corresponding target invoice is stored in block chain;
Step 130: storing target invoice corresponding with the digital digest in the block chain if inquired, call
It issues the red invoice that rushes stated in the intelligent contract on block chain and creates logic, creation rushes red hair for the target invoice
Ticket, and the corresponding relationship for rushing red invoice and the target invoice is stored in the block chain.
The block chain described in this specification can specifically include privately owned chain, shared chain and alliance's chain etc., in this theory
Without being particularly limited in bright book.
For example, in one scenario, above-mentioned block chain specifically can be by total portion mechanism, branch, agency etc.
Alliance's chain as allied member's composition;The operator of alliance's chain can rely on alliance's chain, corresponding to dispose
Business;And described above as total portion mechanism of allied member, branch, agency it all can serve as above-mentioned business
A service node.Each service node receiving can will be plucked produced by itself or with above-mentioned invoice the first number
It to be issued in alliance's chain in the form of transaction, and handle it by the common recognition of the common recognition node in alliance's chain in the transaction
Afterwards, the distributed data base in alliance's chain is stored, and " cochain " for completing above-mentioned Transaction Information deposits card.
Wherein, it should be noted that transaction (Transaction) described in this specification refers to and passes through block
The client of chain creates, and a data for needing finally to be distributed in the distributed data base of block chain.
Usually there is point of the transaction of narrow sense and the transaction of broad sense in the transaction in block chain.The transaction of narrow sense refers to use
The value Transfer that family is issued to block chain;For example, transaction can be user and exist in traditional bit coin block chain network
One initiated in block chain transfers accounts.And the transaction of broad sense refers to the industry being intended to business that user issues to block chain
Business data;For example, operator can build alliance's chain based on actual business demand, rely on the deployment of alliance's chain it is some with
Unrelated other types of line service (for example, depositing card business, authenticity verification business, invoice rushes red business etc.) of value Transfer,
And in this kind of alliance's chain, service message that transaction can be that user issues in alliance's chain one is intended to business or
Service request.
Above-mentioned client may include any type of underlying services data stored using in block chain as data branch
Support, to realize the upper layer application of specific business function.
In block chain technology, block chain interior joint carries out operation to block and usually requires to rely on corresponding intelligent contract
(Smart contract).Such as the operations such as storage, modification, deletion are required to rely on intelligent contract in block chain.The intelligence
Can contract can be it is a kind of be intended to apply contract is propagated, verified or executed in a manner of information-based can be deployed on block chain
Computer protocol.By stating that service logic may be implemented to execute corresponding operating in intelligent contract.Intelligent contract allows
Do not have to carry out credible transaction in third-party situation.These transaction are traceable and irreversible.Intelligent contract, which is capable of providing, to be better than
The safety of traditional contracts method, and reduce other transaction costs relevant to contract.In general, intelligent contract can be and be deployed in area
Block chain node is local, can call corresponding intelligent contract when node needs to be implemented some movement, run intelligent contract with
The service logic stated in intelligent contract is executed, to obtain implementing result.
Digital digest described in this specification can refer to that (hash also referred to as dissipates based on initial data progress Hash
Column) calculate after obtained hash value.Specifically, the digital digest of the invoice includes:
For the invoice content of the invoice;It is calculated alternatively, the unique information in the invoice content carries out hash
The hash value arrived.
Wherein, the invoice content may include unique information.For example, invoice content may include invoice number, hair
Ticket code;Usual invoice number and invoice codes are unique informations;Corresponding, the digital digest of invoice can be denoted as hash
(invoice number+invoice codes).Certainly, invoice content can also include nonuniqueness information, such as the date of invoice, be free of tax
Volume;Corresponding, the digital digest of invoice can be denoted as hash (invoice number+invoice codes+date of invoice+be free of tax
Volume).
Correspondingly, described to rush the red invoice content requested including described wait rush red invoice;Alternatively, in the invoice content
Unique information;
Wait rush the digital digest of red invoice described in the calculating, comprising:
Obtain the invoice content wait rush red invoice rushed in red request;Alternatively, in the invoice content
Unique information;
For the invoice content described in getting wait rush red invoice;Alternatively, the uniqueness in the invoice content is believed
Breath carries out hash and hash value is calculated.
It is noted that invoice to be identified and invoice are all made of identical hash algorithm.
As previously mentioned, invoice can be carried out cochain in advance by this specification, in one embodiment, the method also includes:
Receive the invoice request to create that client is submitted;Wherein, the invoice request to create includes the invoice of user's input
Create information;
In response to the invoice request to create, the invoice creation for calling publication to state in the intelligent contract on block chain is patrolled
Volume, information creating invoice is created based on the invoice;And
The digital digest of the invoice is calculated, and by the corresponding relationship of the invoice and the digital digest of the invoice in institute
It states and is stored in block chain.
It is illustrated below in conjunction with the schematic diagram of invoice cochain shown in Fig. 2:
In the present embodiment, user can pass through client used in it when needing to create invoice in the block chain
End initiates one for creating the transaction of invoice, i.e., initiates invoice request to create by client.Specifically, which can lead to
The invoice creation page for crossing client offer inputs the invoice creation information of target invoice to be created;For example, the lift of invoice
The information such as head, the amount of money.After the input that the user completes invoice creation information, which can be based on the invoice of user's input
Information is created to generate corresponding invoice request to create, and the node that the invoice request to create is sent in the block chain is set
It is standby.
Node device in the block chain can carry out the invoice request to create after receiving the invoice request to create
Response.The invoice creation logic for calling publication to state in the intelligent contract on block chain, based in the invoice request to create
Invoice create information creating invoice;And after completing invoice creation, the digital digest of the invoice can be further calculated,
And the corresponding relationship of the invoice and the digital digest of the invoice is stored in the block chain.
In one embodiment, in response to the node device of the invoice request to create, it can also first determine and be created with the invoice
It builds and requests the invoice creation amount of corresponding invoice issuing side whether sufficient.
For example, it can obtain invoice from the invoice creation information that the user in the invoice request to create inputs and open
The Taxpayer Identification Number of tool side, and determine that corresponding invoice issuing side, the invoice issuing side are based on the Taxpayer Identification Number
The corresponding invoice issuing side of invoice request to create.It is subsequent, it can first determine whether the invoice of the invoice issuing side creates amount
It is sufficient.
In a kind of embodiment shown, the intelligent contract being deployed on the block chain can be called by the node device
The amount of middle statement checks logic, determines whether the invoice creation amount of the invoice issuing side is sufficient.
Wherein, amount checks that logic specifically can be statement in the intelligence contract, with the hair for checking invoice issuing side
Ticket creates the relevant program code of execution logic (such as: some program technics or function for calling) of amount.
Alternatively, third-party trusted service can also be called by the node device, which is sent to this
Third-party trusted service.Wherein, third-party trusted service, which can be, is deployed in third-party trusted service equipment, with
Check the relevant program code of execution logic of the invoice creation amount of invoice issuing side.For example, this is third-party credible
Service equipment can be the equipment in tax intraoffice network, it is possible thereby to improve Information Security.
The third-party trusted service can determine whether the invoice creation amount of the invoice issuing side is sufficient, and will determine
As a result it is back to the node device.The node device can be based on the determination that the third-party trusted service returns as a result, determining
Whether the invoice creation amount of the invoice issuing side is sufficient.
Specifically, the third-party trusted service can determine the invoice issuing side invoice create amount abundance when,
The definitive result of the invoice creation amount abundance of the invoice issuing side is returned to the node device.The node device is receiving this
After definitive result, it can determine that the invoice creation amount of the invoice issuing side is sufficient.Alternatively, the third-party trusted service can be with
When the invoice creation amount for determining the invoice issuing side is inadequate, the invoice wound of the invoice issuing side is returned to the node device
Build the insufficient definitive result of amount.The node device can determine the invoice issuing side after receiving the definitive result
It is inadequate that invoice creates amount.
If it is determined that the invoice creation amount of the invoice issuing side is sufficient, then the intelligence being deployed on the block chain can be called
The invoice creation logic stated in energy contract, creates information based on the invoice that user in the invoice request to create inputs, creates mesh
Mark invoice.
Wherein, invoice creation logic specifically can be statement in the intelligence contract, the execution logic with creation invoice
Relevant program code.
In another embodiment, the invoice can be by be originally generated invoice mechanism provide.Such as can be by
First invoice data of invoice is directly or indirectly uploaded to block chain by the national taxation bureau.Specifically, when an equipment of drawing a bill is opened
Has an a/d, which is also recorded in the system of the tax bureau, and the tax system of the tax bureau can synchronize will be on invoice
Chain deposits card.Wherein the cochain deposit card process embodiment as previously described it is identical, be not discussed here.
For example, after invoice A, invoice B and invoice C cochain, can have been recorded in block chain invoice A hash and
The mapping relations of invoice A data;The mapping relations of invoice B hash and invoice B data;Invoice C hash and invoice C data reflect
Penetrate relationship.
It is noted that as described in Figure 2, space and the storage red ticket of storage invoice can be divided in block chain
The space of (rushing red invoice).By establishing corresponding relationship to realize that it is red that invoice rushes between invoice and red ticket.
Invoice rushes red process in this specification introduced below:
User discovery invoice exist mistake after, need to carry out the incorrect invoice stored in block chain to rush it is red with offset should
Incorrect invoice.Firstly, user can be using the incorrect invoice as wait rush red invoice, and can be mentioned by client to block chain
Hand over and rush red request for wait rush red invoice, come be invoked at disposed on block chain rush red intelligent contract, needle for invoice
Invoice to be identified rush red.
In one implementation, such as preceding creation invoice is similar, and user can be inputted on the client wait rush red hair
The invoice content of ticket or the unique information in invoice content (are below believed the uniqueness in invoice content or invoice content
Breath is referred to as invoice data), and the invoice data of input is carried and is rushed in red request what client was sent;It is sent to block chain
In node device, come trigger the node device in block chain call deployment intelligent contract, for invoice to be identified carry out
It rushes red.Therefore, block chain interior joint equipment can directly receive invoice data.
In another implementation, user, which can treat, rushes red invoice and takes pictures, and acquires wait rush red invoice
Invoice image, and image recognition is carried out to collected invoice image on the client or in third party's identifying system, to know
Not Chu invoice data, and the invoice data obtained by image recognition is carried and is rushed in red request what client was sent, transmission
To the node device in block chain, to trigger the intelligent contract that the node device in block chain calls deployment, for be identified
Invoice rush red.Therefore, block chain interior joint can directly receive invoice data.
Wherein, image recognition is carried out to the image data of collected invoice, it specifically can be by being deployed in block chain
Intelligent contract is completed, and can also be completed by calling third-party trusted service.
In one implementation, according to image recognition algorithm, the invoice data in the invoice image is identified.The embodiment
In, intelligent contract itself has the contract logic of image recognition, can locally identify the invoice number in invoice image in node
According to.
In another implementation, the method also includes:
Node device can also will be prevented by calling third-party trusted service (such as third-party image recognition mechanism)
Invoice image in pseudo- checking request is sent to third party's trusted service, the image recognition by third party's trusted service based on carrying
Algorithm carries out image recognition to invoice image and obtains above-mentioned invoice data, and the available third party's image of node device
The invoice data that identification mechanism returns.In the embodiment, third party's image recognition mechanism image recognition can be transferred to complete, from
And reduce the requirement (and not all node can have image recognition needed for computing resource) to joint behavior.
In one embodiment, node device can call publication in area after getting and rushing the invoice data in red request
The invoice validation logic stated in intelligent contract on block chain, calculating is described wait rush the digital digest of red invoice, and inquires institute
It states and whether stores target invoice corresponding with the digital digest in block chain.
The embodiment, which calculates the digital digest wait rush red invoice, to be calculated based on intelligent contract, is needed
It is bright, it is also possible to (disobey in local based on what preset algorithm was calculated in response to the node device for rushing red request
Rely intelligence contract);It specifically can artificially be configured according to business demand or program automatically selects.
In this specification, stored in inquiring the block chain target invoice corresponding with the digital digest it
Afterwards, what node device needed that publication is called to state in the intelligent contract on block chain rushes red invoice creation logic, and creation is directed to
The target invoice rushes red invoice, and by the corresponding relationship for rushing red invoice and the target invoice in the block chain
It is stored.
In one embodiment, it is created in the step 130 and rushes red invoice for the target invoice, specifically included:
Create negative amount of money invoice identical with the invoice amount of the target invoice.
It is described to store the corresponding relationship for rushing red invoice and the target invoice in the block chain, specifically
Including any in following:
The mapping relations between the negative amount of money invoice and the target invoice are established, and by the mapping relations described
It is stored in block chain;
Establish the mapping relations between the negative amount of money invoice and the digital digest of the target invoice, and by the mapping
Relationship is stored in the block chain;
Establish the mapping between the digital digest of the negative amount of money invoice, the target invoice and the target invoice
Relationship, and the mapping relations are stored in the block chain.
The invoice that keeps accounts cannot delete in tax operation, can be with then for the invoice for the mistake that keeps accounts, in practice
Keep accounts the invoice of a negative amount of money identical with the incorrect invoice amount of money again, to offset the influence of the incorrect invoice.In block chain
In, it is first determined wait rush red invoice for target invoice, then can create the invoice amount phase with the target invoice
Same negative amount of money invoice;Although negative amount of money invoice at this time creates but also needs to establish the negative amount of money invoice in block chain
With the mapping relations between the digital digest of the target invoice and/or the target invoice, can so be closed by mapping
System, determine incorrect invoice whether be completed rush it is red.
As shown in Fig. 2, block chain node receive for wait rush red invoice a rush red request after, can call pre-
If intelligent contract, inquire and whether there is this invoice a, i.e. target invoice described in this specification in block chain;And it is looking into
It askes there are after invoice a, is generated in block chain and rush red invoice a for invoice a, and established this on block chain and rush red hair
Mapping relations between ticket a and invoice a.It is red can to indicate that invoice a is rushed for the mapping relations of the foundation.It is described rush it is red
Invoice a is the negative amount of money identical with the invoice amount of invoice a.For example, the invoice amount of invoice a is 100 yuan, then red invoice a is rushed
Invoice amount be -100 yuan.
A kind of invoice based on block chain that this specification provides rushes red case, by by the digital digest of invoice and invoice
Cochain carries out depositing card;The feature and digital digest that can not be distorted due to the data presence stored in block chain have unique
Feature (i.e. the corresponding initial data of a digital digest);Therefore, when discovery, certain invoice can be based on area when the error occurs
The digital digest of the invoice stored in block chain determines the corresponding target invoice on chain of the incorrect invoice (i.e. wait rush red invoice);
And then it can create and the target invoice is associated rushes red invoice and close the corresponding of red invoice and the target invoice of rushing
It ties up in the block chain and is stored;In this way, the invoice amount of the incorrect invoice can be offset.
Rush that red embodiment of the method is corresponding, and this specification is additionally provided based on block chain with the aforementioned invoice based on block chain
Invoice rush the embodiment that attire is set.Described device embodiment can be by software realization, can also be by hardware or soft or hard
The mode that part combines is realized.It taking software implementation as an example, is the place by equipment where it as the device on a logical meaning
Computer business program instruction corresponding in nonvolatile memory is read into memory what operation was formed by reason device.From hardware layer
For face, as shown in figure 3, a kind of hardware structure diagram of equipment where attire is set is rushed based on the invoice of block chain for this specification,
Other than processor shown in Fig. 3, network interface, memory and nonvolatile memory, setting where device in embodiment
It is standby to rush red actual functional capability generally according to the invoice based on block chain, it can also include other hardware, this is repeated no more.
Fig. 4 is referred to, rushes the module map that attire is set for the invoice based on block chain that one embodiment of this specification provides, institute
It states device and has corresponded to embodiment illustrated in fig. 1, the corresponding pass between invoice and the digital digest of invoice is stored in the block chain
System, described device include:
Receiving unit 210, receive that client submits rushes red request for wait rush red invoice;
Query unit 220 rushes red request in response to described, and calculating is described wait rush the digital digest of red invoice, and inquires
Whether with the digital digest corresponding target invoice is stored in the block chain;
Clearance permit member 230 is rushed, stores target invoice corresponding with the digital digest in the block chain if inquired,
The red invoice that rushes for calling publication to state in the intelligent contract on block chain creates logic, and creation being rushed for the target invoice
Red invoice, and the corresponding relationship for rushing red invoice and the target invoice is stored in the block chain.
Optionally, described device further include:
Request to create receiving unit receives the invoice request to create that client is submitted;Wherein, the invoice request to create packet
Include the invoice creation information of user's input;
Request to create response unit calls intelligent contract of the publication on block chain in response to the invoice request to create
The invoice of middle statement creates logic, creates information creating invoice based on the invoice;And it calculates the number of the invoice and plucks
It wants, and the corresponding relationship of the invoice and the digital digest of the invoice is stored in the block chain.
Optionally, the query unit 220, comprising:
Red request is rushed in response to described, the invoice validation logic for calling publication to state in the intelligent contract on block chain,
Calculate it is described wait rush the digital digest of red invoice, and inquire in the block chain whether store it is corresponding with the digital digest
Target invoice.
Optionally, the digital digest of the invoice includes:
For the invoice content of the invoice;It is calculated alternatively, the unique information in the invoice content carries out hash
The hash value arrived.
Optionally, described to rush the red invoice content requested including described wait rush red invoice;Alternatively, in the invoice content
Unique information;
In the query unit 220, the digital digest wait rush red invoice is calculated, comprising:
Obtain the invoice content wait rush red invoice rushed in red request;Alternatively, in the invoice content
Unique information;
For the invoice content described in getting wait rush red invoice;Alternatively, the uniqueness in the invoice content is believed
Breath carries out hash and hash value is calculated.
Optionally, the block chain is alliance's chain.
Optionally, described to rush in clearance permit member 230, creation rushes red invoice for the target invoice, specifically includes:
Create negative amount of money invoice identical with the invoice amount of the target invoice.
Optionally, described to rush in clearance permit member 230, by the corresponding relationship for rushing red invoice and the target invoice described
It is stored in block chain, specifically includes any in following:
The mapping relations between the negative amount of money invoice and the target invoice are established, and by the mapping relations described
It is stored in block chain;
Establish the mapping relations between the negative amount of money invoice and the digital digest of the target invoice, and by the mapping
Relationship is stored in the block chain;
Establish the mapping between the digital digest of the negative amount of money invoice, the target invoice and the target invoice
Relationship, and the mapping relations are stored in the block chain.
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.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with
It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual
The purpose for needing to select some or all of the modules therein to realize this specification scheme.Those of ordinary skill in the art are not
In the case where making the creative labor, it can understand and implement.
Figure 4 above describes the invoice based on block chain and rushes the inner function module and structural representation that attire is set, essence
On executing subject can be a kind of electronic equipment, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Receive that client submits rushes red request for wait rush red invoice;
Red request is rushed in response to described, calculating is described wait rush the digital digest of red invoice, and inquires in the block chain
Whether with the digital digest corresponding target invoice is stored;Wherein, the number of invoice and invoice is stored in the block chain
Corresponding relationship between word abstract;
If inquiring and storing target invoice corresponding with the digital digest in the block chain, call publication in area
That states in the intelligent contract on block chain rushes red invoice creation logic, and creation is directed to the red invoice that rushes of the target invoice, and will
The corresponding relationship for rushing red invoice and the target invoice is stored in the block chain.
Optionally, further includes:
Receive the invoice request to create that client is submitted;Wherein, the invoice request to create includes the invoice of user's input
Create information;
In response to the invoice request to create, the invoice creation for calling publication to state in the intelligent contract on block chain is patrolled
Volume, information creating invoice is created based on the invoice;And
The digital digest of the invoice is calculated, and by the corresponding relationship of the invoice and the digital digest of the invoice in institute
It states and is stored in block chain.
Optionally, described to rush red request in response to described, calculating is described wait rush the digital digest of red invoice, and inquires institute
It states and whether stores target invoice corresponding with the digital digest in block chain, comprising:
Red request is rushed in response to described, the invoice validation logic for calling publication to state in the intelligent contract on block chain,
Calculate it is described wait rush the digital digest of red invoice, and inquire in the block chain whether store it is corresponding with the digital digest
Target invoice.
Optionally, the digital digest of the invoice includes:
For the invoice content of the invoice;It is calculated alternatively, the unique information in the invoice content carries out hash
The hash value arrived.
Optionally, described to rush the red invoice content requested including described wait rush red invoice;Alternatively, in the invoice content
Unique information;
Wait rush the digital digest of red invoice described in the calculating, comprising:
Obtain the invoice content wait rush red invoice rushed in red request;Alternatively, in the invoice content
Unique information;
For the invoice content described in getting wait rush red invoice;Alternatively, the uniqueness in the invoice content is believed
Breath carries out hash and hash value is calculated.
Optionally, the block chain is alliance's chain.
Optionally, the creation rushes red invoice for the target invoice, specifically includes:
Create negative amount of money invoice identical with the invoice amount of the target invoice.
Optionally, described to deposit the corresponding relationship for rushing red invoice and the target invoice in the block chain
Storage, specifically includes any in following:
The mapping relations between the negative amount of money invoice and the target invoice are established, and by the mapping relations described
It is stored in block chain;
Establish the mapping relations between the negative amount of money invoice and the digital digest of the target invoice, and by the mapping
Relationship is stored in the block chain;
Establish the mapping between the digital digest of the negative amount of money invoice, the target invoice and the target invoice
Relationship, and the mapping relations are stored in the block chain.
In the embodiment of above-mentioned electronic equipment, it should be appreciated that the processor can be central processing unit (English:
Central Processing Unit, referred to as: CPU), can also be other general processors, digital signal processor (English:
Digital Signal Processor, referred to as: DSP), specific integrated circuit (English: Application Specific
Integrated Circuit, referred to as: ASIC) etc..General processor can be microprocessor or the processor is also possible to
Any conventional processor etc., and memory above-mentioned can be read-only memory (English: read-only memory, abbreviation:
ROM), random access memory (English: random access memory, abbreviation: RAM), flash memory, hard disk or solid
State hard disk.The step of method in conjunction with disclosed in the embodiment of the present invention, can be embodied directly in hardware processor and execute completion, or
Hardware and software module combination in person's processor execute completion.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.It is set especially for electronics
For standby embodiment, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to method reality
Apply the part explanation of example.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to this specification
Other embodiments.This specification is intended to cover any variations, uses, or adaptations of this specification, these modifications,
Purposes or adaptive change follow the general principle of this specification and undocumented in the art including this specification
Common knowledge or conventional techniques.The description and examples are only to be considered as illustrative, the true scope of this specification and
Spirit is indicated by the following claims.
It should be understood that this specification is not limited to the precise structure that has been described above and shown in the drawings,
And various modifications and changes may be made without departing from the scope thereof.The range of this specification is only limited by the attached claims
System.