Block chain data processing method and device, equipment and storage medium

The acquisition of smart contract generation control instructions through blockchain technology solves the problems of low efficiency and insufficient security of smart home control, and achieves efficient and safe personalized control.

CN120263576APending Publication Date: 2025-07-04TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410004571.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-02
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The existing smart home control solution is based on a centralized data platform, resulting in high development costs, slow control speed and security risks, making it difficult to meet users' personalized needs.

Method used

Using blockchain technology, by obtaining device identification and control data, smart contracts are obtained from the blockchain network, and control instructions are generated and sent to the target device to achieve decentralized control.

Benefits of technology

It improves the control efficiency of smart home devices, ensures security, and meets the personalized needs of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120263576A_ABST
    Figure CN120263576A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a block chain data processing method and device, equipment and a storage medium, and the method comprises the steps: obtaining control data for controlling target equipment, and an equipment identifier of the target equipment, the method comprises the steps of obtaining an intelligent contract corresponding to a target device identified by a device identifier from a block chain network, generating a control instruction corresponding to the control data based on a corresponding relation between the control data and the control instruction in the intelligent contract, and sending the control instruction to the target device to enable the target device to execute the control instruction. According to the embodiment of the invention, each device in the block chain network is controlled based on the block chain technology, the control efficiency of the smart home device is improved, the security of smart home control is ensured, and the personalized requirements of users are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technologies, and in particular, to a blockchain data processing method, apparatus, device, and storage medium. Background Art

[0002] With the continuous maturity of Internet of Things technologies, research in the field of smart homes has also been continuously developing. Currently, smart home control solutions are all based on a centralized data platform, allowing users to control and manage various smart homes through mobile phones or other terminal devices. Therefore, this centralized data platform needs to interface with smart home devices produced by multiple different smart home manufacturers, which will involve various interfaces and data formats, resulting in high development costs, slow control speeds, and at the same time, the centralized data platform is vulnerable to attacks, with security risks such as leakage or tampering of smart home device data. It is also difficult for users to adjust the working status of smart home devices according to their own personalized needs, resulting in a poor user experience.

[0003] Therefore, how to improve the control efficiency of smart home devices, ensure the security of smart home control, and meet the personalized needs of users is an urgent problem to be solved. Summary of the Invention

[0004] The technical problem to be solved by the embodiments of the present invention is to provide a blockchain data processing method, apparatus, device, and storage medium to improve the control efficiency of smart home devices, ensure the security of smart home control, and meet the personalized needs of users.

[0005] In a first aspect, an embodiment of the present invention provides a blockchain data processing method, including:

[0006] Obtain control data for controlling a target device and the device identifier of the target device;

[0007] Obtain a smart contract corresponding to the target device identified by the device identifier from a blockchain network; wherein the blockchain network includes the target device;

[0008] Generate a control instruction corresponding to the control data based on the correspondence between the control data and the control instruction in the smart contract;

[0009] Send the control instruction to the target device so that the target device executes the control instruction.

[0010] It can be seen that in the embodiments of the present application, control data for controlling a target device and the device identifier of the target device are obtained, a smart contract corresponding to the target device identified by the device identifier is obtained from a blockchain network, a control instruction corresponding to the control data is generated based on the correspondence between the control data and the control instruction in the smart contract, and the control instruction is sent to the target device so that the target device executes the control instruction. Therefore, the embodiments of the present application control each device in the blockchain network based on blockchain technology, achieving improved control efficiency of smart home devices, ensuring the security of smart home control, and meeting the personalized needs of users.

[0011] In an alternative embodiment, the obtaining the control data for controlling the target device and the device identifier of the target device includes:

[0012] Receiving a control request sent by a client, the control request carrying the device identifier of the target device and the control data; wherein, the control data includes operation data submitted by an object of the client to the client for the target device; the blockchain network further includes the client;

[0013] The sending the control instruction to the target device includes:

[0014] Forwarding the control instruction to the target device through the client.

[0015] In an alternative embodiment, the method further includes:

[0016] If the target device identifier exists in the device identifiers associated with the client, triggering the execution of the step of obtaining the smart contract corresponding to the target device from the blockchain network based on the control request.

[0017] In an alternative embodiment, the method further includes:

[0018] Searching in the registered device list to find whether the device identifier of the target device exists; the registered device list includes at least one device identifier, and any device identifier in the registered device list is added to the registered device list when the connection data of the device identified by the any device identifier matches the connection standard data;

[0019] If the target device identifier is found, associating and storing the address of the client with the target device identifier.

[0020] In an alternative embodiment, the method further includes:

[0021] Obtain the identity identifier of the client and the identity information data of the client from the blockchain network;

[0022] Authenticate the client based on the identity identifier of the client and the identity information data of the client;

[0023] If the authentication is successful, trigger the execution of the step of obtaining the smart contract corresponding to the target device from the blockchain network based on the control request.

[0024] In an alternative embodiment, the method further includes:

[0025] Receive the registration request and the identity identifier sent by the client;

[0026] If the identity identifier is not found in the blockchain network, obtain the identity information data of the client from the client;

[0027] Publish the identity information data of the client and the identity identifier to the blockchain network.

[0028] In an alternative embodiment, the obtaining of the control data for controlling the target device and the device identifier of the target device includes:

[0029] Obtain the control data and the device identifier of the target device from the blockchain network; wherein, the control data and the device identifier of the target device are published to the blockchain network by the target device; the control data includes the environmental data collected by the target device.

[0030] In an alternative embodiment, the obtaining of the smart contract corresponding to the target device identified by the device identifier from the blockchain network includes:

[0031] Obtain at least one smart contract corresponding to the target device identified by the device identifier from the blockchain network;

[0032] Determine the control type of the control data, and obtain the smart contract corresponding to the control type from the at least one smart contract.

[0033] In an alternative embodiment, the method further includes:

[0034] Receive the control policy data of the target device sent by the client;

[0035] Generate a smart contract corresponding to the target device based on the control policy data of the target device for the target device;

[0036] Publish the smart contract corresponding to the target device to the blockchain network.

[0037] In an alternative embodiment, the method further includes:

[0038] Publish connection standard data to the blockchain network so that the blockchain nodes corresponding to the device manufacturers can obtain the connection standard data from the blockchain network for manufacturing the target device that matches the connection standard data;

[0039] The step of sending the control instruction to the target device includes:

[0040] Send the control instruction to the target device that matches the connection standard data.

[0041] In an alternative embodiment, the method further includes:

[0042] Publish a registration contract to the blockchain network so that the blockchain nodes corresponding to the device manufacturers can call the registration contract to verify whether the connection data of the target device matches the connection standard data to obtain a verification result;

[0043] Receive the verification result sent by the blockchain node corresponding to the device manufacturer;

[0044] If the verification result indicates that the connection data of the target device matches the connection standard data, add the target device to the blockchain network.

[0045] In a second aspect, an embodiment of the present invention provides a blockchain data processing device, which includes:

[0046] An acquisition unit, configured to acquire control data for controlling a target device and the device identifier of the target device;

[0047] The acquisition unit is further configured to acquire the smart contract corresponding to the target device identified by the device identifier from the blockchain network; wherein the blockchain network includes the target device;

[0048] A generation unit, configured to generate a control instruction corresponding to the control data based on the correspondence between the control data and the control instruction in the smart contract;

[0049] A sending unit, configured to send the control instruction to the target device so that the target device executes the control instruction.

[0050] In a third aspect, an embodiment of the present invention provides a computer device, which includes a memory, a communication interface, and a processor, where the memory, the communication interface, and the processor are interconnected; the memory stores a computer program, and the processor calls the computer program stored in the memory to implement the method described in the first aspect above.

[0051] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the method described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background art, the following will describe the drawings required to be used in the embodiments of the present invention or the background art.

[0053] Figure 1 It is a system architecture diagram of a blockchain data processing method provided by an embodiment of the present application;

[0054] Figure 2 It is a flowchart of a blockchain data processing method provided by an embodiment of the present application;

[0055] Figure 3 It is another system architecture diagram of a blockchain data processing method provided by an embodiment of the present application;

[0056] Figure 4 It is a flowchart for controlling a target device provided by an embodiment of the present application;

[0057] Figure 5 It is a schematic diagram of a blockchain data processing device provided by an embodiment of the present application;

[0058] Figure 6 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0059] The following describes the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention.

[0060] The terms "first", "second", "third", etc. in the specification and claims of the present invention and the above drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "including" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the listed steps or modules, but optionally further includes steps or modules not listed, or optionally further includes other steps or modules inherent to these processes, methods, products, or devices.

[0061] Block Chain is a chain - type data structure formed by combining data blocks in sequence according to time order, and is a distributed ledger that uses cryptography to ensure data immutability and non - forgery. Multiple independent distributed nodes (i.e., blockchain nodes) store the same records. As long as one server in the entire system can work, the entire blockchain is secure. Blockchain technology achieves decentralization. The embodiments of this application provide a blockchain data processing method. Based on blockchain technology, this method adds a target device to the blockchain network to achieve decentralized control of the target device.

[0062] A blockchain data processing method provided by the embodiments of this application can be applied to the smart home control scenario. Taking the actual smart home operation scenario as an example, based on the blockchain data processing method proposed in the embodiments of this application, a user associates multiple smart homes. The smart homes can upload the collected user data to the blockchain network. When the user controls the smart home, the smart contract in the blockchain network can perform personalized smart home control on the user based on the collected user data, improving the automation and efficiency of smart home devices and meeting the personalized needs of users. Since the blockchain has the characteristics of decentralized multi - node data backup, anti - tampering, and traceability, it can achieve secure data storage and transmission.

[0063] Furthermore, in the smart home production scenario, based on the blockchain data processing method provided by the embodiments of this application, the blockchain network can include a control center platform and different smart home manufacturers. Among them, the control center platform can upload unified smart home production standards, such as interface standards, data transmission formats, etc., to the blockchain network. Each smart home manufacturer accessing the blockchain network can obtain the unified smart home production standards from the blockchain network and produce smart home devices according to these standards. In this way, when the user controls each smart home through the control center platform, the control center and each smart home can achieve a faster docking speed and higher control efficiency. At the same time, since each smart device is produced according to unified production standards, it can also effectively save control costs.

[0064] To better understand a blockchain data processing method disclosed in the embodiments of the present invention, the system architecture applicable to the embodiments of this application will be described below.

[0065] Please refer to Figure 1 , Figure 1 which is a system architecture diagram of a blockchain data processing method provided by the embodiments of this application. As shown in Figure 1 the system architecture applicable to the embodiments of this application includes, but is not limited to, a control center and at least one smart device (for example Figure 1The devices shown, namely Device 1, Device 2, and Device 3). Among them, the processing device corresponding to the control center can be the server of the control center. The intelligent devices can include, but are not limited to, smart home devices such as smart air conditioners, smart curtains, floor sweeping robots, smart TVs, as well as independent application programs, application programming interfaces (Application Programming Interface, API), or software development kits (Software Development Kit, SDK). The embodiments of the present invention do not make limitations in this regard.

[0066] It can be understood that a blockchain data processing method described in an embodiment of this application is to more clearly illustrate the technical solution of the embodiment of the present invention, and does not constitute a limitation on the technical solution provided by the embodiment of the present invention. Those skilled in the art know that with the evolution of the system framework and the emergence of new business scenarios, the technical solution provided by the embodiment of the present invention is equally applicable to similar technical problems.

[0067] Please refer to Figure 2 , Figure 2 is a flowchart of a blockchain data processing method provided by an embodiment of this application, as Figure 2 shown.

[0068] S201. Obtain control data for controlling a target device and the device identifier of the target device.

[0069] In an alternative embodiment, the control data and the device identifier of the target device can be obtained from the blockchain network. Among them, the control data and the device identifier of the target device are published to the blockchain network by the target device. The control data includes environmental data collected by the target device. The environmental data can include sound data, temperature data, or image data collected by the target device, etc. Exemplarily, if the target device is an air conditioner device equipped with a temperature sensor, the air conditioner device can collect indoor temperature data in real time through the temperature sensor, and at the same time publish the collected temperature data and the device identifier of the air conditioner device to the blockchain network, so that the device corresponding to the control center can obtain the temperature data and the device identifier from the blockchain network for processing.

[0070] In an alternative embodiment, the blockchain network may also include a client. Therefore, a control request sent by the client can be received. The control request carries the device identifier of the target device and control data. Among them, the control data includes operation data of an object corresponding to the client submitted to the client for the target device. For specific implementation manners, reference can be made to the relevant descriptions in the following Figure 4 .

[0071] Optionally, after collecting environmental data, the target device may send the environmental data to the client, receive the operation data of the target device sent by the client in response to the environmental data, obtain the smart contract corresponding to the target device identified by the device identifier from the blockchain network, generate a control instruction corresponding to the operation data based on the correspondence between the operation data and the control instruction in the smart contract, and forward the control instruction to the target device through the client, so that the target device executes the control instruction.

[0072] Taking an intelligent access control device as an example, the intelligent access control system may collect image data of a visitor, send the image data to the client, and the object corresponding to the client may perform operations such as selecting to unlock or not unlock on the received image data, and send the operation data and the device identifier of the target device to the server. The server may obtain the smart contract corresponding to the target device identified by the device identifier from the blockchain network, generate a control instruction corresponding to the operation data based on the correspondence between the operation data and the control instruction in the smart contract, and forward the control instruction to the target device through the client, so that the target device executes the control instruction.

[0073] S202. Obtain the smart contract corresponding to the target device identified by the device identifier from the blockchain network.

[0074] In one implementation, at least one smart contract corresponding to the target device identified by the device identifier may be obtained from the blockchain network, the control type of the control data may be determined, and the smart contract corresponding to the control type may be obtained from the at least one smart contract. The types of the control data may include operation data, voice data, image data, temperature data, etc. A target device may correspond to more than one smart contract, different control data types correspond to different smart contracts, and different smart contracts correspond to different control strategies.

[0075] Further, the blockchain network includes a client. The server may receive the control strategy data of the target device sent by the client, generate a smart contract corresponding to the target device based on the control strategy data of the target device, and publish the smart contract corresponding to the target device to the blockchain network. Exemplarily, the object corresponding to the client may set different control strategies for different target devices. For example, when there is someone indoors, the air conditioner automatically starts working and adjusts to the most suitable temperature, and when the outdoor light intensity reaches a certain threshold, the curtain automatically closes. The client sends the control strategy data to the server, and the server generates the smart contract corresponding to the smart home based on the received control strategy data and publishes the smart contract to the blockchain network.

[0076] Based on this, the object corresponding to the client can implement personalized control of the target device according to its own personalized needs.

[0077] Optionally, the smart contract corresponding to the target device can also be set and published to the blockchain network by the manufacturer of the target device. The client can receive the relevant information data of the control policy corresponding to the smart contract set and published by the target device manufacturer, so that the object corresponding to the client can make a choice according to the actual situation. Exemplarily, the manufacturer of a lighting device sets and publishes the control policy of the smart contract corresponding to the lighting device as turning on the lighting device when the footsteps of the object are recognized. The client can receive the relevant information of the control policy. If the control policy meets the requirements of the object corresponding to the client, subsequent control instructions can be generated based on the smart contract.

[0078] S203. Generate a control instruction corresponding to the control data based on the correspondence between the control data and the control instruction in the smart contract.

[0079] Among them, a smart contract is actually a program composed of computer code. Its conclusion process is as follows: First step, both parties or multiple parties participating in the conclusion agree and jointly formulate a smart contract; Second step, the smart contract is broadcast and stored to the fulcrums of each blockchain in the world through the blockchain network; Third step, the successfully constructed smart contract waits for the conditions to be met and then automatically executes the contract content. Different control data correspond to different control instructions in the smart contract.

[0080] Optionally, the smart contract can include an artificial intelligence algorithm to predict the corresponding control instruction for the control data. Taking an air-conditioning device as an example, the server receives control data, which includes operation data sent by the client and environmental data published by the air-conditioning device to the blockchain network. The operation data indicates to turn on the air-conditioning device. The environmental data includes the indoor temperature data detected by the temperature sensor in the air-conditioning device before the server receives the control data. The server calls a smart contract corresponding to the air-conditioning device based on the control data. The smart contract contains an artificial intelligence algorithm. Based on the smart algorithm, the smart contract can predict and generate a control instruction corresponding to the control data. The control instruction can indicate to turn on the air-conditioning device with temperature X as the starting temperature. The temperature X is predicted by the artificial intelligence algorithm based on the control data and indicates the most suitable temperature for the object corresponding to the client in the current environment.

[0081] S204. Send the control instruction to the target device so that the target device executes the control instruction.

[0082] In an alternative embodiment, the device corresponding to the control center may publish connection standard data to the blockchain network, so that the blockchain node corresponding to the device manufacturer can obtain the connection standard data from the blockchain network for manufacturing a target device that matches the connection standard data. Therefore, the control instruction can be sent to the target device that matches the connection standard data. Among them, the connection standard data may include the interface standard of the device, the data transmission format of the device, and the like.

[0083] Furthermore, the device corresponding to the control center may publish a registration contract to the blockchain network, so that the blockchain node corresponding to the device manufacturer can call the registration contract to check whether the connection data of the target device matches the above-mentioned connection standard data to obtain a verification result. The device corresponding to the control center can receive the verification result sent by the blockchain node corresponding to the device manufacturer. If the verification result indicates that the connection data of the target device matches the connection standard data, the target device is added to the blockchain network. Based on this, each device manufacturer can obtain a unified production standard and produce devices according to the unified production standard, so that the target devices in the blockchain network are all of the unified standard, the control efficiency of the device corresponding to the control center for the target device is fully improved, and the development cost is reduced.

[0084] It can be seen that in the embodiment of the present application, control data for controlling a target device and the device identifier of the target device are obtained, the smart contract corresponding to the target device identified by the device identifier is obtained from the blockchain network, and based on the correspondence between the control data and the control instruction in the smart contract, a control instruction corresponding to the control data is generated, and the control instruction is sent to the target device so that the target device executes the control instruction. Therefore, the embodiment of the present application controls each device in the blockchain network based on blockchain technology, achieving the improvement of the control efficiency of smart home devices, ensuring the security of smart home control, and meeting the personalized needs of users.

[0085] In an alternative embodiment, the blockchain network may include a client. Please refer to Figure 3 , Figure 3 which is another system architecture diagram of the blockchain data processing method provided by the embodiment of the present application. As Figure 3 shown, the system architecture applicable to this embodiment includes but is not limited to a server, a client, and at least one smart device (such as Figure 3The devices shown, i.e., Device 1, Device 2, and Device 3). Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The intelligent device can include, but is not limited to, smart home devices such as smart air conditioners, smart curtains, floor cleaning robots, smart TVs, as well as independent application programs, Application Programming Interfaces (APIs), or Software Development Kits (SDKs). The terminal can include, but is not limited to: smart phones (such as Android phones, iOS phones, etc.), tablets, portable personal computers, Mobile Internet Devices (MIDs), smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention do not make limitations in this regard.

[0086] In an alternative embodiment, in combination with Figure 3 the system architecture diagram shown, please refer to Figure 4 , Figure 4 which is a flowchart for controlling a target device provided by an embodiment of the present application, as shown in the figure.

[0087] S401. Receive a control request sent by a client, where the control request carries the device identifier of the target device and the control data.

[0088] Among them, the control data includes the operation data submitted by an object of the client to the client for the target device.

[0089] In an alternative embodiment, if the target device identifier exists in the device identifiers associated with the client, trigger the step of obtaining the smart contract corresponding to the target device from the blockchain network. If the target device identifier does not exist in the device identifiers associated with the client, do not trigger the step of obtaining the smart contract corresponding to the target device from the blockchain network.

[0090] Among them, the device identifiers associated with the client are obtained by the following embodiment.

[0091] Specifically, check whether the device identifier of the target device exists in the list of registered devices. The list of registered devices includes at least one device identifier, and any device identifier in the list of registered devices is added to the list of registered devices when the connection data of the device identified by the device identifier matches the connection standard data. If the target device identifier is found, the address of the client is associated and stored with the target device identifier, and the address of one client can be associated and stored with multiple device identifiers.

[0092] Exemplarily, there are a client 1 and a client 2. The device identifiers associated with the client 1 include device 1 and device 5, and the device identifiers associated with the client 2 include device 2 and device 3. If the server receives a control request sent by the client 1, the control request carries the device identifier as device 2 and the control data. Since the device 2 does not exist in the device identifiers associated with the client, the server does not respond to the control request. If the server receives a control request sent by the client 2, the control request carries the device identifier as device 2 and the control data. Since the device 2 exists in the device identifiers associated with the client, the step of obtaining the smart contract corresponding to the device 2 from the blockchain network is triggered.

[0093] It can be seen that by implementing this embodiment, a client can only control the device identified by the device identifier associated with the client, effectively ensuring the security of smart device control. At the same time, through associated storage, when receiving the device identifier of the target device carried in the client control request, it is only necessary to query the device identifier of the target device from the device identifiers associated with the client, further improving the response speed to the client control request and achieving a fast control response for the client.

[0094] In an alternative embodiment, when receiving the control request sent by the client, the identity identifier and the identity information data of the client can be obtained from the blockchain network. Based on the identity identifier and the identity information data of the client, the client is authenticated. If the authentication is passed, the step of obtaining the smart contract corresponding to the target device from the blockchain network based on the control request is triggered.

[0095] The identity identifier and the identity information data of the client can be obtained when the client joins the blockchain network. The client joins the blockchain network through a registration process, and the registration process can include decentralized identity (DID) registration.

[0096] Specifically, the registration request and identity identifier sent by the client can be received. If the identity identifier is not found in the blockchain network, the identity information data of the client is obtained from the client, and the identity information data of the client and the identity identifier are published to the blockchain network.

[0097] Taking the DID registration process as an example, the user corresponding to the client can create a new DID, which can be based on a public key address or other identifier. The client sends the DID and the registration request to the server. The server verifies the validity of the registration request, which can include checking whether the registration request contains necessary parameters and ensuring the integrity and correctness of the registration request. Then the server checks whether the DID exists in the server's database or the decentralized identity registration list. If the DID exists, the server can reject the registration request or send a request to the client, instructing the client to provide a new DID. If the registration request passes the verification and the DID is unique, the server will obtain the registration information and identity information data provided by the client and publish the registration information and identity information data to the blockchain network. Among them, the registration information and identity information data can include the DID, the identity information submitted by the corresponding object of the client, and the public key, etc.

[0098] Furthermore, when the client sends a control request to the server, the server can verify the DID of the client. Specifically, the server can query the decentralized identity registration list or obtain the information of the DID in the blockchain network to verify whether the DID exists. If the DID exists, it further verifies the public key and related identity information associated with the DID.

[0099] S402. Obtain the smart contract corresponding to the target device identified by the device identifier from the blockchain network.

[0100] For the relevant description of obtaining the smart contract corresponding to the target device, reference can be made to the specific introduction in S202 above, which will not be elaborated here.

[0101] S403. Generate a control instruction corresponding to the control data based on the corresponding relationship between the control data and the control instruction in the smart contract.

[0102] In one implementation, the control data can include the operation data sent by the client and the environmental data collected by the target device. Among them, the environmental data can also include the sound data, temperature data, or image data collected by the associated device of the target device. The associated device can be any device identified by any device identifier other than the target device identified by the target device identifier in the device identifiers associated with the client.

[0103] Exemplarily, the device identifiers associated with the client include Device 1 and Device 2. The device identified by Device 1 is an air conditioner device, and the device identified by Device 2 is an access control system device. The server can obtain the outdoor temperature data published by the access control system device to the blockchain network and the indoor temperature data published by the air conditioner device to the blockchain network. Based on the indoor temperature data and the outdoor temperature data, the server can obtain the smart contract corresponding to the air conditioner device. Based on the correspondence between the control data and the control instructions in the smart contract, the server can generate corresponding control instructions, which can instruct the air conditioner device to adjust the temperature to the temperature Y that best matches the current indoor-outdoor temperature difference.

[0104] S404. Forward the control instruction to the target device through the client.

[0105] To better understand the embodiments of the present application, the following takes the technical process of a smart home control solution based on a blockchain data processing method provided by the embodiments of the present application as an example to detail an actual application solution of the embodiments of the present application.

[0106] The system architecture of the technical solution process includes a server, at least one client, at least one smart home device, and the smart home device manufacturer corresponding to the smart home device. The technical solution process can include three stages: production and on-chain of smart homes, initialization of smart home control, and control of smart homes.

[0107] In the production and on-chain stage of smart homes, the server can publish the unified production standard of smart homes and the smart home registration contract to the blockchain network. The blockchain node corresponding to the smart home manufacturer can obtain the unified production standard, so that the smart home manufacturer can produce the smart home device according to the unified production standard. After producing the smart home, the smart home manufacturer can call the registration contract to check whether the smart home meets the unified production standard. If the check passes, the smart home manufacturer can send the check result to the server, so that the server can add the identifier of the smart home to the list of registered smart homes and add the smart home device to the blockchain network.

[0108] In the initialization stage of smart home control, first, the client can create a new DID in the blockchain network and register it in the blockchain network. Then, it can authenticate the smart home devices that the client needs to control, including checking whether the device identifiers of the smart home devices that the client needs to control exist in the registered smart home device list. If the device identifier of the smart home device exists, the client address can be associated and stored with the device identifier of the smart home device. Further, the object corresponding to the client can set the control policy of the smart home through the client or use the control policy corresponding to the smart contract set by the smart home manufacturer. If the object corresponding to the client sets the control policy of the smart home device through the client, the control policy can be sent to the server to generate a smart contract for the smart home device.

[0109] In the control stage of the smart home, the client can send a control request to the server. The control request carries the device identifier and control data of the smart home device. After the server verifies the DID of the client, it can obtain the smart contract corresponding to the target device identified by the device identifier from the blockchain network, and determine the smart contract corresponding to the control data type based on the type of the control data. Based on the correspondence between the control data and the control instruction in the smart contract, a control instruction corresponding to the control data is generated, and the control instruction is forwarded to the smart device through the client so that the smart device executes the control instruction.

[0110] It can be seen that through a blockchain data processing method provided by an embodiment of the present application, based on the characteristics of decentralization, uniqueness, traceability, and immutability of the blockchain, the credibility and security of smart home device and data transmission can be realized. At the same time, through the deployment and invocation of smart contracts to execute functions such as registration, discovery, and control of smart home devices, the automation and efficiency of smart home device control can be ensured, and the control time and feedback time of smart home devices can be shortened. Further, through the distributed ledger feature of the blockchain, the recording and analysis of users' personalized needs and environmental changes can also be realized. At the same time, receiving users' setting of control policies to generate corresponding smart contracts can fully improve the working effect of smart homes and meet users' personalized needs and experiences.

[0111] Based on the description of related embodiments, an embodiment of the present application further provides a blockchain data processing device. The blockchain data processing device can execute Figures 1 to 4 the operations performed by the server shown. Please refer to Figure 5 , Figure 5 which is a schematic diagram of a blockchain data processing device provided by an embodiment of the present application. As Figure 5As shown in the figure, the blockchain data processing device may include, but is not limited to, an acquisition unit 501, a generation unit 502, and a sending unit 503.

[0112] The acquisition unit 501 is configured to acquire control data for controlling a target device and the device identifier of the target device.

[0113] The acquisition unit 501 is further configured to acquire the smart contract corresponding to the target device identified by the device identifier from the blockchain network; wherein the blockchain network includes the target device.

[0114] The generation unit 502 is configured to generate a control instruction corresponding to the control data based on the correspondence between the control data and the control instruction in the smart contract.

[0115] The sending unit 503 is configured to send the control instruction to the target device so that the target device executes the control instruction.

[0116] In an optional implementation manner, the acquisition unit 501 acquires control data for controlling a target device and the device identifier of the target device, including:

[0117] Receiving a control request sent by a client, where the control request carries the device identifier of the target device and the control data; wherein the control data includes operation data of an object of the client submitted to the client for the target device; the blockchain network further includes the client.

[0118] The above-mentioned sending the control instruction to the target device includes:

[0119] The sending unit 503 forwards the control instruction to the target device through the client.

[0120] In an optional implementation manner, if the target device identifier exists in the device identifiers associated with the client, the acquisition unit 501 is triggered to execute the step of acquiring the smart contract corresponding to the target device identified by the device identifier from the blockchain network.

[0121] In an optional implementation manner, the device further includes a search unit 504 and a storage unit 505.

[0122] The search unit 504 is configured to search in the registered device list to find whether the device identifier of the target device exists; the registered device list includes at least one device identifier, and any device identifier in the registered device list is added to the registered device list when the connection data of the device identified by the any device identifier matches the connection standard data.

[0123] A storage unit 505, configured to, if the target device identifier is found, associate and store the address of the client with the target device identifier.

[0124] In an optional implementation, the apparatus further includes an authentication unit 506;

[0125] An acquisition unit 501, configured to acquire the identity identifier of the client and the identity information data of the client from the blockchain network;

[0126] An authentication unit 506, configured to authenticate the client based on the identity identifier of the client and the identity information data of the client;

[0127] If the authentication is passed, trigger the acquisition unit 501 to execute the step of acquiring the smart contract corresponding to the target device identified by the device identifier from the blockchain network.

[0128] In an optional implementation, the apparatus further includes a publishing unit 507;

[0129] The searching unit 504 is further configured to receive a registration request and the identity identifier sent by the client;

[0130] If the identity identifier is not found in the blockchain network, the acquisition unit 501 acquires the identity information data of the client from the client;

[0131] A publishing unit 507, configured to publish the identity information data of the client and the identity identifier to the blockchain network.

[0132] In an optional implementation, the acquisition unit 501 acquires control data for controlling a target device and the device identifier of the target device, including:

[0133] Acquire the control data and the device identifier of the target device from the blockchain network; wherein, the control data and the device identifier of the target device are published to the blockchain network by the target device; the control data includes environmental data collected by the target device.

[0134] In an optional implementation, the acquisition unit 501 acquires the smart contract corresponding to the target device identified by the device identifier from the blockchain network, including:

[0135] Acquire at least one smart contract corresponding to the target device identified by the device identifier from the blockchain network;

[0136] Determine the control type of the control data, and obtain the smart contract corresponding to the control type from the at least one smart contract.

[0137] In an alternative embodiment, the generating unit 502 is configured to receive the control policy data of the target device sent by the client;

[0138] For the target device, based on the control policy data of the target device, generate a smart contract corresponding to the target device;

[0139] The publishing unit 507 is configured to publish the smart contract corresponding to the target device to the blockchain network.

[0140] In an alternative embodiment, the publishing unit 507 is configured to publish the connection standard data to the blockchain network, so that the blockchain node corresponding to the device manufacturer can obtain the connection standard data from the blockchain network for manufacturing the target device that matches the connection standard data;

[0141] The sending unit 503 is configured to send the control instruction to the target device that matches the connection standard data.

[0142] In an alternative embodiment, the publishing unit 507 is configured to publish the registration contract to the blockchain network, so that the blockchain node corresponding to the device manufacturer can call the registration contract to check whether the connection data of the target device matches the connection standard data, and obtain a verification result;

