Summary of the invention
The present invention provides a kind of transaction verification method based on block chain, device, storage medium and electronic equipment, by industryThe dependence and transaction verification for process of being engaged in are integrated into the intelligent contract of block chain, to agree with the whole industry of asset securitizationBusiness process.
In a first aspect, the embodiment of the present invention provides a kind of transaction verification method based on block chain, comprising:
Determine the data to be transacted of current block chain account book to be written, the data to be transacted include: state name to be changedAnd preamble link, the preamble link is for linking the data to be transacted and transaction data, wherein the number of dealsAccording to the preceding Successful Transaction data for the data to be transacted;
Transaction data is obtained according to preamble link, the transaction data includes: the subsequent state set that is subject to variationIt closes, the subsequent state set that is subject to variation includes the subsequent all possible change state of transaction data;
Judge whether the state name to be changed belongs to the subsequent state set that is subject to variation;
If the determination result is YES, then the data flow to be transacted is examined successfully, if the judging result be it is no, it is describedData flow to be transacted examines mistake.
In a kind of possible design, before the transaction data according to preamble link acquisition, also wrapIt includes:
Determine the first sub-process belonging to the state name to be changed;
Determine that data mode of first sub-process in current traffic state data acquisition system, the data mode are skyData mode or non vacuum data state.
In a kind of possible design, first sub-process is any one process in following below scheme:
Loan application, pledge file upload, difference is transferred, principal and interest is refunded, non-principal and interest refund, buy back.
In a kind of possible design, in the determination first sub-process in current traffic state data acquisition systemAfter data mode, further includes:
If the data mode is the empty data mode, the current traffic state is traversed according to preamble linkLast state corresponding to each sub-process in data acquisition system;
Matched second sub-process is linked with the preamble if it exists, then the transaction of the last state of second sub-processData are the transaction data.
In a kind of possible design, in the determination first sub-process in current traffic state data acquisition systemAfter data mode, further includes:
If the data mode is the empty data mode, the current traffic state is traversed according to preamble linkLast state corresponding to each sub-process in data acquisition system;
Matched second sub-process is linked with the preamble if it does not exist, then the data flow to be transacted examines mistake.
In a kind of possible design, second sub-process is any one process in following below scheme:
Loan application, pledge file upload, difference is transferred, principal and interest is refunded, non-principal and interest refund, buy back.
In a kind of possible design, in the determination first sub-process in current traffic state data acquisition systemAfter data mode, further includes:
If the data mode is the non vacuum data state, institute is obtained from the current traffic state data acquisition systemState the last state of the first sub-process;
Judge whether the preamble link matches the transaction data of the last state of first sub-process, judging result isIt is.
In a kind of possible design, in the determination first sub-process in current traffic state data acquisition systemAfter data mode, further includes:
If the data mode is the non vacuum data state, institute is obtained from the current traffic state data acquisition systemState the last state of the first sub-process;
Judge whether the preamble link matches the transaction data of the last state of first sub-process;
If judging result is no, the data flow inspection mistake to be transacted.
In a kind of possible design, the transaction data further include: transaction ID number and transaction business letterBreath;
The transaction ID number is used to link the relationship of establishing the link with the preamble in the data to be transacted;
The information of transaction business is to have been written into the specific business transaction information of the block chain account book.
In a kind of possible design, the data to be transacted further include: identification number to be transacted and business to be transacted letterBreath;
The identification number to be transacted is the unique identity number for the data to be transacted;
The business information to be transacted is the specific business transaction information of the block chain account book to be written.
In a kind of possible design, obtained before transaction data described according to preamble link, further includes:
Obtain the customer digital certificate of the account of block chain account book to be written;
Judge whether the customer digital certificate identical as preset digital certificate in the block chain account book, judgesIt as a result is yes.
Second aspect, the embodiment of the present invention also provide a kind of transaction verification device based on block chain, comprising:
Determining module, for the data to be transacted of determining current block chain account book to be written, the data to be transacted include:State name and preamble link to be changed;
Module is obtained, for obtaining transaction data according to preamble link, the preamble link is described for linkingData to be transacted and the transaction data, wherein the transaction data is that the preceding of the data to be transacted is once successfully handed overEasy data, the transaction data includes: the subsequent state set that is subject to variation, and the subsequent state set that is subject to variation includes instituteState the subsequent all possible change state of transaction data;
Judgment module, for judging whether the state name to be changed belongs to the subsequent state set that is subject to variation;
Mistake is examined successfully or examined to correction verification module for returning to the data flow to be transacted.
In a kind of possible design, the determining module is also used to determine first belonging to the state name to be changedSub-process;
The determining module is also used to determine data shape of first sub-process in current traffic state data acquisition systemState, the data mode are empty data mode or non vacuum data state.
In a kind of possible design, first sub-process is any one process in following below scheme:
Loan application, pledge file upload, difference is transferred, principal and interest is refunded, non-principal and interest refund, buy back.
In a kind of possible design, the transaction verification device further include:
Matching module links traversal institute according to the preamble if being the empty data mode for the data modeState last state corresponding to each sub-process in current traffic state data acquisition system;
Matched second sub-process is linked with the preamble if it exists, then the transaction of the last state of second sub-processData are the transaction data.
In a kind of possible design, the transaction verification device further include:
Matching module links traversal institute according to the preamble if being the empty data mode for the data modeState last state corresponding to each sub-process in current traffic state data acquisition system;
Matched second sub-process is linked with the preamble if it does not exist, then the data flow to be transacted examines mistake.
In a kind of possible design, second sub-process is any one process in following below scheme:
Loan application, pledge file upload, difference is transferred, principal and interest is refunded, non-principal and interest refund, buy back.
In a kind of possible design, the acquisition module, if being also used to the data mode is the non vacuum data shapeState then obtains the last state of first sub-process from the current traffic state data acquisition system;
The judgment module, is also used to judge whether the preamble link matches the last state of first sub-processTransaction data.
In a kind of possible design, the transaction data further include: transaction ID number and transaction business letterBreath;
The transaction ID number is used to link the relationship of establishing the link with the preamble in the data to be transacted;
The information of transaction business is to have been written into the specific business transaction information of the block chain account book.
In a kind of possible design, the data to be transacted further include: identification number to be transacted and business to be transacted letterBreath;
The identification number to be transacted is the unique identity number for the data to be transacted;
The business information to be transacted is the specific business transaction information of the block chain account book to be written.
In a kind of possible design, the acquisition module is also used to obtain the use of the account of block chain account book to be writtenFamily digital certificate;
The judgment module, be also used to judge the customer digital certificate whether with preset number in the block chain account bookWhether word certificate is identical.
The third aspect, the embodiment of the present invention also provide a kind of electronic equipment, comprising:
Processor;And
Memory, for storing the executable instruction of the processor;
Wherein, be configured to execute any one in first aspect via the executable instruction is executed can for the processorThe transaction verification method based on block chain of energy.
Fourth aspect, the embodiment of the present invention also provide a kind of storage medium, are stored thereon with computer program, and feature existsIn any one possible transaction verification method based on block chain in realization first aspect when the program is executed by processor.
A kind of transaction verification method based on block chain, device, storage medium and electronics provided in an embodiment of the present invention are setStandby, by determining the data to be transacted of current block chain account book to be written, data to be transacted include: state name to be changed and precedingSequence link, preamble link is for linking data to be transacted and transaction data, then, obtains number of deals according to preamble linkAccording to, wherein whether transaction data includes: the subsequent state set that is subject to variation, then by judging after changing state name and belonging toThe continuous state set that is subject to variation, thus to confirm that data flow to be transacted checks whether success, by each data to be transactedProcess carries out process verification, for effective transaction verification of Asset State transition, thus have no idea to guarantee assets in strict accordance withOperation flow cochain, to realize the reliable authentication of the upper change in block chain account book to transaction in assets state.
Description and claims of this specification and term " first ", " second ", " third " " in above-mentioned attached drawingThe (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manageThe data that solution uses in this way are interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition toHere the sequence other than those of diagram or description is implemented.In addition, term " includes " and " having " and their any deformation,Be intended to cover it is non-exclusive include, for example, containing the process, method of a series of steps or units, system, product or settingIt is standby those of to be not necessarily limited to be clearly listed step or unit, but may include be not clearly listed or for these mistakesThe intrinsic other step or units of journey, method, product or equipment.
Fig. 1 is schematic diagram of the present invention according to the application scenarios of an example embodiment.As shown in Figure 1, the embodiment of the present inventionThe provided transaction verification method based on block chain and device can be applied to block chain network shown in FIG. 1, wherein the blockChain network can have multiple nodes, which can be fund side, or asset side.
Wherein, referring to Fig.1, the transaction verification method based on block chain provided by the embodiment of the present invention is applied with deviceBlock chain be substantially several technical solutions general designation, including point-to-point peer-to-peer network transport protocol, cryptography encryption calculatesMethod, the Game Design of distributed common recognition mechanism and Nash Equilibrium.Based on the combination of these types of technology, may be implementedThe heart goes to the authentic data library trusted, and guarantees that the traceable of recorded information is traced to the source on chain using algorithm proof mechanism, can notIt forges, can not distort.Alliance's block chain refers to the block chain that its common recognition process is controlled by preselected node;Such as such as one haveThe community of 15 financial institutions composition, each mechanism run a node, and in order to make each block come into force needsObtain the confirmation (2/3 confirmation) of wherein 10 mechanisms.Block chain perhaps allows everyone can be read, or is limited only in participationPerson, or mixed type route is walked, such as the root Hash and its application programming interfaces external disclosure of block, application programming interfaces allowThe external world is used to make the inquiry of finite number of time and obtains the information of block chain state.These block chains, which can be considered, " partially goes to centerChange ".Alliance's chain uses multicenter mode, participant node be also it is set in advance, pass through common recognition mechanism confirmation.In alliance's chainIn, it is different from publicly-owned chain, digital certificate setting and control can be carried out, possesses higher apply and scalability.
Transaction verification method and device provided by the embodiment of the present invention based on block chain is pre-ABS's and ABSUnder business scenario, process is changed to complicated Asset State, a kind of transaction verification method is provided, by the dependence of operation flowAnd transaction verification is integrated into the intelligent contract of block chain, ensures that the card data of depositing in block chain not only embody time series,Also operation flow sequence can be embodied simultaneously, wherein operation flow may include loan application sub-process, pledge file upload subflowJourney, principal and interest refund sub-process, non-principal and interest refund sub-process, difference transfer sub-process and repurchase sub-process.In addition, for eachProcess can include still more detailed assets processing status, for example, that implements needed for each node in loan application sub-process is eachProcessing status pledges file and uploads each processing status implemented needed for each node in sub-process, each in principal and interest refund sub-processThe each processing status implemented needed for node, each processing status implemented in non-principal and interest refund sub-process needed for each node are poorVolume transfers each processing status implemented needed for each node in sub-process and buys back each of the required implementation of each node in sub-processA processing status.
Fig. 2 is that the present invention illustrates according to the process of the transaction verification method based on block chain shown in an example embodimentFigure.As shown in Fig. 2, the transaction verification method provided in this embodiment based on block chain, comprising:
Step 101, the data to be transacted for determining current block chain account book to be written.
Determine the data to be transacted of current block chain account book to be written, wherein data to be transacted include: state name to be changedAnd preamble link, preamble link is for linking data to be transacted and transaction data, wherein transaction data is number to be transactedAccording to a preceding Successful Transaction data.
Wherein, for above-mentioned data to be transacted, it is possible to understand that implemented accordingly for any node in block chainAfter assets processing, it may make that state of the assets under the process changes according to above-mentioned data to be transacted in block chain,Different data to be transacted can correspond to generate different variations in block chain account book.
Also, it can also include: transaction ID number and transaction business information for above-mentioned transaction data,In, transaction ID number is used to link the relationship of establishing the link with the preamble in data to be transacted, and transaction business information isThe specific business transaction information of block chain account book is written.
It and can also include: identification number to be transacted and business information to be transacted for data to be transacted.Wherein, to be transactedIdentification number is the unique identity number for data to be transacted, and business information to be transacted is the specific of block chain account book to be writtenBusiness transaction information.
Can be in conjunction with above-mentioned above-mentioned for the data to be transacted and type of data structure of transaction data it is identical, canThink two block datas being connected of front and back, is linked by the preamble in data to be transacted available to transaction dataTransaction ID number, and if after data verification to be transacted passes through, which is written in block chain account book, and at this point, toTransaction data then will become the previous block data of operation to be transacted next time, to form the associated of front and back block dataAnd ensure that characteristic can not be distorted.
And above-mentioned identification number to be transacted and transaction ID number are respectively corresponded as data to be transacted andThe unique identity number of transaction data.Changing the Status Change under the process for the transaction in assets in block chain account book needsA unique identity number is wanted to be recognized, identification number to be transacted as escribed above and transaction ID number.And it is rightThe correlation properties of anchoring assets are also needed after simply generating by random sequence in the generation of identification number, and are provided certainProof mechanism.Wherein, by taking above-mentioned identification number to be transacted as an example, identification number to be transacted can be characterized as assetUid, andAssetUid is made of several parts: original equity side's signature can be characterized as signOrgcode, have the assets of public credibilityNumber, can be characterized as assetNo, and the detailed data abstract of assets original state can be characterized as assetHash.In turn, rightIdentification number in each block data can refer to formula discussed below and be obtained: assetUid=signOrgcode+assetNo+assetHash。
Wherein, it is worth explanatorily:
Equity side's signature, i.e. signOrgcode, it can be understood as be the issuer to assets, that is, original equityThe agreement mechanism coding of mechanism is signed, such as: JDJR is the mechanism coding of Jingdone district finance, uses Jingdone district finance to JDJRPrivate key is signed, and the identity of JDJR is proved with this.
Asset number, i.e. assetNo, it can be understood as correspondence has the number that the mechanism of public credibility issues, such as Jingdone districtThe informal voucher assets of finance need the loan agreement number of corresponding informal voucher, and loan agreement is audited by regulatory agency, have certain public affairsBelieve power, it is therefore an objective to eliminate the randomness of asset number.
The detailed data of assets original state is made a summary, both assetHash, it can be understood as using Hash hash algorithm to placeIt is carried out obtained from extracts processing in the assets information of reset condition.
The present embodiment is anchored assets reset condition data, can not distort characteristic in source control asset data.
Step 102 obtains transaction data according to preamble link.
Since data to be transacted include: state name and preamble link to be changed, preamble is linked for linking number to be transactedAccording to transaction data, wherein transaction data be data to be transacted a preceding Successful Transaction data, then can be according to preambleLink obtains transaction data, wherein transaction data includes: the subsequent state set that is subject to variation.Be worth understand ground, it is subsequent canState set can be changed and contain that transaction data is after being written block chain account book, the subsequent every other transaction that can be carried outChange state.
Wherein, because when status switch is excessively complicated, the transaction verification process flow in block chain contract will be answered moreIt is miscellaneous to be difficult to handle, therefore, layering disposition can be carried out to operation flow.Using the scheme of layering disposition, area can be effectively reducedThe complexity of block chain contract verifying, makes it have exploitativeness during asset securitization.Fig. 3 is in embodiment illustrated in fig. 2The relation schematic diagram of each sub- assets operation sub-process.As shown in figure 3, layering disposal method is divided under pre ABS business scenarioSix sub- flow chart branches: six sub-branches still can change process comprising more detailed Asset State, be done at a layering hereinIt sets, by business sub-module, reduces the difficulty verified for particular transaction.Transaction verification can be confined to carry out under particular hierarchical,Exclude the state interference of other layerings.Wherein, six sub-branches are respectively as follows: loan application sub-process, pledge file upload subflowJourney, difference transfer sub-process, principal and interest refund sub-process, non-principal and interest refund sub-process, repurchase sub-process.It is common, loan applicationSub-process pledges file upload sub-process and principal and interest refund sub-process as necessary process, other sub-processes are optional process.
It may include: loan application state, loan application by process sequence by taking above-mentioned loan application sub-process as an exampleShape is confirmed by state, loan application disarmed state, result notice of making loans state, result of making loans disarmed state and result of making loansState.For loan application by state, the subsequent state set that is subject to variation then contains loan application and passes through state and loanMoney application disarmed state;And for loan application by state, the subsequent state set that is subject to variation then contains result of making loansNotice state;And for result notice state of making loans, the subsequent state set that is subject to variation then contains result refusal shape of making loansState and result acknowledgement state of making loans.
Step 103 judges whether state name to be changed belongs to the subsequent state set that is subject to variation, if the determination result is YES,104 are thened follow the steps, if judging result thens follow the steps 105 to be no.
State name to be changed in the data to be transacted that current block chain account book to be written has been determined and number of dealsSubsequent in is subject to variation after state set, judges whether state name to be changed belongs to the subsequent state set that is subject to variation.
For example, subsequent in transaction data is subject to variation in state set to contain to make loans and result disarmed state and putsMoney result acknowledgement state, and the entitled result acknowledgement state of making loans of state to be changed in current data to be transacted, then explanation toChange state name belongs to the subsequent state set that is subject to variation;But the if subsequent state set that is subject to variation in transaction dataIn contain make loans result disarmed state and result acknowledgement state of making loans, and the state to be changed in current data to be transactedEntitled loan application disarmed state then illustrates that state name to be changed is not belonging to the subsequent state set that is subject to variation.
Step 104, data flow to be transacted are examined successfully.
If state name to be changed belongs to the subsequent state set that is subject to variation, illustrate that data flow to be transacted is examined successfully.
For example, subsequent in transaction data is subject to variation in state set to contain to make loans and result disarmed state and putsMoney result acknowledgement state, and the entitled result acknowledgement state of making loans of state to be changed in current data to be transacted, then explanation toChange state name belongs to the subsequent state set that is subject to variation, then data flow to be transacted is examined successfully.
Step 105, data flow to be transacted examine mistake.
If state name to be changed is not belonging to the subsequent state set that is subject to variation, it is wrong to illustrate that data flow to be transacted is examinedAccidentally.
For example, if subsequent in transaction data be subject to variation in state set contain make loans result disarmed state andResult of making loans acknowledgement state, and the entitled loan application disarmed state of state to be changed in current data to be transacted, then illustrateState name to be changed is not belonging to the subsequent state set that is subject to variation, then data flow to be transacted is examined successfully.
In the present embodiment, by the data to be transacted of determining current block chain account book to be written, data to be transacted include:State name and preamble link to be changed, preamble link is for linking data to be transacted and transaction data, then, according to preambleLink obtains transaction data, wherein transaction data includes: the subsequent state set that is subject to variation, then by judging wait changeWhether state name belongs to the subsequent state set that is subject to variation, to pass through to confirm that data flow to be transacted checks whether successProcess verification is carried out to each data flow to be transacted, for effective transaction verification of Asset State transition, to have no ideaGuarantee assets in strict accordance with operation flow cochain, to realize that the reliable of upper change is tested in block chain account book to transaction in assets stateCard.
Fig. 4 is that the present invention illustrates according to the process of the transaction verification method based on block chain shown in another example embodimentFigure.As shown in figure 4, the transaction verification method provided in this embodiment based on block chain, comprising:
Step 201, the data to be transacted for determining current block chain account book to be written.
Determine the data to be transacted of current block chain account book to be written, wherein data to be transacted include: state name to be changedAnd preamble link, preamble link is for linking data to be transacted and transaction data, wherein transaction data is number to be transactedAccording to a preceding Successful Transaction data.
Wherein, for above-mentioned data to be transacted, it is possible to understand that implemented accordingly for any node in block chainAfter assets processing, it may make that state of the assets under the process changes according to above-mentioned data to be transacted in block chain,Different data to be transacted can correspond to generate different variations in block chain account book.
Also, it can also include: transaction ID number and transaction business information for above-mentioned transaction data,In, transaction ID number is used to link the relationship of establishing the link with the preamble in data to be transacted, and transaction business information isThe specific business transaction information of block chain account book is written.
It and can also include: identification number to be transacted and business information to be transacted for data to be transacted.Wherein, to be transactedIdentification number is the unique identity number for data to be transacted, and business information to be transacted is the specific of block chain account book to be writtenBusiness transaction information.
Can be in conjunction with above-mentioned above-mentioned for the data to be transacted and type of data structure of transaction data it is identical, canThink two block datas being connected of front and back, is linked by the preamble in data to be transacted available to transaction dataTransaction ID number, and if after data verification to be transacted passes through, which is written in block chain account book, and at this point, toTransaction data then will become the previous block data of operation to be transacted next time, to form the associated of front and back block dataAnd ensure that characteristic can not be distorted.
And above-mentioned identification number to be transacted and transaction ID number are respectively corresponded as data to be transacted andThe unique identity number of transaction data.Changing the Status Change under the process for the transaction in assets in block chain account book needsA unique identity number is wanted to be recognized, identification number to be transacted as escribed above and transaction ID number.And it is rightThe correlation properties of anchoring assets are also needed after simply generating by random sequence in the generation of identification number, and are provided certainProof mechanism.Wherein, by taking above-mentioned identification number to be transacted as an example, identification number to be transacted can be characterized as assetUid, andAssetUid is made of several parts: original equity side's signature can be characterized as signOrgcode, have the assets of public credibilityNumber, can be characterized as assetNo, and the detailed data abstract of assets original state can be characterized as assetHash.In turn, rightIdentification number in each block data can refer to formula discussed below and be obtained: assetUid=signOrgcode+assetNo+assetHash。
Wherein, it is worth explanatorily:
Equity side's signature, i.e. signOrgcode, it can be understood as be the issuer to assets, that is, original equityThe agreement mechanism coding of mechanism is signed, such as: JDJR is the mechanism coding of Jingdone district finance, uses Jingdone district finance to JDJRPrivate key is signed, and the identity of JDJR is proved with this.
Asset number, i.e. assetNo, it can be understood as correspondence has the number that the mechanism of public credibility issues, such as Jingdone districtThe informal voucher assets of finance need the loan agreement number of corresponding informal voucher, and loan agreement is audited by regulatory agency, have certain public affairsBelieve power, it is therefore an objective to eliminate the randomness of asset number.
The detailed data of assets original state is made a summary, both assetHash, it can be understood as using Hash hash algorithm to placeIt is carried out obtained from extracts processing in the assets information of reset condition.
The present embodiment is anchored assets reset condition data, can not distort characteristic in source control asset data.
In one possible implementation, it may be defined that
For describing the Stage type of state, wherein Stage describes the preamble possible state of some state and legalThe digital certificate of writer;
For describing the BusinessFlow type of state transfer and relevant operation, wherein BusinessFlow is by StageIts key data is constituted for element, and defines the basic operation function to BusinessFlow;
World state data structure, wherein world state: current traffic state data acquisition system, with lesser numberCurrent traffic state is recorded according to storage cost, it is ensured that intelligent contract realizes quick status check and write-in digital certificate verification.
It is as follows for the stage type reference of each state:
For BusinessFlow type with reference to as follows:
And it is as shown in the table for the design reference of world state current traffic state data acquisition system:
It can first obtain and call relevant parameter, such as function: function name in data to be transacted, in data to be transactedState name to be changed it is of the same name, such as " LOAN_APPLY ", previousTxId: the transaction ID number in transaction data;AssetUid: the identification number to be transacted in data to be transacted;And bizContent: business information to be transacted, it can be understood asThe specific business transaction information of the block chain account book to be written.
Then, state transition diagram is taken out from block chain database using GetState (" BUSINESS_FLOW ") functionDefinition, and call fromBytes function to initialize businessFlow as parameter.
Also, it by using businessFlow.getStageInstanceByName (function), obtainsstageInstance。
Optionally, before carrying out process verification, authorization check, available block chain to be written can also be carried out in advanceThe customer digital certificate of the account of account book, then judge customer digital certificate whether with preset digital certificate in block chain account bookWhether identical, if whether customer digital certificate is identical as preset digital certificate in block chain account book, authorization check passes through, withInto subsequent process checking routine, and if customer digital certificate whether with the not phase of preset digital certificate in block chain account bookTogether, then authorization check does not pass through, and illustrates that the trading activity is illegal act, does not enter subsequent process checking routine directly.
Step 202 determines data mode of first sub-process in current traffic state data acquisition system.
It is alternatively possible to be obtained by using GetState ([assetUid] _ [stageInstance.category])Shape of first sub-process in world state current traffic state data acquisition system belonging to function (state name to be changed)State, and check whether the data mode of the first sub-process in current traffic state data acquisition system is empty.
Step 2031, data mode are empty data mode, then follow the steps 204.
Data mode of first sub-process in current traffic state data acquisition system is sky, then there has been no transaction before illustratingThis first sub-process is written.
Step 2032, data mode are non vacuum data state, then follow the steps 205.
Data mode of first sub-process in current traffic state data acquisition system is non vacuum data state, then before illustratingHave transaction and this first sub-process is written, therefore data to be transacted can only be write and be linked at existing newest friendship in the first sub-processAfter easy state.
Step 204, linked according to preamble it is newest corresponding to each sub-process in traversal current traffic state data acquisition systemState.
It can be linked according to preamble each in previousTxId traversal current traffic state data acquisition system world stateThen the current last state of sub-process matches suitable sub-process and son by being compared with previousTxId againThe current last state of process.
Step 2041 exists and links matched second sub-process with preamble, thens follow the steps 207.
Each subflow in previousTxId traversal current traffic state data acquisition system world state is linked according to preambleThe current last state of journey, and exist and link matched second sub-process of previousTxId with preamble.
Step 2042, there is no with preamble matched second sub-process is linked, then follow the steps 210.
Each subflow in previousTxId traversal current traffic state data acquisition system world state is linked according to preambleThe current last state of journey, still, there is no with preamble matched second sub-process of previousTxId link, then explanation this toTransaction data does not meet preset process sequence, then illustrates that data flow to be transacted examines mistake.
Step 205, the last state that the first sub-process is obtained from current traffic state data acquisition system.
If data mode of first sub-process in current traffic state data acquisition system is non vacuum data state, illustrate itBefore have transaction be written this first sub-process, in order to data to be transacted can only be write be linked in the first sub-process it is existing mostAfter New Transaction state, the newest of the first sub-process first can be obtained from current traffic state data acquisition system world stateState.
Whether step 206, preamble link match the transaction data of the last state of the first sub-process, if judging result isBe then follow the steps 207, if judging result be it is no, then follow the steps 210.
Judge whether preamble link previousTxId matches the transaction data of the last state of the first sub-process, if notMatching then returns to data flow to be transacted and examines mistake, do not enter subsequent process checking routine directly.
Step 207 obtains transaction data according to preamble link.
Since data to be transacted include: state name and preamble link to be changed, preamble link previousTxId is used forLink data to be transacted and transaction data, wherein transaction data is a preceding Successful Transaction data for data to be transacted, thenIt can be linked according to preamble and obtain transaction data, wherein transaction data includes: the subsequent state set that is subject to variation.It is worthUnderstand ground, the subsequent state set world state that is subject to variation contain transaction data after block chain account book is written, afterThe continuous every other transaction change state that can be can be carried out.
Wherein, because when status switch is excessively complicated, the transaction verification process flow in block chain contract will be answered moreIt is miscellaneous to be difficult to handle, therefore, layering disposition can be carried out to operation flow.Using the scheme of layering disposition, area can be effectively reducedThe complexity of block chain contract verifying, makes it have exploitativeness during asset securitization.As shown in figure 3, layering disposition sideCase under pre ABS business scenario, will be divided into six sub- flow chart branches: six sub-branches still can include more detailed Asset StateProcess is changed, doing a layering disposition herein for business sub-module reduces the difficulty verified for particular transaction.Transaction verificationIt can be confined to carry out under particular hierarchical, exclude the state interference of other layerings.Wherein, six sub-branches are respectively as follows: loan ShenPlease sub-process, pledge file and upload sub-process, difference and transfer sub-process, principal and interest refund sub-process, non-principal and interest refund sub-process, returnPurchase sub-process.Common, loan application sub-process pledges file upload sub-process and principal and interest refund sub-process as necessary streamJourney, other sub-processes are optional process.
It may include: loan application state, loan application by process sequence by taking above-mentioned loan application sub-process as an exampleShape is confirmed by state, loan application disarmed state, result notice of making loans state, result of making loans disarmed state and result of making loansState.For loan application by state, the subsequent state set that is subject to variation then contains loan application and passes through state and loanMoney application disarmed state;And for loan application by state, the subsequent state set that is subject to variation then contains result of making loansNotice state;And for result notice state of making loans, the subsequent state set that is subject to variation then contains result refusal shape of making loansState and result acknowledgement state of making loans.
Step 208 judges whether state name to be changed belongs to the subsequent state set that is subject to variation, if the determination result is YES,Then follow the steps 209, if judging result be it is no, then follow the steps 210.
State name to be changed in the data to be transacted that current block chain account book to be written has been determined and number of dealsSubsequent in is subject to variation after state set world state, and judges whether state name to be changed belongs to subsequent possibilityChange state set world state.
For example, subsequent in transaction data is subject to variation and contains result of making loans in state set world state and refuseExhausted state and result acknowledgement state of making loans, and the entitled result confirmation shape of making loans of state to be changed in current data to be transactedState then illustrates that state name to be changed belongs to the subsequent state set that is subject to variation;But if the subsequent possibility in transaction data becomesContain make loans result disarmed state and result acknowledgement state of making loans in more state set world state, and it is current toThe entitled loan application disarmed state of state to be changed in transaction data then illustrates that state name to be changed is not belonging to subsequent possible changeMore state set.
Step 209, data flow to be transacted are examined successfully.
If state name to be changed belongs to the subsequent state set world state that is subject to variation, illustrate data flow to be transactedJourney is examined successfully.
For example, subsequent in transaction data is subject to variation and contains result of making loans in state set world state and refuseExhausted state and result acknowledgement state of making loans, and the entitled result confirmation shape of making loans of state to be changed in current data to be transactedState then illustrates that state name to be changed belongs to the subsequent state set that is subject to variation, then data flow to be transacted is examined successfully.
Step 210, data flow to be transacted examine mistake.
If state name to be changed is not belonging to the subsequent state set world state that is subject to variation, illustrate data to be transactedProcess examines mistake.
For example, if subsequent be subject to variation in state set world state in transaction data contains result of making loansDisarmed state and result acknowledgement state of making loans, and the entitled loan application refusal of state to be changed in current data to be transactedState then illustrates that state name to be changed is not belonging to the subsequent state set that is subject to variation, then data flow to be transacted is examined successfully.
Fig. 5 is structural representation of the present invention according to the transaction verification device based on block chain shown in an example embodimentFigure.As shown in figure 5, a kind of transaction verification device based on block chain provided in this embodiment, comprising:
Determining module 301, for determining the data to be transacted of current block chain account book to be written, the data packet to be transactedIt includes: state name and preamble link to be changed;
Module 302 is obtained, for obtaining transaction data according to preamble link, the preamble link is for linkingState data to be transacted and the transaction data, wherein the transaction data is the preceding primary success of the data to be transactedTransaction data, the transaction data includes: the subsequent state set that is subject to variation;
Judgment module 303, for judging whether the state name to be changed belongs to the subsequent state set that is subject to variation;
Mistake is examined successfully or examined to correction verification module 304 for returning to the data flow to be transacted.
In a kind of possible design, the determining module 301 is also used to determine belonging to the state name to be changed theOne sub-process;
The determining module 301 is also used to determine number of first sub-process in current traffic state data acquisition systemAccording to state, the data mode is empty data mode or non vacuum data state.
In a kind of possible design, first sub-process is any one process in following below scheme:
Loan application, pledge file upload, difference is transferred, principal and interest is refunded, non-principal and interest refund, buy back.
On the basis of embodiment shown in Fig. 5, Fig. 6 be the present invention according to shown in another example embodiment based on block chainTransaction verification device structural schematic diagram.As shown in fig. 6, the transaction verification device provided in this embodiment based on block chain,Further include:
Matching module 305 is linked according to the preamble and is traversed if being the empty data mode for the data modeLast state corresponding to each sub-process in the current traffic state data acquisition system;
Matched second sub-process is linked with the preamble if it exists, then the transaction of the last state of second sub-processData are the transaction data.
In a kind of possible design, the transaction verification device further include:
Matching module 305 is linked according to the preamble and is traversed if being the empty data mode for the data modeLast state corresponding to each sub-process in the current traffic state data acquisition system;
Matched second sub-process is linked with the preamble if it does not exist, then the data flow to be transacted examines mistake.
In a kind of possible design, second sub-process is any one process in following below scheme:
Loan application, pledge file upload, difference is transferred, principal and interest is refunded, non-principal and interest refund, buy back.
In a kind of possible design, the acquisition module, if being also used to the data mode is the non vacuum data shapeState then obtains the last state of first sub-process from the current traffic state data acquisition system;
The judgment module 303, is also used to judge whether the preamble link matches the newest shape of first sub-processThe transaction data of state.
In a kind of possible design, the transaction data further include: transaction ID number and transaction business letterBreath;
The transaction ID number is used to link the relationship of establishing the link with the preamble in the data to be transacted;
The information of transaction business is to have been written into the specific business transaction information of the block chain account book.
In a kind of possible design, the data to be transacted further include: identification number to be transacted and business to be transacted letterBreath;
The identification number to be transacted is the unique identity number for the data to be transacted;
The business information to be transacted is the specific business transaction information of the block chain account book to be written.
In a kind of possible design, the acquisition module 302 is also used to obtain the account of block chain account book to be writtenCustomer digital certificate;
The judgment module 303, is also used to judge whether the customer digital certificate is preset with the block chain account bookDigital certificate it is whether identical.
In the present embodiment, by the data to be transacted of determining current block chain account book to be written, data to be transacted include:State name and preamble link to be changed, preamble link is for linking data to be transacted and transaction data, then, according to preambleLink obtains transaction data, wherein transaction data includes: the subsequent state set that is subject to variation, then by judging wait changeWhether state name belongs to the subsequent state set that is subject to variation, to pass through to confirm that data flow to be transacted checks whether successProcess verification is carried out to each data flow to be transacted, for effective transaction verification of Asset State transition, to have no ideaGuarantee assets in strict accordance with operation flow cochain, to realize that the reliable of upper change is tested in block chain account book to transaction in assets stateCard.It is worth explanatorily, the transaction verification device based on block chain that Fig. 5-embodiment illustrated in fig. 6 provides can be used for executing above-mentionedThe transaction verification method based on block chain that Fig. 2-embodiment illustrated in fig. 4 provides, specific implementation is similar with technical effect, thisIn repeat no more.
Fig. 7 is structural schematic diagram of the present invention according to the electronic equipment shown in an example embodiment.As shown in fig. 7, this realityThe a kind of electronic equipment 40 for applying example offer includes: processor 41 and memory 42;Wherein:
Memory 42, for storing computer program, which can also be flash (flash memory).
Processor 41, for executing executing instruction for memory storage, to realize each step in the above method.SpecificallyIt may refer to the associated description in previous methods embodiment.
Optionally, memory 42 can also be integrated with processor 41 either independent.
When the memory 42 is independently of the device except processor 41, the electronic equipment 40 can also include:
Bus 43, for connecting the memory 42 and processor 41.
The present embodiment also provides a kind of readable storage medium storing program for executing, is stored with computer program in readable storage medium storing program for executing, works as electronicsWhen at least one processor of equipment executes the computer program, electronics executes the side that above-mentioned various embodiments provideMethod.
The present embodiment also provides a kind of program product, which includes computer program, computer program storageIn readable storage medium storing program for executing.At least one processor of electronic equipment can read the computer program from readable storage medium storing program for executing,At least one processor executes the computer program and electronic equipment is made to implement the method that above-mentioned various embodiments provide.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead toThe relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journeyWhen being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk orThe various media that can store program code such as person's CD.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extentPipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according toSo be possible to modify the technical solutions described in the foregoing embodiments, or part of or all technical features are carried out etc.With replacement;And these modifications or substitutions, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solutionRange.