Blockchain-based internet of things data processing method and related device

By assigning decentralized identity identifiers (DIDs) to IoT devices and registering and storing these identifiers on a blockchain network, the problem of untrustworthy IoT data is solved, thereby improving the reliability and accuracy of data processing.

CN117749821BActive Publication Date: 2026-07-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-09-14
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In smart cities, the unreliability of data from IoT devices leads to insufficient credibility of data processing results.

Method used

By assigning decentralized identity identifiers (DIDs) to IoT devices and registering and storing these identifiers on a blockchain network, the trustworthiness of the data is ensured.

Benefits of technology

This improves the credibility of IoT data, thereby enhancing the reliability of data processing and the accuracy of processing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117749821B_ABST
    Figure CN117749821B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of based on blockchain's Internet of Things data processing method and related equipment, the method includes: for equipment production object distribution about DID's identification interval, to make equipment production object when producing Internet of Things equipment based on identification interval for the Internet of Things equipment produced by distribution corresponding DID;Internet of Things equipment is identified and registered on blockchain network based on DID;If receiving one or more Internet of Things equipment sent target data, each target data is associated with the DID of corresponding Internet of Things equipment and is stored on blockchain network;The data request of target data for target Internet of Things equipment sent by target equipment is obtained;Target DID of target Internet of Things equipment is carried in data request;The target data of target Internet of Things equipment is determined from blockchain network based on target DID, and the target data of target Internet of Things equipment is returned to target equipment.Can improve the credibility of data in Internet of Things scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a blockchain-based Internet of Things (IoT) data processing method and related equipment. Background Technology

[0002] With the rapid development of computer and Internet of Things (IoT) technologies, smart cities have been widely adopted. In smart city applications, a large number of IoT devices typically acquire data from their surroundings and send it directly to the city's smart center. This data is then processed using the data stored at the smart center to produce the smart city's results. However, the entire process from data acquisition by IoT devices to data processing can be susceptible to data unreliability issues due to network or human factors. Therefore, improving the reliability of data in smart cities has become a current research hotspot. Summary of the Invention

[0003] This application provides a blockchain-based IoT data processing method and related equipment, which can improve the reliability of data in IoT scenarios.

[0004] In a first aspect, embodiments of this application provide a blockchain-based Internet of Things (IoT) data processing method, comprising:

[0005] The device receives a device registration request and, in response to the registration request, assigns an identifier range for the device with a decentralized identity identifier (DID), so that the device can assign a corresponding DID to the IoT devices it produces based on the identifier range when producing IoT devices.

[0006] When a registration request for identification carrying the DID of an IoT device is received, the system responds to the registration request and registers the IoT device on the blockchain network based on the DID.

[0007] If target data is received from one or more IoT devices, each target data is associated with the DID of the corresponding IoT device and stored on the blockchain network.

[0008] Acquire a data request sent by the target device for target data of the target IoT device; the data request carries the target DID of the target IoT device, the target IoT device being included in the one or more IoT devices;

[0009] Based on the target DID, the target data of the target IoT device is determined from the blockchain network, and the target data of the target IoT device is returned to the target device.

[0010] Secondly, embodiments of this application provide another blockchain-based IoT data processing method, including:

[0011] A data request for target data of a target IoT device is sent to the blockchain network. The data request carries the target decentralized identity identifier (DID). The target DID is allocated by the device manufacturer corresponding to the target IoT device using an identifier range. This identifier range is obtained by the blockchain network responding to the device manufacturer's registration request after the device manufacturer sends the registration request. The target DID needs to be registered on the blockchain network. This registration is achieved by the blockchain network responding to the registration request after the target IoT device sends a registration request carrying the target DID.

[0012] The target data of the target IoT device returned by the blockchain network is obtained, and the obtained target data is used for data processing to obtain the processing result; the target data of the target IoT device is determined by the blockchain network based on the target DID.

[0013] Thirdly, embodiments of this application provide a blockchain-based Internet of Things (IoT) data processing device, comprising:

[0014] The allocation unit is used to receive a device production object registration request and, in response to the device production object registration request, allocate an identifier range for the device production object with a decentralized identity identifier (DID), so that the device production object can allocate a corresponding DID for the IoT devices it produces based on the identifier range when producing IoT devices.

[0015] The registration unit is configured to respond to the identification registration request and register the identification of the IoT device on the blockchain network based on the DID when it receives an identification registration request sent by an IoT device carrying the DID of the IoT device;

[0016] The storage unit is used to associate each target data with the DID of the corresponding IoT device and store it on the blockchain network if it receives target data sent by one or more IoT devices respectively.

[0017] An acquisition unit is configured to acquire a data request sent by a target device for target data of a target IoT device; the data request carries the target DID of the target IoT device, and the target IoT device is included in the one or more IoT devices.

[0018] The determining unit is configured to determine the target data of the target IoT device from the blockchain network based on the target DID, and return the target data of the target IoT device to the target device.

[0019] Fourthly, embodiments of this application provide another blockchain-based Internet of Things (IoT) data processing device, including:

[0020] A sending unit is configured to send a data request for target data of a target IoT device to a blockchain network; the data request carries the target decentralized identity identifier (DID); the target DID is obtained by the device production object corresponding to the target IoT device using an identifier range, which is obtained by the blockchain network responding to the production object registration request after the device production object corresponding to the target IoT device sends a production object registration request to the blockchain network; the target DID needs to be registered on the blockchain network, and the identifier registration is achieved by the blockchain network responding to the identifier registration request after the target IoT device sends an identifier registration request carrying the target DID to the blockchain network;

[0021] The processing unit is used to acquire target data of the target IoT device returned by the blockchain network, and to process the acquired target data to obtain a processing result; the target data of the target IoT device is determined by the blockchain network based on the target DID.

[0022] Fifthly, embodiments of this application provide an electronic device, the electronic device comprising: a processor and a memory, the processor being configured to perform the methods described in the first aspect and / or the second aspect above.

[0023] Sixthly, embodiments of this application also provide a computer-readable storage medium storing program instructions that, when executed, implement the methods described in the first and / or second aspects.

[0024] In a seventh aspect, embodiments of this application also provide a computer program product or computer program, which includes program instructions that, when executed by a processor, implement the methods described in the first and / or second aspects above.

[0025] This application embodiment can receive a device production object registration request and, in response to the registration request, allocate an identifier range for the device production object based on a decentralized identity identifier (DID). This allows the device production object to assign a corresponding DID to the IoT devices it produces based on the identifier range. When receiving an identifier registration request from an IoT device carrying the IoT device's DID, the device can respond to the registration request and register the IoT device's identifier on the blockchain network based on the DID. If target data is received from one or more IoT devices, each target data can be associated with the corresponding IoT device's DID and stored on the blockchain network. Furthermore, a data request for target data from a target IoT device can be obtained, which may carry the target IoT device's target DID. This allows the target data of the target IoT device to be determined from the blockchain network based on the target DID, and the target data to be returned to the target device. Based on the above method, using IoT devices with decentralized identities to obtain data and storing the data on the blockchain can improve the credibility of the target data, thereby also improving the credibility of data processing. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of this application 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 only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1a This is a schematic diagram of the architecture of an IoT data processing system based on blockchain, provided in an embodiment of this application.

[0028] Figure 1b This is a schematic diagram of a blockchain structure provided in an embodiment of this application;

[0029] Figure 1c This is a schematic diagram illustrating a process for generating a new block, provided in an embodiment of this application.

[0030] Figure 2 This is a schematic flowchart of a blockchain-based Internet of Things (IoT) data processing method provided in an embodiment of this application.

[0031] Figure 3 This is a flowchart illustrating another blockchain-based IoT data processing method provided in this application embodiment;

[0032] Figure 4This is a flowchart illustrating another blockchain-based IoT data processing method provided in the embodiments of this application;

[0033] Figure 5 This is a schematic diagram of the structure of a blockchain-based Internet of Things (IoT) data processing device provided in an embodiment of this application;

[0034] Figure 6 This is a schematic diagram of the structure of a blockchain-based Internet of Things (IoT) data processing device provided in an embodiment of this application;

[0035] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0036] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0037] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0038] Please see Figure 1a This is a schematic diagram of the architecture of a blockchain-based Internet of Things (IoT) data processing system provided in an embodiment of this application. The blockchain-based IoT data processing system includes a blockchain network 10, one or more IoT devices 102, and a target device 103, wherein:

[0039] Blockchain network 10 refers to a network used for data sharing between nodes (or node devices). The blockchain network may include multiple nodes 101, among which consensus nodes may be included. Each node 101, in its normal operation, receives input information and maintains shared data (i.e., the blockchain) within the blockchain network based on the received input information. Each node in the blockchain network stores the same blockchain, which consists of a series of blocks sequentially generated in chronological order, such as... Figure 1a As shown in the diagram, blocks 1, M-1, etc., are blocks that, once added to the blockchain, will not be removed. Blocks record the data submitted by nodes in the blockchain network. To ensure information exchange within the blockchain network, each node can be connected to another node, enabling peer-to-peer (P2P) communication between any two nodes. This P2P communication can be conducted via wired or wireless communication links. For example, when any node in the blockchain network receives input information, other nodes retrieve this input information according to the consensus algorithm and store it as part of the shared data, ensuring consistency of data stored on all nodes in the blockchain network.

[0040] The Internet of Things (IoT) device 102 can access the blockchain network 10 and communicate with nodes in the blockchain network, such as sending target data to nodes. The IoT device 102 can acquire data from its surrounding environment; the input to the IoT device can be any type of environmental data such as light, heat, moisture, or pressure. The IoT device can upload the acquired data to the blockchain network 10 for data storage; that is, the blockchain network 10 can act as a data center, meaning a central hub for data storage.

[0041] The target device 103 can access the blockchain network 10 and communicate with nodes in the blockchain network, such as sending data requests to nodes. Specifically, the target device 103 can send data requests to nodes to request necessary data (such as data obtained by an IoT device from its environment) from the blockchain network 10. The target device 103 can be a server or a user terminal; there is no specific limitation on this.

[0042] It should be noted that, Figure 1a The number of nodes shown is merely illustrative. Any number of nodes can be deployed as needed. A node can refer to any form of computer device connected to the network, such as a server or user terminal, which can all be added as a node.

[0043] Each node in the blockchain network has a corresponding node identifier, and each node can also store the node identifiers of other nodes in the blockchain network. This allows for the subsequent broadcasting of generated blocks to other nodes in the blockchain network based on their node identifiers. Each node can maintain a node identifier list as shown in the table below, storing the node name and node identifier in this list. The node identifier can be an Internet Protocol (IP) address or any other information that can be used to identify the node; the table only uses IP addresses as an example.

[0044] Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258

[0045] In this blockchain network, each node stores an identical copy of the blockchain. A blockchain consists of multiple blocks; see [link to blockchain documentation]. Figure 1bA blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version number, timestamp, and difficulty value, while the block body stores the input information. The next block after the genesis block takes the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature values ​​of the current block, the block header feature values ​​of the parent block, version number, timestamp, and difficulty value, and so on. This ensures that the block data stored in each block is related to the block data stored in the parent block, guaranteeing the security of the input information in the blocks.

[0046] When generating the various blocks in the blockchain, see [link / reference]. Figure 1c When a node in the blockchain receives input information, it verifies the input information. After verification, it stores the input information in a memory pool and updates its hash tree used to record the input information. Then, it updates the timestamp to the time the input information was received and tries different random numbers multiple times to calculate the feature value, ensuring that the calculated feature value satisfies the following formula:

[0047] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x)) <TARGET

[0048] Wherein, SHA256 is the feature value algorithm used to calculate the feature value; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header feature value of the parent block of the current block; merkle_root is the feature value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value for a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the feature value threshold, which can be determined based on nbits.

[0049] Thus, when a random number satisfying the above formula is calculated, the information can be stored accordingly, generating a block header and a block body to obtain the current block. Subsequently, the node containing the blockchain sends the newly generated block to other nodes in its blockchain network based on the node identifiers of other nodes in the blockchain network. The other nodes verify the newly generated block and, after verification, add the newly generated block to their stored blockchain.

[0050] In a blockchain network, smart contracts can run on nodes, enabling various transactions. A smart contract is an immutable, automatically executing computer program that runs on the blockchain. It's code that executes when certain conditions are met. Developers can define contract logic using programming languages, publish it to the blockchain (smart contract registration), and execute it based on the contract terms, triggered by keys or other events. The blockchain also provides functions for upgrading and deregistering smart contracts.

[0051] Decentralized Identity (DID) is a verifiable, self-controlled digital identity identifier that conforms to the World Wide Web Consortium (W3C) specifications. Each DID uniquely corresponds to one entity. The entity can be a person, machine, thing, virtual person or thing, etc. In this embodiment, the entity can refer to an IoT device. The DID can be controlled by the identifier owner. Simply put, DID is a decentralized identity authentication system that does not require the participation of any centralized registration authority, identity provider, or certificate authority. Using decentralized identity identifiers to uniquely identify IoT devices enables them to possess decentralized and self-controllable identity characteristics. The decentralized identity authentication system also features Public Key Infrastructure (PKI), which can bind relevant keys (such as a private key and public key for each DID) to the identity of the certificate holder, providing users with convenient means of managing related certificates.

[0052] In practical use, DIDs can be combined with Verifiable Claims (VCs) to support data exchange. The holder can share information about an entity with a third party, proving the entity's legitimacy by demonstrating ownership of certain proofs or attributes. In one embodiment, the holder can apply for and obtain a verifiable claim from the DID issuer. The issuer can then issue the claim, generating a corresponding DID for the entity and packaging it within the claim. A verifiable claim can be a document where the issuer endorses certain attributes of the DID. The holder can present the entity's verifiable claim, which the verifier receives and verifies to verify the correctness of the Verifiable Presentation (VP), thus confirming the holder's identity. The entity signs the held verifiable claim to form the verifiable presentation.

[0053] In some feasible implementations, any node 101 of the blockchain network can receive a device production object registration request and respond to the device production object registration request to allocate an identifier range for the device production object with a decentralized identity identifier (DID), so that the device production object can allocate the corresponding DID to the IoT device it produces based on the identifier range when producing IoT devices; when receiving an identifier registration request sent by an IoT device carrying the DID of the IoT device, it can respond to the identifier registration request and register the IoT device on the blockchain network based on the DID.

[0054] Subsequently, if any node 101 receives target data sent by IoT device 102, it can associate and store the target data and the decentralized identity of IoT device 102 on the blockchain. When target device 103 needs to process the target data corresponding to IoT device 102, it can obtain the required data from the blockchain network 10. For example, target device 103 can send a data request for target data of the target IoT device to node 101, which may carry the target decentralized identity of the target IoT device. When node 101 receives the data request, it can determine the target data of the target IoT device based on the target decentralized identity and return the target data of the target IoT device to target device 103, so that target device 103 can process the data based on the returned target data and obtain the corresponding processing result. In the above embodiment, using IoT devices with decentralized identities to obtain data and storing the data on the blockchain can improve the credibility of the target data, and thus also improve the credibility of data processing.

[0055] The implementation details of the technical solutions in the embodiments of this application are described in detail below:

[0056] Please see Figure 2 , Figure 2 This is a flowchart illustrating a blockchain-based IoT data processing method provided in an embodiment of this application. The blockchain-based IoT data processing method involves node devices (as described above). Figure 1a The corresponding node device 101 and target device (as described above) in the embodiments Figure 1a Corresponding to the target device 103 in the embodiment, this embodiment mainly describes the interaction process between the node device and the target device. The blockchain-based IoT data processing method includes the following steps:

[0057] S201, the node device receives the production object registration request of the device production object, and responds to the production object registration request by allocating an identifier range for the device production object with a decentralized identity identifier (DID), so that the device production object can allocate the corresponding DID to the IoT devices it produces based on the identifier range when producing IoT devices.

[0058] The node device can be any node device in the blockchain network, and the blockchain can be a public chain, a private chain, or a consortium chain, which is not specifically limited in this application.

[0059] In this context, a DID is a specific formatted string used to represent the digital identity of an entity, such as an IoT device in this embodiment. A DID is an identifier composed of three parts: a scheme, a DID method, and a unique identifier specified by the DID method. The scheme is a fixed prefix for the DID, meaning every DID is prefixed with "did," indicating that a string is a DID type string. The DID method identifies which DID method was used to define and operate the DID. Custom DID methods can be registered on the W3C website to ensure their reliability.

[0060] The format of a DID can be "did:example:123456789abcdefg". Here, "did" is the prefix; "example" indicates the DID method; and "123456789abcdefg" represents a unique string (or identifier) ​​used to identify the IoT device under this DID method. For example, assuming a DID method is cid, which DIDs user identity information, then for a DID system using the cid method, the DID can be represented as: did:cid:5111******5; where "5111******5" represents the user's identity information. As another example, assuming a DID method is ethr, which DIDs Ethereum addresses, then for a DID system using the ethr method, the DID can be represented as: did:ethr:0xc530503a14, where "0xc530503a14" represents the Ethereum address.

[0061] In one implementation, the DID of each IoT device can be pre-configured, such as through a DID service to configure centralized identity identifiers. This DID service can be a service module within a node device or a service module in another device independent of the node device. The following explanation uses the example of a DID service being a service module within a node device. It is understood that IoT devices can be manufactured by a device manufacturer (e.g., a device manufacturing object), and a single device manufacturing object can produce a large number of IoT devices. Therefore, for IoT devices that need to be added to the IoT system, the device manufacturing object used to produce the IoT devices can pre-request an identifier range for the DID from the node device, so that the corresponding DID can be directly assigned after the IoT devices are manufactured. Based on the composition of the centralized identity identifier, in addition to requesting an identifier range for the DID, a DID method (such as the cid method mentioned above) can also be requested from the node device. In a specific implementation, a device production object can send a production object registration request to a node device. This production object registration request can be used to request the identifier range of a DID. The node device can then receive the production object registration request from the device production object. After receiving the production object registration request, the node device can respond to the production object registration request and allocate an identifier range for the DID to the device production object. The node device can then return the identifier range allocated to the device production object to the device production object, so that the device production object can allocate the corresponding DID to the IoT devices it produces based on the identifier range when producing IoT devices.

[0062] In one implementation, different identifier prefixes can be assigned to IoT devices under different scenario types. A scenario type refers to an IoT device that obtains data from the environment under that specific scenario type. For example, scenario types could be smart weather, smart transportation, smart healthcare, etc.; for instance, an IoT device in a smart weather scenario can receive weather-related information. Different identifier prefixes can quickly determine which scenario type the IoT device is obtaining from the environment. Specifically, if a device production object can be used to produce IoT devices applicable to one or more scenario types, then step S201 can be implemented as follows: responding to a production object registration request and obtaining all scenario types corresponding to the device production object; then, configuring corresponding identifier prefixes for each scenario type, with one identifier prefix corresponding to one scenario type; furthermore, an identifier range for decentralized identity identifiers (DIDs) can be assigned to the device production object, where the identifier prefixes of each DID within the identifier range under a scenario type are the same.

[0063] In one implementation, different identifier prefixes can be directly assigned to device production objects. This allows for quick identification of which device production object the IoT device or its target data originates from. Specifically, step S201 can be implemented by: responding to a production object registration request and configuring a corresponding identifier prefix for the device production object; one device production object can correspond to one identifier prefix. Furthermore, an identifier range for decentralized identity identifiers (DIDs) can be assigned to each device production object, with each DID within the identifier range of a single device production object having the same identifier prefix.

[0064] The aforementioned identifier prefix can refer to the first L characters of the unique string used to identify IoT devices under the DID method. The value of L can be preset, and the specific value is not limited.

[0065] In one implementation, besides using a device production object to request an identifier range from a node device to generate the DID of an IoT device, as described above, the IoT device can also directly request the generation of its DID from the node device. Specifically, after the device production object produces the IoT device, the IoT device can send a device registration request to the node device. This device registration request is used to request the generation of the IoT device's DID. The node device can then receive the device registration request, respond to it, and assign a DID to the IoT device. The node device can then return this DID to the IoT device.

[0066] In one implementation, when configuring a DID for an IoT device, the DID service also generates a key pair (private key and public key). The private key corresponding to the DID (or the private key corresponding to the IoT device) can be stored by the IoT device. For example, when the device manufacturer produces the IoT device and assigns a DID to it, the private key can be embedded in the IoT device. This private key can be used to sign the target data corresponding to the IoT device to ensure the trustworthiness of the target data. The public key corresponding to the DID can be bound to the DID. This binding relationship can be published on distributed storage (such as a blockchain) so that subsequent signature verification operations (such as the signature verification operation mentioned in step S208) can retrieve the binding relationship from the distributed storage and obtain the public key based on the binding relationship to perform the signature verification operation.

[0067] S202, when a node device receives an identification registration request sent by an IoT device carrying the DID of the IoT device, it responds to the identification registration request and registers the IoT device on the blockchain network based on the DID.

[0068] In one implementation, any IoT device can register its DID (Distributed Identifier) ​​on a blockchain network. Upon successful registration, the IoT device is confirmed to have joined the blockchain-based IoT data processing system (referred to as the IoT system). Subsequently, when the IoT device sends target data to node devices, the node devices can also record (store) the target data on the blockchain network. Specifically, any IoT device can send a DID registration request to a node device, which may include the IoT device's DID. The node device can receive the DID registration request and, upon receiving it, can respond to the request and register the IoT device's DID on the blockchain network. This registration essentially involves recording the IoT device's DID on the blockchain network. It can be seen that through this registration process, a trusted IoT device identity can be built on the blockchain (such as a consortium blockchain), thereby ensuring the trustworthiness of the IoT devices.

[0069] S203 If a node device receives target data sent by one or more IoT devices respectively, it will associate each target data with the DID of the corresponding IoT device and store it on the blockchain network.

[0070] The target data can refer to data acquired by IoT devices in the physical environment. For example, in a smart weather scenario, the target data could be weather-related data (such as air humidity, wind speed, etc.); similarly, in a smart car scenario, the target data could be vehicle speed, tire pressure, engine speed, etc. The target data sent by any IoT device can carry a decentralized identity identifier (DID) for that IoT device. A DID uniquely identifies an IoT device, allowing the system to determine which IoT device acquired the target data.

[0071] S204, The target device sends a data request to the blockchain network for the target IoT device's target data.

[0072] The data request may carry the target DID of the target IoT device, so that when the node device receives the data request, it can directly look up the target data of the corresponding IoT device (such as the target IoT device) on the blockchain network based on the target DID. The target IoT device is contained in one or more IoT devices.

[0073] S205, the node device obtains the data request sent by the target device for the target IoT device.

[0074] S206, the node device determines the target data of the target IoT device from the blockchain network based on the target DID, and returns the target data of the target IoT device to the target device.

[0075] In one implementation, a node device can determine the target data of a target IoT device on the blockchain it maintains. Considering that the target data of an IoT device is stored on the blockchain using DIDs for association, the node device can directly match the existing DIDs on the blockchain based on the target DID and use the target data corresponding to the matched DID as the target data of the target IoT device.

[0076] S207, the target device obtains the target data of the target IoT device returned by the blockchain network, and uses the obtained target data to perform data processing to obtain the processing result.

[0077] The target data is obtained by the blockchain network based on the target DID of the target IoT device, as described in step S206.

[0078] In one implementation, the target node can obtain target data for the target IoT device returned by the node device. After obtaining the target data, it can perform data processing to obtain the corresponding processing result. In one embodiment, after obtaining the processing result, it can also display the processing result on the terminal screen (or user interface) so that the user can intuitively understand the processing result. For example, in a smart city service scenario, the processing result can be displayed on the front-end large screen corresponding to the smart city service.

[0079] For example, in a smart weather scenario, if the target data is weather information within a specific timeframe, this information could include perceived temperature, humidity, wind speed, wind direction, etc. The data processing could specifically involve weather forecasting based on this information. For instance, weather features for forecasting could be constructed first based on the weather information. After constructing these features, a neural network model could be invoked to perform weather forecasts, yielding a result such as rain, sunshine, or cloudy weather. This forecast result could then be used to update the weather in the current weather application.

[0080] For example, in intelligent transportation scenarios, if the target data is traffic information on a certain road segment, such as traffic flow and vehicle speed, then the data processing specifically determines the current road congestion situation based on the traffic information (e.g., congestion can be categorized as no congestion, moderate congestion, severe congestion, etc.). This congestion situation is the processing result. For instance, predictive congestion rules can be used to process the traffic information to obtain the congestion situation; alternatively, traffic features for congestion prediction can be constructed based on the traffic information. After constructing the traffic features, a neural network model can be called to predict the congestion situation based on these features. Once the congestion situation is obtained, it can be displayed in real-time on the driver's terminal screen so that the driver can understand the current road conditions.

[0081] In one implementation, when a target device obtains target data from a target IoT device on a blockchain network, to verify the identity of the target IoT device and ensure that the obtained target data corresponds to the target IoT device, the public key of the target IoT device can be used for verification. This verifies the authenticity of the target IoT device and ensures the trustworthiness of the obtained data. The verification of the target IoT device's identity information can be implemented in the following way. It should be understood that the target data obtained by the target device can be data signed with a private key. That is, when the target device obtains the target data, it can also obtain the signature information corresponding to the target data. In this case, the public key corresponding to the target IoT device can be used to verify the signature information of the obtained target data. If the verification is successful, it can be guaranteed that the target data obtained by the target device is indeed the data of the target IoT device.

[0082] Optionally, the aforementioned signature information can be obtained by the target IoT device signing the hash of the corresponding target data using its private key. In this case, the specific implementation method for signature verification can be as follows: First, the signature information can be verified using the public key of the target IoT device to obtain verification information. Here, signature verification is essentially a decryption operation on the signature information, and the result of the decryption operation is the verification information. After obtaining the verification information, it can be matched with the hash of the target data. If the verification information and the hash of the target data are consistent, the signature verification is successful, indicating that the target data is trustworthy. Therefore, the data processing steps using the obtained target data can be executed. If the signature information and the hash are inconsistent, the signature verification fails, indicating that the target data is abnormal. Subsequent data processing operations can no longer be performed, as the processing result obtained using abnormal target data will also be abnormal.

[0083] In this embodiment, each IoT device can be assigned a DID on the blockchain. After acquiring target data, the IoT device with the DID signs the acquired data using its own DID's corresponding private key and uploads it to the blockchain network, which serves as the data center. Then, the target device can process the target data from the IoT devices stored in the blockchain network. It can be seen that acquiring and uploading target data based on IoT devices with DIDs ensures the trustworthiness of the IoT devices' identities, thereby guaranteeing the trustworthiness of the target data from generation to transmission. Furthermore, utilizing the immutability of data on the blockchain as a data storage center also ensures the trustworthiness of the data storage center. In summary, the application of blockchain and DID throughout the entire process ensures the trustworthiness of the target data from generation to transmission and final processing, thus improving data trustworthiness and consequently, the trustworthiness of the processing results obtained using the target data.

[0084] Please see Figure 3 , Figure 3 This is a flowchart illustrating another blockchain-based IoT data processing method provided in this application embodiment. This embodiment mainly describes the specific implementation process of IoT data processing on the node device side based on a blockchain network. The blockchain-based IoT data processing method described in this embodiment includes the following steps:

[0085] S301, receive the device production object registration request, and respond to the production object registration request to allocate an identifier range for the device production object regarding decentralized identity identifier (DID), so that the device production object can allocate the corresponding DID to the IoT devices it produces based on the identifier range when producing IoT devices.

[0086] S302, when receiving an identification registration request sent by an IoT device carrying the DID of the IoT device, respond to the identification registration request and register the IoT device on the blockchain network based on the DID.

[0087] The specific implementation of steps S301 and S302 can be referred to the descriptions of steps S201 and S202 above, and will not be repeated here.

[0088] S303 If target data is received from one or more IoT devices, the target data is associated with the DID of the corresponding IoT device and stored on the blockchain network.

[0089] Furthermore, the target data sent by any IoT device can also carry signature information. This signature information can be obtained by any IoT device signing the corresponding target data using its private key. Therefore, after acquiring the target data, any IoT device can sign the target data using its private key to obtain the corresponding signature information. For example, it can first calculate the hash of the target data, and then sign the hash using its private key to obtain the signature information. After obtaining the signature information, when sending the target data to the node device, both the target data and the signature information can be sent simultaneously.

[0090] In summary, signing target data with a private key can guarantee the data security of the data sender (i.e., IoT device). This means that the security of the target data can be guaranteed from the generation (or acquisition) of the target data by the IoT device to the transmission process, ensuring that the target data will not be tampered with, thus guaranteeing the immutability of the target data and ensuring its trustworthiness from generation to transmission.

[0091] In one implementation, the target data can also be reliably verified (or effectively verified). If the target data passes the reliable verification (effective verification), the subsequent step S302 can be executed. If the target data fails the reliable verification (effective verification), the execution of the subsequent steps can be stopped.

[0092] Optionally, there may be a time difference between the time an IoT device acquires data from its surroundings and the time it sends the acquired data to the blockchain network. If the time difference is large, the reliability of the data may be low. Therefore, this time difference can be used to effectively verify the target data and ensure its reliability. In this case, for any IoT device, the sending time of the target data and the acquisition time of the target data from the environment can be obtained, and the time difference between the sending and acquisition times can be calculated. This time difference can then be used to effectively verify the target data of any IoT device. If the time difference is within a valid time period, the verification is considered successful, and a storage operation can be performed, i.e., associating the target data of any IoT device with its DID and storing it on the blockchain network. If the time difference is not within a valid time period, the verification is considered unsuccessful, and a storage failure message can be output to inform the user of the storage status.

[0093] Optionally, the data stored on the blockchain network must be data acquired by IoT devices from the environment within a specified time period. For example, a specific time period for the target data may be pre-set; such as 9:00 AM to 5:00 PM daily, or 1:00 PM to 5:00 AM daily, etc. In this case, the reliability verification (validity verification) can verify the time when the IoT device acquires data from its surrounding environment. In this scenario, for any IoT device, the acquisition time of the target data from the environment can be obtained to perform valid verification of the target data. If the acquisition time is within the specified time period, the valid verification is confirmed, and storage can be performed. If the acquisition time is not within the specified time period, the valid verification fails, and a storage failure message can be output.

[0094] In one implementation, after receiving target data from one or more IoT devices, each piece of target data can be associated with the corresponding IoT device's DID and stored on a blockchain network. For target data from any IoT device, the DID corresponding to that IoT device can be matched with one or more reference DIDs, which are DIDs registered on the blockchain network. If the DID matches any of the multiple reference DIDs, it can be determined that the IoT device has successfully registered on the blockchain network, thus establishing a trusted identity. In this case, the target data can be associated with and stored with the corresponding IoT device's DID. If the DID does not match any of the multiple reference DIDs, it can be determined that the IoT device has not successfully registered on the blockchain network, thus establishing a trusted identity. To ensure the trustworthiness of the target data, storing that target data on the blockchain network can be prohibited. A data storage failure message can also be returned to inform the user.

[0095] In summary, blockchain can be used as a data storage center. By leveraging the immutability of data on the blockchain, the trustworthiness of the data storage center can be guaranteed, and the security of the target data storage can be improved.

[0096] In one implementation, the target data corresponding to each IoT device can be partitioned and stored on the blockchain network based on the data type of the target data. The specific method of partitioning this data type is not limited. For example, the data type can be partitioned according to different scenarios, with one data type corresponding to one scenario. For instance, scenarios could be smart weather, smart transportation, smart healthcare, etc., and the data types could include smart weather scenario, smart transportation, smart healthcare, etc. Alternatively, the data can be further partitioned within each scenario. In this case, the data type can include a primary type and a secondary type. The primary type can indicate a scenario type, and the secondary type can indicate a specific data type within that scenario type. For example, in a smart weather scenario, the data acquired by IoT devices includes perceived temperature, humidity, wind force, and wind direction. The primary type of the data type could be "smart weather," and the secondary types could include temperature, humidity, wind force, and wind direction. Other methods of data partitioning are also possible, but not all are listed here. In practice, after receiving target data from various IoT devices, the data type of each target data item can be obtained first. This data type can be determined based on the data type carried within the target data, or it can be identified using relevant recognition technologies, or determined using other methods. After obtaining the data type of each target data item, each data item can be associated with the DID corresponding to the corresponding IoT device and stored in the storage partition corresponding to each data type on the blockchain network. In other words, the target data can be stored in the partition corresponding to the data type.

[0097] In one implementation, if the identifier prefixes of the DIDs corresponding to IoT devices under different scenario types mentioned in step S201 are different, and the identifier prefixes of the DIDs corresponding to IoT devices under the same scenario type are the same, then the target data can be partitioned and stored according to the identifier prefixes. For example, each target data can be associated with the DID corresponding to the corresponding IoT device and stored in the storage partitions corresponding to each identifier prefix on the blockchain network; that is, one identifier prefix can correspond to one storage partition.

[0098] In one implementation, the storage space of the storage partitions corresponding to each identifier prefix can be different. As mentioned earlier, one scene type corresponds to one identifier prefix. Therefore, the storage space of each storage partition can be allocated based on the data usage rate under each scene type. For example, the storage space of each storage partition is positively correlated with the data usage rate under the scene type corresponding to each identifier prefix. That is, if the data usage rate under a scene type corresponding to a certain identifier prefix is ​​higher, the storage space of the storage partition corresponding to that scene type will be larger; if the data usage rate under a scene type corresponding to a certain identifier prefix is ​​lower, the storage space of the storage partition corresponding to that scene type will be smaller. Optionally, if the storage space of the storage partitions corresponding to each identifier prefix is ​​limited, the target data in each storage partition can be updated to ensure sufficient storage space for the target data uploaded by IoT devices. For example, if it is detected that the remaining storage space of any storage partition exceeds the preset remaining storage space, the data characteristics of each target data in any storage partition can be obtained. Based on the data characteristics of the target data, data to be deleted can be filtered out from any storage partition and then deleted from the storage partition. The data characteristics may include one or more of storage duration and usage frequency. Usage frequency may refer to the number of times it is used within a historical time period. The historical time period refers to the time period before the current time and the time interval between the current time and the current time is a preset duration (e.g., 7 days, 14 days, etc.). The current time may refer to the moment when a new storage requirement for target data is detected.

[0099] The following describes the methods for determining data to be deleted based on different data characteristics.

[0100] Optionally, if the data characteristics include storage duration, the storage duration of each target data item can be obtained first, then compared with a preset storage duration, and finally, the target data that exceeds the preset storage duration can be deleted. This method allows for the deletion of data with excessively long storage durations.

[0101] Optionally, if the data characteristics include usage frequency, the usage frequency of each target data point can be obtained first, then compared with a preset usage frequency, and finally, the target data that does not exceed the preset usage frequency can be deleted. In this way, data with low usage frequency can be deleted.

[0102] Optionally, when the data characteristics include storage duration and usage frequency, the storage duration and usage frequency of each target data can be obtained first, and then the storage duration of each target data can be compared with the preset storage duration. Target data that exceeds the preset storage duration can be used as initial data to be deleted. Furthermore, the usage frequency of each initial data to be deleted can be compared with the preset usage frequency, and finally, the initial data to be deleted that does not exceed the preset usage frequency can be used as data to be deleted.

[0103] S304, Obtain a data request sent by the target device for target data of the target IoT device, the data request carrying the target DID of the target IoT device.

[0104] In one implementation, when a target device needs to process target data obtained from an IoT device, it can obtain the required target data from the blockchain network. Specifically, the target device can send a data request for target data of the target IoT device to a node device, and the node device can receive the data request for target data of the target IoT device sent by the target device. The target IoT device is included among one or more IoT devices registered on the blockchain network. The data request may carry the target DID of the target IoT device, and the number of target DIDs can be one or more, meaning the target device can simultaneously request target data corresponding to one or more IoT devices from the node device. In one embodiment, if the target IoT device includes multiple IoT devices produced by a single device manufacturer, considering that the DID allocation for IoT devices produced by a single device manufacturer is based on an identifier range, the target DID of the target IoT device carried in the data request can be an identifier range to reduce the amount of data requested, thereby improving the data request transmission speed.

[0105] S305 determines the target data of the target IoT device from the blockchain network based on the target DID and returns the target data of the target IoT device to the target device.

[0106] In one implementation, considering that when a node device stores a target on the blockchain network, it associates the target data with its corresponding DID, the node device can search for the target's decentralized identifier from all DIDs on the blockchain network. The node device then uses the target data corresponding to the found decentralized identifier as the target data for the target IoT device. The found DID is the decentralized identifier on the blockchain network that matches the target's decentralized identifier. After obtaining the target data from the target IoT device, the node device can return the target data to the target device, enabling the target device to receive the target data sent by the node device and perform subsequent data processing.

[0107] In one implementation, as described in step S303, the target data of the IoT device can be stored in partitions, such as according to data type and identifier prefix. When determining the target data of the target IoT device from the blockchain network, a storage partition can be determined first based on the data type and identifier prefix, and then further searches can be performed in this storage partition.

[0108] Optionally, if the target data of an IoT device is stored in partitions according to data type, and the data request also carries the target data type, then the required data can be retrieved from each partition based on the target data type. That is, the storage partition corresponding to the target data type can be determined first from the blockchain network; then, the target data of the target IoT device can be determined from the storage partition corresponding to the target data type based on the target DID. It can be seen that by storing data in partitions according to data type, when there is a subsequent need to retrieve data of a specific data type, the required data can be quickly located from the blockchain, thus accelerating the data retrieval speed.

[0109] Optionally, when the target data of IoT devices is stored in partitions according to identifier prefixes, the storage partition corresponding to the prefix can be identified from the blockchain network first based on the identifier prefix of the target DID, and then the target data of the target IoT device can be determined from the storage partition corresponding to the identifier prefix based on the target DID. It can be seen that the above search method can effectively reduce the amount of data searching and speed up the data search process.

[0110] In this embodiment, an IoT device can be assigned a DID on the blockchain to build a trusted IoT device identity based on decentralized identity technology. After acquiring target data, the IoT device with the DID can use its private key corresponding to its DID to sign the acquired target data and upload it to the blockchain network of the data center, thereby ensuring the trustworthiness of the target data from its generation and during data transmission. At the same time, based on the blockchain foundation, the trustworthiness of the target data can also be guaranteed throughout the entire process of data production, data transmission and subsequent data processing by the IoT device.

[0111] To better understand the blockchain-based IoT data processing method proposed in the embodiments of this application, the following will be combined with... Figure 4 The method proposed in the embodiments of this application will be further described; wherein, Figure 4 The scenario involved is a smart city. For example, see... Figure 4 As shown, IoT device manufacturers (i.e., the aforementioned device manufacturers) can first register with a DID service (such as a DID backend service). This registration process involves requesting the identifier range for the IoT devices manufactured by the manufacturer from the DID backend service. Specifically, the manufacturer can send a manufacturer registration request to the DID backend service. After receiving the request, the DID backend service can assign the manufacturer an identifier range for CID and DID. Subsequently, after the manufacturer produces IoT devices, the DID of the produced IoT devices can be directly assigned based on the identifier range of CID and DID, and the private key corresponding to the DID can be embedded into the IoT device.

[0112] After an IoT device leaves the factory (i.e., the device manufacturer produces the IoT device), it can be initialized and run to register the device's DID in the smart city IoT system. For example, the IoT device can send an identification registration request for its DID to the blockchain network. The blockchain network (specifically, a node device on the blockchain network) can receive the identification registration request and register the IoT device on the blockchain network based on the DID carried in the identification registration request, that is, the IoT device's DID is recorded on the blockchain network.

[0113] Once an IoT device is successfully registered, it signifies that it has successfully joined the smart city IoT system. After joining, the IoT device can begin acquiring data from its surroundings to generate corresponding target data (also known as operational data). The IoT device can sign the operational data generated during operation using its embedded private key to obtain corresponding signature information. This signed operational data can then be uploaded to the blockchain network for storage. When uploading operational data, it can also carry a corresponding DID (Distributed ID) so that the operational data can be stored using the DID on the blockchain network, thus associating the DID with the operational data. Similarly, each IoT device follows the above process to upload and store its corresponding operational data on the blockchain network.

[0114] Furthermore, the smart city service backend (such as the target device mentioned above) can obtain the operational data corresponding to a specified IoT device (such as the target IoT device mentioned above) from the blockchain network via its DID. Specifically, the smart city service backend can send a data request for target data of the target IoT device to the blockchain network. This data request can carry the DID of the target IoT device, allowing the blockchain network to locate the corresponding operational data based on the DID and return it to the smart city service backend. After receiving the operational data returned by the blockchain network, the smart city service backend can verify the operational data using the public key corresponding to the target IoT device. After successful verification, the operational data can be processed (or analyzed), such as analyzing the operational status of IoT devices in the current smart city IoT system. Finally, the smart city service backend can transmit the processing results (or analysis results) to the smart city service front-end screen for display.

[0115] In summary, this application embodiment can assign a DID to each IoT device in a smart city IoT system on the blockchain. After acquiring data, the IoT device with the DID can sign the acquired data using the private key corresponding to its DID and upload it to the blockchain network of the data center. Subsequently, the smart city service backend (such as a smart city data analysis system) can perform data processing (analysis) based on the operational data of the IoT devices stored in the blockchain system. Throughout the entire process, the credibility of the operational data can be improved based on blockchain and decentralized identity technology, ensuring the credibility of the operational data from generation to transmission and final processing. Based on the above-mentioned credible process, the credibility of the smart city processing results can also be improved. Furthermore, by utilizing the immutability of data on the blockchain to use the blockchain as a data storage center, the credibility cost in traditional smart city IoT systems can be reduced. At the same time, it can be seen that IoT devices can be closely integrated with DIDs, so that each IoT device is assigned a DID. Thus, specific smart city application scenarios can be built based on the IoT + blockchain + DID model. Similarly, application scenarios such as product traceability, vehicle networking, and intelligent manufacturing can be built based on the IoT + blockchain + DID model.

[0116] Please see Figure 5 This is a schematic diagram of the structure of a blockchain-based Internet of Things (IoT) data processing device provided in an embodiment of this application. The blockchain-based IoT data processing device described in this embodiment includes:

[0117] The allocation unit 501 is used to receive a device production object registration request and, in response to the device production object registration request, allocate an identifier range for the device production object with a decentralized identity identifier (DID), so that the device production object can allocate a corresponding DID for the IoT devices it produces based on the identifier range when producing IoT devices.

[0118] The registration unit 502 is configured to respond to the identification registration request and register the identification of the IoT device on the blockchain network based on the DID when it receives an identification registration request sent by an IoT device carrying the DID of the IoT device;

[0119] Storage unit 503 is used to associate each target data with the DID of the corresponding IoT device and store it on the blockchain network if it receives target data sent by one or more IoT devices respectively.

[0120] The acquisition unit 504 is used to acquire a data request sent by the target device for target data of the target IoT device; the data request carries the target DID of the target IoT device, and the target IoT device is included in the one or more IoT devices.

[0121] The determining unit 505 is used to determine the target data of the target IoT device from the blockchain network based on the target DID, and return the target data of the target IoT device to the target device.

[0122] In one implementation, the storage unit 503 is specifically used for:

[0123] For target data of any IoT device, the DID corresponding to the IoT device is matched with one or more reference DIDs, which are DIDs registered on the blockchain network;

[0124] If the DID matches any of the plurality of reference DIDs, it is determined that any IoT device has been successfully registered on the blockchain network, and the target data is associated with and stored with the DID corresponding to any IoT device.

[0125] In one implementation, the storage unit 503 is specifically used for:

[0126] Obtain the data type of each target data, and associate each target data with the DID corresponding to the corresponding IoT device and store it in the storage partition corresponding to each data type on the blockchain network;

[0127] The data request also carries a target data type; determining the target data of the target IoT device from the blockchain network based on the target DID includes:

[0128] Determine the storage partition corresponding to the target data type from the blockchain network;

[0129] Based on the target DID, the target data of the target IoT device is determined from the storage partition corresponding to the target data type.

[0130] In one implementation, if the device production object is used to produce IoT devices applicable to one or more scenario types, the allocation unit 501 is specifically used for:

[0131] Respond to the production object registration request and obtain all scenario types corresponding to the device production object;

[0132] Configure corresponding identifier prefixes for each scene type, with one identifier prefix corresponding to one scene type;

[0133] Assign an identifier range for the device production object with a decentralized identity identifier (DID), wherein the identifier prefix of each DID in the identifier range under a scene type is the same;

[0134] The storage unit 503 is specifically used for:

[0135] Each target data is associated with the DID corresponding to the corresponding IoT device and stored in the storage partition corresponding to each identifier prefix on the blockchain network.

[0136] In one implementation, the storage unit 503 is further configured to:

[0137] Obtain the storage space of the storage partition corresponding to each of the identifier prefixes; the storage space of each storage partition is positively correlated with the data usage rate under the scene type corresponding to each identifier prefix.

[0138] If it is detected that the remaining storage space of any storage partition exceeds the preset remaining storage space, then the data characteristics of each target data in the storage partition are obtained, and the data characteristics include one or more of storage duration and usage frequency;

[0139] Based on the data characteristics, determine the data to be deleted from any of the storage partitions, and delete the data to be deleted from any of the storage partitions.

[0140] In one implementation, the storage unit 503 is further configured to:

[0141] For any IoT device, obtain the transmission time of the target data sent by the IoT device and the acquisition time of the target data obtained by the IoT device from the environment;

[0142] Calculate the time difference between the sending time and the acquisition time, and use the time difference to effectively verify the target data of any IoT device;

[0143] If the time difference is within a valid time period, then the valid verification is passed, and the step of associating the target data of any IoT device with the DID of any IoT device and storing it on the blockchain network is executed.

[0144] If the time difference is not within the valid time period, the valid check is determined to have failed, and a storage failure message is output.

[0145] In one implementation, the target data sent by any IoT device carries signature information, which is obtained by the IoT device signing the corresponding target data using its private key.

[0146] Please see Figure 6 This is a schematic diagram of another blockchain-based IoT data processing device provided in this application embodiment. The blockchain-based IoT data processing device described in this embodiment includes:

[0147] The sending unit 601 is used to send a data request for target data of a target IoT device to the blockchain network; the data request carries the target decentralized identity identifier (DID); the target DID is obtained by the device production object corresponding to the target IoT device using an identifier range, which is obtained by the blockchain network responding to the production object registration request after the device production object corresponding to the target IoT device sends a production object registration request to the blockchain network; the target DID needs to be registered on the blockchain network, and the identifier registration is achieved by the blockchain network responding to the identifier registration request after the target IoT device sends an identifier registration request carrying the target DID to the blockchain network;

[0148] The processing unit 602 is used to acquire the target data of the target IoT device returned by the blockchain network, and to perform data processing using the acquired target data to obtain the processing result; the target data of the target IoT device is determined by the blockchain network based on the target DID.

[0149] In one implementation, the acquired target data is associated with corresponding signature information, which is obtained by the target IoT device signing the hash of the corresponding target data using a private key; the device further includes a signature verification unit 603, which is specifically used for:

[0150] The signature information is verified using the public key of the target IoT device to obtain verification information, and the verification information is matched with the hash.

[0151] If the signature verification information matches the hash, the signature verification is confirmed to be successful, and the step of processing the data using the acquired target data is executed.

[0152] Please see Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device can be any node device and / or target device in the aforementioned blockchain network, or it can execute some or all of the steps performed by any node device and / or target device in the aforementioned blockchain network. The electronic device described in this embodiment includes: a processor 701, a memory 702, and a network interface 703. The processor 701, memory 702, and network interface 703 can exchange data.

[0153] The processor 701 described above can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0154] The memory 702 described above may include read-only memory and random access memory, and provides program instructions and data to the processor 701. A portion of the memory 702 may also include non-volatile random access memory.

[0155] Optionally, in some embodiments, the electronic device can be any node device in the blockchain network, or can execute some or all of the steps performed by any node device in the blockchain network. For example, when the processor 701 calls the program instructions, it is used to execute:

[0156] The device receives a device registration request and, in response to the registration request, assigns an identifier range for the device to use a decentralized identity identifier (DID), so that the device can assign a corresponding DID to the IoT devices it produces based on the identifier range when producing IoT devices.

[0157] When a registration request for identification carrying the DID of an IoT device is received, the system responds to the registration request and registers the IoT device on the blockchain network based on the DID.

[0158] If target data is received from one or more IoT devices, each target data is associated with the DID of the corresponding IoT device and stored on the blockchain network.

[0159] Acquire a data request sent by the target device for target data of the target IoT device; the data request carries the target DID of the target IoT device, the target IoT device being included in the one or more IoT devices;

[0160] Based on the target DID, the target data of the target IoT device is determined from the blockchain network, and the target data of the target IoT device is returned to the target device.

[0161] In one implementation, the processor 701 is further configured to:

[0162] In one implementation, the processor 701 is specifically used for:

[0163] For target data of any IoT device, the DID corresponding to the IoT device is matched with one or more reference DIDs, which are DIDs registered on the blockchain network;

[0164] If the DID matches any of the plurality of reference DIDs, it is determined that any IoT device has been successfully registered on the blockchain network, and the target data is associated with and stored with the DID corresponding to any IoT device.

[0165] In one implementation, the processor 701 is specifically used for:

[0166] Obtain the data type of each target data, and associate each target data with the DID corresponding to the corresponding IoT device and store it in the storage partition corresponding to each data type on the blockchain network;

[0167] The data request also carries a target data type; determining the target data of the target IoT device from the blockchain network based on the target DID includes:

[0168] Determine the storage partition corresponding to the target data type from the blockchain network;

[0169] Based on the target DID, the target data of the target IoT device is determined from the storage partition corresponding to the target data type.

[0170] In one implementation, if the device manufacturing object is used to produce IoT devices applicable to one or more scenario types, the processor 701 is specifically used for:

[0171] Respond to the production object registration request and obtain all scenario types corresponding to the device production object;

[0172] Configure corresponding identifier prefixes for each scene type, with one identifier prefix corresponding to one scene type;

[0173] Assign an identifier range for the device production object with a decentralized identity identifier (DID), wherein the identifier prefix of each DID in the identifier range under a scene type is the same;

[0174] Specifically, the processor 701 is used for:

[0175] Each target data is associated with the DID corresponding to the corresponding IoT device and stored in the storage partition corresponding to each identifier prefix on the blockchain network.

[0176] In one implementation, the processor 701 is further configured to:

[0177] Obtain the storage space of the storage partition corresponding to each of the identifier prefixes; the storage space of each storage partition is positively correlated with the data usage rate under the scene type corresponding to each identifier prefix.

[0178] If it is detected that the remaining storage space of any storage partition exceeds the preset remaining storage space, then the data characteristics of each target data in the storage partition are obtained, and the data characteristics include one or more of storage duration and usage frequency;

[0179] Based on the data characteristics, determine the data to be deleted from any of the storage partitions, and delete the data to be deleted from any of the storage partitions.

[0180] In one implementation, the processor 701 is further configured to:

[0181] For any IoT device, obtain the transmission time of the target data sent by the IoT device and the acquisition time of the target data obtained by the IoT device from the environment;

[0182] Calculate the time difference between the sending time and the acquisition time, and use the time difference to effectively verify the target data of any IoT device;

[0183] If the time difference is within a valid time period, then the valid verification is passed, and the step of associating the target data of any IoT device with the DID of any IoT device and storing it on the blockchain network is executed.

[0184] If the time difference is not within the valid time period, the valid check is determined to have failed, and a storage failure message is output.

[0185] In one implementation, the target data sent by any IoT device carries signature information, which is obtained by the IoT device signing the corresponding target data using its private key.

[0186] Optionally, in some embodiments, the electronic device may be a target device, or may be capable of executing some or all of the steps performed by the target device. For example, when the processor 701 invokes the program instructions, it is used to execute:

[0187] A data request for target data of a target IoT device is sent to the blockchain network. The data request carries the target decentralized identity identifier (DID). The target DID is allocated by the device manufacturer corresponding to the target IoT device using an identifier range. This identifier range is obtained by the blockchain network responding to the device manufacturer's registration request after the device manufacturer sends the registration request. The target DID needs to be registered on the blockchain network. This registration is achieved by the blockchain network responding to the registration request after the target IoT device sends a registration request carrying the target DID.

[0188] The target data of the target IoT device returned by the blockchain network is obtained, and the obtained target data is used for data processing to obtain the processing result; the target data of the target IoT device is determined by the blockchain network based on the target DID.

[0189] In one implementation, the acquired target data is associated with corresponding signature information, the signature information being obtained by the target IoT device signing the hash of the corresponding target data using a private key; the processor 701 is further configured to:

[0190] The signature information is verified using the public key of the target IoT device to obtain verification information, and the verification information is matched with the hash.

[0191] If the signature verification information matches the hash, the signature verification is confirmed to be successful, and the step of processing the data using the acquired target data is executed.

[0192] This application also provides a computer storage medium storing program instructions, which, when executed, may include, for example... Figure 2 or Figure 3 Some or all of the steps of the blockchain-based IoT data processing method in the corresponding embodiments.

[0193] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0194] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0195] This application also provides a computer program product or computer program that includes program instructions that, when executed by a processor, can implement some or all of the steps in the methods described above. For example, the program instructions are stored in a computer-readable storage medium. The processor of an electronic device reads the program instructions from the computer-readable storage medium and executes the program instructions, causing the electronic device to perform the steps executed in the embodiments of the methods described above.