[0143] Receive the verification result sent by the blockchain node corresponding to the device manufacturer;

[0144] If the verification result indicates that the connection data of the target device matches the connection standard data, add the target device to the blockchain network.

[0145] In the embodiment of the present application, the obtaining unit 501 obtains the control data for controlling the target device and the device identifier of the target device, obtains the smart contract corresponding to the target device identified by the device identifier from the blockchain network, and the generating unit 502 generates a control instruction corresponding to the control data based on the corresponding relationship between the control data and the control instruction in the smart contract. The sending unit 503 sends the control instruction to the target device so that the target device executes the control instruction. Therefore, the embodiment of the present application controls each device in the blockchain network based on blockchain technology, achieving the improvement of the control efficiency of smart home devices, ensuring the security of smart home control, and meeting the personalized needs of users.

[0146] The embodiment of the present application also provides a computer device, please refer to Figure 6, Figure 6 is a schematic structural diagram of a computer device provided by an embodiment of the present application. As Figure 6 shown, the computer device at least includes a processor 601, a memory 602, and a communication interface 603, which can be connected through a bus 604 or other means. In this embodiment of the present application, the connection through the bus 604 is taken as an example. The processor 601 in this embodiment of the present application can execute the operations of the foregoing blockchain data processing method by running a computer program stored in the memory 602, for example:

[0147] Obtain control data for controlling a target device and the device identifier of the target device;

[0148] Obtain the smart contract corresponding to the target device identified by the device identifier from the blockchain network; wherein, the blockchain network includes the target device;

[0149] Generate a control instruction corresponding to the control data based on the correspondence between the control data and the control instruction in the smart contract;

[0150] Send the control instruction to the target device so that the target device executes the control instruction.

[0151] In an optional implementation manner, the processor 601 obtains control data for controlling a target device and the device identifier of the target device, and specifically performs the following operations:

[0152] Receive a control request sent by a client, where the control request carries the device identifier of the target device and the control data; wherein, the control data includes operation data of an object of the client submitted to the client for the target device; the blockchain network also includes the client;

[0153] The sending the control instruction to the target device includes:

[0154] Forward the control instruction to the target device through the client.

[0155] In an optional implementation manner, the processor 601 further performs the following operations:

[0156] If the target device identifier exists in the device identifiers associated with the client, trigger the step of obtaining the smart contract corresponding to the target device identified by the device identifier from the blockchain network.

[0157] In an optional implementation manner, the processor 601 further performs the following operations:

[0158] Find whether the device identifier of the target device exists in the list of registered devices; the list of registered devices includes at least one device identifier, and any device identifier in the list of registered devices is added to the list of registered devices when the connection data of the device identified by the any device identifier matches the connection standard data;

[0159] If the target device identifier is found, the address of the client is associated and stored with the target device identifier.

[0160] In an alternative embodiment, the processor 601 further performs the following operations:

[0161] Obtain the identity identifier of the client and the identity information data of the client from the blockchain network;

[0162] Authenticate the client based on the identity identifier of the client and the identity information data of the client;

[0163] If the authentication is passed, trigger the step of obtaining the smart contract corresponding to the target device identified by the device identifier from the blockchain network.

[0164] In an alternative embodiment, the processor 601 further performs the following operations:

[0165] Receive the registration request and the identity identifier sent by the client;

[0166] If the identity identifier is not found in the blockchain network, obtain the identity information data of the client from the client;

[0167] Publish the identity information data of the client and the identity identifier to the blockchain network.

[0168] In an alternative embodiment, the processor 601 obtains the control data for controlling the target device and the device identifier of the target device, and specifically performs the following operations:

[0169] Obtain the control data and the device identifier of the target device from the blockchain network; wherein, the control data and the device identifier of the target device are published to the blockchain network by the target device; the control data includes the environmental data collected by the target device.

[0170] In an alternative embodiment, the processor 601 obtains the smart contract corresponding to the target device identified by the device identifier from the blockchain network, and specifically performs the following operations:

[0171] Obtain at least one smart contract corresponding to the target device identified by the device identifier from the blockchain network;

[0172] Determine the control type of the control data, and obtain the smart contract corresponding to the control type from the at least one smart contract.

[0173] In an alternative embodiment, the processor 601 further performs the following operations:

[0174] Receive the control policy data of the target device sent by the client;

[0175] For the target device, generate a smart contract corresponding to the target device based on the control policy data of the target device;

[0176] Publish the smart contract corresponding to the target device to the blockchain network.

[0177] In an alternative embodiment, the processor 601 further performs the following operations:

[0178] Publish the connection standard data to the blockchain network, so that the blockchain node corresponding to the device manufacturer can obtain the connection standard data from the blockchain network for manufacturing the target device that matches the connection standard data;

[0179] The sending the control instruction to the target device includes:

[0180] Send the control instruction to the target device that matches the connection standard data.

[0181] In an alternative embodiment, the processor 601 further performs the following operations:

[0182] Publish the registration contract to the blockchain network, so that the blockchain node corresponding to the device manufacturer can call the registration contract to verify whether the connection data of the target device matches the connection standard data to obtain a verification result;

[0183] Receive the verification result sent by the blockchain node corresponding to the device manufacturer;

[0184] If the verification result indicates that the connection data of the target device matches the connection standard data, add the target device to the blockchain network.

