A method and device for managing Internet of Things data based on a dual-chain blockchain system
By adopting a double-chain blockchain system in IoT data management, data is cached and stored in the auxiliary chain network and stored in the main chain network for a long time, the problem of excessive data storage space is solved, and data tampering is prevented, and efficient IoT data management is achieved.
Patent Information
- Application Number
- CN202110459588.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-27
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2041-04-27
AI Technical Summary
The prior art takes up too much storage space when storing large amounts of data evidence, which exceeds the tolerance of conventional storage devices. When using the traditional cache batch hashing method, data may be tampered with during storage.
The IoT data management method based on the double-chain blockchain system is adopted, and the transaction data to be stored in the Internet of Things devices is chained to the auxiliary chain network with non-permanent storage for cache and storage, and long-term data storage is carried out in the main chain network with permanent storage for long-term data. After the transaction data of the auxiliary chain block is confirmed on the main chain network, it is saved to the interstellar file system and frees up space to ensure the authenticity of the data.
This greatly reduces the storage space required for large amounts of data storage, makes it possible to store IoT data in a timely manner, reduces the storage space required for large batches of data storage, and prevents the risk of data being tampered with, and improves the efficiency of IoT data management.
Smart Images

Figure CN115348038B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, and more particularly to a method and device for managing Internet of Things data based on a dual-chain blockchain system. In addition, it also relates to an electronic device and a non-transient computer-readable storage medium. Background Art
[0002] In the process of storing a large amount of data with existing technologies, such as the need to store data from IoT sensors every second, or to store data for each frame in a surveillance video, the amount of data to be stored is extremely large, and the problem of the storage space occupied by the storage records on the blockchain is often faced. Calculated based on the average 8KB of space occupied by each piece of storage data in each blockchain node, in a blockchain network with 50 nodes, one piece of storage data will occupy 400KB of space. Taking the data on the blockchain of IoT devices as an example, if there are 100,000 IoT devices that need to be on the chain, and each device uploads 100,000 pieces of data every day, the new storage space added every day will be as high as 4PB, which is completely beyond the tolerance of conventional storage.
[0003] In order to reduce the frequency of evidence storage, existing methods often cache data locally first. Among them, the method of caching data locally hashes the data as a whole and uploads it to the chain at regular intervals. However, this method results in a certain time difference between data generation and data upload. During this period, the data is only cached in local storage, which poses a great risk of being tampered with. Therefore, how to design an IoT data management solution based on a dual-chain blockchain system has become an important research topic in this field. Summary of the invention
[0004] To this end, the present invention provides an Internet of Things data management method and device based on a dual-chain blockchain system to solve the problem that the existing technology occupies too much storage space when storing a large amount of data, which exceeds the tolerance of conventional storage devices. If the traditional cache batch hash chain method is used, the data may be tampered with during storage.
[0005] The present invention provides an Internet of Things data management method based on a dual-chain blockchain system, comprising: uploading transaction data to be stored by an Internet of Things device to an auxiliary chain network of a blockchain node; the auxiliary chain network is a blockchain network with non-permanent storage and periodic clearing;
[0006] Extracting transaction data of the auxiliary chain block in the auxiliary chain network, performing hash calculation on the transaction data to obtain a first transaction evidence; saving the first transaction evidence to the main chain network of the blockchain node; the main chain network is a blockchain network with permanent storage;
[0007] After the main chain network confirms the first transaction evidence, the extracted transaction data of the auxiliary chain block is saved in a preset interplanetary file system, and the space occupied by the auxiliary chain block is released.
[0008] Furthermore, the IoT data management method based on the dual-chain blockchain system further includes: performing hash calculation on the transaction data stored in the interplanetary file system to obtain a corresponding second transaction evidence;
[0009] The second transaction evidence is compared with the first transaction evidence to determine whether the second transaction evidence is equal to the first transaction evidence. If so, it is determined that the transaction data is authentic; if not, it is determined that the transaction data has been tampered with.
[0010] Furthermore, the storing of the first transaction evidence in the main chain network of the blockchain node specifically includes: pre-setting the frequency of uploading the first transaction evidence to the main chain network, and storing the first transaction evidence in the main chain network of the blockchain node according to the frequency.
[0011] Furthermore, the IoT data management method based on the dual-chain blockchain system also includes: determining the frequency of uploading the first transaction evidence to the main chain network based on the time period of generating the auxiliary chain block.
[0012] Furthermore, the IoT data management method based on the dual-chain blockchain system also includes: determining the cache time of the transaction data on the auxiliary chain network according to the frequency of the first transaction evidence being uploaded to the main chain network.
[0013] Furthermore, the second transaction evidence is compared with the first transaction evidence to determine whether the second transaction evidence is equal to the first transaction evidence, specifically: the second hash value corresponding to the transaction data stored in the interplanetary file system is compared with the first hash value stored in the main chain network to determine whether the second hash value is equal to the first hash value.
[0014] The present invention also provides an IoT data management device based on a dual-chain blockchain system, comprising: a data cache unit, used to upload transaction data to be stored by IoT devices to an auxiliary chain network of blockchain nodes; the auxiliary chain network is a blockchain network with non-permanent storage and periodic clearing;
[0015] A data evidence unit, used for extracting transaction data of an auxiliary chain block in the auxiliary chain network, performing hash calculation on the transaction data to obtain a first transaction evidence; and storing the first transaction evidence in the main chain network of the blockchain node; the main chain network is a blockchain network with permanent storage;
[0016] The data storage and space release unit is used to save the extracted transaction data of the auxiliary chain block into a preset interplanetary file system and release the space occupied by the auxiliary chain block after the main chain network confirms the first transaction evidence.
[0017] Furthermore, the IoT data management device based on the dual-chain blockchain system further includes:
[0018] A hash calculation module, used for performing hash calculation on the transaction data stored in the InterPlanetary File System to obtain a corresponding second transaction evidence;
[0019] The data verification module is used to compare the second transaction evidence with the first transaction evidence to determine whether the second transaction evidence is equal to the first transaction evidence. If so, it is determined that the transaction data is authentic; if not, it is determined that the transaction data has been tampered with.
[0020] Furthermore, the data storage unit is specifically used to: pre-set the frequency of uploading the first transaction evidence to the main chain network, and save the first transaction evidence to the main chain network of the blockchain node according to the frequency.
[0021] Furthermore, the Internet of Things data management device based on the dual-chain blockchain system also includes: an on-chain main chain frequency determination unit, which is used to determine the frequency of the first transaction evidence on-chain main chain network based on the time period of generating the auxiliary chain block.
[0022] Furthermore, the IoT data management device based on the dual-chain blockchain system also includes: a cache time determination unit, which is used to determine the cache time of the transaction data on the auxiliary chain network according to the frequency of the first transaction evidence being uploaded to the main chain network.
[0023] Furthermore, the data verification module is specifically used to compare the second hash value corresponding to the transaction data stored in the interplanetary file system with the first hash value stored in the main chain network to determine whether the second hash value is equal to the first hash value.
[0024] Correspondingly, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the Internet of Things data management method based on the dual-chain blockchain system as described in any one of the above are implemented.
[0025] Correspondingly, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the Internet of Things data management method based on a dual-chain blockchain system as described in any one of the above are implemented.
[0026] By adopting the Internet of Things data management method based on the dual-chain blockchain system described in the present invention, it is possible to use the auxiliary chain network of non-permanent storage to store cached data, and the permanent main chain network to store long-term data, which greatly reduces the storage space required for large-scale data storage, makes it possible to store Internet of Things data on the chain in a timely manner, reduces the storage space required for large-scale data storage, and opens up an on-chain cache area for data to be uploaded to the chain, preventing the risk of data tampering caused by using a local cache area, thereby improving the efficiency of Internet of Things data management. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 A flowchart of an Internet of Things data management method based on a dual-chain blockchain system provided by an embodiment of the present invention;
[0029] Figure 2 A schematic diagram of the overall architecture of a dual-chain blockchain system provided by an embodiment of the present invention;
[0030] Figure 3 A schematic diagram of the auxiliary chain data persistence process provided by an embodiment of the present invention;
[0031] Figure 4 A schematic diagram of the structure of an Internet of Things data management device based on a dual-chain blockchain system provided by an embodiment of the present invention;
[0032] Figure 5 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] The following is a detailed description of an embodiment of the Internet of Things data management method based on a dual-chain blockchain system according to the present invention. Figure 1As shown, it is a flow chart of the Internet of Things data management method based on the dual-chain blockchain system provided by an embodiment of the present invention. The specific implementation process includes the following steps:
[0035] Step 101: Upload the transaction data to be stored by the IoT device to the auxiliary chain network of the blockchain node; wherein the auxiliary chain network is a blockchain network with non-permanent storage and periodic clearing.
[0036] like Figure 2 As shown, in the embodiment of the present invention, the transaction data to be stored by each IoT device can be first stored on each auxiliary chain node of a non-permanent, periodically cleared auxiliary chain network. The key of the on-chain data is "device ID + stored data ID", and the value is the transaction data to be stored. A sub-chain is created for each IoT device through the auxiliary chain network for data storage. The sub-chain can be used as a trusted cache area before the transaction data to be stored of this IoT device is uploaded to the main chain network.
[0037] Step 102: extracting the transaction data of the auxiliary chain block in the auxiliary chain network, performing hash calculation on the transaction data to obtain a first transaction evidence; saving the first transaction evidence to the main chain network of the blockchain node; the main chain network is a blockchain network with permanent storage.
[0038] In this step, the frequency of uploading the first transaction evidence to the main chain network can be preset, and the first transaction evidence is saved to the main chain network of the blockchain node according to the frequency. Specifically, the frequency of uploading the first transaction evidence to the main chain network needs to be determined based on the time period of generating the auxiliary chain block; and the cache time of the transaction data on the auxiliary chain network is further determined according to the frequency of uploading the first transaction evidence to the main chain network.
[0039] Specifically, Figure 3 As shown, the frequency of data on the auxiliary chain network to the main chain network is pre-set, and the generation of 3 auxiliary chain blocks (block A, block B, block C) is set as an auxiliary chain data persistence cycle. Among them, the frequency of data on the auxiliary chain network to the main chain network determines the time for data to be cached on the auxiliary chain network. Extract the transaction data in blocks A1~A3, B1~B3, C1~C3, arrange them in order and perform hash calculations, and the corresponding hash values h(A1~A3), h(B1~B3), h(C1~C3) can be obtained respectively. The three transaction data h(A1~A3), h(B1~B3), h(C1~C3) are chained to the main chain network.
[0040] Step 103: After the main chain network confirms the first transaction evidence, the extracted transaction data of the auxiliary chain block is saved in a preset interplanetary file system, and the space occupied by the auxiliary chain block is released.
[0041] like Figure 3 As shown in the figure, after the main chain network confirms the three transaction data h(A1~A3), h(B1~B3), and h(C1~C3), the auxiliary chain network will extract the transaction data in the auxiliary chain blocks A1~A3, B1~B3, and C1~C3 and save them on the IPFS (Inter Planetary File System), and release the space occupied by the auxiliary chain blocks A1~A3, B1~B3, and C1~C3.
[0042] In addition, during the specific implementation process, the transaction data stored in the InterPlanetary File System may be hashed to obtain a corresponding second transaction evidence; the second transaction evidence is compared with the first transaction evidence to determine whether the second transaction evidence is equal to the first transaction evidence. If so, it is determined that the transaction data is authentic; if not, it is determined that the transaction data has been tampered with. Among them, the second transaction evidence is compared with the first transaction evidence to determine whether the second transaction evidence is equal to the first transaction evidence, specifically: the second hash value corresponding to the transaction data stored in the InterPlanetary File System is compared with the first hash value stored in the main chain network to determine whether the second hash value is equal to the first hash value. Figure 3 As shown, in the above example, the transactions in the auxiliary chain blocks A1~A3, B1~B3, and C1~C3 are saved on IPFS, and the three transaction certificates h(A1~A3), h(B1~B3), and h(C1~C3) are saved on the main chain network. To determine whether a transaction in A1 is true, it is necessary to sort the transactions in the A1~A3 blocks in order and perform hash calculation to obtain h(A1~A3)', and determine whether h(A1~A3) and h(A1~A3)' are equal. If they are equal, the data must be true, otherwise the data may be tampered with.
[0043] For example, in a complete embodiment:
[0044] like Figure 2 In the overall architecture of the dual-chain blockchain system shown, each blockchain node consists of a main chain network and an auxiliary chain network, and IPFS is responsible for storing transaction data that has been cleared from the auxiliary chain network.
[0045] The data to be stored on each IoT device is first stored on each node of a non-permanent, periodically cleared blockchain A (ancillary chain network). The key of the on-chain data is "device ID + stored data ID", and the value is the stored data. The ancillary chain network creates a sub-chain network for each IoT device to store data, and the sub-chain network can be used as a trusted cache area before the stored transaction data of this IoT device is uploaded to the main chain network.
[0046] Then, the transaction data on the auxiliary chain network is hashed and transferred to blockchain B (main chain network) for permanent storage, and the data on blockchain A is transferred to IPFS for preservation. Among them, the non-permanent storage auxiliary chain network is used to store cached data, and the permanent main chain network is used to store long-term data, which reduces the storage space required for large-scale data storage and reduces the possibility of cached data being tampered with.
[0047] Pre-set the frequency of transaction data on the auxiliary chain network to the main chain network, such as Figure 3 The setting shown generates 3 auxiliary chain blocks as a data persistence cycle in the auxiliary chain network. The frequency of transaction data on the auxiliary chain network determines the time for transaction data to be cached on the auxiliary chain network. Extract the transaction data in the auxiliary chain blocks A1~A3, B1~B3, C1~C3, arrange them in order and perform hash calculation to obtain h(A1~A3), h(B1~B3), h(C1~C3) respectively. Upload the three transactions h(A1~A3), h(B1~B3), h(C1~C3) to the main chain network. After the auxiliary chain network confirms the three transactions h(A1~A3), h(B1~B3), h(C1~C3) on the main chain network, it saves the extracted transactions in the auxiliary chain blocks A1~A3, B1~B3, C1~C3 to IPFS and releases the space occupied by the auxiliary chain blocks A1~A3, B1~B3, C1~C3.
[0048] During the data query process, the transaction data in the auxiliary chain blocks A1~A3, B1~B3, and C1~C3 are saved on IPFS, and the three transaction certificates h(A1~A3), h(B1~B3), and h(C1~C3) are saved on the main chain. To determine whether a transaction in A1 is true, the transaction data in the auxiliary chain blocks A1~A3 need to be sorted in order and hashed to obtain h(A1~A3)', and determine whether h(A1~A3) is equal to h(A1~A3)'. If they are equal, the transaction data must be true, otherwise the transaction data may be tampered with.
[0049] By adopting the Internet of Things data management method based on the dual-chain blockchain system described in the embodiment of the present invention, it is possible to use the auxiliary chain network of non-permanent storage to store cached data, and the permanent main chain network to store long-term data, which greatly reduces the storage space required for large-scale data storage, makes it possible to store Internet of Things data on the chain in a timely manner, reduces the storage space required for large-scale data storage, and opens up an on-chain cache area for data to be uploaded to the chain, preventing the risk of data tampering caused by using a local cache area, thereby improving the efficiency of Internet of Things data management.
[0050] Corresponding to the IoT data management method based on a dual-chain blockchain system provided above, the present invention also provides an IoT data management device based on a dual-chain blockchain system. Since the embodiment of the device is similar to the above method embodiment, the description is relatively simple. For relevant details, please refer to the description of the above method embodiment. The embodiment of the IoT data management device based on a dual-chain blockchain system described below is only illustrative. Please refer to Figure 4 As shown, it is a structural diagram of an Internet of Things data management device based on a dual-chain blockchain system provided by an embodiment of the present invention. The Internet of Things data management device based on a dual-chain blockchain system described in the present invention specifically includes the following parts:
[0051] The data cache unit 401 is used to upload the transaction data to be stored by the IoT device to the auxiliary chain network of the blockchain node; the auxiliary chain network is a blockchain network with non-permanent storage and periodic clearing;
[0052] The data evidence unit 402 is used to extract the transaction data of the auxiliary chain block in the auxiliary chain network, perform hash calculation on the transaction data, and obtain a first transaction evidence; and save the first transaction evidence to the main chain network of the blockchain node; the main chain network is a blockchain network with permanent storage;
[0053] The data storage and space release unit 403 is used to save the extracted transaction data of the auxiliary chain block to a preset interplanetary file system and release the space occupied by the auxiliary chain block after the main chain network confirms the first transaction evidence.
[0054] The IoT data management device based on the dual-chain blockchain system described in the embodiment of the present invention can use the auxiliary chain network of non-permanent storage to store cached data, and the permanent main chain network to store long-term data, which greatly reduces the storage space required for large-scale data storage, makes it possible to store IoT data on the chain in a timely manner, reduces the storage space required for large-scale data storage, and opens up an on-chain cache area for data to be uploaded to the chain, preventing the risk of data tampering caused by using a local cache area, thereby improving the efficiency of IoT data management.
[0055] Corresponding to the IoT data management method based on the dual-chain blockchain system provided above, the present invention also provides an electronic device. Since the embodiment of the electronic device is similar to the above method embodiment, the description is relatively simple. For relevant parts, please refer to the description of the above method embodiment. The electronic device described below is only illustrative. Figure 5 As shown, it is a schematic diagram of the physical structure of an electronic device disclosed in an embodiment of the present invention. The electronic device may include: a processor 501, a memory 502 and a communication bus 503, wherein the processor 501 and the memory 502 communicate with each other through the communication bus 503. The processor 501 may call the logic instructions in the memory 502 to execute the Internet of Things data management method based on the dual-chain blockchain system, the method comprising: uploading the transaction data to be stored by the Internet of Things device to the auxiliary chain network of the blockchain node; the auxiliary chain network is a blockchain network with non-permanent storage and periodic clearing; extracting the transaction data of the auxiliary chain block in the auxiliary chain network, performing hash calculation on the transaction data, and obtaining a first transaction certificate; saving the first transaction certificate to the main chain network of the blockchain node; the main chain network is a blockchain network with permanent storage; after the main chain network confirms the first transaction certificate, saving the extracted transaction data of the auxiliary chain block to a preset interplanetary file system, and releasing the space occupied by the auxiliary chain block.
[0056] In addition, the logic instructions in the above-mentioned memory 502 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0057] On the other hand, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the Internet of Things data management method based on a dual-chain blockchain system provided by the above-mentioned method embodiments, the method including: uploading the transaction data to be stored by the Internet of Things device to the auxiliary chain network of the blockchain node; the auxiliary chain network is a blockchain network with non-permanent storage and periodic clearing; extracting the transaction data of the auxiliary chain block in the auxiliary chain network, hashing the transaction data to obtain a first transaction evidence; saving the first transaction evidence to the main chain network of the blockchain node; the main chain network is a blockchain network with permanent storage; after the main chain network confirms the first transaction evidence, saving the extracted transaction data of the auxiliary chain block to a preset interstellar file system, and releasing the space occupied by the auxiliary chain block.
[0058] On the other hand, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the Internet of Things data management method based on a dual-chain blockchain system provided in the above-mentioned embodiments, the method comprising: uploading the transaction data to be stored in the Internet of Things device to the auxiliary chain network of the blockchain node; the auxiliary chain network is a blockchain network with non-permanent storage and periodic clearing; extracting the transaction data of the auxiliary chain block in the auxiliary chain network, performing hash calculation on the transaction data, and obtaining a first transaction evidence; saving the first transaction evidence to the main chain network of the blockchain node; the main chain network is a blockchain network with permanent storage; after the main chain network confirms the first transaction evidence, saving the extracted transaction data of the auxiliary chain block to a preset interplanetary file system, and releasing the space occupied by the auxiliary chain block.
[0059] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0060] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0061] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for managing IoT data based on a dual-chain blockchain system. It is characterized in that include: Upload the transaction data of IoT devices to be stored on the auxiliary chain network of blockchain nodes; The auxiliary chain network is a blockchain network with non-permanent storage and periodic clearing; The transaction data to be recorded by each IoT device is first stored on each auxiliary chain node of a non-permanent, periodically cleared auxiliary chain network. The key of the on-chain data is the device ID + the recorded data ID, and the value is the transaction data to be recorded. A sub-chain is created for each IoT device through the auxiliary chain network for data recording. The sub-chain serves as a trusted cache area before the transaction data to be recorded by the IoT device is uploaded to the main chain network. Extracting transaction data of the auxiliary chain block in the auxiliary chain network, performing hash calculation on the transaction data to obtain a first transaction evidence; saving the first transaction evidence to the main chain network of the blockchain node; the main chain network is a blockchain network with permanent storage; After the main chain network confirms the first transaction evidence, the extracted transaction data of the auxiliary chain block is saved in a preset interplanetary file system, and the space occupied by the auxiliary chain block is released.
2. According to claim 1, the Internet of Things data management method based on the dual-chain blockchain system, It is characterized in that Also includes: Performing hash calculation on the transaction data stored in the InterPlanetary File System to obtain a corresponding second transaction evidence; The second transaction evidence is compared with the first transaction evidence to determine whether the second transaction evidence is equal to the first transaction evidence. If so, it is determined that the transaction data is authentic; if not, it is determined that the transaction data has been tampered with.
3. According to claim 1, the Internet of Things data management method based on the dual-chain blockchain system, It is characterized in that The storing of the first transaction evidence in the main chain network of the blockchain node specifically includes: pre-setting the frequency of uploading the first transaction evidence to the main chain network, and storing the first transaction evidence in the main chain network of the blockchain node according to the frequency.
4. According to the Internet of Things data management method based on the dual-chain blockchain system according to claim 3, It is characterized in that Also includes: The frequency of uploading the first transaction evidence to the main chain network is determined based on the time period of generating the auxiliary chain block.
5. According to the Internet of Things data management method based on the dual-chain blockchain system according to claim 4, It is characterized in that Also includes: The cache time of the transaction data on the auxiliary chain network is determined according to the frequency of the first transaction evidence being stored on the main chain network.
6. The Internet of Things data management method based on the dual-chain blockchain system according to claim 2, It is characterized in that Compare the second transaction evidence with the first transaction evidence to determine whether the second transaction evidence is equal to the first transaction evidence, specifically: compare the second hash value corresponding to the transaction data stored in the interplanetary file system with the first hash value stored in the main chain network to determine whether the second hash value is equal to the first hash value.
7. An IoT data management device based on a dual-chain blockchain system, It is characterized in that include: The data cache unit is used to upload the transaction data to be stored by the IoT device to the auxiliary chain network of the blockchain node; The auxiliary chain network is a blockchain network with non-permanent storage and periodic clearing. The transaction data to be recorded by each IoT device is first stored on each auxiliary chain node of a non-permanent and periodically cleared auxiliary chain network. The key of the uploaded data is the device ID + the recorded data ID, and the value is the transaction data to be recorded. A sub-chain is created for each IoT device through the auxiliary chain network for data recording. The sub-chain serves as a trusted cache area before the transaction data to be recorded by the IoT device is uploaded to the main chain network. A data evidence unit, used for extracting transaction data of an auxiliary chain block in the auxiliary chain network, performing hash calculation on the transaction data to obtain a first transaction evidence; and storing the first transaction evidence in the main chain network of the blockchain node; The main chain network is a permanently stored blockchain network; The data storage and space release unit is used to save the extracted transaction data of the auxiliary chain block into a preset interplanetary file system and release the space occupied by the auxiliary chain block after the main chain network confirms the first transaction evidence.
8. The Internet of Things data management device based on the dual-chain blockchain system according to claim 7, It is characterized in that Also includes: A hash calculation module, used for performing hash calculation on the transaction data stored in the InterPlanetary File System to obtain a corresponding second transaction evidence; The data verification module is used to compare the second transaction evidence with the first transaction evidence to determine whether the second transaction evidence is equal to the first transaction evidence. If so, it is determined that the transaction data is authentic; if not, it is determined that the transaction data has been tampered with.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the Internet of Things data management method based on the dual-chain blockchain system are implemented as described in any one of claims 1 to 6.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the Internet of Things data management method based on a dual-chain blockchain system are implemented as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Main chain storage method and system based on blockchain intelligent contract and storage medium
CN110033243A