A kind of method and system of coded communicationTechnical field
The present invention relates to the communications field, more particularly to a kind of method and system of coded communication.
Background technology
In the prior art, the coded communication mode of main control device and node is:Both first set up non-encrypted logicalLetter is communicatively coupled, and main control device sends key to node, and node is received after key, keeps originalCommunication type, be encrypted and communicate with main control device.
Because main control device and node are in coded communication, both communication distances farther out, when transmitting key,In the presence of the risk obtained by third party.If when transmitting key, obtaining key by third party, then master control is setThe standby coded communication between node can be decoded by third party, do not reached the effect of encryption, caused secret leakageThe problem of.
The content of the invention
In view of the shortcomings of the prior art, the present invention proposes a kind of method and system of coded communication, it is intended to solveThe problem of transmission key can be obtained by third party before communication is encrypted.
Technical scheme proposed by the present invention is:
A kind of method of coded communication, including the first communication equipment with the first NFC module, methods describedComprise the following steps:
First NFC module is touched, is set up and the first communication equipment NFC communication;
According to the NFC communication, obtain and the key information needed for the first communication equipment coded communication;
According to the key information, set up and the first communication equipment coded communication.
Further, the key information of first communication equipment generates for stochastic and dynamic.
Further, according to the key information, set up with after the first communication equipment coded communication,If disconnecting coded communication, the key information failure of first communication equipment with first communication equipment.
Further, it is described according to the key information, set up and the first communication equipment coded communicationStep, including:
Foundation communicates with first communication equipment first;
In described first communicates, it is encrypted and is communicated with first communication equipment using the key information.
The present invention also provides a kind of method of coded communication, including the with the first NFC module first communication is setIt is standby, it the described method comprises the following steps:
First NFC module is touched, is set up and the first communication equipment NFC communication;
According to the NFC communication, it will be sent with the key information needed for the first communication equipment coded communicationTo first communication equipment;
According to the key information, set up and the first communication equipment coded communication.
The present invention also provides a kind of system of coded communication, including the with the first NFC module first communication is setStandby and the second communication equipment with the second NFC module, second NFC module touches the first NFCModule, second communication equipment is set up to be set with the first communication equipment NFC communication, second communicationIt is standby obtain with the key information needed for the first communication equipment coded communication, second communication equipment according toThe key information, sets up and the first communication equipment coded communication.
Further, the key information of first communication equipment generates for stochastic and dynamic.
Further, according to the key information, second communication equipment is set up and communicated with described firstAfter equipment coded communication, if second communication equipment disconnects coded communication with first communication equipment,The then key information failure of first communication equipment.
Further, second communication equipment is set up and communicated with first communication equipment first, describedIn first communication, second communication equipment is added using the key information and first communication equipmentClose communication.
The present invention also provides a kind of system of coded communication, including the with the first NFC module first communication is setStandby and the second communication equipment with the second NFC module, second NFC module touches the first NFCModule, second communication equipment is set up and the first communication equipment NFC communication, logical according to the NFCLetter, second communication equipment will be sent to the key information needed for the first communication equipment coded communicationFirst communication equipment, second communication equipment is set up and led to described first according to the key informationBelieve equipment coded communication.
According to above-mentioned technical scheme, beneficial effect of the present invention:Utilize NFC short-range communications transmission key letterBreath, because transmission range is very near, it is to avoid the problem of being obtained when transmitting key information by third party, fromAnd the purpose of coded communication is reached, effectively protect confidential information.
Brief description of the drawings
Fig. 1 is a kind of flow chart of the method for the coded communication provided using the embodiment of the present invention one;
Fig. 2 is a kind of flow chart of the method for the coded communication provided using the embodiment of the present invention two;
Fig. 3 is a kind of functional block diagram of the system of the coded communication provided using the embodiment of the present invention three;
Fig. 4 is a kind of functional block diagram of the system of the coded communication provided using the embodiment of the present invention four.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, below in conjunction with accompanying drawing and realityExample is applied, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is onlyOnly to explain the present invention, it is not intended to limit the present invention.
Embodiment one
As shown in figure 1, the embodiment of the present invention proposes a kind of method of coded communication, including with the first NFCFirst communication equipment of module.
It the described method comprises the following steps:
Step S101, the first NFC module of touching, set up and the first communication equipment NFC communication.
Methods described also includes the second communication equipment with the second NFC module, the second NFC module touching theOne NFC module, by the communication of the second NFC module and the first NFC module, makes the second communication equipment and theOne communication equipment sets up NFC communication.
Step S102, according to NFC communication, obtain and the key information needed for the first communication equipment coded communication.
After the second communication equipment and the first communication equipment set up NFC communication, the second communication equipment reads theThe key information of one communication equipment, or, the first communication equipment sends key information to the second communication equipment.The key information is for the information communicated to be encrypted and decrypted.
In the present embodiment, the key information of the first communication equipment is stochastic and dynamic generation.
In another embodiment, carried out according to the key information of the first communication equipment with the first communication equipmentThe EIC equipment identification code generation of the communication equipment of NFC communication.That is, the key information of the first communication equipmentIt is to be generated according to the EIC equipment identification code of the second communication equipment.Carried out in the first NFC module and the second NFC moduleDuring NFC communication, the first communication equipment obtains the EIC equipment identification code of the second communication equipment.
Step S103, according to key information, set up and the first communication equipment coded communication.
According to key information, the second communication equipment and the first communication equipment set up coded communication.
In step s 103, including:
Foundation communicates with the first communication equipment first;
In first communicates, it is encrypted and is communicated with the first communication equipment using key information.
Second communication equipment is set up and communicated with the first communication equipment first, and the first communication and NFC communication type are notTogether, the type of the first communication includes:Zigbee, Z-wave, bluetooth and WIFI.In first communicates, theTwo communication equipments are sent to the first communication equipment according to key information encryption information, and the second communication equipment connectsAfter the encryption information for receiving the first communication equipment, encryption information is decrypted according to key information, therefore,In first communicates, the second communication equipment is encrypted with the first communication equipment and communicated.
When the key information of the first communication equipment generates for stochastic and dynamic, lead to according to key information, secondLetter equipment is set up after coded communication with the first communication equipment, is set if the second communication equipment disconnects communicating with firstThe key information failure of standby coded communication, then the first communication equipment.Communicated in the second communication equipment with firstEquipment is set up before coded communication, it is necessary to obtain the new key information of the first communication equipment again again.
Embodiment two
As shown in Fig. 2 the embodiment of the present invention proposes a kind of method of coded communication, including with the first NFCFirst communication equipment of module.
It the described method comprises the following steps:
Step S101, the first NFC module of touching, set up and the first communication equipment NFC communication.
Methods described also includes the second communication equipment with the second NFC module, the second NFC module touching theOne NFC module, by the communication of the second NFC module and the first NFC module, makes the second communication equipment and theOne communication equipment sets up NFC communication.
Step S102, according to NFC communication, will be sent out with the key information needed for the first communication equipment coded communicationGive the first communication equipment.
After the second communication equipment and the first communication equipment set up NFC communication, the second communication equipment sends closeKey information gives the first communication equipment.The key information is for the information communicated to be encrypted and decrypted.
In the present embodiment, the key information of the second communication equipment is stochastic and dynamic generation.
In another embodiment, the key information of the second communication equipment is known according to the equipment of the first communication equipmentOther code generation.When the first NFC module and the second NFC module carry out NFC communication, the second communication equipment is obtainedTake the EIC equipment identification code of the first communication equipment.
Step S103, according to key information, set up and the first communication equipment coded communication.
According to key information, the second communication equipment and the first communication equipment set up coded communication.
In step s 103, including:
Foundation communicates with the first communication equipment first;
In first communicates, it is encrypted and is communicated with the first communication equipment using key information.
Second communication equipment is set up and communicated with the first communication equipment first, and the first communication and NFC communication type are notTogether, the type of the first communication includes:Zigbee, Z-wave, bluetooth and WIFI.In first communicates, theTwo communication equipments are sent to the first communication equipment according to key information encryption information, and the second communication equipment connectsAfter the encryption information for receiving the first communication equipment, encryption information is decrypted according to key information, therefore,In first communicates, the second communication equipment is encrypted with the first communication equipment and communicated.
When the key information of the second communication equipment generates for stochastic and dynamic, lead to according to key information, secondLetter equipment is set up after coded communication with the first communication equipment, is set if the second communication equipment disconnects communicating with firstThe key information failure of standby coded communication, then the second communication equipment.Communicated in the second communication equipment with firstEquipment is set up before coded communication, it is necessary to send new key information again to the first communication equipment again.
Embodiment three
As shown in figure 3, a kind of method of coded communication in order to realize above-described embodiment one, the present invention is implementedExample also proposes a kind of system of coded communication, including the first communication equipment 1 with the first NFC module 11With the second communication equipment 2 with the second NFC module 21.
Second NFC module 21 touches the first NFC module 11, according to NFC communication, the second communication equipment 2Foundation communicates with the first communication equipment 1NFC.
Second NFC module 21 touches the first NFC module 11, passes through the second NFC module 21 and the first NFCThe communication of module 11, makes the second communication equipment 2 and the first communication equipment 1 set up NFC communication.
Second communication equipment 2 is obtained and the key information needed for the coded communication of the first communication equipment 1.
After the second communication equipment 2 and the first communication equipment 1 set up NFC communication, the second communication equipment 2The key information of the first communication equipment 1 is read, or, the first communication equipment 1 sends key information to secondCommunication equipment 2.The key information is for the information communicated to be encrypted and decrypted.
In the present embodiment, the key information of the first communication equipment 1 is stochastic and dynamic generation.
In another embodiment, enter according to the key information of the first communication equipment 1 with the first communication equipment 1The EIC equipment identification code generation of the communication equipment of row NFC communication.That is, the key of the first communication equipment 1Information is generated according to the EIC equipment identification code of the second communication equipment 2.In the first NFC module 11 and the 2nd NFCWhen module 21 carries out NFC communication, the first communication equipment 1 obtains the EIC equipment identification code of the second communication equipment 2.
Second communication equipment 2 is set up and the coded communication of the first communication equipment 1 according to key information.
Second communication equipment 2 is set up and communicated with the first communication equipment 1 first, in first communicates, and second leads toLetter equipment 2 is encrypted with the first communication equipment 1 using key information and communicated.
Second communication equipment 2 is set up and communicated with the first communication equipment 1 first, the first communication and NFC communication classType is different, and the type of the first communication includes:Zigbee, Z-wave, bluetooth and WIFI.In first communicates,Second communication equipment 2 is sent to the first communication equipment 1, and the second communication according to key information encryption informationEquipment 2 is received after the encryption information of the first communication equipment 1, and encryption information is carried out according to key informationDecryption, therefore, in first communicates, the second communication equipment 2 is encrypted with the first communication equipment 1 and communicated.
When the key information of the first communication equipment 1 generates for stochastic and dynamic, according to key information, secondThe communication equipment 1 of communication equipment 2 and first is set up after coded communication, if the second communication equipment 2 disconnects and theThe key information failure of the coded communication of one communication equipment 1, then the first communication equipment 1.Set in the second communicationStandby 2 and first communication equipment 1 set up again before coded communication, it is necessary to obtain the first communication equipment 1 againNew key information.
Example IV
As shown in figure 4, a kind of method of coded communication in order to realize above-described embodiment two, the present invention is implementedExample also proposes a kind of system of coded communication, including the first communication equipment 1 with the first NFC module 11With the second communication equipment 2 with the second NFC module 21.
Second NFC module 21 touches the first NFC module 11, according to NFC communication, the second communication equipment 2Foundation communicates with the first communication equipment 1NFC.
Second NFC module 21 touches the first NFC module 11, passes through the second NFC module 21 and the first NFCThe communication of module 11, makes the second communication equipment 2 and the first communication equipment 1 set up NFC communication.
Second communication equipment 2 will be sent to first with the key information needed for the coded communication of the first communication equipment 1Communication equipment 1.
After the second communication equipment 2 and the first communication equipment 1 set up NFC communication, the second communication equipment 2Key information is sent to the first communication equipment 1.The key information is for being carried out to the information communicatedEncryption and decryption.
In the present embodiment, the key information of the second communication equipment 2 is stochastic and dynamic generation.
In another embodiment, the key information of the second communication equipment 2 is setting according to the first communication equipment 1Standby identification code generation.When the first NFC module 11 and the second NFC module 21 carry out NFC communication, secondCommunication equipment 2 obtains the EIC equipment identification code of the first communication equipment 1.
Second communication equipment 2 is set up and the coded communication of the first communication equipment 1 according to key information.
Second communication equipment 2 is set up and communicated with the first communication equipment 1 first, in first communicates, and second leads toLetter equipment 2 is encrypted with the first communication equipment 1 using key information and communicated.
Second communication equipment 2 is set up and communicated with the first communication equipment 1 first, the first communication and NFC communication classType is different, and the type of the first communication includes:Zigbee, Z-wave, bluetooth and WIFI.In first communicates,Second communication equipment 2 is sent to the first communication equipment 1, and the second communication according to key information encryption informationEquipment 2 is received after the encryption information of the first communication equipment 1, and encryption information is carried out according to key informationDecryption, therefore, in first communicates, the second communication equipment 2 is encrypted with the first communication equipment 1 and communicated.
When the key information of the second communication equipment 2 generates for stochastic and dynamic, according to key information, secondThe communication equipment 1 of communication equipment 2 and first is set up after coded communication, if the second communication equipment 2 disconnects and theThe key information failure of the coded communication of one communication equipment 1, then the second communication equipment 2.Set in the second communicationStandby 2 and first communication equipment 1 set up again before coded communication, it is necessary to send again new key information toFirst communication equipment 1.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in this hairAny modifications, equivalent substitutions and improvements made within bright spirit and principle etc., should be included in the present inventionProtection domain within.