CN116821970A - Sampling detection method based on block chain and Internet of things - Google Patents

Sampling detection method based on block chain and Internet of things Download PDF

Info

Publication number
CN116821970A
CN116821970A CN202211715424.7A CN202211715424A CN116821970A CN 116821970 A CN116821970 A CN 116821970A CN 202211715424 A CN202211715424 A CN 202211715424A CN 116821970 A CN116821970 A CN 116821970A
Authority
CN
China
Prior art keywords
data
data acquisition
node terminal
information
acquisition node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211715424.7A
Other languages
Chinese (zh)
Inventor
兰雨晴
余丹
刘一凡
王丹星
邢智涣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Standard Intelligent Security Technology Co Ltd
Original Assignee
China Standard Intelligent Security Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Standard Intelligent Security Technology Co Ltd filed Critical China Standard Intelligent Security Technology Co Ltd
Priority to CN202211715424.7A priority Critical patent/CN116821970A/en
Publication of CN116821970A publication Critical patent/CN116821970A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a sampling detection method based on a blockchain and the Internet of things, which utilizes the Internet of things to perform unified management on a data acquisition node terminal to realize real-time control and data collection on the data acquisition node terminal, and also utilizes data abstract information stored by the blockchain as a reference for judging whether data is tampered, so that whether the sampled data is tampered or not is accurately judged, and the storage safety and the reliability of the sampled data are improved.

Description

