CN109166042A - Node device, real-time account checking method and storage medium based on block chain - Google Patents

Node device, real-time account checking method and storage medium based on block chain Download PDF

Info

Publication number
CN109166042A
CN109166042A CN201811020410.7A CN201811020410A CN109166042A CN 109166042 A CN109166042 A CN 109166042A CN 201811020410 A CN201811020410 A CN 201811020410A CN 109166042 A CN109166042 A CN 109166042A
Authority
CN
China
Prior art keywords
transaction
detail
reconciliation
processed
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811020410.7A
Other languages
Chinese (zh)
Other versions
CN109166042B (en
Inventor
陈磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811020410.7A priority Critical patent/CN109166042B/en
Publication of CN109166042A publication Critical patent/CN109166042A/en
Application granted granted Critical
Publication of CN109166042B publication Critical patent/CN109166042B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • 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/06Asset management; Financial planning or analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Theoretical Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Technology Law (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Human Resources & Organizations (AREA)
  • Operations Research (AREA)
  • Computer Security & Cryptography (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The present invention relates to a kind of distributed account book technology, a kind of node device, real-time account checking method and computer readable storage medium based on block chain are disclosed.The present invention is received to be requested into chain;Judge whether K transaction detail is the first stroke transaction details traded, if, then K transaction detail is stored into block chain, if not, then according to preset rules, the first reconciliation of K transaction detail is determined as a result, and storing K transaction detail and its first reconciliation result into block chain.Compared to the prior art, the present invention realizes the real-time reconciliation to transaction, shortens fund in way time and fund clearing period.

Description

Node device, real-time account checking method and storage medium based on block chain
Technical field
The present invention relates to block chain technical field, in particular to a kind of node device, the real-time reconciliation side based on block chain Method and computer readable storage medium.
Background technique
The process of exchange of commodity is usually directed to multi-party participation, by taking fund is traded as an example, in fund process of exchange usually by base The gold side of applying to purchase, fund apply to purchase bank and fund mechanism tripartite participates in, and during fund is applied to purchase, the fund side of applying to purchase is needed in correspondence Fund apply to purchase in the electronic account of bank and first supplement with money, and issue to fund mechanism include quantity of applying to purchase the fund application of applying to purchase. Fund mechanism is emitted in electronic account to the fund bank of applying to purchase after receiving the fund and applying to purchase application and deducts and apply to purchase quantity pair The request of withholing for the amount of money answered.Fund applies to purchase bank's response and withholds request, and after withholing successfully, from fund mechanism to fund Shen Purchaser distributes and applies to purchase the consistent fund quantity of quantity.
And for transaction security, above-mentioned fund applies to purchase operation, and corresponding reconciliation must be completed between each participant and is made Industry, to check out the abnormal transaction situation being likely to occur.However, current fund applies to purchase the reconciliation mechanism of operation using T+1 Reconciliation mechanism (i.e. operation of applying to purchase in T days handles data, needs T+1 days just to can be carried out reconciliation), transaction flow is more, and fund link is long, The reconciliation rule that this fund is applied to purchase simultaneously is extremely complex, so that the efficiency of fund settle accounts calculation is very low, user's fund is on way Time is usually all at 1 to 3 day.Therefore, how to realize that the real-time reconciliation of transaction becomes a urgent problem to be solved.
Summary of the invention
The main object of the present invention is to provide a kind of node device, real-time account checking method and computer based on block chain can Read storage medium, it is intended to realize the real-time reconciliation of transaction.
To achieve the above object, the present invention proposes a kind of node device, and the node device includes memory and processor, The real-time reconciliation program based on block chain is stored on the memory, the real-time reconciliation program based on block chain is described Processor realizes following steps when executing:
Receiving step: receiving and request into chain, it is described enter chain request carry the K transaction detail of a transaction, the friendship Easy detail includes stateful transaction, and K is positive integer;
First judgment step: judge the K transaction detail whether be the transaction the first stroke transaction details;
Storing step: when the K transaction detail is the first stroke transaction details of the transaction, by described K Transaction details are stored into block chain;
Reconciliation step: when the K transaction detail is not the first stroke transaction details of the transaction, according to default rule Then, the first reconciliation of the K transaction detail is determined as a result, and the K transaction detail and the K transaction is bright The first thin reconciliation result is stored into the block chain.
Preferably, the reconciliation step includes:
First query steps: inquiring the K-1 transaction detail of the transaction in the block chain, when inquiring, It is transferred to the second judgment step, when not inquiring, second is transferred to and determines step;
Second judgment step: whether the stateful transaction for judging the K-1 transaction detail of the transaction is final state, if so, It is then transferred to third judgment step, if it is not, being transferred to second determines that step, the final state refer to that stateful transaction is to trade successfully or trade The state of failure;
Third judgment step: whether the stateful transaction for judging the K transaction detail is final state, if so, being transferred to One determines step, if it is not, being then transferred to second determines step;
First determines step: judging the stateful transaction of the K transaction detail and the friendship of the K-1 transaction detail Whether easy state is identical, if so, the first reconciliation result of the label K transaction detail is normal, and by described K First reconciliation result of transaction details and the K transaction detail is stored into the block chain, if it is not, then marking described First reconciliation result of K transaction detail is abnormal, and by the of the K transaction detail and the K transaction detail One reconciliation result is stored into the block chain;
Second determines step: the first reconciliation result of the label K transaction detail is unknown, and by described K First reconciliation result of transaction details and the K transaction detail is stored into the block chain.
Preferably, the processor executes the real-time reconciliation program based on block chain, after the reconciliation step, Also perform the steps of
First obtaining step: the transaction execution time that real-time or timing acquisition is respectively traded, and transaction execution time is greater than The transaction of preset duration is as transaction to be processed;
Third determines step: the type of transaction of each transaction to be processed is determined, according to the friendship of each transaction to be processed Mapping relations between easy type and predetermined type of transaction and preset quantity determine that each transaction to be processed is corresponding Preset quantity;
Selection step: judge whether the transaction details quantity of each transaction to be processed is less than the transaction pair to be processed one by one The preset quantity answered, whenever the transaction details quantity for determining a transaction to be processed is less than the corresponding preset quantity to be processed of trading When, using the All Activity detail of the transaction to be processed as the first transaction details to be processed;
First markers step: after finding out all first transaction details to be processed, by all first friendships to be processed Second reconciliation result queue of easy detail is abnormal, and the second reconciliation result of all first transaction details to be processed is deposited Storage is into the block chain.
Preferably, the first reconciliation result includes normal, abnormal and unknown, and the processor executes described based on block The real-time reconciliation program of chain also performs the steps of after first obtaining step
Second obtaining step: it is that unknown transaction is bright that all first reconciliation results are obtained from all transaction to be processed Spy is the second transaction details to be processed;
Second query steps: select the second transaction to be processed bright one by one from all second transaction details to be processed Carefully, when the second selected transaction details to be processed are the i-th transaction detail of affiliated transaction, institute is inquired in the block chain The the (i-1)-th transaction detail traded belonging to second transaction details to be processed of choosing is transferred to third and determines step when inquiring, When not inquiring, it is transferred to the second markers step, wherein i is the positive integer greater than 1;
Third determines step: whether the stateful transaction for judging the (i-1)-th transaction detail is final state, if so, being transferred to 4th determines step, if it is not, it is then transferred to the second markers step,;
4th determines step: whether the stateful transaction for judging the i-th transaction detail is final state, if so, being transferred to the Five determine step, if it is not, it is then transferred to the second markers step,;
5th determines step: judging the stateful transaction of the i-th transaction detail and the friendship of the (i-1)-th transaction detail Whether easy state is identical, if so, it is transferred to third markers step, if it is not, being then transferred to the second markers step;
Second markers step: being abnormal by the second reconciliation result queue of the i-th transaction detail, and by described i-th Second reconciliation result of transaction detail is stored into block chain;
Third markers step: being normal by the second reconciliation result queue of the i-th transaction detail, and by described i-th Second reconciliation result of transaction detail is stored into block chain;
Detecting step: judge in all second transaction details to be processed with the presence or absence of unselected mistake second wait locate Transaction details are managed, when it is present, returns and executes second query steps.
Preferably, the processor executes the real-time reconciliation program based on block chain, also performs the steps of
In real time or all first reconciliation results of timing acquisition or the second reconciliation result are abnormal transaction details, when getting When, account-checking report is generated according to the All Activity detail of acquisition, and send the account-checking report to monitoring device, for the monitoring Equipment creates abnormality processing item according to the account-checking report;
Alternatively, real-time or all first reconciliation results of timing acquisition or the second reconciliation result are abnormal transaction details, when When getting, account-checking report is generated according to the All Activity detail of acquisition, and the account-checking report is stored to the block chain In, the account-checking report is obtained from the block chain for the monitoring device, and according to the account-checking report, create exception Director.
In addition, to achieve the above object, the present invention also proposes a kind of real-time account checking method based on block chain, this method is suitable For the node device in block catenary system, the method comprising the steps of:
Receiving step: receiving and request into chain, it is described enter chain request carry the K transaction detail of a transaction, the friendship Easy detail includes stateful transaction, and K is positive integer;
First judgment step: judge the K transaction detail whether be the transaction the first stroke transaction details;
Storing step: when the K transaction detail is the first stroke transaction details of the transaction, by described K Transaction details are stored into block chain;
Reconciliation step: when the K transaction detail is not the first stroke transaction details of the transaction, according to default rule Then, the first reconciliation of the K transaction detail is determined as a result, and the K transaction detail and the K transaction is bright The first thin reconciliation result is stored into the block chain.
Preferably, the reconciliation step includes:
First query steps: inquiring the K-1 transaction detail of the transaction in the block chain, when inquiring, It is transferred to the second judgment step, when not inquiring, second is transferred to and determines step;
Second judgment step: whether the stateful transaction for judging the K-1 transaction detail of the transaction is final state, if so, It is then transferred to third judgment step, if it is not, being transferred to second determines that step, the final state refer to that stateful transaction is to trade successfully or trade The state of failure;
Third judgment step: whether the stateful transaction for judging the K transaction detail is final state, if so, being transferred to One determines step, if it is not, being then transferred to second determines step;
First determines step: judging the stateful transaction of the K transaction detail and the friendship of the K-1 transaction detail Whether easy state is identical, if so, the first reconciliation result of the label K transaction detail is normal, and by described K First reconciliation result of transaction details and the K transaction detail is stored into the block chain, if it is not, then marking described First reconciliation result of K transaction detail is abnormal, and by the of the K transaction detail and the K transaction detail One reconciliation result is stored into the block chain;
Second determines step: the first reconciliation result of the label K transaction detail is unknown, and by described K First reconciliation result of transaction details and the K transaction detail is stored into the block chain.
Preferably, after the reconciliation step, this method further include:
First obtaining step: the transaction execution time that real-time or timing acquisition is respectively traded, and transaction execution time is greater than The transaction of preset duration is as transaction to be processed;
Third determines step: the type of transaction of each transaction to be processed is determined, according to the friendship of each transaction to be processed Mapping relations between easy type and predetermined type of transaction and preset quantity determine that each transaction to be processed is corresponding Preset quantity;
Selection step: judge whether the transaction details quantity of each transaction to be processed is less than the transaction pair to be processed one by one The preset quantity answered, whenever the transaction details quantity for determining a transaction to be processed is less than the corresponding preset quantity to be processed of trading When, using the All Activity detail of the transaction to be processed as the first transaction details to be processed;
First markers step: after finding out all first transaction details to be processed, by all first friendships to be processed Second reconciliation result queue of easy detail is abnormal, and the second reconciliation result of all first transaction details to be processed is deposited Storage is into the block chain.
Preferably, the first reconciliation result includes normal, abnormal and unknown, should after first obtaining step Method further include:
Second obtaining step: it is that unknown transaction is bright that all first reconciliation results are obtained from all transaction to be processed Spy is the second transaction details to be processed;
Second query steps: select the second transaction to be processed bright one by one from all second transaction details to be processed Carefully, it when the second selected transaction details to be processed are the i-th transaction detail of affiliated transaction, is inquired in the block chain The the (i-1)-th transaction detail traded belonging to the transaction details to be processed of selected second is transferred to third and determines step when inquiring Suddenly, when not inquiring, it is transferred to the second markers step, wherein i is the positive integer greater than 1;
Third determines step: whether the stateful transaction for judging the (i-1)-th transaction detail is final state, if so, being transferred to 4th determines step, if it is not, it is then transferred to the second markers step,;
4th determines step: whether the stateful transaction for judging the i-th transaction detail is final state, if so, being transferred to the Five determine step, if it is not, it is then transferred to the second markers step,;
5th determines step: judging the stateful transaction of the i-th transaction detail and the friendship of the (i-1)-th transaction detail Whether easy state is identical, if so, it is transferred to third markers step, if it is not, being then transferred to the second markers step;
Second markers step: being abnormal by the second reconciliation result queue of the i-th transaction detail, and by described i-th Second reconciliation result of transaction detail is stored into block chain;
Third markers step: being normal by the second reconciliation result queue of the i-th transaction detail, and by described i-th Second reconciliation result of transaction detail is stored into block chain;
Detecting step: judge in all second transaction details to be processed with the presence or absence of unselected mistake second wait locate Transaction details are managed, when it is present, returns and executes second query steps.
In addition, to achieve the above object, the present invention also proposes a kind of computer readable storage medium, described computer-readable Storage medium is stored with the real-time reconciliation program based on block chain, and the real-time reconciliation program based on block chain can be by least one A processor executes, so that at least one described processor executes the real-time reconciliation as described in any one of the above embodiments based on block chain The step of method.
The present invention is received to be requested into chain, it is described enter chain request carry a transaction transaction ID information and the transaction the K transaction detail;Judge the K transaction detail whether be the transaction the first stroke transaction details, if so, will be described K transaction detail is stored into block chain, if it is not, then determining first pair of the K transaction detail according to preset rules Account is as a result, and store the K transaction detail and its first reconciliation result into the block chain.Compared to existing skill Art, each transaction participant of the present invention are stored the transaction details of each transaction to block chain, node device by node device During storing transaction details to block chain, the first reconciliation of every transaction detail is determined as a result, to realize to friendship Easy real-time reconciliation shortens fund in way time and fund clearing period, improves safety of the fund during transaction.This Outside, due to advantages such as the anti-tamper of block chain, high transparency and decentralizations, it is ensured that the authenticity and safety of transaction details.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with The structure shown according to these attached drawings obtains other attached drawings.
Fig. 1 is the optional application environment schematic diagram of each embodiment one of the invention;
Fig. 2 is that the present invention is based on the operation rings of real-time the first, second, third, fourth embodiment of reconciliation program of block chain Border schematic diagram;
Fig. 3 is that the present invention is based on the Program modual graphs of the real-time reconciliation program first embodiment of block chain;
Fig. 4 is the elaborator module map of reconciliation module in Fig. 3;
Fig. 5 is that the present invention is based on the Program modual graphs of the real-time reconciliation program second embodiment of block chain;
Fig. 6 is that the present invention is based on the Program modual graphs of the real-time reconciliation program 3rd embodiment of block chain;
Fig. 7 is that the present invention is based on the Program modual graphs of the real-time reconciliation program fourth embodiment of block chain;
Fig. 8 is that the present invention is based on the flow diagrams of the real-time account checking method first embodiment of block chain;
Fig. 9 is the refinement flow diagram of S40 in Fig. 8;
Figure 10 is that the present invention is based on the flow diagrams of the real-time account checking method second embodiment of block chain;
Figure 11 is that the present invention is based on the flow diagrams of the real-time account checking method 3rd embodiment of block chain.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
The principle and features of the present invention will be described below with reference to the accompanying drawings, and the given examples are served only to explain the present invention, and It is non-to be used to limit the scope of the invention.
As shown in fig.1, being the optional application environment schematic diagram of each embodiment one of the invention.
In the present embodiment, present invention can apply to include but are not limited to, node device 1, block chain network 2 and prison In the application environment for controlling equipment 3.Wherein, block chain network 2 and multiple node devices 1 collectively form a block catenary system, Multiple node device 1 is communicated to connect by block chain network 2.In addition, monitoring device 3 is respectively in block catenary system at least one A node device communication connection.
In the following, above-mentioned application environment and relevant device will be based on, each embodiment of the invention is proposed.
The present invention proposes a kind of real-time reconciliation program based on block chain.
Referring to Fig. 2, being 10 first, second, third, fourth embodiment of real-time reconciliation program the present invention is based on block chain Running environment schematic diagram.
In the present embodiment, the real-time reconciliation program 10 based on block chain is installed and is run in node device 1, for example, Real-time reconciliation program 10 based on block chain, which can be, to be installed and runs on the intelligent contract in node device 1.Node device 1 can To be that mine machine, desktop PC, notebook, palm PC and server etc. calculate equipment.The node device 1 may include, but It is not limited only to, the memory 11 and processor 12 being in communication with each other by program bus.Fig. 2 is illustrated only with component 11,12 Node device 1, it should be understood that be not required for implementing all components shown, the implementation that can be substituted is more or more Few component.
Memory 11 can be the internal storage unit of node device 1 in some embodiments, such as the node device 1 Hard disk or memory.Memory 11 is also possible to the External memory equipment of node device 1 in further embodiments, such as node is set The plug-in type hard disk being equipped on standby 1, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, memory 11 can also be both interior including node device 1 Portion's storage unit also includes External memory equipment.Memory 11 is for storing the application software for being installed on node device 1 and all kinds of Data, such as the program code etc. of the real-time reconciliation program 10 based on block chain.Memory 11 can be also used for temporarily storing The data that has exported or will export.
Processor 12 can be in some embodiments a central processing unit (Central Processing Unit, CPU), microprocessor or other data processing chips, program code or processing data for being stored in run memory 11, example Such as execute the real-time reconciliation program 10 based on block chain.
Referring to Fig. 3, being the Program modual graph of real-time 10 first embodiment of reconciliation program the present invention is based on block chain.? In the present embodiment, the real-time reconciliation program 10 based on block chain can be divided into one or more modules, one or more Module is stored in memory 11, and performed by one or more processors (the present embodiment is processor 12), to complete The present invention.For example, in Fig. 3, the real-time reconciliation program 10 based on block chain can be divided into receiving module 101, first sentence Disconnected module 102, memory module 103 and reconciliation module 104.The so-called module of the present invention is the system for referring to complete specific function Column count machine program instruction section, than program more suitable for describing the real-time reconciliation program 10 based on block chain in node device 1 Implementation procedure, in which:
Receiving module 101 is requested for receiving into chain, it is described enter chain request carry the K transaction detail of a transaction, The transaction details include stateful transaction, and K is positive integer, and represent the transaction detail enters chain request sequence.
In the following, by the following two kinds application scenarios illustrate it is above-mentioned enter chain request triggering mode:
The first, the application scenarios of bank electronic account charging: the fund side of applying to purchase receives the carrying recharge amount that user sends And the electronic account recharge instruction of bank card number, operation is supplemented with money to electronic account execution according to the recharge amount, according to supplementing with money Operating result generates transaction details, and requests to the chain that enters that the fund side of applying to purchase node device initiates to carry transaction details, should Transaction details are recorded into block chain.Then, fund applies to purchase the recharging payment request that direction bank initiates electronic account, the bank Recharging payment request is executed, and transaction details are generated according to the implementing result of recharging payment request, and to bank node equipment The chain that enters for initiating to carry the transaction details of the production is requested, which is recorded into block chain.Finally, bank is to base The gold side of applying to purchase returns to the implementing result of recharging payment request, and fund applies to purchase root and updates platform according to the implementing result that recharging payment is requested Account, and updated according to account as a result, transaction details are generated, to entering for the fund side of the applying to purchase node device initiation carrying transaction details Chain request.
The second, the application scenarios applied to purchase of fund: the fund side of applying to purchase receives the fund Shen that quantity is applied to purchase in the carrying that user sends Purchase instruction, fund apply to purchase root and generate transaction details according to the fund instruction of applying to purchase, initiate to carry to the fund side of applying to purchase node device The transaction details enter chain request.Then, fund applies to purchase the initiation fund request of applying to purchase of direction fund mechanism, and fund authorities should After applying to purchase request, request of withholing is returned to the fund side of applying to purchase.After the fund side of applying to purchase receives the request of withholing, electronic account is executed It withholds operation, and transaction details is generated according to operating result of withholing, initiate to carry transaction details to the fund side of applying to purchase node device Enter chain request.Then, fund applies to purchase the transaction request of withholing that direction bank initiates electronic account, which receives the friendship of withholing Easily after request, the transaction request of withholing is executed, and transaction details are generated according to the implementing result for transaction request of withholing, saved to bank The chain that enters that point device initiates to carry the transaction details is requested.Then, bank returns to holding for transaction request of withholing to the fund side of applying to purchase Row is as a result, the implementing result of the transaction request of withholing is fed back to fund mechanism by the fund side of applying to purchase, and fund mechanism is according to the execution As a result the fund request of applying to purchase is executed, and transaction details are generated according to result of applying to purchase, initiates to carry the transaction to fund node device Detail enters chain request.In addition, the result of applying to purchase also is back to the fund side of applying to purchase by fund mechanism.Finally, fund applies to purchase root Account is updated according to result of applying to purchase, and result is updated according to account and generates transaction details, is taken to the initiation of the fund side of applying to purchase node device Enter chain request with the transaction details.
It should be noted that above-mentioned application scenarios are only used for illustrating, the triggering mode for specifically entering chain request can be according to tool The application scenarios of body determine.
First judgment module 102, for judge the K transaction detail whether be the transaction the first transaction it is bright Carefully, if so, calling memory module 103, if it is not, calling reconciliation module 104.
Above-mentioned first judgment module 102 judge the K transaction detail whether be the transaction the first transaction it is bright Thin step includes:
Judge whether K is equal to 1, if so, determine that the K transaction detail is the first stroke transaction details of the transaction, if It is no, then determine that the K transaction detail is not the first stroke transaction details of the transaction.
Alternatively, it is described enter chain request in carry the transaction ID information of the transaction, believed according to the transaction ID of the transaction The corresponding transaction details of the transaction whether are stored in breath inquiry block chain, if so, determining that the K transaction detail is not this The first stroke transaction details of transaction, if it is not, then determining that the K transaction detail is the first stroke transaction details of the transaction.
Memory module 103, for storing the K transaction detail into block chain.
For the first stroke transaction details of a transaction, without carrying out reconciliation to it, memory module 103 is directly by this K First reconciliation result of transaction details and the K transaction detail is stored into block chain.
Reconciliation module 104, for according to preset rules, determining the first reconciliation of the K transaction detail as a result, and will The K transaction detail is stored into the block chain.
Referring to Fig. 4, above-mentioned reconciliation module 104 includes query unit 1041, the first judging unit 1042, second judgment unit 1043, third judging unit 1044, the first marking unit 1045, the second marking unit 1046 and third marking unit 1047, In:
Query unit 1041, the K-1 transaction detail for inquiring the transaction in the block chain whether there is, If so, the first judging unit 1042 is called, if it is not, calling third marking unit 1047.
First judging unit 1042, for judging whether the stateful transaction of K-1 transaction detail of the transaction is eventually State, if so, second judgment unit 1043 is called, if it is not, calling third marking unit 1047.
The stateful transaction of transaction details has two classes: the first kind is final state, and the final state refers to that stateful transaction is to trade successfully Or the state of Fail Transaction;Second class is non-final state, the stateful transaction including present.
Second judgment unit 1043, for judging whether the stateful transaction of the K transaction detail is final state, if so, Third judging unit 1044 is called, if it is not, calling third marking unit 1047.
Third judging unit 1044, for judge the K transaction detail stateful transaction and the K-1 transaction Whether the stateful transaction of detail is identical, if so, the first marking unit 1045 is called, if it is not, calling the second marking unit 1046.
First marking unit 1045 is normal for marking the first reconciliation result of the K transaction detail, and by institute The the first reconciliation result for stating K transaction detail and the K transaction detail is stored into the block chain.
Second marking unit 1046 will be described for marking the first reconciliation result of the K transaction detail to be abnormal K transaction detail is stored into the block chain.
Third marking unit 1047 is unknown for marking the first reconciliation result of the K transaction detail, and by institute The the first reconciliation result for stating K transaction detail and the K transaction detail is stored into the block chain.
It is unknown that refer to temporarily can not be by the stateful transaction of K-1 transaction detail and the transaction shape of K transaction detail State carries out reconciliation to K transaction detail, to determine the first reconciliation result of K transaction detail.
For example, there are following any case, can not temporarily reconciliation be carried out to K transaction detail:
There is no (lacking) for K-1 transaction detail, alternatively, K-1 transaction detail is that non-final state (is being handled In stateful transaction), alternatively, K transaction detail be non-final state (i.e. the stateful transaction of present).
The present invention is received to be requested into chain, it is described enter chain request carry a transaction transaction ID information and the transaction the K transaction detail;Judge the K transaction detail whether be the transaction the first stroke transaction details, if so, will be described K transaction detail is stored into block chain, if it is not, then determining first pair of the K transaction detail according to preset rules Account is as a result, and store the K transaction detail and its first reconciliation result into the block chain.Compared to existing skill Art, each transaction participant of the present invention are stored the transaction details of each transaction to block chain, node device by node device During storing transaction details to block chain, the first reconciliation of every transaction detail is determined as a result, to realize to friendship Easy real-time reconciliation shortens fund in way time and fund clearing period, improves safety of the fund during transaction.This Outside, due to advantages such as the anti-tamper of block chain, high transparency and decentralizations, it is ensured that the authenticity and safety of transaction details.
As shown in figure 5, Fig. 5 is that the present invention is based on the program modules of real-time 10 second embodiment of reconciliation program of block chain Figure.
The present embodiment on the basis of first embodiment, the program further include the first acquisition module 105, determining module 106, First choice module 107, the first mark module 108, in which:
First obtains module 105, when executing for the transaction that (for example, every 5 minutes) obtain each transaction in real time or periodically Between, and transaction execution time is greater than the transaction of preset duration (for example, 10 minutes) as transaction to be processed.
Determining module 106, for determining the type of transaction of each transaction to be processed, according to each transaction to be processed Mapping relations between type of transaction and predetermined type of transaction and preset quantity determine that each transaction to be processed corresponds to Preset quantity.
Presetting every transaction need to complete in preset duration (for example, in 10 minutes), and for a type of transaction Transaction should record its corresponding preset quantity (for example, the transaction of a type of transaction is corresponding after completely being executed in block chain Preset quantity be 8) transaction details.
Since the corresponding preset quantity of the transaction of each type of transaction is different, by each type of transaction and its corresponding Mapping relations (for example, mapping table) is established between preset quantity, and the mapping relations are stored to the local of each node device and are deposited It stores up in space, or stores into block chain.
First choice module 107, for judging whether the transaction details quantity of each transaction to be processed is less than this one by one Corresponding preset quantity to be processed of trading, whenever the transaction details quantity for determining a transaction to be processed is less than the transaction pair to be processed When the preset quantity answered, using the All Activity detail of the transaction to be processed as the first transaction details to be processed.
First mark module 108, it is to be processed by all described first after finding out all first transaction details to be processed Second reconciliation result queue of transaction details is abnormal, and by the second reconciliation result of all first transaction details to be processed It stores into the block chain.
When transaction details quantity is less than the corresponding preset quantity of transaction to be processed, it is believed that the transaction to be processed executes super When, or because part transaction step fails, cause subsequent transaction step that can not continue to execute, therefore, which is corresponded to The second reconciliation result of All Activity detail mark and be.
The present embodiment filters out the transaction for executing time-out, and by the corresponding All Activity detail of transaction of execution time-out Second reconciliation result, which marks, is.Be conducive to the transaction that monitoring personnel timely handles the time-out, further shorten fund In way time and fund clearing period.
As shown in fig. 6, Fig. 6 is that the present invention is based on the program modules of real-time 10 3rd embodiment of reconciliation program of block chain Figure.
For the present embodiment on the basis of second embodiment, which further includes the second acquisition module 109, the second selecting module 110, enquiry module 111, the second judgment module 112, third judgment module 113, the 4th judgment module 114, the second mark module 115, third mark module 116, detection module 117 and output module 118, in which:
Second obtains module 109, is unknown for obtaining all first reconciliation results from all transaction to be processed Transaction details as the second transaction details to be processed.
Second selecting module 110, it is second to be processed for being selected one by one from all second transaction details to be processed Transaction details.
Enquiry module 111, for (i to be greater than 1 when i-th that the second selected transaction details to be processed are affiliated transaction Positive integer) transaction detail, (i-1)-th of transaction belonging to the second selected transaction details to be processed is inquired in the block chain Transaction detail calls the second judgment module 112 when inquiring, and when not inquiring, calls the second mark module 115.
Second judgment module 112, for judging whether the stateful transaction of the (i-1)-th transaction detail is final state, if so, Third judgment module 113 is called, if it is not, calling the second mark module 115.
Third judgment module 113, for judging whether the stateful transaction of the i-th transaction detail is final state, if so, adjusting With the 4th judgment module 114, if it is not, calling the second mark module 115.
4th judgment module 114, for judge the i-th transaction detail stateful transaction and (i-1)-th transaction Whether the stateful transaction of detail is identical, if so, third mark module 116 is called, if it is not, calling the second mark module 115.
Second mark module 115, for being abnormal by the second reconciliation result queue of the i-th transaction detail, and will Second reconciliation result of the i-th transaction detail is stored into block chain.
Third mark module 116, for being normal by the second reconciliation result queue of the i-th transaction detail, and will Second reconciliation result of the i-th transaction detail is stored into block chain.
Detection module 117, for judging in all second transaction details to be processed with the presence or absence of unselected mistake Second transaction details to be processed, if so, the second selecting module 110 is called, if it is not, calling output module 118.
Output module 118 is abnormal transaction details for exporting all second reconciliation results.
In the present embodiment, it need to be completed in preset duration (for example, in 10 minutes) due to presetting every transaction, if First reconciliation result of one transaction details be it is unknown, then need again to the transaction details carry out reconciliation.If knowing during reconciliation Being clipped to the corresponding stateful transaction of any transaction details in the previous transaction detail of the transaction details or the transaction details is not eventually State, then it is assumed that stateful transaction is not that the corresponding transaction step of transaction details of final state executes time-out, by the of the transaction detail Two reconciliation result queues are abnormal.
The present embodiment is that unknown transaction details carry out reconciliation again to the first reconciliation result, to further determine that the transaction Whether the second reconciliation result of detail is abnormal.By timely finding out abnormal transaction details, be conducive to monitoring personnel and When processing extremely trade, further shorten fund in way time and fund clearing period.
As shown in fig. 7, Fig. 7 is that the present invention is based on the program modules of real-time 10 fourth embodiment of reconciliation program of block chain to show It is intended to.
For the present embodiment on the basis of the first, second, third embodiment, which further includes monitoring modular 119.
Monitoring modular 119 is abnormal for all first reconciliation results of real-time or timing acquisition or the second reconciliation result Transaction details generate account-checking report according to the All Activity detail of acquisition when getting, and send the account-checking report to prison Equipment is controlled, for the monitoring device according to the account-checking report, creates abnormality processing item.
Further, in the present embodiment, monitoring modular 119 is also used to:
In real time or all first reconciliation results of timing acquisition or the second reconciliation result are abnormal transaction details, when getting When, account-checking report is generated according to the All Activity detail of acquisition, and the account-checking report is stored into the block chain, for institute It states monitoring device and obtains the account-checking report from the block chain, and according to the account-checking report, create abnormality processing item.
The present embodiment node device generates account-checking report according to abnormal transaction details, and monitoring device is obtaining the reconciliation report After announcement, abnormality processing item is created according to the account-checking report, monitoring personnel, which can be intervened timely, handles the abnormality processing item, from And it can further shorten fund in way time and fund clearing period.
Further it is proposed that a kind of real-time account checking method based on block chain.Suitable for node device.
As shown in figure 8, Fig. 8 is that the present invention is based on the flow diagrams of the real-time account checking method first embodiment of block chain.
In the present embodiment, this method comprises:
Step S10 is received and is requested into chain, it is described enter chain request carry the K transaction detail of a transaction, the transaction Detail includes stateful transaction, and K is positive integer, and represent the transaction detail enters chain request sequence.
In the following, by the following two kinds application scenarios illustrate it is above-mentioned enter chain request triggering mode:
The first, the application scenarios of bank electronic account charging: the fund side of applying to purchase receives the carrying recharge amount that user sends And the electronic account recharge instruction of bank card number, operation is supplemented with money to electronic account execution according to the recharge amount, according to supplementing with money Operating result generates transaction details, and requests to the chain that enters that the fund side of applying to purchase node device initiates to carry transaction details, should Transaction details are recorded into block chain.Then, fund applies to purchase the recharging payment request that direction bank initiates electronic account, the bank Recharging payment request is executed, and transaction details are generated according to the implementing result of recharging payment request, and to bank node equipment The chain that enters for initiating to carry the transaction details of the production is requested, which is recorded into block chain.Finally, bank is to base The gold side of applying to purchase returns to the implementing result of recharging payment request, and fund applies to purchase root and updates platform according to the implementing result that recharging payment is requested Account, and updated according to account as a result, transaction details are generated, to entering for the fund side of the applying to purchase node device initiation carrying transaction details Chain request.
The second, the application scenarios applied to purchase of fund: the fund side of applying to purchase receives the fund Shen that quantity is applied to purchase in the carrying that user sends Purchase instruction, fund apply to purchase root and generate transaction details according to the fund instruction of applying to purchase, initiate to carry to the fund side of applying to purchase node device The transaction details enter chain request.Then, fund applies to purchase the initiation fund request of applying to purchase of direction fund mechanism, and fund authorities should After applying to purchase request, request of withholing is returned to the fund side of applying to purchase.After the fund side of applying to purchase receives the request of withholing, electronic account is executed It withholds operation, and transaction details is generated according to operating result of withholing, initiate to carry transaction details to the fund side of applying to purchase node device Enter chain request.Then, fund applies to purchase the transaction request of withholing that direction bank initiates electronic account, which receives the friendship of withholing Easily after request, the transaction request of withholing is executed, and transaction details are generated according to the implementing result for transaction request of withholing, saved to bank The chain that enters that point device initiates to carry the transaction details is requested.Then, bank returns to holding for transaction request of withholing to the fund side of applying to purchase Row is as a result, the implementing result of the transaction request of withholing is fed back to fund mechanism by the fund side of applying to purchase, and fund mechanism is according to the execution As a result the fund request of applying to purchase is executed, and transaction details are generated according to result of applying to purchase, initiates to carry the transaction to fund node device Detail enters chain request.In addition, the result of applying to purchase also is back to the fund side of applying to purchase by fund mechanism.Finally, fund applies to purchase root Account is updated according to result of applying to purchase, and result is updated according to account and generates transaction details, is taken to the initiation of the fund side of applying to purchase node device Enter chain request with the transaction details.
It should be noted that above-mentioned application scenarios are only used for illustrating, the triggering mode for specifically entering chain request can be according to tool The application scenarios of body determine.
Step S20, judges whether the K transaction detail is the first stroke transaction details of the transaction, if so, being transferred to Step S30, if it is not, being transferred to step S40.
It is above-mentioned to judge that the step of whether the K transaction detail is the first stroke transaction details of the transaction includes:
Judge whether K is equal to 1, if so, determine that the K transaction detail is the first stroke transaction details of the transaction, if It is no, then determine that the K transaction detail is not the first stroke transaction details of the transaction.
Alternatively, it is described enter chain request in carry the transaction ID information of the transaction, believed according to the transaction ID of the transaction The corresponding transaction details of the transaction whether are stored in breath inquiry block chain, if so, determining that the K transaction detail is not this The first stroke transaction details of transaction, if it is not, then determining that the K transaction detail is the first stroke transaction details of the transaction.
Step S30 stores the K transaction detail into block chain.
For the first stroke transaction details of a transaction, without carrying out reconciliation to it, directly the K transaction detail is stored Into block chain.
Step S40 determines the first reconciliation of the K transaction detail as a result, and by the K according to preset rules First reconciliation result of transaction detail and the K transaction detail is stored into the block chain.
Include: referring to Fig. 9, above-mentioned steps S40
Step S41, the K-1 transaction detail that the transaction is inquired in the block chain whether there is, if so, being transferred to Step S42, if it is not, being transferred to step S47.
Step S42 judges whether the stateful transaction of the K-1 transaction detail of the transaction is final state, if so, being transferred to Step S43, if it is not, being transferred to step S47.
The stateful transaction of transaction details has two classes: the first kind is final state, and the final state refers to that stateful transaction is to trade successfully Or the state of Fail Transaction;Second class is non-final state, the stateful transaction including present.
Step S43 judges whether the stateful transaction of the K transaction detail is final state, if so, it is transferred to step S44, If it is not, being then transferred to step S47.
Step S44 judges the stateful transaction of the K transaction detail and the transaction shape of the K-1 transaction detail Whether state is identical, if so, step S45 is transferred to, if it is not, being then transferred to step S46.
Step S45 stores the K transaction detail into the block chain, and marks the K transaction detail The first reconciliation result be normal, and the first reconciliation result of the K transaction detail and the K transaction detail is deposited Storage is into the block chain.
Step S46 stores the K transaction detail into the block chain, and marks the K transaction detail The first reconciliation result be abnormal, and the first reconciliation result of the K transaction detail and the K transaction detail is deposited Storage is into the block chain.
Step S47 stores the K transaction detail into the block chain, and marks the K transaction detail The first reconciliation result be it is unknown, and the first reconciliation result of the K transaction detail and the K transaction detail is deposited Storage is into the block chain.
It is unknown that refer to temporarily can not be by the stateful transaction of K-1 transaction detail and the transaction shape of K transaction detail State carries out reconciliation to K transaction detail, to determine the first reconciliation result of K transaction detail.
For example, there are following any case, can not temporarily reconciliation be carried out to K transaction detail:
There is no (lacking) for K-1 transaction detail, alternatively, K-1 transaction detail is that non-final state (is being handled In stateful transaction), alternatively, K transaction detail be non-final state (i.e. the stateful transaction of present).
The present invention is received to be requested into chain, it is described enter chain request carry a transaction transaction ID information and the transaction the K transaction detail;Judge the K transaction detail whether be the transaction the first stroke transaction details, if so, will be described K transaction detail is stored into block chain, if it is not, then determining first pair of the K transaction detail according to preset rules Account is as a result, and store the K transaction detail and its first reconciliation result into the block chain.Compared to existing skill Art, each transaction participant of the present invention are stored the transaction details of each transaction to block chain, node device by node device During storing transaction details to block chain, the first reconciliation of every transaction detail is determined as a result, to realize to friendship Easy real-time reconciliation shortens fund in way time and fund clearing period, improves safety of the fund during transaction.This Outside, due to advantages such as the anti-tamper of block chain, high transparency and decentralizations, it is ensured that the authenticity and safety of transaction details.
As shown in Figure 10, Figure 10 is that the present invention is based on the signals of the process of the real-time account checking method second embodiment of block chain Figure.
The present embodiment is on the basis of first embodiment, after step S40, this method further include:
Step S50, in real time or timing (for example, every 5 minutes) obtains the transaction execution time of each transaction, and transaction is held The row time is greater than the transaction of preset duration (for example, 10 minutes) as transaction to be processed.
Step S60 determines the type of transaction of each transaction to be processed, according to the type of transaction of each transaction to be processed And the mapping relations between predetermined type of transaction and preset quantity, determine each corresponding present count to be processed of trading Amount.
Presetting every transaction need to complete in preset duration (for example, in 10 minutes), and for a type of transaction Transaction should record its corresponding preset quantity (for example, the transaction of a type of transaction is corresponding after completely being executed in block chain Preset quantity be 8) transaction details.
Since the corresponding preset quantity of the transaction of each type of transaction is different, by each type of transaction and its corresponding Mapping relations (for example, mapping table) is established between preset quantity, and the mapping relations are stored to the local of each node device and are deposited It stores up in space, or stores into block chain.
Step S70, judges whether the transaction details quantity of each transaction to be processed is less than the transaction pair to be processed one by one The preset quantity answered, whenever the transaction details quantity for determining a transaction to be processed is less than the corresponding preset quantity to be processed of trading When, using the All Activity detail of the transaction to be processed as the first transaction details to be processed.
Step S80, after finding out all first transaction details to be processed, by all first transaction details to be processed The second reconciliation result queue be abnormal, and the second reconciliation result of all first transaction details to be processed is stored to institute It states in block chain.
When transaction details quantity is less than the corresponding preset quantity of transaction to be processed, it is believed that the transaction to be processed executes super When, or because part transaction step fails, cause subsequent transaction step that can not continue to execute, therefore, which is corresponded to The second reconciliation result of All Activity detail mark and be.
The present embodiment node device filters out the transaction for executing time-out, and by the corresponding all friendships of the transaction of execution time-out Second reconciliation result of easy detail, which marks, is.Be conducive to the transaction that monitoring personnel timely handles the time-out, further Shortening fund is in way time and fund clearing period.
As shown in figure 11, Figure 11 is that the present invention is based on the signals of the process of the real-time account checking method 3rd embodiment of block chain Figure.
The present embodiment is on the basis of second embodiment, after step S50, this method further include:
Step S90, it is that unknown transaction details are made that all first reconciliation results are obtained from all transaction to be processed For the second transaction details to be processed.
Step S100 selects the second transaction details to be processed from all second transaction details to be processed one by one.Step Rapid S110, when i-th (i is greater than 1 positive integer) transaction that the second selected transaction details to be processed are affiliated transaction is bright When thin, the (i-1)-th transaction detail of transaction belonging to the second selected transaction details to be processed is inquired in the block chain, when looking into It askes then, is transferred to step S120, when not inquiring, is transferred to step S160.
Step S120 judges whether the stateful transaction of the (i-1)-th transaction detail is final state, if so, being transferred to step S130, if it is not, being then transferred to step S160.
Step S130 judges whether the stateful transaction of the i-th transaction detail is final state, if so, being transferred to step S140, if it is not, being then transferred to step S160.
Step S140 judges the stateful transaction of the i-th transaction detail and the transaction shape of the (i-1)-th transaction detail Whether state is identical, if so, S150 is transferred to, if it is not, being then transferred to step S160.
Second reconciliation result queue of the i-th transaction detail is normal by step S150, and described i-th is handed over Second reconciliation result of easy detail is stored into block chain.
Second reconciliation result queue of the i-th transaction detail is abnormal, and described i-th is handed over by step S160 Second reconciliation result of easy detail is stored into block chain.
Step S170 judges in all second transaction details to be processed with the presence or absence of unselected mistake second wait locate Transaction details are managed, if so, S100 is returned to step, if it is not, being then transferred to step S180.
Step S180, exporting all second reconciliation results is abnormal transaction details.
In the present embodiment, it need to be completed in preset duration (for example, in 10 minutes) due to presetting every transaction, if First reconciliation result of one transaction details be it is unknown, then need to again through step S100-S180 to the transaction details carry out reconciliation. If it is corresponding to recognize any transaction details in the previous transaction detail of the transaction details or the transaction details during reconciliation Stateful transaction be not final state, then it is assumed that stateful transaction is not that the corresponding transaction step of transaction details of final state executes time-out, will Second reconciliation result queue of the transaction detail is abnormal.
The present embodiment node device is that unknown transaction details carry out reconciliation again to the first reconciliation result, with further true Whether the second reconciliation result of the fixed transaction details is abnormal.By timely finding out abnormal transaction details, be conducive to supervise Control personnel timely handle abnormal transaction, further shorten fund in way time and fund clearing period.
Further, a in the present embodiment, this method further include:
In real time or all first reconciliation results of timing acquisition or the second reconciliation result are abnormal transaction details, when getting When, account-checking report is generated according to the All Activity detail of acquisition, and send the account-checking report to monitoring device, for the monitoring Equipment creates abnormality processing item according to the account-checking report.
Alternatively, real-time or all first reconciliation results of timing acquisition or the second reconciliation result are abnormal transaction details, when When getting, account-checking report is generated according to the All Activity detail of acquisition, and the account-checking report is stored to the block chain In, the account-checking report is obtained from the block chain for the monitoring device, and according to the account-checking report, create exception Director.
The present embodiment node device generates account-checking report according to abnormal transaction details, and monitoring device is obtaining the reconciliation report After announcement, abnormality processing item is created according to the account-checking report, monitoring personnel, which can be intervened timely, handles the abnormality processing item, from And it can further shorten fund in way time and fund clearing period.
Further, the present invention also proposes that a kind of computer readable storage medium, the computer readable storage medium are deposited The real-time reconciliation program based on block chain is contained, the real-time reconciliation program based on block chain can be held by least one processor Row, so that at least one described processor executes the real-time account checking method based on block chain in any of the above-described embodiment.
The above description is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all at this Under the inventive concept of invention, using equivalent structure transformation made by description of the invention and accompanying drawing content, or directly/use indirectly It is included in other related technical areas in scope of patent protection of the invention.

Claims (10)

1. a kind of node device, the node device includes memory and processor, which is characterized in that is stored on the memory There is the real-time reconciliation program based on block chain, the real-time reconciliation program based on block chain is realized when being executed by the processor Following steps:
Receiving step: receiving and request into chain, it is described enter chain request carry the K transaction detail of a transaction, the transaction is bright It include carefully stateful transaction, K is positive integer;
First judgment step: judge the K transaction detail whether be the transaction the first stroke transaction details;
Storing step: when the K transaction detail is the first stroke transaction details of the transaction, by the K transaction Detail is stored into block chain;
Reconciliation step: when the K transaction detail is not the first stroke transaction details of the transaction, according to preset rules, The first reconciliation of the K transaction detail is determined as a result, and by the K transaction detail and the K transaction detail The first reconciliation result store into the block chain.
2. node device as described in claim 1, which is characterized in that the reconciliation step includes:
First query steps: the K-1 transaction detail that the transaction is inquired in the block chain is transferred to when inquiring Second judgment step is transferred to second and determines step when not inquiring;
Second judgment step: whether the stateful transaction for judging the K-1 transaction detail of the transaction is final state, if so, turning Enter third judgment step, if it is not, being transferred to second determines that step, the final state refer to that stateful transaction is to trade successfully or Fail Transaction State;
Third judgment step: whether the stateful transaction for judging the K transaction detail is final state, if so, being transferred to first really Step is determined, if it is not, being then transferred to second determines step;
First determines step: judging the stateful transaction of the K transaction detail and the transaction shape of the K-1 transaction detail Whether state is identical, if so, the first reconciliation result of the label K transaction detail is normal, and by the K transaction First reconciliation result of detail and the K transaction detail is stored into the block chain, if it is not, then marking described K First reconciliation result of transaction details is abnormal, and by first pair of the K transaction detail and the K transaction detail Account result is stored into the block chain;
Second determines step: the first reconciliation result of the label K transaction detail is unknown, and by the K transaction First reconciliation result of detail and the K transaction detail is stored into the block chain.
3. node device as described in claim 1, which is characterized in that the processor executes described based on the real-time of block chain Reconciliation program also performs the steps of after the reconciliation step
First obtaining step: the transaction execution time that real-time or timing acquisition is respectively traded, and transaction execution time is greater than and is preset The transaction of duration is as transaction to be processed;
Third determines step: the type of transaction of each transaction to be processed is determined, according to the transaction class of each transaction to be processed Mapping relations between type and predetermined type of transaction and preset quantity determine that each transaction to be processed is corresponding default Quantity;
Selection step: it is corresponding to judge whether the transaction details quantity of each transaction to be processed is less than the transaction to be processed one by one Preset quantity, when the transaction details quantity for determining a transaction to be processed is less than the corresponding preset quantity of transaction to be processed, Using the All Activity detail of the transaction to be processed as the first transaction details to be processed;
First markers step: after finding out all first transaction details to be processed, all first transaction to be processed are bright The second thin reconciliation result queue is abnormal, and by the second reconciliation result of all first transaction details to be processed store to In the block chain.
4. node device as claimed in claim 3, which is characterized in that the first reconciliation result is including normal, exception and not Bright, the processor executes the real-time reconciliation program based on block chain, after first obtaining step, also realize with Lower step:
Second obtaining step: it is that unknown transaction details are made that all first reconciliation results are obtained from all transaction to be processed For the second transaction details to be processed;
Second query steps: selecting the second transaction details to be processed from all second transaction details to be processed one by one, when When the transaction details to be processed of selected second are the i-th transaction detail of affiliated transaction, in the block chain selected by inquiry The the (i-1)-th transaction detail traded belonging to second transaction details to be processed is transferred to third and determines step, when not when inquiring When inquiring, it is transferred to the second markers step, wherein i is the positive integer greater than 1;
Third determines step: whether the stateful transaction for judging the (i-1)-th transaction detail is final state, if so, being transferred to the 4th Step is determined, if it is not, being then transferred to the second markers step;
4th determines step: whether the stateful transaction for judging the i-th transaction detail is final state, if so, being transferred to the 5th really Step is determined, if it is not, being then transferred to the second markers step;
5th determines step: judging the stateful transaction of the i-th transaction detail and the transaction shape of the (i-1)-th transaction detail Whether state is identical, if so, third markers step is transferred to, if it is not, being then transferred to the second markers step;
Second markers step: it is abnormal by the second reconciliation result queue of the i-th transaction detail, and described i-th is handed over Second reconciliation result of easy detail is stored into block chain;
Third markers step: being normal by the second reconciliation result queue of the i-th transaction detail, and described i-th is handed over Second reconciliation result of easy detail is stored into block chain;
Detecting step: judge the second friendship to be processed that whether there is unselected mistake in all second transaction details to be processed Easy detail returns when it is present and executes second query steps.
5. node device as described in claim 3 or 4, which is characterized in that the processor executes described based on block chain Real-time reconciliation program, also performs the steps of
Real-time or all first reconciliation results of timing acquisition or the second reconciliation result are abnormal transaction details, when getting, Account-checking report is generated according to the All Activity detail of acquisition, and sends the account-checking report to monitoring device, is set for the monitoring For according to the account-checking report, abnormality processing item is created;
Alternatively, real-time or all first reconciliation results of timing acquisition or the second reconciliation result are abnormal transaction details, work as acquisition Then, account-checking report is generated according to the All Activity detail of acquisition, and the account-checking report is stored into the block chain, supplied The monitoring device obtains the account-checking report from the block chain, and according to the account-checking report, creates exception director ?.
6. a kind of real-time account checking method based on block chain, node device of this method suitable for block catenary system, feature It is, the method comprising the steps of:
Receiving step: receiving and request into chain, it is described enter chain request carry the K transaction detail of a transaction, the transaction is bright It include carefully stateful transaction, K is positive integer;
First judgment step: judge the K transaction detail whether be the transaction the first stroke transaction details;
Storing step: when the K transaction detail is the first stroke transaction details of the transaction, by the K transaction Detail is stored into block chain;
Reconciliation step: when the K transaction detail is not the first stroke transaction details of the transaction, according to preset rules, The first reconciliation of the K transaction detail is determined as a result, and by the K transaction detail and the K transaction detail The first reconciliation result store into the block chain.
7. as claimed in claim 6 based on the real-time account checking method of block chain, which is characterized in that the reconciliation step includes:
First query steps: the K-1 transaction detail that the transaction is inquired in the block chain is transferred to when inquiring Second judgment step is transferred to second and determines step when not inquiring;
Second judgment step: whether the stateful transaction for judging the K-1 transaction detail of the transaction is final state, if so, turning Enter third judgment step, if it is not, being transferred to second determines that step, the final state refer to that stateful transaction is to trade successfully or Fail Transaction State;
Third judgment step: whether the stateful transaction for judging the K transaction detail is final state, if so, being transferred to first really Step is determined, if it is not, being then transferred to second determines step;
First determines step: judging the stateful transaction of the K transaction detail and the transaction shape of the K-1 transaction detail Whether state is identical, if so, the first reconciliation result of the label K transaction detail is normal, and by the K transaction First reconciliation result of detail and the K transaction detail is stored into the block chain, if it is not, then marking described K First reconciliation result of transaction details is abnormal, and by first pair of the K transaction detail and the K transaction detail Account result is stored into the block chain;
Second determines step: the first reconciliation result of the label K transaction detail is unknown, and by the K transaction First reconciliation result of detail and the K transaction detail is stored into the block chain.
8. as claimed in claim 6 based on the real-time account checking method of block chain, which is characterized in that the reconciliation step it Afterwards, this method further include:
First obtaining step: the transaction execution time that real-time or timing acquisition is respectively traded, and transaction execution time is greater than and is preset The transaction of duration is as transaction to be processed;
Third determines step: the type of transaction of each transaction to be processed is determined, according to the transaction class of each transaction to be processed Mapping relations between type and predetermined type of transaction and preset quantity determine that each transaction to be processed is corresponding default Quantity;
Selection step: it is corresponding to judge whether the transaction details quantity of each transaction to be processed is less than the transaction to be processed one by one Preset quantity, when the transaction details quantity for determining a transaction to be processed is less than the corresponding preset quantity of transaction to be processed, Using the All Activity detail of the transaction to be processed as the first transaction details to be processed;
First markers step: after finding out all first transaction details to be processed, all first transaction to be processed are bright The second thin reconciliation result queue is abnormal, and by the second reconciliation result of all first transaction details to be processed store to In the block chain.
9. as claimed in claim 8 based on the real-time account checking method of block chain, which is characterized in that the first reconciliation result packet Include it is normal, abnormal and unknown, after first obtaining step, this method further include:
Second obtaining step: it is that unknown transaction details are made that all first reconciliation results are obtained from all transaction to be processed For the second transaction details to be processed;
Second query steps: selecting the second transaction details to be processed from all second transaction details to be processed one by one, when When the transaction details to be processed of selected second are the i-th transaction detail of affiliated transaction, in the block chain selected by inquiry The the (i-1)-th transaction detail traded belonging to second transaction details to be processed is transferred to third and determines step, when not when inquiring When inquiring, it is transferred to the second markers step, wherein i is the positive integer greater than 1;
Third determines step: whether the stateful transaction for judging the (i-1)-th transaction detail is final state, if so, being transferred to the 4th Step is determined, if it is not, being then transferred to the second markers step;
4th determines step: whether the stateful transaction for judging the i-th transaction detail is final state, if so, being transferred to the 5th really Step is determined, if it is not, being then transferred to the second markers step;
5th determines step: judging the stateful transaction of the i-th transaction detail and the transaction shape of the (i-1)-th transaction detail Whether state is identical, if so, third markers step is transferred to, if it is not, being then transferred to the second markers step;
Second markers step: it is abnormal by the second reconciliation result queue of the i-th transaction detail, and described i-th is handed over Second reconciliation result of easy detail is stored into block chain;
Third markers step: being normal by the second reconciliation result queue of the i-th transaction detail, and described i-th is handed over Second reconciliation result of easy detail is stored into block chain;
Detecting step: judge the second friendship to be processed that whether there is unselected mistake in all second transaction details to be processed Easy detail returns when it is present and executes second query steps.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has based on block The real-time reconciliation program of chain, the real-time reconciliation program based on block chain can be executed by least one processor, so that described At least one processor executes the step of the real-time account checking method based on block chain as described in any one of claim 6-9 Suddenly.
CN201811020410.7A 2018-09-03 2018-09-03 Node device, real-time reconciliation method based on blockchain, and storage medium Active CN109166042B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811020410.7A CN109166042B (en) 2018-09-03 2018-09-03 Node device, real-time reconciliation method based on blockchain, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811020410.7A CN109166042B (en) 2018-09-03 2018-09-03 Node device, real-time reconciliation method based on blockchain, and storage medium

Publications (2)

Publication Number Publication Date
CN109166042A true CN109166042A (en) 2019-01-08
CN109166042B CN109166042B (en) 2023-06-09

Family

ID=64893826

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811020410.7A Active CN109166042B (en) 2018-09-03 2018-09-03 Node device, real-time reconciliation method based on blockchain, and storage medium

Country Status (1)

Country Link
CN (1) CN109166042B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859041A (en) * 2019-01-09 2019-06-07 平安科技(深圳)有限公司 Fund transaction real time updating method and system, electronic equipment based on block chain
CN111445330A (en) * 2020-03-24 2020-07-24 山东浪潮通软信息科技有限公司 Account checking method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040064375A1 (en) * 2002-09-30 2004-04-01 Randell Wayne L. Method and system for generating account reconciliation data
CN106097092A (en) * 2016-06-07 2016-11-09 中国建设银行股份有限公司 Data processing method and device for reconciliation
CN106504089A (en) * 2016-10-14 2017-03-15 平安科技(深圳)有限公司 Method of commerce and system are applied to purchase based on the fund of block chain
CN107798109A (en) * 2017-11-01 2018-03-13 深圳市牛鼎丰科技有限公司 Method, apparatus, computer equipment and the storage medium of reconciliation clearance
CN107993149A (en) * 2017-12-18 2018-05-04 深圳前海微众银行股份有限公司 Account information management method, system and readable storage medium storing program for executing
CN108074177A (en) * 2017-12-05 2018-05-25 深圳前海微众银行股份有限公司 Data account checking method, system and computer readable storage medium
CN108171489A (en) * 2017-12-18 2018-06-15 深圳前海微众银行股份有限公司 Data liquidation method, system and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040064375A1 (en) * 2002-09-30 2004-04-01 Randell Wayne L. Method and system for generating account reconciliation data
CN106097092A (en) * 2016-06-07 2016-11-09 中国建设银行股份有限公司 Data processing method and device for reconciliation
CN106504089A (en) * 2016-10-14 2017-03-15 平安科技(深圳)有限公司 Method of commerce and system are applied to purchase based on the fund of block chain
CN107798109A (en) * 2017-11-01 2018-03-13 深圳市牛鼎丰科技有限公司 Method, apparatus, computer equipment and the storage medium of reconciliation clearance
CN108074177A (en) * 2017-12-05 2018-05-25 深圳前海微众银行股份有限公司 Data account checking method, system and computer readable storage medium
CN107993149A (en) * 2017-12-18 2018-05-04 深圳前海微众银行股份有限公司 Account information management method, system and readable storage medium storing program for executing
CN108171489A (en) * 2017-12-18 2018-06-15 深圳前海微众银行股份有限公司 Data liquidation method, system and computer readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859041A (en) * 2019-01-09 2019-06-07 平安科技(深圳)有限公司 Fund transaction real time updating method and system, electronic equipment based on block chain
CN109859041B (en) * 2019-01-09 2023-06-27 平安科技(深圳)有限公司 Block chain-based fund transaction real-time updating method and system and electronic equipment
CN111445330A (en) * 2020-03-24 2020-07-24 山东浪潮通软信息科技有限公司 Account checking method and device

Also Published As

Publication number Publication date
CN109166042B (en) 2023-06-09

Similar Documents

Publication Publication Date Title
CN110782240B (en) Business data processing method and device, computer equipment and storage medium
CN109584082A (en) Settlement of insurance claim method, electronic device and storage medium based on block chain
CN107424069A (en) A kind of generation method of air control feature, risk monitoring and control method and apparatus
CN107301536A (en) Resource transfers method and device
CN109194495A (en) server, message processing method and computer readable storage medium
CN108256996A (en) For the single method and system of two partition in credit repaying business
CN110399533A (en) Funds flow querying method and device
CN106910065B (en) Data processing method, device and system for calculating settlement amount based on multiple transactions
CN108805667A (en) Order flow processing method and system
CN108711047A (en) A kind of automatic repayment method, system and terminal device
CN109087199A (en) Account inquiries system, method and storage medium for bank
CN112559300B (en) Fault cause determining system, method and device
CN110430257A (en) Information processing method, device, system and readable storage medium storing program for executing
CN110162458A (en) Test data building method, device and storage medium
CN109166042A (en) Node device, real-time account checking method and storage medium based on block chain
CN105787644B (en) A kind of parametric control method and device of service condition
CN110263580A (en) Data processing method, device and block chain node based on block chain
CN109034819A (en) The report method and device of transaction
US20150026770A1 (en) Safety information transfer system, device and method based on extended parameter set
CN110706108B (en) Method and apparatus for concurrently executing transactions in a blockchain
CN110046977A (en) Bookkeeping methods, account checking method, device and server
CN115222390A (en) Security check method, device, equipment and storage medium
CN109901933A (en) The operating method and device of operation system, storage medium, electronic device
CN110084583A (en) A kind of pressure button stroke accounting data processing method, apparatus and system
CN110309017A (en) Abnormality eliminating method, device, equipment and the storage medium of business

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant