Data management method and device, electronic equipment, storage medium and computer product
By generating public-private key pairs using a built-in software development kit in IoT devices, the problem of easily tampered data in IoT devices is solved, achieving trusted data transmission and enhanced security.
Patent Information
- Application Number
- CN202510302420.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-12-12
AI Technical Summary
When IoT devices collect data and upload it to the blockchain system via a gateway, the data is easily tampered with, resulting in low data security.
A software development kit is built into the IoT device to generate a public-private key pair. The collected data is encrypted using the private key to obtain a digital signature, and the public key is reported to the key service platform. The digital signature is submitted to the blockchain system through the IoT platform. When verifying the data, the application system obtains the public key from the key service platform and the digital signature from the blockchain system to verify the data.
It improves the security of data collected by IoT devices, ensures the trustworthiness of the data source, prevents digital signatures from being tampered with, and enables reliable data transmission.
Smart Images

Figure CN121125103A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things (IoT) technology, and more particularly to a data management method, apparatus, electronic device, storage medium, and computer product. Background Technology
[0002] The Internet of Things (IoT) generates diverse data through various sensors. This data is complex, with significant differences in characteristics, and data security requirements vary depending on the application. Much of the data in IoT systems is real-time sensing data from specific application scenarios, including sensitive data from important industries. Ensuring data security in IoT application systems is crucial for the healthy development of the IoT.
[0003] The goal of information and network security is to ensure the confidentiality, integrity, and availability of protected information (i.e., the CIA principle). This requirement permeates all aspects of the Internet of Things (IoT), including data sensing, data aggregation, data fusion, data transmission, data processing, and decision-making, and reflects the differences between IoT and traditional information system security.
[0004] Based on the distributed, decentralized, and immutable characteristics of blockchain, many current solutions propose combining blockchain with the Internet of Things (IoT) to enhance data credibility. By connecting IoT devices to a blockchain network, functions such as verifiable device identity, encrypted and secure data transmission, and decentralized data management can be achieved, bringing higher credibility and reliability to the IoT.
[0005] In smart metering applications, IoT-related smart terminals (such as smart electricity meters, smart water meters, and smart gas meters) collect data and upload it to the blockchain system via a gateway. The smart terminal layer is only responsible for data collection (e.g., collecting electricity, water, and gas consumption data). The data is uploaded to the blockchain via the gateway and then stored in the relevant application system. The gateway layer signs the data before uploading it to the blockchain and acts as an agent for the smart terminal to perform blockchain interactions. If the gateway is compromised, the data signature can be forged, rendering the on-chain data unreliable. The blockchain layer only records the data hash and the gateway signature, and cannot verify whether the data was genuinely generated by the smart terminal. Therefore, the security of data collected by current IoT devices is low. Summary of the Invention
[0006] This application aims to address at least one of the technical problems existing in related technologies. To this end, this application proposes a data management method, apparatus, electronic device, storage medium, and computer product to solve the problem of data tampering that occurs when IoT terminals upload collected data to a blockchain system via a gateway, thereby improving the security of data collected by IoT devices.
[0007] The data management method according to the first aspect of this application includes: The data collected by the IoT device is encrypted using the private key in the public-private key pair to obtain a digital signature; wherein, the public-private key pair is generated by the IoT device that collects the data based on its built-in software development kit; the public key in the public-private key pair is reported to the key service platform; The digital signature is submitted to the blockchain system via the Internet of Things platform; The collected data is submitted to the application system associated with the IoT device through the IoT platform; wherein, when the application system verifies the collected data, it obtains the public key of the IoT device from the key service platform and obtains the digital signature of the collected data from the blockchain system; and performs data verification based on the digital signature, the collected data and the public key.
[0008] According to one embodiment of this application, the data is encrypted using the private key in the public-private key pair to obtain a digital signature: Perform a hash operation on the collected data to obtain the first hash value; The first hash value is encrypted using the private key from the public-private key pair to obtain a digital signature.
[0009] The data management method according to the second aspect of this application includes: Receive data collected by IoT devices based on the IoT platform; Obtain the public key of the IoT device from the key service platform; the public key is the public key in the public-private key pair reported by the IoT device to the key service platform; the public-private key pair is generated by the IoT device based on the built-in software development kit. Obtain the digital signature of the collected data from the blockchain system; Based on the digital signature, the collected data, and the public key, data verification is performed to obtain the data verification result.
[0010] According to one embodiment of this application, the step of verifying data based on the digital signature, the collected data, and the public key to obtain a data verification result includes: The digital signature is decrypted using the public key to obtain the first hash value; Perform a hash operation on the collected data to obtain a second hash value; The data verification result is determined based on the comparison between the second hash value and the first hash value.
[0011] According to one embodiment of this application, determining the data verification result based on the comparison between the second hash value and the first hash value includes: If the first hash value is the same as the second hash value, the collected data is determined to be real data; If the first hash value is different from the second hash value, the collected data is determined to be abnormal data.
[0012] A data management apparatus according to a third aspect embodiment of this application includes: An encryption module is used to encrypt the data collected by the IoT device based on the private key in the public-private key pair to obtain a digital signature; wherein, the public-private key pair is generated by the IoT device that collects the data based on the built-in software development kit; the public key in the public-private key pair is reported to the key service platform; The first submission module is used to submit the digital signature to the blockchain system through the Internet of Things platform; The second submission module is used to submit the collected data to the application system associated with the IoT device through the IoT platform; wherein, when the application system verifies the collected data, it obtains the public key of the IoT device from the key service platform and obtains the digital signature of the collected data from the blockchain system; and performs data verification based on the digital signature, the collected data and the public key.
[0013] A data management apparatus according to a fourth aspect embodiment of this application includes: The receiving module is used to receive data collected by IoT devices based on the IoT platform; The first acquisition module is used to acquire the public key of the IoT device from the key service platform; the public key is the public key in the public-private key pair reported by the IoT device to the key service platform; the public-private key pair is generated by the IoT device based on the built-in software development kit. The second acquisition module is used to obtain the digital signature of the collected data from the blockchain system; The verification module is used to verify the data based on the digital signature, the collected data, and the public key, and obtain the data verification result.
[0014] An electronic device according to a fifth aspect of this application includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the data management methods described above.
[0015] According to a sixth aspect of the present application, the storage medium is a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the data management method as described above.
[0016] A computer program product according to a seventh aspect of this application includes a computer program that, when executed by a processor, implements any of the data management methods described above.
[0017] The above-described one or more technical solutions in the embodiments of this application have at least the following technical effects: By embedding a Software Development Kit (SDK) into IoT devices, these devices can generate public-private key pairs. The private key in this pair can then be used to encrypt collected data, generating a digital signature and ensuring the trustworthiness of the data source. Simultaneously, the public key can be reported to a key service platform. Furthermore, the digital signature can be submitted to a blockchain system through the IoT platform. The immutability of the blockchain system prevents tampering with the digital signature. After the collected data is submitted to the application system associated with the IoT device through the IoT platform, the application system can obtain the IoT device's public key from the key service platform and the digital signature of the collected data from the blockchain system when verifying the data. Based on the digital signature, the collected data, and the public key, accurate data verification can be performed, thus improving the security of the data collected by the IoT device.
[0018] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is one of the flowcharts illustrating the data management method provided in the embodiments of this application.
[0021] Figure 2 This is the second flowchart illustrating the data management method provided in the embodiments of this application.
[0022] Figure 3 This is a schematic diagram illustrating an application scenario of the data management method provided in the embodiments of this application.
[0023] Figure 4 This is a schematic diagram of the main interaction of the data management method provided in the embodiments of this application.
[0024] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0025] The embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but should not be used to limit the scope of this application.
[0026] In the description of the embodiments of this application, it should be noted that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application. In addition, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0027] In the description of the embodiments of this application, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this application based on the specific circumstances.
[0028] In the embodiments of this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0029] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0030] This application discloses a data management method, apparatus, electronic device, storage medium, and computer product.
[0031] Figure 1 This is one of the flowcharts illustrating the data management method provided in the embodiments of this application, such as... Figure 1 As shown, the data management method includes: Step 110: Encrypt the data collected by the IoT device using the private key in the public-private key pair to obtain a digital signature; wherein, the public-private key pair is generated by the IoT device collecting the data based on the built-in software development kit; the public key in the public-private key pair is reported to the key service platform.
[0032] Step 120: Submit the digital signature to the blockchain system via the Internet of Things platform.
[0033] Step 130: The collected data is submitted to the application system associated with the IoT device through the IoT platform; wherein, when the application system verifies the collected data, it obtains the public key of the IoT device from the key service platform and obtains the digital signature of the collected data from the blockchain system; and verifies the data based on the digital signature, the collected data and the public key.
[0034] It should be noted that the data management method provided in this application can be implemented by an Internet of Things (IoT) device, which may include, but is not limited to, smart meters, smart water meters, smart gas meters, etc. It should also be noted that all data obtained in this application has been acquired through legitimate channels after authorization from the relevant users.
[0035] The IoT device of this application may be equipped with or connected to a data management device, thereby controlling the data management device to execute the data management method of this application.
[0036] It should be noted that the IoT device of this application may include a communication module for communicating with external devices. This communication module may also integrate a software development kit (SDK), which is a blockchain software development kit compatible with IoT blockchain (BoT), thereby enabling the IoT device to interact with the blockchain. The SDK in this application can be referred to as an on-chain SDK.
[0037] The above-mentioned transformation methods are characterized by ease of operation, low integration cost, and fast development speed.
[0038] It should be noted that, after the IoT device is powered on, its built-in software development kit can generate a unique public-private key pair. Furthermore, the IoT device can report the public key of the public-private key pair to a key service platform; the reporting method can be offline or online, and this application does not specify a method.
[0039] It should be noted that when reporting the public key, the IoT device in this application can simultaneously specify and submit the corresponding key identifier. Typically, the International Mobile Equipment Identity (IMEI) of the module where the on-chain SDK resides can be used as the key identifier. In this case, if the IoT device replaces its module, the mapping between the old module's IMEI and its public key should be maintained and set to an invalid state; the mapping between the new module's IMEI and its public key should be established and saved, and set to an enabled state.
[0040] The IoT devices described in this application can collect data; for example, smart meters can collect electricity-related data, smart water meters can collect water-related data, and smart gas meters can collect gas-related data. Furthermore, the IoT devices can generate unique data numbers for the collected data.
[0041] Furthermore, IoT devices can encrypt the collected data using the private key in the public-private key pair, and obtain a digital signature after encryption, which serves as verification information.
[0042] Furthermore, IoT devices can package the collected data's data number, the application for the collected data, and the digital signature, and submit the packaged data to the IoT platform (hereinafter referred to as the OneNET platform) through traditional channels.
[0043] It should be noted that, compared to traditional IoT platforms, this application also incorporates a OneNET-BC module on top of the traditional IoT platform. Therefore, after receiving packaged data submitted by IoT devices, the IoT platform can use the OneNET-BC module to split the packaged data.
[0044] Furthermore, the IoT platform can use the OneNET-BC module to submit the collected data and its data number to the application system associated with the IoT device through traditional channels. Different application systems belong to different entities, and these entities do not have a complete trust relationship; for example, b-1 is an enterprise-side node, and b-2 is a government regulatory / public service department-side node.
[0045] Furthermore, data numbers and digital signatures can be submitted to the blockchain system via the OneNET-BC module through traditional channels, thereby enabling the on-chain verification of data. Due to the immutability of the blockchain, the verification data stored in the blockchain system cannot be tampered with. This utilizes the blockchain's evidence preservation capabilities to retain the verification information of the original data. Simultaneously, the trusted on-chain collection of IoT data extends the scope of blockchain evidence preservation services, shifting the starting point of the evidence preservation service from the time the data is uploaded from off-chain to on-chain to the time of collection by IoT devices.
[0046] The system employs a method of separating public keys and verification information for transmission. Cross-referencing the verification information ensures the credibility of the source data. Furthermore, the data packet segmentation strategy enables more complex authentication mechanisms, enhancing trust between IoT devices and effectively guaranteeing the credibility of the data source and the integrity of the data.
[0047] Therefore, IoT devices can submit digital signatures to the blockchain system through the IoT platform, and submit collected data to the application system associated with the IoT device through the IoT platform.
[0048] When an application system needs to verify the authenticity of a piece of collected data, it can extract the public key of the IoT device for that piece of collected data from the IoT device key service platform. Specifically, the public key can be extracted based on the key identifier.
[0049] Furthermore, the application system can extract the digital signature of the collected data from the blockchain system based on the data number.
[0050] Furthermore, the application system can verify the digital signature extracted from the blockchain system based on the public key and the collected data, thereby completing the data verification and obtaining the data verification result.
[0051] The data verification result can be either that the collected data is real or that the collected data is abnormal. If the collected data is abnormal, it is considered that the collected data may have been tampered with or that the data is abnormal for other reasons.
[0052] This can meet the need for reliable data transmission between IoT device acquisition and on-chain storage, ensuring data reliability from the source of acquisition.
[0053] According to the data management method of this application embodiment, by embedding a software development kit (SDK) in the IoT device, the IoT device can generate a public-private key pair based on the built-in SSD. This allows the collected data to be encrypted using the private key in the public-private key pair to obtain a digital signature, ensuring the trustworthiness of the data source. Simultaneously, the public key in the public-private key pair can be reported to a key service platform. Furthermore, the digital signature can be submitted to a blockchain system through the IoT platform. Based on the immutability of the blockchain system, the digital signature is prevented from being tampered with. Subsequently, after the collected data is submitted to the application system associated with the IoT device through the IoT platform, when the application system verifies the collected data, it can obtain the public key of the IoT device from the key service platform and the digital signature of the collected data from the blockchain system. Therefore, based on the digital signature, the collected data, and the public key, accurate data verification can be performed, thus improving the security of the data collected by the IoT device.
[0054] Based on the above embodiments, the collected data is encrypted using the private key in the public-private key pair to obtain a digital signature: Perform a hash operation on the collected data to obtain the first hash value; The first hash value is encrypted using the private key from the public-private key pair to obtain a digital signature.
[0055] Specifically, after the IoT device completes data collection, it can first perform a hash operation on the collected data. The hash value obtained after the hash operation is defined as the first hash value to distinguish it from subsequent hash values. In this application, the hash operation can be performed using any hash algorithm such as SHA-256, SHA-3, BLAKE2, CRC32, MurmurHash, or CityHash, depending on actual needs; no specific limitation is made in this application.
[0056] It should be noted that the hashing algorithm used by the IoT device in this application to perform hashing operations on the collected data needs to be synchronized with the application system so that the application system can use the same algorithm to perform hashing operations on the collected data when verifying the data, and then verify the data based on the calculation results and other information.
[0057] Furthermore, IoT devices can extract the private key from the public-private key pair and encrypt the first hash value using the private key, thereby obtaining a digital signature of the collected data.
[0058] Based on this, when an application system needs to verify the authenticity of a certain piece of collected data, it can extract the public key of the IoT device for that piece of collected data from the IoT device key service platform. Specifically, the public key can be extracted based on the key identifier.
[0059] Furthermore, the application system can extract the digital signature of the collected data from the blockchain system based on the data number.
[0060] Furthermore, the application system can first perform a hash operation on the collected data using the same hash algorithm as the IoT device to obtain the corresponding hash value. The hash value obtained by the application system can be defined as the second hash value.
[0061] Furthermore, the digital signature can be decrypted using the public key, and the first hash value can be obtained after decryption.
[0062] Furthermore, the first hash value can be compared with the second hash value.
[0063] If the first hash value is determined to be the same as the second hash value, the collected data is confirmed to be real data.
[0064] If the first hash value is determined to be different from the second hash value, the collected data is determined to be abnormal data.
[0065] This application uses the private key in the public-private key pair generated by the IoT device based on the built-in software development kit to encrypt the collected data and obtain a digital signature, which can ensure the trustworthiness of the data source and improve the security of the data collected by the IoT device.
[0066] Figure 2 This is a second flowchart illustrating the data management method provided in the embodiments of this application, as shown below. Figure 2 As shown, the data management method includes: Step 210: Receive the collected data submitted by the IoT device based on the IoT platform.
[0067] Step 220: Obtain the public key of the IoT device from the key service platform; the public key is the public key in the public-private key pair reported by the IoT device to the key service platform; the public-private key pair is generated by the IoT device based on the built-in software development kit.
[0068] Step 230: Obtain the digital signature of the collected data from the blockchain system.
[0069] Step 240: Verify the data based on the digital signature, collected data, and public key to obtain the data verification result.
[0070] It should be noted that the data management method provided in this application embodiment can be implemented by an application system. Different application systems belong to different entities, and there is no complete trust relationship between these entities. For example, b-1 is an enterprise-side node, and b-2 is a government regulatory department / public service department-side node.
[0071] It should be noted that the IoT devices in this application may include, but are not limited to, smart meters, smart water meters, smart gas meters, etc. It should also be noted that all data obtained in this application has been acquired through legitimate channels after authorization from the relevant users.
[0072] The application system of this application can be equipped with or connected to a data management device, thereby controlling the data management device to execute the data management method of this application.
[0073] Specifically, the IoT device of this application may include a communication module for communicating with external devices. This communication module may also integrate a software development kit (SDK), which is a blockchain-compatible SSD, thereby enabling the IoT device to interact with the blockchain. The SDK in this application can be referred to as an on-chain SDK.
[0074] It should be noted that, after the IoT device is powered on, its built-in software development kit can generate a unique public-private key pair. Furthermore, the IoT device can report the public key of the public-private key pair to a key service platform; the reporting method can be offline or online, and this application does not specify a method.
[0075] It should be noted that when reporting the public key, the IoT device in this application can simultaneously specify and submit the corresponding key identifier. Typically, the International Mobile Equipment Identity (IMEI) of the module where the on-chain SDK resides can be used as the key identifier. In this case, if the IoT device replaces its module, the mapping between the old module's IMEI and its public key should be maintained and set to an invalid state; the mapping between the new module's IMEI and its public key should be established and saved, and set to an enabled state.
[0076] The IoT devices described in this application can collect data; for example, smart meters can collect electricity-related data, smart water meters can collect water-related data, and smart gas meters can collect gas-related data. Furthermore, the IoT devices can generate unique data numbers for the collected data.
[0077] Furthermore, IoT devices can encrypt the collected data using the private key in the public-private key pair, and obtain a digital signature after encryption, which serves as verification information.
[0078] Furthermore, IoT devices can package the collected data's data number, the application for the collected data, and the digital signature, and submit the packaged data to the IoT platform (hereinafter referred to as the OneNET platform) through traditional channels.
[0079] It should be noted that, compared to traditional IoT platforms, this application also incorporates a OneNET-BC module on top of the traditional IoT platform. Therefore, after receiving packaged data submitted by IoT devices, the IoT platform can split the packaged data using the OneNET-BC module. Furthermore, the IoT platform can use the OneNET-BC module to submit the collected data and its data number to the application system associated with the IoT device via traditional channels.
[0080] Furthermore, data numbers and digital signatures can be submitted to the blockchain system via the OneNET-BC module through traditional channels, thereby enabling the on-chain verification of data. Due to the immutability of the blockchain, the verification data stored in the blockchain system cannot be tampered with. This utilizes the blockchain's evidence preservation capabilities to retain the verification information of the original data. Simultaneously, the trusted on-chain collection of IoT data extends the scope of blockchain evidence preservation services, shifting the starting point of the evidence preservation service from the time the data is uploaded from off-chain to on-chain to the time of collection by IoT devices.
[0081] The system employs a method of separating public keys and verification information for transmission. Cross-referencing the verification information ensures the credibility of the source data. Furthermore, the data packet segmentation strategy enables more complex authentication mechanisms, enhancing trust between IoT devices and effectively guaranteeing the credibility of the data source and the integrity of the data.
[0082] Therefore, IoT devices can submit digital signatures to the blockchain system through the IoT platform, and submit collected data to the application system associated with the IoT device through the IoT platform.
[0083] Application systems associated with IoT devices can receive data collected by IoT devices based on the IoT platform, and further store the received data along with its data number.
[0084] Furthermore, when an application system needs to verify the authenticity of a certain piece of collected data, it can extract the public key of the IoT device for that piece of collected data from the IoT device key service platform. Specifically, the public key can be extracted based on the key identifier.
[0085] Furthermore, the application system can extract the digital signature of the collected data from the blockchain system based on the data number.
[0086] Furthermore, the application system can verify the digital signature extracted from the blockchain system based on the public key and the collected data, thereby completing the data verification and obtaining the data verification result.
[0087] The data verification result can be either that the collected data is real or that the collected data is abnormal. If the collected data is abnormal, it is considered that the collected data may have been tampered with or that the data is abnormal for other reasons.
[0088] This can meet the need for reliable data transmission between IoT device acquisition and on-chain storage, ensuring data reliability from the source of acquisition.
[0089] According to the data management method of this application embodiment, by embedding a software development kit (SDK) in the IoT device, the IoT device can generate a public-private key pair based on the built-in SSD. This allows the collected data to be encrypted using the private key in the public-private key pair to obtain a digital signature, ensuring the trustworthiness of the data source. Simultaneously, the public key in the public-private key pair can be reported to a key service platform. Furthermore, the digital signature can be submitted to a blockchain system through the IoT platform. Based on the immutability of the blockchain system, the digital signature is prevented from being tampered with. Subsequently, after the collected data is submitted to the application system associated with the IoT device through the IoT platform, when the application system verifies the collected data, it can obtain the public key of the IoT device from the key service platform and the digital signature of the collected data from the blockchain system. Therefore, based on the digital signature, the collected data, and the public key, accurate data verification can be performed, thus improving the security of the data collected by the IoT device.
[0090] Based on the above embodiments, the digital signature is decrypted using the public key to obtain the first hash value; Perform a hash operation on the collected data to obtain a second hash value; The data verification result is determined by comparing the second hash value with the first hash value.
[0091] Specifically, after the IoT device completes data collection, it can first perform a hash operation on the collected data. The hash value obtained after the hash operation is defined as the first hash value to distinguish it from subsequent hash values. In this application, the hash operation can be performed using any hash algorithm such as SHA-256, SHA-3, BLAKE2, CRC32, MurmurHash, or CityHash, depending on actual needs; no specific limitation is made in this application.
[0092] It should be noted that the hashing algorithm used by the IoT device in this application to perform hashing operations on the collected data needs to be synchronized with the application system so that the application system can use the same algorithm to perform hashing operations on the collected data when verifying the data, and then verify the data based on the calculation results and other information.
[0093] Furthermore, IoT devices can extract the private key from the public-private key pair and encrypt the first hash value using the private key, thereby obtaining a digital signature of the collected data.
[0094] Based on this, when an application system needs to verify the authenticity of a certain piece of collected data, it can extract the public key of the IoT device for that piece of collected data from the IoT device key service platform. Specifically, the public key can be extracted based on the key identifier.
[0095] Furthermore, the application system can extract the digital signature of the collected data from the blockchain system based on the data number.
[0096] Furthermore, the application system can first perform a hash operation on the collected data using the same hash algorithm as the IoT device to obtain the corresponding hash value. The hash value obtained by the application system can be defined as the second hash value.
[0097] Furthermore, the digital signature can be decrypted using the public key, and the first hash value can be obtained after decryption.
[0098] Furthermore, the data verification result is determined based on the comparison between the second hash value and the first hash value.
[0099] This application uses the private key in the public-private key pair generated by the IoT device based on the built-in software development kit to encrypt the collected data to obtain a digital signature, and stores the digital signature in the blockchain system. Therefore, the data can be accurately verified through the digital signature, the collected data and the public key, thus improving the security of the data collected by the IoT device.
[0100] Based on the above embodiments, the data verification result is determined by comparing the second hash value with the first hash value, including: If the first hash value is the same as the second hash value, the collected data is determined to be real data. If the first hash value is different from the second hash value, the collected data is determined to be abnormal data.
[0101] Specifically, this application can compare the first hash value with the second hash value.
[0102] If the first hash value is determined to be the same as the second hash value, the collected data is confirmed to be real data.
[0103] If the first hash value is determined to be different from the second hash value, the collected data is determined to be abnormal data.
[0104] This application accurately verifies data authenticity by comparing a second hash value obtained by hashing the collected data using the same hash algorithm as that used by the IoT device with a first hash value obtained by decrypting the digital signature using a public key. This improves the security of data collected by IoT devices.
[0105] Figure 3 This is a schematic diagram illustrating an application scenario of the data management method provided in the embodiments of this application, such as... Figure 3 As shown, in one embodiment, the data management method of this application coexists with the data management scheme of traditional devices. Figure 3 Includes: (1) IoT device a-1, OneNET platform, and application system a are traditional Internet of Things (IoT) application systems. Among them, IoT device a-1 communicates with OneNET platform through interface IF-1; OneNET platform communicates with application system a through interface IF-2.
[0106] (2) IoT device b-1, OneNET platform and OneNET-BC module, IoT device key service platform (i.e., the aforementioned key service platform), application system b, and blockchain system b constitute a trusted IoT data collection and on-chain system; IoT device c-1, OneNET platform and OneNET-BC module, IoT device key service platform, application system c, and blockchain system c constitute another trusted IoT data collection and on-chain system. In each IoT device, the terminal and application, module, and on-chain SDK communicate via interface IF-8; each IoT device communicates with the OneNET platform via interface IF-1; each IoT device communicates with the IoT device key service platform via interface IF-3; the OneNET-BC module communicates with each application system via interface IF-4; the OneNET-BC module communicates with each blockchain system via interface IF-5; the IoT device key service platform communicates with each application system via interface IF-6; and each application system communicates with the corresponding blockchain system via interface IF-7.
[0107] (3) The OneNET platform is shared by all IoT application systems. The OneNET platform, OneNET-BC module, and IoT key service platform are shared by all IoT data collection and trusted on-chain systems.
[0108] (4) Blockchain system b and blockchain system c can be independent platforms or they can be combined into the same system, depending on the specific application scenario.
[0109] Figure 4This is a schematic diagram of the main interaction of the data management method provided in the embodiments of this application, such as... Figure 4 As shown, in one embodiment, the IoT device generates a unique public and private key through the on-chain SDK built into the module, and reports the public key to the IoT key service platform for storage.
[0110] After data collection is completed, the IoT device encrypts the raw data using a private key, and packages the encrypted digital signature along with the raw data into the OneNET platform as verification information.
[0111] The OneNET platform can split the received data, submit verification information to the blockchain system, and submit the raw data to the application system.
[0112] Furthermore, the application system can obtain public keys from the IoT key service platform and digital signatures (also known as data signatures) from the blockchain system, and then perform data verification using its included data verification function. Solid arrows represent the original data path, while dashed arrows represent the verification information path.
[0113] The data management apparatus provided in this application is described below. The data management apparatus described below can be referred to in correspondence with the data management method described above.
[0114] Furthermore, this application also provides a data management device.
[0115] The data management device includes: An encryption module is used to encrypt the data collected by the IoT device based on the private key in the public-private key pair to obtain a digital signature; wherein, the public-private key pair is generated by the IoT device that collects the data based on its built-in software development kit; the public key in the public-private key pair is reported to the key service platform; The first submission module is used to submit the digital signature to the blockchain system through the Internet of Things platform; The second submission module is used to submit the collected data to the application system associated with the IoT device through the IoT platform; wherein, when the application system verifies the collected data, it obtains the public key of the IoT device from the key service platform and obtains the digital signature of the collected data from the blockchain system; and performs data verification based on the digital signature, the collected data and the public key.
[0116] The data management device of this application, by embedding a software development kit (SDK) within the IoT device, enables the IoT device to generate a public-private key pair based on the built-in SSD. This allows the collected data to be encrypted using the private key of the public-private key pair to obtain a digital signature, ensuring the trustworthiness of the data source. Simultaneously, the public key of the public-private key pair can be reported to a key service platform. Furthermore, the digital signature can be submitted to a blockchain system through the IoT platform. Based on the immutability of the blockchain system, the digital signature is protected against tampering. Subsequently, after the collected data is submitted to the application system associated with the IoT device through the IoT platform, the application system, when verifying the collected data, can obtain the public key of the IoT device from the key service platform and the digital signature of the collected data from the blockchain system. Therefore, based on the digital signature, the collected data, and the public key, accurate data verification can be performed, thus improving the security of the data collected by the IoT device.
[0117] In one embodiment, the encryption module is specifically used for: Perform a hash operation on the collected data to obtain the first hash value; The first hash value is encrypted using the private key from the public-private key pair to obtain a digital signature.
[0118] Furthermore, this application also provides a data management device.
[0119] The data management device includes: The receiving module is used to receive data collected by IoT devices based on the IoT platform; The first acquisition module is used to acquire the public key of the IoT device from the key service platform; the public key is the public key in the public-private key pair reported by the IoT device to the key service platform; the public-private key pair is generated by the IoT device based on the built-in software development kit. The second acquisition module is used to obtain the digital signature of the collected data from the blockchain system; The verification module is used to verify the data based on the digital signature, the collected data, and the public key, and obtain the data verification result.
[0120] The data management device of this application, by embedding a software development kit (SDK) within the IoT device, enables the IoT device to generate a public-private key pair based on the built-in SSD. This allows the collected data to be encrypted using the private key of the public-private key pair to obtain a digital signature, ensuring the trustworthiness of the data source. Simultaneously, the public key of the public-private key pair can be reported to a key service platform. Furthermore, the digital signature can be submitted to a blockchain system through the IoT platform. Based on the immutability of the blockchain system, the digital signature is protected against tampering. Subsequently, after the collected data is submitted to the application system associated with the IoT device through the IoT platform, the application system, when verifying the collected data, can obtain the public key of the IoT device from the key service platform and the digital signature of the collected data from the blockchain system. Therefore, based on the digital signature, the collected data, and the public key, accurate data verification can be performed, thus improving the security of the data collected by the IoT device.
[0121] In one embodiment, the verification module is specifically used for: The digital signature is decrypted using the public key to obtain the first hash value; Perform a hash operation on the collected data to obtain a second hash value; The data verification result is determined based on the comparison between the second hash value and the first hash value.
[0122] In one embodiment, the verification module is further configured to: If the first hash value is the same as the second hash value, the collected data is determined to be real data; If the first hash value is different from the second hash value, the collected data is determined to be abnormal data.
[0123] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute the following method: encrypting the collected data from the IoT device based on the private key in the public-private key pair to obtain a digital signature; wherein the public-private key pair is generated by the IoT device collecting the collected data based on its built-in software development kit; and the public key in the public-private key pair is reported to a key service platform. The digital signature is submitted to the blockchain system via the Internet of Things platform; The collected data is submitted to the application system associated with the IoT device through the IoT platform; wherein, when the application system verifies the collected data, it obtains the public key of the IoT device from the key service platform and obtains the digital signature of the collected data from the blockchain system; and performs data verification based on the digital signature, the collected data and the public key.
[0124] Or execute the following method: Receive data collected by IoT devices based on the IoT platform; Obtain the public key of the IoT device from the key service platform; the public key is the public key in the public-private key pair reported by the IoT device to the key service platform; the public-private key pair is generated by the IoT device based on the built-in software development kit. Obtain the digital signature of the collected data from the blockchain system; Based on the digital signature, the collected data, and the public key, data verification is performed to obtain the data verification result.
[0125] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0126] In another aspect, embodiments of this application also provide a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program is implemented to perform the methods provided in the above embodiments, such as: encrypting the collected data of an IoT device based on the private key in a public-private key pair to obtain a digital signature; wherein the public-private key pair is generated by the IoT device collecting the collected data based on a built-in software development kit; and the public key in the public-private key pair is reported to a key service platform. The digital signature is submitted to the blockchain system via the Internet of Things platform; The collected data is submitted to the application system associated with the IoT device through the IoT platform; wherein, when the application system verifies the collected data, it obtains the public key of the IoT device from the key service platform and obtains the digital signature of the collected data from the blockchain system; and performs data verification based on the digital signature, the collected data and the public key.
[0127] And including: Receive data collected by IoT devices based on the IoT platform; Obtain the public key of the IoT device from the key service platform; the public key is the public key in the public-private key pair reported by the IoT device to the key service platform; the public-private key pair is generated by the IoT device based on the built-in software development kit. Obtain the digital signature of the collected data from the blockchain system; Based on the digital signature, the collected data, and the public key, data verification is performed to obtain the data verification result.
[0128] In another aspect, embodiments of this application also provide a computer program product, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to perform the methods provided in the above embodiments, such as: encrypting the collected data of an IoT device based on the private key in a public-private key pair to obtain a digital signature; wherein the public-private key pair is generated by the IoT device that collects the collected data based on a built-in software development kit; and the public key in the public-private key pair is reported to a key service platform. The digital signature is submitted to the blockchain system via the Internet of Things platform; The collected data is submitted to the application system associated with the IoT device through the IoT platform; wherein, when the application system verifies the collected data, it obtains the public key of the IoT device from the key service platform and obtains the digital signature of the collected data from the blockchain system; and performs data verification based on the digital signature, the collected data and the public key.
[0129] And including: Receive data collected by IoT devices based on the IoT platform; Obtain the public key of the IoT device from the key service platform; the public key is the public key in the public-private key pair reported by the IoT device to the key service platform; the public-private key pair is generated by the IoT device based on the built-in software development kit. Obtain the digital signature of the collected data from the blockchain system; Based on the digital signature, the collected data, and the public key, data verification is performed to obtain the data verification result.
[0130] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0131] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of software products. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate this application and are not intended to limit this application. Although this application has been described in detail with reference to the embodiments, those skilled in the art should understand that various combinations, modifications, or equivalent substitutions of the technical solutions of this application do not depart from the spirit and scope of the technical solutions of this application.
Claims
1. A data management method, characterized in that, include: The data collected by the IoT device is encrypted using the private key in the public-private key pair to obtain a digital signature; wherein, the public-private key pair is generated by the IoT device that collects the data based on its built-in software development kit; the public key in the public-private key pair is reported to the key service platform; The digital signature is submitted to the blockchain system via the Internet of Things platform; The collected data is submitted to the application system associated with the IoT device through the IoT platform; wherein, when the application system verifies the collected data, it obtains the public key of the IoT device from the key service platform and obtains the digital signature of the collected data from the blockchain system; and performs data verification based on the digital signature, the collected data and the public key.
2. The data management method according to claim 1, characterized in that, The collected data is encrypted using the private key from the public-private key pair to obtain a digital signature: Perform a hash operation on the collected data to obtain the first hash value; The first hash value is encrypted using the private key from the public-private key pair to obtain a digital signature.
3. A data management method, characterized in that, include: Receive data collected by IoT devices based on the IoT platform; Obtain the public key of the IoT device from the key service platform; The public key is the public key in the public-private key pair reported by the IoT device to the key service platform; The public-private key pair is generated by the IoT device based on its built-in software development kit. Obtain the digital signature of the collected data from the blockchain system; Based on the digital signature, the collected data, and the public key, data verification is performed to obtain the data verification result.
4. The data management method according to claim 3, characterized in that, The process of verifying data based on the digital signature, the collected data, and the public key to obtain a data verification result includes: The digital signature is decrypted using the public key to obtain the first hash value; Perform a hash operation on the collected data to obtain a second hash value; The data verification result is determined based on the comparison between the second hash value and the first hash value.
5. The data management method according to claim 4, characterized in that, The step of determining the data verification result based on the comparison between the second hash value and the first hash value includes: If the first hash value is the same as the second hash value, the collected data is determined to be real data; If the first hash value is different from the second hash value, the collected data is determined to be abnormal data.
6. A data management device, characterized in that, include: An encryption module is used to encrypt the data collected by the IoT device based on the private key in the public-private key pair to obtain a digital signature; wherein, the public-private key pair is generated by the IoT device that collects the data based on its built-in software development kit; the public key in the public-private key pair is reported to the key service platform; The first submission module is used to submit the digital signature to the blockchain system through the Internet of Things platform; The second submission module is used to submit the collected data to the application system associated with the IoT device through the IoT platform; wherein, when the application system verifies the collected data, it obtains the public key of the IoT device from the key service platform and obtains the digital signature of the collected data from the blockchain system; and performs data verification based on the digital signature, the collected data and the public key.
7. A data management device, characterized in that, include: The receiving module is used to receive data collected by IoT devices based on the IoT platform; The first acquisition module is used to obtain the public key of the IoT device from the key service platform; The public key is the public key in the public-private key pair reported by the IoT device to the key service platform; The public-private key pair is generated by the IoT device based on its built-in software development kit. The second acquisition module is used to obtain the digital signature of the collected data from the blockchain system; The verification module is used to verify the data based on the digital signature, the collected data, and the public key, and obtain the data verification result.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the data management method as described in any one of claims 1-2 or 3-5.
9. A storage medium, said storage medium being a non-transitory computer-readable storage medium, wherein a computer program is stored thereon, characterized in that, When the computer program is executed by a processor, it implements the data management method as described in any one of claims 1-2 or 3-5.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data management method according to any one of claims 1-2 or 3-5.