Blockchain presence verification method, device, computer equipment and storage medium
Through blockchain technology, the evidence verification request is received and verified, and the block corresponding to the hash value of the evidence block and the hash value of the photo is found, which solves the problem of low security of electronic evidence proof of presence in the existing technology and realizes efficient proof of presence verification.
Patent Information
- Application Number
- CN202111471340.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-04
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-12-04
AI Technical Summary
In the existing technology, the security of proof of presence of electronic evidence is low and there is a lack of effective verification methods.
Using blockchain technology, the evidence verification request sent by the receiving terminal is searched for the block corresponding to the hash value of the evidence block, and the second evidence block is searched based on the hash value of the photo, realizing multi-level verification to ensure the accuracy of the proof of presence.
It effectively verifies the accuracy of the proof of presence and improves the security and reliability of electronic evidence.
Smart Images

Figure CN114090588B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain on-site verification method, apparatus, computer equipment, and storage medium. Background Art
[0002] With the development of information technology and the widespread use of computer networks, electronic evidence, a byproduct of numerous e-commerce and online interactions, has become increasingly important in the collection and management of evidence in areas such as copyright protection, commercial rights protection, virtual property, and mobile office. The key characteristics of electronic evidence are its reliance on digital media, rapid collection, ease of transmission, minimal storage space, and repeatability. This makes electronic evidence poised to play a crucial role in future rights protection and law enforcement efforts, allowing it to be used as evidence to prove relevant facts.
[0003] Blockchain is a novel application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is a chained data structure composed of sequentially linked data blocks in chronological order, and a distributed ledger that is cryptographically guaranteed to be tamper-proof and unforgeable. Due to its decentralized, tamper-proof, and autonomous nature, blockchain is gaining increasing attention and application.
[0004] Currently, the proof of presence is transmitted to a centralized server for storage, resulting in low security of the stored proof of presence. Therefore, there is an urgent need to provide a method that can effectively verify the accuracy of the proof of presence. Summary of the Invention
[0005] Based on this, it is necessary to provide a blockchain presence verification method, device, computer equipment, computer-readable storage medium and computer program product that can effectively verify whether the presence proof is accurate in response to the above technical problems.
[0006] In a first aspect, the present application provides a blockchain presence verification method. The method comprises:
[0007] Receiving a proof verification request sent by a terminal, the proof verification request including a verification time range and a hash value of a first proof block recorded on the photo to be verified;
[0008] According to the verification time range and the hash value of the first evidence block, searching for the first evidence block corresponding to the hash value of the first evidence block;
[0009] If the first evidence storage block is found, receiving the photo hash value of the photo to be verified sent by the terminal;
[0010] According to the first evidence block and the photo hash value, the second evidence block corresponding to the photo hash value is searched to obtain the evidence verification result.
[0011] In one embodiment, the second evidence block stores the hash value of the photo, including:
[0012] Receiving the evidence storage request sent by the terminal;
[0013] Obtaining a first evidence block and a corresponding first evidence block hash value according to the evidence storage request, and returning the first evidence block hash value to the terminal;
[0014] Receiving a hash value of an evidence photo corresponding to the evidence photo sent by the terminal, where the evidence photo is an electronic photo obtained by the witness holding a carrier recording the hash value of the first evidence block;
[0015] The hash value of the evidence photo is stored in a second evidence block, where the second evidence block is a block in which the blockchain can store data when the hash value of the evidence photo sent by the terminal is received.
[0016] In one embodiment, the method of storing the hash value of the photo in the second evidence block further includes:
[0017] The first block generation time corresponding to the first evidence block and the second block generation time corresponding to the second evidence block are sent to the terminal; the verification time range includes the time range from the first block generation time to the second block generation time.
[0018] In one embodiment, searching for the first evidence block corresponding to the hash value of the first evidence block based on the verification time range and the hash value of the first evidence block includes:
[0019] Starting from the block corresponding to the start time of the verification time range in the blockchain, calculate the hash value of each block corresponding to the start time of the verification time range in sequence, and compare it with the hash value of the first stored evidence block;
[0020] If the calculated hash value of the block is the same as the hash value of the first evidence block, the block will be used as the first evidence block.
[0021] In one embodiment, searching for a second evidence block corresponding to the photo hash value based on the first evidence block and the photo hash value to obtain an evidence verification result includes:
[0022] Starting from the first evidence block, sequentially search for blocks generated after the first evidence block to see if they store the photo hash value;
[0023] The block corresponding to the hash value of the photo is used as the second evidence block, and a result of successful evidence verification is obtained;
[0024] If the block corresponding to the hash value of the photo is not found, the result of evidence verification failure is obtained.
[0025] In one embodiment, the method further comprises:
[0026] If the first evidence block corresponding to the first evidence hash value is not found according to the verification time range and the first evidence block hash value, a result of evidence verification failure is obtained.
[0027] In a second aspect, the present application also provides a blockchain presence verification device. The device includes:
[0028] A first receiving module is configured to receive a proof verification request sent by a terminal, wherein the proof verification request includes a verification time range and a hash value of a first proof block recorded on the photo to be verified;
[0029] A first search module is configured to search for a first evidence block corresponding to the hash value of the first evidence block according to the verification time range and the hash value of the first evidence block;
[0030] A second receiving module is configured to receive a photo hash value of the photo to be verified sent by the terminal if the first evidence storage block is found;
[0031] The second search module is used to search for the second evidence block corresponding to the photo hash value based on the first evidence block and the photo hash value to obtain the evidence verification result.
[0032] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0033] Receiving a proof verification request sent by a terminal, the proof verification request including a verification time range and a hash value of a first proof block recorded on the photo to be verified;
[0034] According to the verification time range and the hash value of the first evidence block, searching for the first evidence block corresponding to the hash value of the first evidence block;
[0035] If the first evidence storage block is found, receiving the photo hash value of the photo to be verified sent by the terminal;
[0036] According to the first evidence block and the photo hash value, the second evidence block corresponding to the photo hash value is searched to obtain the evidence verification result.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0038] Receiving a proof verification request sent by a terminal, the proof verification request including a verification time range and a hash value of a first proof block recorded on the photo to be verified;
[0039] According to the verification time range and the hash value of the first evidence block, searching for the first evidence block corresponding to the hash value of the first evidence block;
[0040] If the first evidence storage block is found, receiving the photo hash value of the photo to be verified sent by the terminal;
[0041] According to the first evidence block and the photo hash value, the second evidence block corresponding to the photo hash value is searched to obtain the evidence verification result.
[0042] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0043] Receiving a proof verification request sent by a terminal, the proof verification request including a verification time range and a hash value of a first proof block recorded on the photo to be verified;
[0044] According to the verification time range and the hash value of the first evidence block, searching for the first evidence block corresponding to the hash value of the first evidence block;
[0045] If the first evidence storage block is found, receiving the photo hash value of the photo to be verified sent by the terminal;
[0046] According to the first evidence block and the photo hash value, the second evidence block corresponding to the photo hash value is searched to obtain the evidence verification result.
[0047] The above-mentioned blockchain presence verification method, apparatus, computer equipment, storage medium and computer program product, by receiving an evidence verification request sent by a terminal, the evidence verification request includes a verification time range and a hash value of the first evidence block recorded on the photo to be verified; according to the verification time range and the hash value of the first evidence block, searching for the first evidence block corresponding to the hash value of the first evidence block; if the first evidence block is found, receiving the photo hash value of the photo to be verified sent by the terminal; according to the first evidence block and the photo hash value, searching for the second evidence block corresponding to the photo hash value, and obtaining an evidence verification result. This application first finds the first evidence block corresponding to the hash value of the first evidence block by verifying the time range and the hash value of the first evidence block recorded on the photo to be verified. After finding the first evidence block, it searches for the second evidence block corresponding to the photo hash value to obtain the corresponding evidence verification result. Through multi-level verification, the accuracy of the proof of presence can be effectively verified. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is a diagram of an application environment of a blockchain on-site verification method in one embodiment;
[0049] Figure 2 1. A flowchart of a blockchain presence verification method according to an embodiment;
[0050] Figure 3 A schematic diagram of a process for storing a photo hash value in the second evidence storage block in one embodiment;
[0051] Figure 4 A schematic diagram of a process for storing a photo hash value in the second evidence storage block in another embodiment;
[0052] Figure 5 204 is a flow chart of step 204 in one embodiment;
[0053] Figure 6 208 is a flow chart of step 208 in one embodiment;
[0054] Figure 7 This is an interaction sequence diagram of a blockchain presence verification method in one embodiment;
[0055] Figure 8 This is a structural block diagram of a blockchain presence verification device in one embodiment;
[0056] Figure 9 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0058] The blockchain presence verification method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 sends an evidence verification request to the server 104, and at the same time sends the verification time range and the hash value of the first evidence block recorded on the photo to be verified. Correspondingly, the server 104 receives the evidence verification request sent by the terminal 102, and the evidence verification request includes the verification time range and the hash value of the first evidence block recorded on the photo to be verified. The server 104 searches for the first evidence block corresponding to the hash value of the first evidence block according to the verification time range and the hash value of the first evidence block. If the first evidence block is found, the receiving terminal 102 sends the photo hash value of the photo to be verified, and searches for the second evidence block corresponding to the photo hash value according to the first evidence block and the photo hash value to obtain the evidence verification result. Terminal 102 may include, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. Server 104 may be implemented as a standalone server or a server cluster consisting of multiple servers.
[0059] In one embodiment, Figure 2 As shown, a blockchain presence verification method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the server in the example:
[0060] Step 202: receiving an evidence verification request sent by a terminal, wherein the evidence verification request includes a verification time range and a hash value of a first evidence block recorded on the photo to be verified.
[0061] The server receives a proof verification request sent by the terminal, wherein the proof verification request includes a verification time range and a hash value of the first proof block recorded on the photo to be verified. After receiving the verification time range, the server searches within the verification time range to see if there is a block or hash value that meets the preset conditions. When performing proof storage, when the server receives the corresponding proof request, it returns the hash value of the block that can store data in the blockchain to the terminal, that is, it returns the hash value of the first proof block to the terminal. After receiving the first proof block hash value displayed by the terminal, the witness presents the first proof block hash value on a carrier. The witness holds the carrier including the first proof block hash value and takes a photo. That is, the obtained electronic photo includes the hash value of the first proof block. Therefore, for the proof verification request, the first proof block hash value needs to be recorded on the photo to be verified.
[0062] In one optional implementation, the terminal receives the photo to be verified, obtains the first evidence block hash value by identifying the characters corresponding to the first evidence block hash value recorded in the photo to be verified, and sends the first evidence block hash value to the server. Accordingly, the server can obtain the first evidence block hash value recorded on the photo to be verified. Alternatively, the terminal directly receives the first evidence block hash value recorded on the photo to be verified, and then sends the first evidence block hash value to the server. Accordingly, the server receives the first evidence block hash value recorded on the photo to be verified.
[0063] Step 204: Search for the first evidence block corresponding to the hash value of the first evidence block based on the verification time range and the hash value of the first evidence block.
[0064] Within the verification timeframe, the server searches for the first evidence block corresponding to the hash value of the first evidence block based on the hash value of the first evidence block. In a blockchain, blocks can be considered individual storage units, recording information exchanged between nodes over a certain period of time. Blocks are linked via a random hash (i.e., a hash algorithm), with each subsequent block containing the hash value of the previous one. As information exchange increases, blocks are linked to one another, forming a blockchain. The hash value of the first evidence block is the hash value obtained by the hash algorithm for the first evidence block.
[0065] In one possible implementation, starting from the block corresponding to the start time of the verification time range, a search is performed to determine whether the hash value of the first evidence block is stored in each block, until the next block corresponding to the block at the end time of the verification time range is found. If the hash value of the first evidence block is stored in the block found, then the previous block of the block is the first evidence block.
[0066] Step 206: If the first evidence storage block is found, the photo hash value of the photo to be verified sent by the receiving terminal.
[0067] If the server finds the first evidence block, it receives the photo hash value of the photo to be verified from the terminal. Specifically, after finding the first evidence block, the server sends an identification indicating that the first evidence block has been found to the terminal. After receiving the identification, the terminal obtains the photo to be verified and calculates the photo hash value of the photo to be verified. The terminal then sends the calculated photo hash value to the server, and the server receives the photo hash value of the photo to be verified from the terminal.
[0068] Step 208: According to the first evidence block and the photo hash value, search for the second evidence block corresponding to the photo hash value to obtain the evidence verification result.
[0069] Based on the first evidence block and the photo's hash value, the server searches for the second evidence block corresponding to the photo's hash value. If the second evidence block corresponding to the photo's hash value is found, the server receives a successful evidence verification result. If the second evidence block corresponding to the photo's hash value is not found, the server receives a failed evidence verification result. The second evidence block is the block that stores the photo's hash value. After receiving the evidence verification result, the server can return it to the terminal.
[0070] In the above-mentioned blockchain presence verification method, the evidence verification request is sent by the receiving terminal, and the evidence verification request includes the verification time range and the hash value of the first evidence block recorded on the photo to be verified; according to the verification time range and the hash value of the first evidence block, the first evidence block corresponding to the hash value of the first evidence block is searched; if the first evidence block is found, the photo hash value of the photo to be verified sent by the receiving terminal is received; according to the first evidence block and the photo hash value, the second evidence block corresponding to the photo hash value is searched to obtain the evidence verification result. This application first finds the first evidence block corresponding to the hash value of the first evidence block by verifying the time range and the hash value of the first evidence block recorded on the photo to be verified. After finding the first evidence block, the second evidence block corresponding to the photo hash value is searched to obtain the corresponding evidence verification result. Through multi-level verification, the accuracy of the proof of presence can be effectively verified.
[0071] In one embodiment, Figure 3 As shown, the second evidence block stores the photo hash value in the following ways:
[0072] Step 302: Receive the evidence storage request sent by the terminal.
[0073] Step 304: Obtain the first evidence block and the corresponding first evidence block hash value according to the evidence storage request, and return the first evidence block hash value to the terminal.
[0074] When receiving the evidence request sent by the terminal, the server obtains a block in the current blockchain that can store data, which is the first evidence block, thereby obtaining the hash value of the first evidence block and sending the hash value of the first evidence block to the terminal.
[0075] Step 306: The receiving terminal receives the hash value of the evidence photo corresponding to the evidence photo sent by the receiving terminal, wherein the evidence photo is an electronic photo obtained by photographing the carrier recording the hash value of the first evidence block by the witness.
[0076] When the terminal receives the hash value of the first evidence block sent by the server, it obtains the evidence photo, calculates the photo hash value of the evidence photo, and sends the photo hash value to the server. This means that the server receives the hash value of the evidence photo sent by the terminal. The evidence photo is an electronic photo obtained by the witness holding a carrier that records the hash value of the first evidence block. For example, the witness can hold a piece of paper with the hash value of the first evidence block written on it and take a photo to obtain the electronic photo.
[0077] Step 308: Store the hash value of the evidence photo in the second evidence block. The second evidence block is a block that the blockchain can store data when the hash value of the evidence photo sent by the terminal is received.
[0078] After receiving the hash value of the evidence photo sent by the terminal, the hash value of the evidence photo is stored in the second block. The second block is a block that the blockchain can store data when the hash value of the evidence photo sent by the terminal is received.
[0079] In one embodiment, the method of storing the hash value of the photo in the second evidence block further includes:
[0080] The first block generation time corresponding to the first evidence block and the second block generation time corresponding to the second evidence block are sent to the terminal; wherein the verification time range includes the time range from the first block generation time to the second block generation time.
[0081] In this embodiment, when performing evidence verification, the server performs verification based on the received verification time range. When the verification time range includes the time range from the first block generation time to the second block generation time, the probability of successful evidence verification can be further improved.
[0082] In an optional embodiment, if Figure 4 As shown, the second evidence block stores the photo hash value in the following ways:
[0083] Step 402: Receive the evidence storage request sent by the terminal.
[0084] Step 404: According to the evidence storage request, obtain the first evidence block and the corresponding first evidence block hash value, and return the first evidence block hash value and the first block generation time corresponding to the first evidence block to the terminal.
[0085] Step 406: The receiving terminal receives the hash value of the evidence photo corresponding to the evidence photo sent by the receiving terminal, wherein the evidence photo is an electronic photo obtained by photographing the carrier recording the hash value of the first evidence block held by the evidence holder.
[0086] Step 408: Store the hash value of the evidence photo in the second evidence block, and return the second block generation time corresponding to the second evidence block to the terminal, where the second evidence block is a block that the blockchain can store data when receiving the hash value of the evidence photo sent by the terminal.
[0087] In a blockchain network, a block is generated at regular intervals. A block acts as a network logbook, recording relevant information about each node in the blockchain over a period of time. When a logbook is full, another is generated. Once a logbook is full, it notifies all participants and updates each logbook. These logbooks are connected together to form a blockchain network.
[0088] In this embodiment, the server receives a certificate request sent by the terminal, obtains the first certificate block and the corresponding hash value of the first certificate block according to the certificate request, and returns the hash value of the first certificate block and the first block generation time corresponding to the first certificate block to the terminal; receives the hash value of the certificate photo corresponding to the certificate photo sent by the terminal, wherein the certificate photo is an electronic photo obtained by the witness holding the carrier recording the hash value of the first certificate block and taking a photo; stores the hash value of the certificate photo in the second certificate block, and returns the second block generation time corresponding to the second certificate block to the terminal, wherein the second certificate block is a block that the blockchain can store data when the hash value of the certificate photo sent by the terminal is received. Through the above method, when performing certificate verification, the verification time range can be set to the time range including the first block generation time to the second block generation time, which can further improve the probability of successful certificate verification.
[0089] In one embodiment, Figure 5 As shown, step 204 of searching for the first evidence block corresponding to the hash value of the first evidence block according to the verification time range and the hash value of the first evidence block includes:
[0090] Step 502: Starting from the block corresponding to the start time of the verification time range in the blockchain, the hash value of each block corresponding to the start time of the verification time range is calculated in sequence, and compared with the hash value of the first stored evidence block.
[0091] In the blockchain, the information recorded in each block includes the corresponding time information, which also records the block generation time of each block. Starting from the block corresponding to the start time of the verification time range in the blockchain, the hash value of each block corresponding to the start time of the verification time range is calculated in sequence. In other words, starting from the block corresponding to the start time of the verification time range, the hash value of each block generated after the block is calculated, and the hash value of each block is compared with the hash value of the first evidence block in sequence. For example, the start time of the verification time range is T m , T m The corresponding block is block m , then calculate in block m The hash value of each subsequent block is compared with the hash value of the first evidence block.
[0092] In step 504, if the calculated hash value of the block is the same as the hash value of the first evidence block, the block is used as the first evidence block.
[0093] In an optional embodiment, the server begins with the block corresponding to the start time of the verification time range in the blockchain, sequentially calculates the hash value of each block corresponding to the start time of the verification time range, and compares it with the hash value of the first stored evidence block. If the calculated hash value of the block is the same as the hash value of the first stored evidence block, the block is used as the first stored evidence block. The search stops until the first stored evidence block is found within the verification time range or the verification time range ends.
[0094] In one embodiment, Figure 6 As shown, according to the first evidence block and the photo hash value, searching for the second evidence block corresponding to the photo hash value to obtain the evidence verification result 208 includes:
[0095] Step 602, starting from the first evidence block, sequentially search whether the blocks generated after the first evidence block store the photo hash value.
[0096] In step 604, the block corresponding to the hash value of the photo is used as the second evidence storage block to obtain a result of successful evidence verification.
[0097] Step 606: If the block corresponding to the hash value of the photo is not found, the result of evidence verification failure is obtained.
[0098] In this embodiment, the server begins with the first evidence block and sequentially searches for blocks generated after the first evidence block to see if they contain a photo hash value, until a block corresponding to the verification time range is found containing a photo hash value, or until the verification time range ends. The block corresponding to the photo hash value is used as the second evidence block, and a verification success result is obtained. If no block corresponding to the photo hash value is found, a verification failure result is obtained. The server can return the verification success and verification failure results to the terminal.
[0099] In one embodiment, the blockchain presence verification method further includes:
[0100] If the first evidence block corresponding to the first evidence hash value is not found according to the verification time range and the hash value of the first evidence block, the result of evidence verification failure is obtained.
[0101] In this embodiment, if the server fails to find the first evidence block corresponding to the hash value of the first evidence block within the verification time range, that is, among the blocks corresponding to the verification time range, the hash value of any block is the same as the hash value of the first evidence block, then it means that the evidence is not stored within the corresponding verification time range, and the result of evidence verification failure is obtained.
[0102] In one embodiment, the blockchain presence verification method uses Figure 7 The timing diagram shown is explained:
[0103] Step 702: When storing evidence, the terminal receives the evidence storage request initiated by the user and sends the evidence storage request to the server.
[0104] In step 704, the server obtains the first evidence block and the corresponding first evidence block hash value based on the evidence storage request, and returns the first evidence block hash value to the terminal. The first evidence block is the block in the blockchain that corresponds to the data that can be stored when the server receives the evidence storage request.
[0105] In step 706, the terminal obtains the stored photo, calculates the stored photo hash value corresponding to the stored photo, and sends the stored photo hash value to the server.
[0106] In step 708, the server stores the hash value of the evidence photo in the second evidence block. After receiving the hash value of the evidence photo sent by the terminal, the server stores the hash value of the evidence photo in the second evidence block and returns the first block generation time corresponding to the first evidence block and the second block generation time corresponding to the second evidence block to the terminal.
[0107] In step 710, the terminal receives a first block generation time corresponding to the first evidence block and a second block generation time corresponding to the second evidence block.
[0108] In step 712, when performing evidence verification, the terminal receives an evidence verification request initiated by the user. The evidence verification request includes a verification time range and a hash value of the first evidence block recorded on the photo to be verified. The verification time range includes the time range from the first block generation time to the second block generation time.
[0109] In step 714, after receiving the corresponding evidence verification request, the terminal searches for the first evidence block corresponding to the hash value of the first evidence block according to the verification time range and the hash value of the first evidence block, and returns the search result of the first evidence block to the terminal.
[0110] Step 716: The terminal receives the search result of the first evidence block.
[0111] In step 718, if the search result of the first evidence block is that the first evidence block is found, the terminal obtains the photo hash value of the photo to be verified and sends the photo hash value of the photo to be verified to the server.
[0112] In step 720 , the server receives the photo hash value of the photo to be verified sent by the terminal.
[0113] In step 722, the server searches the second evidence block corresponding to the photo hash value based on the first evidence block and the photo hash value, and obtains an evidence verification result. The server sends the evidence verification result to the terminal, where the evidence verification result includes evidence verification success and evidence verification failure. When the evidence verification result is evidence verification success, a first identifier is sent to the terminal. When the evidence verification result is evidence verification failure, a second identifier is sent to the terminal. The first identifier and the second identifier are different, for example, the first identifier is 1 and the second identifier is 0.
[0114] Step 724: The terminal receives the evidence verification result.
[0115] The description of the specific steps and implementation process of this embodiment can be found in the above embodiment content and will not be repeated here.
[0116] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0117] Based on the same inventive concept, the present application also provides a blockchain presence verification device for implementing the aforementioned blockchain presence verification method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more blockchain presence verification device embodiments provided below can be found in the above-mentioned limitations of the blockchain presence verification method and will not be repeated here.
[0118] In one embodiment, Figure 8 As shown, a blockchain presence verification device is provided, comprising: a first receiving module 802, a first search module 804, a second receiving module 806 and a second search module 808, wherein:
[0119] A first receiving module 802 is configured to receive a proof verification request sent by a terminal, wherein the proof verification request includes a verification time range and a hash value of a first proof block recorded on the photo to be verified;
[0120] A first search module 804 is configured to search for a first evidence block corresponding to the hash value of the first evidence block according to the verification time range and the hash value of the first evidence block;
[0121] A second receiving module 806 is configured to receive a photo hash value of the photo to be verified sent by the terminal if the first evidence storage block is found;
[0122] The second search module 808 is used to search for the second evidence block corresponding to the photo hash value based on the first evidence block and the photo hash value to obtain the evidence verification result.
[0123] In one embodiment, the blockchain presence verification device further includes a photo hash module, which is used to store the photo hash value in the second evidence storage block, including:
[0124] Receiving the evidence storage request sent by the terminal;
[0125] Obtaining a first evidence block and a corresponding first evidence block hash value according to the evidence storage request, and returning the first evidence block hash value to the terminal;
[0126] Receiving a hash value of an evidence photo corresponding to the evidence photo sent by the terminal, where the evidence photo is an electronic photo obtained by the witness holding a carrier recording the hash value of the first evidence block;
[0127] The hash value of the evidence photo is stored in a second evidence block, where the second evidence block is a block in which the blockchain can store data when the hash value of the evidence photo sent by the terminal is received.
[0128] In one embodiment, the photo hash module is further configured to:
[0129] The first block generation time corresponding to the first evidence block and the second block generation time corresponding to the second evidence block are sent to the terminal; the verification time range includes the time range from the first block generation time to the second block generation time.
[0130] In one embodiment, the first search module 804 is further configured to:
[0131] Starting from the block corresponding to the start time of the verification time range in the blockchain, calculate the hash value of each block corresponding to the start time of the verification time range in sequence, and compare it with the hash value of the first stored evidence block;
[0132] If the calculated hash value of the block is the same as the hash value of the first evidence block, the block will be used as the first evidence block.
[0133] In one embodiment, the second search module 808 is further configured to:
[0134] Starting from the first evidence block, sequentially search for blocks generated after the first evidence block to see if they store the photo hash value;
[0135] The block corresponding to the hash value of the photo is used as the second evidence block, and a result of successful evidence verification is obtained;
[0136] If the block corresponding to the hash value of the photo is not found, the result of evidence verification failure is obtained.
[0137] In one embodiment, the blockchain presence verification device further includes a verification result module for:
[0138] If the first evidence block corresponding to the first evidence hash value is not found according to the verification time range and the first evidence block hash value, a result of evidence verification failure is obtained.
[0139] Each module in the aforementioned blockchain presence verification device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0140] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 9As shown. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device is used 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 the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store hash value data of the evidence photo. The network interface of the computer device is used to communicate with an external terminal via a network connection. When executed by the processor, the computer program implements a blockchain presence verification method.
[0141] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0142] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0143] Receiving a proof verification request sent by a terminal, the proof verification request including a verification time range and a hash value of a first proof block recorded on the photo to be verified;
[0144] According to the verification time range and the hash value of the first evidence block, searching for the first evidence block corresponding to the hash value of the first evidence block;
[0145] If the first evidence storage block is found, receiving the photo hash value of the photo to be verified sent by the terminal;
[0146] According to the first evidence block and the photo hash value, the second evidence block corresponding to the photo hash value is searched to obtain the evidence verification result.
[0147] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0148] Receiving a proof verification request sent by a terminal, the proof verification request including a verification time range and a hash value of a first proof block recorded on the photo to be verified;
[0149] According to the verification time range and the hash value of the first evidence block, searching for the first evidence block corresponding to the hash value of the first evidence block;
[0150] If the first evidence storage block is found, receiving the photo hash value of the photo to be verified sent by the terminal;
[0151] According to the first evidence block and the photo hash value, the second evidence block corresponding to the photo hash value is searched to obtain the evidence verification result.
[0152] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0153] Receiving a proof verification request sent by a terminal, the proof verification request including a verification time range and a hash value of a first proof block recorded on the photo to be verified;
[0154] According to the verification time range and the hash value of the first evidence block, searching for the first evidence block corresponding to the hash value of the first evidence block;
[0155] If the first evidence storage block is found, receiving the photo hash value of the photo to be verified sent by the terminal;
[0156] According to the first evidence block and the photo hash value, the second evidence block corresponding to the photo hash value is searched to obtain the evidence verification result.
[0157] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0158] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0159] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A blockchain presence verification method, characterized in that: The method comprises: A receipt terminal sends a verification request, the verification request including a verification time range and a hash value of a first evidence block recorded on the photo to be verified; the verification time range refers to the time range from the first block generation time of the first evidence block to the second block generation time of the second evidence block; the first evidence block is a block in the blockchain that can store data when the verification request sent by the terminal is received during the evidence storage process; the second evidence block is a block in the blockchain that can store data when the hash value of the evidence photo sent by the terminal is received during the evidence storage process; the evidence photo is an electronic photo obtained by photographing the witness holding a carrier recording the hash value of the first evidence block; According to the verification time range and the hash value of the first evidence block, searching for the first evidence block corresponding to the hash value of the first evidence block; If the first evidence storage block is found, receiving the photo hash value of the photo to be verified sent by the terminal; Starting from the first evidence block, sequentially search for blocks generated after the first evidence block to see if they store the photo hash value; The block corresponding to the hash value of the photo is used as the second evidence block, and an evidence verification result indicating successful evidence verification is obtained; If the block corresponding to the hash value of the photo is not found, the evidence verification result indicating that the evidence verification failed is obtained.
2. The method according to claim 1, characterized in that The second evidence block stores the hash value of the photo in the following manner: Receiving the evidence storage request sent by the terminal; Obtaining a first evidence block and a corresponding first evidence block hash value according to the evidence storage request, and returning the first evidence block hash value to the terminal; Receiving a hash value of the evidence photo corresponding to the evidence photo sent by the terminal; The hash value of the evidence photo is stored in the second evidence block.
3. The method according to claim 2, characterized in that The method of storing the hash value of the photo in the second evidence storage block also includes: Send the first block generation time corresponding to the first evidence block and the second block generation time corresponding to the second evidence block to the terminal.
4. The method according to claim 1, wherein The searching, according to the verification time range and the hash value of the first evidence block, for the first evidence block corresponding to the hash value of the first evidence block includes: Starting from the block corresponding to the start time of the verification time range in the blockchain, calculate the hash value of each block corresponding to the start time of the verification time range in sequence, and compare it with the hash value of the first stored evidence block; If the calculated hash value of the block is the same as the hash value of the first evidence block, the block will be used as the first evidence block.
5. The method according to claim 1, wherein The method further comprises: If the first evidence block corresponding to the hash value of the first evidence block is not found according to the verification time range and the hash value of the first evidence block, a result of evidence verification failure is obtained.
6. The method according to claim 1, wherein The method further comprises: When the evidence verification result is that the evidence verification is successful, a first identifier is sent to the terminal; when the evidence verification result is that the evidence verification fails, a second identifier is sent to the terminal; the first identifier and the second identifier are different.
7. A blockchain presence verification device, characterized in that: The device comprises: A first receiving module is configured to receive a certificate verification request sent by a terminal, the certificate verification request including a verification time range and a hash value of a first certificate block recorded on the photo to be verified; the verification time range refers to a time range from a first block generation time of the first certificate block to a second block generation time of the second certificate block; the first certificate block is a block in the blockchain that can store data upon receiving the certificate request sent by the terminal during the certificate storage process; the second certificate block is a block in the blockchain that can store data upon receiving the hash value of the certificate photo sent by the terminal during the certificate storage process; the certificate photo is an electronic photo obtained by the witness holding a carrier recording the hash value of the first certificate block; A first search module is configured to search for a first evidence block corresponding to the hash value of the first evidence block according to the verification time range and the hash value of the first evidence block; A second receiving module is configured to receive a photo hash value of the photo to be verified sent by the terminal if the first evidence storage block is found; The second search module is used to start from the first evidence block and sequentially search whether the blocks generated after the first evidence block store the photo hash value; use the block corresponding to the photo hash value as the second evidence block to obtain an evidence verification result indicating successful evidence verification; if the block corresponding to the photo hash value is not found, obtain an evidence verification result indicating failed evidence verification.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Evidence verification method and device based on block chain, equipment and storage medium
CN110598478A
Invoice verification method and device, server and storage medium
CN110599207A