A kind of home control network communication protocol of encryption
Affiliated technical field
The present invention relates to computer information processing field, be specifically related to the home control network communication protocol for a main frame of industry and a kind of encryption of a plurality of slaves, for solving encryption and the signal head-on collision problem of wireless signal.
Background technology
Wireless widespread adoption enters our society, and wireless application now exists a lot of problems: 1) signal is not encrypted, if there is a machine that frequency range is identical, just can receive content, can also revise and send information.By the signal of encrypting, even if there is intentional monitoring, because there is no password, so do not know the content sent.2) signal head-on collision, in the place of wireless signal complexity, the situation that signal is often disturbed in addition, by the comparison of principal and subordinate address and verification, can avoid the head-on collision problem of signal.
Summary of the invention:
In order to have realized wireless signal, encrypt and avoid signal head-on collision problem, the present invention adopts the scheme of following technology:
1) main frame transmitted signal, all slaves receive signal,
The signal frame basic format of main frame:
Header |
Data field |
Telegram end |
Pro |
Data |
Pro1 |
Pro: length is 2 bytes.
Data: length is the integral multiple of 16 bytes is the data content of encrypting through main frame.
Pro1: length is 1 byte.
2) slave data decryption territory,
Slave, after data field deciphering, just has 4 groups of following territories to form:
The hardware address of main frame |
Slave addresses territory |
Functional domain |
Verification territory |
Masteraddress |
Slaveaddress |
Func |
Crc |
Masteraddress: the hardware address of main frame, 8 bytes.
Slaveaddress: slave addresses, 7 bytes.
Func: indicate the command context of this frame, the integral multiple of 16 bytes.
The CRC check result of Crc:1 byte, the hardware address that test range is main frame, slave addresses territory, functional domain.
3) target slave sends Echo Frame, and Echo Frame is that length is the integral multiple of 16 bytes, the data content of encrypting for slave.Echo Frame consists of 4 groups of following territories before encrypting:
The hardware address of main frame |
Slave addresses territory |
Functional domain |
Verification territory |
Masteraddress |
Slaveaddress |
Func |
Crc |
Masteraddress: the hardware address of main frame, 8 bytes.
Slaveaddress: slave addresses, 7 bytes.
Func: indicate the command context of this frame, the integral multiple of 16 bytes.
The CRC check result of Crc:1 byte, the hardware address that test range is main frame, slave addresses territory, functional domain.
Compared with prior art, tool has the following advantages and beneficial effect in the present invention:
1) the present invention realizes wireless signal encryption, prevents from monitoring.
2) can be operated in complex environment, avoid signal head-on collision.
Accompanying drawing explanation
Fig. 1 is that the data packet coding form schematic diagram that sends of the main frame of data communication and slave are the data packet coding form schematic diagram after data field deciphering.
Fig. 2 is the front coded format schematic diagram of the slave Data Packet Encryption of data communication.
Fig. 3 is workflow diagram.
Illustrate the workflow of agreement below:
1) information encryption that main frame will send.
2) main frame sends packet, and all slaves receive packet.
3) slave decrypted data packet, unties data field by password.
4) slave obtains 4 groups of territories: the hardware address of main frame, slave addresses territory, functional domain, verification territory.
5) whether slave comes inspection message correct according to verification territory, if verification is not to just losing.
6) main frame is not received Echo Frame at a fixed time, with regard to retransmission of information.
7) if certain target slave receives information, after deciphering, if verification is correct, and in frame, the hardware address of main frame also meets, and in frame, slave addresses is also correct, just moves in frame and orders, and command result is encrypted and beamed back main frame.
Above-described embodiment is preferably implementation method of the present invention; but embodiments of the present invention portion are restricted to the described embodiments; other any do not deviate from change, the modification done under Spirit Essence of the present invention and principle, substitutes, combination, simplify; all should be equivalent substitute mode, within being included in protection scope of the present invention.