[0196] The foregoing has provided a detailed description of a blockchain-based Internet of Things (IoT) data processing method and related devices provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A blockchain-based Internet of Things (IoT) data processing method, characterized in that, The method includes: Receive the device production object registration request; If the device production object is used to produce IoT devices applicable to one or more scenario types, then respond to the production object registration request and obtain all scenario types corresponding to the device production object; Configure corresponding identifier prefixes for each scene type, with one identifier prefix corresponding to one scene type; Assign an identifier range for the device production object with a decentralized identity identifier (DID). The identifier prefixes of each DID in the identifier range under a scenario type are the same, so that the device production object can assign the corresponding DID to the IoT device it produces based on the identifier range when producing IoT devices. When a registration request for identification carrying the DID of an IoT device is received, the system responds to the registration request and registers the IoT device on the blockchain network based on the DID. If target data is received from one or more IoT devices, each target data is associated with the DID of the corresponding IoT device and stored in the storage partition corresponding to each identifier prefix on the blockchain network. Acquire a data request sent by the target device for target data of the target IoT device; the data request carries the target DID of the target IoT device, the target IoT device being included in the one or more IoT devices; Based on the target DID, the target data of the target IoT device is determined from the blockchain network, and the target data of the target IoT device is returned to the target device.

2. The method according to claim 1, characterized in that, The step of associating each target data with the DID of the corresponding IoT device and storing it on the blockchain network includes: For target data of any IoT device, the DID corresponding to the IoT device is matched with one or more reference DIDs, which are DIDs registered on the blockchain network; If the DID matches any of the plurality of reference DIDs, it is determined that any IoT device has been successfully registered on the blockchain network, and the target data is associated with and stored with the DID corresponding to any IoT device.

3. The method according to claim 1 or 2, characterized in that, The step of associating each target data with the DID of the corresponding IoT device and storing it on the blockchain network includes: Obtain the data type of each target data, and associate each target data with the DID corresponding to the corresponding IoT device and store it in the storage partition corresponding to each data type on the blockchain network; The data request also carries a target data type; the step of determining the target data of the target IoT device from the blockchain network based on the target DID includes: Determine the storage partition corresponding to the target data type from the blockchain network; Based on the target DID, the target data of the target IoT device is determined from the storage partition corresponding to the target data type.

4. The method according to claim 1, characterized in that, Also includes: Obtain the storage space of the storage partition corresponding to each of the aforementioned identifier prefixes; The storage space of each storage partition is positively correlated with the data usage rate under the scene type corresponding to each identifier prefix; If it is detected that the remaining storage space of any storage partition exceeds the preset remaining storage space, then the data characteristics of each target data in the storage partition are obtained, and the data characteristics include one or more of storage duration and usage frequency; Based on the data characteristics, determine the data to be deleted from any of the storage partitions, and delete the data to be deleted from any of the storage partitions.

5. The method according to claim 1, characterized in that, Also includes: For any IoT device, obtain the transmission time of the target data sent by the IoT device and the acquisition time of the target data obtained by the IoT device from the environment; Calculate the time difference between the sending time and the acquisition time, and use the time difference to effectively verify the target data of any IoT device; If the time difference is within a valid time period, then the valid verification is passed, and the step of associating the target data of any IoT device with the DID of any IoT device and storing it on the blockchain network is executed. If the time difference is not within the valid time period, the valid check is determined to have failed, and a storage failure message is output.

6. The method according to claim 1, characterized in that, The target data sent by any IoT device carries signature information, which is obtained by the IoT device signing the corresponding target data using its private key.

7. A blockchain-based Internet of Things (IoT) data processing method, characterized in that, The method includes: A data request for target data of a target IoT device is sent to the blockchain network. The data request carries the target decentralized identity identifier (DID). The target DID is obtained by the device production object corresponding to the target IoT device using an identifier range. The identifier range is obtained by the blockchain network responding to the production object registration request after the production object sends a production object registration request, based on the identifier prefixes corresponding to all scenario types of the production object. The production object is used to produce IoT devices applicable to one or more scenario types. One scenario type corresponds to one identifier prefix, and the identifier prefixes of all DIDs within the identifier range of one scenario type are the same. The target DID needs to be registered on the blockchain network. This registration is achieved by the blockchain network responding to the identifier registration request after the target IoT device sends an identifier registration request carrying the target DID. The target data of the target IoT device returned by the blockchain network is obtained, and the obtained target data is used for data processing to obtain the processing result; the target data of the target IoT device is determined by the blockchain network based on the target DID; wherein, the target data of one or more IoT devices are associated with the DID corresponding to the corresponding IoT device and stored in the storage partition corresponding to each identifier prefix on the blockchain network.

8. The method according to claim 7, characterized in that, The acquired target data is associated with corresponding signature information, which is obtained by the target IoT device signing the hash of the corresponding target data using its private key; it also includes: The signature information is verified using the public key of the target IoT device to obtain verification information, and the verification information is matched with the hash. If the signature verification information matches the hash, the signature verification is confirmed to be successful, and the step of processing the data using the acquired target data is executed.

9. A blockchain-based Internet of Things (IoT) data processing device, characterized in that, include: The allocation unit is used to receive the production object registration request of the equipment production object; If the device production object is used to produce IoT devices applicable to one or more scenario types, then respond to the production object registration request and obtain all scenario types corresponding to the device production object; configure a corresponding identifier prefix for each scenario type, with one identifier prefix corresponding to one scenario type; allocate an identifier range for the device production object regarding decentralized identity identifier (DID), with the identifier prefix of each DID in the identifier range under a scenario type being the same, so that the device production object allocates the corresponding DID to the IoT devices it produces based on the identifier range when producing IoT devices; The registration unit is configured to respond to the identification registration request and register the identification of the IoT device on the blockchain network based on the DID when it receives an identification registration request sent by an IoT device carrying the DID of the IoT device; The storage unit is used to associate each target data with the DID corresponding to the corresponding IoT device and store it in the storage partition corresponding to each identifier prefix on the blockchain network if target data is received from one or more IoT devices respectively. An acquisition unit is configured to acquire a data request sent by a target device for target data of a target IoT device; the data request carries the target DID of the target IoT device, and the target IoT device is included in the one or more IoT devices. The determining unit is configured to determine the target data of the target IoT device from the blockchain network based on the target DID, and return the target data of the target IoT device to the target device.

10. A blockchain-based Internet of Things (IoT) data processing device, characterized in that, include: The sending unit is used to send a data request for target data of a target IoT device to the blockchain network. The data request carries the target decentralized identity identifier (DID). The target DID is allocated by the device production object corresponding to the target IoT device using an identifier range. The identifier range is obtained by the blockchain network responding to the production object registration request after the production object sends a production object registration request to the blockchain network, based on the identifier prefixes corresponding to all scenario types of the production object. The production object is used to produce IoT devices applicable to one or more scenario types. One scenario type corresponds to one identifier prefix, and the identifier prefixes of all DIDs in the identifier range under one scenario type are the same. The target DID needs to be registered on the blockchain network. The identifier registration is achieved by the blockchain network responding to the identifier registration request after the target IoT device sends an identifier registration request carrying the target DID. The processing unit is used to acquire target data of the target IoT device returned by the blockchain network, and to process the acquired target data to obtain a processing result; the target data of the target IoT device is determined by the blockchain network based on the target DID; wherein, the target data of one or more IoT devices are associated with the DID corresponding to the corresponding IoT device and stored in the storage partition corresponding to each identifier prefix on the blockchain network.

11. An electronic device, characterized in that, The system includes a processor and a memory, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to perform the method as described in any one of claims 1-8.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that, when executed, are used to implement the method as described in any one of claims 1-8.

13. A computer program product, characterized in that, The computer program product includes program instructions that, when executed by a processor, implement the method as described in any one of claims 1-8.