CN114090588A - Block chain presence verification method and device, computer equipment and storage medium - Google Patents

Block chain presence verification method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114090588A
CN114090588A CN202111471340.9A CN202111471340A CN114090588A CN 114090588 A CN114090588 A CN 114090588A CN 202111471340 A CN202111471340 A CN 202111471340A CN 114090588 A CN114090588 A CN 114090588A
Authority
CN
China
Prior art keywords
block
hash value
certificate
verification
photo
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.)
Pending
Application number
CN202111471340.9A
Other languages
Chinese (zh)
Inventor
郭凯
吴军勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Mingzhu Technology Co ltd
Original Assignee
Shenzhen Mingzhu Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Mingzhu Technology Co ltd filed Critical Shenzhen Mingzhu Technology Co ltd
Priority to CN202111471340.9A priority Critical patent/CN114090588A/en
Publication of CN114090588A publication Critical patent/CN114090588A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2477Temporal data queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures

Abstract

The application relates to a block chain presence verification method, a block chain presence verification device, computer equipment and a storage medium. The method comprises the following steps: receiving a storage and verification request sent by a terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a photo to be verified; searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value; if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal; and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result. According to the method and the device, through the verification time range and the first certificate storing block Hash value recorded on the photo to be verified, the first certificate storing block corresponding to the first certificate storing block Hash value is found out at first, then the second certificate storing block corresponding to the photo Hash value is found out, the corresponding certificate storing and verifying result is obtained, and the accuracy of field certificate verification can be effectively verified.

Description

Block chain presence verification method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a blockchain presence verification method and apparatus, a computer device, and a storage medium.
Background
With the development of information technology and the popularization of computer networks, electronic evidences, which are derivatives of a large number of electronic commerce and trade activities and network communication activities, have played an increasingly important role in the aspects of copyright protection, business maintenance, virtual property, mobile office and the like and the management of related departments. The electronic evidence is mainly characterized by being attached to a digital medium, and having the advantages of rapid collection, convenient transmission, small storage space and repeated reproduction, so that the electronic evidence can play an important role in future maintenance and law enforcement work and can be used as evidence to prove relevant facts.
The Blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The block chain is a chain data structure formed by combining data blocks in a sequential connection mode according to a time sequence, and is a distributed account book which is guaranteed in a cryptographic mode and cannot be tampered and forged. Because the blockchain has the characteristics of decentralization, information non-tampering, autonomy and the like, the blockchain is also paid more and more attention and is applied by people.
Currently, the presence certificate is transmitted to a centralized server for storage, which results in low security of the stored presence certificate, and therefore, it is necessary to provide a method for effectively verifying whether the presence certificate is accurate.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a blockchain presence verification method, apparatus, computer device, computer-readable storage medium, and computer program product capable of effectively verifying whether presence credentials are accurate.
In a first aspect, the present application provides a blockchain presence verification method. The method comprises the following steps:
receiving a storage and verification request sent by a terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a photo to be verified;
searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value;
if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal;
and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result.
In one embodiment, the manner of storing the photo hash value in the second evidence storing block includes:
receiving a certificate storing request sent by a terminal;
according to the certificate storing request, a first certificate storing block and a corresponding first certificate storing block hash value are obtained, and the first certificate storing block hash value is returned to the terminal;
receiving a certificate storing photo hash value corresponding to the certificate storing photo sent by the terminal, wherein the certificate storing photo is an electronic photo obtained by photographing a carrier which records the first certificate storing block hash value and holds by a certificate storing person;
and storing the hash value of the certificate storing photo in a second certificate storing block, wherein the second certificate storing block is a block capable of storing data when a block chain is used for receiving the hash value of the certificate storing photo sent by the terminal.
In one embodiment, the manner of storing the photo hash value in the second evidence storing block further includes:
sending a first block outlet time corresponding to the first evidence storage block and a second block outlet time corresponding to the second evidence storage block to a terminal; the verification time range comprises a time range from a first block-out time to a second block-out time.
In one embodiment, the searching for the first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value includes:
calculating the hash value of each corresponding block after the starting time of the verification time range in sequence from the block corresponding to the starting time of the verification time range in the block chain, and comparing the hash value with the first evidence-storing block hash value;
and if the hash value of the calculated block is the same as the hash value of the first evidence storing block, taking the block as the first evidence storing block.
In one embodiment, the searching for the second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result includes:
sequentially searching whether the photo hash value is stored in the block generated after the first certificate storing block from the first certificate storing block;
taking the block corresponding to the photo hash value as a second verification storage block to obtain a result of successful verification storage;
and if the block corresponding to the photo hash value is not found, obtaining a result of failure of verification and verification.
In one embodiment, the method further comprises:
and if the first certificate storage block corresponding to the first certificate storage hash value is not found according to the verification time range and the first certificate storage block hash value, obtaining a result of certificate storage verification failure.
In a second aspect, the present application also provides a device for verifying the presence of a blockchain. The device comprises:
the first receiving module is used for receiving a storage and verification request sent by the terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a to-be-verified photo;
the first searching module is used for searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value;
the second receiving module is used for receiving the photo hash value of the photo to be verified sent by the terminal if the first certificate storing block is found;
and the second searching module is used for searching a second certificate storing block corresponding to the photo hash value according to the first certificate storing block and the photo hash value to obtain a certificate storing and verifying result.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor realizes the following steps when executing the computer program:
receiving a storage and verification request sent by a terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a photo to be verified;
searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value;
if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal;
and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving a storage and verification request sent by a terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a photo to be verified;
searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value;
if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal;
and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
receiving a storage and verification request sent by a terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a photo to be verified;
searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value;
if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal;
and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result.
According to the block chain on-site verification method, the block chain on-site verification device, the computer equipment, the storage medium and the computer program product, the verification storage request sent by the receiving terminal is received, and the verification storage request comprises a verification time range and a first verification storage block hash value recorded on a to-be-verified photo; searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value; if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal; and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result. According to the method and the device, through verifying the time range and the Hash value of the first certificate storage block recorded on the photo to be verified, the first certificate storage block corresponding to the Hash value of the first certificate storage block is firstly found, after the first certificate storage block is found, the second certificate storage block corresponding to the Hash value of the photo is then found, a corresponding certificate storage and verification result is obtained, and through multi-level verification, the accuracy of field certification can be effectively verified.
Drawings
FIG. 1 is a diagram of an application environment of a blockchain presence verification method in one embodiment;
FIG. 2 is a flow diagram illustrating a block chain presence verification method according to one embodiment;
FIG. 3 is a flowchart illustrating an embodiment of a second certificate authority block storing hash values of photos;
FIG. 4 is a flowchart illustrating a process of storing hash values of photos in the second authentication block according to another embodiment;
FIG. 5 is a schematic flow chart of step 204 in one embodiment;
FIG. 6 is a flow diagram illustrating step 208 in one embodiment;
FIG. 7 is a sequence diagram of the interaction of the blockchain presence verification method in one embodiment;
FIG. 8 is a block diagram of the structure of a blockchain presence verification device in one embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The block chain presence verification method provided by the embodiment of the application can be applied to an application environment as shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. The terminal 102 sends a storage verification request to the server 104, and sends a verification time range and a first storage verification block hash value recorded on a to-be-verified photo at the same time, correspondingly, the server 104 receives the storage verification request sent by the terminal 102, the storage verification request comprises the verification time range and the first storage verification block hash value recorded on the to-be-verified photo, the server 104 searches a first storage verification block corresponding to the first storage verification block hash value according to the verification time range and the first storage verification block hash value, if the first storage verification block is found, receives a photo hash value of the to-be-verified photo sent by the terminal 102, and searches a second storage verification block corresponding to the photo hash value according to the first storage verification block and the photo hash value, so as to obtain a storage verification result. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
In one embodiment, as shown in fig. 2, a blockchain presence verification method is provided, which is described by taking the example that the method is applied to the server in fig. 1, and includes the following steps:
step 202, receiving a storage and verification request sent by the terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a to-be-verified photo.
The server receives a storage and verification request sent by the terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a photo to be verified. And after receiving the verification time range, the server searches whether a block or a hash value meeting a preset condition exists in the verification time range. When the verification is carried out, when the server receives a corresponding verification request, the hash value of a block which can store data in a block chain is returned to the terminal, namely, the hash value of a first verification block is returned to the terminal, after a verifier receives the hash value of the first verification block displayed by the terminal, the hash value of the first verification block is displayed on a carrier, the verifier takes a picture of the carrier comprising the hash value of the first verification block by hand, namely, the obtained electronic photo comprises the hash value of the first verification block, therefore, when the verification request is stored, the hash value of the first verification block is recorded on the photo to be verified.
In an optional implementation manner, the terminal receives the photo to be verified, obtains the first certificate-storing block hash value by identifying a character corresponding to the first certificate-storing block hash value recorded in the photo to be verified, and sends the first certificate-storing block hash value to the server, and correspondingly, the server can obtain the first certificate-storing block hash value recorded in the photo to be verified. Or, the terminal directly receives the first authentication block hash value recorded on the to-be-authenticated photo, and then sends the first authentication block hash value to the server, and correspondingly, the server receives the first authentication block hash value recorded on the to-be-authenticated photo.
And step 204, searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value.
And in the verification time range, the server searches a first certificate storage block corresponding to the first certificate storage block hash value according to the first certificate storage block hash value. In a block chain, blocks can be regarded as individual storage units, the blocks record communication information among nodes within a certain time, the blocks are linked through random hashing (namely, a hashing algorithm), the next block contains a hash value of the previous block, and as the communication of the information increases, one block is connected with one block in sequence to form the block chain. The hash value of the first evidence storing block is the hash value obtained by the first evidence storing block through a hash algorithm.
In a possible implementation manner, whether a first certificate storage block hash value is stored in each block is searched from the block corresponding to the starting time of the verification time range until the next block of the block corresponding to the ending time of the verification time range is searched, and if the first certificate storage block hash value is stored in the searched block, the last block of the block is the first certificate storage block.
And step 206, if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal.
And if the server finds the first certificate storage block, receiving a photo hash value of the photo to be verified sent by the terminal. Specifically, after the server finds the first certificate storage block, the server sends an identifier corresponding to the found first certificate storage block to the terminal, the terminal obtains the photo to be verified after receiving the corresponding identifier and calculates the photo hash value of the photo to be verified, the terminal sends the calculated photo hash value to the server, and the server receives the photo hash value of the photo to be verified sent by the terminal.
And step 208, searching a second authentication block corresponding to the photo hash value according to the first authentication block and the photo hash value to obtain an authentication result.
The server searches a second authentication block corresponding to the photo hash value according to the first authentication block and the photo hash value, and if the second authentication block corresponding to the photo hash value is found, a successful authentication result is obtained; and if the second verification block corresponding to the photo hash value is not found, obtaining a result of failure of verification. The second certificate storage block is a block in which the photo hash value is stored. And after obtaining the storage and verification result, the server can return the storage and verification result to the terminal.
In the block chain on-site verification method, a verification and verification request sent by a receiving terminal is received, wherein the verification and verification request comprises a verification time range and a first verification block hash value recorded on a to-be-verified photo; searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value; if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal; and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result. According to the method and the device, through verifying the time range and the Hash value of the first certificate storage block recorded on the photo to be verified, the first certificate storage block corresponding to the Hash value of the first certificate storage block is firstly found, after the first certificate storage block is found, the second certificate storage block corresponding to the Hash value of the photo is then found, a corresponding certificate storage and verification result is obtained, and through multi-level verification, the accuracy of field certification can be effectively verified.
In one embodiment, as shown in fig. 3, the way of storing the photo hash value in the second storage block includes:
step 302, receiving a certificate storing request sent by a terminal.
Step 304, according to the certificate storing request, obtaining the first certificate storing block and the corresponding first certificate storing block hash value, and returning the first certificate storing block hash value to the terminal.
When receiving a certificate storage request sent by a terminal, a server acquires a block which can store data in a current block chain, wherein the block is a first certificate storage block, so as to acquire a first certificate storage block hash value, and sends the first certificate storage block hash value to the terminal.
And step 306, receiving a certificate storing photo hash value corresponding to the certificate storing photo sent by the terminal, wherein the certificate storing photo is an electronic photo obtained by taking a picture of a carrier recording the first certificate storing block hash value held by a certificate storing person.
When the terminal receives the first certificate storage block hash value sent by the server, the certificate storage photo is obtained, the photo hash value of the certificate storage photo is calculated, and the photo hash value is sent to the server, namely the server can receive the certificate storage photo hash value sent by the terminal. The certificate storage photo is an electronic photo obtained by taking a picture of a carrier recording the hash value of the first certificate storage block held by a certificate storage person, for example, the certificate storage person can take a paper slip written with the hash value of the first certificate storage block to take a picture to obtain the electronic photo.
And 308, storing the hash value of the certificate storing photo in a second certificate storing block, wherein the second certificate storing block is a block capable of storing data when the hash value of the certificate storing photo sent by the terminal is received.
And after receiving the hash value of the certificate storage photo sent by the terminal, storing the hash value of the certificate storage photo in a second block, wherein the second block is a block capable of storing data in a block chain when receiving the hash value of the certificate storage photo sent by the terminal.
In one embodiment, the way that the second evidence storage block stores the photo hash value further includes:
sending a first block outlet time corresponding to the first evidence storage block and a second block outlet time corresponding to the second evidence storage block to the terminal; the verification time range comprises a time range from the first block-out time to the second block-out time.
In this embodiment, when performing the storage verification, the server performs the verification according to the received verification time range, and when the verification time range includes the time range from the first block discharging time to the second block discharging time, the probability of successful storage verification can be further improved.
In an alternative embodiment, as shown in fig. 4, the way of storing the photo hash value in the second storage block includes:
step 402, receiving a certificate storing request sent by a terminal.
Step 404, according to the certificate storing request, obtaining the first certificate storing block and the corresponding first certificate storing block hash value, and returning the first certificate storing block hash value and the first certificate storing block corresponding first block discharging time to the terminal.
And 406, receiving a certificate storing photo hash value corresponding to the certificate storing photo sent by the terminal, wherein the certificate storing photo is an electronic photo obtained by taking a picture of a carrier recording the first certificate storing block hash value held by a certificate storing person.
And step 408, storing the hash value of the certificate storing photo in a second certificate storing block, and returning a second block outlet time corresponding to the second certificate storing block to the terminal, wherein the second certificate storing block is a block capable of storing data when the hash value of the certificate storing photo sent by the terminal is received.
In a blockchain network, a block is generated at intervals, and the block is equivalent to a network record book which is used for recording relevant information of each node in the blockchain in a period of time. When one book is full, another book is created, and once one book has information recorded, the book informs all participants and updates each book, which are linked together to form a blockchain network.
In this embodiment, the server receives a certificate storing request sent by the terminal, acquires a first certificate storing block and a corresponding first certificate storing block hash value according to the certificate storing request, and returns the first certificate storing block hash value and a first block discharging time corresponding to the first certificate storing block to the terminal; receiving a certificate storing photo hash value corresponding to the certificate storing photo sent by the terminal, wherein the certificate storing photo is an electronic photo obtained by photographing by a certificate storing person holding a carrier for recording the first certificate storing block hash value; and storing the hash value of the certificate storing photo in a second certificate storing block, and returning a second block outlet time corresponding to the second certificate storing block to the terminal, wherein the second certificate storing block is a block capable of storing data when the hash value of the certificate storing photo sent by the terminal is received. By the method, the verification time range can be set to the time range from the first block discharging time to the second block discharging time when the storage verification is carried out, and the probability of successful storage verification can be further improved.
In one embodiment, as shown in fig. 5, the step 204 of finding the first evidence storing block corresponding to the first evidence storing block hash value according to the verification time range and the first evidence storing block hash value includes:
step 502, starting from the block corresponding to the start time of the verification time range in the block chain, sequentially calculating the hash value of each corresponding block after the start time of the verification time range, and comparing the hash value with the first evidence-storing block hash value.
In the block chain, the recorded information of each block includes corresponding time information, and the corresponding block-out time of each block is also recorded. The hash value of each block corresponding to the start time of the verification time range is calculated in sequence from the block corresponding to the start time of the verification time range in the block chain, that is, the hash value of each block generated after the block is calculated from the block corresponding to the start time of the verification time range, and the hash value of each block is compared with the hash value of the first evidence-storing block in sequence. For example, the start time of the verification time range is Tm,TmThe corresponding block is blockmThen sequentially calculating in blockmAnd comparing the hash value of each block with the hash value of the first evidence storing block.
In step 504, if the hash value of the calculated block is the same as the hash value of the first evidence storing block, the block is used as the first evidence storing block.
In an optional embodiment, the server sequentially calculates, from the block corresponding to the start time of the verification time range in the block chain, the hash value of each corresponding block after the start time of the verification time range, and compares the hash value with the hash value of the first evidence storing block, and if the calculated hash value of the block is the same as the hash value of the first evidence storing block, the block is taken as the first evidence storing block. And stopping searching until the first evidence storing block is found in the verification time range or the end time of the verification time range is reached.
In an embodiment, as shown in fig. 6, the step 208 of finding the second certificate storing block corresponding to the photo hash value according to the first certificate storing block and the photo hash value to obtain the certificate storing and verifying result includes:
step 602, starting from the first evidence storing block, sequentially searching whether blocks generated after the first evidence storing block store the photo hash value.
And step 604, taking the block corresponding to the photo hash value as a second verification storage block, and obtaining a result of successful verification storage.
And 606, if the block corresponding to the photo hash value is not found, obtaining a result of failure of verification and verification.
In this embodiment, the server sequentially searches whether the blocks generated after the first certificate storing block store the photo hash values or not from the first certificate storing block until the photo hash values are found and stored in the blocks corresponding to the verification time range or the end time of the verification time range is found. Taking the block corresponding to the photo hash value as a second verification storage block to obtain a result of successful verification storage; and if the block corresponding to the photo hash value is not found, obtaining a result of failure of verification and verification. The server can return the result of successful verification and the result of failed verification to the terminal.
In one embodiment, the blockchain presence verification method further comprises:
and if the first certificate storing block corresponding to the first certificate storing hash value is not found according to the verification time range and the first certificate storing block hash value, obtaining a result of certificate storing verification failure.
In this embodiment, if the server does not find the first authentication block corresponding to the hash value of the first authentication block within the authentication time range, that is, if the hash value of any block is not the same as the hash value of the first authentication block in the block corresponding to the authentication time range, it is determined that authentication is not performed within the corresponding authentication time range, and a result that authentication fails is obtained.
In one embodiment, the blockchain presence verification method is illustrated using a timing diagram as shown in FIG. 7:
step 702, when storing certificate, the terminal receives the certificate storing request initiated by the user, and sends the certificate storing request to the server.
Step 704, the server obtains the first certificate storing block and the corresponding first certificate storing block hash value according to the certificate storing request, and returns the first certificate storing block hash value to the terminal. The first certificate storage block is a block which can store data in a block chain when the server receives a certificate storage request.
And step 706, the terminal acquires the certificate storing photo, calculates the corresponding certificate storing photo hash value, and sends the certificate storing photo hash value to the server.
In step 708, the server stores the certificate authority hash value in the second certificate authority block. And after receiving the certificate storage certificate hash value sent by the terminal, the server stores the certificate storage certificate hash value in the second certificate storage block and returns a first block outlet time corresponding to the first certificate storage block and a second block outlet time corresponding to the second certificate storage block to the terminal.
Step 710, the terminal receives a first block output time corresponding to the first evidence storage block and a second block output time corresponding to the second evidence storage block.
And 712, when the storage authentication is performed, the terminal receives a storage authentication request initiated by the user, wherein the storage authentication request includes an authentication time range and a first storage authentication block hash value recorded on the to-be-authenticated photo. The verification time range includes a time range including a first out-of-block time to a second out-of-block time.
And 714, after receiving the corresponding certificate storage and verification request, the terminal searches for a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value, and returns a search result of the first certificate storage block to the terminal.
In step 716, the terminal receives the search result of the first certificate storage block.
In step 718, if the search result of the first certificate storage block is that the first certificate storage block is found, the terminal obtains the photo hash value of the photo to be verified. And the terminal sends the photo hash value of the photo to be verified to the server.
And step 720, the server receives the photo hash value of the photo to be verified sent by the terminal.
And step 722, the server searches a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result. The server sends the verification result to the terminal, wherein, the verification result is including the verification that the verification is successful and the verification that the verification is failed, when the verification result is for the verification that the verification is successful, send first sign to the terminal, when the verification result is for the verification that the verification is failed, send the second sign to the terminal, first sign and second sign are different, for example, first sign is 1, the second sign is 0.
In step 724, the terminal receives the verification result.
The description and implementation process of the specific steps in this embodiment may refer to the contents of the above embodiments, and are not described herein again.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a blockchain presence verification apparatus for implementing the above related blockchain presence verification method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so that specific limitations in one or more embodiments of the block chain presence verification device provided below may refer to the above limitations on the block chain presence verification method, and details are not described here.
In one embodiment, as shown in fig. 8, there is provided a blockchain presence verification apparatus, including: a first receiving module 802, a first lookup module 804, a second receiving module 806, and a second lookup module 808, wherein:
a first receiving module 802, configured to receive a storage authentication request sent by a terminal, where the storage authentication request includes an authentication time range and a first storage authentication block hash value recorded on a to-be-authenticated photograph;
a first searching module 804, configured to search a first certificate storing block corresponding to the first certificate storing block hash value according to the verification time range and the first certificate storing block hash value;
a second receiving module 806, configured to receive a photo hash value of the photo to be verified, sent by the terminal, if the first certificate storage block is found;
and the second searching module 808 is configured to search the second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value, so as to obtain a certificate storage and verification result.
In one embodiment, the blockchain presence verification apparatus further includes a photo hash module for the second certified block to store a photo hash value, including:
receiving a certificate storing request sent by a terminal;
according to the certificate storing request, a first certificate storing block and a corresponding first certificate storing block hash value are obtained, and the first certificate storing block hash value is returned to the terminal;
receiving a certificate storing photo hash value corresponding to the certificate storing photo sent by the terminal, wherein the certificate storing photo is an electronic photo obtained by photographing a carrier which records the first certificate storing block hash value and holds by a certificate storing person;
and storing the hash value of the certificate storing photo in a second certificate storing block, wherein the second certificate storing block is a block capable of storing data when a block chain is used for receiving the hash value of the certificate storing photo sent by the terminal.
In one embodiment, the photo hashing module is further configured to:
sending a first block outlet time corresponding to the first evidence storage block and a second block outlet time corresponding to the second evidence storage block to a terminal; the verification time range comprises a time range from a first block-out time to a second block-out time.
In one embodiment, the first lookup module 804 is further configured to:
calculating the hash value of each corresponding block after the starting time of the verification time range in sequence from the block corresponding to the starting time of the verification time range in the block chain, and comparing the hash value with the first evidence-storing block hash value;
and if the hash value of the calculated block is the same as the hash value of the first evidence storing block, taking the block as the first evidence storing block.
In one embodiment, the second lookup module 808 is further configured to:
sequentially searching whether the photo hash value is stored in the block generated after the first certificate storing block from the first certificate storing block;
taking the block corresponding to the photo hash value as a second verification storage block to obtain a result of successful verification storage;
and if the block corresponding to the photo hash value is not found, obtaining a result of failure of verification and verification.
In one embodiment, the blockchain presence verification apparatus further comprises a verification result module for:
and if the first certificate storage block corresponding to the first certificate storage hash value is not found according to the verification time range and the first certificate storage block hash value, obtaining a result of certificate storage verification failure.
The modules of the block chain in the field authentication device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing certificate photo hash value data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a blockchain presence verification method.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
receiving a storage and verification request sent by a terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a photo to be verified;
searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value;
if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal;
and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving a storage and verification request sent by a terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a photo to be verified;
searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value;
if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal;
and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the steps of:
receiving a storage and verification request sent by a terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a photo to be verified;
searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value;
if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal;
and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A blockchain presence verification method, the method comprising:
receiving a storage and verification request sent by a terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a photo to be verified;
searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value;
if the first certificate storage block is found, receiving a photo hash value of the photo to be verified, which is sent by the terminal;
and searching a second certificate storage block corresponding to the photo hash value according to the first certificate storage block and the photo hash value to obtain a certificate storage and verification result.
2. The method of claim 1, wherein the second storage block stores the photo hash value in a manner that comprises:
receiving a certificate storing request sent by a terminal;
according to the certificate storing request, a first certificate storing block and a corresponding first certificate storing block hash value are obtained, and the first certificate storing block hash value is returned to the terminal;
receiving a certificate storing photo hash value corresponding to the certificate storing photo sent by the terminal, wherein the certificate storing photo is an electronic photo obtained by photographing a carrier which records the first certificate storing block hash value and holds by a certificate storing person;
and storing the hash value of the certificate storing photo in a second certificate storing block, wherein the second certificate storing block is a block capable of storing data when a block chain is used for receiving the hash value of the certificate storing photo sent by the terminal.
3. The method of claim 2, wherein the second storage block stores a hash value of the photo, and further comprising:
sending a first block outlet time corresponding to the first evidence storage block and a second block outlet time corresponding to the second evidence storage block to a terminal; the verification time range comprises a time range from a first block-out time to a second block-out time.
4. The method of claim 1, wherein the searching for the first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value comprises:
calculating the hash value of each corresponding block after the starting time of the verification time range in sequence from the block corresponding to the starting time of the verification time range in the block chain, and comparing the hash value with the first evidence-storing block hash value;
and if the hash value of the calculated block is the same as the hash value of the first evidence storing block, taking the block as the first evidence storing block.
5. The method according to claim 1, wherein the searching for the second verification block corresponding to the photo hash value according to the first verification block and the photo hash value to obtain a verification result comprises:
sequentially searching whether the photo hash value is stored in the block generated after the first certificate storing block from the first certificate storing block;
taking the block corresponding to the photo hash value as a second verification storage block to obtain a result of successful verification storage;
and if the block corresponding to the photo hash value is not found, obtaining a result of failure of verification and verification.
6. The method of claim 1, further comprising:
and if the first certificate storage block corresponding to the first certificate storage hash value is not found according to the verification time range and the first certificate storage block hash value, obtaining a result of certificate storage verification failure.
7. A blockchain presence verification apparatus, the apparatus comprising:
the first receiving module is used for receiving a storage and verification request sent by the terminal, wherein the storage and verification request comprises a verification time range and a first storage and verification block hash value recorded on a to-be-verified photo;
the first searching module is used for searching a first certificate storage block corresponding to the first certificate storage block hash value according to the verification time range and the first certificate storage block hash value;
the second receiving module is used for receiving the photo hash value of the photo to be verified sent by the terminal if the first certificate storing block is found;
and the second searching module is used for searching a second certificate storing block corresponding to the photo hash value according to the first certificate storing block and the photo hash value to obtain a certificate storing and verifying result.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202111471340.9A 2021-12-04 2021-12-04 Block chain presence verification method and device, computer equipment and storage medium Pending CN114090588A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111471340.9A CN114090588A (en) 2021-12-04 2021-12-04 Block chain presence verification method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111471340.9A CN114090588A (en) 2021-12-04 2021-12-04 Block chain presence verification method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114090588A true CN114090588A (en) 2022-02-25

Family

ID=80306452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111471340.9A Pending CN114090588A (en) 2021-12-04 2021-12-04 Block chain presence verification method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114090588A (en)

Similar Documents

Publication Publication Date Title
US10621376B2 (en) Personal ledger blockchain
WO2020211496A1 (en) Method, system and apparatus for verifying signature in blockchain ledger, and device
WO2020238248A1 (en) Data storage method, apparatus and device
TWI714414B (en) Method and device for obtaining block chain data in stages
US11314885B2 (en) Cryptographic data entry blockchain data structure
CN115659417A (en) Audit log storage method, audit log verification method, audit log storage device, audit log verification device and computer equipment
WO2023056249A1 (en) Custodial systems for non-fungible tokens
CN116346310A (en) Method and device for inquiring trace based on homomorphic encryption and computer equipment
CN109450636B (en) Integrity verification method for group data in cloud storage
CN114491647A (en) Data retrieval method and system based on block chain
CN115168499B (en) Database table fragmentation method and device, computer equipment and storage medium
US20230168825A1 (en) Trusted systems for decentralized data storage
CN114090588A (en) Block chain presence verification method and device, computer equipment and storage medium
CN114127724A (en) Integrity audit for multi-copy storage
CN115935414A (en) Block chain based data verification method and device, electronic equipment and storage medium
CN115185946A (en) Multi-tenant system, multi-tenant management method, computer device, and storage medium
CN110636042B (en) Method, device and equipment for updating verified block height of server
CN114745173A (en) Login verification method, login verification device, computer equipment, storage medium and program product
CN112732789A (en) Searchable encryption method based on block chain and electronic equipment
KR102470261B1 (en) Method and system for generating and restoring a private key by using GPS data of pictures
US11809598B2 (en) Devices and methods for safe storage of media containing personal data and erasure of stored personal data
US10726049B2 (en) Obtaining blockchain data in stages
CN116842541A (en) Data encryption and decryption processing method and device, computer equipment and storage medium
WO2021012815A1 (en) Digital asset authentication processing system
CN111292082B (en) Public key management method, device and equipment in block chain type account book

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