A kind of book keeping operation common recognition method and system of heterogeneous system

文档序号:1772876 发布日期:2019-12-03 浏览:18次 中文

阅读说明:本技术 一种异构系统的记账共识方法及系统 (A kind of book keeping operation common recognition method and system of heterogeneous system ) 是由 徐晓红 于 2019-08-22 设计创作,主要内容包括:一种异构系统的记账共识方法及系统。在该系统中,观察节点选取记账节点的信用值大于设定信用阈值的至少一个记账节点作为当值记账节点,并根据至少一个当值记账节点的信用值高低,选择信用值最高的当值记账节点作为最高信用节点;当接收到入账请求时,对应的至少一个当值记账节点分别更新自身的公共账本,将至少一个更新后的账户余额发送给最高信用节点;以及最高信用节点根据至少一个更新后的账户余额,选取共识余额,并将共识余额发送给至少一个当值记账节点和非当值记账节点。采用本申请的方案,通过一个中立的观察节点确定当值记账节点以及最高信用节点,将该最高信用节点确定的共识余额作为最终的账户余额,保证了参与交易的节点的公平性。(A kind of book keeping operation common recognition method and system of heterogeneous system.Within the system, the credit value for observing node selection accounting nodes is greater than at least one accounting nodes of setting credit threshold as when value accounting nodes, and select credit value highest when value accounting nodes are as highest credit node when the credit value height of value accounting nodes according at least one;When receive keep accounts request when, it is corresponding at least one update itself public account book respectively when value accounting nodes, at least one updated account balance is sent to highest credit node;And highest credit node chooses common recognition remaining sum according at least one updated account balance, and common recognition remaining sum is sent at least one when value accounting nodes and Fei Dang value accounting nodes.Using the scheme of the application, determine that, when value accounting nodes and highest credit node, the common recognition remaining sum which is determined ensure that the fairness for the node participated in business as final account balance by a neutral observation node.)

The method 1. a kind of book keeping operation of heterogeneous system is known together, which is characterized in that the described method includes:

The credit value for observing node selection accounting nodes is greater than at least one accounting nodes of setting credit threshold as when value note Account node;

The observation node, when the credit value height of value accounting nodes, selects credit value highest when value book keeping operation according at least one Node is as highest credit node;

When receive keep accounts request when, it is corresponding it is described at least one update the public account book of itself respectively when value accounting nodes, At least one updated account balance is sent to the highest credit node;

The highest credit node chooses common recognition remaining sum according at least one described updated account balance, and will be described total Know remaining sum be sent to it is described at least one when value accounting nodes and Fei Dang value accounting nodes.

2. the method according to claim 1, wherein the highest credit node is according at least one described update Account balance afterwards chooses common recognition remaining sum, comprising:

The highest credit node determines the quantity for working as value accounting nodes that billing discrepancies occur less than the first given threshold;

The highest credit node counts at least one described updated account balance, takes account that is identical and occupying the majority Family remaining sum is as the common recognition remaining sum.

3. according to the method described in claim 2, it is characterized in that, the method also includes:

When it is described at least one when value accounting nodes in it is any when value accounting nodes updated account balance with it is described total When knowing the difference of remaining sum greater than the second given threshold, the observation node will be described any when the credit value of value accounting nodes subtracts First setting value.

4. described in any item methods according to claim 1~3, which is characterized in that the method also includes:

The observation node determines the credit value of at least one accounting nodes, the credit value of at least one accounting nodes of determination Based at least one parameter include: the true credit scoring C of mechanism1, transaction participate in score C2, book keeping operation score C3Work as with book keeping operation It is worth score C4

5. described in any item methods according to claim 1~3, which is characterized in that the method also includes:

It is described observation node according at least one when value accounting nodes credit value height, to it is described at least one when value book keeping operation section Point is ranked up;

When the observation node connect disconnection with the heartbeat of the highest credit node, the observation node selection credit value row Sequence first after the credit value of the highest credit node when value accounting nodes are as new highest credit node.

6. described in any item methods according to claim 1~3, which is characterized in that the method also includes:

The observation node chooses the quantity of node according to the efficiency and/or participation of heterogeneous system, determines the setting credit threshold Value.

7. described in any item methods according to claim 1~3, which is characterized in that the method also includes:

When accounting nodes receive keep accounts request when, the observation node judges whether the accounting nodes are when value accounting nodes;

If the accounting nodes are not to wait the request that keeps accounts when value accounting nodes next time;

If the accounting nodes be when value accounting nodes, execute it is described it is corresponding it is described at least one when value accounting nodes point The step of not updating the public account book of itself.

8. the method according to the description of claim 7 is characterized in that the method also includes:

Whether the request that keeps accounts described in the accounting nodes judgement is mechanism transaction;

If the request that keeps accounts is traded for mechanism, the accounting nodes keep accounts according to requests to update the account of itself This.

9. a kind of heterogeneous system, including transaction node and accounting nodes, which is characterized in that the heterogeneous system further includes observation section Point;

At least one accounting nodes that the credit value that observation node is used to choose accounting nodes is greater than setting credit threshold, which are used as, works as It is worth accounting nodes;

The observation node is used for the credit value height according at least one when value accounting nodes, selects credit value highest when value Accounting nodes are as highest credit node;

It is corresponding it is described at least one when value accounting nodes for when receive keep accounts request when, update the public account of itself respectively This, is sent to the highest credit node at least one updated account balance;

The highest credit node is used for according at least one described updated account balance, chooses common recognition remaining sum, and by institute State common recognition remaining sum be sent to it is described at least one when value accounting nodes and Fei Dang value accounting nodes.

10. a kind of heterogeneous system, which is characterized in that including input unit, output device, memory and processor;Wherein, described Batch processing code is stored in memory, and the processor is executed for calling the program code stored in the memory Such as method according to any one of claims 1 to 8.

Technical field

This application involves a kind of book keeping operation of block chain technical field more particularly to heterogeneous system common recognition method and system.

Background technique

Block chain can be used as a kind of computer architecture technology, it will bring huge change, example to many application scenarios Such as Industry chain management, melt conjunction, supply chain finance etc. are produced.

Common recognition mechanism is block chain technology foundation, is the important mark that block chain is different from other distributed computer technologies Will.The fundamental nature of block chain is decentralization, and the support of decentralization is common recognition mechanism.In particular, common recognition mechanism It carries two important tasks: 1) guaranteeing all fairness for participating in node;2) guarantee the one of the data of distributed heterogeneous system Cause property.

What most block chain network frameworks was all made of isomorphism node.In other words, most block chain frameworks is simultaneously Do not distinguish transaction node and accounting nodes.The structural schematic diagram of isomorphism system as shown in Figure 1 is constituted in three node In credible block chain P2P network structure, each node once completes authentication (KYC), can join the transaction of block chain, It participates in keeping accounts according to the common recognition mechanism of the chain simultaneously.

Compare the credible block chain close to true financial system, generally transaction node and accounting nodes are distinguished.Cause This, it is proposed that a kind of block chain network framework being made of heterogeneous nodes.In such framework, block chain network by two layers not Same node composition.Such as process of exchange is completed by TBC node, and clear (book keeping operation) process and completed by ABC node.This multilayer The advantages of framework is that process of exchange and clearance process can carry out in the completely different block chain network framework of mechanism, can be with Process of exchange is handled using efficient transaction common recognition mechanism, and uses relatively complete book keeping operation common recognition mechanism form processing clearance. Efficiency required for the financial transaction that this mechanism not only solves, while keeping the extension of block chain relatively easy.

However, financial transaction and book keeping operation are inter-related after all.The meaning of English word (Credit) literal translation of " credit " Think of is " buying now, pay in the future ".In the mode of doing business of " cashing on delivery " formula, credit problems are not present.Also To say, in the system of isomorphism (single node type), transaction and payment be it is simultaneous, during which there is no conversion, There is no delays.Thus, have no credit problem.And the function of node once separate, transaction there is delay, isomery clearance and The problem of payment.Clearance and payment are participated in different ways by different departments, different mechanism (different nodes) how Relationship between transaction and (clearance) book keeping operation is solved, with regard to becoming an extremely important problem.

If what transaction was taken is " exchange " mode, the clearance process traded is usually centralization, and ABC may It is a kind of framework of centralization.But in the commercial dealing of reality, more transaction are carried out in a manner of a kind of " OTC ". In other words, account book is distributed, comes out in process of exchange there is no one " authorities " and defines each participant account balance Authenticity and reliability, to determine the last payment amount of clearing, while also being undertaken by the mechanism of this centralization all Credit risk.In the process of exchange of OTC, the authenticity of account book is to be reached common understanding to determine by relationship trading side.This is also The type of transaction of block chain superiority is best embodied in reality.However, if the application of block chain is only confined in transaction Clearance above, and is traded to be placed in itself under chain and be carried out, and the authenticity of transaction is likely to become problem again.It is really landed in block chain In many supply chain finance actual scenes, many people take the method for internal " Token " to solve the problems, such as to trade between clearance, So that transaction becomes in the closed " cash transaction ", and clearing becomes internal " Token " clearance.This method is in closed platform Perhaps effectively, but in an open platform, it is difficult to close to advise and legally goes to issue what this creditable endorsement was fulfilled "Token".Therefore, studying that a kind of relationship that fiduciary mechanism solves to trade between clearance in open platform has very much must It wants.

Up to the present all block chains common recognition mechanism, is all built upon on the basis of isomorphism node.At present not yet It was found that trying to contact the Oil pipeline common recognition mechanism of transaction node and (clearance/clearing) node of keeping accounts.

Summary of the invention

The application provides a kind of book keeping operation common recognition method and system of heterogeneous system.

In a first aspect, providing a kind of book keeping operation common recognition method of heterogeneous system, which comprises

At least one accounting nodes that the credit value of observation node selection accounting nodes is greater than setting credit threshold, which are used as, works as It is worth accounting nodes;

The observation node, when the credit value height of value accounting nodes, selects credit value highest when value according at least one Accounting nodes are as highest credit node;

When receive keep accounts request when, it is corresponding it is described at least one update the public account of itself respectively when value accounting nodes This, is sent to the highest credit node at least one updated account balance;

The highest credit node chooses common recognition remaining sum according at least one described updated account balance, and by institute State common recognition remaining sum be sent to it is described at least one when value accounting nodes and Fei Dang value accounting nodes.

In one implementation, the highest credit node is chosen altogether according at least one described updated account balance Know remaining sum, comprising:

The highest credit node determines the quantity for working as value accounting nodes that billing discrepancies occur less than the first given threshold;

The highest credit node counts at least one described updated account balance, takes identical and occupies the majority Account balance as the common recognition remaining sum.

In another realization, the method also includes:

When it is described at least one when value accounting nodes in it is any when value accounting nodes updated account balance and institute When stating the difference of common recognition remaining sum greater than the second given threshold, the observation node will be described any when the credit value for being worth accounting nodes Subtract the first setting value.

In another realization, the method also includes:

The observation node determines the credit value of at least one accounting nodes, the letter of at least one accounting nodes of determination At least one parameter based on value includes: the true credit scoring C of mechanism1, transaction participate in score C2, book keeping operation score C3And note Account is when value score C4

In another realization, the method also includes:

It is described observation node according at least one when value accounting nodes credit value height, to it is described at least one when value note Account node is ranked up;

When the observation node connect disconnection with the heartbeat of the highest credit node, the observation node selects credit It is worth first sorted after the credit value of the highest credit node when value accounting nodes are as new highest credit node.

In another realization, the method also includes:

The observation node chooses the quantity of node according to the efficiency and/or participation of heterogeneous system, determines the setting letter Use threshold value.

In another realization, the method also includes:

When accounting nodes receive keep accounts request when, the observation node judge the accounting nodes whether be when value book keeping operation save Point;

If the accounting nodes are not to wait the request that keeps accounts when value accounting nodes next time;

If the accounting nodes be when value accounting nodes, execute it is described it is corresponding it is described at least one keep accounts and save when value The step of point updates the public account book of itself respectively.

In another realization, the method also includes:

Whether the request that keeps accounts described in the accounting nodes judgement is mechanism transaction;

If the request that keeps accounts is traded for mechanism, the accounting nodes keep accounts according to requests to update itself Account book.

Second aspect, provides a kind of heterogeneous system, including transaction node and accounting nodes, and the heterogeneous system further includes Observe node;

At least one accounting nodes that the credit value that observation node is used to choose accounting nodes is greater than setting credit threshold are made For when value accounting nodes;

The observation node is used for the credit value height according at least one when value accounting nodes, selects credit value highest When value accounting nodes are as highest credit node;

It is corresponding it is described at least one when value accounting nodes for when receive keep accounts request when, update the public affairs of itself respectively Account book altogether, is sent to the highest credit node at least one updated account balance;

The highest credit node is used to choose common recognition remaining sum according at least one described updated account balance, and By the common recognition remaining sum be sent to it is described at least one when value accounting nodes and Fei Dang value accounting nodes.

In one implementation, the highest credit node is for determining the quantity for working as value accounting nodes that billing discrepancies occur Less than the first given threshold;

The highest credit node counts at least one described updated account balance, takes identical and occupies the majority Account balance as the common recognition remaining sum.

In another realization, the observation node be also used to when it is described at least one when any in value accounting nodes works as It, will be described any when the difference of the updated account balance and the common recognition remaining sum that are worth accounting nodes is greater than the second given threshold When the credit value of value accounting nodes subtracts the first setting value.

In another realization, the observation node is also used to determine the credit value of the accounting nodes, the determining note At least one parameter based on the credit value of account node includes: the true credit scoring C of mechanism1, transaction participate in score C2, book keeping operation Score C3With book keeping operation when value score C4

In another realization, the observation node is also used to according at least one when the credit value of value accounting nodes is high It is low, to it is described at least one be ranked up when value accounting nodes;

When the observation node is also used to connect disconnection when the observation node with the heartbeat of the highest credit node, choosing First that credit value sorts after the credit value of the highest credit node is selected when value accounting nodes are believed as new highest Use node.

In another realization, the observation node is also used to the efficiency according to heterogeneous system and/or participates in choosing node Quantity, determine the setting credit threshold.

In another realization, the observation node be also used to when accounting nodes receive keep accounts request when, judge the note Whether account node is when value accounting nodes;

If the accounting nodes are waited keeping accounts and be asked when value accounting nodes for the accounting nodes next time It asks.

In another realization, the accounting nodes are also used to judge whether the request that keeps accounts is mechanism transaction;

If the accounting nodes, which are also used to the request that keeps accounts, is traded for mechanism, request is kept accounts according to more The newly account book of itself.

The third aspect provides a kind of heterogeneous system, including input unit, output device, memory and processor;Its In, batch processing code is stored in the memory, and the processor is for calling the program generation stored in the memory Code executes either one or two of above-mentioned first aspect or first aspect and realizes the method.

Fourth aspect provides a kind of computer readable storage medium, is stored in the computer readable storage medium Instruction, when run on a computer, so that computer executes either one or two of above-mentioned first aspect or first aspect and realizes institute The method stated.

5th aspect, provides a kind of computer program product comprising instruction, when run on a computer, so that Computer executes either one or two of above-mentioned first aspect or first aspect and realizes the method.

Using the scheme of the application, have the following beneficial effects:

It is determined by a neutral observation node when value accounting nodes and highest credit node, by the highest credit section The determining common recognition remaining sum of point ensure that the fairness for the node participated in business as final account balance.

Detailed description of the invention

In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.

Fig. 1 is a kind of structural schematic diagram of existing isomorphism system;

Fig. 2 is a kind of structural schematic diagram of heterogeneous system provided by the embodiments of the present application;

Fig. 3 is a kind of flow diagram of the book keeping operation common recognition method of heterogeneous system provided by the embodiments of the present application;

Fig. 4 is the flow diagram of the book keeping operation common recognition method of another heterogeneous system provided by the embodiments of the present application;

Fig. 5 is the structural schematic diagram of another heterogeneous system provided by the embodiments of the present application.

Specific embodiment

Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall in the protection scope of this application.

It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded Body, step, operation, the presence or addition of element, component and/or its set.

It is also understood that mesh of the term used in this present disclosure specification merely for the sake of description specific embodiment And be not intended to limit this disclosure.As present disclosure specification and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.

It will be further appreciated that the term "and/or" used in present disclosure specification and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.

As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".

The embodiment of the present application provides a kind of book keeping operation common recognition method and system of heterogeneous system, passes through a neutral observation section Point determines that, when value accounting nodes and highest credit node, the common recognition remaining sum which is determined is as final account Family remaining sum ensure that the fairness for the node participated in business.

It is core in isomery block that the embodiment of the present application, which proposes one with " credit proves " (Proof of Credit), Across the common recognition mechanism of transaction node and accounting nodes in chain transaction system (referred to as " heterogeneous system ").As shown in Fig. 2, being this Shen Please a kind of structural schematic diagram of heterogeneous system that provides of embodiment, which includes transaction node 11, accounting nodes 12, also Including observing node 13, and the dynamic credit scoring device 14 of connection observation node 13 and accounting nodes 12, with accounting nodes 12 Pre-selection accounting nodes pond 15, node credit threshold controller 16 and the accounting nodes pond 17 of connection.

Wherein, it observes node 13: being a kind of third party's neutrality observation section increased newly between transaction node and accounting nodes Point.In OTC practical application scene, transaction node and accounting nodes are all related with the mechanism of some cochain, require real name and recognize Card.After KYC mechanism carries out mechanism (or personal) certification to node, observation node saves the transaction node of the mechanism and book keeping operation Point is associated.The responsibility of observation node is the information provided according to dynamic credit scoring device, updates the credit value of accounting nodes.

Pre-selection accounting nodes pond 15: the accounting nodes of all cochains can be all placed in pre-selection accounting nodes pond.Pre-selection note Accounting nodes in account node pool trade record, but not vote.

Node credit threshold controller 16: this polling is determined according to the number of the efficiency requirements of system and vote node Lift the credit threshold that (election is when value accounting nodes) extract participation in the election accounting nodes from pre-selection accounting nodes pond.

Accounting nodes pond 17: the accounting nodes that all credit values are greater than epicycle election threshold value will all enter when value accounting nodes (practical accounting nodes) pond.

Dynamic credit scoring model: history, the status, the state of accounting nodes, mechanism KYC information pair participated according to transaction Accounting nodes score in real time.

Highest credit algorithm: the algorithm of active account remaining sum, effective transaction List Table is chosen from book keeping operation pond.

It is retouched below in conjunction with book keeping operation common recognition method of the specific process to heterogeneous system provided by the embodiments of the present application It states:

As shown in figure 3, be a kind of flow diagram of the book keeping operation common recognition method of heterogeneous system provided by the embodiments of the present application, This method may comprise steps of:

At least one accounting nodes that S101, the credit value for observing node selection accounting nodes are greater than setting credit threshold are made For when value accounting nodes.

In order to guarantee the efficiency of heterogeneous system and/or consider the quantity for participating in choosing node, not every accounting nodes It all can serve as when value accounting nodes.Therefore, credit threshold is preset, the credit value for choosing accounting nodes is greater than setting credit At least one accounting nodes of threshold value are as when value accounting nodes.

S102, observation node are according at least one when the credit value height of value accounting nodes, and credit value is highest works as selection It is worth accounting nodes as highest credit node.

In order to determine book keeping operation common recognition remaining sum, it is highest when value accounting nodes are as highest credit section to can choose credit value Point determines book keeping operation common recognition remaining sum by the highest credit node.Specifically, observation node is to all credit values when value accounting nodes It is ranked up, selects credit value highest when value accounting nodes are as highest credit node.

S103, when receive keep accounts request when, it is corresponding at least one update the public of itself respectively when value accounting nodes At least one updated account balance is sent to highest credit node by account book.

When receive transaction node keep accounts request when, it is corresponding one or more when value accounting nodes record book keeping operation respectively The account book of accounts payable settlement information in chain updates the public account book of itself, is respectively sent to updated account balance most High credit node.

S104, highest credit node choose common recognition remaining sum according at least one updated account balance, and will be more than common recognition Forelock gives at least one when value accounting nodes and Fei Dang value accounting nodes.

Highest credit node is counted according to a certain account balance provided when value accounting nodes and takes identical and account for more The account balance of number (" the minority is subordinate to the majority " value mode) is as common recognition remaining sum.Use " the minority is subordinate to the majority " value mode Choose some transaction party account come remaining sum (may and true remaining sum have a deviation, but be identified as the counterparty Remaining sum), using the highest credit node determine common recognition remaining sum as final account balance, ensure that the node participated in business Fairness.

The updated public account book that will know together is distributed to all nodes, including when value accounting nodes and Fei Dang value book keeping operation section Point.

According to a kind of book keeping operation common recognition method of heterogeneous system provided by the embodiments of the present application, pass through a neutral observation section Point determines that, when value accounting nodes and highest credit node, the common recognition remaining sum which is determined is as final account Family remaining sum ensure that the fairness for the node participated in business.

As shown in figure 4, be a kind of flow diagram of the book keeping operation common recognition method of heterogeneous system provided by the embodiments of the present application, This method may comprise steps of:

S201, observation node choose the quantity of node according to the efficiency and/or participation of heterogeneous system, determine setting credit threshold Value.

Before carrying out book keeping operation common recognition, observation node chooses the quantity of node according to the efficiency and/or participation of heterogeneous system (i.e. the number of vote node) determines the setting credit threshold (epicycle election threshold value) of node credit threshold controller.Note The credit value of account node is greater than the accounting nodes of the setting credit threshold into when value accounting nodes (practical accounting nodes) pond.

Start book keeping operation common recognition when, initialized respectively with lower module first: dynamic credit scoring device, pre-selection accounting nodes pond, Node credit threshold controller and when value accounting nodes pond.Wherein, the parameter of initialization includes reconciliation period, a upper billing cycle Obtained final public account book (also referred to as authoritative public account book), the public account book of accounting nodes, node credit value etc..Wherein, The reconciliation period can be time span or bill item number, such as be within every 60 minutes a reconciliation period or every 1000 public affairs Account book length is a reconciliation period altogether.

S202, observation node determine the credit value of at least one accounting nodes, determine the credit of at least one accounting nodes At least one parameter based on value includes: the true credit scoring C of mechanism1, transaction participate in score C2, book keeping operation score C3And book keeping operation When value score C4

Observation node is checked whether according to the reconciliation cycle length in the reconciliation period and above-mentioned initialization that are previously set to be in One new reconciliation period.If it is, starting dynamic credit scoring device updates the financial status of all accounting nodes.

Specifically, the financial status of all accounting nodes is updated, that is, determines the credit value of all accounting nodes.Wherein, really At least one parameter based on the credit value of all accounting nodes includes: calmly

The true credit scoring C of mechanism1(can be obtained using big data, machine learning method);

Transaction participates in score C2(total amount of trading in the last round of reconciliation period);

Book keeping operation score C3

Book keeping operation is when value score C4

Then, the credit value of each accounting nodes is obtained are as follows: C=aC1+bC2+cC3+dC4

Wherein a, b, c, d are adjustable parameter.It can according to need and be adjusted.For example, if a > > (b, c, d), then should System is biased to by the leading clearance of the high large enterprises of commercial credit.If (b=0, c=0, d=0), then the system becomes with enterprise True credit is that mechanism is cleared in the centralization of foundation.If (a=0, c=0, d=0), then the system is with the maximum machine of trading volume Structure organization centerization clearance.

In order to avoid centralization, can balanced each parameter weight, while increasing C4Weight, guarantee last round of reconciliation The highest credit node L (T) in period will not be repeated in the period of reconciliation next time to be chosen, to guarantee the Democracy of book keeping operation.

Further, observation node also indicates " the public account of authority that all accounting nodes retain a billing cycle This ", and the public account book that all accounting nodes are held is initialized, labeled as new reconciliation period account book to be confirmed.Wherein, authoritative Public account book, refer to by it is all when value accounting nodes charge to and settlement records after reconciliation is known together.Public account book is The account book for referring to accounts payable settlement information in record book keeping operation chain, before no initializtion, it is possible to no with " the public account book of authority " Same (such as node is not engaged in billing cycle book keeping operation).New reconciliation period account book to be confirmed referred in this reconciliation week When the settlement records that value accounting nodes are recorded in phase.

At least one accounting nodes that S203, the credit value for observing node selection accounting nodes are greater than setting credit threshold are made For when value accounting nodes.

Node is observed according to the setting credit threshold of above-mentioned node credit threshold controller, the pre-selection for the condition that meets is kept accounts Node is included in practical accounting nodes pond, is defined as when value accounting nodes.

S204, observation node are according at least one when the credit value height of value accounting nodes, and credit value is highest works as selection It is worth accounting nodes as highest credit node.

When the new reconciliation period starts, the requirement of node elects highest credit node L (T) according to the observation.Book keeping operation section The highest credit node L (T-1) for working as value credit node and the credit value of oneself being distributed to upper a cycle in point pond.L(T-1) Select the highest credit node in epicycle reconciliation period according to the credit scoring of credit node, and to other nodes according to credit value into Row sequence.The highest credit node L (T-1) of upper a cycle works as value integrate-dump in oneself credit scoring simultaneously, exits When value accounting nodes pond.

S205, transaction node send the request that keeps accounts.

Correspondingly, accounting nodes receive the request that keeps accounts.

Wherein, trade authenticity verification itself is completed in TBC chain transaction.

Accounting nodes are discriminated whether first as mechanism transaction.I.e. by the relevant information of accounting nodes and transaction node data Mechanism of exchange (transaction participant) relevant information is compared in library;If the letter of the information of the accounting nodes and transaction participant Breath can match, and be exactly mechanism transaction for the accounting nodes.It trades if it is mechanism, then retains the transaction Cryptographic Hash (HashKey), the cryptographic Hash are a characteristic parameters for proving the transaction authenticity, and all premises of the present embodiment are The authenticity of transaction is completed to be proved to be in TBC (chain transaction) true.Accounting nodes are believed according to itself transaction of retention Breath wins mechanism trade detail and account balance from " the public account book of authority ", updates " privately owned account book ".Privately owned account book is remembered The record of the funds on account such as trade detail relevant to mechanism and account balance documented by account node.

S206, observation node judge whether accounting nodes are when value accounting nodes.

It is not that each book keeping operation requires whole if the too many efficiency of number of nodes can be low, therefore in order to improve book keeping operation efficiency Accounting nodes both participate in practical book keeping operation, only meet condition the talent participate in book keeping operation (when value book keeping operation).Node is observed in front Determined which be when value accounting nodes, therefore accounting nodes receive keep accounts request when, further judge the book keeping operation section Whether point is when value accounting nodes.

S207, observation node send judging result to accounting nodes.

In another realization, above-mentioned S206 step and S207 step are directly to be determined in S203 step, Directly just specify which accounting nodes had the right to keep accounts within this period when dividing when value accounting nodes, which accounting nodes Have no right to keep accounts within this period;Without implementing S206 step and S207 step.Can by directly by notice in a manner of determined Perhaps it is carried out in such a way that permission is kept accounts in setting or the method for other record accounting nodes status indicators determines.

If S208, accounting nodes are not when value accounting nodes, accounting nodes wait the request that keeps accounts next time;If note Account node be when value accounting nodes, then it is corresponding at least one ought value accounting nodes update itself public account book respectively, it is near A few updated account balance is sent to highest credit node.

If it is not mechanism transaction that accounting nodes, which judge the request that keeps accounts, and the judging result of node according to the observation, such as The fruit accounting nodes work as value node to be non-, can only just wait.If the accounting nodes are to update the book keeping operation when value accounting nodes Node public account book to be confirmed makes this keep accounts request reflection into relevant account balance.

S209, highest credit node determine the quantity for working as value accounting nodes that billing discrepancies occur less than the first setting threshold Value, the highest credit node count at least one described updated account balance, take account that is identical and occupying the majority Family remaining sum is as the common recognition remaining sum.

In this reconciliation period, kept accounts after request every time, it is all ought value accounting nodes to itself holding public account Originally it is updated, and updated related remaining sum is distributed to L (T).L (T) is issued according to accounting nodes more than remaining sum selection common recognition Volume, i.e. highest credit node choose some transaction party account come according to a certain account balance provided when value accounting nodes Remaining sum (may and true remaining sum have a deviation, but be identified as the remaining sum of the counterparty).Specifically, the common recognition that keeps accounts is adopted With " the minority is subordinate to the majority " value mode.When selection, fault-tolerant threshold value, such as 33% note below of tolerance can be set as needed Account node remaining sum calculate occur difference, i.e., generation billing discrepancies when be worth accounting nodes quantity less than the first given threshold when, It can tolerate.

Common recognition remaining sum is sent at least one when value accounting nodes and Fei Dang value book keeping operation section by S210, highest credit node Point.

L (T) the updated public account book that will know together is distributed to all nodes, including when value accounting nodes and the book keeping operation of Fei Dang value Node.

S211, when at least one when value accounting nodes in it is any when value accounting nodes updated account balance together When knowing the difference of remaining sum greater than the second given threshold, observation node is by any when the credit value of value accounting nodes subtracts the first setting Value.Wherein, the first given threshold can be equal to the second given threshold.

The accounting nodes that existing error is calculated in above-mentioned billing cycle, which will be punished, subtracts credit scoring.For example, should be worth After the remaining sum number of a certain account of node book keeping operation is deviated with common recognition remaining sum, and deviation is greater than a tolerance value, it will punish The credit value of the accounting nodes subtracts first setting value, as book keeping operation when worth point.

S212, observation node, when the credit value height of value accounting nodes, work as value book keeping operation at least one according at least one Node is ranked up, and when observation node connect disconnection with the heartbeat of highest credit node, observation node selects credit value First to sort after the credit value of highest credit node is when value accounting nodes are as new highest credit node.

In order to guarantee the stability of accounting system, if heartbeat of the monitoring less than L (T), by under credit sequence One accounting nodes is taken over, this election is re-initiated.

According to a kind of book keeping operation common recognition method of heterogeneous system provided by the embodiments of the present application, pass through a neutral observation section Point determines that, when value accounting nodes and highest credit node, the common recognition remaining sum which is determined is as final account Family remaining sum ensure that the fairness for the node participated in business;And the true credit scoring of comprehensive organ, transaction participate in score, book keeping operation Score and book keeping operation, which are worked as, is worth gradation parameter to score the credit value of accounting nodes, it is ensured that the Democracy of book keeping operation.

The embodiment of the present application also provides a kind of heterogeneous system, and structure is as shown in Figure 2.The heterogeneous system is above-mentioned for executing Book keeping operation common recognition method.Illustratively:

At least one accounting nodes that the credit value that observation node is used to choose accounting nodes is greater than setting credit threshold are made For when value accounting nodes;

The observation node is used for the credit value height according at least one when value accounting nodes, selects credit value highest When value accounting nodes are as highest credit node;

It is corresponding it is described at least one when value accounting nodes for when receive keep accounts request when, update the public affairs of itself respectively Account book altogether, is sent to the highest credit node at least one updated account balance;

The highest credit node is used to choose common recognition remaining sum according at least one described updated account balance, and By the common recognition remaining sum be sent to it is described at least one when value accounting nodes and Fei Dang value accounting nodes.

In one implementation, the highest credit node is for determining the quantity for working as value accounting nodes that billing discrepancies occur Less than the first given threshold;

The highest credit node counts at least one described updated account balance, takes identical and occupies the majority Account balance as the common recognition remaining sum.

In another realization, the observation node be also used to when it is described at least one when any in value accounting nodes works as It, will be described any when the difference of the updated account balance and the common recognition remaining sum that are worth accounting nodes is greater than the second given threshold When the credit value of value accounting nodes subtracts the first setting value.

In another realization, the observation node is also used to determine the credit value of the accounting nodes, the determining note At least one parameter based on the credit value of account node includes: the true credit scoring C of mechanism1, transaction participate in score C2, book keeping operation Score C3With book keeping operation when value score C4

In another realization, the observation node is also used to according at least one when the credit value of value accounting nodes is high It is low, to it is described at least one be ranked up when value accounting nodes;

When the observation node is also used to connect disconnection when the observation node with the heartbeat of the highest credit node, choosing First that credit value sorts after the credit value of the highest credit node is selected when value accounting nodes are believed as new highest Use node.

In another realization, the observation node is also used to the efficiency according to heterogeneous system and/or participates in choosing node Quantity, determine the setting credit threshold.

In another realization, the observation node be also used to when accounting nodes receive keep accounts request when, judge the note Whether account node is when value accounting nodes;

If the accounting nodes are waited keeping accounts and be asked when value accounting nodes for the accounting nodes next time It asks.

In another realization, the accounting nodes are also used to judge whether the request that keeps accounts is mechanism transaction;

If the accounting nodes, which are also used to the request that keeps accounts, is traded for mechanism, request is kept accounts according to more The newly account book of itself.

The detailed description of each module or node in relation to the heterogeneous system can refer to related in Fig. 3 or method shown in Fig. 4 Description.

According to a kind of heterogeneous system provided by the embodiments of the present application, determined by a neutral observation node when value book keeping operation Node and highest credit node, the common recognition remaining sum which is determined ensure that as final account balance The fairness for the node participated in business.

The embodiment of the present application also provides a kind of heterogeneous system, and the heterogeneous system is for executing above-mentioned book keeping operation common recognition method.On Some or all of stating in method can be realized by hardware, can also be realized by software or firmware.

Optionally, system can be chip or integrated circuit in specific implementation.

Optionally, it is realized when some or all of in the book keeping operation common recognition method of above-described embodiment by software or firmware When, it can be realized by a kind of heterogeneous system 200 that Fig. 5 is provided.As shown in figure 5, the system 200 can include:

Input unit 21, output device 22, memory 23 and processor 24 (processor 24 in device can be one or It is multiple, taken a processor as an example in Fig. 5).In the present embodiment, input unit 21, output device 22, memory 23 and processing Device 24 can be connected by bus or other means, wherein in Fig. 5 for being connected by bus.

Wherein, processor 24 is for executing following steps:

At least one accounting nodes that the credit value of controlled observation node selection accounting nodes is greater than setting credit threshold are made For when value accounting nodes;

The observation node is controlled according at least one when the credit value height of value accounting nodes, selects credit value highest When value accounting nodes are as highest credit node;

When receive keep accounts request when, control it is corresponding it is described at least one when value accounting nodes update the public affairs of itself respectively Account book altogether, is sent to the highest credit node at least one updated account balance;

The highest credit node is controlled according at least one described updated account balance, chooses common recognition remaining sum, and By the common recognition remaining sum be sent to it is described at least one when value accounting nodes and Fei Dang value accounting nodes.

In one implementation, processor 24 controls the highest credit node according at least one described updated account Remaining sum chooses common recognition remaining sum, comprising:

The highest credit node determines the quantity for working as value accounting nodes that billing discrepancies occur less than the first given threshold;

The highest credit node counts at least one described updated account balance, takes identical and occupies the majority Account balance as the common recognition remaining sum.

In another realization, processor 24 is also used to execute following steps:

When it is described at least one when value accounting nodes in it is any when value accounting nodes updated account balance and institute When stating the difference of common recognition remaining sum greater than the second given threshold, the observation node is controlled by any letter for working as value accounting nodes The first setting value is subtracted with value.

In another realization, processor 24 is also used to execute following steps:

Control the credit value that the observation node determines at least one accounting nodes, at least one accounting nodes of the determination Credit value based at least one parameter include: the true credit scoring C of mechanism1, transaction participate in score C2, book keeping operation score C3 With book keeping operation when value score C4

In another realization, processor 24 is also used to execute following steps:

Control it is described observation node according at least one when value accounting nodes credit value just, to it is described at least one work as Value accounting nodes are ranked up;

When the observation node connect disconnection with the heartbeat of the highest credit node, the observation node selection is controlled Credit value sequence first after the credit value of the highest credit node when value accounting nodes are as new highest credit Node.

In another realization, processor 24 is also used to execute following steps:

The quantity that the observation node chooses node according to the efficiency and/or participation of heterogeneous system is controlled, is set described in determination Determine credit threshold.

In another realization, processor 24 is also used to execute following steps:

When accounting nodes receive keep accounts request when, control the observation node judge accounting nodes whether be ought value note Account node;

If the accounting nodes are controlled the accounting nodes and wait keeping accounts and ask when value accounting nodes next time It asks;

If the accounting nodes be when value accounting nodes, execute it is described it is corresponding it is described at least one keep accounts and save when value The step of point updates the public account book of itself respectively.

In another realization, processor 24 is also used to execute following steps:

Control whether the request that keeps accounts described in the accounting nodes judgement is mechanism transaction;

If the request that keeps accounts be for mechanism transaction, control the accounting nodes keep accounts according to request update The account book of itself.

Optionally, the program of above-mentioned data processing method can store in memory 23.The memory 23 can be object Independent unit in reason can also be integrated with processor 24.The memory 23 can be used for storing data.

Optionally, when passing through software realization some or all of in the data processing method of above-described embodiment, the device Processor can also be only included.Memory for storing program is located at except device, and processor passes through circuit or electric wire and deposits Reservoir connection, for reading and executing the program stored in memory.

Processor can be central processing unit (central processing unit, CPU), network processing unit (network processor, NP) or wlan device.

Processor can further include hardware chip.Above-mentioned hardware chip can be specific integrated circuit (application-specific integrated circuit, ASIC), programmable logic device (programmable Logic device, PLD) or combinations thereof.Above-mentioned PLD can be Complex Programmable Logic Devices (complex Programmable logic device, CPLD), field programmable gate array (field-programmable gate Array, FPGA), Universal Array Logic (generic array logic, GAL) or any combination thereof.

Memory may include volatile memory (volatile memory), such as random access memory (random-access memory, RAM);Memory also may include nonvolatile memory (non-volatile ), such as flash memory (flash memory), hard disk (hard disk drive, HDD) or solid state hard disk memory (solid-state drive, SSD);Memory can also include the combination of the memory of mentioned kind.

According to a kind of heterogeneous system provided by the embodiments of the present application, determined by a neutral observation node when value book keeping operation Node and highest credit node, the common recognition remaining sum which is determined ensure that as final account balance The fairness for the node participated in business.

It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.

In several embodiments provided by the disclosure, it should be understood that disclosed systems, devices and methods, it can be with It realizes by another way.For example, the division of the unit, only a kind of logical function partition, can have in actual implementation Other division mode, for example, multiple units or components can be combined or can be integrated into another system or some features It can ignore, or not execute.Shown or discussed mutual coupling or direct-coupling or communication connection can be logical Some interfaces are crossed, the indirect coupling or communication connection of device or unit can be electrical property, mechanical or other forms.

Unit may or may not be physically separated as illustrated by the separation member, shown as a unit Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple networks On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.

In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program produces Product include one or more computer instructions.It is all or part of when loading and execute on computers the computer program instructions Ground generates the process or function according to the embodiment of the present disclosure.The computer can be general purpose computer, special purpose computer, computer Network or other programmable devices.The computer instruction may be stored in a computer readable storage medium, or by being somebody's turn to do Computer readable storage medium is transmitted.The computer instruction can be from a web-site, computer, server or data Center passes through wired (such as coaxial cable, optical fiber, Digital Subscriber Line (digital subscriber line, DSL)) or wireless (such as infrared, wireless, microwave etc.) mode is transmitted to another web-site, computer, server or data center.It should Computer readable storage medium can be any usable medium that computer can access or include one or more available The data storage devices such as medium integrated server, data center.The usable medium can be read-only memory (read-only Memory, ROM) or random access memory (random access memory, RAM) or magnetic medium, for example, floppy disk, Hard disk, tape, magnetic disk or optical medium, for example, digital versatile disc (digital versatile disc, DVD) or half Conductive medium, for example, solid state hard disk (solid state disk, SSD) etc..

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种消费处理的方法以及相关装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!