CN109166042B - Node device, real-time reconciliation method based on blockchain, and storage medium - Google Patents

Node device, real-time reconciliation method based on blockchain, and storage medium Download PDF

Info

Publication number
CN109166042B
CN109166042B CN201811020410.7A CN201811020410A CN109166042B CN 109166042 B CN109166042 B CN 109166042B CN 201811020410 A CN201811020410 A CN 201811020410A CN 109166042 B CN109166042 B CN 109166042B
Authority
CN
China
Prior art keywords
transaction
detail
processed
blockchain
kth
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.)
Active
Application number
CN201811020410.7A
Other languages
Chinese (zh)
Other versions
CN109166042A (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

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • 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 invention relates to a distributed ledger wall technology, and discloses node equipment, a real-time reconciliation method based on blockchain and a computer readable storage medium. The invention receives a link-in request; judging whether the Kth transaction detail is the first transaction detail of the transaction, if so, storing the Kth transaction detail into a blockchain, if not, determining a first account checking result of the Kth transaction detail according to a preset rule, and storing the Kth transaction detail and the first account checking result thereof into the blockchain. Compared with the prior art, the invention realizes real-time reconciliation of transactions, and shortens the time in transit of funds and the period of funds clearing.

Description

Node device, real-time reconciliation method based on blockchain, and storage medium
Technical Field
The invention relates to the technical field of blockchains, in particular to node equipment, a blockchain-based real-time reconciliation method and a computer readable storage medium.
Background
The trade process of commodity usually involves multiple parties, taking as an example a fund trade, in which the fund trade process is usually involving three parties, namely, a fund buying party, a fund buying bank and a fund institution, in which the fund buying party needs to recharge in the electronic account of the corresponding fund buying bank first and issue a fund buying application including the buying quantity to the fund institution. After receiving the fund application, the fund institution sends out a deduction request for deducting the amount corresponding to the application amount in the electronic account to the fund application bank. The fund purchasing bank responds to the deduction request, and after the deduction is successful, the fund institution distributes the fund quantity consistent with the purchasing quantity to the fund purchasing party.
For transaction security, the above-mentioned fund purchase operation must be completed between each participant to complete corresponding reconciliation operation, so as to find out possible abnormal transaction conditions. However, the checking mechanism of the current fund purchase operation adopts a t+1 checking mechanism (i.e. the transaction data of the purchase operation on the T day, the checking operation can be performed only on the t+1 day), the transaction flow is more, the fund link is long, and meanwhile, the checking rule of the fund purchase operation is very complex, so that the fund clearing and settling efficiency is very low, and the time of the user funds in transit is usually 1 to 3 days. Therefore, how to realize real-time reconciliation of transactions is a urgent problem to be solved.
Disclosure of Invention
The invention mainly aims to provide node equipment, a real-time reconciliation method based on blockchain and a computer readable storage medium, and aims to realize real-time reconciliation of transactions.
In order to achieve the above object, the present invention provides a node device, which includes a memory and a processor, wherein the memory stores a real-time checking program based on a blockchain, and the real-time checking program based on the blockchain realizes the following steps when executed by the processor:
a receiving step: receiving an in-link request, wherein the in-link request carries a K-th transaction detail of a transaction, the transaction detail comprises a transaction state, and K is a positive integer;
A first judging step: judging whether the Kth transaction detail is the first transaction detail of the transaction;
the storage step: storing the kth transaction detail in a blockchain when the kth transaction detail is a first transaction detail of the transaction;
checking: when the Kth transaction detail is not the first transaction detail of the transaction, determining a first account checking result of the Kth transaction detail according to a preset rule, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain.
Preferably, the reconciliation step includes:
a first query step: inquiring the K-1 transaction detail of the transaction in the blockchain, shifting to a second judging step when inquiring, and shifting to a second determining step when not inquiring;
and a second judging step: judging whether the transaction state of the K-1 transaction detail of the transaction is a final state, if so, switching to a third judging step, and if not, switching to a second determining step, wherein the final state refers to a state that the transaction state is successful or failed;
and a third judging step: judging whether the transaction state of the Kth transaction detail is a final state or not, if so, switching to a first determination step, and if not, switching to a second determination step;
A first determination step: judging whether the transaction state of the Kth transaction detail is the same as the transaction state of the K-1 th transaction detail, if so, marking the first account checking result of the Kth transaction detail as normal, storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain, if not, marking the first account checking result of the Kth transaction detail as abnormal, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain;
a second determination step: marking the first account checking result of the Kth transaction detail as not known, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain.
Preferably, the processor executes the blockchain-based real-time reconciliation program, after the reconciliation step, further implementing the steps of:
a first acquisition step: acquiring the transaction execution time of each transaction in real time or at fixed time, and taking the transaction with the transaction execution time longer than the preset duration as the transaction to be processed;
and a third determining step: determining the transaction type of each transaction to be processed, and determining the preset quantity corresponding to each transaction to be processed according to the transaction type of each transaction to be processed and the mapping relation between the predetermined transaction type and the preset quantity;
The selection step: judging whether the transaction detail quantity of each to-be-processed transaction is smaller than the preset quantity corresponding to the to-be-processed transaction one by one, and taking all the transaction details of the to-be-processed transaction as a first to-be-processed transaction detail every time the transaction detail quantity of the to-be-processed transaction is judged to be smaller than the preset quantity corresponding to the to-be-processed transaction;
a first marking step: after all the first transaction details to be processed are found, marking the second account checking results of all the first transaction details to be processed as abnormal, and storing the second account checking results of all the first transaction details to be processed into the blockchain.
Preferably, the first reconciliation result includes normal, abnormal and unknown, the processor executes the blockchain-based real-time reconciliation program, and after the first obtaining step, the following steps are further implemented:
a second acquisition step: acquiring all transaction details with the first account checking result being unknown from all the transactions to be processed as second transaction details to be processed;
and a second query step: selecting second to-be-processed transaction details one by one from all the second to-be-processed transaction details, inquiring the ith-1 th transaction details of the transaction to which the selected second to-be-processed transaction details belong in the blockchain when the selected second to-be-processed transaction details are the ith transaction details of the belonging transaction, and transferring to a third determining step when the selected second to-be-processed transaction details are inquired, and transferring to a second marking step when the selected second to-be-processed transaction details are not inquired, wherein i is a positive integer larger than 1;
And a third determining step: judging whether the transaction state of the ith-1 transaction detail is a final state, if so, switching to a fourth determination step, and if not, switching to a second marking step;
fourth determining step: judging whether the transaction state of the ith transaction detail is a final state, if so, switching to a fifth determination step, and if not, switching to a second marking step;
fifth determining step: judging whether the transaction state of the ith transaction detail is the same as the transaction state of the i-1 th transaction detail, if so, switching to a third marking step, and if not, switching to a second marking step;
a second marking step: marking the second account checking result of the ith transaction detail as abnormal, and storing the second account checking result of the ith transaction detail into a blockchain;
a third marking step: marking the second account checking result of the ith transaction detail as normal, and storing the second account checking result of the ith transaction detail into a blockchain;
the detection step comprises: judging whether unselected second to-be-processed transaction details exist in all the second to-be-processed transaction details, and if so, returning to execute the second query step.
Preferably, the processor executes the blockchain-based real-time reconciliation program, and further implements the steps of:
acquiring transaction details with abnormal first account checking results or second account checking results in real time or at regular time, generating account checking reports according to all acquired transaction details when the transaction details are acquired, and sending the account checking reports to monitoring equipment for the monitoring equipment to create abnormal handling matters according to the account checking reports;
or acquiring transaction details with abnormal first account checking results or second account checking results in real time or at regular time, generating account checking reports according to all acquired transaction details when the transaction details are acquired, storing the account checking reports into the blockchain, enabling the monitoring equipment to acquire the account checking reports from the blockchain, and creating abnormal handling matters according to the account checking reports.
In addition, in order to achieve the above objective, the present invention further provides a real-time checking method based on a blockchain, which is applicable to node devices in a blockchain system, and the method includes the steps of:
a receiving step: receiving an in-link request, wherein the in-link request carries a K-th transaction detail of a transaction, the transaction detail comprises a transaction state, and K is a positive integer;
A first judging step: judging whether the Kth transaction detail is the first transaction detail of the transaction;
the storage step: storing the kth transaction detail in a blockchain when the kth transaction detail is a first transaction detail of the transaction;
checking: when the Kth transaction detail is not the first transaction detail of the transaction, determining a first account checking result of the Kth transaction detail according to a preset rule, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain.
Preferably, the reconciliation step includes:
a first query step: inquiring the K-1 transaction detail of the transaction in the blockchain, shifting to a second judging step when inquiring, and shifting to a second determining step when not inquiring;
and a second judging step: judging whether the transaction state of the K-1 transaction detail of the transaction is a final state, if so, switching to a third judging step, and if not, switching to a second determining step, wherein the final state refers to a state that the transaction state is successful or failed;
and a third judging step: judging whether the transaction state of the Kth transaction detail is a final state or not, if so, switching to a first determination step, and if not, switching to a second determination step;
A first determination step: judging whether the transaction state of the Kth transaction detail is the same as the transaction state of the K-1 th transaction detail, if so, marking the first account checking result of the Kth transaction detail as normal, storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain, if not, marking the first account checking result of the Kth transaction detail as abnormal, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain;
a second determination step: marking the first account checking result of the Kth transaction detail as not known, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain.
Preferably, after the step of reconciling, the method further comprises:
a first acquisition step: acquiring the transaction execution time of each transaction in real time or at fixed time, and taking the transaction with the transaction execution time longer than the preset duration as the transaction to be processed;
and a third determining step: determining the transaction type of each transaction to be processed, and determining the preset quantity corresponding to each transaction to be processed according to the transaction type of each transaction to be processed and the mapping relation between the predetermined transaction type and the preset quantity;
The selection step: judging whether the transaction detail quantity of each to-be-processed transaction is smaller than the preset quantity corresponding to the to-be-processed transaction one by one, and taking all the transaction details of the to-be-processed transaction as a first to-be-processed transaction detail every time the transaction detail quantity of the to-be-processed transaction is judged to be smaller than the preset quantity corresponding to the to-be-processed transaction;
a first marking step: after all the first transaction details to be processed are found, marking the second account checking results of all the first transaction details to be processed as abnormal, and storing the second account checking results of all the first transaction details to be processed into the blockchain.
Preferably, the first reconciliation result includes normal, abnormal and unknown, and after the first obtaining step, the method further includes:
a second acquisition step: acquiring all transaction details with the first account checking result being unknown from all the transactions to be processed as second transaction details to be processed;
and a second query step: selecting second to-be-processed transaction details one by one from all the second to-be-processed transaction details, inquiring the ith-1 th transaction details of the transaction to which the selected second to-be-processed transaction details belong in the blockchain when the selected second to-be-processed transaction details are the ith transaction details of the transaction to which the selected second to-be-processed transaction details belong, and switching to a third determination step when the selected second to-be-processed transaction details are inquired, and switching to a second marking step when the selected second to-be-processed transaction details are not inquired, wherein i is a positive integer larger than 1;
And a third determining step: judging whether the transaction state of the ith-1 transaction detail is a final state, if so, switching to a fourth determination step, and if not, switching to a second marking step;
fourth determining step: judging whether the transaction state of the ith transaction detail is a final state, if so, switching to a fifth determination step, and if not, switching to a second marking step;
fifth determining step: judging whether the transaction state of the ith transaction detail is the same as the transaction state of the i-1 th transaction detail, if so, switching to a third marking step, and if not, switching to a second marking step;
a second marking step: marking the second account checking result of the ith transaction detail as abnormal, and storing the second account checking result of the ith transaction detail into a blockchain;
a third marking step: marking the second account checking result of the ith transaction detail as normal, and storing the second account checking result of the ith transaction detail into a blockchain;
the detection step comprises: judging whether unselected second to-be-processed transaction details exist in all the second to-be-processed transaction details, and if so, returning to execute the second query step.
In addition, to achieve the above object, the present invention also proposes a computer-readable storage medium storing a blockchain-based real-time reconciliation program executable by at least one processor to cause the at least one processor to perform the steps of the blockchain-based real-time reconciliation method as set forth in any of the above.
The method comprises the steps of receiving a link entering request, wherein the link entering request carries transaction identification information of a transaction and a K transaction detail of the transaction; judging whether the Kth transaction detail is the first transaction detail of the transaction, if so, storing the Kth transaction detail into a blockchain, if not, determining a first account checking result of the Kth transaction detail according to a preset rule, and storing the Kth transaction detail and the first account checking result thereof into the blockchain. Compared with the prior art, each transaction participant stores the transaction details of each transaction into the blockchain through the node equipment, and the node equipment determines the first account checking result of each transaction detail in the process of storing the transaction details into the blockchain, so that real-time account checking of the transaction is realized, the time in transit of funds and the period of funds clearing are shortened, and the safety of the funds in the transaction period is improved. In addition, due to the advantages of tamper resistance, high transparency, decentralization and the like of the blockchain, the authenticity and the safety of transaction details are ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the structures shown in these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of an alternative application environment according to various embodiments of the present invention;
FIG. 2 is a schematic diagram of an operating environment of a first, second, third, and fourth embodiment of a blockchain-based real-time reconciliation process of the present invention;
FIG. 3 is a block diagram of a real-time checking program based on a blockchain according to a first embodiment of the present invention;
FIG. 4 is a detailed program block diagram of the reconciliation block of FIG. 3;
FIG. 5 is a block diagram of a second embodiment of a blockchain-based real-time reconciliation process in accordance with the present invention;
FIG. 6 is a block diagram of a third embodiment of a blockchain-based real-time reconciliation process in accordance with the present invention;
FIG. 7 is a block diagram illustrating a fourth embodiment of a blockchain-based real-time reconciliation process in accordance with the invention;
FIG. 8 is a flowchart of a first embodiment of a blockchain-based real-time reconciliation method of the present invention;
FIG. 9 is a schematic diagram of the refinement flow of S40 in FIG. 8;
FIG. 10 is a flowchart of a second embodiment of a blockchain-based real-time reconciliation method of the present invention;
FIG. 11 is a flowchart of a third embodiment of a blockchain-based real-time reconciliation method of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
The principles and features of the present invention are described below with reference to the drawings, the examples are illustrated for the purpose of illustrating the invention and are not to be construed as limiting the scope of the invention.
Referring to fig. 1, an alternative application environment is shown according to various embodiments of the present invention.
In this embodiment, the present invention is applicable to application environments including, but not limited to, the node device 1, the blockchain network 2, and the monitoring device 3. Wherein the blockchain network 2 and the plurality of node devices 1 together form a blockchain system, the plurality of node devices 1 are communicatively connected through the blockchain network 2. Furthermore, the monitoring devices 3 are each communicatively connected to at least one node device in the blockchain system.
In the following, various embodiments of the present invention will be presented based on the above-described application environment and related devices.
The invention provides a real-time reconciliation program based on a blockchain.
Referring to FIG. 2, a block chain based real-time reconciliation process 10 of the present invention is schematically illustrated in a first, second, third and fourth embodiment of the operating environment.
In the present embodiment, the blockchain-based real-time reconciliation program 10 is installed and run in the node apparatus 1, for example, the blockchain-based real-time reconciliation program 10 may be an intelligent contract installed and run in the node apparatus 1. The node device 1 may be a computing device such as a mining machine, a desktop computer, a notebook computer, a palm computer, a server, etc. The node device 1 may include, but is not limited to, a memory 11 and a processor 12 in communication with each other via a program bus. Fig. 2 shows only a node device 1 with components 11, 12, but it should be understood that not all shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 11 may in some embodiments be an internal storage unit of the node device 1, such as a hard disk or a memory of the node device 1. The memory 11 may in other embodiments also be an external storage device of the node device 1, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the node device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the node device 1. The memory 11 is used for storing application software installed in the node apparatus 1 and various types of data, such as program codes of the blockchain-based real-time reconciliation program 10. The memory 11 may also be used to temporarily store data that has been output or is to be output.
Processor 12 may in some embodiments be a central processing unit (Central Processing Unit, CPU), microprocessor or other data processing chip for executing program code or processing data stored in memory 11, such as executing blockchain-based real-time reconciliation program 10 or the like.
Referring to FIG. 3, a block diagram of a first embodiment of a blockchain-based real-time reconciliation process 10 is shown. In this embodiment, the blockchain-based real-time reconciliation program 10 may be partitioned into one or more modules that are stored in the memory 11 and executed by one or more processors (processor 12 in this embodiment) to complete the invention. For example, in fig. 3, the blockchain-based real-time reconciliation program 10 may be partitioned into a receiving module 101, a first determining module 102, a storing module 103, and a reconciliation module 104. The modules referred to in the present invention refer to a series of computer program instruction segments capable of performing a specific function, more suitable than a program for describing the execution of the blockchain-based real-time reconciliation program 10 in the node device 1, wherein:
the receiving module 101 is configured to receive an in-link request, where the in-link request carries a kth transaction detail of a transaction, and the transaction detail includes a transaction state, where K is a positive integer and represents an in-link request sequence of the transaction detail.
The triggering manner of the above-mentioned in-link request is illustrated by the following two application scenarios:
first, application scenario of bank electronic account recharging: the method comprises the steps that a fund purchasing party receives an electronic account recharging instruction carrying recharging amount and a bank card number sent by a user, recharging is carried out on the electronic account according to the recharging amount, transaction details are generated according to recharging operation results, and a link entering request carrying the transaction details is initiated to a fund purchasing party node device so that the transaction details can be recorded in a blockchain. And then, the fund purchase initiates a recharging transaction request of the electronic account to the bank, the bank executes the recharging transaction request, generates transaction details according to an execution result of the recharging transaction request, and initiates a chain entering request carrying the produced transaction details to the bank node equipment so as to record the transaction details into the blockchain. And finally, the bank returns an execution result of the recharging transaction request to the fund purchasing party, the fund purchasing party updates the standing book according to the execution result of the recharging transaction request, generates transaction details according to the updating result of the standing book, and initiates a link-in request carrying the transaction details to the fund purchasing party node equipment.
Second, fund application scenario: the method comprises the steps that a fund purchasing party receives a fund purchasing instruction carrying purchasing quantity sent by a user, generates a transaction detail according to the fund purchasing instruction, and initiates a link-in request carrying the transaction detail to a node device of the fund purchasing party. Then, the fund purchasing party initiates a fund purchasing request to the fund institution, and after receiving the purchasing request, the fund institution returns a deduction request to the fund purchasing party. After receiving the deduction request, the fund purchasing party executes deduction operation on the electronic account, generates transaction details according to the deduction operation result, and initiates a chain entering request carrying the transaction details to the fund purchasing party node equipment. And then, the fund purchase request initiates a deduction transaction request of the electronic account to the bank, after receiving the deduction transaction request, the bank executes the deduction transaction request, generates a transaction detail according to an execution result of the deduction transaction request, and initiates a chain entering request carrying the transaction detail to the bank node equipment. And then, the bank returns an execution result of the deduction transaction request to the fund buying party, the fund buying party feeds back the execution result of the deduction transaction request to the fund institution, the fund institution executes the fund buying request according to the execution result, generates transaction details according to the buying result, and initiates a link-in request carrying the transaction details to the fund node equipment. The fund institution also returns the result of the purchase to the fund acquirer. And finally, updating the standing account by the fund purchasing party according to the purchasing result, generating transaction details according to the standing account updating result, and initiating a link-in request carrying the transaction details to the fund purchasing party node equipment.
It should be noted that the above application scenario is only used as an example, and the triggering manner of the specific in-link request may be determined according to the specific application scenario.
A first judging module 102, configured to judge whether the kth transaction detail is the first transaction detail of the transaction, if yes, call the storage module 103, and if not, call the reconciliation module 104.
The step of determining whether the kth transaction detail is the first transaction detail of the transaction by the first determining module 102 includes:
judging whether K is equal to 1, if so, judging that the Kth transaction detail is the first transaction detail of the transaction, and if not, judging that the Kth transaction detail is not the first transaction detail of the transaction.
Or, the link entering request carries the transaction identification information of the transaction, whether the transaction detail corresponding to the transaction is stored in the blockchain is queried according to the transaction identification information of the transaction, if yes, the Kth transaction detail is judged not to be the first transaction detail of the transaction, and if not, the Kth transaction detail is judged to be the first transaction detail of the transaction.
A storage module 103, configured to store the kth transaction details into a blockchain.
For the first transaction detail of a transaction, the storage module 103 may directly store the kth transaction detail and the first reconciliation result of the kth transaction detail into the blockchain without reconciliation.
And the reconciliation module 104 is configured to determine a first reconciliation result of the kth transaction detail according to a preset rule, and store the kth transaction detail into the blockchain.
Referring to fig. 4, the reconciliation module 104 includes a query unit 1041, a first determination unit 1042, a second determination unit 1043, a third determination unit 1044, a first marking unit 1045, a second marking unit 1046, and a third marking unit 1047, wherein:
the query unit 1041 is configured to query the blockchain for whether the K-1 transaction details of the transaction exist, if so, call the first determination unit 1042, and if not, call the third marking unit 1047.
The first judging unit 1042 is configured to judge whether the transaction state of the K-1 th transaction detail of the transaction is a final state, if so, call the second judging unit 1043, and if not, call the third marking unit 1047.
The transaction states of the transaction details are of two types: the first type is a final state, wherein the final state refers to a state that the transaction state is successful or failed; the second is a non-final state, including the transaction state being processed.
The second judging unit 1043 is configured to judge whether the transaction state of the kth transaction detail is a final state, if yes, call the third judging unit 1044, and if not, call the third marking unit 1047.
And a third judging unit 1044, configured to judge whether the transaction state of the kth transaction detail is the same as the transaction state of the kth-1 transaction detail, if yes, call the first marking unit 1045, and if not, call the second marking unit 1046.
A first marking unit 1045, configured to mark that the first accounting result of the kth transaction detail is normal, and store the kth transaction detail and the first accounting result of the kth transaction detail in the blockchain.
A second marking unit 1046, configured to mark that the first reconciliation result of the kth transaction detail is abnormal, and store the kth transaction detail into the blockchain.
A third marking unit 1047, configured to mark that the first accounting result of the kth transaction detail is not clear, and store the kth transaction detail and the first accounting result of the kth transaction detail in the blockchain.
The unknown meaning is that the first reconciliation result of the kth transaction detail can not be determined by temporarily reconciling the kth transaction detail with the transaction state of the kth transaction detail and the transaction state of the kth transaction detail.
For example, there may be cases where the K-th transaction details cannot be reconciled temporarily:
the K-1 th transaction detail is not present (i.e., missing), or the K-1 th transaction detail is non-terminal (i.e., in-process transaction state), or the K-th transaction detail is non-terminal (i.e., in-process transaction state).
The method comprises the steps of receiving a link entering request, wherein the link entering request carries transaction identification information of a transaction and a K transaction detail of the transaction; judging whether the Kth transaction detail is the first transaction detail of the transaction, if so, storing the Kth transaction detail into a blockchain, if not, determining a first account checking result of the Kth transaction detail according to a preset rule, and storing the Kth transaction detail and the first account checking result thereof into the blockchain. Compared with the prior art, each transaction participant stores the transaction details of each transaction into the blockchain through the node equipment, and the node equipment determines the first account checking result of each transaction detail in the process of storing the transaction details into the blockchain, so that real-time account checking of the transaction is realized, the time in transit of funds and the period of funds clearing are shortened, and the safety of the funds in the transaction period is improved. In addition, due to the advantages of tamper resistance, high transparency, decentralization and the like of the blockchain, the authenticity and the safety of transaction details are ensured.
As shown in FIG. 5, FIG. 5 is a block diagram of a second embodiment of the blockchain-based real-time reconciliation process 10 of the present invention.
The present embodiment further includes, on the basis of the first embodiment, a first acquisition module 105, a determination module 106, a first selection module 107, and a first marking module 108, wherein:
the first obtaining module 105 is configured to obtain, in real time or at regular time (e.g., every 5 minutes), a transaction execution time of each transaction, and take a transaction with the transaction execution time being longer than a preset duration (e.g., 10 minutes) as a transaction to be processed.
The determining module 106 is configured to determine a transaction type of each of the pending transactions, and determine a preset number corresponding to each of the pending transactions according to the transaction type of each of the pending transactions and a mapping relationship between a predetermined transaction type and the preset number.
Each transaction is preset to be completed within a preset time period (for example, within 10 minutes), and the transaction details of the corresponding preset number (for example, the preset number corresponding to the transaction of one transaction type is 8) are recorded in the blockchain after the transaction of one transaction type is completely executed.
Because the preset number corresponding to each transaction type is different, a mapping relation (for example, a mapping table) is established between each transaction type and the corresponding preset number, and the mapping relation is stored in a local storage space of each node device or in a blockchain.
The first selection module 107 is configured to determine whether the number of transaction details of each transaction to be processed is smaller than a preset number corresponding to the transaction to be processed one by one, and each time it is determined that the number of transaction details of the transaction to be processed is smaller than the preset number corresponding to the transaction to be processed, take all the transaction details of the transaction to be processed as the first transaction details to be processed.
The first marking module 108 marks the second reconciliation result of all the first to-be-processed transaction details as abnormal after all the first to-be-processed transaction details are found, and stores the second reconciliation result of all the first to-be-processed transaction details into the blockchain.
When the number of the transaction details is smaller than the preset number corresponding to the transaction to be processed, the transaction to be processed is considered to be overtime to be executed, or the subsequent transaction steps cannot be continuously executed due to failure of part of the transaction steps, so that the second reconciliation results of all the transaction details corresponding to the transaction to be processed are marked as abnormal.
The embodiment screens out the overtime transaction, and marks the second reconciliation result of all the transaction details corresponding to the overtime transaction as abnormal. The method is beneficial to monitoring personnel to timely process the overtime transaction, and further shortens the time-in-transit of funds and the period of funds clearing.
Referring to FIG. 6, FIG. 6 is a block diagram of a third embodiment of a blockchain-based real-time reconciliation process 10 of the present invention.
The program of this embodiment further includes, based on the second embodiment, a second acquisition module 109, a second selection module 110, a query module 111, a second judgment module 112, a third judgment module 113, a fourth judgment module 114, a second marking module 115, a third marking module 116, a detection module 117, and an output module 118, where:
a second obtaining module 109, configured to obtain, from all the pending transactions, all the transaction details whose first reconciliation result is unknown as second pending transaction details.
The second selecting module 110 is configured to select the second to-be-processed transaction details one by one from all the second to-be-processed transaction details.
A query module 111, configured to query the blockchain for an i-1 th transaction detail of the selected second pending transaction detail of the transaction (i is a positive integer greater than 1) when the selected second pending transaction detail is the i-th transaction detail of the transaction, call the second judging module 112 when the selected second pending transaction detail is queried, and call the second marking module 115 when the selected second pending transaction detail is not queried.
And a second judging module 112, configured to judge whether the transaction state of the i-1 st transaction detail is a final state, if yes, call the third judging module 113, and if not, call the second marking module 115.
And a third judging module 113, configured to judge whether the transaction state of the ith transaction detail is a final state, if yes, call the fourth judging module 114, and if not, call the second marking module 115.
A fourth determining module 114, configured to determine whether the transaction status of the ith transaction detail is the same as the transaction status of the i-1 th transaction detail, if yes, call the third marking module 116, and if not, call the second marking module 115.
A second marking module 115, configured to mark the second reconciliation result of the ith transaction detail as abnormal, and store the second reconciliation result of the ith transaction detail in a blockchain.
And a third marking module 116, configured to mark the second reconciliation result of the ith transaction detail as normal, and store the second reconciliation result of the ith transaction detail in a blockchain.
The detecting module 117 is configured to determine whether or not there is an unselected second pending transaction detail in all the second pending transaction details, if yes, call the second selecting module 110, and if no, call the output module 118.
And the output module 118 is configured to output transaction details that all the second reconciliation results are abnormal.
In this embodiment, since each transaction is preset to be completed within a preset period of time (for example, within 10 minutes), if the first reconciliation result of a transaction detail is not clear, the reconciliation of the transaction detail is required again. If the transaction detail or the transaction state corresponding to any transaction detail in the previous transaction detail of the transaction detail is not in the final state in the checking process, the execution of the transaction step corresponding to the transaction detail in which the transaction state is not in the final state is considered to be overtime, and the second checking result of the transaction detail is marked as abnormal.
The embodiment checks again the transaction detail with the first checking result being unknown so as to further determine whether the second checking result of the transaction detail is abnormal. By timely finding out abnormal transaction details, monitoring personnel can timely process abnormal transactions, and the time in transit of funds and the period of funds clearing are further shortened.
Referring to fig. 7, fig. 7 is a schematic diagram of a program module of a fourth embodiment of the blockchain-based real-time reconciliation process 10 of the present invention.
The present embodiment further includes a monitoring module 119 on the basis of the first, second, and third embodiments.
The monitoring module 119 is configured to acquire, in real time or at a fixed time, all transaction details with abnormal first accounting results or second accounting results, generate an accounting report according to all acquired transaction details when the transaction details are acquired, and send the accounting report to the monitoring device, so that the monitoring device creates abnormal handling matters according to the accounting report.
Further, in this embodiment, the monitoring module 119 is further configured to:
and acquiring transaction details with abnormal first account checking results or second account checking results in real time or at regular time, generating account checking reports according to all acquired transaction details when the transaction details are acquired, storing the account checking reports into the blockchain, enabling the monitoring equipment to acquire the account checking reports from the blockchain, and creating abnormal handling matters according to the account checking reports.
According to the embodiment, the node equipment generates the reconciliation report according to the abnormal transaction details, and after the monitoring equipment acquires the reconciliation report, the abnormal processing matters are created according to the reconciliation report, so that monitoring personnel can timely intervene in processing the abnormal processing matters, and the in-transit time of funds and the funds clearing cycle can be further shortened.
In addition, the invention provides a real-time checking method based on the blockchain. The method is suitable for node equipment.
Fig. 8 is a flowchart of a first embodiment of the blockchain-based real-time reconciliation method of the present invention.
In this embodiment, the method includes:
step S10, receiving a link-in request, wherein the link-in request carries a K-th transaction detail of a transaction, the transaction detail comprises a transaction state, and K is a positive integer which represents the link-in request sequence of the transaction detail.
The triggering manner of the above-mentioned in-link request is illustrated by the following two application scenarios:
first, application scenario of bank electronic account recharging: the method comprises the steps that a fund purchasing party receives an electronic account recharging instruction carrying recharging amount and a bank card number sent by a user, recharging is carried out on the electronic account according to the recharging amount, transaction details are generated according to recharging operation results, and a link entering request carrying the transaction details is initiated to a fund purchasing party node device so that the transaction details can be recorded in a blockchain. And then, the fund purchase initiates a recharging transaction request of the electronic account to the bank, the bank executes the recharging transaction request, generates transaction details according to an execution result of the recharging transaction request, and initiates a chain entering request carrying the produced transaction details to the bank node equipment so as to record the transaction details into the blockchain. And finally, the bank returns an execution result of the recharging transaction request to the fund purchasing party, the fund purchasing party updates the standing book according to the execution result of the recharging transaction request, generates transaction details according to the updating result of the standing book, and initiates a link-in request carrying the transaction details to the fund purchasing party node equipment.
Second, fund application scenario: the method comprises the steps that a fund purchasing party receives a fund purchasing instruction carrying purchasing quantity sent by a user, generates a transaction detail according to the fund purchasing instruction, and initiates a link-in request carrying the transaction detail to a node device of the fund purchasing party. Then, the fund purchasing party initiates a fund purchasing request to the fund institution, and after receiving the purchasing request, the fund institution returns a deduction request to the fund purchasing party. After receiving the deduction request, the fund purchasing party executes deduction operation on the electronic account, generates transaction details according to the deduction operation result, and initiates a chain entering request carrying the transaction details to the fund purchasing party node equipment. And then, the fund purchase request initiates a deduction transaction request of the electronic account to the bank, after receiving the deduction transaction request, the bank executes the deduction transaction request, generates a transaction detail according to an execution result of the deduction transaction request, and initiates a chain entering request carrying the transaction detail to the bank node equipment. And then, the bank returns an execution result of the deduction transaction request to the fund buying party, the fund buying party feeds back the execution result of the deduction transaction request to the fund institution, the fund institution executes the fund buying request according to the execution result, generates transaction details according to the buying result, and initiates a link-in request carrying the transaction details to the fund node equipment. The fund institution also returns the result of the purchase to the fund acquirer. And finally, updating the standing account by the fund purchasing party according to the purchasing result, generating transaction details according to the standing account updating result, and initiating a link-in request carrying the transaction details to the fund purchasing party node equipment.
It should be noted that the above application scenario is only used as an example, and the triggering manner of the specific in-link request may be determined according to the specific application scenario.
Step S20, determining whether the kth transaction detail is the first transaction detail of the transaction, if yes, turning to step S30, and if no, turning to step S40.
The step of determining whether the kth transaction detail is the first transaction detail of the transaction includes:
judging whether K is equal to 1, if so, judging that the Kth transaction detail is the first transaction detail of the transaction, and if not, judging that the Kth transaction detail is not the first transaction detail of the transaction.
Or, the link entering request carries the transaction identification information of the transaction, whether the transaction detail corresponding to the transaction is stored in the blockchain is queried according to the transaction identification information of the transaction, if yes, the Kth transaction detail is judged not to be the first transaction detail of the transaction, and if not, the Kth transaction detail is judged to be the first transaction detail of the transaction.
Step S30, storing the Kth transaction detail into a blockchain.
For the first transaction detail of a transaction, the K transaction detail is directly stored in the blockchain without checking the first transaction detail.
Step S40, determining a first account checking result of the Kth transaction detail according to a preset rule, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain.
Referring to fig. 9, the step S40 includes:
step S41, inquiring whether the K-1 transaction details of the transaction exist in the blockchain, if so, turning to step S42, and if not, turning to step S47.
Step S42, judging whether the transaction state of the K-1 transaction detail of the transaction is the final state, if so, turning to step S43, otherwise, turning to step S47.
The transaction states of the transaction details are of two types: the first type is a final state, wherein the final state refers to a state that the transaction state is successful or failed; the second is a non-final state, including the transaction state being processed.
Step S43, judging whether the transaction state of the Kth transaction detail is a final state, if so, turning to step S44, otherwise, turning to step S47.
Step S44, judging whether the transaction state of the Kth transaction detail is the same as the transaction state of the Kth-1 transaction detail, if so, turning to step S45, and if not, turning to step S46.
Step S45, storing the Kth transaction detail into the blockchain, marking the first account checking result of the Kth transaction detail as normal, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain.
Step S46, storing the kth transaction detail in the blockchain, marking the first account checking result of the kth transaction detail as abnormal, and storing the kth transaction detail and the first account checking result of the kth transaction detail in the blockchain.
Step S47, storing the kth transaction detail in the blockchain, marking the first account checking result of the kth transaction detail as not known, and storing the kth transaction detail and the first account checking result of the kth transaction detail in the blockchain.
The unknown meaning is that the first reconciliation result of the kth transaction detail can not be determined by temporarily reconciling the kth transaction detail with the transaction state of the kth transaction detail and the transaction state of the kth transaction detail.
For example, there may be cases where the K-th transaction details cannot be reconciled temporarily:
The K-1 th transaction detail is not present (i.e., missing), or the K-1 th transaction detail is non-terminal (i.e., in-process transaction state), or the K-th transaction detail is non-terminal (i.e., in-process transaction state).
The method comprises the steps of receiving a link entering request, wherein the link entering request carries transaction identification information of a transaction and a K transaction detail of the transaction; judging whether the Kth transaction detail is the first transaction detail of the transaction, if so, storing the Kth transaction detail into a blockchain, if not, determining a first account checking result of the Kth transaction detail according to a preset rule, and storing the Kth transaction detail and the first account checking result thereof into the blockchain. Compared with the prior art, each transaction participant stores the transaction details of each transaction into the blockchain through the node equipment, and the node equipment determines the first account checking result of each transaction detail in the process of storing the transaction details into the blockchain, so that real-time account checking of the transaction is realized, the time in transit of funds and the period of funds clearing are shortened, and the safety of the funds in the transaction period is improved. In addition, due to the advantages of tamper resistance, high transparency, decentralization and the like of the blockchain, the authenticity and the safety of transaction details are ensured.
Fig. 10 is a flowchart of a second embodiment of the blockchain-based real-time reconciliation method of the present invention.
The present embodiment is based on the first embodiment, after step S40, the method further includes:
in step S50, the transaction execution time of each transaction is acquired in real time or at regular time (e.g., every 5 minutes), and the transaction with the transaction execution time longer than the preset duration (e.g., 10 minutes) is taken as the transaction to be processed.
Step S60, determining a transaction type of each transaction to be processed, and determining a preset number corresponding to each transaction to be processed according to the transaction type of each transaction to be processed and a mapping relationship between a predetermined transaction type and the preset number.
Each transaction is preset to be completed within a preset time period (for example, within 10 minutes), and the transaction details of the corresponding preset number (for example, the preset number corresponding to the transaction of one transaction type is 8) are recorded in the blockchain after the transaction of one transaction type is completely executed.
Because the preset number corresponding to each transaction type is different, a mapping relation (for example, a mapping table) is established between each transaction type and the corresponding preset number, and the mapping relation is stored in a local storage space of each node device or in a blockchain.
Step S70, judging whether the number of transaction details of each transaction to be processed is smaller than the preset number corresponding to the transaction to be processed one by one, and taking all the transaction details of the transaction to be processed as the first transaction details to be processed whenever judging that the number of transaction details of the transaction to be processed is smaller than the preset number corresponding to the transaction to be processed.
And S80, marking second account checking results of all the first to-be-processed transaction details as abnormal after all the first to-be-processed transaction details are found, and storing the second account checking results of all the first to-be-processed transaction details into the blockchain.
When the number of the transaction details is smaller than the preset number corresponding to the transaction to be processed, the transaction to be processed is considered to be overtime to be executed, or the subsequent transaction steps cannot be continuously executed due to failure of part of the transaction steps, so that the second reconciliation results of all the transaction details corresponding to the transaction to be processed are marked as abnormal.
The node device in this embodiment screens out the transaction with overtime execution, and marks the second reconciliation result of all the transaction details corresponding to the transaction with overtime execution as abnormal. The method is beneficial to monitoring personnel to timely process the overtime transaction, and further shortens the time-in-transit of funds and the period of funds clearing.
Fig. 11 is a flowchart of a third embodiment of the blockchain-based real-time reconciliation method of the present invention.
The present embodiment is based on the second embodiment, after step S50, the method further includes:
step S90, obtaining all transaction details with the first reconciliation result being unknown from all the transactions to be processed as second transaction details to be processed.
Step S100, selecting a second to-be-processed transaction list one by one from all the second to-be-processed transaction lists. Step S110, when the selected second to-be-processed transaction detail is the ith transaction detail of the affiliated transaction (i is a positive integer greater than 1), inquiring the ith-1 transaction detail of the affiliated transaction of the selected second to-be-processed transaction detail in the blockchain, and when inquiring, turning to step S120, and when not inquiring, turning to step S160.
Step S120, judging whether the transaction state of the ith-1 transaction detail is a final state, if so, turning to step S130, and if not, turning to step S160.
Step S130, judging whether the transaction state of the ith transaction detail is a final state, if so, turning to step S140, and if not, turning to step S160.
Step S140, determining whether the transaction state of the ith transaction detail is the same as the transaction state of the i-1 th transaction detail, if so, turning to step S150, otherwise, turning to step S160.
And step S150, marking the second reconciliation result of the ith transaction detail as normal, and storing the second reconciliation result of the ith transaction detail into a blockchain.
Step S160, marking the second reconciliation result of the ith transaction detail as abnormal, and storing the second reconciliation result of the ith transaction detail into a blockchain.
Step S170, determining whether there is an unselected second pending transaction detail in all the second pending transaction details, if yes, returning to step S100, and if no, proceeding to step S180.
Step S180, outputting transaction details with abnormal second account checking results.
In this embodiment, since each transaction is preset to be completed within a preset period of time (for example, within 10 minutes), if the first accounting result of a transaction detail is not clear, the transaction detail needs to be checked again through steps S100-S180. If the transaction detail or the transaction state corresponding to any transaction detail in the previous transaction detail of the transaction detail is not in the final state in the checking process, the execution of the transaction step corresponding to the transaction detail in which the transaction state is not in the final state is considered to be overtime, and the second checking result of the transaction detail is marked as abnormal.
The node device in this embodiment performs reconciliation again on the transaction details whose first reconciliation result is unknown, so as to further determine whether the second reconciliation result of the transaction details is abnormal. By timely finding out abnormal transaction details, monitoring personnel can timely process abnormal transactions, and the time in transit of funds and the period of funds clearing are further shortened.
Further, in this embodiment, the method further includes:
and acquiring transaction details with abnormal first account checking results or second account checking results in real time or at regular time, generating account checking reports according to all acquired transaction details when the transaction details are acquired, and sending the account checking reports to monitoring equipment for the monitoring equipment to create abnormal handling matters according to the account checking reports.
Or acquiring transaction details with abnormal first account checking results or second account checking results in real time or at regular time, generating account checking reports according to all acquired transaction details when the transaction details are acquired, storing the account checking reports into the blockchain, enabling the monitoring equipment to acquire the account checking reports from the blockchain, and creating abnormal handling matters according to the account checking reports.
According to the embodiment, the node equipment generates the reconciliation report according to the abnormal transaction details, and after the monitoring equipment acquires the reconciliation report, the abnormal processing matters are created according to the reconciliation report, so that monitoring personnel can timely intervene in processing the abnormal processing matters, and the in-transit time of funds and the funds clearing cycle can be further shortened.
Further, the present invention also proposes a computer-readable storage medium storing a blockchain-based real-time reconciliation program executable by at least one processor to cause the at least one processor to perform the blockchain-based real-time reconciliation method of any of the embodiments described above.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the invention, and all equivalent structural changes made by the description of the present invention and the accompanying drawings or direct/indirect application in other related technical fields are included in the scope of the invention.

Claims (8)

1. A node device comprising a memory and a processor, wherein the memory has stored thereon a blockchain-based real-time reconciliation program that when executed by the processor performs the steps of:
a receiving step: receiving an in-link request, wherein the in-link request carries a K-th transaction detail of a transaction, the transaction detail comprises a transaction state, and K is a positive integer;
A first judging step: judging whether the Kth transaction detail is the first transaction detail of the transaction;
the storage step: storing the kth transaction detail in a blockchain when the kth transaction detail is a first transaction detail of the transaction;
checking: when the kth transaction detail is not the first transaction detail of the transaction, determining a first reconciliation result of the kth transaction detail according to a preset rule, and storing the kth transaction detail and the first reconciliation result of the kth transaction detail into the blockchain, wherein the steps include:
a first query step: inquiring the K-1 transaction detail of the transaction in the blockchain, shifting to a second judging step when inquiring, and shifting to a second determining step when not inquiring;
and a second judging step: judging whether the transaction state of the K-1 transaction detail of the transaction is a final state, if so, transferring to a third judging step, and if not, transferring to a second determining step, wherein the transaction states of the transaction detail are of two types: the first type is final state, which means that the transaction state is the successful or failed state of the transaction; the second is a non-final state, referring to the transaction state being processed;
And a third judging step: judging whether the transaction state of the Kth transaction detail is a final state or not, if so, switching to a first determination step, and if not, switching to a second determination step;
a first determination step: judging whether the transaction state of the Kth transaction detail is the same as the transaction state of the K-1 th transaction detail, if so, marking the first account checking result of the Kth transaction detail as normal, storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain, if not, marking the first account checking result of the Kth transaction detail as abnormal, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain;
a second determination step: marking the first account checking result of the Kth transaction detail as not known, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain.
2. The node device of claim 1, wherein the processor executes the blockchain-based real-time reconciliation program, after the reconciliation step, further implementing the steps of:
A first acquisition step: acquiring the transaction execution time of each transaction in real time or at fixed time, and taking the transaction with the transaction execution time longer than the preset duration as the transaction to be processed;
and a third determining step: determining the transaction type of each transaction to be processed, and determining the preset quantity corresponding to each transaction to be processed according to the transaction type of each transaction to be processed and the mapping relation between the predetermined transaction type and the preset quantity;
the selection step: judging whether the transaction detail quantity of each to-be-processed transaction is smaller than the preset quantity corresponding to the to-be-processed transaction one by one, and taking all the transaction details of the to-be-processed transaction as a first to-be-processed transaction detail every time the transaction detail quantity of the to-be-processed transaction is judged to be smaller than the preset quantity corresponding to the to-be-processed transaction;
a first marking step: after all the first transaction details to be processed are found, marking the second account checking results of all the first transaction details to be processed as abnormal, and storing the second account checking results of all the first transaction details to be processed into the blockchain.
3. The node device of claim 2, wherein the first reconciliation result includes normal, abnormal and unknown, the processor executing the blockchain-based real-time reconciliation program, after the first obtaining step, further implementing the steps of:
A second acquisition step: acquiring all transaction details with the first account checking result being unknown from all the transactions to be processed as second transaction details to be processed;
and a second query step: selecting second to-be-processed transaction details one by one from all the second to-be-processed transaction details, inquiring the ith-1 th transaction details of the transaction to which the selected second to-be-processed transaction details belong in the blockchain when the selected second to-be-processed transaction details are the ith transaction details of the belonging transaction, and transferring to a third determining step when the selected second to-be-processed transaction details are inquired, and transferring to a second marking step when the selected second to-be-processed transaction details are not inquired, wherein i is a positive integer larger than 1;
and a third determining step: judging whether the transaction state of the ith-1 transaction detail is a final state, if so, switching to a fourth determination step, and if not, switching to a second marking step;
fourth determining step: judging whether the transaction state of the ith transaction detail is a final state or not, if so, switching to a fifth determination step, and if not, switching to a second marking step;
fifth determining step: judging whether the transaction state of the ith transaction detail is the same as the transaction state of the i-1 th transaction detail, if so, switching to a third marking step, and if not, switching to a second marking step;
A second marking step: marking the second account checking result of the ith transaction detail as abnormal, and storing the second account checking result of the ith transaction detail into a blockchain;
a third marking step: marking the second account checking result of the ith transaction detail as normal, and storing the second account checking result of the ith transaction detail into a blockchain;
the detection step comprises: judging whether unselected second to-be-processed transaction details exist in all the second to-be-processed transaction details, and if so, returning to execute the second query step.
4. The node device of claim 2 or 3, wherein the processor executes the blockchain-based real-time reconciliation program, further implementing the steps of:
acquiring transaction details with abnormal first account checking results or second account checking results in real time or at regular time, generating account checking reports according to all acquired transaction details when the transaction details are acquired, and sending the account checking reports to monitoring equipment for the monitoring equipment to create abnormal handling matters according to the account checking reports;
or acquiring transaction details with abnormal first account checking results or second account checking results in real time or at regular time, generating account checking reports according to all acquired transaction details when the transaction details are acquired, storing the account checking reports into the blockchain, enabling the monitoring equipment to acquire the account checking reports from the blockchain, and creating abnormal handling matters according to the account checking reports.
5. A blockchain-based real-time reconciliation method applicable to node devices in a blockchain system, the method comprising the steps of:
a receiving step: receiving an in-link request, wherein the in-link request carries a K-th transaction detail of a transaction, the transaction detail comprises a transaction state, and K is a positive integer;
a first judging step: judging whether the Kth transaction detail is the first transaction detail of the transaction;
the storage step: storing the kth transaction detail in a blockchain when the kth transaction detail is a first transaction detail of the transaction;
checking: when the kth transaction detail is not the first transaction detail of the transaction, determining a first reconciliation result of the kth transaction detail according to a preset rule, and storing the kth transaction detail and the first reconciliation result of the kth transaction detail into the blockchain, wherein the steps include:
a first query step: inquiring the K-1 transaction detail of the transaction in the blockchain, shifting to a second judging step when inquiring, and shifting to a second determining step when not inquiring;
and a second judging step: judging whether the transaction state of the K-1 transaction detail of the transaction is a final state, if so, transferring to a third judging step, and if not, transferring to a second determining step, wherein the transaction states of the transaction detail are of two types: the first type is final state, which means that the transaction state is the successful or failed state of the transaction; the second is a non-final state, referring to the transaction state being processed;
And a third judging step: judging whether the transaction state of the Kth transaction detail is a final state or not, if so, switching to a first determination step, and if not, switching to a second determination step;
a first determination step: judging whether the transaction state of the Kth transaction detail is the same as the transaction state of the K-1 th transaction detail, if so, marking the first account checking result of the Kth transaction detail as normal, storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain, if not, marking the first account checking result of the Kth transaction detail as abnormal, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain;
a second determination step: marking the first account checking result of the Kth transaction detail as not known, and storing the Kth transaction detail and the first account checking result of the Kth transaction detail into the blockchain.
6. The blockchain-based real-time reconciliation method of claim 5, further comprising, after the reconciling step:
a first acquisition step: acquiring the transaction execution time of each transaction in real time or at fixed time, and taking the transaction with the transaction execution time longer than the preset duration as the transaction to be processed;
And a third determining step: determining the transaction type of each transaction to be processed, and determining the preset quantity corresponding to each transaction to be processed according to the transaction type of each transaction to be processed and the mapping relation between the predetermined transaction type and the preset quantity;
the selection step: judging whether the transaction detail quantity of each to-be-processed transaction is smaller than the preset quantity corresponding to the to-be-processed transaction one by one, and taking all the transaction details of the to-be-processed transaction as a first to-be-processed transaction detail every time the transaction detail quantity of the to-be-processed transaction is judged to be smaller than the preset quantity corresponding to the to-be-processed transaction;
a first marking step: after all the first transaction details to be processed are found, marking the second account checking results of all the first transaction details to be processed as abnormal, and storing the second account checking results of all the first transaction details to be processed into the blockchain.
7. The blockchain-based real-time reconciliation method of claim 6, wherein the first reconciliation result comprises normal, abnormal and unknown, the method further comprising, after the first obtaining step:
a second acquisition step: acquiring all transaction details with the first account checking result being unknown from all the transactions to be processed as second transaction details to be processed;
And a second query step: selecting second to-be-processed transaction details one by one from all the second to-be-processed transaction details, inquiring the ith-1 th transaction details of the transaction to which the selected second to-be-processed transaction details belong in the blockchain when the selected second to-be-processed transaction details are the ith transaction details of the belonging transaction, and transferring to a third determining step when the selected second to-be-processed transaction details are inquired, and transferring to a second marking step when the selected second to-be-processed transaction details are not inquired, wherein i is a positive integer larger than 1;
and a third determining step: judging whether the transaction state of the ith-1 transaction detail is a final state, if so, switching to a fourth determination step, and if not, switching to a second marking step;
fourth determining step: judging whether the transaction state of the ith transaction detail is a final state or not, if so, switching to a fifth determination step, and if not, switching to a second marking step;
fifth determining step: judging whether the transaction state of the ith transaction detail is the same as the transaction state of the i-1 th transaction detail, if so, switching to a third marking step, and if not, switching to a second marking step;
a second marking step: marking the second account checking result of the ith transaction detail as abnormal, and storing the second account checking result of the ith transaction detail into a blockchain;
A third marking step: marking the second account checking result of the ith transaction detail as normal, and storing the second account checking result of the ith transaction detail into a blockchain;
the detection step comprises: judging whether unselected second to-be-processed transaction details exist in all the second to-be-processed transaction details, and if so, returning to execute the second query step.
8. A computer-readable storage medium storing a blockchain-based real-time reconciliation program executable by at least one processor to cause the at least one processor to perform the steps of the blockchain-based real-time reconciliation method of any of claims 5-7.
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 CN109166042A (en) 2019-01-08
CN109166042B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107993149A (en) * 2017-12-18 2018-05-04 深圳前海微众银行股份有限公司 Account information management method, system and readable storage medium storing program for executing

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7536325B2 (en) * 2002-09-30 2009-05-19 Canadian National Railway Company 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
CN108074177B (en) * 2017-12-05 2022-01-11 深圳前海微众银行股份有限公司 Data reconciliation 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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107993149A (en) * 2017-12-18 2018-05-04 深圳前海微众银行股份有限公司 Account information management method, system and readable storage medium storing program for executing

Also Published As

Publication number Publication date
CN109166042A (en) 2019-01-08

Similar Documents

Publication Publication Date Title
US20190279197A1 (en) Systems and methods for implementing deterministic finite automata (dfas) via a blockchain
CN108595157B (en) Block chain data processing method, device, equipment and storage medium
CN103714625B (en) A kind of charging intelligent card method and system
CN109543455A (en) A kind of data archiving method and device of block chain
CN109146095A (en) The treating method and apparatus of multiservice system problem
CN108846660B (en) Method and system for identifying abnormal fund
CN106910065B (en) Data processing method, device and system for calculating settlement amount based on multiple transactions
CN109166042B (en) Node device, real-time reconciliation method based on blockchain, and storage medium
CN115409590A (en) Unified account checking method, device, equipment and storage medium
CN114218110A (en) Account checking test method and device for financial data, computer equipment and storage medium
WO2021129005A1 (en) Blockchain state change-based transaction tracking method and device
CN109918385A (en) Tripartite's account checking method, electronic device and readable storage medium storing program for executing
EP2793201A1 (en) Safety information transfer system, device and method based on extended parameter set
CN106708869B (en) Group data processing method and device
CN111324645B (en) Block chain data processing method and device
CN110706108A (en) Method and apparatus for concurrently executing transactions in a blockchain
CN109934590A (en) A kind of data processing method based on block chain, device, electronic equipment and medium
CN110648219B (en) Method and device for standardizing input area of bank transaction system
WO2020181798A1 (en) Data processing method and device, server and computer-readable storage medium
CN112686759A (en) Account checking monitoring method, device, equipment and medium
CN112148353A (en) Data processing method and device
CN112950171A (en) Bank business processing system and method
CN108932611A (en) Charge calculation management method, device and electronic equipment
CN114140236A (en) Line-crossing and remittance-returning processing method, device, equipment and readable storage medium
CN108876570B (en) Electronic device, method for processing abnormal fund problem and storage medium

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