[0185] In an embodiment of the present application, the processor 601 obtains control data for controlling a target device and the device identifier of the target device, obtains the smart contract corresponding to the target device identified by the device identifier from the blockchain network, generates a control instruction corresponding to the control data based on the correspondence between the control data and the control instruction in the smart contract, and sends the control instruction to the target device so that the target device executes the control instruction. Therefore, the embodiment of the present application controls each device in the blockchain network based on blockchain technology, achieving improved control efficiency of smart home devices, ensuring the security of smart home control, and meeting the personalized needs of users.

[0186] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0187] The embodiment of the present application also provides a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer is caused to execute the steps in any of the above method embodiments.

[0188] The embodiment of the present application also provides a chip, including a memory and a processor. The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the device installed with the chip executes the steps in any of the above method embodiments.

[0189] The steps in the method embodiment of the present application can be adjusted, combined, and deleted according to actual needs.

[0190] The units in the device embodiment of the present application can be combined, divided, and deleted according to actual needs.

Claims

1. A blockchain data processing method, characterized in that, Including: Obtaining control data for controlling a target device and the device identifier of the target device; Obtaining, from a blockchain network, a smart contract corresponding to the target device identified by the device identifier; wherein the blockchain network includes the target device; Generating a control instruction corresponding to the control data based on the correspondence between the control data and the control instruction in the smart contract; Sending the control instruction to the target device so that the target device executes the control instruction.

2. The method according to claim 1, characterized in that, The obtaining of the control data for controlling the target device and the device identifier of the target device includes: Receiving a control request sent by a client, the control request carrying the device identifier of the target device and the control data; wherein the control data includes operation data submitted by an object of the client to the client for the target device; the blockchain network also includes the client; The sending of the control instruction to the target device includes: Forwarding the control instruction to the target device through the client.

3. The method according to claim 2, wherein The method further includes: If the target device identifier exists in the device identifiers associated with the client, triggering the step of obtaining, from the blockchain network, the smart contract corresponding to the target device identified by the device identifier.

4. The method according to claim 3, wherein The method further includes: Searching in a list of registered devices to find if there is the device identifier of the target device; the list of registered devices includes at least one device identifier, and any device identifier in the list of registered devices is added to the list of registered devices when the connection data of the device identified by the any device identifier matches the connection standard data; If the target device identifier is found, associating and storing the address of the client with the target device identifier.

5. The method according to claim 2, characterized in that The method further includes: Obtaining the identity identifier of the client and the identity information data of the client from the blockchain network; Authenticating the client based on the identity identifier of the client and the identity information data of the client; If the authentication is passed, triggering the step of obtaining, from the blockchain network, the smart contract corresponding to the target device identified by the device identifier.

6. The method according to claim 5, wherein The method further includes: Receiving a registration request and the identity identifier sent by the client; If the identity identifier is not found in the blockchain network, obtaining the identity information data of the client from the client; Publishing the identity information data of the client and the identity identifier to the blockchain network.

7. The method according to claim 1, characterized in that, The obtaining of the control data for controlling the target device and the device identifier of the target device includes: Obtaining the control data and the device identifier of the target device from the blockchain network; wherein the control data and the device identifier of the target device are published to the blockchain network by the target device; the control data includes environmental data collected by the target device.

8. The method according to any one of claims 1-7, characterized in that, The obtaining, from the blockchain network, of the smart contract corresponding to the target device identified by the device identifier includes: Obtain at least one smart contract corresponding to the target device identified by the device identifier from the blockchain network; Determine the control type of the control data, and obtain the smart contract corresponding to the control type from the at least one smart contract.

9. The method according to claim 8, wherein The method further includes: Receive the control policy data of the target device sent by the client; For the target device, generate a smart contract corresponding to the target device based on the control policy data of the target device; Publish the smart contract corresponding to the target device to the blockchain network.

10. The method according to any one of claims 1-7, characterized in that, The method further includes: Publish the connection standard data to the blockchain network, so that the blockchain node corresponding to the device manufacturer can obtain the connection standard data from the blockchain network for manufacturing the target device that matches the connection standard data; The step of sending the control instruction to the target device includes: Send the control instruction to the target device that matches the connection standard data.

11. The method according to any one of claims 1 to 7, characterized in that, The method further includes: Publish the registration contract to the blockchain network, so that the blockchain node corresponding to the device manufacturer can call the registration contract to check whether the connection data of the target device matches the connection standard data to obtain a verification result; Receive the verification result sent by the blockchain node corresponding to the device manufacturer; If the verification result indicates that the connection data of the target device matches the connection standard data, add the target device to the blockchain network.

12. A blockchain data processing device, characterized in that, The apparatus includes: An acquisition unit, configured to acquire control data for controlling a target device and the device identifier of the target device; The acquisition unit is further configured to obtain a smart contract corresponding to the target device identified by the device identifier from the blockchain network; wherein, the blockchain network includes the target device; A generation unit, configured to generate a control instruction corresponding to the control data based on the correspondence between the control data and the control instruction in the smart contract; A sending unit, configured to send the control instruction to the target device, so that the target device executes the control instruction.

13. A computer device, characterized in that, The computer device includes a memory, a communication interface, and a processor, wherein the memory, the communication interface, and the processor are interconnected; the memory stores a computer program, and the processor calls the computer program stored in the memory to implement the method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the method according to any one of claims 1 to 11.