CN111787020A - Communication method and device based on block chain - Google Patents

Communication method and device based on block chain Download PDF

Info

Publication number
CN111787020A
CN111787020A CN202010639151.7A CN202010639151A CN111787020A CN 111787020 A CN111787020 A CN 111787020A CN 202010639151 A CN202010639151 A CN 202010639151A CN 111787020 A CN111787020 A CN 111787020A
Authority
CN
China
Prior art keywords
signature
client
instruction
server
control
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.)
Granted
Application number
CN202010639151.7A
Other languages
Chinese (zh)
Other versions
CN111787020B (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.)
Shenzhen Qinlin Science & Technology Co ltd
Original Assignee
Shenzhen Qinlin Science & 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 Shenzhen Qinlin Science & Technology Co ltd filed Critical Shenzhen Qinlin Science & Technology Co ltd
Priority to CN202010639151.7A priority Critical patent/CN111787020B/en
Publication of CN111787020A publication Critical patent/CN111787020A/en
Application granted granted Critical
Publication of CN111787020B publication Critical patent/CN111787020B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • 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
    • H04L63/0884Network architectures or network communication protocols for network security for authentication of entities by delegation of authentication, e.g. a proxy authenticates an entity to be authenticated on behalf of this entity vis-à-vis an authentication entity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information

Abstract

The embodiment of the application provides a communication method and a device based on a block chain, which relate to the technical field of communication, and the method is applied to a block chain server, wherein the method comprises the following steps: receiving a control instruction and an instruction signature sent by a control server; the instruction signature is matched with the control instruction; when an issuing request sent by a control server is received, carrying out validity verification on the control server to obtain a verification result of the control server; when the verification result of the control server indicates that the control server is legal, a control instruction is issued to the client; when a first signature verification request fed back by the client is received, generating a first signature verification result corresponding to the first signature verification request according to the instruction signature, and issuing the first signature verification result to the client so that the client executes a control instruction according to the first signature verification result. Therefore, the implementation of the implementation mode can improve the safety and stability of the communication of the Internet of things.

Description

Communication method and device based on block chain
Technical Field
The present application relates to the field of communications technologies, and in particular, to a block chain-based communication method and apparatus.
Background
At present, with the rapid development of the internet of things, more and more internet of things devices and related communication devices appear in front of people, and great convenience is brought to people. However, in practice, it is found that the current internet of things cloud platform usually uses the most common SSL/TLS communication encryption mode in order to ensure its general purpose, and the SSL/TLS encryption technology is relatively easy to simulate and crack, so that the current internet of things communication has low security and stability.
Disclosure of Invention
An object of the embodiments of the present application is to provide a communication method and device based on a block chain, which can improve the security and stability of communication of the internet of things.
A first aspect of an embodiment of the present application provides a communication method based on a block chain, which is applied to a block chain server, and the method includes:
receiving a control instruction and an instruction signature sent by a control server; the instruction signature matches the control instruction;
when an issuing request sent by the control server is received, carrying out validity verification on the control server to obtain a verification result of the control server;
when the verification result of the control server indicates that the control server is legal, the control instruction is issued to the client;
when a first signature verification request fed back by the client is received, generating a first signature verification result corresponding to the first signature verification request according to the instruction signature, and issuing the first signature verification result to the client so that the client executes the control instruction according to the first signature verification result.
In the implementation process, the block chain server can receive a control instruction and an instruction signature sent by the control server, and the instruction signature is matched with the control instruction; meanwhile, the block chain server detects whether an issuing request sent by the control server is received; when the block chain server receives an issuing request sent by the control server, carrying out validity verification on the control server to obtain a verification result of the control server; when the verification result of the control server indicates that the control server is legal, a control instruction is issued to the client; enabling the client to receive the control instruction and feed back the first signature verification request; when the block chain server receives a first signature verification request fed back by the client, generating a first signature verification result corresponding to the first signature verification request according to the instruction signature, and issuing the first signature verification result to the client so that the client executes a control instruction according to the first signature verification result; when the first signature checking result shows that the control instruction is a safe and effective instruction sent by the control server, the client executes the control instruction, and when the first signature checking result shows that the control instruction is not the instruction sent by the control server, the client refuses to execute the control instruction. By implementing the embodiment, the method can use the blockchain server as the transfer between the control server and the client, and meanwhile, the blockchain server applies the blockchain technology, and performs double-aspect security verification on the control server and the client on the technology to ensure secure connection of communication; meanwhile, the signature in the control instruction transmission process can be subjected to security verification, so that the issuing safety of the control instruction is ensured; therefore, the method can effectively improve the safety of the communication of the Internet of things, and can ensure the communication stability by using the block chain, so that the stability of the communication of the Internet of things is also improved.
Further, after the steps of generating a first signature verification result corresponding to the first signature verification request according to the instruction signature and issuing the first signature verification result to the client, the method further includes:
receiving response content and a response signature fed back by the client; the response signature matches the response content;
sending the response content to the control server;
and when a second signature verification request fed back by the control server is received, generating a second signature verification result corresponding to the response content according to the response signature, and issuing the second signature verification result to the control server so that the control server confirms the response content according to the second signature verification result.
In the implementation process, the method can also receive response content and a response signature fed back by the client by the block chain server, and the response signature is matched with the response content; sending the response content to the control server so that the control server feeds back the second signature verification request; and when the block chain server receives a second signature checking request fed back by the control server, the block chain server generates a second signature checking result corresponding to the response content according to the response signature, and issues the second signature checking result to the control server, so that the control server confirms the response content according to the second signature checking result. Therefore, by implementing the implementation mode, the block chain server can also provide the execution result signature of the control instruction for the control server, so that the control server can know that the client executes the feedback information sent by the control instruction, the control server can conveniently perform subsequent processing work, and the integrity of the communication of the internet of things and the effect of the communication of the internet of things are improved.
Further, the method further comprises:
storing the instruction signature and the response signature;
judging whether the storage time length of the instruction signature and the response signature is greater than a preset time length or not;
and when the storage time length of the instruction signature and the response signature is longer than the preset time length, sending the instruction signature and the response signature to a log server so that the log server permanently stores the instruction signature and the response signature.
In the implementation process, the blockchain server may further store the instruction signature and the response signature; then judging whether the storage time length of the instruction signature and the response signature is greater than a preset time length or not; and when the storage time length of the instruction signature and the response signature is longer than the preset time length, sending the instruction signature and the response signature to a log server so that the log server permanently stores the instruction signature and the response signature. Therefore, by implementing the implementation mode, the traceability of the block chain depended on by the block chain server can be realized, the traceability of the communication log can be further realized, in consideration of the problem of storage space under certain occasions, the preset time length can be a configurable state, the preset time length is defaulted to be 6 months, and after 6 months, the corresponding signature can be automatically pushed to the log server with lower cost, so that permanent storage is realized, and long-term and traceability effects are achieved.
Further, before the step of receiving an issue request and an instruction signature sent by a control server, the method further includes:
receiving registration information sent by a client;
verifying the legality of the client according to the registration information to obtain a verification result of the client;
and when the verification result of the client shows that the client is legal, establishing a trusted communication channel between the block chain server and the client, and sending registration success information to the client.
In the implementation process, the blockchain server in the method can also receive registration information sent by the client; then, verifying the validity of the client according to the registration information to obtain a verification result of the client; and when the verification result of the client indicates that the client is legal, establishing a trusted communication channel between the block chain server and the client, and sending registration success information to the client. Therefore, the implementation of the implementation mode can register the client in advance, so that the safe communication connection is realized, and then the notification of successful connection establishment is fed back on the basis, so that the follow-up work can be continuously carried out.
Further, after the step of sending the registration success information to the client and before the step of receiving the control command and the command signature sent by the control server, the method further includes:
judging whether a heartbeat information packet sent by the client side is received;
when receiving a heartbeat information packet sent by the client, sending a heartbeat response packet matched with the heartbeat information packet to the client, and triggering and executing the step of judging whether the heartbeat information packet sent by the client is received;
and when the heartbeat information packet sent by the client is not received, outputting disconnection prompt information.
In the implementation process, the method can also judge whether a heartbeat information packet sent by the client is received through the block chain server; when receiving a heartbeat information packet sent by the client, sending a heartbeat response packet matched with the heartbeat information packet to the client, and triggering and executing to judge whether the heartbeat information packet sent by the client is received; and if the heartbeat information packet sent by the client is not received, outputting disconnection prompt information. Therefore, by implementing the implementation mode, the communication connection between the client and the blockchain server can be maintained through the heartbeat response, the client is always connected to the blockchain server, and the connection state is not interrupted.
Further, the block chain server constructs a communication instruction protocol according to JSON, so that the block chain server transmits the control instruction to the client through the communication instruction protocol.
In the implementation process, the blockchain server constructs a communication instruction protocol according to the JSON, so that the blockchain server transmits the control instruction to the client through the communication instruction protocol. Therefore, by implementing the implementation mode, the instruction transmission can be carried out through the communication instruction protocol built by JSON, and the reliable and stable remote communication is realized.
Further, the communication instruction based on the communication instruction protocol comprises an instruction stream number, an instruction code, a control quantity content matched with the control quantity code, a result code and result information matched with the result code.
In the implementation process, the communication instruction based on the communication instruction protocol includes an instruction stream number, an instruction code, a control quantity content matched with the control quantity code, a result code, and result information matched with the result code. It can be seen that implementing such an embodiment enables simplified communication via such a communication protocol, thereby improving communication efficiency and communication security.
A second aspect of the embodiments of the present application provides a block chain based communication apparatus, including:
the receiving unit is used for receiving an issuing request and an instruction signature sent by the control server; the issuing request is used for requesting the block chain to issue a control instruction corresponding to the instruction signature;
the verification unit is used for verifying the validity of the control server to obtain a server verification result;
the issuing unit is used for issuing the control instruction and the server verification result to the client when the server verification result shows that the control server is legal; so as to enable the client to execute the control instruction.
In the implementation process, the communication device based on the block chain can receive the issuing request and the instruction signature sent by the control server through the receiving unit; the issuing request is used for requesting the block chain to issue a control instruction corresponding to the instruction signature; the validity of the control server can be verified through a verification unit to obtain a server verification result; the control instruction and the server verification result can be issued to the client by an issuing unit when the server verification result shows that the control server is legal; so as to enable the client to execute the control instruction. Therefore, by implementing the embodiment, the communication device based on the block chain can improve the working efficiency through the cooperative work among a plurality of units and ensure the working effect; on the other hand, by implementing the embodiment, the blockchain server can be used as a relay between the control server and the client, and meanwhile, the blockchain server applies a blockchain technology, and performs security verification on both sides of the control server and the client on the technology so as to ensure secure connection of communication; meanwhile, the signature in the control instruction transmission process can be subjected to security verification, so that the issuing safety of the control instruction is ensured; therefore, the method can effectively improve the safety of the communication of the Internet of things, and can ensure the communication stability by using the block chain, so that the stability of the communication of the Internet of things is also improved.
A third aspect of embodiments of the present application provides an electronic device, including a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the block chain based communication method according to any one of the first aspect of embodiments of the present application.
A fourth aspect of the present embodiment provides a computer-readable storage medium, which stores computer program instructions, where the computer program instructions, when read and executed by a processor, perform the block chain based communication method according to any one of the first aspect of the present embodiment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flowchart of a block chain based communication method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another block chain-based communication method according to an embodiment of the present application;
fig. 3 is a schematic tree flow chart of another communication method based on a block chain according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a block chain based communication apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another block chain based communication apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1
Referring to fig. 1, fig. 1 is a flowchart illustrating a block chain based communication method according to an embodiment of the present application. The method is applied to a block chain server of the Internet of things, and is particularly applied to a system among the block chain server, a control server and a client. Meanwhile, the method can be applied to a scene that the control server transmits the control instruction to the client for control. The communication method based on the block chain comprises the following steps:
s101, receiving a control instruction and an instruction signature sent by a control server; the instruction signature matches the control instruction.
In this embodiment, the blockchain server may be a distributed key storage server combined with an edge cloud.
In this embodiment, the blockchain server may use an edge cloud in combination with a multi-copy storage technology, so as to implement multi-copy key distribution by combining an edge device technology and a cloud computing technology, and perform fragmented storage of a key by using a storage space of an edge device.
In this embodiment, the blockchain server may use an edge cloud in combination with a high-concurrency cache technology to achieve a certain application service capability on a relatively high-performance edge device, so that the edge device can provide application services for other nodes in and around a block.
In this embodiment, the instruction signature may be a control instruction code.
In this embodiment, the control instruction encoding may be preset.
In this embodiment, the blockchain server constructs a communication instruction protocol according to JSON, so that the blockchain server transmits the control instruction to the client through the communication instruction protocol.
S102, when receiving an issuing request sent by the control server, carrying out validity verification on the control server to obtain a verification result of the control server.
In this embodiment, the issuing request is sent to the blockchain server by the control server.
In this embodiment, the validity verification may verify the certificate and the connection state of the control server, and this embodiment is not limited at all.
S103, when the verification result of the control server shows that the control server is legal, a control instruction is issued to the client.
In this embodiment, the client is a communication client (SDK) based on a block chain, where the client may connect the block chain through its block chain communication module, perform identity authentication, establish a function of a trusted communication channel, then connect the communication server through the block chain communication module through the real-time communication module, and keep the link, receive a control command issued by the communication server at any time, and report an execution result of the command to the corresponding server; and finally, reinforcing the system layer and the network layer of the client system, closing the high-authority account of the system, only keeping the client SDK in the user state, closing all network service ports, and enabling the client SDK to be used for communicating with the communication server after the client SDK is registered in the block chain.
In this embodiment, the client can effectively improve the overall communication security.
And S104, when a first signature verification request fed back by the client is received, generating a first signature verification result corresponding to the first signature verification request according to the command signature, and issuing the first signature verification result to the client so that the client executes a control command according to the first signature verification result.
In this embodiment, the first signature verification result is a result corresponding to the first signature verification request, and is corresponding to the instruction signature, and is used to verify whether the control instruction is result information of the security instruction sent by the control server.
In this embodiment, the blockchain server may be a distributed communication server based on a blockchain, where the blockchain server may be a decentralized trusted communication server and may be distributed in three regions of north, south and central china in the continental china; meanwhile, multiple living machine rooms in the same city are deployed in each large area, and the machine rooms are distributed in 2-4 machine rooms with the distance of more than 30 kilometers in the same city; in addition, based on the infrastructure capacity of cloud computing, the automatic elastic expansion capacity of computing power and bandwidth can be realized; then, the block chain server adopts the encrypted communication of the block chain as a bottom layer protocol (an application layer communication protocol is constructed based on JSON), and can carry out remote communication with a client (SDK) in the intelligent terminal equipment; secondly, the block chain server can also store the signature fingerprint of each communication instruction by adopting a block chain, so that a client (SDK) automatically performs signature verification with the block chain after receiving a control command, and only the instruction passing the signature verification can be executed; finally, the blockchain server can realize the traceability of the communication log based on the traceability of the blockchain, but because the storage space problem exists in some occasions is considered, the storage logic of the blockchain can be configured, so that the blockchain server defaults that the storage period of the configured log is 6 months, and the configured log is automatically pushed to a log server with lower cost after 6 months for permanent storage.
By implementing the implementation mode, various problems caused by cost, management, stability and the like in the prior art can be solved, and the method and the device are suitable for any intelligent Internet of things terminal with relatively high computing performance and network performance.
In this embodiment, the execution subject of the method may be a computing device such as a computer and a server, and is not limited in this embodiment.
In this embodiment, an execution subject of the method may also be a smart device such as a smart phone and a tablet, which is not limited in this embodiment.
It can be seen that, by implementing the communication method based on the block chain described in fig. 1, the control instruction and the instruction signature sent by the control server can be received, and the instruction signature is matched with the control instruction; meanwhile, the block chain server detects whether an issuing request sent by the control server is received; when the block chain server receives an issuing request sent by the control server, carrying out validity verification on the control server to obtain a verification result of the control server; when the verification result of the control server indicates that the control server is legal, a control instruction is issued to the client; enabling the client to receive the control instruction and feed back the first signature verification request; when the block chain server receives a first signature verification request fed back by the client, generating a first signature verification result corresponding to the first signature verification request according to the instruction signature, and issuing the first signature verification result to the client so that the client executes a control instruction according to the first signature verification result; when the first signature checking result shows that the control instruction is a safe and effective instruction sent by the control server, the client executes the control instruction, and when the first signature checking result shows that the control instruction is not the instruction sent by the control server, the client refuses to execute the control instruction. By implementing the embodiment, the method can use the blockchain server as the transfer between the control server and the client, and meanwhile, the blockchain server applies the blockchain technology, and performs double-aspect security verification on the control server and the client on the technology to ensure secure connection of communication; meanwhile, the signature in the control instruction transmission process can be subjected to security verification, so that the issuing safety of the control instruction is ensured; therefore, the method can effectively improve the safety of the communication of the Internet of things, and can ensure the communication stability by using the block chain, so that the stability of the communication of the Internet of things is also improved.
Example 2
Referring to fig. 2, fig. 2 is a schematic flowchart of another communication method based on a blockchain according to an embodiment of the present application. The block chain based communication method depicted in fig. 2 is improved according to the block chain based communication method depicted in fig. 1. The communication method based on the block chain comprises the following steps:
s201, receiving a control instruction and an instruction signature sent by a control server; the instruction signature matches the control instruction.
As an optional implementation manner, the control command and the command signature sent by the control server are received; before the step of matching the instruction signature with the control instruction, the method further comprises:
receiving registration information sent by a client;
verifying the validity of the client according to the registration information to obtain a verification result of the client;
and when the verification result of the client side shows that the client side is legal, establishing a trusted communication channel between the block chain server and the client side, and sending registration success information to the client side.
As a further optional implementation manner, after the step of sending the registration success information to the client and before the step of receiving the control instruction and the instruction signature sent by the control server, the method further includes:
judging whether a heartbeat information packet sent by a client side is received;
when receiving a heartbeat information packet sent by a client, sending a heartbeat response packet matched with the heartbeat information packet to the client, and triggering and executing to judge whether the heartbeat information packet sent by the client is received;
and when the heartbeat information packet sent by the client is not received, outputting disconnection prompt information.
In this embodiment, the blockchain server constructs a communication instruction protocol according to JSON, so that the blockchain server transmits the control instruction to the client through the communication instruction protocol.
In the present embodiment, the communication instruction based on the communication instruction protocol includes an instruction stream number, an instruction code, a control amount content matching the control amount code, a result code, and result information matching the result code.
S202, when receiving an issuing request sent by the control server, carrying out validity verification on the control server to obtain a verification result of the control server.
In this embodiment, the issuing request is sent to the blockchain server by the control server.
In this embodiment, the validity verification may verify the certificate and the connection state of the control server, and this embodiment is not limited at all.
And S203, when the verification result of the control server shows that the control server is legal, issuing a control instruction to the client.
In this embodiment, the process is an instruction forwarding process, and is not limited in this embodiment.
S204, when a first signature verification request fed back by the client is received, generating a first signature verification result corresponding to the first signature verification request according to the command signature, and issuing the first signature verification result to the client so that the client executes a control command according to the first signature verification result.
In this embodiment, the first signature verification result is a result corresponding to the first signature verification request, and is corresponding to the instruction signature, and is used to verify whether the control instruction is result information of the security instruction sent by the control server.
S205, receiving response content and a response signature fed back by the client; the response signature matches the response content.
In this embodiment, the response signature may be a result code or result information compiled based on JSON.
S206, sending the response content to the control server.
In this embodiment, the process is a response content forwarding process, and this embodiment is not limited in any way.
And S207, when a second signature verification request fed back by the control server is received, generating a second signature verification result corresponding to the response content according to the response signature, and issuing the second signature verification result to the control server so that the control server confirms the response content according to the second signature verification result.
In this embodiment, the second signature verification result is a result corresponding to the second signature verification request, and is corresponding to the response signature, and is used to verify whether the response content is result information sent by the client SKD.
And S208, storing the instruction signature and the response signature.
In this embodiment, the method may further store the instruction signature and the response signature in real time.
In this embodiment, steps S208 to S210 may be inserted between other steps, and this embodiment is not limited in any way.
S209, judging whether the storage time length of the instruction signature and the response signature is greater than the preset time length, if so, executing a step S210; if not, the flow is ended.
In this embodiment, the blockchain server may implement traceability of the communication log based on traceability of the blockchain, but because a problem of storage space in some cases is considered, storage logic of the blockchain may be configured, so that the blockchain server defaults to configure the log with a retention period of 6 months, and automatically pushes the configured log to a log server with a lower cost after 6 months for permanent storage.
In this embodiment, the 6 months may be the preset time period.
And S210, sending the instruction signature and the response signature to a log server so that the log server permanently stores the instruction signature and the response signature.
In this embodiment, the permanent storage of the log server can provide a better tracing effect for data tracing, so that the load constancy (no overload) of the work of the block chain server is improved, and the overall security and the overall traceability of the communication method are further improved.
Referring to fig. 3, fig. 3 is a schematic tree flow chart of a block chain-based communication method, and fig. 3 can refer to this embodiment to understand specific implementation timings and implementation processes corresponding to each step in this embodiment. Wherein, the blockchain is used to refer to a blockchain server, and the SDK is used to refer to a client.
For example, the communication instruction protocol described in the present application is compiled based on JSON, and may include several parts:
(1) instruction flow number: the serial number of the instruction in the whole system life cycle, and the unique code of the GUID.
(2) And (3) control instruction encoding: from 0000 to 9999, 1 million control instructions can be customized.
(3) And (3) control quantity coding: from 000000 to 999999, 100 ten thousand control quantities can be defined.
(4) Content of control amount: the data content corresponding to the control quantity can be customized.
(5) And (4) result code: from 000 to 999, 1000 result codes can be customized.
(6) And result information: the character string type, variable length, and result code correspond one-to-one.
Example communication protocol:
1. data recall instructions
Request for
Figure BDA0002567709610000141
Response to
Figure BDA0002567709610000142
2. Switch control command
Request for
Figure BDA0002567709610000143
Figure BDA0002567709610000151
Response to
Figure BDA0002567709610000152
Here, the related explanations can be analogized according to the above-mentioned parenthesis.
By implementing the implementation mode, the method can construct a low-cost credible communication service network for bearing a large-scale intelligent terminal of the Internet of things based on a block chain software technology, so that the method has the following effects: the trusted communication is realized through the encryption technology of the block chain server, the intelligent terminal on each chain can be ensured to be a trusted terminal, and each instruction is a trusted instruction, so that the safety reliability of the communication process is improved; each client in the block chain is a node with certain processing and computing capabilities, the more devices in the network, the stronger the anti-attack capability of the network, and the higher the cracking difficulty; the method is realized by adopting a pure software technology, special hardware equipment or SIM cards are not required to be introduced, and only the deployment cost of the communication server is required, so that the low overall cost is realized; meanwhile, the original extremely complex trusted communication network design is simplified by adopting the open-source blockchain technology for transformation, and research personnel can easily drive and control development work only by having certain blockchain knowledge, so that the difficulty in implementation is simplified; the communication protocol realized by adopting the open source block chain technology and the JSON data format widely used in the WEB industry has wide applicability and expansibility, and secondary development and definition are very simple, so that the applicability and the expandability of the method are enhanced.
It can be seen that, by implementing the communication method based on the blockchain described in fig. 2, the blockchain server can be used as a relay between the control server and the client, and meanwhile, the blockchain server applies a blockchain technology, and performs security verification on both sides of the control server and the client on the basis of the technology to ensure secure connection of communication; meanwhile, the signature in the control instruction transmission process can be subjected to security verification, so that the issuing safety of the control instruction is ensured; therefore, the method can effectively improve the safety of the communication of the Internet of things, and can ensure the communication stability by using the block chain, so that the stability of the communication of the Internet of things is also improved.
Example 3
Referring to fig. 4, fig. 4 is a schematic structural diagram of a block chain based communication device according to an embodiment of the present disclosure. Wherein the block chain based communication device comprises:
a receiving unit 310, configured to receive an issue request and an instruction signature sent by a control server; the issuing request is used for requesting the block chain to issue a control instruction corresponding to the instruction signature;
the verification unit 320 is configured to perform validity verification on the control server to obtain a server verification result;
the issuing unit 330 is configured to issue the control instruction and the server verification result to the client when the server verification result indicates that the control server is legal; so that the client executes the control instructions.
In this embodiment, for the explanation of the communication device based on the block chain, reference may be made to the description in embodiment 1 or embodiment 2, and details are not repeated in this embodiment.
It can be seen that, by implementing the communication device based on the block chain described in fig. 4, the working efficiency can be improved through the cooperative work among a plurality of units, and the working effect can be ensured; on the other hand, by implementing the embodiment, the blockchain server can be used as a relay between the control server and the client, and meanwhile, the blockchain server applies a blockchain technology, and performs security verification on both sides of the control server and the client on the technology so as to ensure secure connection of communication; meanwhile, the signature in the control instruction transmission process can be subjected to security verification, so that the issuing safety of the control instruction is ensured; therefore, the method can effectively improve the safety of the communication of the Internet of things, and can ensure the communication stability by using the block chain, so that the stability of the communication of the Internet of things is also improved.
Example 4
Referring to fig. 5, fig. 5 is a schematic structural diagram of another communication device based on a blockchain according to an embodiment of the present disclosure. The block chain based communication apparatus illustrated in fig. 5 is modified from the block chain based communication apparatus illustrated in fig. 4. Wherein the block chain based communication device further comprises:
a receiving unit 310, configured to receive response content and a response signature fed back by the client; the response signature is matched with the response content;
a sending unit 340, configured to send the response content to the control server;
and the issuing unit 330 is configured to generate a second signature verification result corresponding to the response content according to the response signature when receiving a second signature verification request fed back by the control server, and issue the second signature verification result to the control server, so that the control server confirms the response content according to the second signature verification result.
As an optional implementation manner, the block chain based communication apparatus further includes:
a storage unit 350 for storing the instruction signature and the response signature;
a judging unit 360, configured to judge whether a storage duration of the instruction signature and the response signature is greater than a preset duration;
and the sending unit 340 is configured to send the instruction signature and the response signature to the log server when the storage duration of the instruction signature and the response signature is longer than a preset duration, so that the log server permanently stores the instruction signature and the response signature.
As an optional implementation manner, the block chain based communication apparatus further includes:
a receiving unit 310, configured to receive registration information sent by a client;
the verification unit 370 is configured to perform validity verification on the client according to the registration information verification, so as to obtain a verification result of the client;
the establishing unit 380 is configured to establish a trusted communication channel between the blockchain server and the client when the verification result of the client indicates that the client is legal, and send registration success information to the client.
As an optional implementation, the block chain based communication device includes:
the judging unit 360 is configured to judge whether a heartbeat packet sent by the client is received;
the receiving unit 310 is configured to, when receiving a heartbeat packet sent by a client, send a heartbeat response packet matched with the heartbeat packet to the client, and trigger execution of an operation of determining whether the heartbeat packet sent by the client is received;
the output unit 390 is configured to output disconnection prompt information when the heartbeat packet sent by the client is not received.
As an alternative embodiment, the blockchain server constructs a communication instruction protocol according to JSON, so that the blockchain server transmits the control instruction to the client through the communication instruction protocol.
As an alternative embodiment, the communication instruction based on the communication instruction protocol includes an instruction stream number, an instruction code, a control quantity content matching with the control quantity code, a result code, and result information matching with the result code.
In this embodiment, for the explanation of the communication device based on the block chain, reference may be made to the description in embodiment 1 or embodiment 2, and details are not repeated in this embodiment.
It can be seen that, by implementing the communication device based on the block chain described in fig. 5, the working efficiency can be improved and the working effect can be ensured through the cooperative work among a plurality of units; on the other hand, by implementing the embodiment, the blockchain server can be used as a relay between the control server and the client, and meanwhile, the blockchain server applies a blockchain technology, and performs security verification on both sides of the control server and the client on the technology so as to ensure secure connection of communication; meanwhile, the signature in the control instruction transmission process can be subjected to security verification, so that the issuing safety of the control instruction is ensured; therefore, the method can effectively improve the safety of the communication of the Internet of things, and can ensure the communication stability by using the block chain, so that the stability of the communication of the Internet of things is also improved.
An embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the block chain based communication method in embodiment 1 or embodiment 2 of the present application.
An embodiment of the present application provides a computer-readable storage medium, which stores computer program instructions, and when the computer program instructions are read and executed by a processor, the computer program instructions perform the blockchain-based communication method according to any one of embodiment 1 or embodiment 2 of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A communication method based on a block chain is applied to a block chain server, and the method comprises the following steps:
receiving a control instruction and an instruction signature sent by a control server; the instruction signature matches the control instruction;
when an issuing request sent by the control server is received, carrying out validity verification on the control server to obtain a verification result of the control server;
when the verification result of the control server indicates that the control server is legal, the control instruction is issued to the client;
when a first signature verification request fed back by the client is received, generating a first signature verification result corresponding to the first signature verification request according to the instruction signature, and issuing the first signature verification result to the client so that the client executes the control instruction according to the first signature verification result.
2. The blockchain-based communication method according to claim 1, wherein after the steps of generating a first signature verification result corresponding to the first signature verification request according to the command signature and issuing the first signature verification result to the client, the method further comprises:
receiving response content and a response signature fed back by the client; the response signature matches the response content;
sending the response content to the control server;
and when a second signature verification request fed back by the control server is received, generating a second signature verification result corresponding to the response content according to the response signature, and issuing the second signature verification result to the control server so that the control server confirms the response content according to the second signature verification result.
3. The blockchain-based communication method according to claim 2, wherein the method further comprises:
storing the instruction signature and the response signature;
judging whether the storage time length of the instruction signature and the response signature is greater than a preset time length or not;
and when the storage time length of the instruction signature and the response signature is longer than the preset time length, sending the instruction signature and the response signature to a log server so that the log server permanently stores the instruction signature and the response signature.
4. The blockchain-based communication method according to claim 1, wherein before the step of receiving the issuance request and the instruction signature transmitted by the control server, the method further comprises:
receiving registration information sent by a client;
verifying the legality of the client according to the registration information to obtain a verification result of the client;
and when the verification result of the client shows that the client is legal, establishing a trusted communication channel between the block chain server and the client, and sending registration success information to the client.
5. The blockchain-based communication method according to claim 4, wherein after the step of sending the registration success information to the client and before the step of receiving the control command and the command signature sent by the control server, the method further comprises:
judging whether a heartbeat information packet sent by the client side is received;
when receiving a heartbeat information packet sent by the client, sending a heartbeat response packet matched with the heartbeat information packet to the client, and triggering and executing the step of judging whether the heartbeat information packet sent by the client is received;
and when the heartbeat information packet sent by the client is not received, outputting disconnection prompt information.
6. The blockchain-based communication method according to claim 1, wherein the blockchain server constructs a communication instruction protocol according to JSON, so that the blockchain server transmits the control instruction to the client through the communication instruction protocol.
7. The blockchain-based communication method according to claim 6, wherein the communication command based on the communication command protocol includes a command stream number, a command code, a control quantity content matching the control quantity code, a result code, and result information matching the result code.
8. A blockchain based communication apparatus, the blockchain based communication apparatus comprising:
the receiving unit is used for receiving an issuing request and an instruction signature sent by the control server; the issuing request is used for requesting the block chain to issue a control instruction corresponding to the instruction signature;
the verification unit is used for verifying the validity of the control server to obtain a server verification result;
the issuing unit is used for issuing the control instruction and the server verification result to the client when the server verification result shows that the control server is legal; so as to enable the client to execute the control instruction.
9. An electronic device, characterized in that the electronic device comprises a memory for storing a computer program and a processor for executing the computer program to cause the electronic device to perform the blockchain based communication method of any one of claims 1 to 5.
10. A readable storage medium, having stored thereon computer program instructions, which when read and executed by a processor, perform the blockchain-based communication method according to any one of claims 1 to 5.
CN202010639151.7A 2020-07-02 2020-07-02 Communication method and device based on block chain Active CN111787020B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010639151.7A CN111787020B (en) 2020-07-02 2020-07-02 Communication method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010639151.7A CN111787020B (en) 2020-07-02 2020-07-02 Communication method and device based on block chain

Publications (2)

Publication Number Publication Date
CN111787020A true CN111787020A (en) 2020-10-16
CN111787020B CN111787020B (en) 2023-04-14

Family

ID=72759552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010639151.7A Active CN111787020B (en) 2020-07-02 2020-07-02 Communication method and device based on block chain

Country Status (1)

Country Link
CN (1) CN111787020B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357262A (en) * 2015-09-29 2016-02-24 小米科技有限责任公司 Device control method and device control apparatus
CN106533861A (en) * 2016-11-18 2017-03-22 郑州信大捷安信息技术股份有限公司 Security control system and authentication method of smart home Internet of Things
CN106850664A (en) * 2017-02-28 2017-06-13 重庆步航科技有限公司 Internet-of-things terminal method of controlling security and its system based on intelligent mobile terminal
CN107026874A (en) * 2017-06-02 2017-08-08 李维刚 One kind instruction signature and verification method and system
CN107659536A (en) * 2016-07-25 2018-02-02 中兴通讯股份有限公司 A kind of method, apparatus and system of application block chain
CN108809625A (en) * 2018-05-21 2018-11-13 爱图智能(深圳)有限公司 A kind of intelligent home control system based on block chain, method and device
US20180343251A1 (en) * 2017-11-16 2018-11-29 Qingdao Hisense Electronics Co., Ltd. Processing method and apparatus for remote assistance
CN109167822A (en) * 2018-08-14 2019-01-08 众安信息技术服务有限公司 A kind of internet of things equipment control method and system based on block chain
CN109587164A (en) * 2018-12-27 2019-04-05 深圳市元征科技股份有限公司 A kind of information encrypting transmission method, device, equipment and storage medium
CN109756579A (en) * 2019-03-05 2019-05-14 深圳众享互联科技有限公司 A kind of Internet of Things Information Secure Transmission System and transmission method based on block chain
US20190297134A1 (en) * 2011-01-08 2019-09-26 N99 Llc Remote control authority and authentication
CN111163034A (en) * 2018-10-22 2020-05-15 北京京东尚科信息技术有限公司 Block chain network, electronic lock control method thereof, terminal device and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190297134A1 (en) * 2011-01-08 2019-09-26 N99 Llc Remote control authority and authentication
CN105357262A (en) * 2015-09-29 2016-02-24 小米科技有限责任公司 Device control method and device control apparatus
CN107659536A (en) * 2016-07-25 2018-02-02 中兴通讯股份有限公司 A kind of method, apparatus and system of application block chain
CN106533861A (en) * 2016-11-18 2017-03-22 郑州信大捷安信息技术股份有限公司 Security control system and authentication method of smart home Internet of Things
CN106850664A (en) * 2017-02-28 2017-06-13 重庆步航科技有限公司 Internet-of-things terminal method of controlling security and its system based on intelligent mobile terminal
CN107026874A (en) * 2017-06-02 2017-08-08 李维刚 One kind instruction signature and verification method and system
US20180343251A1 (en) * 2017-11-16 2018-11-29 Qingdao Hisense Electronics Co., Ltd. Processing method and apparatus for remote assistance
CN108809625A (en) * 2018-05-21 2018-11-13 爱图智能(深圳)有限公司 A kind of intelligent home control system based on block chain, method and device
CN109167822A (en) * 2018-08-14 2019-01-08 众安信息技术服务有限公司 A kind of internet of things equipment control method and system based on block chain
CN111163034A (en) * 2018-10-22 2020-05-15 北京京东尚科信息技术有限公司 Block chain network, electronic lock control method thereof, terminal device and storage medium
CN109587164A (en) * 2018-12-27 2019-04-05 深圳市元征科技股份有限公司 A kind of information encrypting transmission method, device, equipment and storage medium
CN109756579A (en) * 2019-03-05 2019-05-14 深圳众享互联科技有限公司 A kind of Internet of Things Information Secure Transmission System and transmission method based on block chain

Also Published As

Publication number Publication date
CN111787020B (en) 2023-04-14

Similar Documents

Publication Publication Date Title
CN107249009B (en) Data verification method and system based on block chain
CN111201749B (en) Method and system for secure data communication
CN111489159B (en) Data processing method, device, computer equipment and medium
CN111010372A (en) Block chain network identity authentication system, data processing method and gateway equipment
CN108377272B (en) Method and system for managing terminal of Internet of things
CN111490878B (en) Key generation method, device, equipment and medium
CN106576043A (en) Virally distributable trusted messaging
CN102780698A (en) User terminal safety communication method in platform of Internet of Things
CN110601815B (en) Block chain data processing method and equipment
CN110071807B (en) Block chain point-to-point node authentication method, system and computer readable storage medium
CN112989426B (en) Authorization authentication method and device, and resource access token acquisition method
CN110149323B (en) Processing device with ten-million-level TPS (platform secure protocol) contract processing capacity
Urien Towards secure elements for trusted transactions in blockchain and blochchain IoT (BIoT) Platforms. Invited paper
CN111541776A (en) Safe communication device and system based on Internet of things equipment
CN104639328A (en) GOOSE message authentication method and GOOSE (Generic Object Oriented Substation Event) message authentication system
CN105162592B (en) A kind of method and system of certification wearable device
CN104639330B (en) A kind of GOOSE message completeness certification method
CN105100116A (en) Efficient and safe power data interaction method in wireless communication mode
CN113904854A (en) Block chain data encryption method and device based on quotient secret algorithm
CN109005187A (en) A kind of communication information guard method and device
CN111787020B (en) Communication method and device based on block chain
CN109327475B (en) Multi-layer identity authentication method, device, equipment and storage medium
CN111597537A (en) Block chain network-based certificate issuing method, related equipment and medium
CN110944052A (en) File transmission method, device, system, electronic equipment and storage medium
CN103823691A (en) Wireless sensor network security online reprogramming method based on network coding

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