CN114357508B - Internet of things data sharing system and method based on predictors and blockchain - Google Patents
Internet of things data sharing system and method based on predictors and blockchain Download PDFInfo
- Publication number
- CN114357508B CN114357508B CN202111611229.5A CN202111611229A CN114357508B CN 114357508 B CN114357508 B CN 114357508B CN 202111611229 A CN202111611229 A CN 202111611229A CN 114357508 B CN114357508 B CN 114357508B
- Authority
- CN
- China
- Prior art keywords
- data
- internet
- things
- user
- predictor
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000012544 monitoring process Methods 0.000 claims description 22
- 230000008569 process Effects 0.000 claims description 14
- 230000004044 response Effects 0.000 claims description 12
- 230000007246 mechanism Effects 0.000 claims description 11
- 230000000977 initiatory effect Effects 0.000 claims description 6
- 230000006855 networking Effects 0.000 claims description 6
- 238000007781 pre-processing Methods 0.000 claims description 6
- 230000001960 triggered effect Effects 0.000 claims description 4
- 230000008859 change Effects 0.000 claims description 3
- 238000004806 packaging method and process Methods 0.000 claims description 3
- 238000012216 screening Methods 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 abstract description 4
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000004422 calculation algorithm Methods 0.000 description 5
- 238000011161 development Methods 0.000 description 2
- 241000609666 Tuber aestivum Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Landscapes
- Telephonic Communication Services (AREA)
Abstract
The invention discloses an Internet of things data sharing system and method based on a predictive engine and a block chain. The method adopts the ethernet as a basic platform, performs homomorphic encryption on the uploaded data, calls an intelligent contract, uses a decentralizing predictor CHAINLINK as a middleware of a data transmission uplink, adopts a web js library to complete the call of the on-link contract, and realizes the encryption on the key data of the Internet of things by utilizing the Paillier homomorphic encryption, thereby realizing the sharing of the key data of the Internet of things. The invention solves the problem of data call in the link-up and link-down data collaboration by utilizing the predictor technology, and the decentralised predictor architecture can well improve the reliability of the data, so that the data use and sharing are safer.
Description
Technical Field
The invention relates to the technical field of data sharing, in particular to an Internet of things data sharing system and method based on a predictor and a blockchain.
Background
Along with the fact that the Internet of things is definitely positioned as an important component of new construction of China, the essence of the Internet of things is that the sharing of the Internet of things data becomes an important factor for determining the development of the Internet of things. Because the internet of things data acquired by the internet of things data sensor has the characteristics of mass, timeliness, relevance and safety, how to timely, safely and conveniently share the internet of things data becomes a concern.
At present, the traditional mode of sharing the data of the Internet of things based on the Internet is widely applied to industries. In the traditional Internet data sharing architecture, an Internet of things data sensor is utilized to collect Internet of things data at an information collection layer and a network layer, and the Internet of things data is sent to a gateway; and the gateway sends the Internet of things data to the server and the database to realize the internet of data. The data user accesses the server, and the server invokes the database to read and share the data of the Internet of things. However, in the traditional sharing mode, the data provider needs to upload and store the data of the internet of things in advance, and the data user can access the data of the internet of things in the database, so that the sharing of the data is realized, and the scheme has higher requirement on the speed of data transmission and is difficult to ensure the timeliness of the data of the internet of things; secondly, most of the data of the Internet of things are streaming data, the data size is large, different databases are designed according to different data types (dynamic data and static data) to carry out corresponding storage operation, and the storage scheme based on the databases occupies huge storage space of the databases; finally, data sharing based on the Internet is faced with the problems that the data of the Internet of things is tampered, a database is down and the tracing of the shared data of users is difficult, and the safety of the data of the Internet of things is difficult to guarantee.
With the development of the blockchain technology, the data sharing of the internet of things based on the blockchain network is considered as a potential data sharing method of the internet of things. The main purpose of the data sharing of the Internet of things based on the blockchain network is to eliminate trust concerns of a data provider and a data user by utilizing the 'decrustation' characteristic of the blockchain network. In China, the archive data protection and sharing method proposed by Tan Haibo et al utilizes the IPFS file system to store archive data, and the intelligent contract is used for carrying out identity management, so that participants in each link of the system need to carry out multiple rounds of data interaction on the link and the link, the operation steps are more complicated, and the performance is not ideal; xu Wenyu et al propose a scheme of providing data to insurance companies under the condition of protecting patient privacy based on blockchain and homomorphic encryption, which fixes application scenes in measures of applying and recording disease types, has limited application scenes and does not detail the process of storing and linking data under the chain; overseas, azaria et al originally proposed a data sharing architecture using blockchains, but only with a vague theoretical idea. The data sharing scheme based on the block chain is mostly in a theoretical architecture, and is not enough in consideration of performance and technical feasibility, so that the scheme is difficult to be applied to sharing of data of the Internet of things.
In summary, how to realize the sharing of the data of the internet of things based on the blockchain, and construct a feasible sharing system according to the sharing method, so as to ensure the mass, the timeliness, the relevance and the safety of the data of the internet of things, becomes a problem to be solved.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides an Internet of things data sharing system and method based on a predictor and a blockchain.
In order to solve the technical problems, the invention adopts the following technical scheme: an internet of things data sharing system based on predictors and blockchains, the system comprising: a data provider, a plurality of predictor nodes, a blockchain network, and a data consumer;
the blockchain network comprises an EVM-based blockchain private chain, a cloud server for running the blockchain private chain and an intelligent contract running on the private chain; the intelligent contracts running on the private chain comprise user contracts and foreshadowing machine contracts;
the data provider acquires data by using an Internet of things data sensor, transmits the acquired Internet of things data to a predictor node, and waits for access of the predictor node; when the access of the predictor node is received, the data provider attaches the data of the Internet of things to be requested to the response message of the data request and sends the data to the predictor node, so that the function of providing the data of the Internet of things by the data provider is realized;
The predictor node monitors a data acquisition request of a user contract in the blockchain network, and calls the predictor contract through the user contract so that the predictor node is called; when the predictor node is called, starting to access the data provider, initiating an internet of things http request message to the data provider, and acquiring internet of things data of the data provider; then, the internet of things data acquired from the data provider is uploaded to a user contract on the private chain of the blockchain in a transaction mode;
the data user invokes a designated user contract to initiate a request of the data of the Internet of things, the request of the data of the Internet of things is sent, and after the data of the Internet of things is sent from the data provider and returned to the blockchain network through the predictor node, the data of the Internet of things is analyzed by the user contract in the blockchain network and displayed to the data user through a user interface of the system.
Further, the data provider performs uplink preprocessing on the collected data of the internet of things by using a python script, including: size comparison, data screening and homomorphic encryption operation; uploading the Internet of things data after the uplink preprocessing to a cloud server built by a data provider;
And the network address of the cloud server constructed by the data provider is in an open state as an API, and is used for receiving the data request of the Internet of things of the predictor node and sending a response message to the predictor node.
Furthermore, a polling mode is adopted to realize the data acquisition request of the user contract in the monitoring block chain network.
Further, the blockchain private chain adopts a consensus mechanism based on rights attestation POA to distribute the blockout rights of the private chain to designated miner addresses, namely, the accounts of all the participants running the system.
On the other hand, the invention also provides a method for sharing data by adopting the data sharing system of the Internet of things based on the predictors and the blockchain, which specifically comprises the following steps:
step 1: the data provider collects data by using the data sensor of the Internet of things, and transmits the collected data of the Internet of things to the predictor node, and waits for the access of the predictor node, wherein the specific process is as follows:
Step 1.1: the method comprises the steps that an Internet of things sensor collects Internet of things data and stores the data in networking equipment connected with the sensor;
step 1.2: the data provider automatically determines whether the networking equipment connected with the data sensor of the Internet of things encrypts the data of the Internet of things to be uploaded in the Paillier homomorphic mode according to the self requirement, if so, the step 1.3 is carried out, otherwise, the step 1.4 is skipped;
Step 1.3: the data of the Internet of things is sent to a cloud server of a data provider, and the data is decrypted;
step 1.4: the cloud server of the data provider is utilized to configure an API for the data of the Internet of things to be shared so that a predictor node can request the data of the Internet of things;
Step 1.5: the network address URL of the API is provided to a javascript script of the predictor node for subsequent data requests of the predictor node.
Step 2: the data user invokes a user contract specified in the blockchain network to initiate a request for data of the internet of things, and the specific process is as follows:
Step 2.1: the data user sends an Internet of things data request according to an API interface address of the target data and a data path corresponding to the target data in the API; the method specifically comprises the steps of initiating a transaction to a user contract, namely a transaction for a data request, and realizing the selection and the request of the data of the Internet of things, wherein the specific process is as follows:
Step 2.1.1: the data user invokes the user contract corresponding to the required sensor of the internet of things under the chain to specify the contract address of the corresponding user contract;
Step 2.1.2: if the sensor of the off-link Internet of things needed by the data user does not have the user contract corresponding to the sensor, a pre-established user contract template is adopted to establish a user contract corresponding to the sensor of the off-link Internet of things;
Step 2.1.3: the created user contracts are deployed into a private chain of a block chain in the data sharing system of the Internet of things so as to realize the binding of the user contracts and server addresses corresponding to sensors of the Internet of things below the chain;
Step 2.1.4: according to the needs of the data user, the data user invokes different functions in the user contract to realize different data query functions.
Step 2.2: the data user judges whether the transaction of the data request is normally packed by the private chain of the blockchain;
Step 2.3: if the private chain of the block chain does not have the transaction of normally packaging the data request, judging that the data request is initiated to fail;
Step 2.4: if the private chain of the blockchain normally packages the transaction of the data request, the user contract on the blockchain is normally called by the data user, so that the predictor contract is triggered to be called by the user contract, and the predictor node is triggered to work.
Step 3: the predictor node continuously monitors a data acquisition request of a user contract in the blockchain network in a polling mode, acquires the internet of things data under the chain from a data provider after receiving the internet of things data request, and uploads the internet of things data acquired from the data provider to the user contract on the blockchain private chain in a transaction mode, wherein the process is as follows:
Step 3.1: after receiving the data request, the predictor node sends the data request to a data source API;
Step 3.2: the server where the data source API is located continuously judges whether a data request of a predictor node is received or not;
step 3.3: if the request is received, the data of the Internet of things is added in the response message and returned to the predictor node; otherwise, continuing to circularly detect the data request of the predictor node;
Step 3.4: the Internet of things data is transmitted to the predictor node along with the response message, the predictor node is responsible for uploading the Internet of things data to a user contract of the private chain of the blockchain in a transaction form and permanently storing the data, and the Internet of things data is transmitted and uplink if the transaction is successfully executed.
Step 4: the data user accesses the user contract by calling the web3.Js library, and is used for storing the variable value of the data of the Internet of things, so that the variable value is returned to the data user, and the user obtains the data of the Internet of things.
Further, the step 3 further includes a scoring mechanism for the predictor node, and the specific method is as follows:
s1: setting an intelligent contract monitoring script in a block chain network;
S2: when the monitoring script monitors the call of the data user to the user contract, starting monitoring operation on the execution condition of the user contract;
s3: if the user contract is successfully called, the monitoring script does not adopt a punishment mechanism, otherwise, S4 is executed;
s4: the user contract is not successfully invoked, the data user receives a message of user contract invoking failure, and sends a request to the monitoring script, so that the integral of the corresponding predictor node is reduced;
S5: after the predictor node successfully receives the data request, judging whether the acquired data of the Internet of things is successfully uplink;
S6: if the data of the Internet of things is successfully uplink, the system server increases the score of the corresponding predictor node, and rewards the predictor to successfully execute the data request; the scoring flow is called for the current prophetic machine to finish;
S7: if the data of the Internet of things fails to be uplink, sending an error warning to the user contract called by the data user, wherein the system server side does not change the predictive engine integral; and (5) calling the scoring flow to finish the current prophetic machine.
The beneficial effects of adopting above-mentioned technical scheme to produce lie in:
1. According to the method provided by the invention, on the node network deployment environment level, the block chain network is operated on the cloud server, so that for a user, the user can be connected to the operation environment of the product by simply configuring the wallet network, and the user experience is good; for the node operator, the state of the chain can be synchronized quickly only by initializing the chain. The node operation cost is low and the efficiency is high. In conclusion, the technical scheme of limiting the block authority and facilitating the node interconnection can reduce the cost of platform operation and ensure transaction safety.
2. The method provided by the invention has the advantages that the decentralised predictor nodes are built on a local private chain environment, predictor interfaces on the chain are built through a predictor contract, and the local predictor nodes are built on a plurality of cloud servers and connected to the private chain to serve as facilities of the data input block chain. The data is no longer solely dependent on a single data provider, and is no longer under the control of a node operator. The decentralised predictor architecture can well improve the reliability of data, so that the data use and sharing are safer.
3. Aiming at the problems of difficult data tracing and verification in the traditional internet of things key data sharing, the method provided by the invention utilizes the characteristics of block chain decentralization, tamper resistance, trust removal and the like to actively explore the application of the block chain in the aspect of data sharing. Aiming at the problem that intelligent contracts in a block chain cannot actively acquire out-of-chain data and the timeliness of the data, the problem of data calling in the data collaboration of the up-chain and the down-chain of the chain is solved by researching and utilizing a predictor technology; aiming at the privacy protection problem brought by the platform as an intermediate service provider, privacy security in the data transmission and processing process is realized by utilizing cryptographic technologies such as homomorphic encryption and the like.
Drawings
FIG. 1 is a schematic diagram of a data sharing system of the Internet of things based on a predictor and a blockchain in an embodiment of the present invention;
FIG. 2 is a flow chart of a method for sharing data using a predictor-based blockchain-based data sharing system of the Internet of things in an embodiment of the present invention;
FIG. 3 is a flow chart of data transmission from the Internet of things to the predictor node in an embodiment of the present invention;
Fig. 4 is a flowchart of a scoring mechanism for a predictor node in an embodiment of the present invention.
Detailed Description
The following describes in further detail the embodiments of the present invention with reference to the drawings and examples. The following examples are illustrative of the invention and are not intended to limit the scope of the invention.
As shown in fig. 1, the data sharing system of the internet of things based on the predictor and the blockchain in the embodiment is as follows.
The system comprises a data provider, a plurality of predictor nodes, a blockchain network and a data consumer;
the blockchain network comprises an EVM-based blockchain private chain, a cloud server for running the blockchain private chain and an intelligent contract running on the private chain; the intelligent contracts running on the private chain comprise user contracts and foreshadowing machine contracts;
the data provider acquires data by using an Internet of things data sensor, transmits the acquired Internet of things data to a predictor node, and waits for access of the predictor node; when the access of the predictor node is received, the data provider attaches the data of the Internet of things to be requested to the response message of the data request and sends the data to the predictor node, so that the function of providing the data of the Internet of things by the data provider is realized;
The predictor node monitors a data acquisition request of a user contract in the blockchain network, and calls the predictor contract through the user contract so that the predictor node is called; when the predictor node is called, starting to access the data provider, initiating an internet of things http request message to the data provider, and acquiring internet of things data of the data provider; then, the internet of things data acquired from the data provider is uploaded to a user contract on the private chain of the blockchain in a transaction mode;
the data user invokes a designated user contract to initiate a request of the data of the Internet of things, the request of the data of the Internet of things is sent, and after the data of the Internet of things is sent from the data provider and returned to the blockchain network through the predictor node, the data of the Internet of things is analyzed by the user contract in the blockchain network and displayed to the data user through a user interface of the system.
In this embodiment, a data user accesses a blockchain network through a javascript script or a blockchain client, and initiates an entity user of a request for data of the internet of things by inputting a contract address of a specified user contract in the script or selecting a specific user contract through a graphical interface of a user front end, and calling the specified user contract; the data consumer can also be defined as: the intelligent contract is called by a specific interface to realize the collection of certain programs of the data request function. The data consumer is mainly abstracted into a program in the system-by calling a third party function library, such as: and the web3.js library, the web3.py library, the truffle framework and the like are used for calling the intelligent contract of the private chain part of the block chain, so that the data request of the Internet of things is sent.
Further, the data provider performs uplink preprocessing on the collected data of the internet of things by using a python script, including: size comparison, data screening and homomorphic encryption operation; uploading the Internet of things data after the uplink preprocessing to a cloud server built by a data provider;
And the network address of the cloud server constructed by the data provider is in an open state as an API, and is used for receiving the data request of the Internet of things of the predictor node and sending a response message to the predictor node.
Furthermore, a polling mode is adopted to realize the data acquisition request of the user contract in the monitoring block chain network.
Further, the blockchain private chain adopts a consensus mechanism based on rights attestation POA to distribute the blockout rights of the private chain to designated miner addresses, namely, the accounts of all the participants running the system. In addition, the private chain of the block chain is used as a carrier for intelligent contract operation, and plays a role in guaranteeing normal execution of contract functions; the on-chain data comprises transmitted internet of things data, specific information (hash value and transaction time) of blockchain transaction and information (contract address and contract parameter) of intelligent contract, which are all stored in the private chain; for the cloud server environment part, the function is as follows: running a user front end and a private chain of a block chain of the data sharing system of the Internet of things, and running a monitoring script for monitoring intelligent contracts on the chain; the monitoring script is used for evaluating the running condition of the intelligent contracts in the private chain of the blockchain, and further, the scoring mechanism designed by the invention is utilized for scoring the predictor node to measure the working condition of the predictor node.
On the other hand, the embodiment also provides a method for carrying out data sharing by adopting the data sharing system of the internet of things based on the predictor and the blockchain, and the flow is shown in fig. 2, and specifically comprises the following steps:
step 1: the data provider collects data by using the data sensor of the internet of things, and transmits the collected data of the internet of things to the predictor node, and waits for the access of the predictor node, and the specific flow is shown in fig. 3, and the process is as follows:
Step 1.1: the method comprises the steps that an Internet of things sensor collects Internet of things data and stores the data in networking equipment connected with the sensor;
step 1.2: the data provider automatically determines whether the networking equipment connected with the data sensor of the Internet of things encrypts the data of the Internet of things to be uploaded in the Paillier homomorphic mode according to the self requirement, if so, the step 1.3 is carried out, otherwise, the step 1.4 is skipped;
in this embodiment, the encryption algorithm for encrypting the internet of things data in step 1.2 may be various, and for the sake of specific description, the Paillier homomorphic encryption algorithm is applied here as an implementation description. The method comprises the following specific steps:
Step 1.2.1: generating a random number: two large prime numbers p and q are randomly generated and then calculated:
N(N=pq)
λ=lcm(p-1,q-1)
step 1.2.2: generating a key: randomly selecting a number So that it satisfies the following conditions:
gcd(L(gλmod N2),N)=1
wherein: l (x) =x-1/N
The public key generated by the paillier algorithm: pk= { N, g }; private key: sk=λ;
Step 1.2.3: encryption of data of the Internet of things: the data provider may randomly select a random number: r is E Z N;
Then encrypt plaintext m by using the content of the user public key, ciphertext is set to C: c=g mrnmod N2
The specific meaning of the parameters in the Paillier homomorphic encryption algorithm described above is shown in Table 1 below:
TABLE 1 concrete meaning of parameters in Paillier homomorphic encryption algorithm
Step 1.3: the data of the Internet of things is sent to a cloud server of a data provider, and the data is decrypted;
in this embodiment, for a given ciphertext:
the user can decrypt the ciphertext C with the private key to obtain the corresponding plaintext m. The specific formula is as follows:
step 1.4: the cloud server of the data provider is utilized to configure an API for the data of the Internet of things to be shared so that a predictor node can request the data of the Internet of things;
Step 1.5: the network address URL of the API is provided to a javascript script of the predictor node for subsequent data requests of the predictor node.
Step 2: the data user invokes a user contract specified in the blockchain network to initiate a request for data of the internet of things, and the specific process is as follows:
Step 2.1: the data user sends an Internet of things data request according to an API interface address of the target data and a data path corresponding to the target data in the API; the method specifically comprises the steps of initiating a transaction to a user contract, namely a transaction for a data request, and realizing the selection and the request of the data of the Internet of things, wherein the specific process is as follows:
Step 2.1.1: the data user invokes the user contract corresponding to the required sensor of the internet of things under the chain to specify the contract address of the corresponding user contract;
Step 2.1.2: if the sensor of the off-link Internet of things needed by the data user does not have the user contract corresponding to the sensor, a pre-established user contract template is adopted to establish a user contract corresponding to the sensor of the off-link Internet of things;
Step 2.1.3: the created user contracts are deployed into a private chain of a block chain in the data sharing system of the Internet of things so as to realize the binding of the user contracts and server addresses corresponding to sensors of the Internet of things below the chain;
Step 2.1.4: according to the needs of the data user, the data user invokes different functions in the user contract to realize different data query functions.
In this embodiment, if the data consumer queries the last acquired data of the internet of things, the data consumer may call finalresult functions in the corresponding contract template, where the functions are designed as: the function will not call the foreseeing machine contract, but will return the internet of things data acquired by calling the foreseeing machine contract last time to the data user, and the data is stored in the private chain of the blockchain without calling the foreseeing machine contract (the function name is related to the details of the code after the actual deployment of the system, and the code 1 in the following table 2 is taken as an example for explanation).
If the data consumer queries the internet of things data under the current chain, the getData function in the corresponding contract template may be called, which is designed to call the foreshadowing contract, and specific information of the internet of things sensor under the chain bound to the user contract (the API address corresponding to the internet of things sensor under the chain is specified, and the data path corresponding to the target data is located in the API) is sent to the foreshadowing contract (the function name is related to the details of the code after the actual deployment of the system, here, the code 1 in the following table 2 is explained as an example).
TABLE 2 code 1
Step 2.2: the data user judges whether the transaction of the data request is normally packed by the private chain of the blockchain;
The embodiment is specifically characterized in that a cloud server at the front end of an operating user monitors the data request, acquires data returned by a private chain of a block chain, and judges whether the data request is truly successful or not according to status fields in Receipts receipts in the returned data, wherein status is 0 for failure and status is 1 for success;
Step 2.3: if the private chain of the block chain does not have the transaction of normally packaging the data request, judging that the data request is initiated to fail;
In this embodiment, if the blockchain private chain does not normally package the transaction of the data request (status=0), it is determined that the data request is initiated and fails, the transaction fee is returned to the blockchain account of the data user, the monitoring script of the blockchain network monitors the failed execution of the transaction, reduces the value of the variable representing the node point of the predictor in the monitoring script, penalizes that the predictor fails to successfully execute the data request, and the data request ends;
Step 2.4: if the private chain of the blockchain normally packages the transaction of the data request (status=1), the user contract on the blockchain is normally invoked by the data consumer, and the predictor contract is invoked by the user contract, so as to trigger the predictor node to work.
Step 3: the predictor node continuously monitors a data acquisition request of a user contract in the blockchain network in a polling mode, acquires the internet of things data under the chain from a data provider after receiving the internet of things data request, and uploads the internet of things data acquired from the data provider to the user contract on the blockchain private chain in a transaction mode, wherein the process is as follows:
Step 3.1: after receiving the data request, the predictor node sends the data request to a data source API;
Step 3.2: the server where the data source API is located continuously judges whether a data request of a predictor node is received or not;
step 3.3: if the request is received, the data of the Internet of things is added in the response message and returned to the predictor node; otherwise, continuing to circularly detect the data request of the predictor node;
Step 3.4: the Internet of things data is transmitted to the predictor node along with the response message, the predictor node is responsible for uploading the Internet of things data to a user contract of the private chain of the blockchain in a transaction form and permanently storing the data, and the Internet of things data is transmitted and uplink if the transaction is successfully executed.
Step 4: the data user accesses the user contract by calling the web3.Js library, and is used for storing the variable value of the data of the Internet of things, so that the variable value is returned to the data user, and the user obtains the data of the Internet of things.
Further, the step 3 further includes a scoring mechanism of the predictor node, and the flow is shown in fig. 4, and the specific method is as follows:
s1: setting an intelligent contract monitoring script in a block chain network;
S2: when the monitoring script monitors the call of the data user to the user contract, starting monitoring operation on the execution condition of the user contract;
s3: if the user contract is successfully called, the monitoring script does not adopt a punishment mechanism, otherwise, S4 is executed;
s4: the user contract is not successfully invoked, the data user receives a message of user contract invoking failure, and sends a request to the monitoring script, so that the integral of the corresponding predictor node is reduced;
S5: after the predictor node successfully receives the data request, judging whether the acquired data of the Internet of things is successfully uplink;
S6: if the data of the Internet of things is successfully uplink, the system server increases the score of the corresponding predictor node, and rewards the predictor to successfully execute the data request; the scoring flow is called for the current prophetic machine to finish;
S7: if the data of the Internet of things fails to be uplink, sending an error warning to the user contract called by the data user, wherein the system server side does not change the predictive engine integral; and (5) calling the scoring flow to finish the current prophetic machine.
Claims (8)
1. The Internet of things data sharing system based on the predictors and the blockchains is characterized by comprising a data provider, a plurality of predictors nodes, a blockchain network and a data consumer;
the blockchain network comprises an EVM-based blockchain private chain, a cloud server for running the blockchain private chain and an intelligent contract running on the private chain; the intelligent contracts running on the private chain comprise user contracts and foreshadowing machine contracts;
the data provider acquires data by using an Internet of things data sensor, transmits the acquired Internet of things data to a predictor node, and waits for access of the predictor node; when the access of the predictor node is received, the data provider attaches the data of the Internet of things to be requested to the response message of the data request and sends the data to the predictor node, so that the function of providing the data of the Internet of things by the data provider is realized;
The predictor node monitors a data acquisition request of a user contract in the blockchain network, and calls the predictor contract through the user contract so that the predictor node is called; when the predictor node is called, starting to access the data provider, initiating an internet of things http request message to the data provider, and acquiring internet of things data of the data provider; then, the internet of things data acquired from the data provider is uploaded to a user contract on the private chain of the blockchain in a transaction mode;
The data user invokes a designated user contract to initiate a request of the data of the Internet of things, the request of the data of the Internet of things is sent, and after the data of the Internet of things is sent from the data provider and returned to the blockchain network through the predictor node, the data of the Internet of things is analyzed by the user contract in the blockchain network and displayed to the data user through a user interface of the system;
the method for sharing data based on the Internet of things data sharing system of the predictor and the blockchain comprises the following steps:
step 1: the data provider acquires data by using an Internet of things data sensor, transmits the acquired Internet of things data to a predictor node, and waits for access of the predictor node;
step 2: the data user invokes a user contract specified in the blockchain network to initiate a request for data of the internet of things;
step 3: the predictor node continuously monitors a data acquisition request of a user contract in the blockchain network in a polling mode, acquires the internet of things data under the chain from a data provider after receiving the internet of things data request, and uploads the internet of things data acquired from the data provider to the user contract on the blockchain private chain by utilizing a transaction mode;
Step 4: the data user accesses the user contract by calling the web3.Js library, and is used for storing the variable value of the data of the Internet of things, so that the variable value is returned to the data user, and the user obtains the data of the Internet of things;
The step 3 also comprises a scoring mechanism of the predictor node, and the specific method is as follows:
s1: setting an intelligent contract monitoring script in a block chain network;
S2: when the monitoring script monitors the call of the data user to the user contract, starting monitoring operation on the execution condition of the user contract;
s3: if the user contract is successfully called, the monitoring script does not adopt a punishment mechanism, otherwise, S4 is executed;
s4: the user contract is not successfully invoked, the data user receives a message of user contract invoking failure, and sends a request to the monitoring script, so that the integral of the corresponding predictor node is reduced;
S5: after the predictor node successfully receives the data request, judging whether the acquired data of the Internet of things is successfully uplink;
S6: if the data of the Internet of things is successfully uplink, the system server increases the score of the corresponding predictor node, and rewards the predictor to successfully execute the data request; the scoring flow is called for the current prophetic machine to finish;
S7: if the data of the Internet of things fails to be uplink, sending an error warning to the user contract called by the data user, wherein the system server side does not change the predictive engine integral; and (5) calling the scoring flow to finish the current prophetic machine.
2. The predictor and blockchain-based internet of things data sharing system of claim 1, wherein: the data provider performs uplink preprocessing on the collected data of the internet of things by using a python script, and the method comprises the following steps: size comparison, data screening and homomorphic encryption operation; uploading the Internet of things data after the uplink preprocessing to a cloud server built by a data provider;
And the network address of the cloud server constructed by the data provider is in an open state as an API, and is used for receiving the data request of the Internet of things of the predictor node and sending a response message to the predictor node.
3. The data sharing system of the internet of things based on the predictors and the blockchains according to claim 1, wherein the data acquisition request of the user contract in the listening blockchain network is realized in a polling mode.
4. The system of claim 1, wherein the private chain of blockchain employs a consensus mechanism based on proof of rights POA to distribute the block-out rights of the private chain to designated miner addresses, i.e., to the accounts of the parties running the system.
5. The system for sharing data of the internet of things based on the predictor and the blockchain according to claim 1, wherein the process of step 1 in the method for sharing data of the internet of things based on the predictor and the blockchain is as follows:
Step 1.1: the method comprises the steps that an Internet of things sensor collects Internet of things data and stores the data in networking equipment connected with the sensor;
step 1.2: the data provider automatically determines whether the networking equipment connected with the data sensor of the Internet of things encrypts the data of the Internet of things to be uploaded in the Paillier homomorphic mode according to the self requirement, if so, the step 1.3 is carried out, otherwise, the step 1.4 is skipped;
Step 1.3: the data of the Internet of things is sent to a cloud server of a data provider, and the data is decrypted;
step 1.4: the cloud server of the data provider is utilized to configure an API for the data of the Internet of things to be shared so that a predictor node can request the data of the Internet of things;
Step 1.5: the network address URL of the API is provided to a javascript script of the predictor node for subsequent data requests of the predictor node.
6. The system for sharing data of the internet of things based on the predictor and the blockchain according to claim 1, wherein the process of the step 2 in the method for sharing data of the internet of things based on the predictor and the blockchain is as follows:
Step 2.1: the data user sends an Internet of things data request according to an API interface address of the target data and a data path corresponding to the target data in the API; the method specifically comprises the steps of initiating a transaction to a user contract, namely a transaction for a data request, and realizing the selection and the request of the data of the Internet of things;
Step 2.2: the data user judges whether the transaction of the data request is normally packed by the private chain of the blockchain;
Step 2.3: if the private chain of the block chain does not have the transaction of normally packaging the data request, judging that the data request is initiated to fail;
Step 2.4: if the private chain of the blockchain normally packages the transaction of the data request, the user contract on the blockchain is normally called by the data user, so that the predictor contract is triggered to be called by the user contract, and the predictor node is triggered to work.
7. The system for sharing data of the Internet of things based on the predictor and the blockchain of claim 5, wherein the system comprises a storage unit, the process of the step 2.1 in the method for sharing data based on the data sharing system of the internet of things of the predictor and the blockchain is as follows:
Step 2.1.1: the data user invokes the user contract corresponding to the required sensor of the internet of things under the chain to specify the contract address of the corresponding user contract;
Step 2.1.2: if the sensor of the off-link Internet of things needed by the data user does not have the user contract corresponding to the sensor, a pre-established user contract template is adopted to establish a user contract corresponding to the sensor of the off-link Internet of things;
Step 2.1.3: the created user contracts are deployed into a private chain of a block chain in the data sharing system of the Internet of things so as to realize the binding of the user contracts and server addresses corresponding to sensors of the Internet of things below the chain;
Step 2.1.4: according to the needs of the data user, the data user invokes different functions in the user contract to realize different data query functions.
8. The system for sharing data of the internet of things based on the predictor and the blockchain according to claim 1, wherein the process of the step 3 in the method for sharing data of the internet of things based on the predictor and the blockchain is as follows:
Step 3.1: after receiving the data request, the predictor node sends the data request to a data source API;
Step 3.2: the server where the data source API is located continuously judges whether a data request of a predictor node is received or not;
step 3.3: if the request is received, the data of the Internet of things is added in the response message and returned to the predictor node; otherwise, continuing to circularly detect the data request of the predictor node;
Step 3.4: the Internet of things data is transmitted to the predictor node along with the response message, the predictor node is responsible for uploading the Internet of things data to a user contract of the private chain of the blockchain in a transaction form and permanently storing the data, and the Internet of things data is transmitted and uplink if the transaction is successfully executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111611229.5A CN114357508B (en) | 2021-12-27 | 2021-12-27 | Internet of things data sharing system and method based on predictors and blockchain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111611229.5A CN114357508B (en) | 2021-12-27 | 2021-12-27 | Internet of things data sharing system and method based on predictors and blockchain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114357508A CN114357508A (en) | 2022-04-15 |
CN114357508B true CN114357508B (en) | 2024-06-14 |
Family
ID=81101660
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111611229.5A Active CN114357508B (en) | 2021-12-27 | 2021-12-27 | Internet of things data sharing system and method based on predictors and blockchain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114357508B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115296811B (en) * | 2022-06-15 | 2023-10-31 | 湖南天河国云科技有限公司 | Block chain-based data sharing utilization method, device and medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10542046B2 (en) * | 2018-06-07 | 2020-01-21 | Unifyvault LLC | Systems and methods for blockchain security data intelligence |
US11876910B2 (en) * | 2019-01-31 | 2024-01-16 | Salesforce, Inc. | Systems, methods, and apparatuses for implementing a multi tenant blockchain platform for managing Einstein platform decisions using distributed ledger technology (DLT) |
CN111092914B (en) * | 2020-03-18 | 2020-06-26 | 支付宝(杭州)信息技术有限公司 | Method and device for accessing external data |
CN112016105B (en) * | 2020-08-17 | 2022-04-08 | 东北大学秦皇岛分校 | Chain uplink and downlink data sharing method based on distributed prediction machine and homomorphic encryption |
CN112131298B (en) * | 2020-11-19 | 2021-06-29 | 支付宝(杭州)信息技术有限公司 | Data conversion method and device based on block chain |
-
2021
- 2021-12-27 CN CN202111611229.5A patent/CN114357508B/en active Active
Non-Patent Citations (2)
Title |
---|
基于区块链的5G物联网数据共享方案;乔康;游伟;王领伟;汤红波;;网络与信息安全学报;20200815(04);全文 * |
基于区块链的物流应用***数据共享技术;张玉卓;李娜;;电子设计工程;20200720(14);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114357508A (en) | 2022-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Dalskov et al. | Securing DNSSEC keys via threshold ECDSA from generic MPC | |
CN101409706B (en) | Method, system and relevant equipment for distributing data of edge network | |
EP1278112B1 (en) | A process for providing access of a client to a content provider server under control of a resource locator server | |
CN112214780A (en) | Data processing method and device, intelligent equipment and storage medium | |
CN110032545A (en) | File memory method, system and electronic equipment based on block chain | |
Fabian | Implementing secure p2p-ons | |
CN105247529A (en) | Synchronizing credential hashes between directory services | |
CN104506487B (en) | The credible execution method of privacy policy under cloud environment | |
CN106878265A (en) | A kind of data processing method and device | |
CN108270882A (en) | The analysis method and device of domain name, storage medium, electronic device | |
KR101520751B1 (en) | A method and server for monitoring users during their browsing within a communications network | |
CN112883015A (en) | Block chain data management method, device and storage medium | |
CN106131165B (en) | Anti-stealing link method and device for content distributing network | |
CN105956143A (en) | Database access method and database proxy node | |
CN112308561A (en) | Block chain-based evidence storing method and system, computer equipment and storage medium | |
CN113141365B (en) | Distributed micro-service data transmission method, device, system and electronic equipment | |
CN110599142A (en) | Data storage method and device, computer equipment and storage medium | |
CN111488372A (en) | Data processing method, device and storage medium | |
CN109819068A (en) | User terminal and its block chain domain name analytic method | |
CN108847952A (en) | Method, device and system for processing request link context | |
Lesniewski-Laas et al. | {SSL} Splitting: Securely Serving Data from Untrusted Caches | |
CN114357508B (en) | Internet of things data sharing system and method based on predictors and blockchain | |
CN110597541A (en) | Interface updating processing method, device, equipment and storage medium based on block chain | |
CN111090386A (en) | Cloud storage method, device and system and computer equipment | |
CN106031097A (en) | Service processing method and device |
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 |