Sampling detection method based on block chain and Internet of things
Technical Field
The invention relates to the technical field of data sampling processing, in particular to a sampling detection method based on a block chain and the Internet of things.
Background
The distributed internet of things sensing system is used for connecting a plurality of sensors into the internet of things, all the sensors respectively acquire corresponding data, and the acquired data are uploaded to a database for storage. In order to ensure the security of data storage in the database, encryption processing is usually performed on the data and identity verification is performed on a user terminal accessing the database, but the above manner cannot effectively prevent the data in the database from being tampered maliciously, and the tampered data cannot be quickly and accurately located from the database, so that the security of data storage in the database is reduced.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a sampling detection method based on a blockchain and the Internet of things, which comprehensively and continuously controls the data acquisition state of a data acquisition node terminal through the Internet of things, and ensures that sampling data corresponding to the data acquisition node terminal is collected in time; uploading data summary information and hash value information thereof corresponding to the sampled data to a block chain for storage, and uploading the sampled data, the data summary information and the hash value information thereof to a database for storage, so that associated data storage between the database and the block chain is realized; when data sampling searching is needed to be carried out from the database, firstly, searching and comparing data abstract information stored in the block chain and the database by taking hash value information as a reference, and judging whether sampling data stored in the database are tampered or not according to a comparison result, so that the sampling data of the database are subjected to adaptive storage state adjustment; according to the method, the data acquisition node terminals are uniformly managed by the Internet of things, so that real-time control and data collection of the data acquisition node terminals are realized, and the data abstract information stored by the block chain is used as a reference for judging whether the data is tampered, so that whether the sampled data is tampered is accurately judged, and the storage safety and the reliability of the sampled data are improved.
The invention provides a sampling detection method based on a blockchain and the Internet of things, which comprises the following steps:
step S1, after an instruction management platform terminal sends a wake-up instruction to a data acquisition node terminal through the Internet of things, setting a corresponding data acquisition mode for the data acquisition node terminal according to a response message of the data acquisition node terminal; distributing corresponding data transmission links of the Internet of things to the data acquisition node terminal through the management platform terminal;
step S2, analyzing and processing the sampling data returned by the data acquisition node terminal, and judging whether the data acquisition node terminal completes the current data acquisition task; extracting corresponding data abstract information from all sampling data of a current data acquisition task, uploading the data abstract information to a block chain, and obtaining hash value information matched with the data abstract information;
step S3, the data abstract information and the hash value information are stored in a block chain section corresponding to the block chain together; the sampling data, the data abstract information and the hash value information are stored in a storage interval of a database together;
step S4, judging whether sampling data of the storage section is tampered or not according to data abstract information respectively stored in the block chain section and the storage section; and adjusting the data storage state of the storage section according to the judgment result.
Further, in the step S1, after the instruction management platform terminal sends a wake-up instruction to the data acquisition node terminal through the internet of things, setting a corresponding data acquisition mode for the data acquisition node terminal according to the response message of the data acquisition node terminal specifically includes:
the method comprises the steps that an instruction management platform terminal sends a wake-up instruction to a data acquisition node terminal through the Internet of things, and response information and response time of the data acquisition node terminal about the wake-up instruction are obtained;
analyzing and processing the response message, judging whether the data acquisition node terminal is in an awake state or not, and judging whether the response time is smaller than a preset time threshold or not;
if the data acquisition node terminal is not in the wake-up state, indicating that the data acquisition node terminal does not acquire data;
if the data acquisition node terminal is in an awake state and the response time is smaller than a preset time threshold, the data acquisition node terminal is instructed to acquire data at a first sampling frequency;
if the data acquisition node terminal is in an awake state and the response time is greater than or equal to a preset time threshold, the data acquisition node terminal is instructed to acquire data at a second sampling frequency; wherein the first sampling frequency is greater than the second sampling frequency.
Further, in the step S1, the method further includes:
when the data acquisition node terminal receives the wake-up instruction, generating a response message about the wake-up instruction, wherein the response message comprises a wake-up state of the data acquisition node terminal, a time when the data acquisition node terminal receives the wake-up instruction and a time when the response message is sent, and meanwhile, the front end of each time is provided with data calibration, and the process is as follows:
step S101, utilizing the following formula (1), according to the information received by the indication management platform terminal, judging which node terminal wake-up instruction response message the information is,
in the above formula (1), I represents that the information received by the indication management platform terminal is a wake-up instruction response message of the I-th node terminal; g 16 A 16-system form representing the information received by the indication management platform terminal; l (L) A A frame header generic data length representing a 16-ary form of a wake-up instruction reply message;>>representing a right shift; a is that 16 (i) A 16-system form of a response message frame header of a preset ith node terminal is represented; n represents the total number of node terminals;substituting the value of i from 1 to n into a bracket to obtain an i value satisfying the bracket formula, and if any i value does not exist to satisfy the bracket formula, indicating that the formula has no solution;
if the I does not exist, that is, the formula (1) does not have a solution, the information received by the indication management platform terminal is useless information, and the received information is discarded at the moment;
step S102, extracting the time when the data acquisition node terminal receives the wake-up instruction and the time when the data acquisition node terminal transmits the response message from the response message of the wake-up instruction by using the following formula (2),
in the above formula (2), t in (I) Indicating the moment when the I-th data acquisition node terminal receives the wake-up instruction; t is t out (I) Indicating the moment when the I-th data acquisition node terminal sends the response message; b (B) 16 (in) represents t set in the reply message in (I) 16 scale data before time data, the number of data bits is uniform L B A bit; b (B) 16 (out) represents t set in the reply message out (I) 16 scale data before time data, the number of data bits is uniform L B A bit; g 16 (k+1→k+L B ) Representing the extracted data G 16 From the (k+1) th to the (k+L) th bit B Data on bits; k represents an integer variable; len (G) 16 ) Representing data G 16 Is a data total bit number of (2);represents taking the value of k from 1 to len (G 16 )-L B Substituting the value into a bracket to obtain a value of k in the bracket; k1 K2 represents an arithmetic intermediate quantity; l (L) t Representing t in response message in (I) Time of day data or t in reply message out (I) Preset data bit values of the time data; g 16 (K1+L B +1→K1+L B +L t ) Representing the extracted data G 16 K1+L of (B) B +1 to K1+L B +L t Data on bits; g 16 (K2+L B +1→K2+L B +L t ) Representing the extracted data G 16 Middle (f)K2+L B +1 to K2+L B +L t Data on bits; [] 10 Representing converting the data in brackets into decimal form data;
step S103, obtaining the response time of the data acquisition node terminal about the wake-up instruction according to the time when the data acquisition node terminal receives the wake-up instruction and the time when the response message is sent, the time when the instruction management platform terminal sends the wake-up instruction and the time when the instruction management platform terminal receives the response message by using the following formula (3),
in the above formula (3), Y (I) represents a response time of the I-th data acquisition node terminal with respect to the wake-up instruction; t (T) out (I) Indicating the moment when the indication management platform terminal sends a wake-up instruction to the I-th data acquisition node terminal; t (T) in (I) And indicating the moment when the indication management platform terminal receives the response message.
Further, in the step S1, allocating, by the management platform terminal, a corresponding data transmission link of the internet of things to the data acquisition node terminal specifically includes:
and acquiring gateway addresses of the management platform terminal and the data acquisition node terminal in the awakening state in the Internet of things, and constructing an Internet of things data transmission link between the management platform terminal and the data acquisition node terminal in the awakening state.
Further, in the step S2, analyzing and processing the sampled data returned by the data acquisition node terminal, and determining whether the data acquisition node terminal completes the current data acquisition task specifically includes:
extracting a data identifier from the sampling data returned by the data acquisition node terminal each time, if the data identifier comprises a task name identifier of the current data acquisition task, determining that the corresponding sampling data belongs to the current data acquisition task, otherwise, determining that the corresponding sampling data does not belong to the current data acquisition task;
if the data acquisition node terminal returns the sampling data which does not belong to the current data acquisition task for the first time, judging that the data acquisition node terminal has completed the current data acquisition task, and indicating the management platform terminal to package all the sampling data which belong to the current data acquisition task.
Further, in the step S2, extracting corresponding data summary information from all sampled data of the current data acquisition task, uploading the data summary information to a blockchain, and obtaining hash value information matched with the data summary information specifically includes:
text semantic recognition processing is carried out on all sampling data of a current data acquisition task, so that semantic keywords corresponding to each sampling data are obtained, and all the semantic keywords are formed into data abstract information corresponding to the current data acquisition task;
uploading the data abstract information to a blockchain, carrying out SHA256 algorithm processing on the data abstract information, carrying out hash value information matched with the data abstract information, and carrying out association binding processing on the data abstract information and the corresponding hash value information.
Further, in the step S3, storing the data summary information and the hash value information together in a blockchain section corresponding to the blockchain specifically includes:
and defining a block chain interval with matched size in the block chain according to the total information data quantity of the data abstract information and the hash value information, and storing the associated and bound data abstract information and hash value information in the block chain interval.
Further, in the step S3, storing the sample data, the data summary information, and the hash value information together in a storage section of a database specifically includes:
and according to the total information data quantity of the sampling data, the data abstract information and the hash value information, a storage interval with a matched size is defined in a database, the sampling data is compressed, and then the sampling data, the data abstract information and the hash value information are stored in the storage interval together.
Further, in the step S4, according to the data summary information stored in each of the blockchain section and the storage section, whether the sampling data of the storage section is tampered is determined; according to the above judgment result, the adjusting the data storage state of the storage section specifically includes:
extracting corresponding target hash value information from a data acquisition request from a user terminal, and searching the block chain and the database by taking the target hash value information as an index to obtain a matched block chain interval and a storage interval;
judging whether the data summary information stored in each of the searched block chain section and the storage section is the same, if so, judging that the sampling data of the storage section is not tampered; if the sampling data are different, judging that the sampling data in the storage section are tampered;
and if the sampling data of the storage interval is tampered, carrying out clearing treatment on all the information stored in the storage interval.
Compared with the prior art, the sampling detection method based on the blockchain and the Internet of things comprehensively and continuously controls the data acquisition state of the data acquisition node terminal through the Internet of things, and ensures that sampling data corresponding to the data acquisition node terminal is collected in time; uploading data summary information and hash value information thereof corresponding to the sampled data to a block chain for storage, and uploading the sampled data, the data summary information and the hash value information thereof to a database for storage, so that associated data storage between the database and the block chain is realized; when data sampling searching is needed to be carried out from the database, firstly, searching and comparing data abstract information stored in the block chain and the database by taking hash value information as a reference, and judging whether sampling data stored in the database are tampered or not according to a comparison result, so that the sampling data of the database are subjected to adaptive storage state adjustment; according to the method, the data acquisition node terminals are uniformly managed by the Internet of things, so that real-time control and data collection of the data acquisition node terminals are realized, and the data abstract information stored by the block chain is used as a reference for judging whether the data is tampered, so that whether the sampled data is tampered is accurately judged, and the storage safety and the reliability of the sampled data are improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
The technical scheme of the invention is further described in detail through the drawings and the embodiments.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a sampling detection method based on a blockchain and the internet of things.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a flow chart of a sampling detection method based on a blockchain and the internet of things according to an embodiment of the present invention is shown. The sampling detection method based on the block chain and the Internet of things comprises the following steps:
step S1, after an instruction management platform terminal sends a wake-up instruction to a data acquisition node terminal through the Internet of things, setting a corresponding data acquisition mode for the data acquisition node terminal according to a response message of the data acquisition node terminal; the management platform terminal distributes corresponding data transmission links of the Internet of things to the data acquisition node terminal;
step S2, analyzing and processing the sampling data returned by the data acquisition node terminal, and judging whether the data acquisition node terminal completes the current data acquisition task; extracting corresponding data abstract information from all sampling data of a current data acquisition task, uploading the data abstract information to a block chain, and obtaining hash value information matched with the data abstract information;
step S3, the data summary information and the hash value information are stored in a block chain section corresponding to the block chain together; the sampling data, the data abstract information and the hash value information are stored in a storage interval of a database together;
step S4, judging whether the sampling data of the storage section is tampered or not according to the data abstract information respectively stored in the block chain section and the storage section; and adjusting the data storage state of the storage section according to the judgment result.
The beneficial effects of the technical scheme are as follows: the sampling detection method based on the blockchain and the Internet of things comprehensively and continuously controls the data acquisition state of the data acquisition node terminal through the Internet of things, and ensures that sampling data corresponding to the data acquisition node terminal is collected in time; uploading data summary information and hash value information thereof corresponding to the sampled data to a block chain for storage, and uploading the sampled data, the data summary information and the hash value information thereof to a database for storage, so that associated data storage between the database and the block chain is realized; when data sampling searching is needed to be carried out from the database, firstly, searching and comparing data abstract information stored in the block chain and the database by taking hash value information as a reference, and judging whether sampling data stored in the database are tampered or not according to a comparison result, so that the sampling data of the database are subjected to adaptive storage state adjustment; according to the method, the data acquisition node terminals are uniformly managed by the Internet of things, so that real-time control and data collection of the data acquisition node terminals are realized, and the data abstract information stored by the block chain is used as a reference for judging whether the data is tampered, so that whether the sampled data is tampered is accurately judged, and the storage safety and the reliability of the sampled data are improved.
Preferably, in the step S1, after the instruction management platform terminal sends a wake-up instruction to the data acquisition node terminal through the internet of things, setting a corresponding data acquisition mode for the data acquisition node terminal according to a response message of the data acquisition node terminal specifically includes:
the method comprises the steps that an instruction management platform terminal sends a wake-up instruction to a data acquisition node terminal through the Internet of things, and response information and response time of the data acquisition node terminal about the wake-up instruction are obtained;
analyzing and processing the response message, judging whether the data acquisition node terminal is in an awake state or not, and judging whether the response time is smaller than a preset time threshold value or not;
if the data acquisition node terminal is not in the wake-up state, indicating that the data acquisition node terminal does not acquire data;
if the data acquisition node terminal is in an awake state and the response time is smaller than a preset time threshold, the data acquisition node terminal is instructed to acquire data at a first sampling frequency;
if the data acquisition node terminal is in an awake state and the response time is greater than or equal to a preset time threshold, the data acquisition node terminal is instructed to acquire data at a second sampling frequency; wherein the first sampling frequency is greater than the second sampling frequency.
The beneficial effects of the technical scheme are as follows: according to the method, the management platform terminal is utilized to independently manage the data acquisition node terminal accessed in the Internet of things, the wake-up instruction is sent to the data acquisition node terminal, so that the data acquisition node terminal can be switched from the original dormant state to the wake-up state, whether the data acquisition node terminal is actually switched to the wake-up state or not can be accurately determined by analyzing response information from the data acquisition node terminal, the response speed of the data acquisition node terminal (namely, the data processing speed of the data acquisition node terminal) is judged according to the response time of the data acquisition node terminal in the wake-up state, if the response time is smaller than the preset time threshold, the data processing speed of the data acquisition node terminal is higher, if the response time is larger than or equal to the preset time threshold, the data processing speed of the data acquisition node terminal is lower, and the data acquisition node terminal is instructed to perform data acquisition at different first sampling frequencies or second sampling frequencies at the moment, so that the data acquisition working intensity can be matched with the data processing speed of the data acquisition node terminal, and the condition of data acquisition omission is avoided.
Preferably, in this step S1, further comprising:
when the data acquisition node terminal receives the wake-up instruction, generating a response message about the wake-up instruction, wherein the response message comprises a wake-up state of the data acquisition node terminal, a time when the data acquisition node terminal receives the wake-up instruction and a time when the response message is sent, and meanwhile, the front end of each time is provided with data calibration, and the process is as follows:
step S101, using the following formula (1), according to the information received by the indication management platform terminal, judging which node terminal wake-up instruction response message the information is,
in the above formula (1), I indicates that the information received by the indication management platform terminal is a wake-up instruction response message of the I-th node terminal; g 16 A 16-ary form representing information received by the indication management platform terminal; l (L) A A frame header generic data length representing a 16-ary form of a wake-up instruction reply message;>>representing a right shift; a is that 16 (i) Indicating the preset i node terminal's response16-ary form of reply message frame header; n represents the total number of node terminals;substituting the value of i from 1 to n into a bracket to obtain an i value satisfying the bracket formula, and if any i value does not exist to satisfy the bracket formula, indicating that the formula has no solution;
if I does not exist, namely the formula (1) does not have a solution, the information received by the indication management platform terminal is indicated to be useless information, and the received information is discarded at the moment;
step S102, extracting the time when the data acquisition node terminal receives the wake-up instruction and the time when the data acquisition node terminal transmits the response message from the response message of the wake-up instruction by using the following formula (2),
in the above formula (2), t in (I) Indicating the moment when the I-th data acquisition node terminal receives the wake-up instruction; t is t out (I) Indicating the moment when the I-th data acquisition node terminal sends the response message; b (B) 16 (in) represents t set in the reply message in (I) 16 scale data before time data, the number of data bits is uniform L B A bit; b (B) 16 (out) represents t set in the reply message out (I) 16 scale data before time data, the number of data bits is uniform L B A bit; g 16 (k+1→k+L B ) Representing the extracted data G 16 From the (k+1) th to the (k+L) th bit B Data on bits; k represents an integer variable; len (G) 16 ) Representing data G 16 Is a data total bit number of (2);represents taking the value of k from 1 to len (G 16 )-L B Substituting the value into a bracket to obtain a value of k in the bracket; k1 K2 represents an arithmetic intermediate quantity; l (L) t Representing t in response message in (I) Time of day data or t in reply message out (I) Preset data bit values of the time data; g 16 (K1+L B +1→K1+L B +L t ) Representing the extracted data G 16 K1+L of (B) B +1 to K1+L B +L t Data on bits; g 16 (K2+L B +1→K2+L B +L t ) Representing the extracted data G 16 K2+L of (B) B +1 to K2+L B +L t Data on bits; [] 10 Representing converting the data in brackets into decimal form data;
step S103, obtaining the response time of the data acquisition node terminal about the wake-up instruction according to the time when the data acquisition node terminal receives the wake-up instruction and the time when the instruction management platform terminal transmits the wake-up instruction and the time when the instruction management platform terminal receives the response message by using the following formula (3),
in the above formula (3), Y (I) represents a response time of the I-th data acquisition node terminal with respect to the wake-up instruction; t (T) out (I) Indicating the moment when the indication management platform terminal sends a wake-up instruction to the I-th data acquisition node terminal; t (T) in (I) Indicating the moment when the indication management platform terminal receives the response message.
The beneficial effects of the technical scheme are as follows: by utilizing the formula (1), according to the information received by the indication management platform terminal, judging which node terminal is the wake-up instruction response message of the information, thereby rapidly positioning the node terminal according to the message or rapidly discarding useless data and ensuring the working efficiency of the system; then, the time when the data acquisition node terminal receives the wake-up instruction and the time when the data acquisition node terminal transmits the response message are extracted from the response message of the wake-up instruction by utilizing the formula (2), so that corresponding data is extracted rapidly and intelligently through the calibration state in the information, and the intelligent characteristic of the system is reflected; and finally, obtaining the response time of the data acquisition node terminal about the wake-up instruction according to the time when the data acquisition node terminal receives the wake-up instruction and the time when the response message is sent, the time when the indication management platform terminal sends the wake-up instruction and the time when the indication management platform terminal receives the response message by utilizing the formula (3), thereby comprehensively obtaining the response time from two angles and ensuring the accuracy of the obtained numerical value.
Preferably, in the step S1, allocating, by the management platform terminal, a corresponding data transmission link of the internet of things to the data acquisition node terminal specifically includes:
and acquiring gateway addresses of the management platform terminal and the data acquisition node terminal in the awakening state in the Internet of things, and constructing an Internet of things data transmission link between the management platform terminal and the data acquisition node terminal in the awakening state.
The beneficial effects of the technical scheme are as follows: by the mode, the special data transmission link between the management platform terminal and the data acquisition node terminal can be constructed in the Internet of things, and the transmission efficiency and the transmission reliability of the sampled data are improved.
Preferably, in the step S2, analyzing and processing the sampled data returned by the data acquisition node terminal, and determining whether the data acquisition node terminal completes the current data acquisition task specifically includes:
extracting a data identifier from the sampling data returned by the data acquisition node terminal each time, if the data identifier comprises a task name identifier of the current data acquisition task, determining that the corresponding sampling data belongs to the current data acquisition task, otherwise, determining that the corresponding sampling data does not belong to the current data acquisition task;
if the data acquisition node terminal returns the sampling data which does not belong to the current data acquisition task for the first time, judging that the data acquisition node terminal has completed the current data acquisition task, and indicating the management platform terminal to package all the sampling data which belong to the current data acquisition task.
The beneficial effects of the technical scheme are as follows: by the mode, when the data acquisition node terminal detects, the task name code of the currently executed data acquisition task is added to the sample data formed by detection to serve as the identifier, so that the sample data are distinguished, the sample data returned by the data acquisition node terminal each time are extracted and identified, the data acquisition task to which the sample data belong can be accurately judged, whether the data acquisition node terminal has completed the current data acquisition task or not is conveniently judged, and crosstalk of the sample data of different data acquisition tasks is effectively avoided.
Preferably, in the step S2, extracting corresponding data summary information from all sampled data of the current data acquisition task, and uploading the data summary information to a blockchain, and obtaining hash value information matched with the data summary information specifically includes:
text semantic recognition processing is carried out on all sampling data of a current data acquisition task, so that semantic keywords corresponding to each sampling data are obtained, and all the semantic keywords are formed into data abstract information corresponding to the current data acquisition task;
uploading the data abstract information to a blockchain, carrying out SHA256 algorithm processing on the data abstract information, carrying out hash value information matched with the data abstract information, and carrying out association binding processing on the data abstract information and the corresponding hash value information.
The beneficial effects of the technical scheme are as follows: in actual work, text semantic recognition processing is carried out on all sampling data of a current data acquisition task, one or more keywords with highest occurrence frequency in all keywords obtained through the text semantic recognition processing are used as semantic keywords, and all the semantic keywords are combined to form corresponding data abstract information, so that the data abstract information can carry out comprehensive semantic representation on all the sampling data. And uploading the data summary information to a blockchain, processing the data summary information by using an SHA256 algorithm to obtain corresponding hash value information, and performing association binding processing on the data summary information and the corresponding hash value information, thereby realizing the common storage of the data summary information and the hash value information in the blockchain.
Preferably, in the step S3, storing the data summary information and the hash value information together in the blockchain section corresponding to the blockchain specifically includes:
and defining a block chain interval with matched size in the block chain according to the total information data quantity of the data abstract information and the hash value information, and storing the associated and bound data abstract information and hash value information in the block chain interval.
The beneficial effects of the technical scheme are as follows: by the method, the block chain section with the proper size can be defined for the data summary information and the hash value information in the block chain for storage, so that excessive occupation of the storage space of the block chain is avoided, and the storage space utilization efficiency of the block chain is improved.
Preferably, in the step S3, storing the sample data, the data summary information and the hash value information together in a storage section of a database specifically includes:
and defining a storage interval with matched size in a database according to the total information data quantity of the sampling data, the data abstract information and the hash value information, compressing the sampling data, and then jointly storing the sampling data, the data abstract information and the hash value information in the storage interval.
The beneficial effects of the technical scheme are as follows: by the method, the storage interval of the database with proper size can be defined for the sampling data, the data summary information and the hash value information in the blockchain for storage, so that excessive occupation of the storage space of the database is avoided, and the storage space utilization efficiency of the database is improved.
Preferably, in the step S4, whether the sampling data of the storage section is tampered is determined according to the data summary information stored in each of the blockchain section and the storage section; according to the judging result, the adjusting the data storage state of the storage interval specifically comprises:
extracting corresponding target hash value information from a data acquisition request from a user terminal, and searching the blockchain and the database by taking the target hash value information as an index to obtain a matched blockchain section and a storage section;
judging whether the data summary information stored in each of the searched block chain section and the storage section is the same, if so, judging that the sampling data of the storage section is not tampered; if the sampling data are different, judging that the sampling data in the storage interval are tampered;
and if the sampling data of the storage interval is tampered, carrying out emptying treatment on all the information stored in the storage interval.
The beneficial effects of the technical scheme are as follows: by the method, the target hash value information contained in the data acquisition request of the user terminal is taken as an index, the block chain section and the storage section where the hash value information corresponding to the target hash value information is located are searched from the block chain and the database, the respective data summary information of the searched block chain section and the storage section is compared, whether the sampling data of the storage section are tampered or not is judged according to the comparison result, and then all the information stored in the storage section with the tampered sampling data is subjected to clearing processing, so that the tampered sampling data stored in the storage space is prevented from influencing the reliability of subsequent data processing.
According to the content of the embodiment, the sampling detection method based on the blockchain and the Internet of things comprehensively and continuously controls the data acquisition state of the data acquisition node terminal through the Internet of things, and ensures that sampling data corresponding to the data acquisition node terminal is collected in time; uploading data summary information and hash value information thereof corresponding to the sampled data to a block chain for storage, and uploading the sampled data, the data summary information and the hash value information thereof to a database for storage, so that associated data storage between the database and the block chain is realized; when data sampling searching is needed to be carried out from the database, firstly, searching and comparing data abstract information stored in the block chain and the database by taking hash value information as a reference, and judging whether sampling data stored in the database are tampered or not according to a comparison result, so that the sampling data of the database are subjected to adaptive storage state adjustment; according to the method, the data acquisition node terminals are uniformly managed by the Internet of things, so that real-time control and data collection of the data acquisition node terminals are realized, and the data abstract information stored by the block chain is used as a reference for judging whether the data is tampered, so that whether the sampled data is tampered is accurately judged, and the storage safety and the reliability of the sampled data are improved.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (9)

