CN117478716B - Communication method and device of equipment, electronic equipment and storage medium - Google Patents

Communication method and device of equipment, electronic equipment and storage medium Download PDF

Info

Publication number
CN117478716B
CN117478716B CN202311820977.3A CN202311820977A CN117478716B CN 117478716 B CN117478716 B CN 117478716B CN 202311820977 A CN202311820977 A CN 202311820977A CN 117478716 B CN117478716 B CN 117478716B
Authority
CN
China
Prior art keywords
equipment
communication
target
intelligent contract
devices
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311820977.3A
Other languages
Chinese (zh)
Other versions
CN117478716A (en
Inventor
熊昆
李春光
徐玉姣
李威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai, Zhuhai Lianyun Technology Co Ltd filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202311820977.3A priority Critical patent/CN117478716B/en
Publication of CN117478716A publication Critical patent/CN117478716A/en
Application granted granted Critical
Publication of CN117478716B publication Critical patent/CN117478716B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Abstract

The embodiment of the invention provides a communication method and device of equipment, electronic equipment and a storage medium, and relates to the technical field of equipment communication, wherein the method comprises the following steps: the first equipment acquires target parameters, and if the target parameters meet target execution conditions of the first equipment, a communication request aiming at the target parameters is acquired; the intelligent contract responds to the received communication request, if the identity authentication of the first equipment is completed, the second equipment corresponding to the communication request is determined, and authentication passing information is sent to the first equipment; the first device sends the target parameters to the second device in response to receiving the authentication passing information; the second device executes the device operation corresponding to the target parameter, thereby establishing a decentralised network through the blockchain, realizing the automatic communication control among the devices under the condition that a third party is not required to be trusted through intelligent integration, enabling each device to execute the corresponding operation according to the execution condition of the device, and improving the convenience of the control among the devices and the communication efficiency among the devices.

Description

Communication method and device of equipment, electronic equipment and storage medium
Technical Field
The present invention relates to the field of device communication technology, and in particular, to a device communication method, a device communication apparatus, an electronic device, and a computer readable storage medium.
Background
With the continuous development of wireless network applications such as the internet of things and smart home, more and more devices are accessed into the network, and wireless network communication becomes an indispensable part of daily life of people. However, in related network communications, communications between devices often require users to manually transmit through control terminals, and communication control between devices is not automated and is inefficient.
Disclosure of Invention
The embodiment of the invention provides a communication method and device of equipment, electronic equipment and a computer readable storage medium, so as to solve or partially solve the problem of low communication efficiency between the equipment.
The embodiment of the invention discloses a communication method of equipment, which is applied to a blockchain network, wherein an intelligent contract and a plurality of pieces of equipment are deployed in the blockchain network, and execution conditions of the pieces of equipment are configured in the intelligent contract, and the method comprises the following steps:
the method comprises the steps that first equipment collects target parameters, and if the target parameters meet target execution conditions of the first equipment, a communication request aiming at the target parameters is obtained;
The intelligent contract responds to the received communication request, and if the identity authentication of the first equipment is completed, the second equipment corresponding to the communication request is determined, and authentication passing information is sent to the first equipment;
the first device sending the target parameter to the second device in response to receiving the authentication pass information;
and the second device executes the device operation corresponding to the target parameter.
In some possible embodiments, the first device collects a target parameter, and if the target parameter meets a target execution condition of the first device, obtains a communication request for the target parameter, including:
the method comprises the steps that a first device collects environmental parameters of an environment where the first device is located;
if the environment parameter meets the target execution condition of the first device, the first device selects a second device associated with the environment parameter from the plurality of devices;
the first device generates a communication request for the second device.
In some possible embodiments, the determining, if the identity authentication of the first device is completed, the second device corresponding to the communication request includes:
Acquiring a first equipment identity and a first communication authority of the first equipment;
and if the first equipment identity characterizes that the first equipment is in a registration state in the intelligent contract and the first communication authority characterizes that the first equipment has the authority to communicate with other equipment, determining a second equipment corresponding to the communication request.
In some possible embodiments, the sending authentication pass information to the first device includes:
the intelligent contract obtains the current running state of the second equipment;
and if the second equipment is in a standby state currently, the intelligent contract sends authentication passing information for the communication request to the first equipment.
In some possible embodiments, further comprising:
and if the second equipment is in the running state currently, the intelligent contract sends authentication failing information for the communication request to the first equipment.
In some possible embodiments, after the second device performs a device operation corresponding to the target parameter, the method further includes:
the second device responds to the device operation corresponding to the target parameter after the execution is finished, and sends an execution state record aiming at the target parameter to the intelligent contract;
The intelligent contract broadcasts the execution state records to enable each device to synchronize the execution state records.
In some possible embodiments, the smart contract broadcasts the execution state record to synchronize the execution state record by each of the devices, including:
the intelligent contract performs validity verification on the execution state record, and if the execution state record is valid, the execution state record is packed into a candidate block;
the smart contract broadcasting the candidate block into the blockchain network;
and responding to the detection of the candidate block by other devices except the first device and the second device, performing validity verification on the candidate block, and if the candidate block passes the verification, adding the candidate block into a local block chain copy.
In some possible embodiments, further comprising:
the intelligent contract obtains the equipment credibility and the equipment parameters of the equipment;
the intelligent contract carries out equipment evaluation on the equipment according to the equipment reputation and the equipment parameters to obtain weight information and contribution of the equipment;
Wherein the weight information is used to characterize a degree of importance of the device in the blockchain network, and the contribution degree is used to characterize a degree of contribution of the device in the blockchain network.
In some possible embodiments, the environmental parameter includes at least one of an ambient temperature, an ambient humidity, illumination information, air information, and a smoke parameter.
In some possible embodiments, the second device includes one of an air conditioner, a humidifier, a purifier, a light fixture, a sun-shading furniture, a smoke alarm, the second device performing a device operation corresponding to the target parameter, including:
the air conditioner performs a temperature adjustment operation corresponding to the ambient temperature;
and/or the humidifier performs a humidity adjustment operation corresponding to the ambient humidity;
and/or the purifier performs an air conditioning purifying operation corresponding to the air information;
and/or the lamp or the sun-shading furniture executes illumination adjustment operation corresponding to the illumination information;
and/or the smoke alarm performs a smoke alarm operation corresponding to the smoke parameter.
The embodiment of the invention also discloses a communication device of the equipment, which is applied to a blockchain network, wherein an intelligent contract and a plurality of equipment are deployed in the blockchain network, the execution conditions of the equipment are configured in the intelligent contract, and the device comprises:
The parameter acquisition module is positioned on the first equipment and is used for acquiring target parameters, and if the target parameters meet target execution conditions of the first equipment, a communication request aiming at the target parameters is acquired;
the device authentication module is positioned in the intelligent contract and is used for responding to the received communication request, if the identity authentication of the first device is completed, determining a second device corresponding to the communication request, and sending authentication passing information to the first device;
the parameter sending module is positioned at the first equipment and used for responding to the received authentication passing information and sending the target parameter to the second equipment;
and the operation execution module is positioned on the second equipment and is used for executing equipment operation corresponding to the target parameter.
In some possible embodiments, the parameter acquisition module is specifically configured to:
collecting environmental parameters of the environment;
if the environment parameter meets the target execution condition of the first device, selecting a second device associated with the environment parameter from the plurality of devices;
a communication request is generated for the second device.
In some possible embodiments, the device authentication module is specifically configured to:
Acquiring a first equipment identity and a first communication authority of the first equipment;
and if the first equipment identity characterizes that the first equipment is in a registration state in the intelligent contract and the first communication authority characterizes that the first equipment has the authority to communicate with other equipment, determining a second equipment corresponding to the communication request.
In some possible embodiments, the device authentication module is specifically configured to:
the intelligent contract obtains the current running state of the second equipment;
and if the second equipment is in a standby state currently, sending authentication passing information for the communication request to the first equipment.
In some possible embodiments, further comprising:
and the information sending module is positioned in the intelligent contract and is used for sending authentication failing information aiming at the communication request to the first equipment if the second equipment is in the running state currently.
In some possible embodiments, the apparatus further comprises:
the record sending module is positioned at the second device and used for responding to the device operation corresponding to the target parameter after the execution is finished and sending an execution state record aiming at the target parameter to the intelligent contract;
And the record broadcasting module is positioned in the intelligent contract and used for broadcasting the execution state record so that each device can synchronize the execution state record.
In some possible embodiments, the record broadcasting module is specifically configured to:
verifying the validity of the execution state record, and if the execution state record is valid, packing the execution state record into a candidate block;
broadcasting the candidate block into the blockchain network;
and responding to the detection of the candidate block by other devices except the first device and the second device, performing validity verification on the candidate block, and if the candidate block passes the verification, adding the candidate block into a local block chain copy.
In some possible embodiments, further comprising:
the parameter acquisition module is positioned in the intelligent contract and is used for acquiring the equipment credibility and the equipment parameters of each piece of equipment;
the evaluation module is positioned in the intelligent contract and is used for performing equipment evaluation on the equipment according to the equipment credibility and the equipment parameters to obtain weight information and contribution of the equipment;
Wherein the weight information is used to characterize a degree of importance of the device in the blockchain network, and the contribution degree is used to characterize a degree of contribution of the device in the blockchain network.
In some possible embodiments, the environmental parameter includes at least one of an ambient temperature, an ambient humidity, illumination information, air information, and a smoke parameter.
In some possible embodiments, the second device includes one of an air conditioner, a humidifier, a purifier, a light fixture, a sun-shading furniture, and a smoke alarm, and the operation execution module is specifically configured to:
the air conditioner performs a temperature adjustment operation corresponding to the ambient temperature;
and/or the humidifier performs a humidity adjustment operation corresponding to the ambient humidity;
and/or the purifier performs an air conditioning purifying operation corresponding to the air information;
and/or the lamp or the sun-shading furniture executes illumination adjustment operation corresponding to the illumination information;
and/or the smoke alarm performs a smoke alarm operation corresponding to the smoke parameter.
The embodiment of the invention also discloses electronic equipment, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
The memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Embodiments of the present invention also disclose a computer-readable storage medium having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the method according to the embodiments of the present invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, the method and the system can be applied to a blockchain network, an intelligent contract and a plurality of devices are deployed in the blockchain network, execution conditions of the devices in the intelligent contract are configured, a first device can acquire target parameters for the devices in the blockchain, if the target parameters meet the target execution conditions of the first device, a communication request aiming at the target parameters is acquired, then the intelligent contract responds to the received communication request, if identity authentication of the first device is completed, a second device corresponding to the communication request is determined, authentication passing information is sent to the first device, the first device responds to the received authentication passing information, the target parameters are sent to the second device, then the second device executes device operation corresponding to the target parameters, so that a decentralised network is established through the blockchain, and automatic communication control among the devices is realized under the condition that the intelligent contract does not need to trust a third party, so that the devices can execute corresponding operations according to the execution conditions of the devices, and the convenience of control among the devices and the communication efficiency among the devices are improved.
Drawings
FIG. 1 is a flow chart of steps of a method of communication of a device provided in an embodiment of the present invention;
FIG. 2 is a schematic diagram of a communication architecture provided in an embodiment of the present invention;
fig. 3 is a block diagram of a communication apparatus of an apparatus provided in an embodiment of the present invention;
fig. 4 is a block diagram of an electronic device provided in an embodiment of the invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
As one example, in related network communications, communications between devices often require a user to manually send through a control terminal, and communication control between devices is not automated and is inefficient. Moreover, wireless signals are easily intercepted and cracked, and if not taken with sufficient security measures, private information may be revealed or hacked.
In the invention, the intelligent contract and a plurality of devices are deployed in the blockchain network, the execution conditions of the devices are configured in the intelligent contract, for the devices in the blockchain, the first device can acquire the target parameters, if the target parameters meet the target execution conditions of the first device, the communication request aiming at the target parameters is acquired, then the intelligent contract responds to the received communication request, if the identity authentication of the first device is completed, the second device corresponding to the communication request is determined, authentication passing information is sent to the first device, the first device responds to the received authentication passing information, the target parameters are sent to the second device, then the second device executes the device operation corresponding to the target parameters, thereby establishing a decentralised network through the blockchain, realizing the automatic communication control among the devices under the condition that the intelligent closing does not need to trust a third party, enabling the devices to execute the corresponding operation according to the execution conditions of the devices, and improving the convenience of the control among the devices and the efficiency of the communication among the devices. And when the devices communicate, the validity of the data interaction can be verified based on a consensus algorithm, and the consistency of the data on the block chain is ensured, so that the confidentiality and the integrity of the data are ensured, and the utilization rate of network resources is improved.
Referring to fig. 1, a step flow chart of a communication method of a device provided in an embodiment of the present invention is applied to a blockchain network, where an intelligent contract and a plurality of devices are deployed in the blockchain network, where execution conditions of the devices are configured in the intelligent contract, and specifically may include the following steps:
step 101, a first device acquires a target parameter, and if the target parameter meets a target execution condition of the first device, a communication request aiming at the target parameter is acquired;
in the embodiment of the invention, a block chain network can be constructed for corresponding equipment, and each equipment is accessed into the block chain network, so that data interaction can be performed between each equipment based on the block chain network. Optionally, the blockchain network may be applied to an intelligent home scene, and the device may be various home appliances, etc., where it is to be noted that in the embodiment of the present invention, the intelligent home scene is exemplified, and it is to be understood that the present invention is not limited to this, and may also be applied to other internet of things scenes.
In an example, referring to fig. 2, a schematic diagram of a communication architecture provided in an embodiment of the present invention is shown, by constructing a blockchain network, deploying intelligent contracts and consensus algorithms in the blockchain network, and accessing a plurality of devices, thereby establishing a decentralised network through the blockchain, and implementing automatic communication control between devices through intelligent convergence without needing to trust a third party, so that each device can perform a corresponding operation according to its own execution condition, and the convenience of control between devices and the efficiency of communication between devices are improved. And when the devices communicate, the validity of the data interaction can be verified based on a consensus algorithm, and the consistency of the data on the block chain is ensured, so that the confidentiality and the integrity of the data are ensured, and the utilization rate of network resources is improved.
In a specific implementation, a decentralised network (i.e. a blockchain network) can be established through a blockchain technology, all devices are connected in the blockchain network, all connected devices are registered in the blockchain network at the same time, unique identification IDs and communication authorities are allocated to each device, corresponding intelligent contracts are deployed at the same time, terms and execution conditions of a communication protocol between the devices are configured in the intelligent contracts, each device generates data and transmits the data based on the terms, and performs corresponding operations, such as data interaction with other devices, execution target operations and the like, when the execution conditions are met, so that the communication between the devices in the blockchain network can be automatically controlled through the intelligent contracts by configuring the corresponding terms and the execution conditions of the devices in the intelligent contracts, and confidentiality and integrity of the communication between the devices are ensured.
When the device is added into the blockchain network, the identity of the device can be authenticated in a digital identity authentication mode based on the blockchain network so as to verify the legitimacy of the device. For example, in a smart home scenario, assuming devices include door locks, routers, air conditioners, refrigerators, washing machines, switches, televisions, lights, purifiers, humidifiers, and central control devices, etc., a blockchain network for these pieces of furniture may be constructed and each piece of furniture is assigned a unique identification ID and communication rights, including "door locks", "routers", "air conditioners", "refrigerators", "washing machines", "switches", "televisions", "lights", "purifiers", "humidifiers", and "central control devices", etc., as each piece of furniture accesses the blockchain network.
As for the communication authority, it may be a communication activity range and limitation that the device may perform in the blockchain network, including data transceiving authority, data access authority, network resource usage authority, pairing and communication authority, and the like. The data receiving and transmitting rights may be data receiving and transmitting rights, for example, a part of devices only have data transmitting rights but not data receiving rights, a part of devices only have data receiving rights but not data transmitting rights, a part of devices simultaneously have data transmitting rights and data receiving rights, and the like; the data access right item can be the right of the device to access the data service stored in the blockchain network, including the data reading right, the data writing right, the data deleting right and the like, for example, the sensor device generally only has the writing right and is used for reporting the state parameter of the sensor itself and cannot perform other operations, the intelligent sound has the data reading right and the data writing right and can read the states of other devices so as to control the device, and the central control device can have the data reading right, the data writing right, the data deleting right and the like so as to control the other devices; the network resource usage rights can be rights of using network resources by devices, such as broadband usage amount, connection frequency, etc., for example, a router can control bandwidth usage of each device according to device type of the device, so as to ensure that devices such as televisions have enough bandwidth, or control whether new devices access to a blockchain network, etc.; the pairing and communication authority can be whether the equipment can directly communicate with other equipment or exchange data and the like, and the pairing and the peer-to-peer can be carried out with other equipment at corresponding time, for example, a door lock and the like can only accept control commands of authorized equipment, so that the instruction source is ensured to be reliable, the equipment can only be paired with authenticated equipment after reset, malicious operation is prevented, and therefore, the equipment is classified and managed through configuring corresponding communication authority of the equipment in an intelligent contract, and the flexibility and convenience of automatic control of the equipment are improved.
In addition, besides the intelligent contracts, a corresponding consensus algorithm can be configured in the blockchain network for verifying the correctness of communication data between devices, and the processing procedure based on the intelligent contracts and the consensus algorithm can comprise the following steps:
1. node selection: the consensus algorithm can automatically select the equipment nodes participating in network communication, and automatically adjust the weight and contribution of the nodes according to the credibility and performance of the nodes.
2. And (3) condition judgment: the conditions are preset in advance in the intelligent contract, and the automatic judgment can be performed after the conditions are met. In network communication, whether the communication conditions are met or not can be automatically judged according to the identities and the authorities of the two communication parties, and the functions of identity verification, authority verification and the like between equipment and a control end in the Internet of things network are realized.
3. Automatic execution: and automatically executing the set clause content after the preset conditions are met. In network communication, the intelligent contract can automatically execute operations such as encryption, decryption, signature and the like, so that human intervention and misoperation are avoided, and the working efficiency is improved.
4. And (3) data verification: the intelligent contract can verify the communication data of the equipment network according to the terms of the communication protocol in the contract, so that the data is prevented from being tampered and forged. The consensus algorithm can ensure the authenticity and the integrity of communication data, and can automatically synchronize the data in different equipment nodes, thereby avoiding the occurrence of inconsistent and lost data.
5. Automatic notification: the intelligent contract can automatically inform the wireless network communication parties of the actual communication conditions, such as communication success, failure, overtime and the like, so that the transparency and reliability of the wireless network communication of the equipment are improved, and the occurrence of communication failure and misunderstanding is avoided.
In some possible implementations, the intelligent contract may obtain the device reputation and the device parameters of each device, and then perform device evaluation on the device according to the device reputation and the device parameters to obtain the weight information and the contribution degree of the device. Wherein the weight information is used to characterize a degree of importance of the device in the blockchain network, and the contribution degree is used to characterize a degree of contribution of the device in the blockchain network.
Wherein, the measurement of the credibility at least can comprise: history of performance: the past performance of the device in the blockchain network, such as the number of successful communication, the availability of service, whether malicious behavior exists, etc.; resource contribution: the equipment provides resources such as computing power, storage space, bandwidth and the like for the blockchain network; degree of participation: the frequency and duration of device activity in the blockchain network, online participation in the duration of activity, and the like. Optionally, the weight of a device refers to the relative importance or influence of the device in the blockchain network, and the contribution degree refers to a measure of the contribution of the device in the blockchain network to the stabilization of the blockchain network. The weighting and contribution adjustment of devices may be dynamically adjusted according to a particular algorithm, e.g., a child device may get higher weight if it is able to reliably process and forward data, and thus the role of the device in the blockchain network may be more important. Also, if a device frequently participates in data processing or other blockchain network activities, its contribution increases, and may therefore get more incentive, such as more blockchain network service requests or higher service priorities.
In another possible implementation manner, the condition judgment and automatic execution are performed, by configuring a corresponding execution condition for each device in the intelligent contract, the device itself detects and judges a corresponding state parameter, and if the execution condition is met, a corresponding operation is performed. Wherein, the execution conditions at least can include: 1. identity authentication requirements: defining how the device verifies the identity; 2. access control rules: specifying which devices have access to a particular network resource; 3. data sharing policy: deciding which data can be shared, and how; 4. quality of service standard: ensuring that the data transmission meets specific time delay and reliability requirements; 5. security and privacy protection: the method comprises the steps of data encryption, anonymization requirements and the like, and operation rules can be set for equipment and services in a blockchain network through execution conditions, so that automatic execution condition judgment is realized.
In one example, for sensor furniture, corresponding condition parameters can be set, when the environmental parameters collected by the sensor meet the condition parameters, the reporting of the environmental parameters, the adjustment instruction and the like can be triggered so as to transmit the environmental parameters to the corresponding furniture, and corresponding operations are performed by the corresponding furniture, for example, when the temperature sensor detects that the environmental temperature reaches 28 degrees, the corresponding temperature parameters and the adjustment instruction can be transmitted to the air conditioner so as to cool the air conditioner, thereby establishing a decentralised network through a blockchain, and realizing automatic communication control among devices through intelligent integration under the condition that a third party is not required to be trusted, so that each device can perform corresponding operations according to own execution conditions, thereby improving the convenience of control among the devices and the efficiency of communication among the devices.
In another example, the process of condition judgment may also be: detecting a communication request in a block chain network, automatically judging whether the communication request meets a preset condition, if so, allowing the communication request to be automatically executed, otherwise, preventing the communication request, and simultaneously, after the communication is completed, recording corresponding communication activity information by an intelligent contract.
In some possible implementations, for a process that the device performs automatic execution according to an execution condition, assuming that a first device located in the blockchain network is located, after a corresponding target parameter is collected, the target parameter may be compared with a target execution condition corresponding to the first device, and if the target parameter meets the target execution condition, a communication request for the target parameter may be obtained, so as to initiate communication with other devices, so as to implement processing of the target parameter. The target parameter may include a state parameter of the target device itself, an environmental parameter of the environment, and the like, and the environmental parameter may include at least one of an environmental temperature, an environmental humidity, illumination information, air information, and a smoke parameter, for example.
In a specific implementation, a first device collects environmental parameters of an environment in which the first device is located; if the environment parameter meets the target execution condition of the first device, selecting a second device associated with the environment parameter from a plurality of devices, and then generating a communication request aiming at the second device so as to send the communication request to the intelligent contract, and carrying out identity verification on the first device by the intelligent contract to judge whether the first device belongs to legal devices in the blockchain network.
For example, assuming that the first device is a temperature sensor, the temperature sensor may collect an ambient temperature in real time, and compare the collected temperature with a preset temperature set in an execution condition, including comparing with a heating temperature threshold, comparing with a cooling temperature threshold, and the like, and when the corresponding condition is satisfied, may send the temperature to an air conditioner so that the air conditioner performs cooling or heating, and the like; assuming that the first device is a humidity sensor, the humidity sensor may collect ambient humidity in real time, compare the collected humidity with preset humidity set in an execution condition, determine whether humidification or dehumidification is required for the environment, if it is determined that humidification is required, send corresponding humidity and a humidification instruction to the humidifier so as to humidify the humidifier, and if it is determined that dehumidification is required, send corresponding humidity and a dehumidification instruction to the air conditioner so as to dehumidify the environment.
Step 102, the intelligent contract responds to the received communication request, if the identity authentication of the first device is completed, the second device corresponding to the communication request is determined, and authentication passing information is sent to the first device;
After the first device sends the communication request to the intelligent contract, the intelligent contract can respond to the received communication request, if the identity authentication of the first device is completed, the second device corresponding to the communication request is determined, authentication passing information is sent to the first device, and therefore whether the first device is legal in the blockchain is judged through identity authentication of the first device, and the safety of communication between the devices is guaranteed.
In some possible implementations, the smart contract may acquire a first device identity and a first communication right of the first device, and if the first device identity indicates that the first device is already in a registration state in the smart contract and the first communication right indicates that the first device has a right to communicate with other devices, determine a second device corresponding to the communication request, and acquire a current running state of the second device; if the second equipment is in a standby state currently, the intelligent contract sends authentication passing information for the communication request to the first equipment; if the second device is currently in an operating state, the intelligent contract sends authentication failure information for the communication request to the first device.
For each device in the blockchain network, when the network is accessed, corresponding registration is required, only the registered device can communicate with other devices in the blockchain network, after the intelligent contract receives a communication request of the first device, whether the first device belongs to the device registered in the blockchain network can be verified, if the first device belongs to the registered device, whether the first device has permission to communicate with other devices can be further judged, if the corresponding communication permission is also provided, a second device which needs to be communicated by the first device can be determined, and the current running state of the second device is acquired so as to detect whether the second device is in a standby state currently, if the second device is in the running state currently, the second device is characterized in that other task operations are currently being executed by the second device, tasks corresponding to the first device cannot be executed, the intelligent contract can send authentication failure information to the first device so as to inform the first device that the second device is in a busy state and retried later, and the like; if the second device is currently in a standby state, representing that the second device is currently in an idle state, and executing a task corresponding to the first device, the intelligent contract can send authentication passing information to the first device, and inform the first device that the first device can communicate with the second device, so that the first device performs data interaction with the second device based on a secure channel in the blockchain.
Step 103, the first device sends the target parameter to the second device in response to receiving the authentication passing information;
in the embodiment of the invention, if the first device receives the authentication passing information sent by the intelligent contract, the target parameter can be sent to the second device based on the secure channel in the blockchain network, so that the second device executes corresponding operation based on the target parameter; if the first device receives the authentication failing information sent by the intelligent contract, a corresponding communication request can be initiated to the intelligent contract again after a preset time interval, so that whether the intelligent contract meets the communication condition or not can be detected again.
And 104, the second device executes the device operation corresponding to the target parameter.
As before, assuming that the target parameter is an environmental parameter, the environmental parameter may include at least one of an environmental temperature, an environmental humidity, illumination information, air information, and a smoke parameter, and the corresponding second device is different based on the different environmental parameter, for example, the second device may include one of an air conditioner, a humidifier, a purifier, a lamp, a sun-shading furniture, and a smoke alarm, and the air conditioner performs a temperature adjustment operation corresponding to the environmental temperature; and/or the humidifier performs a humidity adjustment operation corresponding to the ambient humidity; and/or the purifier performs an air conditioning purifying operation corresponding to the air information; and/or the lamps or the sun-shading furniture execute illumination adjustment operation corresponding to the illumination information; and/or the smoke alarm executes smoke alarm operation corresponding to smoke parameters, thereby establishing a decentralised network through a blockchain, realizing automatic communication control among devices under the condition that a third party is not required to be trusted through intelligent integration, enabling each device to execute corresponding operation according to own execution condition, and improving the convenience of control among devices and the efficiency of communication among devices.
In addition, after the second device executes the corresponding operation, the execution state record aiming at the target parameter can be sent to the intelligent contract in response to the device operation corresponding to the target parameter after the execution is finished, the intelligent contract broadcasts the execution state record, and each device synchronizes the execution state record, so that the intelligent contract synchronizes the data generated by the communication between the first device and the second device to other devices based on the consensus algorithm, the consistency of the data in the blockchain network is ensured, and each device can synchronize the corresponding data so as to improve the effectiveness of device control in the blockchain network.
In a specific implementation, the intelligent contract performs validity verification on the execution state record, if the execution state record is valid, the execution state record is packaged into a candidate block, then the candidate block is broadcast into the blockchain network, then other devices except the first device and the second device respond to the detection of the candidate block to perform validity verification on the candidate block, and if the candidate block passes the verification, the candidate block is added into the local blockchain copy.
In one example, for a data synchronization process between devices, it may include:
1. And (3) data generation: when the device collects data (e.g., sensor readings), it generates a record of the communication request and broadcasts the record to the network.
2. Request verification: other devices receiving the request will verify the validity of the request, including checking the signature, format, and compliance of the data with preset conditions.
3. Block structure: once the requests are validated, they are packed into a candidate block. A device or group of devices may be responsible for this packing process according to rules of the consensus algorithm.
4. Block broadcasting: the device that created the new block broadcasts it to the network, and after receiving this new block, the other devices will verify, ensuring that all requests therein are legitimate and that the block itself meets the requirements of the consensus algorithm.
5. And (3) consensus is achieved: once a block is verified as correct, other devices add this block to their own blockchain copy. This process means that devices in the network agree on the current state of the blockchain.
6. Data synchronization: as new blocks are added, the local blockchain copy of the device is updated, thereby synchronizing the latest requested data contained in the blocks. This ensures that each device in the network has a consistent view of the data.
7. Continuous synchronization: the internet of things device will continuously generate data and these data will continuously enter the network through new requests, be packed into blocks, and be verified and added to the blockchain through the consensus process. This looping process ensures that data in the network continues to be synchronized.
In addition, before data interaction, the devices in the blockchain network can be verified to verify whether the identity of the opposite party is legal, and the corresponding verification process can be as follows:
and (3) data receiving: and receiving the data in the network, and decrypting the data by using the corresponding key according to the agreement clause.
Signature verification: the receiving device uses the public key of the sending device to verify the authenticity of the data signature, and if the verification passes, the data source is normal and the data source is not tampered in the transmission process.
Recording and auditing: all communication requests and results are recorded in the blockchain network for auditing and analysis.
It should be noted that the embodiments of the present invention include, but are not limited to, the foregoing examples, and it will be understood that those skilled in the art may also set the embodiments according to actual requirements under the guidance of the concepts of the embodiments of the present invention, which are not limited thereto.
In the embodiment of the invention, the method and the system can be applied to a blockchain network, an intelligent contract and a plurality of devices are deployed in the blockchain network, execution conditions of the devices in the intelligent contract are configured, a first device can acquire target parameters for the devices in the blockchain, if the target parameters meet the target execution conditions of the first device, a communication request aiming at the target parameters is acquired, then the intelligent contract responds to the received communication request, if identity authentication of the first device is completed, a second device corresponding to the communication request is determined, authentication passing information is sent to the first device, the first device responds to the received authentication passing information, the target parameters are sent to the second device, then the second device executes device operation corresponding to the target parameters, so that a decentralised network is established through the blockchain, and automatic communication control among the devices is realized under the condition that the intelligent contract does not need to trust a third party, so that the devices can execute corresponding operations according to the execution conditions of the devices, and the convenience of control among the devices and the communication efficiency among the devices are improved.
In order to enable those skilled in the art to better understand the technical solutions according to the embodiments of the present invention, the following description is given by way of example:
Two devices: device a (intelligent temperature sensor) and device B (intelligent air conditioning system). Device a is responsible for monitoring room temperature and communicating with device B under certain conditions to adjust temperature. The following is an example flow of automated condition judgment and communication execution:
step 1: setting intelligent contract clauses:
deploying an intelligent contract on the blockchain, the contract comprising the following terms:
if the temperature detected by device a exceeds 24 ℃, communication with device B is triggered. Both device a and device B must have valid registration and authentication states in the blockchain network. Device B must be on standby, that is, without other tasks being performed, upon receipt of a communication request from device a.
Step 2: condition judgment of the equipment A:
device a periodically detects room temperature and compares the readings to a threshold (24 ℃) defined by the smart contract. If the temperature exceeds the threshold, device A is ready to initiate communication.
Step 3: identity verification and rights checking:
device a sends a request to the smart contract over the blockchain network containing its device ID and the detected temperature value. The smart contract verifies the identity and status (registration and authentication status) of the device a and checks whether the device B is in a standby state.
Step 4: communication is performed:
if the status of both device A and device B satisfy the conditions of the smart contract, the contract automatically performs the communication operation:
the intelligent contract instructs the device A to send the information of the temperature exceeding to the device B.
Device a sends a signal to device B using a secure channel of the blockchain network, the signal possibly including the current temperature and the proposed adjustment instructions.
And after the equipment B receives the signal, adjusting the air conditioner setting according to the received information so as to reduce the indoor temperature.
Step 5: communication status feedback:
after the device B finishes executing, an execution state report is sent to the intelligent contract to confirm that the temperature is adjusted according to the instruction.
The smart contract records the results of this communication and updates the status of device a and device B on the blockchain.
Step 6: data verification and synchronization:
the consensus algorithm ensures that all network nodes (including device a and device B) have a record of this communication, ensuring consistency and non-tamper ability of the data.
If communication fails or device B is busy, the smart contract may record a failure event and may trigger a warning or retry mechanism.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 3, a block diagram of a communication apparatus of a device provided in an embodiment of the present invention is applied to a blockchain network, where a smart contract and a plurality of devices are deployed in the blockchain network, where execution conditions of the devices are configured in the smart contract, and may specifically include the following modules:
the parameter acquisition module 301, located in the first device, is configured to acquire a target parameter, and if the target parameter meets a target execution condition of the first device, acquire a communication request for the target parameter;
the device authentication module 302, located in the smart contract, configured to, in response to receiving the communication request, determine a second device corresponding to the communication request, and send authentication passing information to the first device if identity authentication of the first device is completed;
a parameter sending module 303, located at the first device, configured to send the target parameter to the second device in response to receiving the authentication passing information;
and an operation execution module 304 located in the second device, configured to execute a device operation corresponding to the target parameter.
In some possible embodiments, the parameter acquisition module 301 is specifically configured to:
Collecting environmental parameters of the environment;
if the environment parameter meets the target execution condition of the first device, selecting a second device associated with the environment parameter from the plurality of devices;
a communication request is generated for the second device.
In some possible embodiments, the device authentication module 302 is specifically configured to:
acquiring a first equipment identity and a first communication authority of the first equipment;
and if the first equipment identity characterizes that the first equipment is in a registration state in the intelligent contract and the first communication authority characterizes that the first equipment has the authority to communicate with other equipment, determining a second equipment corresponding to the communication request.
In some possible embodiments, the device authentication module 302 is specifically configured to:
the intelligent contract obtains the current running state of the second equipment;
and if the second equipment is in a standby state currently, sending authentication passing information for the communication request to the first equipment.
In some possible embodiments, further comprising:
and the information sending module is positioned in the intelligent contract and is used for sending authentication failing information aiming at the communication request to the first equipment if the second equipment is in the running state currently.
In some possible embodiments, the apparatus further comprises:
the record sending module is positioned at the second device and used for responding to the device operation corresponding to the target parameter after the execution is finished and sending an execution state record aiming at the target parameter to the intelligent contract;
and the record broadcasting module is positioned in the intelligent contract and used for broadcasting the execution state record so that each device can synchronize the execution state record.
In some possible embodiments, the record broadcasting module is specifically configured to:
verifying the validity of the execution state record, and if the execution state record is valid, packing the execution state record into a candidate block;
broadcasting the candidate block into the blockchain network;
and responding to the detection of the candidate block by other devices except the first device and the second device, performing validity verification on the candidate block, and if the candidate block passes the verification, adding the candidate block into a local block chain copy.
In some possible embodiments, further comprising:
the parameter acquisition module is positioned in the intelligent contract and is used for acquiring the equipment credibility and the equipment parameters of each piece of equipment;
The evaluation module is positioned in the intelligent contract and is used for performing equipment evaluation on the equipment according to the equipment credibility and the equipment parameters to obtain weight information and contribution of the equipment;
wherein the weight information is used to characterize a degree of importance of the device in the blockchain network, and the contribution degree is used to characterize a degree of contribution of the device in the blockchain network.
In some possible embodiments, the environmental parameter includes at least one of an ambient temperature, an ambient humidity, illumination information, air information, and a smoke parameter.
In some possible embodiments, the second device includes one of an air conditioner, a humidifier, a purifier, a light fixture, a piece of sun-shading furniture, and a smoke alarm, and the operation execution module 304 is specifically configured to:
the air conditioner performs a temperature adjustment operation corresponding to the ambient temperature;
and/or the humidifier performs a humidity adjustment operation corresponding to the ambient humidity;
and/or the purifier performs an air conditioning purifying operation corresponding to the air information;
and/or the lamp or the sun-shading furniture executes illumination adjustment operation corresponding to the illumination information;
And/or the smoke alarm performs a smoke alarm operation corresponding to the smoke parameter.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In addition, the embodiment of the invention also provides electronic equipment, which comprises: the computer program is stored in the memory and can run on the processor, and when the computer program is executed by the processor, the processes of the communication method embodiment of the device are realized, and the same technical effects can be achieved, so that repetition is avoided, and the description is omitted here.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, realizes the processes of the communication method embodiment of the device, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
Fig. 4 is a schematic hardware structure of an electronic device implementing various embodiments of the present invention.
The electronic device 400 includes, but is not limited to: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, processor 410, and power source 411. It will be appreciated by those skilled in the art that the structure of the electronic device according to the embodiments of the present invention is not limited to the electronic device, and the electronic device may include more or less components than those illustrated, or may combine some components, or may have different arrangements of components. In the embodiment of the invention, the electronic equipment comprises, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer and the like.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 401 may be used for receiving and transmitting signals during the process of receiving and transmitting information or communication, specifically, receiving downlink data from a base station and then processing the received downlink data by the processor 410; and, the uplink data is transmitted to the base station. Typically, the radio frequency unit 401 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 401 may also communicate with networks and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user through the network module 402, such as helping the user to send and receive e-mail, browse web pages, and access streaming media, etc.
The audio output unit 403 may convert audio data received by the radio frequency unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output as sound. Also, the audio output unit 403 may also provide audio output (e.g., a call signal reception sound, a message reception sound, etc.) related to a specific function performed by the electronic device 400. The audio output unit 403 includes a speaker, a buzzer, a receiver, and the like.
The input unit 404 is used to receive an audio or video signal. The input unit 404 may include a graphics processor (Graphics Processing Unit, GPU) 4041 and a microphone 4042, the graphics processor 4041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 406. The image frames processed by the graphics processor 4041 may be stored in memory 409 (or other storage medium) or transmitted via the radio frequency unit 401 or the network module 402. The microphone 4042 may receive sound and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output that can be transmitted to the mobile communication base station via the radio frequency unit 401 in the case of a telephone call mode.
The electronic device 400 also includes at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 4061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 4061 and/or the backlight when the electronic device 400 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for recognizing the gesture of the electronic equipment (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; the sensor 405 may further include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which are not described herein.
The display unit 406 is used to display information input by a user or information provided to the user. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 407 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 407 includes a touch panel 4071 and other input devices 4072. The touch panel 4071, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 4071 or thereabout using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 4071 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 410, and receives and executes commands sent from the processor 410. In addition, the touch panel 4071 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 407 may include other input devices 4072 in addition to the touch panel 4071. In particular, other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 4071 may be overlaid on the display panel 4061, and when the touch panel 4071 detects a touch operation thereon or thereabout, the touch operation is transferred to the processor 410 to determine the type of touch event, and then the processor 410 provides a corresponding visual output on the display panel 4061 according to the type of touch event. It will be appreciated that in one embodiment, the touch panel 4071 and the display panel 4061 are implemented as two separate components to implement the input and output functions of the electronic device, but in some embodiments, the touch panel 4071 may be integrated with the display panel 4061 to implement the input and output functions of the electronic device, which is not limited herein.
The interface unit 408 is an interface to which an external device is connected to the electronic apparatus 400. For example, the external devices may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 408 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus 400 or may be used to transmit data between the electronic apparatus 400 and an external device.
Memory 409 may be used to store software programs as well as various data. The memory 409 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 409 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 410 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 409 and invoking data stored in the memory 409, thereby performing overall monitoring of the electronic device. Processor 410 may include one or more processing units; preferably, the processor 410 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 410.
The electronic device 400 may also include a power supply 411 (e.g., a battery) for powering the various components, and preferably the power supply 411 may be logically connected to the processor 410 via a power management system that performs functions such as managing charging, discharging, and power consumption.
In addition, the electronic device 400 includes some functional modules, which are not shown, and are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. A method of communication of devices, applied to a blockchain network, in which a smart contract and a plurality of devices are deployed, the smart contract being configured with execution conditions of each of the devices, the method comprising:
the method comprises the steps that first equipment collects target parameters, and if the target parameters meet target execution conditions of the first equipment, a communication request aiming at the target parameters is obtained;
the intelligent contract responds to the received communication request, and if the identity authentication of the first equipment is completed, the second equipment corresponding to the communication request is determined, and authentication passing information is sent to the first equipment;
the first device sending the target parameter to the second device in response to receiving the authentication pass information;
the second device executes device operation corresponding to the target parameter;
wherein after the second device performs a device operation corresponding to the target parameter, the method further includes:
the second device responds to the device operation corresponding to the target parameter after the execution is finished, and sends an execution state record aiming at the target parameter to the intelligent contract;
The intelligent contract performs validity verification on the execution state record, and if the execution state record is valid, the execution state record is packed into a candidate block;
the smart contract broadcasting the candidate block into the blockchain network;
in response to detecting the candidate block, other devices except the first device and the second device perform validity verification on the candidate block, and if the candidate block passes verification, the candidate block is added into a local block chain copy;
each device corresponds to a communication authority, and if the identity authentication of the first device is completed, determining a second device corresponding to the communication request includes:
acquiring a first equipment identity and a first communication authority of the first equipment;
and if the first equipment identity characterizes that the first equipment is in a registration state in the intelligent contract and the first communication authority characterizes that the first equipment has the authority to communicate with other equipment, determining a second equipment corresponding to the communication request.
2. The method of claim 1, wherein the first device collects a target parameter, and if the target parameter meets a target execution condition of the first device, obtaining a communication request for the target parameter comprises:
The method comprises the steps that a first device collects environmental parameters of an environment where the first device is located;
if the environment parameter meets the target execution condition of the first device, the first device selects a second device associated with the environment parameter from the plurality of devices;
the first device generates a communication request for the second device.
3. The method of claim 1, wherein the sending authentication pass information to the first device comprises:
the intelligent contract obtains the current running state of the second equipment;
and if the second equipment is in a standby state currently, the intelligent contract sends authentication passing information for the communication request to the first equipment.
4. A method according to claim 3, further comprising:
and if the second equipment is in the running state currently, the intelligent contract sends authentication failing information for the communication request to the first equipment.
5. The method as recited in claim 1, further comprising:
the intelligent contract obtains the equipment credibility and the equipment parameters of the equipment;
the intelligent contract carries out equipment evaluation on the equipment according to the equipment reputation and the equipment parameters to obtain weight information and contribution of the equipment;
Wherein the weight information is used to characterize a degree of importance of the device in the blockchain network, and the contribution degree is used to characterize a degree of contribution of the device in the blockchain network.
6. The method of claim 2, wherein the environmental parameter comprises at least one of an ambient temperature, an ambient humidity, illumination information, air information, and a smoke parameter.
7. The method of claim 6, wherein the second device comprises one of an air conditioner, a humidifier, a purifier, a light fixture, a piece of sun-shading furniture, a smoke alarm, the second device performing a device operation corresponding to the target parameter, comprising:
the air conditioner performs a temperature adjustment operation corresponding to the ambient temperature;
and/or the humidifier performs a humidity adjustment operation corresponding to the ambient humidity;
and/or the purifier performs an air conditioning purifying operation corresponding to the air information;
and/or the lamp or the sun-shading furniture executes illumination adjustment operation corresponding to the illumination information;
and/or the smoke alarm performs a smoke alarm operation corresponding to the smoke parameter.
8. A communication apparatus of a device, applied to a blockchain network, in which a smart contract and a plurality of devices are deployed, in which execution conditions of the respective devices are configured, the apparatus comprising:
the parameter acquisition module is positioned on the first equipment and is used for acquiring target parameters, and if the target parameters meet target execution conditions of the first equipment, a communication request aiming at the target parameters is acquired;
the device authentication module is positioned in the intelligent contract and is used for responding to the received communication request, if the identity authentication of the first device is completed, determining a second device corresponding to the communication request, and sending authentication passing information to the first device;
the parameter sending module is positioned at the first equipment and used for responding to the received authentication passing information and sending the target parameter to the second equipment;
the operation execution module is positioned on the second equipment and used for executing equipment operation corresponding to the target parameter;
wherein the apparatus further comprises:
the record sending module is positioned at the second device and used for responding to the device operation corresponding to the target parameter after the execution is finished and sending an execution state record aiming at the target parameter to the intelligent contract;
The record broadcasting module is positioned in the intelligent contract and is used for verifying the validity of the execution state record, and if the execution state record is valid, the execution state record is packed into a candidate block; broadcasting the candidate block into the blockchain network; in response to detecting the candidate block, other devices except the first device and the second device perform validity verification on the candidate block, and if the candidate block passes verification, the candidate block is added into a local block chain copy;
wherein each device corresponds to a communication authority, and the device authentication module is specifically configured to:
acquiring a first equipment identity and a first communication authority of the first equipment;
and if the first equipment identity characterizes that the first equipment is in a registration state in the intelligent contract and the first communication authority characterizes that the first equipment has the authority to communicate with other equipment, determining a second equipment corresponding to the communication request.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
The memory is used for storing a computer program;
the processor is configured to implement the method according to any one of claims 1-7 when executing a program stored on a memory.
10. A computer-readable storage medium having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the method of any of claims 1-7.
CN202311820977.3A 2023-12-27 2023-12-27 Communication method and device of equipment, electronic equipment and storage medium Active CN117478716B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311820977.3A CN117478716B (en) 2023-12-27 2023-12-27 Communication method and device of equipment, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311820977.3A CN117478716B (en) 2023-12-27 2023-12-27 Communication method and device of equipment, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117478716A CN117478716A (en) 2024-01-30
CN117478716B true CN117478716B (en) 2024-04-05

Family

ID=89627864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311820977.3A Active CN117478716B (en) 2023-12-27 2023-12-27 Communication method and device of equipment, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117478716B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107341702A (en) * 2017-03-08 2017-11-10 阿里巴巴集团控股有限公司 A kind of method and device of business processing
CN108737348A (en) * 2017-04-21 2018-11-02 中国科学院信息工程研究所 A kind of internet of things equipment access control method of the intelligent contract based on block chain
WO2018224431A1 (en) * 2017-06-07 2018-12-13 Philips Lighting Holding B.V. Connected lighting system, method, and apparatus using blockchain
CN109302415A (en) * 2018-11-09 2019-02-01 四川虹微技术有限公司 A kind of authentication method, block chain node and storage medium
CN110806923A (en) * 2019-10-29 2020-02-18 百度在线网络技术(北京)有限公司 Parallel processing method and device for block chain tasks, electronic equipment and medium
GB202000417D0 (en) * 2019-01-15 2020-02-26 Fisher Rosemount Systems Inc Distributed ledgers in process control systems
EP3723007A1 (en) * 2019-04-12 2020-10-14 Siemens Aktiengesellschaft Method and control system for controlling an execution of transactions
CN112465523A (en) * 2020-11-30 2021-03-09 珠海格力电器股份有限公司 Block chain system-based channel conflict identification method, device, medium and server
CN112600710A (en) * 2020-12-18 2021-04-02 四川虹微技术有限公司 Block chain-based terminal linkage method and device and electronic equipment
CN112907244A (en) * 2021-02-10 2021-06-04 iCALC控股有限公司 Data processing method, device and equipment based on block chain and readable storage medium
CN113191895A (en) * 2020-09-04 2021-07-30 支付宝(杭州)信息技术有限公司 Transaction execution method, system and device
WO2021202545A1 (en) * 2020-03-31 2021-10-07 Skygrid, Llc Blockchain-based hybrid authentication

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3596880B1 (en) * 2017-04-18 2022-06-01 Samsung Electronics Co., Ltd. Method and apparatus for access control in distributed blockchain-based internet of things (iot) network
US11055703B2 (en) * 2017-06-19 2021-07-06 Hitachi, Ltd. Smart contract lifecycle management
CN108492180B (en) * 2018-02-14 2020-11-24 创新先进技术有限公司 Asset management method and device and electronic equipment

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107341702A (en) * 2017-03-08 2017-11-10 阿里巴巴集团控股有限公司 A kind of method and device of business processing
CN108737348A (en) * 2017-04-21 2018-11-02 中国科学院信息工程研究所 A kind of internet of things equipment access control method of the intelligent contract based on block chain
WO2018224431A1 (en) * 2017-06-07 2018-12-13 Philips Lighting Holding B.V. Connected lighting system, method, and apparatus using blockchain
CN109302415A (en) * 2018-11-09 2019-02-01 四川虹微技术有限公司 A kind of authentication method, block chain node and storage medium
GB202000417D0 (en) * 2019-01-15 2020-02-26 Fisher Rosemount Systems Inc Distributed ledgers in process control systems
EP3723007A1 (en) * 2019-04-12 2020-10-14 Siemens Aktiengesellschaft Method and control system for controlling an execution of transactions
CN110806923A (en) * 2019-10-29 2020-02-18 百度在线网络技术(北京)有限公司 Parallel processing method and device for block chain tasks, electronic equipment and medium
WO2021202545A1 (en) * 2020-03-31 2021-10-07 Skygrid, Llc Blockchain-based hybrid authentication
CN113191895A (en) * 2020-09-04 2021-07-30 支付宝(杭州)信息技术有限公司 Transaction execution method, system and device
CN112465523A (en) * 2020-11-30 2021-03-09 珠海格力电器股份有限公司 Block chain system-based channel conflict identification method, device, medium and server
CN112600710A (en) * 2020-12-18 2021-04-02 四川虹微技术有限公司 Block chain-based terminal linkage method and device and electronic equipment
CN112907244A (en) * 2021-02-10 2021-06-04 iCALC控股有限公司 Data processing method, device and equipment based on block chain and readable storage medium

Also Published As

Publication number Publication date
CN117478716A (en) 2024-01-30

Similar Documents

Publication Publication Date Title
US10917414B2 (en) Monitoring actions performed by a network of peer devices using a blockchain
CN110687821B (en) Intelligent home control system and method based on block chain
US9882912B2 (en) System and method for providing authentication service for internet of things security
CN109600223B (en) Verification method, activation method, device, equipment and storage medium
US8750828B2 (en) Enabling remote and anonymous control of mobile and portable multimedia devices for security, tracking and recovery
CN113395159B (en) Data processing method based on trusted execution environment and related device
US11128451B2 (en) Remotely managing devices using blockchain and DICE-RIoT
US10068077B2 (en) False alarm avoidance
CN112533202B (en) Identity authentication method and device
CN112765684B (en) Block chain node terminal management method, device, equipment and storage medium
CN111314085B (en) Digital certificate verification method and device
CN111475832B (en) Data management method and related device
CN110598386B (en) Block chain-based data processing method, device, equipment and storage medium
CN111598573B (en) Equipment fingerprint verification method and device
CN113221150A (en) Data protection method and device
CN117478716B (en) Communication method and device of equipment, electronic equipment and storage medium
CN110532324B (en) Block chain-based bulletin information display method, device, equipment and storage medium
CN114826724B (en) Data processing method, device, electronic equipment and storage medium
JP2006065639A (en) Client terminal, service providing apparatus and method for detecting service
CN115002775A (en) Device network access method and device, electronic device and storage medium
CN110798444B (en) Data synchronization method and device based on Internet of things
CN110717605B (en) Block chain-based access information processing method and device
CN116015695A (en) Resource access method, system, device, terminal and storage medium
CN117896110A (en) Verification method and device of equipment, electronic equipment and storage medium
CN114389825B (en) Data communication method based on block chain and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant