Blockchain-based method for authenticating data of an internet of things platform before uploading the data
By verifying data hash values on the database and blockchain sides, a trusted unified identifier and data storage table are constructed, solving the problem of untrustworthy data on IoT platforms and achieving trusted authentication and consistency of data before it is uploaded to the blockchain.
Patent Information
- Application Number
- CN202210998588.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2042-08-19
AI Technical Summary
Existing IoT platforms cannot verify the authenticity of data at the source, making the data unreliable when combined with blockchain.
By verifying the hash value of data on both the database side and the blockchain side, a data storage table with blockchain characteristics is constructed, a trusted unified identifier for the database is generated, and a double hash value comparison is performed before the data is uploaded to the blockchain to ensure the trustworthiness of the data.
It achieves trusted authentication before data is uploaded to the blockchain, ensuring the consistency and reliability of data before and after being uploaded, and improving the credibility of IoT platform data.
Smart Images

Figure CN115378608B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of security, Internet of Things and blockchain technology, and particularly relates to a method for authenticating data of an Internet of Things platform before being chained based on a blockchain. BACKGROUND
[0002] In recent years, blockchain technology has attracted extensive attention at home and abroad. Blockchain is widely used in the Internet of Things, supply chain, communication, big data and artificial intelligence industries due to its characteristics of decentralization and collective maintenance, distrust, non-tamperability and traceability, anonymity and security.
[0003] The combination of blockchain technology and the Internet of Things is also a direction of focus worldwide. The combination of blockchain and the Internet of Things is powerful and will cause significant changes in multiple industries, paving the way for new business models and novel distributed applications. However, there are still problems to be solved when combining blockchain technology with industrial and agricultural Internet of Things systems. Although data on the chain is tamper-proof, the data entered into the chain cannot be verified from the source. We hope to solve this problem by verifying the database and data, but the existing data authentication can only be verified at the Internet of Things platform level or at the device level, without direct verification of the collected data. Therefore, the data authenticity problem when combining the Internet of Things with blockchain is a core problem that needs to be solved in the process of combination. SUMMARY
[0004] Therefore, the purpose of the present application is to provide a method for authenticating data of an Internet of Things platform before being chained based on a blockchain, which ensures the authenticity of the data before being chained.
[0005] To achieve the above purpose, the present application adopts the following technical solution: a method for authenticating data of an Internet of Things platform before being chained based on a blockchain, a trusted unified identifier is generated for a database, and a data storage table with blockchain characteristics is constructed, which contains two fields of dbhash and dbprehash. dbhash is the hash value of the data at time t, and dbprehash is the hash value of the data at time t-1. Whether the hash value at time t and the dbprehash value at time t+1 are equal is verified to determine whether the data has been modified at the database side. At the same time, the data is chained. At the blockchain side, blockhash is the hash value of the data at time t, and blockprehash is the hash value of the data at time t-1. Whether the dbhash value at time t and the blcokhash value at time t are equal, and whether the dbprehash value at time t and the blcokprehash value at time t are equal are verified at the blockchain side to determine whether the data has been modified again, thereby ensuring the authenticity of the data before being chained.
[0006] In a preferred embodiment, the generation of the database server-side trusted uniform identification specifically comprises:
[0007] (1) First, create a self-signed root certificate key ca , first generate the CA private key key pri_ca , and then use the CA private key key pri_ca to generate the CA public key key pub_ca ;
[0008] (2) The CA public key key pub_ca is issued to the database server side and the database verification side;
[0009] (3) The database server-side private key Key pri_dbservice and the database server-side public key Key pub_dbservice are generated by the CA public key Key pub_ca on the database server side;
[0010] (4) The database verification side private key Key pri_verify and the database verification side public key Key pub_verify are generated by the CA public key Key pub_ca on the database verification side;
[0011] (5) The database opens an ssl connection, ssl-ca=Key pub_ca , ssl-key= Key pri_dbservice , ssl-cert =Key pub_dbservice ;
[0012] (6) The database verification side public key Key pri_verify is sent to the server side to encrypt the database server-side public key Key pub_dbservice to obtain Key;
[0013] (7) On the database server side, use the database server-side private key Key pri_dbservice to sign DBID, DBNAME, IP and Key and other device information to obtain sign;
[0014] (8) Send Key and sign and device ID to the database verification side;
[0015] (9) On the database verification side, use the database server-side public key Key pub_dbservice to verify sign, and if the verification is passed, it means that the database is a legal database;
[0016] (10) On the database verification side, use the database verification side private key Key pri_verifyDecrypt Key, decryption is successful, which means that the database verification end is a legitimate private key holder;
[0017] (11) CA public key Key pub_ca , database verification end private key Key pri_verify and database verification end public key Key pub_verify , DBID, DBNAME, IP and other information, according to W3C standard group package on chain, register the unique information of each database on the chain;
[0018] (12) register the database verification end account on the database server side, and set the user to connect only in ssl mode;
[0019] (13) the blockchain system returns the database trusted unified identifier DBCUID to the database server side through the database verification module, as a field of the database.
[0020] In a preferred embodiment, the database connection string is constructed specifically including:
[0021] (1) the data on-chain module applies CA public key Key pub_ca Database verification end private key Key pri_verify and database verification end public key Key pub_verify according to the database trusted unified identifier DBCUID;
[0022] (2) the database on-chain module constructs a database connection string according to the obtained CA public key Key pub_ca Database verification end private key Key pri_verify and database verification end public key Key pub_verif ;
[0023] (3) the data on-chain module connects to the Internet of Things platform database through the database connection string, and uploads the data on the chain.
[0024] Compared with the prior art, the present application has the following beneficial effects:
[0025] 1. For the trusted authentication of the Internet of Things platform database, the database trusted unified identification technology based on the blockchain technology is proposed for the Internet of Things platform database.
[0026] 2. For the trusted authentication of the Internet of Things platform database data, the data storage table with the characteristics of the blockchain is constructed to ensure the credibility of the data on the Internet of Things platform database side; after the data is uploaded on the chain, the credibility of the uploaded data is ensured by comparing the hash values before and after the data is uploaded on the chain. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 is the flow chart of the preferred embodiment of the present application (one);
[0028] Figure 2 Flow chart (two) for preferred embodiments of the present application;
[0029] Figure 3 Flow chart (three) for preferred embodiments of the present application;
[0030] Figure 4 Data storage representation intent for preferred embodiments of the present application;
[0031] Figure 5 Post-uplink data verification schematic for preferred embodiments of the present application. DETAILED DESCRIPTION
[0032] The present application is further described below in conjunction with the accompanying drawings and embodiments.
[0033] It should be noted that the following detailed description is illustrative only, and is intended to provide further description in order to provide a fuller enabling teaching of the present application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0034] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments in accordance with the present application; as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise; further, it should be understood that the terms "comprise", "comprising", "comprises" and / or "comprising" when used in this specification, specify the presence of stated features, steps, operations, devices, components and / or combinations thereof, but do not preclude the presence or addition of one or more other features, steps, operations, devices, components and / or combinations thereof.
[0035] A blockchain-based Internet of Things platform data pre-uplink trusted authentication method, with reference to Figures 1 to 5 A trusted uniform identification is generated for the database, and a data storage table with blockchain characteristics is constructed, which contains two fields of dbhash and dbprehash. The dbhash is the hash value of the data at time t, and the dbprehash is the hash value of the data at time t-1. By verifying whether the hash value at time t is equal to the dbprehash value at time t+1, it is determined on the database side whether the data has been modified, and the data is uploaded to the blockchain. On the blockchain side, the blockhash is the hash value of the data at time t, and the blockprehash is the hash value of the data at time t-1. By verifying whether the dbhash value at time t is equal to the blcokhash value at time t, and whether the dbprehash value at time t is equal to the blcokprehash value at time t, it is determined again whether the data has been modified on the blockchain side to ensure the trustworthiness of the data before uplink.
[0036] The generating database server end trusted uniform identification specifically comprises:
[0037] (1) first create a self-signed root certificate key ca , first generate CA private key key pri_ca , then generate CA public key key pri_ca using CA private key key pub_ca ;
[0038] (2) the CA public key key pub_ca is issued to the database server end and the database verification end;
[0039] (3) the database server end private key Key pri_dbservice and the database server end public key Key pub_dbservice are generated through the CA public key Key pub_ca ;
[0040] (4) the database verification end private key Key pri_verify and the database verification end public key Key pub_verify are generated through the CA public key Key pub_ca ;
[0041] (5) the database starts ssl connection, ssl-ca=Key pub_ca , ssl-key= Key pri_dbservice , ssl-cert =Key pub_dbservice ;
[0042] (6) the database verification end public key Key pri_verify is sent to the server end, which is used to encrypt the database server end public key Key pub_dbservice to obtain Key;
[0043] (7) on the database server side, the database server end private key Key pri_dbservice is used to sign DBID, DBNAME, IP and Key and other device information to obtain sign;
[0044] (8) Key and sign and device ID are sent to the database verification end;
[0045] (9) on the database verification end, the database server end public key Key pub_dbservice is used to verify sign, and the verification passing indicates that the database is a legal database;
[0046] (10) on the database verification end, the database verification end private key Key pri_verify is used to decrypt Key, and the decryption success indicates that the database verification end is a legal private key holder;
[0047] (11) CA public key Key pub_ca , database verification end private key Key pri_verify and database verification end public key Key pub_verify , DBID, DBNAME, IP, etc. information, according to W3C standard group package chain, register the unique information of each database on the chain;
[0048] (12) register the database verification end account on the database server side, and set the user to connect only in ssl mode;
[0049] (13) the blockchain system returns the database trusted unified identifier DBCUID to the database server side through the database verification module, as a field of the database.
[0050] Reference Figure 3 , the construction of database connection string specifically includes:
[0051] (1) the data on-chain module applies CA public key Key pub_ca database verification end private key Key pri_verify and database verification end public key Key pub_verify according to the database trusted unified identifier DBCUID;
[0052] (2) the database on-chain module constructs the database connection string according to the CA public key Key pub_ca database verification end private key Key pri_verify and database verification end public key Key pub_verif ;
[0053] (3) the data on-chain module connects to the Internet of Things platform database through the database connection string, and uploads the data to the chain.
[0054] Reference Figures 4-5 , data trusted authentication specifically includes: constructing a data storage table with blockchain characteristics, judging whether the data is modified on the database side by verifying whether the hash value at time t and the dbprehash value at time t+1 are equal; after uploading to the chain, the data is verified on the blockchain side, blockhash is the hash value of the data at time t, blockprehash is the hash value of the data at time t-1, on the blockchain side, by verifying whether the dbhash value at time t and the blcokhash value at time t are equal, and verifying whether the dbprehash value at time t and the blcokprehash value at time t are equal, the data is modified again.
Claims
1. A trusted authentication method for data before it is uploaded to the blockchain on an IoT platform, characterized in that, A trusted unified identifier is generated for the database, and a data storage table with blockchain characteristics is constructed. This data storage table contains two fields: dbhash and dbprehash. dbhash is the hash value of the data at time t, and dbprehash is the hash value of the data at time t-1. By verifying whether the hash value at time t and the dbprehash value at time t+1 are equal, the database side is used to determine whether the data has been modified. At the same time, the data is uploaded to the blockchain. On the blockchain side, blockhash is the hash value of the data at time t, and blockprehash is the hash value of the data at time t-1. On the blockchain side, by verifying whether the dbhash value at time t and the blockhash value at time t are equal, and verifying whether the dbprehash value at time t and the blockprehash value at time t are equal, the data is again checked to determine whether the data has been modified, thus ensuring the trustworthiness of the data before it is uploaded to the blockchain. The generation of a trusted unified identifier for the database server specifically includes: (1) First, create a self-signed root certificate key. ca First, generate the CA private key. pri_ca Then use the CA private key. pri_ca Generate CA public key pub_ca ; (2) Transfer the CA public key key pub_ca Send to the database server and database verification end; (3) On the database server side, use the CA public key Key pub_ca Generate database server-side private key. pri_dbservice And database server-side public key pub_dbservice ; (4) Verify the database using the CA public key. pub_ca Generate database verification private key. pri_verify And database verification public key pub_verify ; (5) Enable SSL connection to the database, ssl-ca=Key pub_ca ssl-key= Key pri_dbservice ssl-cert =Key pub_dbservice ; (6) Transfer the database verification public key Key pri_verify Send to the server to encrypt the database server's public key. pub_dbservice Get the Key; (7) On the database server side, use the database server's private key Key pri_dbservice The signature includes DBID, DBNAME, IP address, Key, and other device information. (8) Send the Key, sign, and device ID to the database verification end; (9) On the database verification side, use the database server's public key Key. pub_dbservice Signature verification: Successful signature verification indicates that the database is a legitimate database. (10) At the database authentication end, use the database authentication end private key Key pri_verify Decrypt the key. Successful decryption indicates that the database verification end is the legitimate private key holder. (11) Transfer the CA public key Key pub_ca Database verification private key pri_verify And database verification public key pub_verify Information such as DBID, DBNAME, and IP address are packaged and uploaded to the blockchain according to W3C standards, registering unique information for each database on the blockchain; (12) Register a database authentication account on the database server and set the user to connect only via SSL; (13) The blockchain system returns the database trusted unified identifier DBCUID to the database server through the database verification module, which is used as a field of the database.
2. The trusted authentication method for data upload to a blockchain-based IoT platform according to claim 1, characterized in that, Uploading data to the blockchain requires constructing a database connection string, which specifically includes: (1) The data upload module applies for a CA public key Key based on the database trusted unified identifier DBCUID. pub_ca Database authentication private key pri_verify And database verification public key pub_verify ; (2) The database chaining module uses the obtained CA public key Key. pub_ca Database authentication private key pri_verify And database verification public key pub_verif Construct a database connection string; (3) The data upload module connects to the IoT platform database through the database connection string and uploads the data to the blockchain.
Citation Information
Patent Citations
Online monitoring method and system for cooking fume in catering industry based on block chain
CN113010903A
Internet-of-Things equipment unified authentication method and system based on block chain and PUF (Physical Unclonable Function)
CN113708935A