Disclosure of Invention
In view of this, the present invention provides a document identification method, apparatus and system, which ensure the accuracy of the document identification result based on the consensus mechanism of the block chain.
In order to achieve the above purpose, the invention provides the following specific technical scheme:
a document identification method for use in a work node in a blockchain in a document identification system, the blockchain including a document institution node and a plurality of the work nodes, the method comprising:
acquiring documents to be identified issued by the document mechanism nodes;
obtaining a local reference identification result of the document to be identified;
receiving reference identification results of the documents to be identified broadcast by other working nodes in the block chain;
and performing consensus on the local reference identification result and the reference identification results of the documents to be identified broadcast by other working nodes to obtain a consensus result, wherein the consensus result is used for determining a target identification result corresponding to the documents to be identified.
Optionally, the acquiring the document to be identified issued by the document organization node includes:
and acquiring the document to be identified according to the hash value of the current highest block and the mapping relation between the hash value of the current highest block and the document to be identified, wherein the mapping relation between the hash value of the current highest block and the document to be identified is stored in the created block in advance in the form of an intelligent contract.
Optionally, after obtaining the local reference recognition result of the document to be recognized, the method further includes:
generating a block including the local reference recognition result;
broadcasting the block to the whole network in a transaction form.
Optionally, the generating a block including the local reference recognition result includes:
and packaging all currently received transaction information and the local reference identification result to generate the block, wherein all currently received transaction information comprises the document to be identified issued by the document mechanism node in a transaction form.
Optionally, the generating a block including the local reference recognition result includes:
calculating the workload certification target number by adopting a workload certification mechanism;
and packaging the workload certification index number, all currently received transaction information and the local reference identification result to generate the block, wherein all currently received transaction information comprises the document to be identified issued by the document institution node in a transaction form.
Optionally, after receiving the reference identification result of the document to be identified broadcast by the other working nodes in the block chain, the method further includes:
verifying the received blocks which are broadcasted by other working nodes and comprise the reference identification result of the document to be identified;
and generating a block corresponding to the received block when the received block is verified.
Optionally, the consensus between the local reference identification result and the reference identification result of the document to be identified broadcast by the other working nodes includes:
counting the local reference identification result and the reference identification results of the documents to be identified broadcast by other working nodes;
and determining the reference identification result with the highest total number and the total number larger than a preset value in the statistical results as the target identification result, wherein the preset value is not larger than the total number of the working nodes in the block.
Optionally, after obtaining the consensus result, the method further includes:
and receiving identification feedback information sent by the document institution node under the condition that the local reference identification result is the target identification result in the consensus result.
A document identification apparatus for use in a work node in a blockchain in a document identification system, the blockchain including a document institution node and a plurality of the work nodes, the apparatus comprising:
the document to be identified acquiring unit is used for acquiring documents to be identified issued by the document mechanism node;
a local reference identification result obtaining unit, configured to obtain a local reference identification result of the document to be identified;
a reference identification result receiving unit, configured to receive a reference identification result of the document to be identified, where the reference identification result is broadcast by other working nodes in the block chain;
and the identification result consensus unit is used for performing consensus on the local reference identification result and the reference identification result of the document to be identified broadcast by the other working nodes to obtain a consensus result, and the consensus result is used for determining a target identification result corresponding to the document to be identified.
Optionally, the local reference identification result obtaining unit is specifically configured to obtain the document to be identified according to the hash value of the current highest block and a mapping relationship between the hash value of the current highest block and the document to be identified, where the mapping relationship between the hash value of the current highest block and the document to be identified is stored in the created block in advance in an intelligent contract.
Optionally, the apparatus further comprises:
the first block generating unit is used for generating a block comprising a local reference identification result after obtaining the local reference identification result of the document to be identified; broadcasting the block to the whole network in a transaction form.
Optionally, the first block generating unit is specifically configured to package all currently received transaction information and the local reference identification result, and generate the block, where all currently received transaction information includes the document to be identified, which is issued by the document institution node in a transaction form.
Optionally, the first block generating unit is specifically configured to:
calculating the workload certification target number by adopting a workload certification mechanism;
and packaging the workload certification index number, all currently received transaction information and the local reference identification result to generate the block, wherein all currently received transaction information comprises the document to be identified issued by the document institution node in a transaction form.
Optionally, the apparatus further comprises:
the second block generating unit is used for verifying the received blocks which are broadcasted by other working nodes and comprise the reference identification results of the documents to be identified after receiving the reference identification results of the documents to be identified broadcasted by other working nodes in the block chain; and generating a block corresponding to the received block when the received block is verified.
Optionally, the identification result consensus unit is specifically configured to:
counting the local reference identification result and the reference identification results of the documents to be identified broadcast by other working nodes;
and determining the reference identification result with the highest total number and the total number larger than a preset value in the statistical results as the target identification result, wherein the preset value is not larger than the total number of the working nodes in the block.
Optionally, the apparatus further comprises:
a feedback information receiving unit, configured to receive, after obtaining a consensus result, identification feedback information sent by the literature institution node if the local reference identification result is the target identification result in the consensus result.
A document identification system comprising a blockchain comprising a document authority node and a plurality of worker nodes;
the document institution node is used for broadcasting documents to be identified to the whole network in a transaction form;
the work node is configured to perform a document identification method as described in any one of the above.
Optionally, the document mechanism node is further configured to store the document to be identified in a candidate pool when the target identification result of the document to be identified is not obtained in the current round.
Compared with the prior art, the invention has the following beneficial effects:
the invention discloses a document identification method, wherein a document mechanism node issues a document to be identified through a block chain, a working node determines a target identification result of the document to be identified through consensus on the basis of obtaining a local reference identification result of the document to be identified and receiving reference identification results of difficult documents to be identified broadcast by other working nodes in the block chain, and due to the fact that a large number of working nodes exist in the block chain, the consensus mechanism of the block chain ensures that the accuracy and reliability of the target identification result determined through the consensus of the large number of working nodes are high, and meanwhile, due to the good disaster tolerance and the non-tamper property of the block chain, document information obtained after identification can be stably and safely stored on the block chain.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The inventor has found that in the conventional block chain, the consumed computing power is only used for maintaining the safety and the non-tamper property of the block chain, the computing power is not effectively utilized, and the computing power and the common recognition mechanism of the block chain can be applied to literature identification. The reward mechanism of the block chain ensures that each working node tends to accurately identify documents in order to obtain reward, the block chain is a distributed account book, the number of network nodes is large, monopoly of the nodes can be prevented, the target identification result of the documents is ensured to be commonly identified by a large number of working nodes, and therefore the accuracy and the reliability of the document identification result are ensured.
Based on the above inventive concept, the present embodiment discloses a document identification method, which is applied to a work node in a block chain in a document identification system, where the document identification system includes a document mechanism node and a plurality of work nodes, and please refer to fig. 1, where the identification method specifically includes the following steps:
s101: acquiring documents to be identified issued by document mechanism nodes;
the document mechanism node broadcasts the document to be identified to the whole network in a transaction mode, and the document to be identified can be pixel information of the document to be identified.
The working node can obtain the document to be identified by receiving the transaction information of the document to be identified, and can also obtain the document to be identified according to the hash value of the current highest block and the mapping relation between the hash value of the current highest block and the document to be identified. And the mapping relation between the hash value of the current highest block and the document to be identified is stored in the created block in advance in the form of an intelligent contract.
In an initial state, only a created block is in a block chain, and the intelligent contract is predefined in the created block and represents a mapping relationship between a hash value of a current highest block and pixel information of a document to be identified:
f(x)=y
wherein x represents the hash value of the current highest block, y represents the pixel information of the document to be identified, and one document y to be identified can be uniquely positioned through x.
S102: obtaining a local reference identification result of the document to be identified;
the local reference recognition result can be a manual recognition result or an algorithm recognition result, and in order to ensure the accuracy of the recognition result, a user corresponding to the working node selects to manually recognize the document to be recognized or adopts an algorithm with higher recognition accuracy to recognize the document to be recognized.
After obtaining the identification result of the document to be identified, the identification result may be stored in a storage path preset by the working node, and the working node obtains the local reference identification result of the document to be identified by reading data in the storage path.
S103: receiving reference identification results of the documents to be identified, which are broadcast by other working nodes in the block chain;
it should be noted that after all working nodes in the block chain acquire the document to be identified, all the working nodes strive to obtain the reference identification result of the document to be identified, and broadcast the obtained reference identification result of the document to be identified to other working nodes.
S104: and performing consensus on the local reference identification result and the reference identification results of the documents to be identified broadcast by other working nodes to obtain a consensus result, wherein the consensus result is used for determining a target identification result corresponding to the documents to be identified.
Each working node in the block chain broadcasts the local reference identification result to other working nodes and receives the reference identification results of the documents to be identified, which are broadcast by other working nodes, so that each working node in the block chain can obtain the reference identification results of all the working nodes in the block chain on the documents to be identified.
Therefore, the consensus result can be obtained by performing consensus on the reference identification results of the documents to be identified by all the working nodes in the obtained block chain. If the local reference identification result and the reference identification results of the documents to be identified broadcast by other working nodes are counted, the reference identification result with the highest total number and the total number larger than a preset value in the counting results is determined as the target identification result, wherein the preset value is not larger than the total number of the working nodes in the block, such as 50% of the total number of the working nodes in the block chain.
Due to the fact that a large number of working nodes exist in the block chain, the consensus mechanism of the block chain guarantees that the accuracy and the reliability of the target identification result of the document determined through the consensus of the large number of working nodes are high, especially for difficult documents, the identification difficulty and the identification accuracy rate of the difficult documents are high compared with those of common documents, and the document identification method in the embodiment has the advantages that the effect is obvious when the document identification method is applied to the difficult documents, and the identification accuracy rate of the difficult documents can be greatly improved.
Meanwhile, due to the good disaster tolerance and the non-tamper property of the block chain, the document information obtained after recognition can be stably and safely stored on the block chain.
Preferably, after obtaining the consensus result, in the case that the local reference recognition result is the target recognition result in the consensus result, the identification feedback information sent by the document institution node is received.
The feedback information comprises identification rewards, and the identification rewards are issued to the working nodes obtaining the target identification result to drive the working nodes in the block chain to carefully identify the documents to be identified for the following reasons:
if the working node A is identified in the literature, in order to obtain the identification reward for the working node A, the identification result of the working node A is ensured to be similar to the identification results of other nodes. In the case of a given document to be identified, the way in which all the node identification results are similar is to try to give a result similar to the document to be identified. Because the result of all the nodes reaches the condition that the document to be identified is converged, the probability that the identification results of all the working nodes are similar is achieved, which is far higher than the probability that the identification results of all the working nodes are similar under the condition that the identification results of all the working nodes are contrary to the direction of the document to be identified, and the probability that the identification results of the grand kingdom are similar is achieved. In summary, the optimal strategy is to carefully identify the documents for all working nodes. If the reward is taken without being recognized seriously (such as random generation), more than 51 percent of the total network is required to be controlled, so that the chance of being recognized as the target recognition result is obtained in a large rate, and the practice is usually not paid in the case of a large number of working nodes of the blockchain network, thereby avoiding the cheating phenomenon. Thus, the recognition reward mechanism drives all working nodes in the blockchain to recognize documents carefully in order to receive recognition rewards.
Further, in order to realize traceability of a document identification result, after obtaining a local reference identification result of a document to be identified, a working node stores the identification result in a block chain, and there are two situations when the working node generates the block chain: specifically, the working node may calculate the workload certification target number by using a workload certification mechanism, and package the workload certification target number, all currently received transaction information, and the local reference identification result to generate the block, where all currently received transaction information includes documents to be identified, which are issued by the document institution node in a transaction form. In another case, when an unproductive block such as the workload verification index number is not calculated, the work node verifies a block including a reference recognition result of the document to be recognized broadcast by another work node, and when the received block passes verification, generates a block corresponding to the received block.
To further explain the operation mechanism of the above-mentioned document identification method in the block chain, a detailed description is given below by way of a specific example.
In an initial state, only a created block exists in a block chain, an intelligent contract is predefined in the created block, and the intelligent contract represents the mapping relation between the hash value of the current highest block and the pixel information of the document to be identified:
f(x)=y
wherein x represents the hash value of the current highest block, y represents the pixel information of the document to be identified, and one document y to be identified can be uniquely positioned through x.
After that, the document institution node broadcasts the pixel information of the document 1 to the whole network in a transaction form, and after the working node a obtains the identification result of the document 1, the block 2 including the pixel information of the document 1 and the identification result of the working node a to the document 1 as shown in fig. 2 is generated and broadcasted to the whole network, wherein the arrow in fig. 2 indicates the generation order of the blocks in the block chain.
Before the working nodes in the blockchain carry out consensus on the identification result of the document 1, each working node receives the identification result of the document 1 broadcasted by other working nodes in a transaction form, after the target identification result is obtained through consensus, the document organization node broadcasts the pixel information of the document 2 to the whole network in a transaction form, after the working node B obtains the identification result of the document 2, a block 3 which comprises all currently received transaction information and the identification result of the working node B to the document 2 is generated, as shown in fig. 3, wherein all currently received transaction information comprises the identification results of the nodes 1-n to the document 1 and the pixel information of the document 2, the block is broadcasted to the whole network, and arrows in fig. 3 represent the generation sequence of the blocks in the blockchain.
Before the working nodes in the blockchain carry out consensus on the identification result of the document 2, each working node receives the identification result of the document 2 broadcasted by other working nodes in a transaction form, after the target identification result is obtained through consensus, the document institution node broadcasts the pixel information of the document 3 to the whole network in a transaction form, after the working node C obtains the identification result of the document 3, a block 4 which comprises all currently received transaction information and the identification result of the working node C to the document 3 is generated, as shown in fig. 4, wherein all currently received transaction information comprises the identification results of the nodes 1-n to the document 2 and the pixel information of the document 3, and the block is broadcasted to the whole network, and arrows in fig. 4 represent the generation sequence of the blocks in the blockchain.
Through the block chain operation mechanism, the block chain can be operated all the time, and the identification of the literature is continuously realized.
Based on the document identification method disclosed in the above embodiment, this embodiment correspondingly discloses a document identification apparatus, which is applied to a work node in a blockchain in a document identification system, where the blockchain includes a document mechanism node and a plurality of work nodes, and please refer to fig. 5, the apparatus includes:
a document to be identified acquiring unit 501, configured to acquire a document to be identified issued by the document organization node;
a local reference recognition result obtaining unit 502, configured to obtain a local reference recognition result of the document to be recognized;
a reference identification result receiving unit 503, configured to receive a reference identification result of the document to be identified, where the reference identification result is broadcast by other working nodes in the block chain;
an identification result consensus unit 504, configured to perform consensus on the local reference identification result and the reference identification result of the document to be identified broadcast by the other working nodes to obtain a consensus result, where the consensus result is used to determine a target identification result corresponding to the document to be identified.
Optionally, the local reference identification result obtaining unit is specifically configured to obtain the document to be identified according to the hash value of the current highest block and a mapping relationship between the hash value of the current highest block and the document to be identified, where the mapping relationship between the hash value of the current highest block and the document to be identified is stored in the created block in advance in an intelligent contract.
Optionally, the apparatus further comprises:
the first block generating unit is used for generating a block comprising a local reference identification result after obtaining the local reference identification result of the document to be identified; broadcasting the block to the whole network in a transaction form.
Optionally, the first block generating unit is specifically configured to package all currently received transaction information and the local reference identification result, and generate the block, where all currently received transaction information includes the document to be identified, which is issued by the document institution node in a transaction form.
Optionally, the first block generating unit is specifically configured to:
calculating the workload certification target number by adopting a workload certification mechanism;
and packaging the workload certification index number, all currently received transaction information and the local reference identification result to generate the block, wherein all currently received transaction information comprises the document to be identified issued by the document institution node in a transaction form.
Optionally, the apparatus further comprises:
the second block generating unit is used for verifying the received blocks which are broadcasted by other working nodes and comprise the reference identification results of the documents to be identified after receiving the reference identification results of the documents to be identified broadcasted by other working nodes in the block chain; and generating a block corresponding to the received block when the received block is verified.
Optionally, the identification result consensus unit is specifically configured to:
counting the local reference identification result and the reference identification results of the documents to be identified broadcast by other working nodes;
and determining the reference identification result with the highest total number and the total number larger than a preset value in the statistical results as the target identification result, wherein the preset value is not larger than the total number of the working nodes in the block.
Optionally, the apparatus further comprises:
a feedback information receiving unit, configured to receive, after obtaining a consensus result, identification feedback information sent by the literature institution node if the local reference identification result is the target identification result in the consensus result.
Based on the literature identification method disclosed in the above embodiment, the present embodiment discloses a literature identification system, which includes a block chain, where the block chain includes a literature mechanism node and a plurality of working nodes;
the working node is used for executing the following document identification method:
acquiring documents to be identified issued by the document mechanism nodes;
obtaining a local reference identification result of the document to be identified;
receiving reference identification results of the documents to be identified broadcast by other working nodes in the block chain;
and performing consensus on the local reference identification result and the reference identification results of the documents to be identified broadcast by other working nodes to obtain a consensus result, wherein the consensus result is used for determining a target identification result corresponding to the documents to be identified.
Further, the acquiring the document to be identified issued by the document institution node includes:
and acquiring the document to be identified according to the hash value of the current highest block and the mapping relation between the hash value of the current highest block and the document to be identified, wherein the mapping relation between the hash value of the current highest block and the document to be identified is stored in the created block in advance in the form of an intelligent contract.
Further, after the obtaining of the local reference identification result of the document to be identified, the method further includes:
generating a block including the local reference recognition result;
broadcasting the block to the whole network in a transaction form.
Further, the generating a block including the local reference recognition result includes:
and packaging all currently received transaction information and the local reference identification result to generate the block, wherein all currently received transaction information comprises the document to be identified issued by the document mechanism node in a transaction form.
Further, the generating a block including the local reference recognition result includes:
calculating the workload certification target number by adopting a workload certification mechanism;
and packaging the workload certification index number, all currently received transaction information and the local reference identification result to generate the block, wherein all currently received transaction information comprises the document to be identified issued by the document institution node in a transaction form.
Further, after receiving the reference identification result of the document to be identified broadcast by other working nodes in the block chain, the method further includes:
verifying the received blocks which are broadcasted by other working nodes and comprise the reference identification result of the document to be identified;
and generating a block corresponding to the received block when the received block is verified.
Further, the consensus between the local reference identification result and the reference identification result of the document to be identified broadcast by the other working nodes includes:
counting the local reference identification result and the reference identification results of the documents to be identified broadcast by other working nodes;
and determining the reference identification result with the highest total number and the total number larger than a preset value in the statistical results as the target identification result, wherein the preset value is not larger than the total number of the working nodes in the block.
Further, after the obtaining of the consensus result, the method further comprises:
and receiving identification feedback information sent by the document institution node under the condition that the local reference identification result is the target identification result in the consensus result.
The document institution node is used for broadcasting documents to be identified to the whole network in a transaction form;
optionally, the document mechanism node is further configured to store the document to be identified in a candidate pool when the target identification result of the document to be identified is not obtained in the current round.
It should be noted that, the literature institution node selects the literature to be identified from the candidate pool and broadcasts the selected literature to the whole network in a transaction form, and if a certain literature does not obtain the target identification result in multiple rounds of identification, the literature can be removed from the candidate pool in order to avoid the waste of computing resources in the blockchain, and the literature institution node performs subsequent processing.
In the document identification system disclosed in this embodiment, a document organization node issues a document to be identified through a block chain, a working node determines a target identification result of the document to be identified through consensus on the basis of obtaining a local reference identification result of the document to be identified and receiving reference identification results of documents to be identified broadcast by other working nodes in the block chain, and since a large number of working nodes exist in the block chain, a consensus mechanism of the block chain itself ensures that the accuracy and reliability of the target identification result determined through consensus of a large number of working nodes are high, and meanwhile, due to good disaster tolerance and tamper resistance of the block chain itself, document information obtained after identification can be stably and safely stored on the block chain.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.