1. The sampling detection method based on the block chain and the Internet of things is characterized by comprising the following steps of:
step S1, after an instruction management platform terminal sends a wake-up instruction to a data acquisition node terminal through the Internet of things, setting a corresponding data acquisition mode for the data acquisition node terminal according to a response message of the data acquisition node terminal; distributing corresponding data transmission links of the Internet of things to the data acquisition node terminal through the management platform terminal;
step S2, analyzing and processing the sampling data returned by the data acquisition node terminal, and judging whether the data acquisition node terminal completes the current data acquisition task; extracting corresponding data abstract information from all sampling data of a current data acquisition task, uploading the data abstract information to a block chain, and obtaining hash value information matched with the data abstract information;
step S3, the data abstract information and the hash value information are stored in a block chain section corresponding to the block chain together; the sampling data, the data abstract information and the hash value information are stored in a storage interval of a database together;
step S4, judging whether sampling data of the storage section is tampered or not according to data abstract information respectively stored in the block chain section and the storage section; and adjusting the data storage state of the storage section according to the judgment result.
2. The blockchain and internet of things-based sampling detection method as in claim 1, wherein: in the step S1, after the management platform terminal is instructed to send a wake-up instruction to the data acquisition node terminal through the internet of things, setting a corresponding data acquisition mode for the data acquisition node terminal according to the response message of the data acquisition node terminal specifically includes:
the method comprises the steps that an instruction management platform terminal sends a wake-up instruction to a data acquisition node terminal through the Internet of things, and response information and response time of the data acquisition node terminal about the wake-up instruction are obtained;
analyzing and processing the response message, judging whether the data acquisition node terminal is in an awake state or not, and judging whether the response time is smaller than a preset time threshold or not;
if the data acquisition node terminal is not in the wake-up state, indicating that the data acquisition node terminal does not acquire data;
if the data acquisition node terminal is in an awake state and the response time is smaller than a preset time threshold, the data acquisition node terminal is instructed to acquire data at a first sampling frequency;
if the data acquisition node terminal is in an awake state and the response time is greater than or equal to a preset time threshold, the data acquisition node terminal is instructed to acquire data at a second sampling frequency; wherein the first sampling frequency is greater than the second sampling frequency.
3. The blockchain and internet of things-based sampling detection method as in claim 2, wherein: in the step S1, further includes:
when the data acquisition node terminal receives the wake-up instruction, generating a response message about the wake-up instruction, wherein the response message comprises a wake-up state of the data acquisition node terminal, a time when the data acquisition node terminal receives the wake-up instruction and a time when the response message is sent, and meanwhile, the front end of each time is provided with data calibration, and the process is as follows:
step S101, utilizing the following formula (1), according to the information received by the indication management platform terminal, judging which node terminal wake-up instruction response message the information is,
in the above formula (1), I represents that the information received by the indication management platform terminal is a wake-up instruction response message of the I-th node terminal; g 16 A 16-system form representing the information received by the indication management platform terminal; l (L) A A frame header generic data length representing a 16-ary form of a wake-up instruction reply message;>>representing a right shift; a is that 16 (i) A 16-system form of a response message frame header of a preset ith node terminal is represented; n represents the total number of node terminals;substituting the value of i from 1 to n into a bracket to obtain an i value satisfying the bracket formula, and if any i value does not exist to satisfy the bracket formula, indicating that the formula has no solution;
if the I does not exist, that is, the formula (1) does not have a solution, the information received by the indication management platform terminal is useless information, and the received information is discarded at the moment;
step S102, extracting the time when the data acquisition node terminal receives the wake-up instruction and the time when the data acquisition node terminal transmits the response message from the response message of the wake-up instruction by using the following formula (2),
in the above formula (2), t in (I) Representing the I-th data acquisitionThe node terminal receives the wake-up instruction; t is t out (I) Indicating the moment when the I-th data acquisition node terminal sends the response message; b (B) 16 (in) represents t set in the reply message in (I) 16 scale data before time data, the number of data bits is uniform L B A bit; b (B) 16 (out) represents t set in the reply message out (I) 16 scale data before time data, the number of data bits is uniform L B A bit; g 16 (k+1→k+L B ) Representing the extracted data G 16 From the (k+1) th to the (k+L) th bit B Data on bits; k represents an integer variable; len (G) 16 ) Representing data G 16 Is a data total bit number of (2);represents taking the value of k from 1 to len (G 16 )-L B Substituting the value into a bracket to obtain a value of k in the bracket; k1 K2 represents an arithmetic intermediate quantity; l (L) t Representing t in response message in (I) Time of day data or t in reply message out (I) Preset data bit values of the time data; g 16 (K1+L B +1→K1+L B +L t ) Representing the extracted data G 16 K1+L of (B) B +1 to K1+L B +L t Data on bits; g 16 (K2+L B +1→K2+L B +L t ) Representing the extracted data G 16 K2+L of (B) B +1 to K2+L B +L t Data on bits; [] 10 Representing converting the data in brackets into decimal form data;
step S103, obtaining the response time of the data acquisition node terminal about the wake-up instruction according to the time when the data acquisition node terminal receives the wake-up instruction and the time when the response message is sent, the time when the instruction management platform terminal sends the wake-up instruction and the time when the instruction management platform terminal receives the response message by using the following formula (3),
in the above formula (3), Y (I) represents a response time of the I-th data acquisition node terminal with respect to the wake-up instruction; t (T) out (I) Indicating the moment when the indication management platform terminal sends a wake-up instruction to the I-th data acquisition node terminal; t (T) in (I) And indicating the moment when the indication management platform terminal receives the response message.
4. The blockchain and internet of things-based sampling detection method as in claim 2, wherein: in the step S1, allocating, by the management platform terminal, a corresponding data transmission link of the internet of things to the data acquisition node terminal specifically includes:
and acquiring gateway addresses of the management platform terminal and the data acquisition node terminal in the awakening state in the Internet of things, and constructing an Internet of things data transmission link between the management platform terminal and the data acquisition node terminal in the awakening state.
5. The blockchain and internet of things-based sampling detection method as in claim 4, wherein: in the step S2, analyzing and processing the sampled data returned by the data acquisition node terminal, and determining whether the data acquisition node terminal completes the current data acquisition task specifically includes: extracting a data identifier from the sampling data returned by the data acquisition node terminal each time, if the data identifier comprises a task name identifier of the current data acquisition task, determining that the corresponding sampling data belongs to the current data acquisition task, otherwise, determining that the corresponding sampling data does not belong to the current data acquisition task;
if the data acquisition node terminal returns the sampling data which does not belong to the current data acquisition task for the first time, judging that the data acquisition node terminal has completed the current data acquisition task, and indicating the management platform terminal to package all the sampling data which belong to the current data acquisition task.
6. The blockchain and internet of things-based sampling detection method as in claim 5, wherein: in the step S2, extracting corresponding data summary information from all sampled data of the current data acquisition task, uploading the data summary information to a blockchain, and obtaining hash value information matched with the data summary information specifically includes:
text semantic recognition processing is carried out on all sampling data of a current data acquisition task, so that semantic keywords corresponding to each sampling data are obtained, and all the semantic keywords are formed into data abstract information corresponding to the current data acquisition task;
uploading the data abstract information to a blockchain, carrying out SHA256 algorithm processing on the data abstract information, carrying out hash value information matched with the data abstract information, and carrying out association binding processing on the data abstract information and the corresponding hash value information.
7. The blockchain and internet of things-based sampling detection method of claim 6, wherein: in the step S3, storing the data summary information and the hash value information together in a blockchain section corresponding to the blockchain specifically includes:
and defining a block chain interval with matched size in the block chain according to the total information data quantity of the data abstract information and the hash value information, and storing the associated and bound data abstract information and hash value information in the block chain interval.
8. The blockchain and internet of things-based sampling detection method of claim 7, wherein: in the step S3, storing the sampling data, the data summary information, and the hash value information together in a storage section of a database specifically includes:
and according to the total information data quantity of the sampling data, the data abstract information and the hash value information, a storage interval with a matched size is defined in a database, the sampling data is compressed, and then the sampling data, the data abstract information and the hash value information are stored in the storage interval together.
9. The blockchain and internet of things-based sampling detection method of claim 8, wherein: in the step S4, according to the data summary information stored in each of the blockchain section and the storage section, whether the sampling data in the storage section is tampered is judged; according to the above judgment result, the adjusting the data storage state of the storage section specifically includes:
extracting corresponding target hash value information from a data acquisition request from a user terminal, and searching the block chain and the database by taking the target hash value information as an index to obtain a matched block chain interval and a storage interval;
judging whether the data summary information stored in each of the searched block chain section and the storage section is the same, if so, judging that the sampling data of the storage section is not tampered; if the sampling data are different, judging that the sampling data in the storage section are tampered;
and if the sampling data of the storage interval is tampered, carrying out clearing treatment on all the information stored in the storage interval.
CN202211715424.7A 2022-12-28 2022-12-28 Sampling detection method based on block chain and Internet of things Pending CN116821970A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211715424.7A CN116821970A (en) 2022-12-28 2022-12-28 Sampling detection method based on block chain and Internet of things

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211715424.7A CN116821970A (en) 2022-12-28 2022-12-28 Sampling detection method based on block chain and Internet of things

Publications (1)

Publication Number Publication Date
CN116821970A true CN116821970A (en) 2023-09-29

Family

ID=88115493

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211715424.7A Pending CN116821970A (en) 2022-12-28 2022-12-28 Sampling detection method based on block chain and Internet of things

Country Status (1)

Country Link
CN (1) CN116821970A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117061239A (en) * 2023-10-10 2023-11-14 国网四川省电力公司信息通信公司 Method and system for safely uploading and storing operation data of Internet of things terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117061239A (en) * 2023-10-10 2023-11-14 国网四川省电力公司信息通信公司 Method and system for safely uploading and storing operation data of Internet of things terminal
CN117061239B (en) * 2023-10-10 2023-12-22 国网四川省电力公司信息通信公司 Method and system for safely uploading and storing operation data of Internet of things terminal

Similar Documents

Publication Publication Date Title
CN111126622A (en) Data anomaly detection method and device
US20200344042A1 (en) Verification system and method for cooperating with blockchain and off-chain devices
US11876909B2 (en) Verification system and method for chaining data
CN116821970A (en) Sampling detection method based on block chain and Internet of things
CN112565378A (en) Cloud native resource dynamic prediction method and device, computer equipment and storage medium
CN113204567B (en) Big data judicial case analysis processing system
CN112351088A (en) CDN cache method, device, computer equipment and storage medium
CN113946294A (en) Distributed storage system and data processing method thereof
CN116915259A (en) Bin allocation data optimized storage method and system based on internet of things
CN115278737A (en) Data acquisition method of 5G network
CN116546025B (en) Cloud computing-based edge data management system
CN116482713A (en) Navigation data verification method for Beidou navigation receiver
CN114422608B (en) Data transmission method, device and equipment
CN109409855B (en) Metablock and generation, identification and filtering method thereof
CN116418674B (en) Method and device for automatic low-delay management of intelligent internet of things VPN router system
CN113158497A (en) Online service experiment method and device, computer equipment and storage medium
CN110501952B (en) Information acquisition equipment and management method
CN114817641B (en) Industrial data acquisition method and device and electronic equipment
CN115833843B (en) Vehicle operation monitoring data storage optimization method and management platform
CN113836457B (en) Mobile internet terminal cache management method, system and storage medium based on information identification and analysis
CN116881304B (en) API gateway arrangement management system and method based on distributed EDI
CN109165220B (en) Data matching calculation method
CN117557208A (en) Intelligent judicial data acquisition method and system
CN117439988A (en) Cloud platform data transmission method for file interface
CN117834586A (en) DNS cache management method and device, electronic equipment and storage medium

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