Disclosure of Invention
The application provides a method and a device for updating a certificate index of a security type general certificate, which can update the index information of the certificate in real time and ensure the accuracy of the index information.
In a first aspect, an embodiment of the present application provides a method for updating a document index of a security type general certificate, including:
after the trading information corresponding to the security type evidence is written into the block chain main chain, the accounting node configures a mark to be processed for the trading information;
the accounting node broadcasts the network address of the transaction information and the to-be-processed identification to each node on the block chain;
after each node on the block chain confirms the network address of the transaction information and the identifier to be processed according to the index entry set, the accounting node sends an index updating request message to an index updating node;
after receiving the index updating request message, the index updating node creates index information for the voucher and adds the index information into the index entry set;
and the index updating node encrypts the updated index entry set and writes the encrypted index entry set into the block.
In one example, any node in the block chain receives a request message sent by a node outside the block chain, where the request message is application information of an index update node that becomes the block chain;
the node receiving the request message sent by the external node broadcasts the request message to each node of the block chain;
when each node of the block chain agrees on the request message, the external node becomes an index update node of the block chain.
In one example, each node in the blockchain determines that one node on the blockchain is the index update node according to a preset consensus mechanism.
In one example, the index update node creates index information for the credential;
the index updating node generates the index information mirror image and stores the index information mirror image in a local storage device;
the index updating node encrypts the index information through a preset encryption algorithm to obtain a first ciphertext;
the index update node adds the first ciphertext to the set of entry indexes.
In one example, query information is received from a user;
the index updating node determines to-be-verified index information corresponding to the query information according to the index information in the local storage device;
the index updating node encrypts the index information to be verified through the encryption method to obtain a second ciphertext;
the index update node reads the set of index entries from the block chain;
the index updating node determines whether the first ciphertext and the second ciphertext are matched in the index entry set; if so, the index updating node returns the index information to be verified.
In one example, the index information includes: one or more of speech, text and images.
In a second aspect, an embodiment of the present application provides a document index updating apparatus for security-type general certificates, including: the system comprises a configuration module, a broadcasting module, a sending module and an index updating module;
the configuration module is used for configuring a mark to be processed for the trading information through an accounting node after the trading information corresponding to the security type evidence is written into the block chain main chain;
the broadcast module is used for broadcasting the network address of the transaction information and the to-be-processed identification to each node on the block chain through the accounting node;
the sending module is used for sending an index updating request message to an index updating node through the accounting node after each node on the block chain confirms the network address of the transaction information and the identifier to be processed according to the index entry set;
the index updating module is used for creating index information for the certificate of the transaction through the index updating node after receiving the index updating request message through the index updating node, and adding the created index information into the index entry set; and encrypting the updated index entry set through the index updating node, and writing the encrypted index entry set into a block.
In one example, the apparatus further comprises: a receiving module and a determining module;
the receiving module is used for receiving a request message sent by an external node of the block chain through any node in the block chain, wherein the request message is application information of an index updating node which becomes the block chain;
the broadcast module is further configured to broadcast a request message to each node of the block chain through a node that receives the request message sent by the external node;
the determining module is configured to determine that the external node becomes an index update node of the block chain when each node of the block chain agrees with the request message.
In one example, the index updating module is further configured to generate the index information mirror through the index updating node and store the index information mirror in a local storage device; encrypting the index information through a preset encryption algorithm by the index updating node to obtain a first ciphertext; adding the first ciphertext into the entry index set via the index update node.
In one example, the index update module is further configured to create index information for the credential through the index update node; receiving query information from a user; determining index information to be verified corresponding to the query information according to the index updating node in the local storage device; encrypting the index information to be verified through the index updating node by the encryption method to obtain a second ciphertext; reading, by the index update node, the set of index entries from the blockchain; determining whether the first ciphertext and the second ciphertext are matched in the index entry set through the index updating node; if so, the index updating node returns the index information to be verified.
The embodiment of the application provides a method and a device for updating an index of a security type general certificate, wherein index information of the certificate is updated by setting an index updating node, and whether the index needs to be established on the certificate is verified by utilizing the fairness and the non-falsification of a block chain, so that repeated establishment of the index or establishment of wrong index information is avoided. In addition, the index updating node writes the index entry set into the block after encrypting the index entry set so as to prevent the index entry from being tampered. Meanwhile, in order to prevent the index information from being leaked and tampered, the mirror image of the index information stored in the local equipment by the index updating node is verified in a ciphertext verification mode. Therefore, the technical scheme provided by the embodiment of the application can update the index information of the certificate in time and ensure the accuracy of the index information.
Detailed description of the preferred embodiments
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
The embodiment of the application provides a voucher index storage method for asset class evidence, as shown in fig. 1, comprising the following steps:
step 101, after the trading information corresponding to the security type evidence is written into the block chain main chain, the accounting node configures a mark to be processed for the trading information.
In the blockchain technique, only the information on the main chain is considered to be correct, so the transaction information written into the main chain is a valid transaction, and the corresponding certificate is necessarily true. Only if the certificate is guaranteed to be authentic, the index information of the certificate can be inquired by people. Therefore, the certificate is true and reliable, and is a precondition for implementing the embodiment of the application.
In the embodiment of the application, the accounting node is a node for writing the transaction into the block in the block chain, there are two methods for determining the accounting node, namely, a trusted node selected by each node in the block chain, or a node in the block chain acquiring the accounting right according to a preset consensus mechanism, and the node acquiring the accounting right is the accounting node.
Step 102, the accounting node broadcasts the network address and the pending identification of the transaction information to each node in the blockchain.
And 103, after each node on the block chain confirms the network address and the to-be-processed identification of the transaction information according to the index entry set, the accounting node sends an index updating request message to the index updating node.
In this embodiment of the application, each node of the block chain may identify the network address and the to-be-processed identifier of the transaction information according to the created index entry set, so as to confirm the validity of the transaction information and whether the index information corresponding to the certificate of the transaction information already exists in the index entry set. For example, each node verifies whether the pending identifier conforms to a predetermined specific format, thereby determining whether the identifier is valid, and further determining whether the transaction has been written into the blockchain main chain. Each node verifies whether the network address corresponding to the certificate of the transaction information already exists in the index entry set so as to prevent repeated establishment of the index information. Wherein, the index entry set comprises a plurality of index information, and the index information comprises: the network address corresponding to the credential and the identifier corresponding to the credential.
It should be noted that the index update node may be an external node of the blockchain or an internal node of the blockchain. The specific method for the external node to apply for the index update node becoming the block chain is as follows:
and any node in the block chain receives a request message sent by a node outside the block chain, wherein the request message becomes application information of an index updating node of the block chain, and the request message comprises identity information of the outside node and one or more of working experience and enterprise qualification for creating the index information.
The node receiving the request message sent by the external node broadcasts the request message to each node of the blockchain. When each node of the blockchain agrees on the request message, the external node becomes an index update node of the blockchain.
The index updating node is an external node of the block chain and has the following beneficial effects:
1. the external nodes can provide special resources and services for inquiring, recording, storing and updating the index information, thereby improving the maintenance quality of the index information. The query, record, storage and update of the index information consumes a large amount of calculation resources, and most of the calculation resources of the internal nodes of the blockchain are needed for business operation, so that the internal nodes need to have sufficiently strong calculation resources if becoming the index update nodes. If the external node becomes an index updating node, the computing resources of the node can be specially used for inquiring, recording, storing and updating the index information, so that the maintenance quality of the index information is improved.
2. The certificates corresponding to the general certificates are various in types, and the storage space of the block can be occupied. And storing part of data of the index information to an external node, so that the storage space of each block in the block chain is saved, and the efficiency of recording transaction information by the block chain is improved.
Since the external node is not in the consensus system of the blockchain, the index information stored in the local device by the external node may be tampered. Meanwhile, when querying information, the external node needs to read information from the blockchain, which may cause index information leakage. Therefore, in the embodiment of the application, the index updating node generates the index information mirror image and stores the index information mirror image in the local storage device, that is, the index updating node only stores the backup information of the index information, and the most initial index information is stored in the block, thereby laying a foundation for verifying whether the index information stored by the index updating node is tampered later. Meanwhile, the index updating node encrypts the index information through a preset encryption algorithm to obtain a first ciphertext, and the security of the index information is further improved.
After the index updating node receives the query information from the user, the index updating node firstly determines the to-be-verified index information corresponding to the query information according to the query information in the local storage device. And then, the index updating node encrypts the index information to be verified through an encryption method to obtain a second ciphertext. And finally, the index updating node reads the index entry set from the block chain, determines whether the first ciphertext and the second ciphertext are matched in the index entry set, and returns the index information to be verified if the first ciphertext and the second ciphertext are matched. Because the index updating node encrypts the index information through the preset encryption algorithm, even if the index information is intercepted by a person in the process of acquiring the index information from the block chain by the index updating node, the opposite side can only see the ciphertext of the index information, and therefore the index information cannot be leaked. In order to implement the above ciphertext verification method, the index information and the index information to be verified may be encrypted by using a hash function.
In the embodiment of the present application, a method for an internal node of a block chain to become an index update node includes:
and according to a preset consensus mechanism, each node in the block chain determines one node on the block chain as an index updating node. For example, each node in the block chain determines the most computationally intensive node as an index update node according to a consensus mechanism proved by workload. Because the updating and the query of the index need a large amount of calculation force for supporting, the node with the strongest calculation force is selected as the index updating node. For the nodes in the block chain, the identity information and the address of each node are determined, so that the node is convenient to supervise so as to ensure the safety of the index information created by the node.
And step 104, after receiving the index updating request message, the index updating node creates index information for the voucher and adds the index information into the index entry set.
And 105, encrypting the updated index entry set by the index updating node, and writing the encrypted index entry set into the block.
In the embodiment of the application, in order to prevent someone from tampering the index information, the index information is encrypted and written into the block. In order to facilitate user query, the index information includes: one or more of speech, text and images, thereby providing a multi-dimensional query hierarchy for the user.
As shown in fig. 2, an embodiment of the present application provides a credential index storage device for asset certificates, including: aconfiguration module 201, abroadcast module 202, atransmission module 203, anindex update module 204, areception module 205, and adetermination module 206.
Theconfiguration module 201 is configured to configure a to-be-processed identifier for the transaction information through the accounting node after the transaction information corresponding to the security type certificate authority is written into the block chain main chain.
Thebroadcasting module 202 is configured to broadcast the network address and the pending identification of the transaction information to each node in the blockchain via the accounting node.
The sendingmodule 203 is configured to send an index update request message to the index update node through the accounting node after each node on the blockchain confirms the network address and the to-be-processed identifier of the transaction information according to the index entry set.
Theindex updating module 204 is configured to create index information for the certificate of the transaction after receiving the index updating request message through the index updating node, and add the created index information into the index entry set; and encrypting the updated index entry set through the index updating node, and writing the encrypted index entry set into the block.
In this embodiment of the application, the receivingmodule 205 is further configured to receive, by any node in the blockchain, a request message sent by a node outside the blockchain, where the request message is application information of an index update node that becomes the blockchain.
Thebroadcasting module 202 is further configured to broadcast the request message to each node of the blockchain through a node that receives the request message sent by the external node.
The determiningmodule 206 is configured to determine that the external node becomes an index update node of the block chain when each node of the block chain agrees with the request message.
In this embodiment of the present application, theindex updating module 204 is further configured to create index information for the credential through an index updating node; generating an index information mirror image through an index updating node and storing the index information mirror image in a local storage device; encrypting the index information through the index updating node by using a preset encryption algorithm to obtain a first ciphertext; and adding the first ciphertext into the entry index set through the index updating node.
In this embodiment of the present application, theindex updating module 204 is further configured to receive query information from a user through an index updating node; determining index information to be verified corresponding to the query information according to the index updating node in the local storage device; encrypting the index information to be verified through the index updating node by an encryption method to obtain a second ciphertext; reading an index entry set from a block chain through an index updating node; determining whether the first ciphertext is matched with the second ciphertext through the index updating node in the index entry set; if so, the index updating node returns the index information to be verified.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application. It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.