CN112529707B - Transaction uplink error prevention method and device based on instance election consensus and electronic equipment - Google Patents
Transaction uplink error prevention method and device based on instance election consensus and electronic equipment Download PDFInfo
- Publication number
- CN112529707B CN112529707B CN202011478363.8A CN202011478363A CN112529707B CN 112529707 B CN112529707 B CN 112529707B CN 202011478363 A CN202011478363 A CN 202011478363A CN 112529707 B CN112529707 B CN 112529707B
- Authority
- CN
- China
- Prior art keywords
- transaction
- instance
- current
- signature
- leader
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Computer Security & Cryptography (AREA)
- General Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- Bioethics (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- Economics (AREA)
- Development Economics (AREA)
- Health & Medical Sciences (AREA)
- Technology Law (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mobile Radio Communication Systems (AREA)
- Storage Device Security (AREA)
Abstract
The embodiment of the specification provides an instance election consensus-based transaction uplink error prevention method, a plurality of instances sharing the same block address are created for a service provider, each instance independently performs contract fair transaction with a service demander to generate a transaction log, the transaction log is provided with transaction content and a changeable signature instruction, the transaction log of current transaction of the current instance is synchronized to other instances, the multiple instances are kept consistent through log synchronization, whether the signature instruction is in an initial state is judged by combining the transaction logs synchronized among the instances, the transaction content is signed by using a digital certificate in the signature instruction based on a judgment result, an abnormal condition that one signature instruction is repeatedly used by different instances or attacked can be identified, repeated use is prevented, a leader instance generated by election serves as an access node of a block chain to uplink the signed transaction content, uplink of the transaction is controlled, and therefore the safety and the reliability of a multi-instance transaction mode are improved.
Description
Technical Field
The present application relates to the field of internet, and in particular, to a method, an apparatus, and an electronic device for preventing error in a transaction uplink based on an instance election consensus.
Background
The strong notarization is to endow the corresponding document of the trade contract with the mandatory execution efficacy. The compulsory execution of the official document has authenticity and legality, and the meaning of "endowing with force" is endowed with force.
In the process of making contract transaction, the service provider and the service demander carry out notarization on the contract through the intermediary of the notarization place, so that when the service provider, the service demander and even the guarantor do not or refuse to fulfill the obligation due, one party can hold the creditor document endowed with the enforcement effectiveness through the notarization to apply for the execution certificate to the notarization place, and hold the creditor document and the execution certificate to apply for the enforcement to the national court.
Although the concept of online notarization is proposed in the industry at present, few implementation schemes are provided, because the business systems at present are still centralized systems, and for the trading contracts signed by notarization, the trading contracts temporarily extracted from the centralized systems in the strengthening stage can hardly make other business parties believe that the trading contracts are the trading contents when the contracts are signed.
On the other hand, for service providers such as banks, a plurality of service lines often develop services to many clients and sign contracts, if a decentralized system is used to provide storage services, the contracts are necessarily signed to ensure the true identities of contract signers, however, if each service line has a respective digital certificate and private key, a block chain is difficult to manage (for example, when a node on the chain verifies the identity of the contract, a plurality of public keys of the bank need to be used to verify the identity one by one, and the identity verification failure can be finally determined after each verification failure), if each service line respectively generates a signature instruction to sign transaction contents by using the same private key, and then the information is linked up, a security problem and an error that one signature instruction is used for many times may occur.
Therefore, in order to further advance the online implementation of strong notarization, it is necessary to use a block chain to implement transaction signature and then uplink, and in order to adapt to the special situation that multiple service lines simultaneously perform services, it is necessary to provide a new uplink method to prevent errors caused by repeated use of signatures, thereby improving security and reliability.
The above information disclosed in this background section is only for enhancement of understanding of the background of the disclosure and therefore it may contain information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
The embodiment of the specification provides a transaction uplink mistake proofing method, device and electronic equipment based on example election consensus, and the method, device and electronic equipment are used for safety and credibility.
An embodiment of the present specification provides an uplink transaction error prevention method based on an example election consensus, including:
creating multiple instances sharing the same block address for a service provider;
each instance independently carries out contract notarization transaction with a service demand party to generate a transaction log, and the transaction log is provided with transaction contents and signature instructions with changeable states;
synchronizing a transaction log generated by a current instance based on the current transaction to an instance sharing the same block address with the transaction log, judging whether the state of a signature instruction of the current transaction is an initial state or not by combining a historical transaction log generated by the current instance and the transaction log synchronously received, and signing transaction contents by using a digital certificate in the signature instruction based on a judgment result;
the leader instance generated by the multiple instance elections links as an access node of the blockchain links the signed transaction content.
Optionally, the method further comprises:
dividing the multiple instances into a leader instance and follower instances, wherein the number of the leader instances is 1, configuring a vote counting right for the leader instance, and configuring a voting request right and a voting right for each follower instance;
the step of synchronizing the transaction log generated by the current instance based on the current transaction to the instance sharing the same block address with the current instance, and determining whether the state of the signature instruction of the current transaction is an initial state by combining the historical transaction log generated by the current instance and the transaction log received synchronously comprises the following steps:
the current instance sends a transaction log of the transaction to be signed to the leader instance, wherein the transaction log comprises transaction content and a current signature instruction;
the leader instance synchronizes the transaction log to each follower instance and requests each follower instance to vote on the state of the signature instruction in the transaction to be signed;
each follower instance receives the synchronized transaction logs, judges whether the current signature instruction is in an initial state or not by combining the transaction logs stored in the history of the follower instance, and sends a judgment result to the leader instance if the current signature instruction is in the initial state;
and the leader instance counts tickets to obtain a consensus judgment result.
Optionally, the determining whether the current signature instruction is in an initial state includes:
and judging whether the signature command is in an initial state or not by using the state identifier carried by the signature command.
Optionally, the leader instance synchronizing the transaction log to each follower instance, further comprising:
and after the current instance carries out signature by using the current signature instruction, changing the state identifier of the current signature instruction, and synchronizing the changed state identifier to each instance.
Optionally, the method further comprises:
and setting an arbitrary period, and randomly dividing the multiple instances into the leader instance and the follower instance again in each arbitrary period.
Optionally, the signature instruction is also associated with a transaction identifier;
the signing the transaction content by using the digital certificate in the signing instruction based on the judgment result further comprises:
judging whether the transaction identification associated with the current signature instruction corresponds to the transaction to be signed;
and if the signature instruction is in an initial state and the associated transaction identifier corresponds to the transaction direction to be signed, signing the transaction content by using the digital certificate in the signature instruction.
Optionally, the service provider is a bank.
An embodiment of the present specification further provides an apparatus for preventing error in a transaction uplink based on an example election consensus, including:
the instance management module is used for creating a plurality of instances sharing the same block address for a service provider;
the transaction module is used for independently performing contract notarization transaction with a service demand party by each instance to generate a transaction log, and the transaction log is provided with transaction contents and signature instructions with changeable states;
the synchronization module synchronizes a transaction log generated by the current instance based on the current transaction to the instance sharing the same block address with the current instance;
the verification signing module is used for judging whether the state of a signing instruction of the current transaction is an initial state or not by combining a historical transaction log generated by the current instance and a transaction log synchronously received, and signing the transaction content by using a digital certificate in the signing instruction based on a judgment result;
and the uplink module is used for taking the leader instance generated by the multiple instance elections as an access node of the block chain to uplink the signed transaction content.
Optionally, the instance management module is further configured to:
dividing the multiple instances into a leader instance and follower instances, wherein the number of the leader instances is 1, configuring a vote counting right for the leader instance, and configuring a voting request right and a voting right for each follower instance;
the step of synchronizing the transaction log generated by the current instance based on the current transaction to the instance sharing the same block address with the current instance, and determining whether the state of the signature instruction of the current transaction is an initial state by combining the historical transaction log generated by the current instance and the transaction log received synchronously comprises the following steps:
the current instance sends a transaction log of the transaction to be signed to a leader instance, wherein the transaction log to be signed has transaction content and a current signature instruction;
the leader instance synchronizes the transaction log to each follower instance and requests each follower instance to vote on the state of the signature instruction in the transaction to be signed;
each follower instance receives the synchronized transaction logs, judges whether the current signature instruction is in an initial state or not by combining the transaction logs stored in history, and sends a judgment result to the leader instance if the current signature instruction is in the initial state;
and the leader instance counts tickets to obtain a consensus judgment result.
Optionally, the determining whether the current signature instruction is in an initial state includes:
and judging whether the signature command is in an initial state or not by using the state identifier carried by the signature command.
Optionally, the leader instance synchronizing the transaction log to each follower instance, further comprising:
and after the current instance carries out signature by using the current signature instruction, changing the state identifier of the current signature instruction, and synchronizing the changed state identifier to each instance.
Optionally, the instance management module is further configured to:
and setting a free period, and randomly dividing the multiple instances into the leader instance and the follower instance again at each free period.
Optionally, the signature instruction is also associated with a transaction identifier;
the signing the transaction content by using the digital certificate in the signing instruction based on the judgment result further comprises:
judging whether the transaction identification associated with the current signature instruction corresponds to the transaction to be signed;
and if the signature instruction is in an initial state and the associated transaction identifier corresponds to the transaction direction to be signed, signing the transaction content by using the digital certificate in the signature instruction.
Optionally, the service provider is a bank.
An embodiment of the present specification further provides an electronic device, where the electronic device includes:
a processor; and the number of the first and second groups,
a memory storing computer-executable instructions that, when executed, cause the processor to perform any of the methods described above.
The present specification also provides a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement any of the above methods.
Various technical schemes provided by the embodiments of the present description create multiple instances sharing the same block address for a service provider, each instance independently performs a contract fair transaction with a service demander to generate a transaction log, wherein a signature instruction having transaction content and a changeable state synchronizes the transaction log of the current instance to other instances, the multiple instances keep consistent through log synchronization, and then the signature instruction determined by combining the transaction logs synchronized among the instances is an initial state, the transaction content is signed by using a digital certificate in the signature instruction based on a determination result, an abnormal situation or attack that one signature instruction is repeatedly used by different instances can be identified so as to prevent repeated use, a leader instance generated by election serves as an access node of a block chain to chain the signed transaction content, so that the chain-up of transactions is realized, and thus, the security and the controlled reliability of a multi-instance transaction mode are improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic diagram illustrating a schematic diagram of an example election consensus-based transaction uplink error prevention method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of an uplink transaction error prevention apparatus based on example election consensus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a computer-readable medium provided in an embodiment of the present specification.
Detailed Description
Exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. The exemplary embodiments, however, may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept to those skilled in the art. The same reference numerals denote the same or similar elements, components, or parts in the drawings, and thus their repetitive description will be omitted.
Features, structures, characteristics or other details described in a particular embodiment may not be excluded from being combined in a suitable manner in one or more other embodiments, while still complying with the technical idea of the invention.
In describing particular embodiments, the present invention has been described with reference to features, structures, characteristics or other details that are within the purview of one skilled in the art to provide a thorough understanding of the embodiments. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific features, structures, characteristics, or other details.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The term "and/or" and/or "includes all combinations of any one or more of the associated listed items.
Fig. 1 is a schematic diagram of a method for preventing errors in a trade link based on an example election consensus according to an embodiment of the present disclosure, where the method may include:
s101: multiple instances sharing the same block address are created for the service provider.
In the embodiment of the present specification, the service provider is a bank.
The digital certificate comprises an asymmetric key pair, namely a public key and a private key, wherein the private key is used for signing by the service party, the public key is used for decrypting signed contents by other block nodes, and the signed contents are compared with the contents before signing, so that the identity of the signer can be further verified.
Any service party or block node needs to sign the uplink or forwarding of the transaction content, so as to ensure the reliability of the uplink content.
In an embodiment of the present description, we may provide a blockchain into the node for the service provider, through which the service provider may chain transactions.
The multiple instances can improve the service processing efficiency, and each instance can generate a signature instruction by using a common private key and is used for signing the transaction content to be signed.
Since multiple instances share a private key, the contents of the uplink transaction remain as a signature with an identity, which avoids management confusion.
Since each instance can randomly generate signature commands, it is inevitable to generate duplication of signature commands, which still results in reduced credibility if the instances are left to develop, or one signature command is linked up already, so other block nodes can consider that the signature command is not a temporarily forged signature command, i.e. a valid signature command, and if an instance signs the temporarily generated transaction content with the signature command, it is difficult to recognize that the signed transaction content is temporarily forged, which is also a security error caused by reusing the signature command.
Therefore, if multiple instances can be kept consistent, the default signature instruction can only be used once, and the problem of signature instruction reuse can be avoided.
S102: and each instance independently carries out contract notarization transaction with a service demand party to generate a transaction log, wherein the transaction log is provided with transaction contents and signature instructions with changeable states.
To be able to determine whether the signature instruction has been used, we can add state identification data to the signature instruction.
In this case, a sequence number (round value) of the number of times the transaction is called may be used as the state identification data.
For example, the initial state of the signature instruction may be defaulted to 0 calls or 1 calls.
Therefore, the signature instructions are only needed to be synchronized when the signature instructions are generated by all the instances, and after the signature instructions are used, the updated state identification data are synchronized, so that all the instances can be kept consistent, and the double-flower problem is prevented.
S103: synchronizing a transaction log generated by the current instance based on the current transaction to an instance sharing the same block address with the transaction log, judging whether the state of a signature instruction of the current transaction is an initial state or not by combining a historical transaction log generated by the current instance and the transaction log synchronously received, and signing transaction content by using a digital certificate in the signature instruction based on a judgment result.
In the embodiment of the specification, the signature instruction is also associated with a transaction identifier;
the signing the transaction content by using the digital certificate in the signing instruction based on the judgment result may further include:
judging whether the transaction identification associated with the current signature instruction corresponds to the transaction to be signed;
and if the signature instruction is in an initial state and the associated transaction identifier corresponds to the transaction direction to be signed, signing the transaction content by using the digital certificate in the signature instruction.
In this way, each signature instruction can only be used for signing the transaction content of the user notarization, and other transaction content cannot be freely signed.
In the embodiment of the present specification, for signed data, who is uplink, we can determine by way of election.
In one of the ways, the method may include:
the first instance initiates voting on the leader instance, and synchronizes the Nonce and the state;
if the second instance agrees with the voting of the first instance, the voting is issued to other instances;
if the third instance agrees with the ticket of the second instance, the third instance is issued to other instances;
after all instances have agreed, the cluster begins to function properly.
In another manner, the method may also include:
a random number is determined using a random function, and a leader instance is determined based on the random number.
Alternatively, the instance with the most votes may be the leader instance.
It should be noted that we can specify an tenure such that different instances take turns to become leader instances, which are not described here.
The leader instance is used for judging whether the signature instruction can be used or not, feeding back a judgment result and linking the signed transaction content.
In an embodiment of the present specification, the method may further include:
and cleaning a log newly generated when the instance is synchronized, and generating and storing snapshot information by using the transaction content and the state identification data.
Of course, the leader instance can still independently perform a fair contract transaction with the service demand party to generate a transaction log, which is not specifically described herein.
Therefore, in the embodiment of the present specification, the method may further include:
dividing the multiple instances into a leader instance and follower instances, wherein the number of the leader instances is 1, configuring a vote counting right for the leader instance, and configuring a voting request right and a voting right for each follower instance;
the synchronizing the transaction log generated by the current instance based on the current transaction to the instance sharing the same block address with the current instance, and determining whether the state of the signature instruction of the current transaction is the initial state by combining the historical transaction log generated by the current instance and the transaction log received synchronously may include:
the current instance sends a transaction log of the transaction to be signed to the leader instance, wherein the transaction log comprises transaction content and a current signature instruction;
the leader instance synchronizes the transaction log to each follower instance and requests each follower instance to vote on the state of the signature instruction in the transaction to be signed;
each follower instance receives the synchronized transaction logs, judges whether the current signature instruction is in an initial state or not by combining the transaction logs stored in the history of the follower instance, and sends a judgment result to the leader instance if the current signature instruction is in the initial state;
and the leader instance counts tickets to obtain a consensus judgment result.
Because the leader instance is required to count tickets and judge before signing by the signature instruction every time, and the judgment basis of each instance is the synchronously received log, each log generated by each instance is recorded by other instances, so that although each instance independently develops business, the log of each instance has the signature condition of other instances through log synchronization, and the condition of repeated use can be avoided.
In the embodiment of the present specification, the method may further include:
and setting a free period, and randomly dividing the multiple instances into the leader instance and the follower instance again at each free period.
In this embodiment of the present specification, the determining whether the current signature instruction is in an initial state may include:
and judging whether the signature command is in an initial state or not by using the state identifier carried by the signature command.
In an embodiment of this specification, the synchronizing, by the leader instance, the transaction log to each follower instance may further include:
and after the current instance is signed by using the current signature instruction, changing the state identifier of the current signature instruction, and synchronizing the changed state identifier to each instance.
Therefore, if the same signature command is generated or the signature command is tried to be used again, the signature can be identified and stopped, and the repeated use is avoided.
S104: and the leader instance generated by the multiple instance elections serves as an access node of the block chain to chain the signed transaction content.
The method comprises the steps of creating a plurality of instances sharing the same block address for a service provider, enabling each instance to independently perform contract notarization transaction with a service demand party to generate a transaction log, enabling the transaction log of the current instance to be synchronized to other instances, enabling the multiple instances to keep consistent through log synchronization, judging whether the signature instruction is in an initial state or not by combining the transaction log synchronized among the instances, signing transaction content by using a digital certificate in the signature instruction based on a judgment result, identifying abnormal conditions or attacks of repeated use of one signature instruction by different instances to prevent repeated use, enabling a leader instance generated by election to serve as an access node of a block chain to chain up the signed transaction content, enabling the chain up of transactions to be controlled, and accordingly improving the safety and the reliability of a multi-instance transaction mode.
In an embodiment of the present specification, the method may further include:
each block node performs identity authentication and voting on the transaction content linked on the access node by using the public key of the service provider;
and the main chain counts the authentication voting result, and if the voting passing ratio is greater than a threshold value, the signed transaction content is stored in a storage node of the block chain.
In an embodiment of the present specification, the method may further include:
and the main chain calls the signed transaction content to send to a transaction calling requester based on a transaction calling request carrying a transaction identifier.
Thus, the court can judge whether to sign mandatory documents, such as official documents, according to the transaction content.
Fig. 2 is a schematic structural diagram of an uplink transaction error prevention apparatus based on example election consensus according to an embodiment of the present disclosure, where the apparatus may include:
an instance management module 201, which creates a plurality of instances sharing the same block address for a service provider;
the transaction module 202 is used for independently performing contract notarization transaction with a service demand party by each instance to generate a transaction log, and the transaction log is provided with transaction contents and signature instructions with changeable states;
the synchronization module 203 synchronizes a transaction log generated by the current instance based on the current transaction to the instance sharing the same block address with the current instance;
the verification signature module 204 is used for judging whether the state of a signature instruction of the current transaction is an initial state or not by combining the historical transaction log generated by the current instance and the transaction log synchronously received, and signing the transaction content by using a digital certificate in the signature instruction based on the judgment result;
and an uplink module 205, for taking the leader instance generated by the multiple instance elections as the access node of the block chain to uplink the signed transaction content.
In this embodiment, the instance management module 201 is further configured to:
dividing the multiple instances into a leader instance and follower instances, wherein the number of the leader instances is 1, configuring a voting right for the leader instance, and configuring a voting request right and a voting right for each follower instance;
the step of synchronizing the transaction log generated by the current instance based on the current transaction to the instance sharing the same block address with the current instance, and determining whether the state of the signature instruction of the current transaction is an initial state by combining the historical transaction log generated by the current instance and the transaction log received synchronously comprises the following steps:
the current instance sends a transaction log of the transaction to be signed to the leader instance, wherein the transaction log comprises transaction content and a current signature instruction;
the leader instance synchronizes the transaction log to each follower instance and requests each follower instance to vote on the state of the signature instruction in the transaction to be signed;
each follower instance receives the synchronized transaction logs, judges whether the current signature instruction is in an initial state or not by combining the transaction logs stored in history, and sends a judgment result to the leader instance if the current signature instruction is in the initial state;
and the leader instance counts tickets to obtain a consensus judgment result.
In an embodiment of this specification, the determining whether the current signature instruction is in an initial state includes:
and judging whether the signature command is in an initial state or not by using the state identifier carried by the signature command.
In an embodiment of the present specification, the leader instance synchronizing the transaction logs to follower instances further comprises:
and after the current instance carries out signature by using the current signature instruction, changing the state identifier of the current signature instruction, and synchronizing the changed state identifier to each instance.
In this embodiment, the instance management module 201 is further configured to:
and setting a free period, and randomly dividing the multiple instances into the leader instance and the follower instance again at each free period.
In the embodiment of the specification, the signature instruction is also associated with a transaction identifier;
the signing the transaction content by using the digital certificate in the signing instruction based on the judgment result further comprises:
judging whether the transaction identification associated with the current signature instruction corresponds to the transaction to be signed;
and if the signature instruction is in an initial state and the associated transaction identifier corresponds to the transaction direction to be signed, signing the transaction content by using the digital certificate in the signature instruction.
In the embodiment of the present specification, the service provider is a bank.
The device creates a plurality of instances sharing the same block address for a service provider, each instance independently carries out contract notarization transaction with a service demand party to generate a transaction log, wherein the transaction log has transaction content and a signature instruction with a changeable state, the transaction log of the current instance of the current transaction is synchronized to other instances, the multiple instances are kept consistent through log synchronization, whether the signature instruction judged by combining the transaction logs synchronized among the instances is in an initial state or not is judged, the transaction content is signed by using a digital certificate in the signature instruction based on a judgment result, an abnormal condition or attack that one signature instruction is repeatedly used by different instances can be identified, the repeated use is prevented, a leader instance generated by election serves as an access node of a block chain to chain up the signed transaction content, the chain up of the transaction is controlled, and therefore the safety and the reliability of a multi-instance transaction mode are improved.
Based on the same inventive concept, the embodiment of the specification further provides the electronic equipment.
In the following, embodiments of the electronic device of the present invention are described, which may be regarded as specific physical implementations for the above-described embodiments of the method and apparatus of the present invention. Details described in the embodiments of the electronic device of the invention should be considered supplementary to the embodiments of the method or apparatus described above; for details not disclosed in the embodiments of the electronic device of the present invention, reference may be made to the above-described embodiments of the method or apparatus.
Fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. An electronic device 300 according to this embodiment of the invention is described below with reference to fig. 3. The electronic device 300 shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 3, electronic device 300 is embodied in the form of a general purpose computing device. The components of electronic device 300 may include, but are not limited to: at least one processing unit 310, at least one memory unit 320, a bus 330 connecting the various system components (including the memory unit 320 and the processing unit 310), a display unit 340, and the like.
Wherein the storage unit stores program code executable by the processing unit 310 to cause the processing unit 310 to perform the steps according to various exemplary embodiments of the present invention described in the above-mentioned processing method section of the present specification. For example, the processing unit 310 may perform the steps shown in fig. 1.
The storage unit 320 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM) 3201 and/or a cache storage unit 3202, and may further include a read only memory unit (ROM) 3203.
The storage unit 320 may also include a program/utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment.
The electronic device 300 may also communicate with one or more external devices 400 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 300, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 300 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 350. Also, electronic device 300 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 360. Network adapter 360 may communicate with other modules of electronic device 300 via bus 330. It should be appreciated that although not shown in FIG. 3, other hardware and/or software modules may be used in conjunction with electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments of the present invention described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, or a network device, etc.) execute the above-mentioned method according to the present invention. The computer program, when executed by a data processing apparatus, enables the computer readable medium to implement the above-described method of the invention, namely: such as the method shown in fig. 1.
Fig. 4 is a schematic diagram of a computer-readable medium provided in an embodiment of the present specification.
A computer program implementing the method shown in fig. 1 may be stored on one or more computer readable media. The computer readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In summary, the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functionality of some or all of the components in embodiments in accordance with the invention may be implemented in practice using a general purpose data processing device such as a microprocessor or a Digital Signal Processor (DSP). The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on a computer readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
While the foregoing embodiments have described the objects, aspects and advantages of the present invention in further detail, it should be understood that the present invention is not inherently related to any particular computer, virtual machine or electronic device, and various general-purpose machines may be used to implement the present invention. The present invention is not limited to the above embodiments, and any modifications, equivalent substitutions, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.
Claims (10)
1. An example election consensus based uplink transaction error prevention method, comprising:
creating multiple instances sharing the same block address for a service provider;
each instance independently carries out contract notarization transaction with a service demand party to generate a transaction log, wherein the transaction log is provided with transaction contents and signature instructions with changeable states;
the current instance synchronizes a transaction log generated based on the current transaction to an instance sharing the same block address with the current instance, each follower instance judges whether the state of a signature instruction of the current transaction is an initial state or not by combining a historical transaction log generated by the current instance and the transaction log synchronously received, and the current instance signs the transaction content by using a digital certificate in the signature instruction based on the judgment result;
and the leader instance generated by the multiple instance elections serves as an access node of the block chain to chain the signed transaction content.
2. The method of claim 1, further comprising:
dividing the multiple instances into a leader instance and follower instances, wherein the number of the leader instances is 1, configuring a vote counting right for the leader instance, and configuring a voting request right and a voting right for each follower instance;
the current instance synchronizes a transaction log generated based on the current transaction to an instance sharing the same block address with the current instance, and each follower instance determines whether the state of the signature instruction of the current transaction is an initial state by combining a historical transaction log generated by the current instance and the transaction log received synchronously, including:
the current instance sends a transaction log of the transaction to be signed to the leader instance, wherein the transaction log is provided with transaction content and a current signature instruction;
the leader instance synchronizes the transaction log to each follower instance and requests each follower instance to vote on the state of the signature instruction in the transaction to be signed;
each follower instance receives the synchronized transaction logs, judges whether the current signature instruction is in an initial state or not by combining the transaction logs stored in the history of the follower instance, and sends a judgment result to the leader instance if the current signature instruction is in the initial state;
and the leader instance counts tickets to obtain a consensus judgment result.
3. The method of claim 2, wherein said determining whether the current signature instruction is in an initial state comprises:
and judging whether the signature command is in an initial state or not by using the state identifier carried by the signature command.
4. The method of claim 3, wherein the leader instance synchronizes the transaction log to follower instances, further comprising:
and after the current instance is signed by using the current signature instruction, changing the state identifier of the current signature instruction, and synchronizing the changed state identifier to each instance.
5. The method of claim 2, further comprising:
and setting an arbitrary period, and randomly dividing the multiple instances into the leader instance and the follower instance again in each arbitrary period.
6. The method of claim 2, wherein the signature instruction is further associated with a transaction identifier;
the signing the transaction content by using the digital certificate in the signing instruction based on the judgment result further comprises:
judging whether the transaction identification associated with the current signature instruction corresponds to the transaction to be signed;
and if the signature instruction is in an initial state and the associated transaction identifier corresponds to the transaction direction to be signed, signing the transaction content by using the digital certificate in the signature instruction.
7. The method of claim 1, wherein the service provider is a bank.
8. An example election consensus based uplink transaction error proofing apparatus, comprising:
the instance management module is used for creating a plurality of instances sharing the same block address for a service provider;
the transaction module is used for independently performing contract notarization transaction with a service demand party by each instance to generate a transaction log, and the transaction log is provided with transaction contents and signature instructions in changeable states;
a synchronization module, wherein the current instance synchronizes a transaction log generated based on the current transaction to an instance sharing the same block address with the current instance;
the verification signing module is used for judging whether the state of a signing instruction of the current transaction is an initial state or not by combining the historical transaction log generated by each follower instance with the transaction log synchronously received, and the current instance signs the transaction content by using a digital certificate in the signing instruction based on the judgment result;
and the uplink module is used for enabling the leader example generated by the multiple example elections to serve as the access node of the block chain to uplink the signed transaction content.
9. An electronic device, wherein the electronic device comprises:
a processor; and (c) a second step of,
a memory storing computer-executable instructions that, when executed, cause the processor to perform the method of any of claims 1-7.
10. A computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011478363.8A CN112529707B (en) | 2020-12-15 | 2020-12-15 | Transaction uplink error prevention method and device based on instance election consensus and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011478363.8A CN112529707B (en) | 2020-12-15 | 2020-12-15 | Transaction uplink error prevention method and device based on instance election consensus and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112529707A CN112529707A (en) | 2021-03-19 |
CN112529707B true CN112529707B (en) | 2022-12-13 |
Family
ID=75000176
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011478363.8A Active CN112529707B (en) | 2020-12-15 | 2020-12-15 | Transaction uplink error prevention method and device based on instance election consensus and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112529707B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106682907A (en) * | 2016-12-10 | 2017-05-17 | 江苏恒为信息科技有限公司 | Comparison and consensus method for block chain data |
CN106878071A (en) * | 2017-01-25 | 2017-06-20 | 上海钜真金融信息服务有限公司 | A kind of block chain common recognition mechanism based on Raft algorithms |
CN109104286A (en) * | 2018-07-26 | 2018-12-28 | 杭州安恒信息技术股份有限公司 | A kind of new block generation method of the common recognition based on threshold digital signature |
CN111489159A (en) * | 2020-04-09 | 2020-08-04 | 腾讯科技(深圳)有限公司 | Data processing method, data processing device, computer equipment and medium |
CN111600720A (en) * | 2020-05-20 | 2020-08-28 | 腾讯科技(深圳)有限公司 | Data processing method, device and equipment based on block chain and readable storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7047760B2 (en) * | 2016-07-29 | 2022-04-05 | 日本電気株式会社 | Systems, data management methods and programs |
US11005664B2 (en) * | 2018-04-16 | 2021-05-11 | R3 Ltd. | Blockchain post-quantum signature scheme |
-
2020
- 2020-12-15 CN CN202011478363.8A patent/CN112529707B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106682907A (en) * | 2016-12-10 | 2017-05-17 | 江苏恒为信息科技有限公司 | Comparison and consensus method for block chain data |
CN106878071A (en) * | 2017-01-25 | 2017-06-20 | 上海钜真金融信息服务有限公司 | A kind of block chain common recognition mechanism based on Raft algorithms |
CN109104286A (en) * | 2018-07-26 | 2018-12-28 | 杭州安恒信息技术股份有限公司 | A kind of new block generation method of the common recognition based on threshold digital signature |
CN111489159A (en) * | 2020-04-09 | 2020-08-04 | 腾讯科技(深圳)有限公司 | Data processing method, data processing device, computer equipment and medium |
CN111600720A (en) * | 2020-05-20 | 2020-08-28 | 腾讯科技(深圳)有限公司 | Data processing method, device and equipment based on block chain and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112529707A (en) | 2021-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108833081B (en) | Block chain-based equipment networking authentication method | |
KR102687781B1 (en) | System and method for authenticating off-chain data based on proof verification | |
CN110546604B (en) | Protecting blockchain transactions based on uncertain data | |
CN111464518B (en) | Method and device for sending and verifying cross-link communication data | |
CN108111314B (en) | Method and equipment for generating and verifying digital certificate | |
CN110633963B (en) | Electronic bill processing method, electronic bill processing device, computer readable storage medium and computer readable storage device | |
JP2021502746A (en) | A system to protect the verification key from modification and to verify the validity of the legitimacy proof | |
CN110569251A (en) | Data processing method, related equipment and computer readable storage medium | |
CN111080295A (en) | Block chain-based electronic contract processing method and equipment | |
CN111327564B (en) | Access method and device for alliance chain | |
US20120324229A1 (en) | System and method for generating keyless digital multi-signatures | |
CN113328997B (en) | Alliance chain crossing system and method | |
CN110941859A (en) | Method, apparatus, computer-readable storage medium, and computer program product for block chain formation consensus | |
CN110084600B (en) | Processing and verifying method, device, equipment and medium for resolution transaction request | |
CN111314172A (en) | Data processing method, device and equipment based on block chain and storage medium | |
CN113256297B (en) | Data processing method, device and equipment based on block chain and readable storage medium | |
CN110400217B (en) | Rule change processing method and device for intelligent contract | |
CN112069550A (en) | Electronic contract deposit certificate system based on intelligent contract mode | |
CN114362961A (en) | Block chain based account recovery method, device, equipment and storage medium | |
CN110502889A (en) | Login method, device, computer readable storage medium and computer equipment | |
CN115701078A (en) | Cross-chain transaction processing method and device, electronic equipment and storage medium | |
CN101807237B (en) | Signature method and device | |
CN117916735A (en) | Security element, method for registering a token and token reference register | |
CN108022104B (en) | Login method, terminal and system for digital currency wallet | |
CN112529707B (en) | Transaction uplink error prevention method and device based on instance election consensus and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |