CN113919011A - Anti-counterfeiting method of equipment inspection report based on block chain - Google Patents
Anti-counterfeiting method of equipment inspection report based on block chain Download PDFInfo
- Publication number
- CN113919011A CN113919011A CN202111487536.7A CN202111487536A CN113919011A CN 113919011 A CN113919011 A CN 113919011A CN 202111487536 A CN202111487536 A CN 202111487536A CN 113919011 A CN113919011 A CN 113919011A
- Authority
- CN
- China
- Prior art keywords
- data
- verification
- inspection
- private key
- whole network
- 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.)
- Granted
Links
- 238000007689 inspection Methods 0.000 title claims abstract description 203
- 238000000034 method Methods 0.000 title claims abstract description 61
- 238000012795 verification Methods 0.000 claims abstract description 149
- 230000002159 abnormal effect Effects 0.000 claims abstract description 14
- 238000001514 detection method Methods 0.000 claims description 23
- 238000004590 computer program Methods 0.000 claims description 16
- 238000004364 calculation method Methods 0.000 claims description 13
- 238000004891 communication Methods 0.000 claims description 7
- 238000004422 calculation algorithm Methods 0.000 claims description 5
- 238000004806 packaging method and process Methods 0.000 claims description 2
- 239000002131 composite material Substances 0.000 claims 1
- 238000012360 testing method Methods 0.000 abstract description 15
- 238000010586 diagram Methods 0.000 description 10
- 239000000284 extract Substances 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 230000005856 abnormality Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000013075 data extraction Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 230000007774 longterm Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003238 somatosensory effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0861—Generation of secret information including derivation or calculation of cryptographic keys or passwords
- H04L9/0869—Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3236—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
- H04L9/3239—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2151—Time stamp
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Storage Device Security (AREA)
Abstract
本发明提供了一种基于区块链的设备检验报告的防伪方法。该方案包括获取防伪随机数,通过所述防伪随机数和设备检验数据生成一个综合数据,通过加密后获得目标区块数据,在全网进行广播,提取其中的检验数据,并通过发出节点进行私钥加密后将所述检验数据进行在线展示;获取全部的检验数据需求,逐一匹配检验数据展示表;对所述全网广播数据分解拆分,并利用所述接收节点的私钥进行解密,生成随机数明文,判断数据是否存在异常;利用时间戳和数据结构验证正确性;在数据节点发出的私钥验证命令,进行验证。该方案通过对设备检验报告的数据进行在线分区块加密,实现对于设备检验报告的基于全网广播的加密。
The invention provides an anti-counterfeiting method for equipment inspection reports based on block chain. The scheme includes obtaining an anti-counterfeiting random number, generating a comprehensive data through the anti-counterfeiting random number and equipment inspection data, obtaining target block data after encryption, broadcasting it in the whole network, extracting the inspection data, and privately conducting private data through the sending node. After the key is encrypted, the test data is displayed online; all the test data requirements are obtained, and the test data display table is matched one by one; The plaintext of the random number is used to determine whether the data is abnormal; the correctness is verified by the timestamp and data structure; the private key verification command issued by the data node is used for verification. The scheme realizes the encryption of the equipment inspection report based on the whole network broadcast by performing online block encryption on the data of the equipment inspection report.
Description
技术领域technical field
本发明涉及设备检验技术领域,更具体地,涉及一种基于区块链的设备检验报告的防伪方法。The present invention relates to the technical field of equipment inspection, and more particularly, to an anti-counterfeiting method for an equipment inspection report based on a block chain.
背景技术Background technique
设备检验报告是证明设备的性能和设备的功能的文件。目前,现有的设备检验报告作为一种证明文件,是在工业、医疗等多个领域中的必要文件,精确、全面的设备检验报告是保证这些行业的安全、稳定运行的关键。The equipment inspection report is a document that proves the performance of the equipment and the function of the equipment. At present, the existing equipment inspection report, as a kind of certification document, is a necessary document in many fields such as industry and medical treatment. An accurate and comprehensive equipment inspection report is the key to ensure the safe and stable operation of these industries.
在本发明技术之前,设备检验报告的存档形式一般是纸质文件,并通过盖章的方式,进行验证作为直接的证明材料。但是,纸质文件存在诸多不便存放的缺点,也有部分研究考虑采用电子签章的方式用PDF等文件格式进行存储,但是仍然存在电子签章信息泄露后的伪造风险。Before the technology of the present invention, the archive form of the equipment inspection report is generally a paper document, and is verified as a direct proof material by means of a seal. However, paper documents have many shortcomings in inconvenient storage, and some studies consider the use of electronic signatures for storage in PDF and other file formats, but there is still the risk of forgery after the disclosure of electronic signature information.
发明内容SUMMARY OF THE INVENTION
鉴于上述问题,本发明提出了一种基于区块链的设备检验报告的防伪方法,通过对设备检验报告的数据进行在线分区块加密,实现对于设备检验报告的基于全网广播的加密。通过分预设区域上下限的时间戳和双重校验码的联合验证,并在此基础上结合管理员的通信状态的校验,实现联合的可靠性验证,若验证失败则重新发出新的私匙,时刻保证整个区块链系统中的检验报告数据的可靠性。In view of the above problems, the present invention proposes an anti-counterfeiting method for equipment inspection reports based on blockchain, which realizes the encryption of equipment inspection reports based on the whole network broadcasting by performing online block encryption on the data of the equipment inspection reports. Through the joint verification of the time stamp and double check code of the upper and lower limits of the preset area, and on this basis, combined with the verification of the administrator's communication status, the joint reliability verification is realized. If the verification fails, a new private message will be issued again. key to ensure the reliability of inspection report data in the entire blockchain system at all times.
根据本发明实施例第一方面,提供一种基于区块链的设备检验报告的防伪方法。According to the first aspect of the embodiments of the present invention, an anti-counterfeiting method for a device inspection report based on a blockchain is provided.
在一个或多个实施例中,优选地,所述一种基于区块链的设备检验报告的防伪方法包括:In one or more embodiments, preferably, the blockchain-based anti-counterfeiting method for equipment inspection reports includes:
获取防伪随机数,通过所述防伪随机数和设备检验数据生成一个综合数据,通过加密后获得目标区块数据,在全网进行广播;Obtain the anti-counterfeiting random number, generate a comprehensive data through the anti-counterfeiting random number and the equipment inspection data, obtain the target block data after encryption, and broadcast it in the whole network;
获取全部的全网广播,提取其中的检验数据,并通过发出节点进行私钥加密后将所述检验数据进行在线展示;Obtain all the network-wide broadcasts, extract the inspection data, and display the inspection data online after encrypting with the private key by the sending node;
获取全部的检验数据需求,根据检验数据需求对全网广播数据进行划分,逐一匹配检验数据展示表,其中,所述检验数据展示表分类包括检测对象、检测结果、检测流程、检测数据表;Obtain all the inspection data requirements, divide the broadcast data of the whole network according to the inspection data requirements, and match the inspection data display table one by one, wherein the classification of the inspection data display table includes the inspection object, the inspection result, the inspection process, and the inspection data table;
通过接收节点获取所述全网广播数据,并对所述全网广播数据分解拆分,并利用所述接收节点的私钥进行解密,生成随机数明文,生成了第四加密数据,对比所述第四加密数据是否与分解拆分获得的第三加密数据一致,判断数据是否存在异常;Obtain the network-wide broadcast data through the receiving node, decompose and split the network-wide broadcast data, and use the private key of the receiving node to decrypt to generate a random number plaintext, and generate fourth encrypted data. Whether the fourth encrypted data is consistent with the third encrypted data obtained by decomposing and splitting, determine whether the data is abnormal;
从所述全网广播数据中提取新区块的全部数据,并利用时间戳和数据结构验证正确性;Extract all the data of the new block from the whole network broadcast data, and verify the correctness by using the timestamp and the data structure;
根据全部广播网络的在数据节点发出的私钥验证命令,进行验证,当验证无法通过时管理员登入并发放新的私钥。Verification is performed according to the private key verification command issued by the data nodes of all broadcast networks. When the verification fails, the administrator logs in and issues a new private key.
在一个或多个实施例中,优选地,所述获取防伪随机数,通过所述防伪随机数和设备检验数据生成一个综合数据,通过加密后获得目标区块数据,在全网进行广播,具体包括:In one or more embodiments, preferably, the anti-counterfeiting random number is obtained, a comprehensive data is generated by the anti-counterfeiting random number and the device inspection data, the target block data is obtained after encryption, and broadcast on the whole network, specifically include:
随机获取一个防伪随机数和所述设备检验数据,将所述防伪随机数和所述设备检验数据融合为第一区块链数据;Randomly obtain an anti-counterfeiting random number and the device inspection data, and fuse the anti-counterfeiting random number and the device inspection data into the first blockchain data;
对所述第一区块链数据进行Hash加密,获得加密第一区块链数据;Hash encryption is performed on the first blockchain data to obtain encrypted first blockchain data;
对所述防伪随机数利用Hash加密,获得随机加密数据;Hash encryption is used for the anti-counterfeiting random number to obtain random encrypted data;
对所述设备检验数据通过发出节点进行所述私钥加密,生成数据加密第一加密检验数据;Encrypting the device verification data with the private key by the sending node to generate the first encrypted verification data for data encryption;
用接收节点的公钥对所述加密第一区块链数据进行二次加密,生成第二加密检验数据;Perform secondary encryption on the encrypted first blockchain data with the public key of the receiving node to generate second encrypted verification data;
将所述随机加密数据、所述第一区块链数据和所述第二加密检验数据按照顺序合并打包,生成目标区块数据;Combine and package the random encrypted data, the first block chain data and the second encrypted verification data in order to generate target block data;
在全网进行所述目标区块数据的全网广播;Perform network-wide broadcast of the target block data on the entire network;
在接收节点获取所述全网广播数据。The network-wide broadcast data is acquired at the receiving node.
在一个或多个实施例中,优选地,所述获取全部的全网广播,提取其中的检验数据,并通过发出节点进行私钥加密后将所述检验数据进行在线展示,具体包括:In one or more embodiments, preferably, the obtaining of all network-wide broadcasts, extracting the verification data therein, and encrypting the verification data with the private key by the sending node, displaying the verification data online, specifically includes:
获取全部的全网广播的所述目标区块数据;Obtain all the target block data broadcasted by the whole network;
提取所述目标区块数据中的明文数据;extracting plaintext data in the target block data;
对所述明文数据进行数据提取,获取以往记录的每个区块的检验数据;Data extraction is performed on the plaintext data to obtain the inspection data of each block recorded in the past;
在显示屏幕上对所述检验数据进行展示。The inspection data is displayed on a display screen.
在一个或多个实施例中,优选地,所述获取全部的检验数据需求,根据检验数据需求对全网广播数据进行划分,逐一匹配检验数据展示表,其中,所述检验数据展示表分类包括检测对象、检测结果、检测流程、检测数据表,具体包括:In one or more embodiments, preferably, the acquiring all the inspection data requirements, dividing the whole network broadcast data according to the inspection data requirements, and matching the inspection data display tables one by one, wherein the classification of the inspection data display table includes: Test objects, test results, test procedures, and test data sheets, including:
获取全部的检验数据需求,并根据所述检验数据需求进行数据划分,生成至少一个检验数据展示表;Acquire all the inspection data requirements, and divide the data according to the inspection data requirements, and generate at least one inspection data display table;
获取所述检验数据展示表,并根据所述检验数据展示表分类为检测对象、检测结果、检测流程、检测数据表;Obtaining the test data display table, and classifying the test data display table into test objects, test results, test procedures, and test data tables according to the test data display table;
对于所述全网广播数据进行结构划分,逐一匹配所述检验数据展示表,完成数据展示。The structure of the whole network broadcast data is divided, and the inspection data display table is matched one by one to complete the data display.
在一个或多个实施例中,优选地,所述通过所述接收节点获取所述全网广播数据,并对所述全网广播数据分解拆分,并利用所述接收节点的私钥进行解密,生成随机数明文,生成了第四加密数据,对比所述第四加密数据是否与分解拆分获得的第三加密数据一致,判断数据是否存在异常,具体包括:In one or more embodiments, preferably, the network-wide broadcast data is obtained through the receiving node, and the network-wide broadcast data is decomposed and split, and decrypted by using the private key of the receiving node , generate a random number plaintext, generate fourth encrypted data, compare whether the fourth encrypted data is consistent with the third encrypted data obtained by decomposing and splitting, and determine whether the data is abnormal, specifically including:
通过所述接收节点获取所述全网广播数据;Obtain the network-wide broadcast data through the receiving node;
对所述全网广播数据进行分解拆分,获得第一加密数据、第二加密数据和第三加密数据;Decomposing and splitting the whole network broadcast data to obtain first encrypted data, second encrypted data and third encrypted data;
对所述第一加密数据利用所述接收节点的私钥进行解密,生词所述随机数明文;Decrypt the first encrypted data using the private key of the receiving node, and generate the plaintext of the random number;
对于所述第二加密数据利用所述接收节点的私钥进行解密,获得中间加密数据;Decrypt the second encrypted data using the private key of the receiving node to obtain intermediate encrypted data;
对所述中间加密数据利用所述发出节点的公钥进行解密获得所述设备检验数据;Decrypting the intermediate encrypted data using the public key of the sending node to obtain the device verification data;
利用所述设备检验数据和所述随机数明文一起进行Hash算法加密,生成第四加密数据;Utilize the device verification data and the random number plaintext to perform Hash algorithm encryption together to generate fourth encrypted data;
对比所述第三加密数据和所述第四加密数据是否一致,若出现数据不一致,则认为所述设备检验数据存在异常,并发出警告;Comparing whether the third encrypted data and the fourth encrypted data are consistent, if there is data inconsistency, it is considered that the device inspection data is abnormal, and a warning is issued;
在所述第三加密数据和所述第四加密数据一致时,数据不存在异常。When the third encrypted data and the fourth encrypted data are consistent, there is no abnormality in the data.
在一个或多个实施例中,优选地,所述从所述全网广播数据中提取新区块的全部数据,并利用时间戳和数据结构验证正确性,具体包括:In one or more embodiments, preferably, extracting all the data of the new block from the network-wide broadcast data, and verifying the correctness by using a timestamp and a data structure, specifically including:
从所述全网广播数据中输入新区块的全部数据;Input all the data of the new block from the said network-wide broadcast data;
对所述新区块数据进行数据结构校验,确认生成的数据结构是否为预设的结构;Carrying out data structure verification on the new block data to confirm whether the generated data structure is a preset structure;
进行所述新区块的父节点校验,确定生成的所述新区块的父节点是否为预先设置的节点;Carry out the parent node verification of the new block to determine whether the generated parent node of the new block is a preset node;
判断当前新区块的时间戳,判断所述时间戳是否在运行的预设范围,其中,所述预设范围为1小时;Judging the time stamp of the current new block, and judging whether the time stamp is in a running preset range, wherein the preset range is 1 hour;
当所述当前新区块的时间戳在预设范围内同时数据结构为预设的结构时,则区块整体验证正确。When the timestamp of the current new block is within the preset range and the data structure is the preset structure, the block overall verification is correct.
在一个或多个实施例中,优选地,所述根据全部广播网络的在数据节点发出的私钥验证命令,进行验证,当验证无法通过时管理员登入并发放新的私钥,具体包括:In one or more embodiments, preferably, the verification is performed according to the private key verification commands sent by the data nodes of all broadcast networks, and when the verification fails, the administrator logs in and issues a new private key, specifically including:
获取全部的广播网络中的在运数据节点,向各个节点发出私钥验证指令;Obtain all the data nodes in operation in the broadcast network, and issue private key verification instructions to each node;
利用第一计算公式验证所有节点的私钥是否在预设区域上下限内;Use the first calculation formula to verify whether the private keys of all nodes are within the upper and lower limits of the preset area;
当所述私钥满足预设需求时,发出可以正常验证指令,否则发出私钥验证错误;When the private key meets the preset requirements, a normal verification instruction is issued, otherwise, a private key verification error is issued;
当所述私钥验证错误时,仅在满足私钥验证的区域进行新的区块数据的广播,并向未通过私钥验证节点重新发放验证命令;When the verification of the private key is incorrect, the new block data is broadcast only in the area that satisfies the verification of the private key, and the verification command is reissued to the node that does not pass the verification of the private key;
由管理员登入所述未通过私钥验证节点进行所述验证命令的通信校验,当校验不通过时,发出警告并通报整个网络广播;The administrator logs in to the node that fails to pass the private key verification to perform the communication verification of the verification command, and when the verification fails, a warning is issued and the entire network broadcast is notified;
由管理员登入所述未通过私钥验证节点进行所述验证命令的通信校验,当校验通过时,所述管理员利用第二计算公式生成所述未通过私钥验证节点对应的随机私钥;The administrator logs in to the node that fails to pass the private key verification to perform communication verification of the verification command. When the verification passes, the administrator uses the second calculation formula to generate a random private key corresponding to the node that fails to pass the private key verification. key;
所述第一计算公式为:S l <k 1 t+k 2 A+k 3 B<S h The first calculation formula is: S l < k 1 t+k 2 A+k 3 B < S h
其中,S l 为预设区域下限,S h 为预设区域上限,k 1、k 2、k 3依次为第一用户校验系数、第二用户校验系数、第三用户校验系数,t为当前时间戳,A为用户第一校验码,B为用户第二校验码; Wherein, Sl is the lower limit of the preset area, Sh is the upper limit of the preset area, k 1 , k 2 , and k 3 are the first user verification coefficient, the second user verification coefficient, and the third user verification coefficient in sequence, t is the current timestamp, A is the first check code of the user, and B is the second check code of the user;
所述第二计算公式为: The second calculation formula is:
其中,S l 为预设区域下限,S h 为预设区域上限,k 1、k 2、k 3依次为第一用户校验系数、第二用户校验系数、第三用户校验系数,t为当前时间戳,A为用户第一校验码,B为用户第二校验码。 Wherein, Sl is the lower limit of the preset area, Sh is the upper limit of the preset area, k 1 , k 2 , and k 3 are the first user verification coefficient, the second user verification coefficient, and the third user verification coefficient in sequence, t is the current timestamp, A is the user's first check code, and B is the user's second check code.
根据本发明实施例第二方面,提供一种基于区块链的设备检验报告的防伪系统。According to the second aspect of the embodiments of the present invention, an anti-counterfeiting system for a device inspection report based on a blockchain is provided.
在一个或多个实施例中,优选地,所述一种基于区块链的设备检验报告的防伪系统包括:In one or more embodiments, preferably, the blockchain-based anti-counterfeiting system for equipment inspection reports includes:
检验数据加密存储模块,用于获取防伪随机数,通过所述防伪随机数和设备检验数据生成一个综合数据,通过加密后获得目标区块数据,在全网进行广播;The verification data encryption storage module is used to obtain the anti-counterfeiting random number, generate a comprehensive data through the anti-counterfeiting random number and the equipment verification data, obtain the target block data after encryption, and broadcast it in the whole network;
检验数据查看模块,用于获取全部的全网广播,提取其中的检验数据,并通过发出节点进行私钥加密后将所述检验数据进行在线展示;The inspection data viewing module is used to obtain all the network-wide broadcasts, extract the inspection data, and display the inspection data online after encrypting with the private key by the sending node;
检验数据查询模块,用于获取全部的检验数据需求,根据检验数据需求对全网广播数据进行划分,逐一匹配检验数据展示表,其中,所述检验数据展示表分类包括检测对象、检测结果、检测流程、检测数据表;The inspection data query module is used to obtain all the inspection data requirements, divide the broadcast data of the whole network according to the inspection data requirements, and match the inspection data display table one by one, wherein, the classification of the inspection data display table includes the inspection object, the inspection result, the inspection Process, test data sheet;
检验数据解码验证模块,用于通过接收节点获取所述全网广播数据,并对所述全网广播数据分解拆分,并利用所述接收节点的私钥进行解密,生成随机数明文,生成了第四加密数据,对比所述第四加密数据是否与分解拆分获得的第三加密数据一致,判断数据是否存在异常;The verification data decoding and verification module is used to obtain the broadcast data of the whole network through the receiving node, decompose and split the broadcast data of the whole network, and use the private key of the receiving node to decrypt, generate a random number plaintext, and generate a Fourth encrypted data, compare whether the fourth encrypted data is consistent with the third encrypted data obtained by decomposing and splitting, and determine whether the data is abnormal;
检验数据统计模块,用于从所述全网广播数据中提取新区块的全部数据,并利用时间戳和数据结构验证正确性;A verification data statistics module is used to extract all the data of the new block from the whole network broadcast data, and verify the correctness by using the timestamp and the data structure;
用户设置模块,用于根据全部广播网络的在数据节点发出的私钥验证命令,进行验证,当验证无法通过时管理员登入并发放新的私钥。The user setting module is used for verification according to the private key verification command issued by the data node of all broadcast networks. When the verification fails, the administrator logs in and issues a new private key.
根据本发明实施例第三方面,提供一种计算机可读存储介质,其上存储计算机程序指令,所述计算机程序指令在被处理器执行时实现如本发明实施例第一方面中任一项所述的方法。According to a third aspect of the embodiments of the present invention, there is provided a computer-readable storage medium on which computer program instructions are stored, and when executed by a processor, the computer program instructions implement any one of the first aspect of the embodiments of the present invention. method described.
根据本发明实施例第四方面,提供一种电子设备,包括存储器和处理器,所述存储器用于存储一条或多条计算机程序指令,其中,所述一条或多条计算机程序指令被所述处理器执行以实现本发明实施例第一方面中任一项所述的方法。According to a fourth aspect of an embodiment of the present invention, an electronic device is provided, including a memory and a processor, the memory being used to store one or more computer program instructions, wherein the one or more computer program instructions are processed by the processing to implement the method described in any one of the first aspect of the embodiments of the present invention.
本发明的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:
1)在本发明实施例中,通过hash算法和随机数进行加密,生成了设备检验报告的防伪加密数据,并将此数据作为目标区块数据;1) In the embodiment of the present invention, the hash algorithm and random number are used for encryption to generate the anti-counterfeiting encrypted data of the equipment inspection report, and this data is used as the target block data;
2)在本发明实施例中,通过检验数据的在线的校验,完成对于全部的广播后的数据为信息验证,确保区块形成后的可靠性;2) In the embodiment of the present invention, through the online verification of the inspection data, complete the information verification for all the data after the broadcast, and ensure the reliability after the block is formed;
3)在本发明实施例中,通过保证用户的可靠性验证,保证整个方法和系统中仅存在检验数据。3) In the embodiment of the present invention, by ensuring the reliability verification of the user, it is ensured that only inspection data exists in the entire method and system.
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Other features and advantages of the present invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description, claims, and drawings.
下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solutions of the present invention will be further described in detail below through the accompanying drawings and embodiments.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
图1是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法的流程图。FIG. 1 is a flowchart of an anti-counterfeiting method for a device inspection report based on a blockchain according to an embodiment of the present invention.
图2是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的获取防伪随机数,通过所述防伪随机数和设备检验数据生成一个综合数据,通过加密后获得目标区块数据,在全网进行广播的流程图。FIG. 2 is a block chain-based device inspection report anti-counterfeiting method for obtaining an anti-counterfeiting random number according to an embodiment of the present invention, generating a comprehensive data through the anti-counterfeiting random number and device inspection data, and obtaining a target area after encryption. Block data, the flow chart of broadcasting in the whole network.
图3是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的获取全部的全网广播,提取其中的检验数据,并通过发出节点进行私钥加密后将所述检验数据进行在线展示的流程图。Fig. 3 is an embodiment of the present invention, in an anti-counterfeiting method for a device inspection report based on a blockchain, obtaining all the whole network broadcasts, extracting the inspection data, and encrypting the inspection by the sending node after the private key is encrypted Flowchart for online presentation of data.
图4是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的获取全部的检验数据需求,根据检验数据需求对全网广播数据进行划分,逐一匹配检验数据展示表,其中,所述检验数据展示表分类包括检测对象、检测结果、检测流程、检测数据表的流程图。4 is a block chain-based device inspection report anti-counterfeiting method according to an embodiment of the present invention to obtain all the inspection data requirements, divide the whole network broadcast data according to the inspection data requirements, and match the inspection data display table one by one, Wherein, the classification of the inspection data display table includes the inspection object, the inspection result, the inspection process, and the flow chart of the inspection data table.
图5是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的通过接收节点获取所述全网广播数据,并对所述全网广播数据分解拆分,并利用所述接收节点的私钥进行解密,生成随机数明文,生成了第四加密数据,对比所述第四加密数据是否与分解拆分获得的第三加密数据一致,判断数据是否存在异常的流程图。FIG. 5 is a block chain-based device inspection report anti-counterfeiting method according to an embodiment of the present invention, in which the network-wide broadcast data is obtained through a receiving node, and the network-wide broadcast data is decomposed and split, and the The private key of the receiving node is decrypted, the random number plaintext is generated, the fourth encrypted data is generated, the flow chart of judging whether the data is abnormal is compared by comparing whether the fourth encrypted data is consistent with the third encrypted data obtained by decomposing and splitting.
图6是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的从所述全网广播数据中提取新区块的全部数据,并利用时间戳和数据结构验证正确性的流程图。6 is a block chain-based device inspection report anti-counterfeiting method according to an embodiment of the present invention, which extracts all the data of the new block from the whole network broadcast data, and uses the timestamp and the data structure to verify the correctness flow chart.
图7是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的根据全部广播网络的在数据节点发出的私钥验证命令,进行验证,当验证无法通过时管理员登入并发放新的私钥的流程图。7 is a block chain-based device inspection report anti-counterfeiting method according to an embodiment of the present invention, according to the private key verification command issued by the data nodes of all broadcast networks, to verify, when the verification fails, the administrator logs in And the flow chart of issuing a new private key.
图8是本发明一个实施例的一种基于区块链的设备检验报告的防伪系统的结构图。FIG. 8 is a structural diagram of an anti-counterfeiting system based on a blockchain-based equipment inspection report according to an embodiment of the present invention.
图9是本发明一个实施例中一种电子设备的结构图。FIG. 9 is a structural diagram of an electronic device in an embodiment of the present invention.
具体实施方式Detailed ways
在本发明的说明书和权利要求书及上述附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如101、102等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。In some of the processes described in the description and claims of the present invention and the above-mentioned drawings, various operations are included in a specific order, but it should be clearly understood that these operations may not be in accordance with the order in which they appear herein. For execution or parallel execution, the sequence numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. Additionally, these flows may include more or fewer operations, and these operations may be performed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit "first" and "second" are different types.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
设备检验报告是证明设备的性能和设备的功能的文件。目前,现有的设备检验报告作为一种证明文件,是在工业、医疗等多个领域中的必要文件,精确、全面的设备检验报告是保证这些行业的安全、稳定运行的关键。The equipment inspection report is a document that proves the performance of the equipment and the function of the equipment. At present, the existing equipment inspection report, as a kind of certification document, is a necessary document in many fields such as industry and medical treatment. An accurate and comprehensive equipment inspection report is the key to ensure the safe and stable operation of these industries.
在本发明技术之前,设备检验报告的存档形式一般是纸质文件,并通过盖章的方式,进行验证作为直接的证明材料。但是,纸质文件存在诸多不便存放的缺点,也有部分研究考虑采用电子签章的方式用PDF等文件格式进行存储,但是仍然存在电子签章信息泄露后的伪造风险。Before the technology of the present invention, the archive form of the equipment inspection report is generally a paper document, and is verified as a direct proof material by means of a seal. However, paper documents have many shortcomings in inconvenient storage, and some studies consider the use of electronic signatures for storage in PDF and other file formats, but there is still the risk of forgery after the disclosure of electronic signature information.
本发明实施例中,提供了一种基于区块链的设备检验报告的防伪方法。该方案通过对设备检验报告的数据进行在线分区块加密,实现对于设备检验报告的基于全网广播的加密。In the embodiment of the present invention, an anti-counterfeiting method for a device inspection report based on a blockchain is provided. The scheme realizes the encryption of the equipment inspection report based on the whole network broadcast by performing online block encryption on the data of the equipment inspection report.
根据本发明实施例第一方面,提供一种基于区块链的设备检验报告的防伪方法。According to the first aspect of the embodiments of the present invention, an anti-counterfeiting method for a device inspection report based on a blockchain is provided.
图1是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法的流程图。FIG. 1 is a flowchart of an anti-counterfeiting method for a device inspection report based on a blockchain according to an embodiment of the present invention.
如图1所示,在一个或多个实施例中,优选地,所述一种基于区块链的设备检验报告的防伪方法包括:As shown in FIG. 1, in one or more embodiments, preferably, the anti-counterfeiting method based on a blockchain-based equipment inspection report includes:
S101、获取防伪随机数,通过所述防伪随机数和设备检验数据生成一个综合数据,通过加密后获得目标区块数据,在全网进行广播;S101. Obtain an anti-counterfeiting random number, generate a comprehensive data by using the anti-counterfeiting random number and equipment inspection data, obtain target block data after encryption, and broadcast it on the entire network;
S102、获取全部的全网广播,提取其中的检验数据,并通过发出节点进行私钥加密后将所述检验数据进行在线展示;S102, obtaining all the network-wide broadcasts, extracting the inspection data therein, and encrypting the inspection data with the private key by the sending node and displaying the inspection data online;
S103、获取全部的检验数据需求,根据检验数据需求对全网广播数据进行划分,逐一匹配检验数据展示表,其中,所述检验数据展示表分类包括检测对象、检测结果、检测流程、检测数据表;S103. Acquire all the inspection data requirements, divide the broadcast data of the entire network according to the inspection data requirements, and match the inspection data display tables one by one, wherein the classification of the inspection data display table includes the inspection object, the inspection result, the inspection process, and the inspection data table. ;
S104、通过接收节点获取所述全网广播数据,并对所述全网广播数据分解拆分,并利用所述接收节点的私钥进行解密,生成随机数明文,生成了第四加密数据,对比所述第四加密数据是否与分解拆分获得的第三加密数据一致,判断数据是否存在异常;S104. Obtain the network-wide broadcast data through the receiving node, decompose and split the network-wide broadcast data, and decrypt using the private key of the receiving node to generate a random number plaintext, generate fourth encrypted data, and compare Whether the fourth encrypted data is consistent with the third encrypted data obtained by decomposing and splitting, it is judged whether the data is abnormal;
S105、从所述全网广播数据中提取新区块的全部数据,并利用时间戳和数据结构验证正确性;S105, extracting all the data of the new block from the whole network broadcast data, and verifying the correctness by using the timestamp and the data structure;
S106、根据全部广播网络的在数据节点发出的私钥验证命令,进行验证,当验证无法通过时管理员登入并发放新的私钥。S106 , perform verification according to the private key verification commands issued by the data nodes of all broadcast networks, and when the verification fails, the administrator logs in and issues a new private key.
在本发明实施例中,通过区块链数据进行设备检验报告的加密工作,并根据加密数据通过解密获得随机数据进行数据一致性的校验,进而在全网进行广播,完成整个区块链数据的在线验证。当出现额外的数据异常时,通过此方式可以有效保障整个系统的设备检验报告的安全性。In the embodiment of the present invention, the encryption of the equipment inspection report is performed through blockchain data, and random data is obtained through decryption according to the encrypted data to perform data consistency verification, and then broadcast on the entire network to complete the entire blockchain data. online verification. When additional data anomalies occur, this method can effectively ensure the security of the equipment inspection report of the entire system.
图2是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的获取防伪随机数,通过所述防伪随机数和设备检验数据生成一个综合数据,通过加密后获得目标区块数据,在全网进行广播的流程图。FIG. 2 is a block chain-based device inspection report anti-counterfeiting method for obtaining an anti-counterfeiting random number according to an embodiment of the present invention, generating a comprehensive data through the anti-counterfeiting random number and device inspection data, and obtaining a target area after encryption. Block data, the flow chart of broadcasting in the whole network.
如图2所示,在一个或多个实施例中,优选地,所述获取防伪随机数,通过所述防伪随机数和设备检验数据生成一个综合数据,通过加密后获得目标区块数据,在全网进行广播,具体包括:As shown in FIG. 2, in one or more embodiments, preferably, the obtaining of the anti-counterfeiting random number, generating a comprehensive data through the anti-counterfeiting random number and the device inspection data, and obtaining the target block data after encryption, Broadcast on the entire network, including:
S201、随机获取一个防伪随机数和所述设备检验数据,将所述防伪随机数和所述设备检验数据融合为第一区块链数据;S201. Randomly obtain an anti-counterfeiting random number and the device inspection data, and fuse the anti-counterfeiting random number and the device inspection data into first blockchain data;
S202、对所述第一区块链数据进行Hash加密,获得加密第一区块链数据;S202, performing Hash encryption on the first blockchain data to obtain encrypted first blockchain data;
S203、对所述防伪随机数利用Hash加密,获得随机加密数据;S203, using Hash encryption on the anti-counterfeiting random number to obtain random encrypted data;
S204、对所述设备检验数据通过发出节点进行所述私钥加密,生成数据加密第一加密检验数据;S204, encrypting the device verification data with the private key by the sending node, and generating data encryption first encrypted verification data;
S205、用接收节点的公钥对所述加密第一区块链数据进行二次加密,生成第二加密检验数据;S205, performing secondary encryption on the encrypted first blockchain data with the public key of the receiving node to generate second encrypted verification data;
S206、将所述随机加密数据、所述第一区块链数据和所述第二加密检验数据按照顺序合并打包,生成目标区块数据;S206, combining and packaging the random encrypted data, the first blockchain data and the second encrypted verification data in order to generate target block data;
S207、在全网进行所述目标区块数据的全网广播;S207, performing network-wide broadcast of the target block data on the entire network;
S208、在接收节点获取所述全网广播数据。S208: Acquire the network-wide broadcast data at the receiving node.
在本发明实施例中,通过一个防伪随机数和对设备检验数据生成加密第一区块块链数据,并且分别通过三个方面进行加密,生成一个全网广播数据,这个全网广播数据为目标区块数据。In the embodiment of the present invention, the encrypted first block chain data is generated through an anti-counterfeiting random number and device inspection data, and encrypted through three aspects respectively to generate a network-wide broadcast data, and this network-wide broadcast data is the target block data.
图3是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的获取全部的全网广播,提取其中的检验数据,并通过发出节点进行私钥加密后将所述检验数据进行在线展示的流程图。Fig. 3 is an embodiment of the present invention, in an anti-counterfeiting method for a device inspection report based on a blockchain, obtaining all the whole network broadcasts, extracting the inspection data, and encrypting the inspection by the sending node after the private key is encrypted Flow chart for online presentation of data.
如图3所示,在一个或多个实施例中,优选地,所述获取全部的全网广播,提取其中的检验数据,并通过发出节点进行私钥加密后将所述检验数据进行在线展示,具体包括:As shown in FIG. 3 , in one or more embodiments, preferably, the acquisition of all network-wide broadcasts is performed, the verification data therein is extracted, and the verification data is displayed online after encryption by the sending node with the private key. , including:
S301、获取全部的全网广播的所述目标区块数据;S301, obtain all the target block data broadcasted by the whole network;
S302、提取所述目标区块数据中的明文数据;S302, extracting plaintext data in the target block data;
S303、对所述明文数据进行数据提取,获取以往记录的每个区块的检验数据;S303, performing data extraction on the plaintext data to obtain the inspection data of each block recorded in the past;
S304、在显示屏幕上对所述检验数据进行展示。S304, displaying the inspection data on the display screen.
在本发明实施例中,当存在数据已经被全网广播并确认,则在查询过程中可以直接调取,对于未被广播的数据,无法完成数据的在线展示。In the embodiment of the present invention, when the existing data has been broadcast and confirmed by the whole network, it can be directly retrieved during the query process. For the data that has not been broadcast, the online display of the data cannot be completed.
图4是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的获取全部的检验数据需求,根据检验数据需求对全网广播数据进行划分,逐一匹配检验数据展示表,其中,所述检验数据展示表分类包括检测对象、检测结果、检测流程、检测数据表的流程图。4 is a block chain-based device inspection report anti-counterfeiting method according to an embodiment of the present invention to obtain all the inspection data requirements, divide the whole network broadcast data according to the inspection data requirements, and match the inspection data display table one by one, Wherein, the classification of the inspection data display table includes the inspection object, the inspection result, the inspection process, and the flow chart of the inspection data table.
如图4所示,在一个或多个实施例中,优选地,所述获取全部的检验数据需求,根据检验数据需求对全网广播数据进行划分,逐一匹配检验数据展示表,其中,所述检验数据展示表分类包括检测对象、检测结果、检测流程、检测数据表,具体包括:As shown in FIG. 4 , in one or more embodiments, preferably, in the process of acquiring all the inspection data requirements, the whole network broadcast data is divided according to the inspection data requirements, and the inspection data presentation tables are matched one by one, wherein the said The classification of inspection data display table includes inspection object, inspection result, inspection process and inspection data table, including:
S401、获取全部的检验数据需求,并根据所述检验数据需求进行数据划分,生成至少一个检验数据展示表;S401. Obtain all inspection data requirements, and perform data division according to the inspection data requirements, and generate at least one inspection data display table;
S402、获取所述检验数据展示表,并根据所述检验数据展示表分类为检测对象、检测结果、检测流程、检测数据表;S402, obtaining the inspection data presentation table, and classifying the inspection data presentation table into a detection object, a detection result, a detection process, and a detection data table according to the inspection data presentation table;
S403、对于所述全网广播数据进行结构划分,逐一匹配所述检验数据展示表,完成数据展示。S403. Perform structure division on the network-wide broadcast data, match the inspection data display table one by one, and complete the data display.
在本发明实施例中,对于设备检测数据不能仅通过数据表进行获取,尚需要根据检验数据的形式进行查询,获得针对性数据,而并非时生数据,无法展示。In the embodiment of the present invention, the device detection data cannot be obtained only through the data table, but also needs to be queried according to the form of the inspection data to obtain the targeted data, not the time-generated data, which cannot be displayed.
图5是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的通过接收节点获取所述全网广播数据,并对所述全网广播数据分解拆分,并利用所述接收节点的私钥进行解密,生成随机数明文,生成了第四加密数据,对比所述第四加密数据是否与分解拆分获得的第三加密数据一致,判断数据是否存在异常的流程图。FIG. 5 is a block chain-based device inspection report anti-counterfeiting method according to an embodiment of the present invention, in which the network-wide broadcast data is obtained through a receiving node, and the network-wide broadcast data is decomposed and split, and the The private key of the receiving node is decrypted, the random number plaintext is generated, the fourth encrypted data is generated, the flow chart of judging whether the data is abnormal by comparing whether the fourth encrypted data is consistent with the third encrypted data obtained by decomposing and splitting.
如图5所示,在一个或多个实施例中,优选地,所述通过所述接收节点获取所述全网广播数据,并对所述全网广播数据分解拆分,并利用接收节点的私钥进行解密,生成随机数明文,生成了第四加密数据,对比所述第四加密数据是否与分解拆分获得的第三加密数据一致,判断数据是否存在异常,具体包括:As shown in FIG. 5 , in one or more embodiments, preferably, the network-wide broadcast data is acquired through the receiving node, and the network-wide broadcast data is decomposed and split, and the receiving node’s The private key is decrypted, the random number plaintext is generated, the fourth encrypted data is generated, and whether the fourth encrypted data is consistent with the third encrypted data obtained by decomposing and splitting is compared to determine whether the data is abnormal, specifically including:
S501、通过所述接收节点获取所述全网广播数据;S501. Acquire the network-wide broadcast data through the receiving node;
S502、对所述全网广播数据进行分解拆分,获得第一加密数据、第二加密数据和第三加密数据;S502, decomposing and splitting the network-wide broadcast data to obtain first encrypted data, second encrypted data and third encrypted data;
S503、对所述第一加密数据利用所述接收节点的私钥进行解密,生词所述随机数明文;S503, decrypt the first encrypted data using the private key of the receiving node, and generate the plaintext of the random number;
S504、对于所述第二加密数据利用所述接收节点的私钥进行解密,获得中间加密数据;S504, decrypt the second encrypted data using the private key of the receiving node to obtain intermediate encrypted data;
S505、对所述中间加密数据利用所述发出节点的公钥进行解密获得所述设备检验数据;S505, decrypt the intermediate encrypted data using the public key of the sending node to obtain the device verification data;
S506、利用所述设备检验数据和所述随机数明文一起进行Hash算法加密,生成第四加密数据;S506, using the device verification data and the random number plaintext to perform Hash algorithm encryption together to generate fourth encrypted data;
S507、对比所述第三加密数据和所述第四加密数据是否一致,若出现数据不一致,则认为所述设备检验数据存在异常,并发出警告;S507, comparing whether the third encrypted data and the fourth encrypted data are consistent, if there is data inconsistency, it is considered that the device inspection data is abnormal, and a warning is issued;
S508、在所述第三加密数据和所述第四加密数据一致时,数据不存在异常。S508. When the third encrypted data is consistent with the fourth encrypted data, there is no abnormality in the data.
在本发明实施中,通过对全网广播数据的分解拆分,此次的拆分过程中,将会产生第一加密数据、第二加密数据和第三加密数据。其中,第一加密数据是最初的一段数据,这段数据的长度将会固定。第二加密数据是用于实际使用的检验数据,这使得最终获得数据第三加密数据进行对比可以判断,此数据是否为广播方面和接收方面对应的数据。In the implementation of the present invention, the first encrypted data, the second encrypted data and the third encrypted data will be generated in this splitting process by decomposing and splitting the broadcast data of the whole network. The first encrypted data is the first piece of data, and the length of this piece of data will be fixed. The second encrypted data is the verification data for actual use, which makes it possible to compare the finally obtained data with the third encrypted data to determine whether the data corresponds to the broadcasting aspect and the receiving aspect.
图6是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的从所述全网广播数据中提取新区块的全部数据,并利用时间戳和数据结构验证正确性的流程图。6 is a block chain-based device inspection report anti-counterfeiting method according to an embodiment of the present invention, which extracts all the data of the new block from the whole network broadcast data, and uses the timestamp and the data structure to verify the correctness flow chart.
如图6所示,在一个或多个实施例中,优选地,所述从所述全网广播数据中提取新区块的全部数据,并利用时间戳和数据结构验证正确性,具体包括:As shown in FIG. 6, in one or more embodiments, preferably, the whole data of the new block is extracted from the whole network broadcast data, and the correctness is verified by using the timestamp and the data structure, which specifically includes:
S601、从所述全网广播数据中输入新区块的全部数据;S601, input all data of new block from described whole network broadcast data;
S602、对所述新区块数据进行数据结构校验,确认生成的数据结构是否为预设的结构;S602, performing data structure verification on the new block data, and confirming whether the generated data structure is a preset structure;
S603、进行所述新区块的父节点校验,确定生成的所述新区块的父节点是否为预先设置的节点;S603, perform the parent node verification of the new block, and determine whether the generated parent node of the new block is a preset node;
S604、判断当前新区块的时间戳,判断所述时间戳是否在运行的预设范围,其中,所述预设范围为1小时;S604, judging the timestamp of the current new block, and judging whether the timestamp is in a running preset range, wherein the preset range is 1 hour;
S605、当所述当前新区块的时间戳在预设范围内同时数据结构为预设的结构时,则区块整体验证正确。S605. When the timestamp of the current new block is within a preset range and the data structure is a preset structure, the block overall verification is correct.
本发明实施例中,对于全网广播的数据进行了在线的校验,校验内容主要是对于时间戳的校验,若生成的时间戳过久,则认为检验数据统计存在丢失或无法算出的风险。其次,对于数据的格式和是否为前一个父节点生成方面的校验。校验成功后,则认为全部的数据在全网广播时,时间产生的都是有效数据。In the embodiment of the present invention, online verification is performed on the data broadcasted on the whole network, and the verification content is mainly the verification of the timestamp. If the generated timestamp is too long, it is considered that the statistics of the verification data are lost or cannot be calculated. risk. Second, check the format of the data and whether it was generated for the previous parent node. After the verification is successful, it is considered that when all the data is broadcast on the entire network, the time generated is valid data.
图7是本发明一个实施例的一种基于区块链的设备检验报告的防伪方法中的根据全部广播网络的在数据节点发出的私钥验证命令,进行验证,当验证无法通过时管理员登入并发放新的私钥的流程图。7 is a block chain-based device inspection report anti-counterfeiting method according to an embodiment of the present invention, according to the private key verification command issued by the data nodes of all broadcast networks, to verify, when the verification fails, the administrator logs in And the flow chart of issuing a new private key.
如图7所示,在一个或多个实施例中,优选地,所述根据全部广播网络的在数据节点发出的私钥验证命令,进行验证,当验证无法通过时管理员登入并发放新的私钥,具体包括:As shown in FIG. 7 , in one or more embodiments, preferably, the verification is performed according to the private key verification commands issued by the data nodes of all broadcast networks, and when the verification fails, the administrator logs in and issues a new one. Private key, including:
S701、获取全部的广播网络中的在运数据节点,向各个节点发出私钥验证指令;S701. Acquire all the data nodes in operation in the broadcast network, and issue a private key verification instruction to each node;
S702、利用第一计算公式验证所有节点的私钥是否在预设区域上下限内;S702, using the first calculation formula to verify whether the private keys of all nodes are within the upper and lower limits of the preset area;
S703、当所述私钥满足预设需求时,发出可以正常验证指令,否则发出私钥验证错误;S703, when the private key meets the preset requirement, issue a normal verification instruction, otherwise issue a private key verification error;
S704、当所述私钥验证错误时,仅在满足私钥验证的区域进行新的区块数据的广播,并向未通过私钥验证节点重新发放验证命令;S704, when the private key verification is wrong, only broadcast the new block data in the area that satisfies the private key verification, and reissue the verification command to the node that fails to pass the private key verification;
S705、由管理员登入所述未通过私钥验证节点进行所述验证命令的通信校验,当校验不通过时,发出警告并通报整个网络广播;S705, the administrator logs in to the node that fails to pass the private key verification to perform the communication verification of the verification command, and when the verification fails, issue a warning and notify the entire network broadcast;
S706、由管理员登入所述未通过私钥验证节点进行所述验证命令的通信校验,当校验通过时,所述管理员利用第二计算公式生成所述未通过私钥验证节点对应的随机私钥;S706. The administrator logs in to the node that fails to pass the private key verification to perform communication verification of the verification command. When the verification passes, the administrator uses the second calculation formula to generate the corresponding data of the node that fails to pass the private key verification. random private key;
所述第一计算公式为:S l <k 1 t+k 2 A+k 3 B<S h The first calculation formula is: S l < k 1 t+k 2 A+k 3 B < S h
其中,S l 为预设区域下限,S h 为预设区域上限,k 1、k 2、k 3依次为第一用户校验系数、第二用户校验系数、第三用户校验系数,t为当前时间戳,A为用户第一校验码,B为用户第二校验码; Wherein, Sl is the lower limit of the preset area, Sh is the upper limit of the preset area, k 1 , k 2 , and k 3 are the first user verification coefficient, the second user verification coefficient, and the third user verification coefficient in sequence, t is the current timestamp, A is the first check code of the user, and B is the second check code of the user;
所述第二计算公式为: The second calculation formula is:
其中,S l 为预设区域下限,S h 为预设区域上限,k 1、k 2、k 3依次为第一用户校验系数、第二用户校验系数、第三用户校验系数,t为当前时间戳,A为用户第一校验码,B为用户第二校验码。 Wherein, Sl is the lower limit of the preset area, Sh is the upper limit of the preset area, k 1 , k 2 , and k 3 are the first user verification coefficient, the second user verification coefficient, and the third user verification coefficient in sequence, t is the current timestamp, A is the user's first check code, and B is the user's second check code.
在确定各个区块中的广播节点是否正确过程中,通过第一计算公式判断了具体的各自的私匙是否为预先设定的格式,当验证通过后,则继续对于无法直接通过校验的数据重新进行设置,确保在长期运行过程中任然能够抑制保存广播节点是始终可以通过验证的。In the process of determining whether the broadcast nodes in each block are correct, the first calculation formula is used to determine whether the specific private keys are in the preset format. After the verification is passed, the data that cannot directly pass the verification will be processed. Reconfigure the settings to ensure that it is always verifiable to suppress the save broadcast node during long-term operation.
根据本发明实施例第二方面,提供一种基于区块链的设备检验报告的防伪系统。According to the second aspect of the embodiments of the present invention, an anti-counterfeiting system for a device inspection report based on a blockchain is provided.
图8是本发明一个实施例的一种基于区块链的设备检验报告的防伪系统的结构图。FIG. 8 is a structural diagram of an anti-counterfeiting system based on a blockchain-based equipment inspection report according to an embodiment of the present invention.
如图8所示,在一个或多个实施例中,优选地,所述一种基于区块链的设备检验报告的防伪系统包括:As shown in FIG. 8 , in one or more embodiments, preferably, the anti-counterfeiting system based on a blockchain-based equipment inspection report includes:
检验数据加密存储模块801,用于获取防伪随机数,通过所述防伪随机数和设备检验数据生成一个综合数据,通过加密后获得目标区块数据,在全网进行广播;The verification data encryption storage module 801 is used to obtain the anti-counterfeiting random number, generate a comprehensive data through the anti-counterfeiting random number and the equipment verification data, obtain the target block data after encryption, and broadcast it on the whole network;
检验数据查看模块802,用于获取全部的全网广播,提取其中的检验数据,并通过发出节点进行私钥加密后将所述检验数据进行在线展示;The inspection data viewing module 802 is used to obtain all the whole network broadcasts, extract the inspection data therein, and display the inspection data online after encrypting with the private key by the sending node;
检验数据查询模块803,用于获取全部的检验数据需求,根据检验数据需求对全网广播数据进行划分,逐一匹配检验数据展示表,其中,所述检验数据展示表分类包括检测对象、检测结果、检测流程、检测数据表;The inspection data query module 803 is used to obtain all the inspection data requirements, divide the broadcast data of the whole network according to the inspection data requirements, and match the inspection data display tables one by one, wherein, the classification of the inspection data display table includes detection objects, detection results, Testing process, testing data sheet;
检验数据解码验证模块804,用于通过接收节点获取所述全网广播数据,并对所述全网广播数据分解拆分,并利用所述接收节点的私钥进行解密,生成随机数明文,生成了第四加密数据,对比所述第四加密数据是否与分解拆分获得的第三加密数据一致,判断数据是否存在异常;The verification data decoding and verification module 804 is configured to obtain the network-wide broadcast data through the receiving node, decompose and split the network-wide broadcast data, and use the private key of the receiving node to decrypt, generate a random number plaintext, and generate The fourth encrypted data is compared, and whether the fourth encrypted data is consistent with the third encrypted data obtained by decomposing and splitting is compared, and whether there is an abnormality in the data is judged;
检验数据统计模块805,用于从所述全网广播数据中提取新区块的全部数据,并利用时间戳和数据结构验证正确性;The verification data statistics module 805 is used to extract all the data of the new block from the whole network broadcast data, and verify the correctness by using the timestamp and the data structure;
用户设置模块806,用于根据全部广播网络的在数据节点发出的私钥验证命令,进行验证,当验证无法通过时管理员登入并发放新的私钥。The user setting module 806 is configured to perform verification according to the private key verification commands issued by the data nodes of all broadcast networks, and when the verification fails, the administrator logs in and issues a new private key.
根据本发明实施例第三方面,提供一种计算机可读存储介质,其上存储计算机程序指令,所述计算机程序指令在被处理器执行时实现如本发明实施例第一方面中任一项所述的方法。According to a third aspect of the embodiments of the present invention, there is provided a computer-readable storage medium on which computer program instructions are stored, and when executed by a processor, the computer program instructions implement any one of the first aspect of the embodiments of the present invention. method described.
根据本发明实施例第四方面,提供一种电子设备。图9是本发明一个实施例中一种电子设备的结构图。图9所示的电子设备为通用设备检验报告防伪装置,其包括通用的计算机硬件结构,其至少包括处理器901和存储器902。处理器901和存储器902通过总线903连接。存储器902适于存储处理器901可执行的指令或程序。处理器901可以是独立的微处理器,也可以是一个或者多个微处理器集合。由此,处理器901通过执行存储器902所存储的指令,从而执行如上所述的本发明实施例的方法流程实现对于数据的处理和对于其它装置的控制。总线903将上述多个组件连接在一起,同时将上述组件连接到显示控制器904和显示装置以及输入/输出(I/O)装置905。输入/输出(I/O)装置905可以是鼠标、键盘、调制解调器、网络接口、触控输入装置、体感输入装置、打印机以及本领域公知的其他装置。典型地,输入/输出装置905通过输入/输出(I/O)控制器906与系统相连。According to a fourth aspect of the embodiments of the present invention, an electronic device is provided. FIG. 9 is a structural diagram of an electronic device in an embodiment of the present invention. The electronic device shown in FIG. 9 is a general device inspection report anti-counterfeiting device, which includes a general computer hardware structure, which at least includes a processor 901 and a memory 902 . The processor 901 and the memory 902 are connected by a bus 903 . Memory 902 is adapted to store instructions or programs executable by processor 901 . The processor 901 may be an independent microprocessor, or may be a set of one or more microprocessors. Thus, the processor 901 executes the instructions stored in the memory 902 to execute the above-described method flow of the embodiments of the present invention to process data and control other devices. The bus 903 connects the above-mentioned various components together, while connecting the above-mentioned components to the display controller 904 and the display device and input/output (I/O) device 905 . The input/output (I/O) device 905 may be a mouse, a keyboard, a modem, a network interface, a touch input device, a somatosensory input device, a printer, and other devices known in the art. Typically, input/output devices 905 are connected to the system through an input/output (I/O) controller 906 .
本发明的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:
1)在本发明实施例中,通过hash算法和随机数进行加密,生成了设备检验报告的防伪加密数据,并将此数据作为目标区块数据;1) In the embodiment of the present invention, the hash algorithm and random number are used for encryption to generate the anti-counterfeiting encrypted data of the equipment inspection report, and this data is used as the target block data;
2)在本发明实施例中,通过检验数据的在线的校验,完成对于全部的广播后的数据为信息验证,确保区块形成后的可靠性;2) In the embodiment of the present invention, through the online verification of the inspection data, complete the information verification for all the data after the broadcast, and ensure the reliability after the block is formed;
3)在本发明实施例中,通过保证用户的可靠性验证,保证整个方法和系统中仅存在检验数据。3) In the embodiment of the present invention, by ensuring the reliability verification of the user, it is ensured that only inspection data exists in the entire method and system.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block in the flowcharts and/or block diagrams, and combinations of flows and/or blocks in the flowcharts and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in one or more of the flowcharts and/or one or more blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions An apparatus implements the functions specified in a flow or flows of the flowcharts and/or a block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in one or more of the flowcharts and/or one or more blocks of the block diagrams.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit and scope of the invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111487536.7A CN113919011B (en) | 2021-12-08 | 2021-12-08 | An anti-counterfeiting method for equipment inspection reports based on blockchain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111487536.7A CN113919011B (en) | 2021-12-08 | 2021-12-08 | An anti-counterfeiting method for equipment inspection reports based on blockchain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113919011A true CN113919011A (en) | 2022-01-11 |
CN113919011B CN113919011B (en) | 2022-03-18 |
Family
ID=79248871
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111487536.7A Active CN113919011B (en) | 2021-12-08 | 2021-12-08 | An anti-counterfeiting method for equipment inspection reports based on blockchain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113919011B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109598518A (en) * | 2018-09-30 | 2019-04-09 | 阿里巴巴集团控股有限公司 | Method for anti-counterfeit and device, electronic equipment based on block chain |
CN109741803A (en) * | 2019-01-14 | 2019-05-10 | 南京大学 | Blockchain-based medical data security collaboration system |
US20190370358A1 (en) * | 2018-05-29 | 2019-12-05 | Oracle International Corporation | Securing access to confidential data using a blockchain ledger |
CN112035426A (en) * | 2020-08-06 | 2020-12-04 | 珠海格力电器股份有限公司 | Supply chain data anti-counterfeiting method, device, equipment and computer readable medium |
CN112200496A (en) * | 2020-11-12 | 2021-01-08 | 北京三维天地科技股份有限公司 | Laboratory detection report management system based on block chain |
CN112581126A (en) * | 2020-12-08 | 2021-03-30 | 腾讯科技(深圳)有限公司 | Block chain-based platform data management method and device and storage medium |
CN112948894A (en) * | 2019-12-10 | 2021-06-11 | 中远海运科技股份有限公司 | Block chain-based anti-counterfeiting method, device, equipment and medium for tally inspection report |
CN113079015A (en) * | 2021-03-11 | 2021-07-06 | 国电南瑞科技股份有限公司 | Electric power data anti-counterfeiting encryption verification method and system |
US20210326942A1 (en) * | 2020-04-16 | 2021-10-21 | Zachariah Marcus Peterson | Method of Securing Online Merchant Reviews Using Block Chains |
-
2021
- 2021-12-08 CN CN202111487536.7A patent/CN113919011B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190370358A1 (en) * | 2018-05-29 | 2019-12-05 | Oracle International Corporation | Securing access to confidential data using a blockchain ledger |
CN109598518A (en) * | 2018-09-30 | 2019-04-09 | 阿里巴巴集团控股有限公司 | Method for anti-counterfeit and device, electronic equipment based on block chain |
CN109741803A (en) * | 2019-01-14 | 2019-05-10 | 南京大学 | Blockchain-based medical data security collaboration system |
CN112948894A (en) * | 2019-12-10 | 2021-06-11 | 中远海运科技股份有限公司 | Block chain-based anti-counterfeiting method, device, equipment and medium for tally inspection report |
US20210326942A1 (en) * | 2020-04-16 | 2021-10-21 | Zachariah Marcus Peterson | Method of Securing Online Merchant Reviews Using Block Chains |
CN112035426A (en) * | 2020-08-06 | 2020-12-04 | 珠海格力电器股份有限公司 | Supply chain data anti-counterfeiting method, device, equipment and computer readable medium |
CN112200496A (en) * | 2020-11-12 | 2021-01-08 | 北京三维天地科技股份有限公司 | Laboratory detection report management system based on block chain |
CN112581126A (en) * | 2020-12-08 | 2021-03-30 | 腾讯科技(深圳)有限公司 | Block chain-based platform data management method and device and storage medium |
CN113079015A (en) * | 2021-03-11 | 2021-07-06 | 国电南瑞科技股份有限公司 | Electric power data anti-counterfeiting encryption verification method and system |
Also Published As
Publication number | Publication date |
---|---|
CN113919011B (en) | 2022-03-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109067801B (en) | Identity authentication method, identity authentication device and computer readable medium | |
CN101369889B (en) | Method for electronic endorsement of document | |
CN110785783A (en) | Method and apparatus for testing signature verification for blockchain systems | |
US8793499B2 (en) | Nested digital signatures with constant file size | |
CN104486075A (en) | Intelligent substation ICD model file digital signature verification method | |
CN114444105B (en) | Intelligent audit data reporting safety method | |
CN110598456B (en) | Data storage method and device, electronic equipment and storage medium | |
CN110826091B (en) | File signature method and device, electronic equipment and readable storage medium | |
CN113610526A (en) | Data trust method and device, electronic equipment and storage medium | |
CN104468120A (en) | Method and system for achieving electronic signature | |
CN113487469B (en) | Carbon bank data processing method and system | |
CN112907375B (en) | Data processing method, device, computer equipment and storage medium | |
US7707423B2 (en) | Method and system for maintaining digital signature integrity | |
CN109155089A (en) | Method for being voted using chain type signature | |
US8214634B1 (en) | Establishing trust via aggregate peer ranking | |
JP2013062650A (en) | Data verification device, data verification method for data verification device, data verification program, and data verification system | |
CN113919011B (en) | An anti-counterfeiting method for equipment inspection reports based on blockchain | |
WO2020134637A1 (en) | Key component verification method and apparatus, and terminal device | |
CN110929277A (en) | A data concentrator, energy metering data processing method and system | |
CN100505621C (en) | Method of Digital Signature Locked Domain | |
Andi et al. | Securing Medical Records of COVID-19 Patients Using Elliptic Curve Digital Signature Algorithm (ECDSA) in Blockchain | |
US9292698B1 (en) | Method and system for remote forensic data collection | |
CN202677327U (en) | Handwritten terminal for encrypting signatures | |
CN112825093B (en) | Security baseline checking method, host, server, electronic device and storage medium | |
CN113821446A (en) | A test and verification method and device for a transaction system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220708 Address after: 050000 room 10-2-403-2, Jianzhu Jiayuan, No. 15, Zhaiying North Street, Chang'an District, Shijiazhuang City, Hebei Province Patentee after: Hebei Shuoquan Technology Co.,Ltd. Address before: 050035 No.288, Zhufeng street, hi tech Development Zone, Shijiazhuang City, Hebei Province Patentee before: SHIJIAZHUANG University |
|
TR01 | Transfer of patent right |